From patchwork Thu Sep 27 13:14:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11759 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 F37D923EFF for ; Thu, 27 Sep 2012 13:14:25 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4424DA1875E for ; Thu, 27 Sep 2012 13:14:25 +0000 (UTC) Received: by ieje10 with SMTP id e10so4106142iej.11 for ; Thu, 27 Sep 2012 06:14:24 -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=uxbCZ0lWmYJvFG5fQb64HWgC2PSGVeKo5AuMPeGXbCs=; b=ord+gtkqUXNKn0atFIBdfc+LV1/0P2UrCxIBi07VKxs7dla/MApu04gAKv8+mwu8gJ xVbzCgeNwqufvKeUbmnWinga+bi9I4pO8CGBdwiVrcIaz1MHUcOOoDmsHBU/Z0UKQtxx HqhhgyXQaYYR8Y7Yy0BlF1eS13UkowLlx8zh3pChhUqQ71ugSViLkb/xAnx+z5i4OBCo 6o5vcBsPE0X2ntOnJw5qr+DWBKTDqfOoy3dEc71sTmHWNNy+2ImWmJ0ybr5YlFYjDp/S Eubd13jjua2IvV3gaO9vGiwHKXUpfn6m5au8SHujMVHGRLk5x3BxqXqyg8JlgZtgSpc8 ZTJg== Received: by 10.50.184.129 with SMTP id eu1mr3587110igc.0.1348751664697; Thu, 27 Sep 2012 06:14:24 -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 ex8csp414833igc; Thu, 27 Sep 2012 06:14:23 -0700 (PDT) Received: by 10.14.220.8 with SMTP id n8mr5800444eep.19.1348751662652; Thu, 27 Sep 2012 06:14:22 -0700 (PDT) Received: from eu1sys200aog112.obsmtp.com (eu1sys200aog112.obsmtp.com [207.126.144.133]) by mx.google.com with SMTP id z2si5188778eel.32.2012.09.27.06.14.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 06:14:22 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.133 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-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob112.postini.com ([207.126.147.11]) with SMTP ID DSNKUGRRKNDinC9Grvzeg4W/BE8OZhso7v1r@postini.com; Thu, 27 Sep 2012 13:14:22 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 70B6566; Thu, 27 Sep 2012 13:13:40 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 6796963; Thu, 27 Sep 2012 09:03:03 +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 A489724C07C; Thu, 27 Sep 2012 15:14:03 +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, 27 Sep 2012 15:14:10 +0200 From: Linus Walleij To: , Cc: Stephen Warren , Anmar Oueja , Linus Walleij , Lee Jones Subject: [PATCH 4/4] ARM: nomadik/ux500: convert to SPARSE_IRQ Date: Thu, 27 Sep 2012 15:14:07 +0200 Message-ID: <1348751647-17493-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: ALoCoQkniJiSPNog91lnzIJXVbZm3m71mhnHPeQIhUVzFhpKym29dwyxUK4o+BJMy2JE0E9WdGe/ 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. Cc: Lee Jones Signed-off-by: Linus Walleij --- arch/arm/Kconfig | 2 ++ arch/arm/mach-nomadik/board-nhk8815.c | 4 ++-- arch/arm/mach-nomadik/include/mach/irqs.h | 2 +- arch/arm/mach-ux500/board-mop500.c | 1 - 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, 15 insertions(+), 9 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..287b349 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 = { 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..da2fd05 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -1,4 +1,3 @@ - /* * Copyright (C) 2008-2009 ST-Ericsson * 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 6aab107..b8d6e92 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -35,6 +35,7 @@ #include #include +#include #include "pinctrl-nomadik.h"