board-goflexnet.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
  3. *
  4. * arch/arm/mach-kirkwood/board-goflexnet.c
  5. *
  6. * Seagate GoFlext Net 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. * Copied and modified for Seagate GoFlex Net support by
  14. * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
  15. * GoFlex kernel patches.
  16. *
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/init.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/ata_platform.h>
  22. #include <linux/mv643xx_eth.h>
  23. #include <linux/of.h>
  24. #include <linux/of_address.h>
  25. #include <linux/of_fdt.h>
  26. #include <linux/of_irq.h>
  27. #include <linux/of_platform.h>
  28. #include <linux/gpio.h>
  29. #include <asm/mach-types.h>
  30. #include <asm/mach/arch.h>
  31. #include <asm/mach/map.h>
  32. #include <mach/kirkwood.h>
  33. #include <mach/bridge-regs.h>
  34. #include <linux/platform_data/mmc-mvsdio.h>
  35. #include "common.h"
  36. #include "mpp.h"
  37. static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
  38. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  39. };
  40. static unsigned int goflexnet_mpp_config[] __initdata = {
  41. MPP29_GPIO, /* USB Power Enable */
  42. MPP47_GPIO, /* LED Orange */
  43. MPP46_GPIO, /* LED Green */
  44. MPP45_GPIO, /* LED Left Capacity 3 */
  45. MPP44_GPIO, /* LED Left Capacity 2 */
  46. MPP43_GPIO, /* LED Left Capacity 1 */
  47. MPP42_GPIO, /* LED Left Capacity 0 */
  48. MPP41_GPIO, /* LED Right Capacity 3 */
  49. MPP40_GPIO, /* LED Right Capacity 2 */
  50. MPP39_GPIO, /* LED Right Capacity 1 */
  51. MPP38_GPIO, /* LED Right Capacity 0 */
  52. 0
  53. };
  54. void __init goflexnet_init(void)
  55. {
  56. /*
  57. * Basic setup. Needs to be called early.
  58. */
  59. kirkwood_mpp_conf(goflexnet_mpp_config);
  60. if (gpio_request(29, "USB Power Enable") != 0 ||
  61. gpio_direction_output(29, 1) != 0)
  62. pr_err("can't setup GPIO 29 (USB Power Enable)\n");
  63. kirkwood_ehci_init();
  64. kirkwood_ge00_init(&goflexnet_ge00_data);
  65. }