board-paz00.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
  44. .mapbase = TEGRA_UARTD_BASE,
  45. .irq = INT_UARTD,
  46. .flags = UPF_BOOT_AUTOCONF,
  47. .iotype = UPIO_MEM,
  48. .regshift = 2,
  49. .uartclk = 216000000,
  50. }, {
  51. .flags = 0
  52. }
  53. };
  54. static struct platform_device debug_uart = {
  55. .name = "serial8250",
  56. .id = PLAT8250_DEV_PLATFORM,
  57. .dev = {
  58. .platform_data = debug_uart_platform_data,
  59. },
  60. };
  61. static struct platform_device *paz00_devices[] __initdata = {
  62. &debug_uart,
  63. &tegra_sdhci_device1,
  64. &tegra_sdhci_device4,
  65. };
  66. static void paz00_i2c_init(void)
  67. {
  68. platform_device_register(&tegra_i2c_device1);
  69. platform_device_register(&tegra_i2c_device2);
  70. platform_device_register(&tegra_i2c_device4);
  71. }
  72. static void paz00_usb_init(void)
  73. {
  74. platform_device_register(&tegra_ehci2_device);
  75. platform_device_register(&tegra_ehci3_device);
  76. }
  77. static void __init tegra_paz00_fixup(struct machine_desc *desc,
  78. struct tag *tags, char **cmdline, struct meminfo *mi)
  79. {
  80. mi->nr_banks = 1;
  81. mi->bank[0].start = PHYS_OFFSET;
  82. mi->bank[0].size = 448 * SZ_1M;
  83. }
  84. static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
  85. /* name parent rate enabled */
  86. { "uartd", "pll_p", 216000000, true },
  87. { NULL, NULL, 0, 0},
  88. };
  89. static struct tegra_sdhci_platform_data sdhci_pdata1 = {
  90. .cd_gpio = TEGRA_GPIO_SD1_CD,
  91. .wp_gpio = TEGRA_GPIO_SD1_WP,
  92. .power_gpio = TEGRA_GPIO_SD1_POWER,
  93. };
  94. static struct tegra_sdhci_platform_data sdhci_pdata4 = {
  95. .cd_gpio = -1,
  96. .wp_gpio = -1,
  97. .power_gpio = -1,
  98. .is_8bit = 1,
  99. };
  100. static void __init tegra_paz00_init(void)
  101. {
  102. tegra_clk_init_from_table(paz00_clk_init_table);
  103. paz00_pinmux_init();
  104. tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
  105. tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
  106. platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
  107. paz00_i2c_init();
  108. paz00_usb_init();
  109. }
  110. MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
  111. .boot_params = 0x00000100,
  112. .fixup = tegra_paz00_fixup,
  113. .map_io = tegra_map_common_io,
  114. .init_early = tegra_init_early,
  115. .init_irq = tegra_init_irq,
  116. .timer = &tegra_timer,
  117. .init_machine = tegra_paz00_init,
  118. MACHINE_END