board-harmony.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 <mach/sdhci.h>
  31. #include "board.h"
  32. #include "board-harmony.h"
  33. #include "clock.h"
  34. #include "devices.h"
  35. #include "gpio-names.h"
  36. static struct plat_serial8250_port debug_uart_platform_data[] = {
  37. {
  38. .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
  39. .mapbase = TEGRA_UARTD_BASE,
  40. .irq = INT_UARTD,
  41. .flags = UPF_BOOT_AUTOCONF,
  42. .iotype = UPIO_MEM,
  43. .regshift = 2,
  44. .uartclk = 216000000,
  45. }, {
  46. .flags = 0
  47. }
  48. };
  49. static struct platform_device debug_uart = {
  50. .name = "serial8250",
  51. .id = PLAT8250_DEV_PLATFORM,
  52. .dev = {
  53. .platform_data = debug_uart_platform_data,
  54. },
  55. };
  56. static struct platform_device *harmony_devices[] __initdata = {
  57. &debug_uart,
  58. &tegra_sdhci_device1,
  59. &tegra_sdhci_device2,
  60. &tegra_sdhci_device4,
  61. };
  62. static void __init tegra_harmony_fixup(struct machine_desc *desc,
  63. struct tag *tags, char **cmdline, struct meminfo *mi)
  64. {
  65. mi->nr_banks = 2;
  66. mi->bank[0].start = PHYS_OFFSET;
  67. mi->bank[0].size = 448 * SZ_1M;
  68. mi->bank[1].start = SZ_512M;
  69. mi->bank[1].size = SZ_512M;
  70. }
  71. static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
  72. /* name parent rate enabled */
  73. { "uartd", "pll_p", 216000000, true },
  74. { NULL, NULL, 0, 0},
  75. };
  76. static struct tegra_sdhci_platform_data sdhci_pdata1 = {
  77. .cd_gpio = -1,
  78. .wp_gpio = -1,
  79. .power_gpio = -1,
  80. };
  81. static struct tegra_sdhci_platform_data sdhci_pdata2 = {
  82. .cd_gpio = TEGRA_GPIO_PI5,
  83. .wp_gpio = TEGRA_GPIO_PH1,
  84. .power_gpio = TEGRA_GPIO_PT3,
  85. };
  86. static struct tegra_sdhci_platform_data sdhci_pdata4 = {
  87. .cd_gpio = TEGRA_GPIO_PH2,
  88. .wp_gpio = TEGRA_GPIO_PH3,
  89. .power_gpio = TEGRA_GPIO_PI6,
  90. .is_8bit = 1,
  91. };
  92. static void __init tegra_harmony_init(void)
  93. {
  94. tegra_clk_init_from_table(harmony_clk_init_table);
  95. harmony_pinmux_init();
  96. tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
  97. tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
  98. tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
  99. platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
  100. }
  101. MACHINE_START(HARMONY, "harmony")
  102. .boot_params = 0x00000100,
  103. .fixup = tegra_harmony_fixup,
  104. .map_io = tegra_map_common_io,
  105. .init_early = tegra_init_early,
  106. .init_irq = tegra_init_irq,
  107. .timer = &tegra_timer,
  108. .init_machine = tegra_harmony_init,
  109. MACHINE_END