From d2ffb918f74bf6f596209491babde9df0c7fb4b8 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Sat, 9 Feb 2013 17:45:28 -0800 Subject: [PATCH 1/3] ARM: tegra: Fix build error w/ ARCH_TEGRA_114_SOC w/o ARCH_TEGRA_3x_SOC This patch fixes the build error when ARCH_TEGRA_114_SOC is enabled and ARCH_TEGRA_3x_SOC is disabled. This provides Tegra114 with its own tegra114_init_early() instead of making use of tegra30_init_early() so that T114 build doesn't depend on T3x anymore. Signed-off-by: Hiroshi Doyu Acked-by: Stephen Warren Signed-off-by: Olof Johansson --- arch/arm/mach-tegra/board-dt-tegra114.c | 2 +- arch/arm/mach-tegra/board.h | 2 ++ arch/arm/mach-tegra/common.c | 33 ++++++++++++++++--------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c index 3ed17ce884df..b920df1b69fa 100644 --- a/arch/arm/mach-tegra/board-dt-tegra114.c +++ b/arch/arm/mach-tegra/board-dt-tegra114.c @@ -37,7 +37,7 @@ static const char * const tegra114_dt_board_compat[] = { DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)") .smp = smp_ops(tegra_smp_ops), .map_io = tegra_map_common_io, - .init_early = tegra30_init_early, + .init_early = tegra114_init_early, .init_irq = tegra_dt_init_irq, .handle_irq = gic_handle_irq, .init_time = clocksource_of_init, diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index da8f5a3c4240..86851c81a350 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -1,6 +1,7 @@ /* * arch/arm/mach-tegra/board.h * + * Copyright (c) 2013 NVIDIA Corporation. All rights reserved. * Copyright (C) 2010 Google, Inc. * * Author: @@ -27,6 +28,7 @@ void tegra_assert_system_reset(char mode, const char *cmd); void __init tegra20_init_early(void); void __init tegra30_init_early(void); +void __init tegra114_init_early(void); void __init tegra_map_common_io(void); void __init tegra_init_irq(void); void __init tegra_dt_init_irq(void); diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 2f1351359a35..427045b9dfb1 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -1,6 +1,7 @@ /* * arch/arm/mach-tegra/common.c * + * Copyright (c) 2013 NVIDIA Corporation. All rights reserved. * Copyright (C) 2010 Google, Inc. * * Author: @@ -100,31 +101,39 @@ static void __init tegra_init_cache(void) } +static void __init tegra_init_early(void) +{ + tegra_cpu_reset_handler_init(); + tegra_apb_io_init(); + tegra_init_fuse(); + tegra_init_cache(); + tegra_pmc_init(); + tegra_powergate_init(); +} + #ifdef CONFIG_ARCH_TEGRA_2x_SOC void __init tegra20_init_early(void) { - tegra_cpu_reset_handler_init(); - tegra_apb_io_init(); - tegra_init_fuse(); - tegra_init_cache(); - tegra_pmc_init(); - tegra_powergate_init(); + tegra_init_early(); tegra20_hotplug_init(); } #endif + #ifdef CONFIG_ARCH_TEGRA_3x_SOC void __init tegra30_init_early(void) { - tegra_cpu_reset_handler_init(); - tegra_apb_io_init(); - tegra_init_fuse(); - tegra_init_cache(); - tegra_pmc_init(); - tegra_powergate_init(); + tegra_init_early(); tegra30_hotplug_init(); } #endif +#ifdef CONFIG_ARCH_TEGRA_114_SOC +void __init tegra114_init_early(void) +{ + tegra_init_early(); +} +#endif + void __init tegra_init_late(void) { tegra_powergate_debugfs_init(); From 23c8c4b4e0ae21852e366206aa4981380b863799 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 7 Feb 2013 14:43:23 -0700 Subject: [PATCH 2/3] ARM: tegra: enable ARCH_REQUIRE_GPIOLIB for Tegra114 CONFIG_ARCH_TEGRA_114_SOC doesn't currently enable gpiolib, which causes numerous build problems building a Tegra kernel with only Tegra114 enabled, and not Tegra20 or Tegra30. Enable ARCH_REQUIRE_GPIOLIB to solve this. However, all Tegra will use gpiolib, so select this option from ARCH_TEGRA rather than each individual ARCH_TEGRA_*_SOC, to prevent this problem for any future chips. Signed-off-by: Stephen Warren Signed-off-by: Olof Johansson --- arch/arm/Kconfig | 1 + arch/arm/mach-tegra/Kconfig | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index eb9fc2f8acf1..25541a1971aa 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -640,6 +640,7 @@ config ARCH_LPC32XX config ARCH_TEGRA bool "NVIDIA Tegra" select ARCH_HAS_CPUFREQ + select ARCH_REQUIRE_GPIOLIB select CLKDEV_LOOKUP select CLKSRC_MMIO select CLKSRC_OF diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index bde8197c8db8..86543241f5bb 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -5,7 +5,6 @@ comment "NVIDIA Tegra options" config ARCH_TEGRA_2x_SOC bool "Enable support for Tegra20 family" select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP - select ARCH_REQUIRE_GPIOLIB select ARM_ERRATA_720789 select ARM_ERRATA_742230 if SMP select ARM_ERRATA_751472 @@ -27,7 +26,6 @@ config ARCH_TEGRA_2x_SOC config ARCH_TEGRA_3x_SOC bool "Enable support for Tegra30 family" - select ARCH_REQUIRE_GPIOLIB select ARM_ERRATA_743622 select ARM_ERRATA_751472 select ARM_ERRATA_754322 From 1d7e5c2c815dda6eb7a0e41a6b27ea61cd927f99 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 7 Feb 2013 14:43:24 -0700 Subject: [PATCH 3/3] ARM: tegra: sort Kconfig selects for Tegra114 The Kconfig options selected by ARCH_TEGRA_*_SOC were recently sorted. Update the newly added ARCH_TEGRA_114_SOC's select statements to match. Signed-off-by: Stephen Warren Signed-off-by: Olof Johansson --- arch/arm/mach-tegra/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 86543241f5bb..d1c4893894ce 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -45,10 +45,10 @@ config ARCH_TEGRA_3x_SOC config ARCH_TEGRA_114_SOC bool "Enable support for Tegra114 family" - select ARM_GIC - select CPU_V7 - select ARM_L1_CACHE_SHIFT_6 select ARM_ARCH_TIMER + select ARM_GIC + select ARM_L1_CACHE_SHIFT_6 + select CPU_V7 select PINCTRL select PINCTRL_TEGRA114 help