board-harmony.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * arch/arm/mach-tegra/board-harmony.c
  3. *
  4. * Copyright (C) 2010 Google, Inc.
  5. *
  6. * This software is licensed under the terms of the GNU General Public
  7. * License version 2, as published by the Free Software Foundation, and
  8. * may be copied, distributed, and modified under those terms.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/serial_8250.h>
  20. #include <linux/clk.h>
  21. #include <linux/dma-mapping.h>
  22. #include <linux/pda_power.h>
  23. #include <linux/io.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/time.h>
  27. #include <asm/setup.h>
  28. #include <mach/iomap.h>
  29. #include <mach/irqs.h>
  30. #include "board.h"
  31. #include "board-harmony.h"
  32. #include "clock.h"
  33. /* NVidia bootloader tags */
  34. #define ATAG_NVIDIA 0x41000801
  35. #define ATAG_NVIDIA_RM 0x1
  36. #define ATAG_NVIDIA_DISPLAY 0x2
  37. #define ATAG_NVIDIA_FRAMEBUFFER 0x3
  38. #define ATAG_NVIDIA_CHIPSHMOO 0x4
  39. #define ATAG_NVIDIA_CHIPSHMOOPHYS 0x5
  40. #define ATAG_NVIDIA_PRESERVED_MEM_0 0x10000
  41. #define ATAG_NVIDIA_PRESERVED_MEM_N 2
  42. #define ATAG_NVIDIA_FORCE_32 0x7fffffff
  43. struct tag_tegra {
  44. __u32 bootarg_key;
  45. __u32 bootarg_len;
  46. char bootarg[1];
  47. };
  48. static int __init parse_tag_nvidia(const struct tag *tag)
  49. {
  50. return 0;
  51. }
  52. __tagtable(ATAG_NVIDIA, parse_tag_nvidia);
  53. static struct plat_serial8250_port debug_uart_platform_data[] = {
  54. {
  55. .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
  56. .mapbase = TEGRA_UARTD_BASE,
  57. .irq = INT_UARTD,
  58. .flags = UPF_BOOT_AUTOCONF,
  59. .iotype = UPIO_MEM,
  60. .regshift = 2,
  61. .uartclk = 216000000,
  62. }, {
  63. .flags = 0
  64. }
  65. };
  66. static struct platform_device debug_uart = {
  67. .name = "serial8250",
  68. .id = PLAT8250_DEV_PLATFORM,
  69. .dev = {
  70. .platform_data = debug_uart_platform_data,
  71. },
  72. };
  73. static struct platform_device *harmony_devices[] __initdata = {
  74. &debug_uart,
  75. };
  76. static void __init tegra_harmony_fixup(struct machine_desc *desc,
  77. struct tag *tags, char **cmdline, struct meminfo *mi)
  78. {
  79. mi->nr_banks = 2;
  80. mi->bank[0].start = PHYS_OFFSET;
  81. mi->bank[0].size = 448 * SZ_1M;
  82. mi->bank[1].start = SZ_512M;
  83. mi->bank[1].size = SZ_512M;
  84. }
  85. static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
  86. /* name parent rate enabled */
  87. { "uartd", "pll_p", 216000000, true },
  88. { NULL, NULL, 0, 0},
  89. };
  90. static void __init tegra_harmony_init(void)
  91. {
  92. tegra_common_init();
  93. tegra_clk_init_from_table(harmony_clk_init_table);
  94. harmony_pinmux_init();
  95. platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
  96. }
  97. MACHINE_START(HARMONY, "harmony")
  98. .boot_params = 0x00000100,
  99. .phys_io = IO_APB_PHYS,
  100. .io_pg_offst = ((IO_APB_VIRT) >> 18) & 0xfffc,
  101. .fixup = tegra_harmony_fixup,
  102. .init_irq = tegra_init_irq,
  103. .init_machine = tegra_harmony_init,
  104. .map_io = tegra_map_common_io,
  105. .timer = &tegra_timer,
  106. MACHINE_END