diff options
author | Hiroshi Doyu <hdoyu@nvidia.com> | 2013-02-13 12:15:48 -0500 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-03-11 16:29:43 -0400 |
commit | 7469688e832e340a84a1f6d4c290d8680c723256 (patch) | |
tree | 5e201ba31ff58010c8541140ca15bd86204f45fe | |
parent | 84b808da2dea7020211f1d73d015ff6c3ac207c4 (diff) |
ARM: tegra: Unify tegra{20,30,114}_init_early()
Refactored tegra{20,30,114}_init_early() so that we have the unified
tegra_init_early().
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-dt-tegra114.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-dt-tegra20.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-dt-tegra30.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/common.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-tegra/hotplug.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-tegra/sleep.h | 10 |
7 files changed, 21 insertions, 50 deletions
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c index 085d63637b62..08e82941e53c 100644 --- a/arch/arm/mach-tegra/board-dt-tegra114.c +++ b/arch/arm/mach-tegra/board-dt-tegra114.c | |||
@@ -36,7 +36,7 @@ static const char * const tegra114_dt_board_compat[] = { | |||
36 | DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)") | 36 | DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)") |
37 | .smp = smp_ops(tegra_smp_ops), | 37 | .smp = smp_ops(tegra_smp_ops), |
38 | .map_io = tegra_map_common_io, | 38 | .map_io = tegra_map_common_io, |
39 | .init_early = tegra114_init_early, | 39 | .init_early = tegra_init_early, |
40 | .init_irq = tegra_dt_init_irq, | 40 | .init_irq = tegra_dt_init_irq, |
41 | .init_time = clocksource_of_init, | 41 | .init_time = clocksource_of_init, |
42 | .init_machine = tegra114_dt_init, | 42 | .init_machine = tegra114_dt_init, |
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c index a0edf2510280..fca18e9157bd 100644 --- a/arch/arm/mach-tegra/board-dt-tegra20.c +++ b/arch/arm/mach-tegra/board-dt-tegra20.c | |||
@@ -145,7 +145,7 @@ static const char *tegra20_dt_board_compat[] = { | |||
145 | DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)") | 145 | DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)") |
146 | .map_io = tegra_map_common_io, | 146 | .map_io = tegra_map_common_io, |
147 | .smp = smp_ops(tegra_smp_ops), | 147 | .smp = smp_ops(tegra_smp_ops), |
148 | .init_early = tegra20_init_early, | 148 | .init_early = tegra_init_early, |
149 | .init_irq = tegra_dt_init_irq, | 149 | .init_irq = tegra_dt_init_irq, |
150 | .init_time = clocksource_of_init, | 150 | .init_time = clocksource_of_init, |
151 | .init_machine = tegra_dt_init, | 151 | .init_machine = tegra_dt_init, |
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c index bf68567e549d..63f8139879b9 100644 --- a/arch/arm/mach-tegra/board-dt-tegra30.c +++ b/arch/arm/mach-tegra/board-dt-tegra30.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * NVIDIA Tegra30 device tree board support | 4 | * NVIDIA Tegra30 device tree board support |
5 | * | 5 | * |
6 | * Copyright (C) 2011 NVIDIA Corporation | 6 | * Copyright (C) 2011, 2013, NVIDIA Corporation |
7 | * | 7 | * |
8 | * Derived from: | 8 | * Derived from: |
9 | * | 9 | * |
@@ -50,7 +50,7 @@ static const char *tegra30_dt_board_compat[] = { | |||
50 | DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)") | 50 | DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)") |
51 | .smp = smp_ops(tegra_smp_ops), | 51 | .smp = smp_ops(tegra_smp_ops), |
52 | .map_io = tegra_map_common_io, | 52 | .map_io = tegra_map_common_io, |
53 | .init_early = tegra30_init_early, | 53 | .init_early = tegra_init_early, |
54 | .init_irq = tegra_dt_init_irq, | 54 | .init_irq = tegra_dt_init_irq, |
55 | .init_time = clocksource_of_init, | 55 | .init_time = clocksource_of_init, |
56 | .init_machine = tegra30_dt_init, | 56 | .init_machine = tegra30_dt_init, |
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 86851c81a350..60431de585ca 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h | |||
@@ -26,9 +26,7 @@ | |||
26 | 26 | ||
27 | void tegra_assert_system_reset(char mode, const char *cmd); | 27 | void tegra_assert_system_reset(char mode, const char *cmd); |
28 | 28 | ||
29 | void __init tegra20_init_early(void); | 29 | void __init tegra_init_early(void); |
30 | void __init tegra30_init_early(void); | ||
31 | void __init tegra114_init_early(void); | ||
32 | void __init tegra_map_common_io(void); | 30 | void __init tegra_map_common_io(void); |
33 | void __init tegra_init_irq(void); | 31 | void __init tegra_init_irq(void); |
34 | void __init tegra_dt_init_irq(void); | 32 | void __init tegra_dt_init_irq(void); |
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 5449a3f2977b..f0315c95c76d 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c | |||
@@ -94,7 +94,7 @@ static void __init tegra_init_cache(void) | |||
94 | 94 | ||
95 | } | 95 | } |
96 | 96 | ||
97 | static void __init tegra_init_early(void) | 97 | void __init tegra_init_early(void) |
98 | { | 98 | { |
99 | tegra_cpu_reset_handler_init(); | 99 | tegra_cpu_reset_handler_init(); |
100 | tegra_apb_io_init(); | 100 | tegra_apb_io_init(); |
@@ -102,31 +102,9 @@ static void __init tegra_init_early(void) | |||
102 | tegra_init_cache(); | 102 | tegra_init_cache(); |
103 | tegra_pmc_init(); | 103 | tegra_pmc_init(); |
104 | tegra_powergate_init(); | 104 | tegra_powergate_init(); |
105 | tegra_hotplug_init(); | ||
105 | } | 106 | } |
106 | 107 | ||
107 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | ||
108 | void __init tegra20_init_early(void) | ||
109 | { | ||
110 | tegra_init_early(); | ||
111 | tegra20_hotplug_init(); | ||
112 | } | ||
113 | #endif | ||
114 | |||
115 | #ifdef CONFIG_ARCH_TEGRA_3x_SOC | ||
116 | void __init tegra30_init_early(void) | ||
117 | { | ||
118 | tegra_init_early(); | ||
119 | tegra30_hotplug_init(); | ||
120 | } | ||
121 | #endif | ||
122 | |||
123 | #ifdef CONFIG_ARCH_TEGRA_114_SOC | ||
124 | void __init tegra114_init_early(void) | ||
125 | { | ||
126 | tegra_init_early(); | ||
127 | } | ||
128 | #endif | ||
129 | |||
130 | void __init tegra_init_late(void) | 108 | void __init tegra_init_late(void) |
131 | { | 109 | { |
132 | tegra_powergate_debugfs_init(); | 110 | tegra_powergate_debugfs_init(); |
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c index a599f6e36dea..8da9f78475da 100644 --- a/arch/arm/mach-tegra/hotplug.c +++ b/arch/arm/mach-tegra/hotplug.c | |||
@@ -1,8 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * | ||
3 | * Copyright (C) 2002 ARM Ltd. | 2 | * Copyright (C) 2002 ARM Ltd. |
4 | * All Rights Reserved | 3 | * All Rights Reserved |
5 | * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved. | 4 | * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved. |
6 | * | 5 | * |
7 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
@@ -15,6 +14,7 @@ | |||
15 | #include <asm/cacheflush.h> | 14 | #include <asm/cacheflush.h> |
16 | #include <asm/smp_plat.h> | 15 | #include <asm/smp_plat.h> |
17 | 16 | ||
17 | #include "fuse.h" | ||
18 | #include "sleep.h" | 18 | #include "sleep.h" |
19 | 19 | ||
20 | static void (*tegra_hotplug_shutdown)(void); | 20 | static void (*tegra_hotplug_shutdown)(void); |
@@ -56,18 +56,13 @@ int tegra_cpu_disable(unsigned int cpu) | |||
56 | return cpu == 0 ? -EPERM : 0; | 56 | return cpu == 0 ? -EPERM : 0; |
57 | } | 57 | } |
58 | 58 | ||
59 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | 59 | void __init tegra_hotplug_init(void) |
60 | extern void tegra20_hotplug_shutdown(void); | ||
61 | void __init tegra20_hotplug_init(void) | ||
62 | { | 60 | { |
63 | tegra_hotplug_shutdown = tegra20_hotplug_shutdown; | 61 | if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) |
64 | } | 62 | return; |
65 | #endif | ||
66 | 63 | ||
67 | #ifdef CONFIG_ARCH_TEGRA_3x_SOC | 64 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20) |
68 | extern void tegra30_hotplug_shutdown(void); | 65 | tegra_hotplug_shutdown = tegra20_hotplug_shutdown; |
69 | void __init tegra30_hotplug_init(void) | 66 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30) |
70 | { | 67 | tegra_hotplug_shutdown = tegra30_hotplug_shutdown; |
71 | tegra_hotplug_shutdown = tegra30_hotplug_shutdown; | ||
72 | } | 68 | } |
73 | #endif | ||
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h index 4ffae541726e..970ebd5138b9 100644 --- a/arch/arm/mach-tegra/sleep.h +++ b/arch/arm/mach-tegra/sleep.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved. | 2 | * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long); | |||
124 | void tegra_disable_clean_inv_dcache(void); | 124 | void tegra_disable_clean_inv_dcache(void); |
125 | 125 | ||
126 | #ifdef CONFIG_HOTPLUG_CPU | 126 | #ifdef CONFIG_HOTPLUG_CPU |
127 | void tegra20_hotplug_init(void); | 127 | void tegra20_hotplug_shutdown(void); |
128 | void tegra30_hotplug_init(void); | 128 | void tegra30_hotplug_shutdown(void); |
129 | void tegra_hotplug_init(void); | ||
129 | #else | 130 | #else |
130 | static inline void tegra20_hotplug_init(void) {} | 131 | static inline void tegra_hotplug_init(void) {} |
131 | static inline void tegra30_hotplug_init(void) {} | ||
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | void tegra20_cpu_shutdown(int cpu); | 134 | void tegra20_cpu_shutdown(int cpu); |