common.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* linux/arch/arm/mach-msm/common.c
  2. *
  3. * Common setup code for MSM7K Boards
  4. *
  5. * Copyright (C) 2007 Google, Inc.
  6. * Author: Brian Swetland <swetland@google.com>
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/init.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/io.h>
  22. #include <asm/mach/flash.h>
  23. #include <asm/setup.h>
  24. #include <linux/mtd/nand.h>
  25. #include <linux/mtd/partitions.h>
  26. #include <mach/msm_iomap.h>
  27. #include <mach/board.h>
  28. struct flash_platform_data msm_nand_data = {
  29. .parts = 0,
  30. .nr_parts = 0,
  31. };
  32. static struct resource msm_nand_resources[] = {
  33. [0] = {
  34. .start = 7,
  35. .end = 7,
  36. .flags = IORESOURCE_DMA,
  37. },
  38. };
  39. static struct platform_device msm_nand_device = {
  40. .name = "msm_nand",
  41. .id = -1,
  42. .num_resources = ARRAY_SIZE(msm_nand_resources),
  43. .resource = msm_nand_resources,
  44. .dev = {
  45. .platform_data = &msm_nand_data,
  46. },
  47. };
  48. static struct platform_device msm_smd_device = {
  49. .name = "msm_smd",
  50. .id = -1,
  51. };
  52. static struct resource msm_i2c_resources[] = {
  53. {
  54. .start = MSM_I2C_BASE,
  55. .end = MSM_I2C_BASE + MSM_I2C_SIZE - 1,
  56. .flags = IORESOURCE_MEM,
  57. },
  58. {
  59. .start = INT_PWB_I2C,
  60. .end = INT_PWB_I2C,
  61. .flags = IORESOURCE_IRQ,
  62. },
  63. };
  64. static struct platform_device msm_i2c_device = {
  65. .name = "msm_i2c",
  66. .id = 0,
  67. .num_resources = ARRAY_SIZE(msm_i2c_resources),
  68. .resource = msm_i2c_resources,
  69. };
  70. static struct resource usb_resources[] = {
  71. {
  72. .start = MSM_HSUSB_PHYS,
  73. .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
  74. .flags = IORESOURCE_MEM,
  75. },
  76. {
  77. .start = INT_USB_HS,
  78. .end = INT_USB_HS,
  79. .flags = IORESOURCE_IRQ,
  80. },
  81. };
  82. static struct platform_device msm_hsusb_device = {
  83. .name = "msm_hsusb",
  84. .id = -1,
  85. .num_resources = ARRAY_SIZE(usb_resources),
  86. .resource = usb_resources,
  87. .dev = {
  88. .coherent_dma_mask = 0xffffffff,
  89. },
  90. };
  91. static struct platform_device *devices[] __initdata = {
  92. &msm_nand_device,
  93. &msm_smd_device,
  94. &msm_i2c_device,
  95. &msm_hsusb_device,
  96. };
  97. void __init msm_add_devices(void)
  98. {
  99. platform_add_devices(devices, ARRAY_SIZE(devices));
  100. }