aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter De Schrijver <pdeschrijver@nvidia.com>2011-12-14 10:03:17 -0500
committerOlof Johansson <olof@lixom.net>2011-12-17 23:15:13 -0500
commitc37c07ddf26910f39cdc55df54640439d3a38083 (patch)
tree8370726d13d713b156472e68b94831296c09c1a1
parent8e4fab2c39b2db774e41553646788599cfdac9df (diff)
arm/tegra: prepare early init for multiple tegra variants
This patch splits the early init code in a common and a tegra20 specific part. Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Acked-by: Stephen Warren <swarren@nvidia.com> Acked-by: Colin Cross <ccross@android.com> Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-tegra/board-dt.c19
-rw-r--r--arch/arm/mach-tegra/board-harmony.c2
-rw-r--r--arch/arm/mach-tegra/board-paz00.c2
-rw-r--r--arch/arm/mach-tegra/board-seaboard.c6
-rw-r--r--arch/arm/mach-tegra/board-trimslice.c2
-rw-r--r--arch/arm/mach-tegra/board.h3
-rw-r--r--arch/arm/mach-tegra/common.c27
7 files changed, 34 insertions, 27 deletions
diff --git a/arch/arm/mach-tegra/board-dt.c b/arch/arm/mach-tegra/board-dt.c
index c21863d6425d..ddaa037be028 100644
--- a/arch/arm/mach-tegra/board-dt.c
+++ b/arch/arm/mach-tegra/board-dt.c
@@ -53,17 +53,6 @@ void seaboard_pinmux_init(void);
53void trimslice_pinmux_init(void); 53void trimslice_pinmux_init(void);
54void ventana_pinmux_init(void); 54void ventana_pinmux_init(void);
55 55
56static const struct of_device_id tegra_dt_irq_match[] __initconst = {
57 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
58 { }
59};
60
61void __init tegra_dt_init_irq(void)
62{
63 tegra_init_irq();
64 of_irq_init(tegra_dt_irq_match);
65}
66
67struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { 56struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
68 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL), 57 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL),
69 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC2_BASE, "sdhci-tegra.1", NULL), 58 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC2_BASE, "sdhci-tegra.1", NULL),
@@ -139,7 +128,7 @@ static void __init tegra_dt_init(void)
139 "Unknown platform! Pinmuxing not initialized\n"); 128 "Unknown platform! Pinmuxing not initialized\n");
140} 129}
141 130
142static const char * tegra_dt_board_compat[] = { 131static const char *tegra20_dt_board_compat[] = {
143 "compulab,trimslice", 132 "compulab,trimslice",
144 "nvidia,harmony", 133 "nvidia,harmony",
145 "compal,paz00", 134 "compal,paz00",
@@ -148,12 +137,12 @@ static const char * tegra_dt_board_compat[] = {
148 NULL 137 NULL
149}; 138};
150 139
151DT_MACHINE_START(TEGRA_DT, "nVidia Tegra (Flattened Device Tree)") 140DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
152 .map_io = tegra_map_common_io, 141 .map_io = tegra_map_common_io,
153 .init_early = tegra_init_early, 142 .init_early = tegra20_init_early,
154 .init_irq = tegra_dt_init_irq, 143 .init_irq = tegra_dt_init_irq,
155 .handle_irq = gic_handle_irq, 144 .handle_irq = gic_handle_irq,
156 .timer = &tegra_timer, 145 .timer = &tegra_timer,
157 .init_machine = tegra_dt_init, 146 .init_machine = tegra_dt_init,
158 .dt_compat = tegra_dt_board_compat, 147 .dt_compat = tegra20_dt_board_compat,
159MACHINE_END 148MACHINE_END
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index fd190a8dc665..d60a0d45f2f7 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -186,7 +186,7 @@ MACHINE_START(HARMONY, "harmony")
186 .atag_offset = 0x100, 186 .atag_offset = 0x100,
187 .fixup = tegra_harmony_fixup, 187 .fixup = tegra_harmony_fixup,
188 .map_io = tegra_map_common_io, 188 .map_io = tegra_map_common_io,
189 .init_early = tegra_init_early, 189 .init_early = tegra20_init_early,
190 .init_irq = tegra_init_irq, 190 .init_irq = tegra_init_irq,
191 .handle_irq = gic_handle_irq, 191 .handle_irq = gic_handle_irq,
192 .timer = &tegra_timer, 192 .timer = &tegra_timer,
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
index 0b7e1cfee70d..e68b40727e6d 100644
--- a/arch/arm/mach-tegra/board-paz00.c
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -189,7 +189,7 @@ MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
189 .atag_offset = 0x100, 189 .atag_offset = 0x100,
190 .fixup = tegra_paz00_fixup, 190 .fixup = tegra_paz00_fixup,
191 .map_io = tegra_map_common_io, 191 .map_io = tegra_map_common_io,
192 .init_early = tegra_init_early, 192 .init_early = tegra20_init_early,
193 .init_irq = tegra_init_irq, 193 .init_irq = tegra_init_irq,
194 .handle_irq = gic_handle_irq, 194 .handle_irq = gic_handle_irq,
195 .timer = &tegra_timer, 195 .timer = &tegra_timer,
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index 7328379b1356..b79f9ce9941c 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -283,7 +283,7 @@ static void __init tegra_wario_init(void)
283MACHINE_START(SEABOARD, "seaboard") 283MACHINE_START(SEABOARD, "seaboard")
284 .atag_offset = 0x100, 284 .atag_offset = 0x100,
285 .map_io = tegra_map_common_io, 285 .map_io = tegra_map_common_io,
286 .init_early = tegra_init_early, 286 .init_early = tegra20_init_early,
287 .init_irq = tegra_init_irq, 287 .init_irq = tegra_init_irq,
288 .handle_irq = gic_handle_irq, 288 .handle_irq = gic_handle_irq,
289 .timer = &tegra_timer, 289 .timer = &tegra_timer,
@@ -293,7 +293,7 @@ MACHINE_END
293MACHINE_START(KAEN, "kaen") 293MACHINE_START(KAEN, "kaen")
294 .atag_offset = 0x100, 294 .atag_offset = 0x100,
295 .map_io = tegra_map_common_io, 295 .map_io = tegra_map_common_io,
296 .init_early = tegra_init_early, 296 .init_early = tegra20_init_early,
297 .init_irq = tegra_init_irq, 297 .init_irq = tegra_init_irq,
298 .handle_irq = gic_handle_irq, 298 .handle_irq = gic_handle_irq,
299 .timer = &tegra_timer, 299 .timer = &tegra_timer,
@@ -303,7 +303,7 @@ MACHINE_END
303MACHINE_START(WARIO, "wario") 303MACHINE_START(WARIO, "wario")
304 .atag_offset = 0x100, 304 .atag_offset = 0x100,
305 .map_io = tegra_map_common_io, 305 .map_io = tegra_map_common_io,
306 .init_early = tegra_init_early, 306 .init_early = tegra20_init_early,
307 .init_irq = tegra_init_irq, 307 .init_irq = tegra_init_irq,
308 .handle_irq = gic_handle_irq, 308 .handle_irq = gic_handle_irq,
309 .timer = &tegra_timer, 309 .timer = &tegra_timer,
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
index 60a36a2e0be1..4a197a20be93 100644
--- a/arch/arm/mach-tegra/board-trimslice.c
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -175,7 +175,7 @@ MACHINE_START(TRIMSLICE, "trimslice")
175 .atag_offset = 0x100, 175 .atag_offset = 0x100,
176 .fixup = tegra_trimslice_fixup, 176 .fixup = tegra_trimslice_fixup,
177 .map_io = tegra_map_common_io, 177 .map_io = tegra_map_common_io,
178 .init_early = tegra_init_early, 178 .init_early = tegra20_init_early,
179 .init_irq = tegra_init_irq, 179 .init_irq = tegra_init_irq,
180 .handle_irq = gic_handle_irq, 180 .handle_irq = gic_handle_irq,
181 .timer = &tegra_timer, 181 .timer = &tegra_timer,
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 1d14df7eb7de..fdec3ffa4455 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -25,9 +25,10 @@
25 25
26void tegra_assert_system_reset(char mode, const char *cmd); 26void tegra_assert_system_reset(char mode, const char *cmd);
27 27
28void __init tegra_init_early(void); 28void __init tegra20_init_early(void);
29void __init tegra_map_common_io(void); 29void __init tegra_map_common_io(void);
30void __init tegra_init_irq(void); 30void __init tegra_init_irq(void);
31void __init tegra_dt_init_irq(void);
31void __init tegra_init_clock(void); 32void __init tegra_init_clock(void);
32int __init tegra_pcie_init(bool init_port0, bool init_port1); 33int __init tegra_pcie_init(bool init_port0, bool init_port1);
33 34
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 690b888be506..0fafb60497a5 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/mach-tegra/board-harmony.c 2 * arch/arm/mach-tegra/common.c
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * 5 *
@@ -21,8 +21,10 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/of_irq.h>
24 25
25#include <asm/hardware/cache-l2x0.h> 26#include <asm/hardware/cache-l2x0.h>
27#include <asm/hardware/gic.h>
26 28
27#include <mach/iomap.h> 29#include <mach/iomap.h>
28#include <mach/system.h> 30#include <mach/system.h>
@@ -33,6 +35,17 @@
33 35
34void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset; 36void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;
35 37
38static const struct of_device_id tegra_dt_irq_match[] __initconst = {
39 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
40 { }
41};
42
43void __init tegra_dt_init_irq(void)
44{
45 tegra_init_irq();
46 of_irq_init(tegra_dt_irq_match);
47}
48
36void tegra_assert_system_reset(char mode, const char *cmd) 49void tegra_assert_system_reset(char mode, const char *cmd)
37{ 50{
38 void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04); 51 void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
@@ -44,7 +57,8 @@ void tegra_assert_system_reset(char mode, const char *cmd)
44 writel_relaxed(reg, reset); 57 writel_relaxed(reg, reset);
45} 58}
46 59
47static __initdata struct tegra_clk_init_table common_clk_init_table[] = { 60#ifdef CONFIG_ARCH_TEGRA_2x_SOC
61static __initdata struct tegra_clk_init_table tegra20_clk_init_table[] = {
48 /* name parent rate enabled */ 62 /* name parent rate enabled */
49 { "clk_m", NULL, 0, true }, 63 { "clk_m", NULL, 0, true },
50 { "pll_p", "clk_m", 216000000, true }, 64 { "pll_p", "clk_m", 216000000, true },
@@ -60,6 +74,7 @@ static __initdata struct tegra_clk_init_table common_clk_init_table[] = {
60 { "cpu", NULL, 0, true }, 74 { "cpu", NULL, 0, true },
61 { NULL, NULL, 0, 0}, 75 { NULL, NULL, 0, 0},
62}; 76};
77#endif
63 78
64static void __init tegra_init_cache(void) 79static void __init tegra_init_cache(void)
65{ 80{
@@ -74,10 +89,12 @@ static void __init tegra_init_cache(void)
74 89
75} 90}
76 91
77void __init tegra_init_early(void) 92#ifdef CONFIG_ARCH_TEGRA_2x_SOC
93void __init tegra20_init_early(void)
78{ 94{
79 tegra_init_fuse(); 95 tegra_init_fuse();
80 tegra_init_clock(); 96 tegra2_init_clocks();
81 tegra_clk_init_from_table(common_clk_init_table); 97 tegra_clk_init_from_table(tegra20_clk_init_table);
82 tegra_init_cache(); 98 tegra_init_cache();
83} 99}
100#endif