board-harmony.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * arch/arm/mach-tegra/board-harmony.c
  3. *
  4. * Copyright (C) 2010 Google, Inc.
  5. *
  6. * This software is licensed under the terms of the GNU General Public
  7. * License version 2, as published by the Free Software Foundation, and
  8. * may be copied, distributed, and modified under those terms.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/serial_8250.h>
  20. #include <linux/clk.h>
  21. #include <linux/dma-mapping.h>
  22. #include <linux/pda_power.h>
  23. #include <linux/io.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/time.h>
  27. #include <asm/setup.h>
  28. #include <mach/iomap.h>
  29. #include <mach/irqs.h>
  30. #include "board.h"
  31. #include "board-harmony.h"
  32. #include "clock.h"
  33. static struct plat_serial8250_port debug_uart_platform_data[] = {
  34. {
  35. .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
  36. .mapbase = TEGRA_UARTD_BASE,
  37. .irq = INT_UARTD,
  38. .flags = UPF_BOOT_AUTOCONF,
  39. .iotype = UPIO_MEM,
  40. .regshift = 2,
  41. .uartclk = 216000000,
  42. }, {
  43. .flags = 0
  44. }
  45. };
  46. static struct platform_device debug_uart = {
  47. .name = "serial8250",
  48. .id = PLAT8250_DEV_PLATFORM,
  49. .dev = {
  50. .platform_data = debug_uart_platform_data,
  51. },
  52. };
  53. static struct platform_device *harmony_devices[] __initdata = {
  54. &debug_uart,
  55. };
  56. static void __init tegra_harmony_fixup(struct machine_desc *desc,
  57. struct tag *tags, char **cmdline, struct meminfo *mi)
  58. {
  59. mi->nr_banks = 2;
  60. mi->bank[0].start = PHYS_OFFSET;
  61. mi->bank[0].size = 448 * SZ_1M;
  62. mi->bank[1].start = SZ_512M;
  63. mi->bank[1].size = SZ_512M;
  64. }
  65. static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
  66. /* name parent rate enabled */
  67. { "uartd", "pll_p", 216000000, true },
  68. { NULL, NULL, 0, 0},
  69. };
  70. static void __init tegra_harmony_init(void)
  71. {
  72. tegra_clk_init_from_table(harmony_clk_init_table);
  73. harmony_pinmux_init();
  74. platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
  75. }
  76. MACHINE_START(HARMONY, "harmony")
  77. .boot_params = 0x00000100,
  78. .fixup = tegra_harmony_fixup,
  79. .map_io = tegra_map_common_io,
  80. .init_early = tegra_init_early,
  81. .init_irq = tegra_init_irq,
  82. .timer = &tegra_timer,
  83. .init_machine = tegra_harmony_init,
  84. MACHINE_END