aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/board-dt-tegra20.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/board-dt-tegra20.c')
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra20.c74
1 files changed, 67 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index eb7249db50a..d0de9c1192f 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -64,6 +64,7 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
64 &tegra_ehci2_pdata), 64 &tegra_ehci2_pdata),
65 OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2", 65 OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2",
66 &tegra_ehci3_pdata), 66 &tegra_ehci3_pdata),
67 OF_DEV_AUXDATA("nvidia,tegra20-apbdma", 0x6000a000, "tegra-apbdma", NULL),
67 {} 68 {}
68}; 69};
69 70
@@ -81,11 +82,6 @@ static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
81 { NULL, NULL, 0, 0}, 82 { NULL, NULL, 0, 0},
82}; 83};
83 84
84static struct of_device_id tegra_dt_match_table[] __initdata = {
85 { .compatible = "simple-bus", },
86 {}
87};
88
89static void __init tegra_dt_init(void) 85static void __init tegra_dt_init(void)
90{ 86{
91 tegra_clk_init_from_table(tegra_dt_clk_init_table); 87 tegra_clk_init_from_table(tegra_dt_clk_init_table);
@@ -94,10 +90,74 @@ static void __init tegra_dt_init(void)
94 * Finished with the static registrations now; fill in the missing 90 * Finished with the static registrations now; fill in the missing
95 * devices 91 * devices
96 */ 92 */
97 of_platform_populate(NULL, tegra_dt_match_table, 93 of_platform_populate(NULL, of_default_bus_match_table,
98 tegra20_auxdata_lookup, NULL); 94 tegra20_auxdata_lookup, NULL);
99} 95}
100 96
97#ifdef CONFIG_MACH_TRIMSLICE
98static void __init trimslice_init(void)
99{
100 int ret;
101
102 ret = tegra_pcie_init(true, true);
103 if (ret)
104 pr_err("tegra_pci_init() failed: %d\n", ret);
105}
106#endif
107
108#ifdef CONFIG_MACH_HARMONY
109static void __init harmony_init(void)
110{
111 int ret;
112
113 ret = harmony_regulator_init();
114 if (ret) {
115 pr_err("harmony_regulator_init() failed: %d\n", ret);
116 return;
117 }
118
119 ret = harmony_pcie_init();
120 if (ret)
121 pr_err("harmony_pcie_init() failed: %d\n", ret);
122}
123#endif
124
125#ifdef CONFIG_MACH_PAZ00
126static void __init paz00_init(void)
127{
128 tegra_paz00_wifikill_init();
129}
130#endif
131
132static struct {
133 char *machine;
134 void (*init)(void);
135} board_init_funcs[] = {
136#ifdef CONFIG_MACH_TRIMSLICE
137 { "compulab,trimslice", trimslice_init },
138#endif
139#ifdef CONFIG_MACH_HARMONY
140 { "nvidia,harmony", harmony_init },
141#endif
142#ifdef CONFIG_MACH_PAZ00
143 { "compal,paz00", paz00_init },
144#endif
145};
146
147static void __init tegra_dt_init_late(void)
148{
149 int i;
150
151 tegra_init_late();
152
153 for (i = 0; i < ARRAY_SIZE(board_init_funcs); i++) {
154 if (of_machine_is_compatible(board_init_funcs[i].machine)) {
155 board_init_funcs[i].init();
156 break;
157 }
158 }
159}
160
101static const char *tegra20_dt_board_compat[] = { 161static const char *tegra20_dt_board_compat[] = {
102 "nvidia,tegra20", 162 "nvidia,tegra20",
103 NULL 163 NULL
@@ -110,7 +170,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
110 .handle_irq = gic_handle_irq, 170 .handle_irq = gic_handle_irq,
111 .timer = &tegra_timer, 171 .timer = &tegra_timer,
112 .init_machine = tegra_dt_init, 172 .init_machine = tegra_dt_init,
113 .init_late = tegra_init_late, 173 .init_late = tegra_dt_init_late,
114 .restart = tegra_assert_system_reset, 174 .restart = tegra_assert_system_reset,
115 .dt_compat = tegra20_dt_board_compat, 175 .dt_compat = tegra20_dt_board_compat,
116MACHINE_END 176MACHINE_END