From patchwork Thu Sep 20 16:20:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11581 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 319E823EFE for ; Thu, 20 Sep 2012 16:20:32 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id B8AF93D0998B for ; Thu, 20 Sep 2012 16:20:30 +0000 (UTC) Received: by iafj25 with SMTP id j25so1759280iaf.11 for ; Thu, 20 Sep 2012 09:20:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=a9YIS1wDrvqDBoI4h56F+E8BU7eTVVGYwve6x0NVLlY=; b=TkcikmpBqRvwK68UpIiCJv0P/IaWZcK7KKBdFX3KZwzNPzmVQF7T708Qv2kyF1clED wKjCx4CVJzDJr5CHEMKNhjXIP2S1dFJ5qaEwpzfdd4+QDeMrwLnh0TzxJ/kQLUG9noEB LhJvCzTo3nn5WFeWAiX7Y2Fkc9Xi/kxD4sNc9Qt8oRXbknluZCCCC2Wm0fzI7ZAuZBrg /ku5joSgoREOh8R86UCqzhchtirzfkumc2xfoUNBrriBLqTkRZ0guD+/QTafaokd91Lk 8QdUepAiJJ7fL+ss8Ki0yMpZV79aG/AxnxgexFIg+njqf5sDVpCBNxgnYDkaxD2nkfnI lvtw== Received: by 10.50.7.212 with SMTP id l20mr2174386iga.43.1348158029849; Thu, 20 Sep 2012 09:20:29 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp84907igc; Thu, 20 Sep 2012 09:20:28 -0700 (PDT) Received: by 10.14.180.68 with SMTP id i44mr2915704eem.20.1348158027629; Thu, 20 Sep 2012 09:20:27 -0700 (PDT) Received: from eu1sys200aog102.obsmtp.com (eu1sys200aog102.obsmtp.com [207.126.144.113]) by mx.google.com with SMTP id y1si4036452eep.138.2012.09.20.09.20.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 09:20:27 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.113; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKUFtCRJZTIvF+6XpCDfG2Vuo7And4wBov@postini.com; Thu, 20 Sep 2012 16:20:26 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 59263AA; Thu, 20 Sep 2012 16:12:02 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 127D5AC0; Thu, 20 Sep 2012 16:20:17 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id CAD5624C07C; Thu, 20 Sep 2012 18:20:07 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 20 Sep 2012 18:20:16 +0200 From: Linus Walleij To: Cc: Anmar Oueja , Linus Walleij Subject: [PATCH] ARM: nomadik/ux500: convert to SPARSE_IRQ Date: Thu, 20 Sep 2012 18:20:12 +0200 Message-ID: <1348158012-424-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnE39xnI8t7eOJe+SmhIYwtr4bZ6C1+2vdhh6e5hf125yonMmtnYe0Uw6+pvkcKHb1wLRE9 From: Linus Walleij This converts the Nomadik and Ux500 over to using sparse IRQ, including some pokes around the pinctrl driver. To avoid referencing unnecessary header files, the plat-nomadik timer driver is augmented to pass an irq number at init time, and the change is applied across both platforms simultaneously for this reason. The change works fine for the Nomadik with it's VIC IRQ controller, whereas the GIC on ux500 complains like this: ------------[ cut here ]------------ WARNING: at /home/elinwal/linux-stericsson/arch/arm/common/gic.c:713 gic_init_bases+0xe8/0x290() Cannot allocate irq_descs @ IRQ16, assuming pre-allocated Modules linked in: [] (unwind_backtrace+0x0/0xf8) from [] (warn_slowpath_common+0x4c/0x64) [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt+0x30/0x40) from [] (gic_init_bases+0xe8/0x290) [] (gic_init_bases+0xe8/0x290) from [] (ux500_init_irq+0xb0/0xfc) [] (ux500_init_irq+0xb0/0xfc) from [] (init_IRQ+0x14/0x1c) [] (init_IRQ+0x14/0x1c) from [] (start_kernel+0x198/0x2ec) [] (start_kernel+0x198/0x2ec) from [<00008044>] (0x8044) ---[ end trace 1b75b31a2719ed1c ]--- This is beacause the .nr_irqs member of the MACHINE descriptor will allocate 0->(number of IRQs on this machine) interrupts. If I understand it correctly, the warning is there to tell you that your platform is in flight for transition to non pre-allocated IRQs, so if we want it to go away completely the .nr_irqs member of the MACHINE descriptor should be zero and all IRQ descriptors allocated dynamically (with or without irq domains as helper). This means changing a few dozed irq_chips for ux500 and needs to happen over time. So I am assuming that the warning message is acceptable for now and applying this anyway. Signed-off-by: Linus Walleij --- arch/arm/Kconfig | 2 ++ arch/arm/mach-nomadik/board-nhk8815.c | 5 +++-- arch/arm/mach-nomadik/include/mach/irqs.h | 2 +- arch/arm/mach-ux500/board-mop500.c | 4 ++++ arch/arm/mach-ux500/cpu-db8500.c | 1 + arch/arm/mach-ux500/devices-common.c | 1 + arch/arm/mach-ux500/devices-db8500.c | 1 + arch/arm/mach-ux500/devices-db8500.h | 1 + arch/arm/mach-ux500/include/mach/irqs.h | 2 +- arch/arm/mach-ux500/timer.c | 2 +- arch/arm/plat-nomadik/include/plat/mtu.h | 2 +- arch/arm/plat-nomadik/timer.c | 4 ++-- drivers/pinctrl/pinctrl-nomadik.c | 1 + 13 files changed, 20 insertions(+), 8 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2f88d8d..bec5d08 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -945,6 +945,7 @@ config ARCH_U8500 select ARCH_HAS_CPUFREQ select HAVE_SMP select MIGHT_HAVE_CACHE_L2X0 + select SPARSE_IRQ help Support for ST-Ericsson's Ux500 architecture @@ -958,6 +959,7 @@ config ARCH_NOMADIK select PINCTRL select MIGHT_HAVE_CACHE_L2X0 select ARCH_REQUIRE_GPIOLIB + select SPARSE_IRQ help Support for the Nomadik platform by ST-Ericsson diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index f4535a7..22b62b8 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -36,6 +35,7 @@ #include #include +#include #include "cpu-8815.h" @@ -260,7 +260,7 @@ static void __init nomadik_timer_init(void) src_cr |= SRC_CR_INIT_VAL; writel(src_cr, io_p2v(NOMADIK_SRC_BASE)); - nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE)); + nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0); } static struct sys_timer nomadik_timer = { @@ -313,6 +313,7 @@ MACHINE_START(NOMADIK, "NHK8815") /* Maintainer: ST MicroElectronics */ .atag_offset = 0x100, .map_io = cpu8815_map_io, + .nr_irqs = NOMADIK_NR_IRQS, .init_irq = cpu8815_init_irq, .handle_irq = vic_handle_irq, .timer = &nomadik_timer, diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h index a118e61..b549d05 100644 --- a/arch/arm/mach-nomadik/include/mach/irqs.h +++ b/arch/arm/mach-nomadik/include/mach/irqs.h @@ -72,7 +72,7 @@ #define NOMADIK_NR_GPIO 128 /* last 4 not wired to pins */ #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + NOMADIK_GPIO_OFFSET) #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - NOMADIK_GPIO_OFFSET) -#define NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) +#define NOMADIK_NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) /* Following two are used by entry_macro.S, to access our dual-vic */ #define VIC_REG_IRQSR0 0 diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index a534d88..f5f979f 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -695,6 +695,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform") /* Maintainer: Srinidhi Kasagar */ .atag_offset = 0x100, .map_io = u8500_map_io, + .nr_irqs = UX500_NR_IRQS, .init_irq = ux500_init_irq, /* we re-use nomadik timer here */ .timer = &ux500_timer, @@ -706,6 +707,7 @@ MACHINE_END MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") .atag_offset = 0x100, .map_io = u8500_map_io, + .nr_irqs = UX500_NR_IRQS, .init_irq = ux500_init_irq, .timer = &ux500_timer, .handle_irq = gic_handle_irq, @@ -716,6 +718,7 @@ MACHINE_END MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") .atag_offset = 0x100, .map_io = u8500_map_io, + .nr_irqs = UX500_NR_IRQS, .init_irq = ux500_init_irq, /* we re-use nomadik timer here */ .timer = &ux500_timer, @@ -845,6 +848,7 @@ static const char * u8500_dt_board_compat[] = { DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") .map_io = u8500_map_io, + .nr_irqs = UX500_NR_IRQS, .init_irq = ux500_init_irq, /* we re-use nomadik timer here */ .timer = &ux500_timer, diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index db3c52d..0a09647 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "devices-db8500.h" #include "ste-dma40-db8500.h" diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index dfdd4a5..0923dbd 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c @@ -15,6 +15,7 @@ #include #include +#include #include "devices-common.h" diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index 91754a8..bec92a7 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c @@ -17,6 +17,7 @@ #include #include +#include #include "ste-dma40-db8500.h" diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h index 3c8010f..4b24c99 100644 --- a/arch/arm/mach-ux500/devices-db8500.h +++ b/arch/arm/mach-ux500/devices-db8500.h @@ -8,6 +8,7 @@ #ifndef __DEVICES_DB8500_H #define __DEVICES_DB8500_H +#include #include "devices-common.h" struct ske_keypad_platform_data; diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h index e892854..fc77b42 100644 --- a/arch/arm/mach-ux500/include/mach/irqs.h +++ b/arch/arm/mach-ux500/include/mach/irqs.h @@ -46,6 +46,6 @@ #include #endif -#define NR_IRQS IRQ_BOARD_END +#define UX500_NR_IRQS IRQ_BOARD_END #endif /* ASM_ARCH_IRQS_H */ diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c index 66e7f00..4395ca5 100644 --- a/arch/arm/mach-ux500/timer.c +++ b/arch/arm/mach-ux500/timer.c @@ -96,7 +96,7 @@ dt_fail: * */ - nmdk_timer_init(mtu_timer_base); + nmdk_timer_init(mtu_timer_base, IRQ_MTU0); clksrc_dbx500_prcmu_init(prcmu_timer_base); ux500_twd_init(); } diff --git a/arch/arm/plat-nomadik/include/plat/mtu.h b/arch/arm/plat-nomadik/include/plat/mtu.h index 582641f..8008897 100644 --- a/arch/arm/plat-nomadik/include/plat/mtu.h +++ b/arch/arm/plat-nomadik/include/plat/mtu.h @@ -1,7 +1,7 @@ #ifndef __PLAT_MTU_H #define __PLAT_MTU_H -void nmdk_timer_init(void __iomem *base); +void nmdk_timer_init(void __iomem *base, int irq); void nmdk_clkevt_reset(void); void nmdk_clksrc_reset(void); diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index 9222e55..0ae2b06 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c @@ -174,7 +174,7 @@ void nmdk_clksrc_reset(void) mtu_base + MTU_CR(0)); } -void __init nmdk_timer_init(void __iomem *base) +void __init nmdk_timer_init(void __iomem *base, int irq) { unsigned long rate; struct clk *clk0; @@ -217,7 +217,7 @@ void __init nmdk_timer_init(void __iomem *base) #endif /* Timer 1 is used for events, register irq and clockevents */ - setup_irq(IRQ_MTU0, &nmdk_timer_irq); + setup_irq(irq, &nmdk_timer_irq); nmdk_clkevt.cpumask = cpumask_of(0); clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU); } diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 3dde653..2844e50 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -35,6 +35,7 @@ #include #include +#include #include "pinctrl-nomadik.h"