2 * Copyright 2012 (C), Michael Walle <michael@walle.cc>
4 * arch/arm/mach-kirkwood/board-lsxl.c
6 * Buffalo Linkstation LS-XHL and LS-CHLv2 init for drivers not
7 * converted to flattened device tree yet.
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.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/mv643xx_eth.h>
18 #include <linux/gpio.h>
22 static struct mv643xx_eth_platform_data lsxl_ge00_data = {
23 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
26 static struct mv643xx_eth_platform_data lsxl_ge01_data = {
27 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
30 static unsigned int lsxl_mpp_config[] __initdata = {
31 MPP10_GPO, /* HDD Power Enable */
32 MPP11_GPIO, /* USB Vbus Enable */
33 MPP18_GPO, /* FAN High Enable# */
34 MPP19_GPO, /* FAN Low Enable# */
35 MPP36_GPIO, /* Function Blue LED */
36 MPP37_GPIO, /* Alarm LED */
37 MPP38_GPIO, /* Info LED */
38 MPP39_GPIO, /* Power LED */
39 MPP40_GPIO, /* Fan Lock */
40 MPP41_GPIO, /* Function Button */
41 MPP42_GPIO, /* Power Switch */
42 MPP43_GPIO, /* Power Auto Switch */
43 MPP48_GPIO, /* Function Red LED */
48 * On the LS-XHL/LS-CHLv2, the shutdown process is following:
49 * - Userland monitors key events until the power switch goes to off position
51 * - U-boot starts and goes into an idle mode waiting for the user
52 * to move the switch to ON position
55 static void lsxl_power_off(void)
57 kirkwood_restart('h', NULL);
60 #define LSXL_GPIO_HDD_POWER 10
61 #define LSXL_GPIO_USB_POWER 11
63 void __init lsxl_init(void)
66 * Basic setup. Needs to be called early.
68 kirkwood_mpp_conf(lsxl_mpp_config);
70 /* usb and sata power on */
71 gpio_set_value(LSXL_GPIO_USB_POWER, 1);
72 gpio_set_value(LSXL_GPIO_HDD_POWER, 1);
75 kirkwood_ge00_init(&lsxl_ge00_data);
76 kirkwood_ge01_init(&lsxl_ge01_data);
78 /* register power-off method */
79 pm_power_off = lsxl_power_off;