guruplug-setup.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * arch/arm/mach-kirkwood/guruplug-setup.c
  3. *
  4. * Marvell GuruPlug Reference Board Setup
  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/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/mtd/partitions.h>
  14. #include <linux/ata_platform.h>
  15. #include <linux/mv643xx_eth.h>
  16. #include <linux/gpio.h>
  17. #include <linux/leds.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include <mach/kirkwood.h>
  21. #include <linux/platform_data/mmc-mvsdio.h>
  22. #include "common.h"
  23. #include "mpp.h"
  24. static struct mtd_partition guruplug_nand_parts[] = {
  25. {
  26. .name = "u-boot",
  27. .offset = 0,
  28. .size = SZ_1M
  29. }, {
  30. .name = "uImage",
  31. .offset = MTDPART_OFS_NXTBLK,
  32. .size = SZ_4M
  33. }, {
  34. .name = "root",
  35. .offset = MTDPART_OFS_NXTBLK,
  36. .size = MTDPART_SIZ_FULL
  37. },
  38. };
  39. static struct mv643xx_eth_platform_data guruplug_ge00_data = {
  40. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  41. };
  42. static struct mv643xx_eth_platform_data guruplug_ge01_data = {
  43. .phy_addr = MV643XX_ETH_PHY_ADDR(1),
  44. };
  45. static struct mv_sata_platform_data guruplug_sata_data = {
  46. .n_ports = 1,
  47. };
  48. static struct mvsdio_platform_data guruplug_mvsdio_data = {
  49. /* unfortunately the CD signal has not been connected */
  50. .gpio_card_detect = -1,
  51. .gpio_write_protect = -1,
  52. };
  53. static struct gpio_led guruplug_led_pins[] = {
  54. {
  55. .name = "guruplug:red:health",
  56. .gpio = 46,
  57. .active_low = 1,
  58. },
  59. {
  60. .name = "guruplug:green:health",
  61. .gpio = 47,
  62. .active_low = 1,
  63. },
  64. {
  65. .name = "guruplug:red:wmode",
  66. .gpio = 48,
  67. .active_low = 1,
  68. },
  69. {
  70. .name = "guruplug:green:wmode",
  71. .gpio = 49,
  72. .active_low = 1,
  73. },
  74. };
  75. static struct gpio_led_platform_data guruplug_led_data = {
  76. .leds = guruplug_led_pins,
  77. .num_leds = ARRAY_SIZE(guruplug_led_pins),
  78. };
  79. static struct platform_device guruplug_leds = {
  80. .name = "leds-gpio",
  81. .id = -1,
  82. .dev = {
  83. .platform_data = &guruplug_led_data,
  84. }
  85. };
  86. static unsigned int guruplug_mpp_config[] __initdata = {
  87. MPP46_GPIO, /* M_RLED */
  88. MPP47_GPIO, /* M_GLED */
  89. MPP48_GPIO, /* B_RLED */
  90. MPP49_GPIO, /* B_GLED */
  91. 0
  92. };
  93. static void __init guruplug_init(void)
  94. {
  95. /*
  96. * Basic setup. Needs to be called early.
  97. */
  98. kirkwood_init();
  99. kirkwood_mpp_conf(guruplug_mpp_config);
  100. kirkwood_uart0_init();
  101. kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25);
  102. kirkwood_ehci_init();
  103. kirkwood_ge00_init(&guruplug_ge00_data);
  104. kirkwood_ge01_init(&guruplug_ge01_data);
  105. kirkwood_sata_init(&guruplug_sata_data);
  106. kirkwood_sdio_init(&guruplug_mvsdio_data);
  107. platform_device_register(&guruplug_leds);
  108. }
  109. MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
  110. /* Maintainer: Siddarth Gore <gores@marvell.com> */
  111. .atag_offset = 0x100,
  112. .init_machine = guruplug_init,
  113. .map_io = kirkwood_map_io,
  114. .init_early = kirkwood_init_early,
  115. .init_irq = kirkwood_init_irq,
  116. .init_time = kirkwood_timer_init,
  117. .restart = kirkwood_restart,
  118. MACHINE_END