board-goflexnet.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/mv643xx_eth.h>
  21. #include <linux/gpio.h>
  22. #include "common.h"
  23. #include "mpp.h"
  24. static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
  25. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  26. };
  27. static unsigned int goflexnet_mpp_config[] __initdata = {
  28. MPP29_GPIO, /* USB Power Enable */
  29. MPP47_GPIO, /* LED Orange */
  30. MPP46_GPIO, /* LED Green */
  31. MPP45_GPIO, /* LED Left Capacity 3 */
  32. MPP44_GPIO, /* LED Left Capacity 2 */
  33. MPP43_GPIO, /* LED Left Capacity 1 */
  34. MPP42_GPIO, /* LED Left Capacity 0 */
  35. MPP41_GPIO, /* LED Right Capacity 3 */
  36. MPP40_GPIO, /* LED Right Capacity 2 */
  37. MPP39_GPIO, /* LED Right Capacity 1 */
  38. MPP38_GPIO, /* LED Right Capacity 0 */
  39. 0
  40. };
  41. void __init goflexnet_init(void)
  42. {
  43. /*
  44. * Basic setup. Needs to be called early.
  45. */
  46. kirkwood_mpp_conf(goflexnet_mpp_config);
  47. if (gpio_request(29, "USB Power Enable") != 0 ||
  48. gpio_direction_output(29, 1) != 0)
  49. pr_err("can't setup GPIO 29 (USB Power Enable)\n");
  50. kirkwood_ehci_init();
  51. kirkwood_ge00_init(&goflexnet_ge00_data);
  52. }