1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#include <linux/clk.h>
20#include <linux/clk/tegra.h>
21#include <linux/dma-mapping.h>
22#include <linux/init.h>
23#include <linux/io.h>
24#include <linux/irqchip.h>
25#include <linux/irqdomain.h>
26#include <linux/kernel.h>
27#include <linux/of_address.h>
28#include <linux/of_fdt.h>
29#include <linux/of.h>
30#include <linux/of_platform.h>
31#include <linux/pda_power.h>
32#include <linux/platform_device.h>
33#include <linux/serial_8250.h>
34#include <linux/slab.h>
35#include <linux/sys_soc.h>
36#include <linux/usb/tegra_usb_phy.h>
37
38#include <soc/tegra/fuse.h>
39#include <soc/tegra/pmc.h>
40
41#include <asm/hardware/cache-l2x0.h>
42#include <asm/mach/arch.h>
43#include <asm/mach/time.h>
44#include <asm/mach-types.h>
45#include <asm/setup.h>
46#include <asm/trusted_foundations.h>
47
48#include "board.h"
49#include "common.h"
50#include "cpuidle.h"
51#include "iomap.h"
52#include "irq.h"
53#include "pm.h"
54#include "reset.h"
55#include "sleep.h"
56
57
58
59
60
61
62
63
64u32 tegra_uart_config[3] = {
65
66 1,
67
68 0,
69
70 0,
71};
72
73static void __init tegra_init_early(void)
74{
75 of_register_trusted_foundations();
76 tegra_cpu_reset_handler_init();
77}
78
79static void __init tegra_dt_init_irq(void)
80{
81 tegra_init_irq();
82 irqchip_init();
83}
84
85static void __init tegra_dt_init(void)
86{
87 struct soc_device_attribute *soc_dev_attr;
88 struct soc_device *soc_dev;
89 struct device *parent = NULL;
90
91 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
92 if (!soc_dev_attr)
93 goto out;
94
95 soc_dev_attr->family = kasprintf(GFP_KERNEL, "Tegra");
96 soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d",
97 tegra_sku_info.revision);
98 soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%u", tegra_get_chip_id());
99
100 soc_dev = soc_device_register(soc_dev_attr);
101 if (IS_ERR(soc_dev)) {
102 kfree(soc_dev_attr->family);
103 kfree(soc_dev_attr->revision);
104 kfree(soc_dev_attr->soc_id);
105 kfree(soc_dev_attr);
106 goto out;
107 }
108
109 parent = soc_device_to_device(soc_dev);
110
111
112
113
114
115out:
116 of_platform_default_populate(NULL, NULL, parent);
117}
118
119static void __init tegra_dt_init_late(void)
120{
121 tegra_init_suspend();
122 tegra_cpuidle_init();
123
124 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
125 of_machine_is_compatible("compal,paz00"))
126 tegra_paz00_wifikill_init();
127}
128
129static const char * const tegra_dt_board_compat[] = {
130 "nvidia,tegra124",
131 "nvidia,tegra114",
132 "nvidia,tegra30",
133 "nvidia,tegra20",
134 NULL
135};
136
137DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
138 .l2c_aux_val = 0x3c400001,
139 .l2c_aux_mask = 0xc20fc3fe,
140 .smp = smp_ops(tegra_smp_ops),
141 .map_io = tegra_map_common_io,
142 .init_early = tegra_init_early,
143 .init_irq = tegra_dt_init_irq,
144 .init_machine = tegra_dt_init,
145 .init_late = tegra_dt_init_late,
146 .dt_compat = tegra_dt_board_compat,
147MACHINE_END
148