board-sapphire.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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/gpio.h>
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/input.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/irq.h>
  21. #include <linux/device.h>
  22. #include <linux/delay.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 <mach/system.h>
  29. #include <mach/vreg.h>
  30. #include <mach/board.h>
  31. #include <asm/io.h>
  32. #include <asm/delay.h>
  33. #include <asm/setup.h>
  34. #include <linux/mtd/nand.h>
  35. #include <linux/mtd/partitions.h>
  36. #include "gpio_chip.h"
  37. #include "board-sapphire.h"
  38. #include "proc_comm.h"
  39. #include "devices.h"
  40. void msm_init_irq(void);
  41. void msm_init_gpio(void);
  42. static struct platform_device *devices[] __initdata = {
  43. &msm_device_smd,
  44. &msm_device_dmov,
  45. &msm_device_nand,
  46. &msm_device_uart1,
  47. &msm_device_uart3,
  48. };
  49. extern struct sys_timer msm_timer;
  50. static void __init sapphire_init_irq(void)
  51. {
  52. msm_init_irq();
  53. }
  54. static void __init sapphire_init(void)
  55. {
  56. platform_add_devices(devices, ARRAY_SIZE(devices));
  57. }
  58. static struct map_desc sapphire_io_desc[] __initdata = {
  59. {
  60. .virtual = SAPPHIRE_CPLD_BASE,
  61. .pfn = __phys_to_pfn(SAPPHIRE_CPLD_START),
  62. .length = SAPPHIRE_CPLD_SIZE,
  63. .type = MT_DEVICE_NONSHARED
  64. }
  65. };
  66. static void __init sapphire_fixup(struct tag *tags, char **cmdline,
  67. struct meminfo *mi)
  68. {
  69. int smi_sz = parse_tag_smi((const struct tag *)tags);
  70. mi->nr_banks = 1;
  71. mi->bank[0].start = PHYS_OFFSET;
  72. mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
  73. if (smi_sz == 32) {
  74. mi->bank[0].size = (84*1024*1024);
  75. } else if (smi_sz == 64) {
  76. mi->bank[0].size = (101*1024*1024);
  77. } else {
  78. /* Give a default value when not get smi size */
  79. smi_sz = 64;
  80. mi->bank[0].size = (101*1024*1024);
  81. }
  82. }
  83. static void __init sapphire_map_io(void)
  84. {
  85. msm_map_common_io();
  86. iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
  87. msm_clock_init();
  88. }
  89. MACHINE_START(SAPPHIRE, "sapphire")
  90. /* Maintainer: Brian Swetland <swetland@google.com> */
  91. .atag_offset = 0x100,
  92. .fixup = sapphire_fixup,
  93. .map_io = sapphire_map_io,
  94. .init_irq = sapphire_init_irq,
  95. .init_machine = sapphire_init,
  96. .timer = &msm_timer,
  97. MACHINE_END