board-paz00.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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/rfkill-gpio.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/gpio.h>
  37. #include "board.h"
  38. #include "board-paz00.h"
  39. #include "clock.h"
  40. #include "devices.h"
  41. #include "gpio-names.h"
  42. static struct plat_serial8250_port debug_uart_platform_data[] = {
  43. {
  44. /* serial port on JP1 */
  45. .membase = IO_ADDRESS(TEGRA_UARTA_BASE),
  46. .mapbase = TEGRA_UARTA_BASE,
  47. .irq = INT_UARTA,
  48. .flags = UPF_BOOT_AUTOCONF,
  49. .iotype = UPIO_MEM,
  50. .regshift = 2,
  51. .uartclk = 216000000,
  52. }, {
  53. /* serial port on mini-pcie */
  54. .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
  55. .mapbase = TEGRA_UARTD_BASE,
  56. .irq = INT_UARTD,
  57. .flags = UPF_BOOT_AUTOCONF,
  58. .iotype = UPIO_MEM,
  59. .regshift = 2,
  60. .uartclk = 216000000,
  61. }, {
  62. .flags = 0
  63. }
  64. };
  65. static struct platform_device debug_uart = {
  66. .name = "serial8250",
  67. .id = PLAT8250_DEV_PLATFORM,
  68. .dev = {
  69. .platform_data = debug_uart_platform_data,
  70. },
  71. };
  72. static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = {
  73. .name = "wifi_rfkill",
  74. .reset_gpio = TEGRA_WIFI_RST,
  75. .shutdown_gpio = TEGRA_WIFI_PWRN,
  76. .type = RFKILL_TYPE_WLAN,
  77. };
  78. static struct platform_device wifi_rfkill_device = {
  79. .name = "rfkill_gpio",
  80. .id = -1,
  81. .dev = {
  82. .platform_data = &wifi_rfkill_platform_data,
  83. },
  84. };
  85. static struct platform_device *paz00_devices[] __initdata = {
  86. &debug_uart,
  87. &tegra_sdhci_device1,
  88. &tegra_sdhci_device4,
  89. &wifi_rfkill_device,
  90. };
  91. static void paz00_i2c_init(void)
  92. {
  93. platform_device_register(&tegra_i2c_device1);
  94. platform_device_register(&tegra_i2c_device2);
  95. platform_device_register(&tegra_i2c_device4);
  96. }
  97. static void paz00_usb_init(void)
  98. {
  99. platform_device_register(&tegra_ehci2_device);
  100. platform_device_register(&tegra_ehci3_device);
  101. }
  102. static void __init tegra_paz00_fixup(struct machine_desc *desc,
  103. struct tag *tags, char **cmdline, struct meminfo *mi)
  104. {
  105. mi->nr_banks = 1;
  106. mi->bank[0].start = PHYS_OFFSET;
  107. mi->bank[0].size = 448 * SZ_1M;
  108. }
  109. static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
  110. /* name parent rate enabled */
  111. { "uarta", "pll_p", 216000000, true },
  112. { "uartd", "pll_p", 216000000, true },
  113. { NULL, NULL, 0, 0},
  114. };
  115. static struct tegra_sdhci_platform_data sdhci_pdata1 = {
  116. .cd_gpio = TEGRA_GPIO_SD1_CD,
  117. .wp_gpio = TEGRA_GPIO_SD1_WP,
  118. .power_gpio = TEGRA_GPIO_SD1_POWER,
  119. };
  120. static struct tegra_sdhci_platform_data sdhci_pdata4 = {
  121. .cd_gpio = -1,
  122. .wp_gpio = -1,
  123. .power_gpio = -1,
  124. .is_8bit = 1,
  125. };
  126. static void __init tegra_paz00_init(void)
  127. {
  128. tegra_clk_init_from_table(paz00_clk_init_table);
  129. paz00_pinmux_init();
  130. tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
  131. tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
  132. platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
  133. paz00_i2c_init();
  134. paz00_usb_init();
  135. }
  136. MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
  137. .boot_params = 0x00000100,
  138. .fixup = tegra_paz00_fixup,
  139. .map_io = tegra_map_common_io,
  140. .init_early = tegra_init_early,
  141. .init_irq = tegra_init_irq,
  142. .timer = &tegra_timer,
  143. .init_machine = tegra_paz00_init,
  144. MACHINE_END