connectTheSignalSlot.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * arch/arm/mach-orion5x/kurobox_pro-setup.c
  3. *
  4. * Maintainer: Ronen Shitrit <rshitrit@marvell.com>
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #include <linux/gpio.h>
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/pci.h>
  15. #include <linux/irq.h>
  16. #include <linux/delay.h>
  17. #include <linux/mtd/physmap.h>
  18. #include <linux/mtd/nand.h>
  19. #include <linux/mv643xx_eth.h>
  20. #include <linux/i2c.h>
  21. #include <linux/serial_reg.h>
  22. #include <linux/ata_platform.h>
  23. #include <asm/mach-types.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/pci.h>
  26. #include <mach/orion5x.h>
  27. #include <linux/platform_data/mtd-orion_nand.h>
  28. #include "common.h"
  29. #include "mpp.h"
  30. /*****************************************************************************
  31. * KUROBOX-PRO Info
  32. ****************************************************************************/
  33. /*
  34. * 256K NOR flash Device bus boot chip select
  35. */
  36. #define KUROBOX_PRO_NOR_BOOT_BASE 0xf4000000
  37. #define KUROBOX_PRO_NOR_BOOT_SIZE SZ_256K
  38. /*
  39. * 256M NAND flash on Device bus chip select 1
  40. */
  41. #define KUROBOX_PRO_NAND_BASE 0xfc000000
  42. #define KUROBOX_PRO_NAND_SIZE SZ_2M
  43. /*****************************************************************************
  44. * 256MB NAND Flash on Device bus CS0
  45. ****************************************************************************/
  46. static struct mtd_partition kurobox_pro_nand_parts[] = {
  47. {
  48. .name = "uImage",
  49. .offset = 0,
  50. .size = SZ_4M,
  51. }, {
  52. .name = "rootfs",
  53. .offset = SZ_4M,
  54. .size = SZ_64M,
  55. }, {
  56. .name = "extra",
  57. .offset = SZ_4M + SZ_64M,
  58. .size = SZ_256M - (SZ_4M + SZ_64M),
  59. },
  60. };
  61. static struct resource kurobox_pro_nand_resource = {
  62. .flags = IORESOURCE_MEM,
  63. .start = KUROBOX_PRO_NAND_BASE,
  64. .end = KUROBOX_PRO_NAND_BASE + KUROBOX_PRO_NAND_SIZE - 1,
  65. };
  66. static struct orion_nand_data kurobox_pro_nand_data = {
  67. .parts = kurobox_pro_nand_parts,
  68. .nr_parts = ARRAY_SIZE(kurobox_pro_nand_parts),
  69. .cle = 0,
  70. .ale = 1,
  71. .width = 8,
  72. };
  73. static struct platform_device kurobox_pro_nand_flash = {
  74. .name = "orion_nand",
  75. .id = -1,
  76. .dev = {
  77. .platform_data = &kurobox_pro_nand_data,
  78. },
  79. .resource = &kurobox_pro_nand_resource,
  80. .num_resources = 1,
  81. };
  82. /*****************************************************************************
  83. * 256KB NOR Flash on BOOT Device
  84. ****************************************************************************/
  85. static struct physmap_flash_data kurobox_pro_nor_flash_data = {
  86. .width = 1,
  87. };
  88. static struct resource kurobox_pro_nor_flash_resource = {
  89. .flags = IORESOURCE_MEM,
  90. .start = KUROBOX_PRO_NOR_BOOT_BASE,
  91. .end = KUROBOX_PRO_NOR_BOOT_BASE + KUROBOX_PRO_NOR_BOOT_SIZE - 1,
  92. };
  93. static struct platform_device kurobox_pro_nor_flash = {
  94. .name = "physmap-flash",
  95. .id = 0,
  96. .dev = {
  97. .platform_data = &kurobox_pro_nor_flash_data,
  98. },
  99. .num_resources = 1,
  100. .resource = &kurobox_pro_nor_flash_resource,
  101. };
  102. /*****************************************************************************
  103. * PCI
  104. ****************************************************************************/
  105. static int __init kurobox_pro_pci_map_irq(const struct pci_dev *dev, u8 slot,
  106. u8 pin)
  107. {
  108. int irq;
  109. /*
  110. * Check for devices with hard-wired IRQs.
  111. */
  112. irq = orion5x_pci_map_irq(dev, slot, pin);
  113. if (irq != -1)
  114. return irq;
  115. /*
  116. * PCI isn't used on the Kuro
  117. */
  118. return -1;
  119. }
  120. static struct hw_pci kurobox_pro_pci __initdata = {
  121. .nr_controllers = 2,
  122. .setup = orion5x_pci_sys_setup,
  123. .scan = orion5x_pci_sys_scan_bus,
  124. .map_irq = kurobox_pro_pci_map_irq,
  125. };
  126. static int __init kurobox_pro_pci_init(void)
  127. {
  128. if (machine_is_kurobox_pro()) {
  129. orion5x_pci_disable();
  130. pci_common_init(&kurobox_pro_pci);
  131. }
  132. return 0;
  133. }
  134. subsys_initcall(kurobox_pro_pci_init);
  135. /*****************************************************************************
  136. * Ethernet
  137. ****************************************************************************/
  138. static struct mv643xx_eth_platform_data kurobox_pro_eth_data = {
  139. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  140. };
  141. /*****************************************************************************
  142. * RTC 5C372a on I2C bus