guruplug-setup.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 <plat/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. };
  51. static struct gpio_led guruplug_led_pins[] = {
  52. {
  53. .name = "guruplug:red:health",
  54. .gpio = 46,
  55. .active_low = 1,
  56. },
  57. {
  58. .name = "guruplug:green:health",
  59. .gpio = 47,
  60. .active_low = 1,
  61. },
  62. {
  63. .name = "guruplug:red:wmode",
  64. .gpio = 48,
  65. .active_low = 1,
  66. },
  67. {
  68. .name = "guruplug:green:wmode",
  69. .gpio = 49,
  70. .active_low = 1,
  71. },
  72. };
  73. static struct gpio_led_platform_data guruplug_led_data = {
  74. .leds = guruplug_led_pins,
  75. .num_leds = ARRAY_SIZE(guruplug_led_pins),
  76. };
  77. static struct platform_device guruplug_leds = {
  78. .name = "leds-gpio",
  79. .id = -1,
  80. .dev = {
  81. .platform_data = &guruplug_led_data,
  82. }
  83. };
  84. static unsigned int guruplug_mpp_config[] __initdata = {
  85. MPP46_GPIO, /* M_RLED */
  86. MPP47_GPIO, /* M_GLED */
  87. MPP48_GPIO, /* B_RLED */
  88. MPP49_GPIO, /* B_GLED */
  89. 0
  90. };
  91. static void __init guruplug_init(void)
  92. {
  93. /*
  94. * Basic setup. Needs to be called early.
  95. */
  96. kirkwood_init();
  97. kirkwood_mpp_conf(guruplug_mpp_config);
  98. kirkwood_uart0_init();
  99. kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25);
  100. kirkwood_ehci_init();
  101. kirkwood_ge00_init(&guruplug_ge00_data);
  102. kirkwood_ge01_init(&guruplug_ge01_data);
  103. kirkwood_sata_init(&guruplug_sata_data);
  104. kirkwood_sdio_init(&guruplug_mvsdio_data);
  105. platform_device_register(&guruplug_leds);
  106. }
  107. MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
  108. /* Maintainer: Siddarth Gore <gores@marvell.com> */
  109. .atag_offset = 0x100,
  110. .init_machine = guruplug_init,
  111. .map_io = kirkwood_map_io,
  112. .init_early = kirkwood_init_early,
  113. .init_irq = kirkwood_init_irq,
  114. .timer = &kirkwood_timer,
  115. .restart = kirkwood_restart,
  116. MACHINE_END