From patchwork Tue Jul 16 22:17:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 2828337 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9DC909F9CA for ; Tue, 16 Jul 2013 22:19:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FE2220276 for ; Tue, 16 Jul 2013 22:19:58 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 987A820265 for ; Tue, 16 Jul 2013 22:19:56 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzDZw-00021W-IR; Tue, 16 Jul 2013 22:18:41 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzDZe-0001fR-O7; Tue, 16 Jul 2013 22:18:22 +0000 Received: from avon.wwwdotorg.org ([2001:470:1f0f:bd7::2]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UzDZ9-0001bZ-Hx for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2013 22:17:53 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 44A9A6419; Tue, 16 Jul 2013 16:29:50 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 77205E47A4; Tue, 16 Jul 2013 16:17:30 -0600 (MDT) From: Stephen Warren To: Stephen Warren Subject: [PATCH 2/4] ARM: tegra: remove use of CONFIG_ARCH_TEGRA_*_SOC Date: Tue, 16 Jul 2013 16:17:21 -0600 Message-Id: <1374013043-4693-2-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1374013043-4693-1-git-send-email-swarren@wwwdotorg.org> References: <1374013043-4693-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.7 at avon.wwwdotorg.org X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130716_181751_934917_DD00D8C8 X-CRM114-Status: GOOD ( 17.01 ) X-Spam-Score: -2.3 (--) Cc: linux-tegra@vger.kernel.org, Stephen Warren , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Warren Modify code in mach-tegra not to use ARCH_TEGRA_*_SOC, but just ARCH_TEGRA. This simplifies various conditional logic. Signed-off-by: Stephen Warren --- arch/arm/mach-tegra/Kconfig | 2 +- arch/arm/mach-tegra/Makefile | 30 ++++++++++++------------------ arch/arm/mach-tegra/board.h | 2 +- arch/arm/mach-tegra/cpuidle.c | 9 +++------ arch/arm/mach-tegra/fuse.h | 14 -------------- arch/arm/mach-tegra/hotplug.c | 11 ++++++++--- arch/arm/mach-tegra/platsmp.c | 12 +++++++----- arch/arm/mach-tegra/pm.c | 6 ++---- arch/arm/mach-tegra/reset-handler.S | 16 ++-------------- arch/arm/mach-tegra/sleep.h | 6 ------ arch/arm/mach-tegra/tegra.c | 3 +-- 11 files changed, 37 insertions(+), 74 deletions(-) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 44cb28c..9a4ec62 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -54,7 +54,7 @@ config ARCH_TEGRA_114_SOC config TEGRA_PCI bool "PCI Express support" - depends on ARCH_TEGRA_2x_SOC + depends on ARCH_TEGRA select PCI config TEGRA_AHB diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index 98b184e..efb1e01 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -14,27 +14,21 @@ obj-y += reset-handler.o obj-y += sleep.o obj-y += tegra.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.o -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-tegra20.o -ifeq ($(CONFIG_CPU_IDLE),y) -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += cpuidle-tegra20.o -endif -obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_speedo.o -obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-tegra30.o -ifeq ($(CONFIG_CPU_IDLE),y) -obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += cpuidle-tegra30.o -endif +obj-y += tegra20_speedo.o +obj-y += tegra2_emc.o +obj-y += sleep-tegra20.o +obj-$(CONFIG_CPU_IDLE) += cpuidle-tegra20.o +obj-y += tegra30_speedo.o +obj-y += sleep-tegra30.o +obj-$(CONFIG_CPU_IDLE) += cpuidle-tegra30.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_TEGRA_PCI) += pcie.o -obj-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra114_speedo.o -obj-$(CONFIG_ARCH_TEGRA_114_SOC) += sleep-tegra30.o -ifeq ($(CONFIG_CPU_IDLE),y) -obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o -endif +obj-y += tegra114_speedo.o +obj-y += sleep-tegra30.o +obj-$(CONFIG_CPU_IDLE) += cpuidle-tegra114.o -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o +obj-y += board-harmony-pcie.o -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o +obj-y += board-paz00.o diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 9a6659f..e86604f 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -42,7 +42,7 @@ static inline int tegra_clk_debugfs_init(void) { return 0; } #endif int __init tegra_powergate_init(void); -#if defined(CONFIG_ARCH_TEGRA_2x_SOC) && defined(CONFIG_DEBUG_FS) +#if defined(CONFIG_DEBUG_FS) int __init tegra_powergate_debugfs_init(void); #else static inline int tegra_powergate_debugfs_init(void) { return 0; } diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c index e85973c..44bad5d 100644 --- a/arch/arm/mach-tegra/cpuidle.c +++ b/arch/arm/mach-tegra/cpuidle.c @@ -31,16 +31,13 @@ void __init tegra_cpuidle_init(void) { switch (tegra_chip_id) { case TEGRA20: - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) - tegra20_cpuidle_init(); + tegra20_cpuidle_init(); break; case TEGRA30: - if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) - tegra30_cpuidle_init(); + tegra30_cpuidle_init(); break; case TEGRA114: - if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC)) - tegra114_cpuidle_init(); + tegra114_cpuidle_init(); break; } } diff --git a/arch/arm/mach-tegra/fuse.h b/arch/arm/mach-tegra/fuse.h index def7968..e589322 100644 --- a/arch/arm/mach-tegra/fuse.h +++ b/arch/arm/mach-tegra/fuse.h @@ -56,23 +56,9 @@ void tegra_init_fuse(void); bool tegra_spare_fuse(int bit); u32 tegra_fuse_readl(unsigned long offset); -#ifdef CONFIG_ARCH_TEGRA_2x_SOC void tegra20_init_speedo_data(void); -#else -static inline void tegra20_init_speedo_data(void) {} -#endif - -#ifdef CONFIG_ARCH_TEGRA_3x_SOC void tegra30_init_speedo_data(void); -#else -static inline void tegra30_init_speedo_data(void) {} -#endif - -#ifdef CONFIG_ARCH_TEGRA_114_SOC void tegra114_init_speedo_data(void); -#else -static inline void tegra114_init_speedo_data(void) {} -#endif #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c index a52c10e..8b79d83 100644 --- a/arch/arm/mach-tegra/hotplug.c +++ b/arch/arm/mach-tegra/hotplug.c @@ -62,10 +62,15 @@ void __init tegra_hotplug_init(void) if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) return; - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20) + switch (tegra_chip_id) { + case TEGRA20: tegra_hotplug_shutdown = tegra20_hotplug_shutdown; - if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30) + break; + case TEGRA30: tegra_hotplug_shutdown = tegra30_hotplug_shutdown; - if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114) + break; + case TEGRA114: tegra_hotplug_shutdown = tegra30_hotplug_shutdown; + break; + } } diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c index 97b33a2..b76a5d8 100644 --- a/arch/arm/mach-tegra/platsmp.c +++ b/arch/arm/mach-tegra/platsmp.c @@ -170,14 +170,16 @@ static int tegra114_boot_secondary(unsigned int cpu, struct task_struct *idle) static int tegra_boot_secondary(unsigned int cpu, struct task_struct *idle) { - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20) + switch (tegra_chip_id) { + case TEGRA20: return tegra20_boot_secondary(cpu, idle); - if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30) + case TEGRA30: return tegra30_boot_secondary(cpu, idle); - if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114) + case TEGRA114: return tegra114_boot_secondary(cpu, idle); - - return -EINVAL; + default: + return -EINVAL; + } } static void __init tegra_smp_prepare_cpus(unsigned int max_cpus) diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 261fec1..cae6894 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -48,12 +48,10 @@ static void tegra_tear_down_cpu_init(void) { switch (tegra_chip_id) { case TEGRA20: - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) - tegra_tear_down_cpu = tegra20_tear_down_cpu; + tegra_tear_down_cpu = tegra20_tear_down_cpu; break; case TEGRA30: - if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) - tegra_tear_down_cpu = tegra30_tear_down_cpu; + tegra_tear_down_cpu = tegra30_tear_down_cpu; break; } } diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S index 39dc9e78..57fafb7 100644 --- a/arch/arm/mach-tegra/reset-handler.S +++ b/arch/arm/mach-tegra/reset-handler.S @@ -123,10 +123,9 @@ ENTRY(__tegra_cpu_reset_handler) cpsid aif, 0x13 @ SVC mode, interrupts disabled tegra_get_soc_id TEGRA_APB_MISC_BASE, r6 -#ifdef CONFIG_ARCH_TEGRA_2x_SOC t20_check: cmp r6, #TEGRA20 - bne after_t20_check + bne t30_check t20_errata: # Tegra20 is a Cortex-A9 r1p1 mrc p15, 0, r0, c1, c0, 0 @ read system control register @@ -137,12 +136,9 @@ t20_errata: orr r0, r0, #1 << 11 @ erratum 751472 mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register b after_errata -after_t20_check: -#endif -#ifdef CONFIG_ARCH_TEGRA_3x_SOC t30_check: cmp r6, #TEGRA30 - bne after_t30_check + bne after_errata t30_errata: # Tegra30 is a Cortex-A9 r2p9 mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register @@ -150,8 +146,6 @@ t30_errata: orr r0, r0, #1 << 11 @ erratum 751472 mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register b after_errata -after_t30_check: -#endif after_errata: mrc p15, 0, r10, c0, c0, 5 @ MPIDR and r10, r10, #0x3 @ R10 = CPU number @@ -166,7 +160,6 @@ after_errata: bleq __die @ CPU not present (to OS) #endif -#ifdef CONFIG_ARCH_TEGRA_2x_SOC /* Are we on Tegra20? */ cmp r6, #TEGRA20 bne 1f @@ -176,7 +169,6 @@ after_errata: cmp r10, #0 strne r0, [r5, #PMC_SCRATCH41] 1: -#endif /* Waking up from LP2? */ ldr r9, [r12, #RESET_DATA(MASK_LP2)] @@ -221,13 +213,10 @@ __die: cmp r6, #TEGRA20 bne 1f -#ifdef CONFIG_ARCH_TEGRA_2x_SOC mov32 r0, 0x1111 mov r1, r0, lsl r10 str r1, [r7, #0x340] @ CLK_RST_CPU_CMPLX_SET -#endif 1: -#ifdef CONFIG_ARCH_TEGRA_3x_SOC mov32 r6, TEGRA_FLOW_CTRL_BASE cmp r10, #0 @@ -257,7 +246,6 @@ __die: mov r0, r11, lsl #8 str r0, [r7, #348] @ CLK_CPU_CMPLX_SET -#endif /* If the CPU still isn't dead, just spin here. */ b . diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h index 98b7da6..461ff1b 100644 --- a/arch/arm/mach-tegra/sleep.h +++ b/arch/arm/mach-tegra/sleep.h @@ -35,11 +35,9 @@ #define PMC_SCRATCH39 0x138 #define PMC_SCRATCH41 0x140 -#ifdef CONFIG_ARCH_TEGRA_2x_SOC #define CPU_RESETTABLE 2 #define CPU_RESETTABLE_SOON 1 #define CPU_NOT_RESETTABLE 0 -#endif #ifdef __ASSEMBLY__ /* returns the offset of the flow controller halt register for a cpu */ @@ -157,11 +155,7 @@ static inline void tegra_hotplug_init(void) {} void tegra20_cpu_shutdown(int cpu); int tegra20_cpu_is_resettable_soon(void); void tegra20_cpu_clear_resettable(void); -#ifdef CONFIG_ARCH_TEGRA_2x_SOC void tegra20_cpu_set_resettable_soon(void); -#else -static inline void tegra20_cpu_set_resettable_soon(void) {} -#endif int tegra20_sleep_cpu_secondary_finish(unsigned long); void tegra20_tear_down_cpu(void); diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index fc97cfd..5334252 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c @@ -104,8 +104,7 @@ static void __init harmony_init(void) static void __init paz00_init(void) { - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) - tegra_paz00_wifikill_init(); + tegra_paz00_wifikill_init(); } static struct {