sheevaplug-setup.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * arch/arm/mach-kirkwood/sheevaplug-setup.c
  3. *
  4. * Marvell SheevaPlug 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/mv643xx_eth.h>
  15. #include <linux/gpio.h>
  16. #include <linux/leds.h>
  17. #include <asm/mach-types.h>
  18. #include <asm/mach/arch.h>
  19. #include <mach/kirkwood.h>
  20. #include <plat/mvsdio.h>
  21. #include "common.h"
  22. #include "mpp.h"
  23. static struct mtd_partition sheevaplug_nand_parts[] = {
  24. {
  25. .name = "u-boot",
  26. .offset = 0,
  27. .size = SZ_1M
  28. }, {
  29. .name = "uImage",
  30. .offset = MTDPART_OFS_NXTBLK,
  31. .size = SZ_4M
  32. }, {
  33. .name = "root",
  34. .offset = MTDPART_OFS_NXTBLK,
  35. .size = MTDPART_SIZ_FULL
  36. },
  37. };
  38. static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
  39. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  40. };
  41. static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
  42. /* unfortunately the CD signal has not been connected */
  43. };
  44. static struct gpio_led sheevaplug_led_pins[] = {
  45. {
  46. .name = "plug:green:health",
  47. .default_trigger = "default-on",
  48. .gpio = 49,
  49. .active_low = 1,
  50. },
  51. };
  52. static struct gpio_led_platform_data sheevaplug_led_data = {
  53. .leds = sheevaplug_led_pins,
  54. .num_leds = ARRAY_SIZE(sheevaplug_led_pins),
  55. };
  56. static struct platform_device sheevaplug_leds = {
  57. .name = "leds-gpio",
  58. .id = -1,
  59. .dev = {
  60. .platform_data = &sheevaplug_led_data,
  61. }
  62. };
  63. static unsigned int sheevaplug_mpp_config[] __initdata = {
  64. MPP29_GPIO, /* USB Power Enable */
  65. MPP49_GPIO, /* LED */
  66. 0
  67. };
  68. static void __init sheevaplug_init(void)
  69. {
  70. /*
  71. * Basic setup. Needs to be called early.
  72. */
  73. kirkwood_init();
  74. kirkwood_mpp_conf(sheevaplug_mpp_config);
  75. kirkwood_uart0_init();
  76. kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
  77. if (gpio_request(29, "USB Power Enable") != 0 ||
  78. gpio_direction_output(29, 1) != 0)
  79. printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
  80. kirkwood_ehci_init();
  81. kirkwood_ge00_init(&sheevaplug_ge00_data);
  82. kirkwood_sdio_init(&sheevaplug_mvsdio_data);
  83. platform_device_register(&sheevaplug_leds);
  84. }
  85. MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
  86. /* Maintainer: shadi Ammouri <shadi@marvell.com> */
  87. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  88. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  89. .boot_params = 0x00000100,
  90. .init_machine = sheevaplug_init,
  91. .map_io = kirkwood_map_io,
  92. .init_irq = kirkwood_init_irq,
  93. .timer = &kirkwood_timer,
  94. MACHINE_END