board-paz00.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * arch/arm/mach-tegra/board-paz00.c
  3. *
  4. * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de>
  5. *
  6. * Based on board-harmony.c
  7. * Copyright (C) 2010 Google, Inc.
  8. *
  9. * This software is licensed under the terms of the GNU General Public
  10. * License version 2, as published by the Free Software Foundation, and
  11. * may be copied, distributed, and modified under those terms.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/init.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/serial_8250.h>
  23. #include <linux/clk.h>
  24. #include <linux/dma-mapping.h>
  25. #include <linux/pda_power.h>
  26. #include <linux/io.h>
  27. #include <linux/i2c.h>
  28. #include <linux/platform_data/tegra_usb.h>
  29. #include <asm/mach-types.h>
  30. #include <asm/mach/arch.h>
  31. #include <asm/mach/time.h>
  32. #include <asm/setup.h>
  33. #include <mach/iomap.h>
  34. #include <mach/irqs.h>
  35. #include <mach/sdhci.h>
  36. #include <mach/usb_phy.h>
  37. #include <mach/gpio.h>
  38. #include "board.h"
  39. #include "board-paz00.h"
  40. #include "clock.h"
  41. #include "devices.h"
  42. #include "gpio-names.h"
  43. static struct plat_serial8250_port debug_uart_platform_data[] = {
  44. {
  45. .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
  46. .mapbase = TEGRA_UARTD_BASE,
  47. .irq = INT_UARTD,
  48. .flags = UPF_BOOT_AUTOCONF,
  49. .iotype = UPIO_MEM,
  50. .regshift = 2,
  51. .uartclk = 216000000,
  52. }, {
  53. .flags = 0
  54. }
  55. };
  56. static struct platform_device debug_uart = {
  57. .name = "serial8250",
  58. .id = PLAT8250_DEV_PLATFORM,
  59. .dev = {
  60. .platform_data = debug_uart_platform_data,
  61. },
  62. };
  63. static struct platform_device *paz00_devices[] __initdata = {
  64. &debug_uart,
  65. &tegra_sdhci_device1,
  66. &tegra_sdhci_device4,
  67. };
  68. static void paz00_i2c_init(void)
  69. {
  70. platform_device_register(&tegra_i2c_device1);
  71. platform_device_register(&tegra_i2c_device2);
  72. platform_device_register(&tegra_i2c_device4);
  73. }
  74. static struct tegra_ulpi_config ulpi_phy_config = {
  75. .reset_gpio = TEGRA_ULPI_RST,
  76. .clk = "cdev2",
  77. };
  78. static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
  79. [0] = {
  80. .operating_mode = TEGRA_USB_OTG,
  81. .power_down_on_bus_suspend = 1,
  82. },
  83. [1] = {
  84. .phy_config = &ulpi_phy_config,
  85. .operating_mode = TEGRA_USB_HOST,
  86. .power_down_on_bus_suspend = 1,
  87. },
  88. [2] = {
  89. .operating_mode = TEGRA_USB_HOST,
  90. .power_down_on_bus_suspend = 1,
  91. },
  92. };
  93. static void paz00_usb_init(void)
  94. {
  95. tegra_ehci2_device.dev.platform_data = &tegra_ehci_pdata[1];
  96. tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata[2];
  97. platform_device_register(&tegra_ehci2_device);
  98. platform_device_register(&tegra_ehci3_device);
  99. }
  100. static void __init tegra_paz00_fixup(struct machine_desc *desc,
  101. struct tag *tags, char **cmdline, struct meminfo *mi)
  102. {
  103. mi->nr_banks = 1;
  104. mi->bank[0].start = PHYS_OFFSET;
  105. mi->bank[0].size = 448 * SZ_1M;
  106. }
  107. static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
  108. /* name parent rate enabled */
  109. { "uartd", "pll_p", 216000000, true },
  110. { NULL, NULL, 0, 0},
  111. };
  112. static struct tegra_sdhci_platform_data sdhci_pdata1 = {
  113. .cd_gpio = TEGRA_GPIO_SD1_CD,
  114. .wp_gpio = TEGRA_GPIO_SD1_WP,
  115. .power_gpio = TEGRA_GPIO_SD1_POWER,
  116. };
  117. static struct tegra_sdhci_platform_data sdhci_pdata4 = {
  118. .cd_gpio = -1,
  119. .wp_gpio = -1,
  120. .power_gpio = -1,
  121. .is_8bit = 1,
  122. };
  123. static void __init tegra_paz00_init(void)
  124. {
  125. tegra_clk_init_from_table(paz00_clk_init_table);
  126. paz00_pinmux_init();
  127. tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
  128. tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
  129. platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
  130. paz00_i2c_init();
  131. paz00_usb_init();
  132. }
  133. MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
  134. .boot_params = 0x00000100,
  135. .fixup = tegra_paz00_fixup,
  136. .map_io = tegra_map_common_io,
  137. .init_early = tegra_init_early,
  138. .init_irq = tegra_init_irq,
  139. .timer = &tegra_timer,
  140. .init_machine = tegra_paz00_init,
  141. MACHINE_END