board-sapphire.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* linux/arch/arm/mach-msm/board-sapphire.c
  2. * Copyright (C) 2007-2009 HTC Corporation.
  3. * Author: Thomas Tsai <thomas_tsai@htc.com>
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/input.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/irq.h>
  20. #include <linux/sysdev.h>
  21. #include <linux/delay.h>
  22. #include <asm/gpio.h>
  23. #include <mach/hardware.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/map.h>
  27. #include <asm/mach/flash.h>
  28. #include <asm/system.h>
  29. #include <mach/system.h>
  30. #include <mach/vreg.h>
  31. #include <mach/board.h>
  32. #include <asm/io.h>
  33. #include <asm/delay.h>
  34. #include <asm/setup.h>
  35. #include <linux/mtd/nand.h>
  36. #include <linux/mtd/partitions.h>
  37. #include "gpio_chip.h"
  38. #include "board-sapphire.h"
  39. #include "proc_comm.h"
  40. #include "devices.h"
  41. void msm_init_irq(void);
  42. void msm_init_gpio(void);
  43. static struct platform_device *devices[] __initdata = {
  44. &msm_device_smd,
  45. &msm_device_dmov,
  46. &msm_device_nand,
  47. &msm_device_uart1,
  48. &msm_device_uart3,
  49. };
  50. extern struct sys_timer msm_timer;
  51. static void __init sapphire_init_irq(void)
  52. {
  53. msm_init_irq();
  54. }
  55. static void __init sapphire_init(void)
  56. {
  57. platform_add_devices(devices, ARRAY_SIZE(devices));
  58. }
  59. static struct map_desc sapphire_io_desc[] __initdata = {
  60. {
  61. .virtual = SAPPHIRE_CPLD_BASE,
  62. .pfn = __phys_to_pfn(SAPPHIRE_CPLD_START),
  63. .length = SAPPHIRE_CPLD_SIZE,
  64. .type = MT_DEVICE_NONSHARED
  65. }
  66. };
  67. static void __init sapphire_fixup(struct machine_desc *desc, struct tag *tags,
  68. char **cmdline, struct meminfo *mi)
  69. {
  70. int smi_sz = parse_tag_smi((const struct tag *)tags);
  71. mi->nr_banks = 1;
  72. mi->bank[0].start = PHYS_OFFSET;
  73. mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
  74. if (smi_sz == 32) {
  75. mi->bank[0].size = (84*1024*1024);
  76. } else if (smi_sz == 64) {
  77. mi->bank[0].size = (101*1024*1024);
  78. } else {
  79. /* Give a default value when not get smi size */
  80. smi_sz = 64;
  81. mi->bank[0].size = (101*1024*1024);
  82. }
  83. }
  84. static void __init sapphire_map_io(void)
  85. {
  86. msm_map_common_io();
  87. iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
  88. msm_clock_init();
  89. }
  90. MACHINE_START(SAPPHIRE, "sapphire")
  91. /* Maintainer: Brian Swetland <swetland@google.com> */
  92. #ifdef CONFIG_MSM_DEBUG_UART
  93. .phys_io = MSM_DEBUG_UART_PHYS,
  94. .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
  95. #endif
  96. .boot_params = PHYS_OFFSET + 0x100,
  97. .fixup = sapphire_fixup,
  98. .map_io = sapphire_map_io,
  99. .init_irq = sapphire_init_irq,
  100. .init_machine = sapphire_init,
  101. .timer = &msm_timer,
  102. MACHINE_END