board-paz00.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 gpio_led gpio_leds[] = {
  86. {
  87. .name = "wifi-led",
  88. .default_trigger = "rfkill0",
  89. .gpio = TEGRA_WIFI_LED,
  90. },
  91. };
  92. static struct gpio_led_platform_data gpio_led_info = {
  93. .leds = gpio_leds,
  94. .num_leds = ARRAY_SIZE(gpio_leds),
  95. };
  96. static struct platform_device leds_gpio = {
  97. .name = "leds-gpio",
  98. .id = -1,
  99. .dev = {
  100. .platform_data = &gpio_led_info,
  101. },
  102. };
  103. static struct platform_device *paz00_devices[] __initdata = {
  104. &debug_uart,
  105. &tegra_sdhci_device4,
  106. &tegra_sdhci_device1,
  107. &wifi_rfkill_device,
  108. &leds_gpio,
  109. };
  110. static void paz00_i2c_init(void)
  111. {
  112. platform_device_register(&tegra_i2c_device1);
  113. platform_device_register(&tegra_i2c_device2);
  114. platform_device_register(&tegra_i2c_device4);
  115. }
  116. static void paz00_usb_init(void)
  117. {
  118. platform_device_register(&tegra_ehci2_device);
  119. platform_device_register(&tegra_ehci3_device);
  120. }
  121. static void __init tegra_paz00_fixup(struct machine_desc *desc,
  122. struct tag *tags, char **cmdline, struct meminfo *mi)
  123. {
  124. mi->nr_banks = 1;
  125. mi->bank[0].start = PHYS_OFFSET;
  126. mi->bank[0].size = 448 * SZ_1M;
  127. }
  128. static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
  129. /* name parent rate enabled */
  130. { "uarta", "pll_p", 216000000, true },
  131. { "uartd", "pll_p", 216000000, true },
  132. { NULL, NULL, 0, 0},
  133. };
  134. static struct tegra_sdhci_platform_data sdhci_pdata1 = {
  135. .cd_gpio = TEGRA_GPIO_SD1_CD,
  136. .wp_gpio = TEGRA_GPIO_SD1_WP,
  137. .power_gpio = TEGRA_GPIO_SD1_POWER,
  138. };
  139. static struct tegra_sdhci_platform_data sdhci_pdata4 = {
  140. .cd_gpio = -1,
  141. .wp_gpio = -1,
  142. .power_gpio = -1,
  143. .is_8bit = 1,
  144. };
  145. static void __init tegra_paz00_init(void)
  146. {
  147. tegra_clk_init_from_table(paz00_clk_init_table);
  148. paz00_pinmux_init();
  149. tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
  150. tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
  151. platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
  152. paz00_i2c_init();
  153. paz00_usb_init();
  154. }
  155. MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
  156. .boot_params = 0x00000100,
  157. .fixup = tegra_paz00_fixup,
  158. .map_io = tegra_map_common_io,
  159. .init_early = tegra_init_early,
  160. .init_irq = tegra_init_irq,
  161. .timer = &tegra_timer,
  162. .init_machine = tegra_paz00_init,
  163. MACHINE_END