board-dockstar.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * arch/arm/mach-kirkwood/board-dockstar.c
  3. *
  4. * Seagate FreeAgent Dockstar Board Init for drivers not converted to
  5. * flattened device tree yet.
  6. *
  7. * This file is licensed under the terms of the GNU General Public
  8. * License version 2. This program is licensed "as is" without any
  9. * warranty of any kind, whether express or implied.
  10. *
  11. * Copied and modified for Seagate GoFlex Net support by
  12. * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
  13. * GoFlex kernel patches.
  14. *
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/ata_platform.h>
  20. #include <linux/mv643xx_eth.h>
  21. #include <linux/of.h>
  22. #include <linux/of_address.h>
  23. #include <linux/of_fdt.h>
  24. #include <linux/of_irq.h>
  25. #include <linux/of_platform.h>
  26. #include <linux/gpio.h>
  27. #include <asm/mach-types.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/map.h>
  30. #include <mach/kirkwood.h>
  31. #include <mach/bridge-regs.h>
  32. #include <linux/platform_data/mmc-mvsdio.h>
  33. #include "common.h"
  34. #include "mpp.h"
  35. static struct mv643xx_eth_platform_data dockstar_ge00_data = {
  36. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  37. };
  38. static unsigned int dockstar_mpp_config[] __initdata = {
  39. MPP29_GPIO, /* USB Power Enable */
  40. MPP46_GPIO, /* LED green */
  41. MPP47_GPIO, /* LED orange */
  42. 0
  43. };
  44. void __init dockstar_dt_init(void)
  45. {
  46. /*
  47. * Basic setup. Needs to be called early.
  48. */
  49. kirkwood_mpp_conf(dockstar_mpp_config);
  50. if (gpio_request(29, "USB Power Enable") != 0 ||
  51. gpio_direction_output(29, 1) != 0)
  52. pr_err("can't setup GPIO 29 (USB Power Enable)\n");
  53. kirkwood_ehci_init();
  54. kirkwood_ge00_init(&dockstar_ge00_data);
  55. }