tegra.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * NVIDIA Tegra SoC device tree board support
  3. *
  4. * Copyright (C) 2011, 2013, NVIDIA Corporation
  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. #include <linux/clk.h>
  19. #include <linux/clk/tegra.h>
  20. #include <linux/dma-mapping.h>
  21. #include <linux/init.h>
  22. #include <linux/io.h>
  23. #include <linux/irqchip.h>
  24. #include <linux/irqdomain.h>
  25. #include <linux/kernel.h>
  26. #include <linux/of_address.h>
  27. #include <linux/of_fdt.h>
  28. #include <linux/of.h>
  29. #include <linux/of_platform.h>
  30. #include <linux/pda_power.h>
  31. #include <linux/platform_device.h>
  32. #include <linux/serial_8250.h>
  33. #include <linux/slab.h>
  34. #include <linux/sys_soc.h>
  35. #include <linux/usb/tegra_usb_phy.h>
  36. #include <soc/tegra/fuse.h>
  37. #include <soc/tegra/pmc.h>
  38. #include <asm/hardware/cache-l2x0.h>
  39. #include <asm/mach/arch.h>
  40. #include <asm/mach/time.h>
  41. #include <asm/mach-types.h>
  42. #include <asm/setup.h>
  43. #include <asm/trusted_foundations.h>
  44. #include "board.h"
  45. #include "common.h"
  46. #include "cpuidle.h"
  47. #include "iomap.h"
  48. #include "irq.h"
  49. #include "pm.h"
  50. #include "reset.h"
  51. #include "sleep.h"
  52. /*
  53. * Storage for debug-macro.S's state.
  54. *
  55. * This must be in .data not .bss so that it gets initialized each time the
  56. * kernel is loaded. The data is declared here rather than debug-macro.S so
  57. * that multiple inclusions of debug-macro.S point at the same data.
  58. */
  59. u32 tegra_uart_config[3] = {
  60. /* Debug UART initialization required */
  61. 1,
  62. /* Debug UART physical address */
  63. 0,
  64. /* Debug UART virtual address */
  65. 0,
  66. };
  67. static void __init tegra_init_early(void)
  68. {
  69. of_register_trusted_foundations();
  70. tegra_cpu_reset_handler_init();
  71. }
  72. static void __init tegra_dt_init_irq(void)
  73. {
  74. tegra_init_irq();
  75. irqchip_init();
  76. }
  77. static void __init tegra_dt_init(void)
  78. {
  79. struct device *parent = tegra_soc_device_register();
  80. of_platform_default_populate(NULL, NULL, parent);
  81. }
  82. static void __init tegra_dt_init_late(void)
  83. {
  84. tegra_init_suspend();
  85. tegra_cpuidle_init();
  86. if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
  87. of_machine_is_compatible("compal,paz00"))
  88. tegra_paz00_wifikill_init();
  89. if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) &&
  90. of_machine_is_compatible("nvidia,tegra20"))
  91. platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0);
  92. }
  93. static const char * const tegra_dt_board_compat[] = {
  94. "nvidia,tegra124",
  95. "nvidia,tegra114",
  96. "nvidia,tegra30",
  97. "nvidia,tegra20",
  98. NULL
  99. };
  100. DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
  101. .l2c_aux_val = 0x3c400001,
  102. .l2c_aux_mask = 0xc20fc3fe,
  103. .smp = smp_ops(tegra_smp_ops),
  104. .map_io = tegra_map_common_io,
  105. .init_early = tegra_init_early,
  106. .init_irq = tegra_dt_init_irq,
  107. .init_machine = tegra_dt_init,
  108. .init_late = tegra_dt_init_late,
  109. .dt_compat = tegra_dt_board_compat,
  110. MACHINE_END