board-lsxl.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright 2012 (C), Michael Walle <michael@walle.cc>
  3. *
  4. * arch/arm/mach-kirkwood/board-lsxl.c
  5. *
  6. * Buffalo Linkstation LS-XHL and LS-CHLv2 init for drivers not
  7. * converted to 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/mtd/partitions.h>
  17. #include <linux/ata_platform.h>
  18. #include <linux/spi/flash.h>
  19. #include <linux/spi/spi.h>
  20. #include <linux/mv643xx_eth.h>
  21. #include "common.h"
  22. #include "mpp.h"
  23. static struct mv643xx_eth_platform_data lsxl_ge00_data = {
  24. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  25. };
  26. static struct mv643xx_eth_platform_data lsxl_ge01_data = {
  27. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  28. };
  29. static unsigned int lsxl_mpp_config[] __initdata = {
  30. MPP10_GPO, /* HDD Power Enable */
  31. MPP11_GPIO, /* USB Vbus Enable */
  32. MPP18_GPO, /* FAN High Enable# */
  33. MPP19_GPO, /* FAN Low Enable# */
  34. MPP36_GPIO, /* Function Blue LED */
  35. MPP37_GPIO, /* Alarm LED */
  36. MPP38_GPIO, /* Info LED */
  37. MPP39_GPIO, /* Power LED */
  38. MPP40_GPIO, /* Fan Lock */
  39. MPP41_GPIO, /* Function Button */
  40. MPP42_GPIO, /* Power Switch */
  41. MPP43_GPIO, /* Power Auto Switch */
  42. MPP48_GPIO, /* Function Red LED */
  43. 0
  44. };
  45. /*
  46. * On the LS-XHL/LS-CHLv2, the shutdown process is following:
  47. * - Userland monitors key events until the power switch goes to off position
  48. * - The board reboots
  49. * - U-boot starts and goes into an idle mode waiting for the user
  50. * to move the switch to ON position
  51. *
  52. */
  53. static void lsxl_power_off(void)
  54. {
  55. kirkwood_restart('h', NULL);
  56. }
  57. void __init lsxl_init(void)
  58. {
  59. /*
  60. * Basic setup. Needs to be called early.
  61. */
  62. kirkwood_mpp_conf(lsxl_mpp_config);
  63. kirkwood_ge00_init(&lsxl_ge00_data);
  64. kirkwood_ge01_init(&lsxl_ge01_data);
  65. /* register power-off method */
  66. pm_power_off = lsxl_power_off;
  67. }