board-dreamplug.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
  3. *
  4. * arch/arm/mach-kirkwood/board-dreamplug.c
  5. *
  6. * Marvell DreamPlug Reference Board Init for drivers not converted to
  7. * flattened device tree yet.
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/ata_platform.h>
  17. #include <linux/mv643xx_eth.h>
  18. #include <linux/of.h>
  19. #include <linux/of_address.h>
  20. #include <linux/of_fdt.h>
  21. #include <linux/of_irq.h>
  22. #include <linux/of_platform.h>
  23. #include <linux/gpio.h>
  24. #include <linux/leds.h>
  25. #include <linux/mtd/physmap.h>
  26. #include <linux/spi/flash.h>
  27. #include <linux/spi/spi.h>
  28. #include <asm/mach-types.h>
  29. #include <asm/mach/arch.h>
  30. #include <asm/mach/map.h>
  31. #include <mach/kirkwood.h>
  32. #include <mach/bridge-regs.h>
  33. #include <plat/mvsdio.h>
  34. #include "common.h"
  35. #include "mpp.h"
  36. static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
  37. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  38. };
  39. static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
  40. .phy_addr = MV643XX_ETH_PHY_ADDR(1),
  41. };
  42. static struct mv_sata_platform_data dreamplug_sata_data = {
  43. .n_ports = 1,
  44. };
  45. static struct mvsdio_platform_data dreamplug_mvsdio_data = {
  46. /* unfortunately the CD signal has not been connected */
  47. };
  48. static struct gpio_led dreamplug_led_pins[] = {
  49. {
  50. .name = "dreamplug:blue:bluetooth",
  51. .gpio = 47,
  52. .active_low = 1,
  53. },
  54. {
  55. .name = "dreamplug:green:wifi",
  56. .gpio = 48,
  57. .active_low = 1,
  58. },
  59. {
  60. .name = "dreamplug:green:wifi_ap",
  61. .gpio = 49,
  62. .active_low = 1,
  63. },
  64. };
  65. static struct gpio_led_platform_data dreamplug_led_data = {
  66. .leds = dreamplug_led_pins,
  67. .num_leds = ARRAY_SIZE(dreamplug_led_pins),
  68. };
  69. static struct platform_device dreamplug_leds = {
  70. .name = "leds-gpio",
  71. .id = -1,
  72. .dev = {
  73. .platform_data = &dreamplug_led_data,
  74. }
  75. };
  76. static unsigned int dreamplug_mpp_config[] __initdata = {
  77. MPP0_SPI_SCn,
  78. MPP1_SPI_MOSI,
  79. MPP2_SPI_SCK,
  80. MPP3_SPI_MISO,
  81. MPP47_GPIO, /* Bluetooth LED */
  82. MPP48_GPIO, /* Wifi LED */
  83. MPP49_GPIO, /* Wifi AP LED */
  84. 0
  85. };
  86. void __init dreamplug_init(void)
  87. {
  88. /*
  89. * Basic setup. Needs to be called early.
  90. */
  91. kirkwood_mpp_conf(dreamplug_mpp_config);
  92. kirkwood_ehci_init();
  93. kirkwood_ge00_init(&dreamplug_ge00_data);
  94. kirkwood_ge01_init(&dreamplug_ge01_data);
  95. kirkwood_sata_init(&dreamplug_sata_data);
  96. kirkwood_sdio_init(&dreamplug_mvsdio_data);
  97. platform_device_register(&dreamplug_leds);
  98. }