]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - arch/arm/mach-tegra/tegra.c
ARM: tegra: Sort dependencies alphabetically
[mirror_ubuntu-jammy-kernel.git] / arch / arm / mach-tegra / tegra.c
CommitLineData
8e267f3d 1/*
1b14f3a5 2 * NVIDIA Tegra SoC device tree board support
8e267f3d 3 *
1b14f3a5 4 * Copyright (C) 2011, 2013, NVIDIA Corporation
8e267f3d
GL
5 * Copyright (C) 2010 Secret Lab Technologies, Ltd.
6 * Copyright (C) 2010 Google, Inc.
7 *
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 */
18
8e267f3d 19#include <linux/clk.h>
a0524acc 20#include <linux/clk/tegra.h>
8e267f3d 21#include <linux/dma-mapping.h>
a0524acc
TR
22#include <linux/init.h>
23#include <linux/io.h>
24#include <linux/irqchip.h>
8e267f3d 25#include <linux/irqdomain.h>
a0524acc 26#include <linux/kernel.h>
8e267f3d
GL
27#include <linux/of_address.h>
28#include <linux/of_fdt.h>
a0524acc 29#include <linux/of.h>
8e267f3d
GL
30#include <linux/of_platform.h>
31#include <linux/pda_power.h>
a0524acc
TR
32#include <linux/platform_device.h>
33#include <linux/serial_8250.h>
d591fdf8
DH
34#include <linux/slab.h>
35#include <linux/sys_soc.h>
bab53ce3 36#include <linux/usb/tegra_usb_phy.h>
8e267f3d 37
304664ea 38#include <soc/tegra/fuse.h>
7232398a 39#include <soc/tegra/pmc.h>
304664ea 40
6ad27b83 41#include <asm/firmware.h>
51100bdc 42#include <asm/hardware/cache-l2x0.h>
8e267f3d
GL
43#include <asm/mach/arch.h>
44#include <asm/mach/time.h>
a0524acc 45#include <asm/mach-types.h>
8e267f3d 46#include <asm/setup.h>
1a5de3ae 47#include <asm/trusted_foundations.h>
8e267f3d 48
8e267f3d 49#include "board.h"
a1725732 50#include "common.h"
51100bdc 51#include "cpuidle.h"
2be39c07 52#include "iomap.h"
51100bdc 53#include "irq.h"
51100bdc
SW
54#include "pm.h"
55#include "reset.h"
56#include "sleep.h"
57
58/*
59 * Storage for debug-macro.S's state.
60 *
61 * This must be in .data not .bss so that it gets initialized each time the
62 * kernel is loaded. The data is declared here rather than debug-macro.S so
63 * that multiple inclusions of debug-macro.S point at the same data.
64 */
2f1d70af 65u32 tegra_uart_config[3] = {
51100bdc
SW
66 /* Debug UART initialization required */
67 1,
68 /* Debug UART physical address */
69 0,
70 /* Debug UART virtual address */
71 0,
51100bdc
SW
72};
73
51100bdc
SW
74static void __init tegra_init_early(void)
75{
1a5de3ae 76 of_register_trusted_foundations();
cd198d6d 77 tegra_cpu_reset_handler_init();
6ad27b83 78 call_firmware_op(l2x0_init);
51100bdc
SW
79}
80
81static void __init tegra_dt_init_irq(void)
82{
51100bdc
SW
83 tegra_init_irq();
84 irqchip_init();
51100bdc 85}
bab53ce3 86
8e267f3d
GL
87static void __init tegra_dt_init(void)
88{
27a0342a 89 struct device *parent = tegra_soc_device_register();
d591fdf8 90
435ebcbc 91 of_platform_default_populate(NULL, NULL, parent);
8e267f3d
GL
92}
93
c554dee3
SW
94static void __init tegra_dt_init_late(void)
95{
51100bdc
SW
96 tegra_init_suspend();
97 tegra_cpuidle_init();
c554dee3 98
da35cbca
AB
99 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
100 of_machine_is_compatible("compal,paz00"))
101 tegra_paz00_wifikill_init();
15164e00
DO
102
103 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
104 of_machine_is_compatible("nvidia,tegra20"))
105 platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
c554dee3
SW
106}
107
1b14f3a5 108static const char * const tegra_dt_board_compat[] = {
73944475 109 "nvidia,tegra124",
1b14f3a5
HD
110 "nvidia,tegra114",
111 "nvidia,tegra30",
c5444f39 112 "nvidia,tegra20",
8e267f3d
GL
113 NULL
114};
115
1b14f3a5 116DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
00123d9a
RK
117 .l2c_aux_val = 0x3c400001,
118 .l2c_aux_mask = 0xc20fc3fe,
a1725732 119 .smp = smp_ops(tegra_smp_ops),
00123d9a 120 .map_io = tegra_map_common_io,
7469688e 121 .init_early = tegra_init_early,
0d4f7479 122 .init_irq = tegra_dt_init_irq,
8e267f3d 123 .init_machine = tegra_dt_init,
c554dee3 124 .init_late = tegra_dt_init_late,
1b14f3a5 125 .dt_compat = tegra_dt_board_compat,
8e267f3d 126MACHINE_END