board-paz00.c 3.6 KB

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