board-trout.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* linux/arch/arm/mach-msm/board-trout.c
  2. *
  3. * Copyright (C) 2009 Google, Inc.
  4. * Author: Brian Swetland <swetland@google.com>
  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/clkdev.h>
  20. #include <asm/system_info.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/map.h>
  24. #include <asm/setup.h>
  25. #include <mach/board.h>
  26. #include <mach/hardware.h>
  27. #include <mach/msm_iomap.h>
  28. #include "devices.h"
  29. #include "board-trout.h"
  30. #include "common.h"
  31. extern int trout_init_mmc(unsigned int);
  32. static struct platform_device *devices[] __initdata = {
  33. &msm_clock_7x01a,
  34. &msm_device_gpio_7201,
  35. &msm_device_uart3,
  36. &msm_device_smd,
  37. &msm_device_nand,
  38. &msm_device_hsusb,
  39. &msm_device_i2c,
  40. };
  41. static void __init trout_init_early(void)
  42. {
  43. arch_ioremap_caller = __msm_ioremap_caller;
  44. }
  45. static void __init trout_init_irq(void)
  46. {
  47. msm_init_irq();
  48. }
  49. static void __init trout_fixup(struct tag *tags, char **cmdline,
  50. struct meminfo *mi)
  51. {
  52. mi->nr_banks = 1;
  53. mi->bank[0].start = PHYS_OFFSET;
  54. mi->bank[0].size = (101*1024*1024);
  55. }
  56. static void __init trout_init(void)
  57. {
  58. int rc;
  59. platform_add_devices(devices, ARRAY_SIZE(devices));
  60. #ifdef CONFIG_MMC
  61. rc = trout_init_mmc(system_rev);
  62. if (rc)
  63. printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);
  64. #endif
  65. }
  66. static struct map_desc trout_io_desc[] __initdata = {
  67. {
  68. .virtual = TROUT_CPLD_BASE,
  69. .pfn = __phys_to_pfn(TROUT_CPLD_START),
  70. .length = TROUT_CPLD_SIZE,
  71. .type = MT_DEVICE_NONSHARED
  72. }
  73. };
  74. static void __init trout_map_io(void)
  75. {
  76. msm_map_common_io();
  77. iotable_init(trout_io_desc, ARRAY_SIZE(trout_io_desc));
  78. #ifdef CONFIG_MSM_DEBUG_UART3
  79. /* route UART3 to the "H2W" extended usb connector */
  80. writeb(0x80, TROUT_CPLD_BASE + 0x00);
  81. #endif
  82. }
  83. static void __init trout_init_late(void)
  84. {
  85. smd_debugfs_init();
  86. }
  87. MACHINE_START(TROUT, "HTC Dream")
  88. .atag_offset = 0x100,
  89. .fixup = trout_fixup,
  90. .map_io = trout_map_io,
  91. .init_early = trout_init_early,
  92. .init_irq = trout_init_irq,
  93. .init_machine = trout_init,
  94. .init_late = trout_init_late,
  95. .init_time = msm7x01_timer_init,
  96. MACHINE_END