board-ts219.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. *
  3. * QNAP TS-11x/TS-21x Turbo NAS Board Setup via DT
  4. *
  5. * Copyright (C) 2012 Andrew Lunn <andrew@lunn.ch>
  6. *
  7. * Based on the board file ts219-setup.c:
  8. *
  9. * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com>
  10. * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com>
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License
  14. * as published by the Free Software Foundation; either version
  15. * 2 of the License, or (at your option) any later version.
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/mv643xx_eth.h>
  21. #include <linux/ata_platform.h>
  22. #include <linux/gpio_keys.h>
  23. #include <linux/input.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/mach/arch.h>
  26. #include <mach/kirkwood.h>
  27. #include "common.h"
  28. #include "tsx1x-common.h"
  29. static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = {
  30. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  31. };
  32. void __init qnap_dt_ts219_init(void)
  33. {
  34. u32 dev, rev;
  35. kirkwood_pcie_id(&dev, &rev);
  36. if (dev == MV88F6282_DEV_ID)
  37. qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
  38. kirkwood_ge00_init(&qnap_ts219_ge00_data);
  39. pm_power_off = qnap_tsx1x_power_off;
  40. }
  41. /* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */
  42. static int __init ts219_pci_init(void)
  43. {
  44. if (machine_is_ts219())
  45. kirkwood_pcie_init(KW_PCIE0);
  46. return 0;
  47. }
  48. subsys_initcall(ts219_pci_init);