kernel.patches/3.3.8/v3.3-ARM-kirkwood-Add-support-for-Buffalo-LS-CHLv2.patch

279 lines
8.1 KiB
Diff
Raw Permalink Normal View History

2012-11-24 17:08:51 +01:00
diff -uNr linux-3.3.8-go.orig/arch/arm/mach-kirkwood/common.c linux-3.3.8-go/arch/arm/mach-kirkwood/common.c
--- linux-3.3.8-go.orig/arch/arm/mach-kirkwood/common.c 2012-11-22 21:47:03.726499285 +0100
+++ linux-3.3.8-go/arch/arm/mach-kirkwood/common.c 2012-11-22 21:50:05.917342298 +0100
@@ -31,6 +31,7 @@
#include <plat/common.h>
#include <plat/time.h>
#include <plat/addr-map.h>
+#include <asm/mach-types.h>
#include "common.h"
/*****************************************************************************
diff -uNr linux-3.3.8-go.orig/arch/arm/mach-kirkwood/include/mach/system.h linux-3.3.8-go/arch/arm/mach-kirkwood/include/mach/system.h
--- linux-3.3.8-go.orig/arch/arm/mach-kirkwood/include/mach/system.h 2012-11-22 21:47:03.725499297 +0100
+++ linux-3.3.8-go/arch/arm/mach-kirkwood/include/mach/system.h 2012-11-22 21:49:41.395632387 +0100
@@ -9,6 +9,10 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
+#include <linux/io.h>
+#include <asm/proc-fns.h>
+#include <mach/bridge-regs.h>
+
static inline void arch_idle(void)
{
cpu_do_idle();
diff -uNr linux-3.3.8-go.orig/arch/arm/mach-kirkwood/Kconfig linux-3.3.8-go/arch/arm/mach-kirkwood/Kconfig
--- linux-3.3.8-go.orig/arch/arm/mach-kirkwood/Kconfig 2012-11-22 21:47:03.726499285 +0100
+++ linux-3.3.8-go/arch/arm/mach-kirkwood/Kconfig 2012-11-22 21:47:26.775227628 +0100
@@ -148,6 +148,12 @@
Say 'Y' here if you want your kernel to support the
Buffalo LS-WVL/E-AP NAS
+config MACH_LINKSTATION_CHLV2
+ bool "Buffalo LS-CHLv2 Series"
+ help
+ Say 'Y' here if you want your kernel to support the
+ Buffalo LS-CHLv2 Series.
+
endmenu
endif
diff -uNr linux-3.3.8-go.orig/arch/arm/mach-kirkwood/lschlv2-setup.c linux-3.3.8-go/arch/arm/mach-kirkwood/lschlv2-setup.c
--- linux-3.3.8-go.orig/arch/arm/mach-kirkwood/lschlv2-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-3.3.8-go/arch/arm/mach-kirkwood/lschlv2-setup.c 2012-11-22 21:47:26.775227628 +0100
@@ -0,0 +1,211 @@
+/*
+ * arch/arm/mach-kirkwood/lschlv2-setup.c
+ *
+ * Buffalo LS Kirkwood Series Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/gpio.h>
+#include <linux/gpio_keys.h>
+#include <linux/init.h>
+#include <linux/input.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include "include/mach/system.h"
+#include <mach/kirkwood.h>
+#include "common.h"
+#include "mpp.h"
+
+/*****************************************************************************
+ * 512KB SPI Flash on BOOT Device
+ ****************************************************************************/
+static struct mtd_partition lschlv2_partitions[] = {
+ {
+ .name = "u-boot",
+ .offset = 0x00000,
+ .size = 0x70000,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ {
+ .name = "u-boot env",
+ .offset = MTDPART_OFS_APPEND,
+ .size = 0x10000,
+ }
+};
+
+static struct flash_platform_data lschlv2_spi_slave_data = {
+ .type = "m25p40",
+ .parts = lschlv2_partitions,
+ .nr_parts = ARRAY_SIZE(lschlv2_partitions),
+};
+
+static struct spi_board_info __initdata lschlv2_spi_slave_info[] = {
+ {
+ .modalias = "m25p80",
+ .platform_data = &lschlv2_spi_slave_data,
+ .irq = -1,
+ .max_speed_hz = 20000000,
+ .bus_num = 0,
+ .chip_select = 0,
+ }
+};
+
+static struct mv643xx_eth_platform_data lschlv2_ge00_data = {
+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data lschlv2_ge01_data = {
+ .phy_addr = MV643XX_ETH_PHY_ADDR(8),
+};
+
+static unsigned int lschlv2_mpp_config[] __initdata = {
+ MPP10_GPO, /* HDD Power */
+ MPP11_GPIO, /* USB Vbus Power */
+ MPP18_GPO, /* FAN High on:0, off:1 */
+ MPP19_GPO, /* FAN Low on:0, off:1 */
+ MPP36_GPIO, /* FUNC LED */
+ MPP37_GPIO, /* ALARM LED */
+ MPP38_GPIO, /* INFO LED */
+ MPP39_GPIO, /* POWER LED */
+ MPP40_GPIO, /* FAN LOCK */
+ MPP41_GPIO, /* FUNC SW */
+ MPP42_GPIO, /* POWER SW */
+ MPP43_GPIO, /* POWER AUTO SW */
+ MPP48_GPIO, /* FUNC RED LED */
+ MPP49_GPIO, /* UART EN */
+ 0
+};
+
+static struct mv_sata_platform_data lschlv2_sata_data = {
+ .n_ports = 1,
+};
+
+static struct gpio_led lschlv2_led_pins[] = {
+ {
+ .name = "func",
+ .gpio = 36,
+ .active_low = 1,
+ },
+ {
+ .name = "alarm",
+ .gpio = 37,
+ .active_low = 1,
+ },
+ {
+ .name = "info",
+ .gpio = 38,
+ .active_low = 1,
+ },
+ {
+ .name = "power",
+ .gpio = 39,
+ .default_trigger = "default-on",
+ .active_low = 1,
+ },
+ {
+ .name = "func2",
+ .gpio = 48,
+ .active_low = 1,
+ },
+};
+
+static struct gpio_led_platform_data lschlv2_led_data = {
+ .leds = lschlv2_led_pins,
+ .num_leds = ARRAY_SIZE(lschlv2_led_pins),
+};
+
+static struct platform_device lschlv2_leds = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &lschlv2_led_data,
+ }
+};
+
+#define LSCHLv2_GPIO_USB_VBUS_EN 11
+#define LSCHLv2_GPIO_KEY_FUNC 41
+
+static struct gpio_keys_button lschlv2_buttons[] = {
+ {
+ .code = KEY_OPTION,
+ .gpio = LSCHLv2_GPIO_KEY_FUNC,
+ .desc = "Function Button",
+ .active_low = 1,
+ },
+};
+
+static struct gpio_keys_platform_data lschlv2_button_data = {
+ .buttons = lschlv2_buttons,
+ .nbuttons = ARRAY_SIZE(lschlv2_buttons),
+};
+
+static struct platform_device lschlv2_button_device = {
+ .name = "gpio-keys",
+ .id = -1,
+ .num_resources = 0,
+ .dev = {
+ .platform_data = &lschlv2_button_data,
+ },
+};
+
+static void lschlv2_power_off(void)
+{
+ kirkwood_restart('h', NULL); //arch_reset(0, NULL);
+}
+
+static void __init lschlv2_init(void)
+{
+ /*
+ * Basic setup. Needs to be called early.
+ */
+ kirkwood_init();
+ kirkwood_mpp_conf(lschlv2_mpp_config);
+
+ kirkwood_uart0_init();
+
+ if (gpio_request(LSCHLv2_GPIO_USB_VBUS_EN, "USB Power Enable") != 0 ||
+ gpio_direction_output(LSCHLv2_GPIO_USB_VBUS_EN, 1) != 0)
+ printk(KERN_ERR "can't set up USB Power Enable\n");
+ kirkwood_ehci_init();
+
+ kirkwood_ge00_init(&lschlv2_ge00_data);
+ kirkwood_ge01_init(&lschlv2_ge01_data);
+
+ kirkwood_sata_init(&lschlv2_sata_data);
+
+ kirkwood_spi_init();
+
+ platform_device_register(&lschlv2_leds);
+ platform_device_register(&lschlv2_button_device);
+
+ spi_register_board_info(lschlv2_spi_slave_info,
+ ARRAY_SIZE(lschlv2_spi_slave_info));
+
+ /* register power-off method */
+ pm_power_off = lschlv2_power_off;
+
+ pr_info("%s: finished\n", __func__);
+}
+
+
+
+MACHINE_START(LINKSTATION_CHLV2, "Buffalo Linkstation LS-CHLv2")
+ .atag_offset = 0x100,
+ .init_machine = lschlv2_init,
+ .map_io = kirkwood_map_io,
+ .init_early = kirkwood_init_early,
+ .init_irq = kirkwood_init_irq,
+ .timer = &kirkwood_timer,
+ .restart = kirkwood_restart,
+MACHINE_END
diff -uNr linux-3.3.8-go.orig/arch/arm/mach-kirkwood/Makefile linux-3.3.8-go/arch/arm/mach-kirkwood/Makefile
--- linux-3.3.8-go.orig/arch/arm/mach-kirkwood/Makefile 2012-11-22 21:47:03.726499285 +0100
+++ linux-3.3.8-go/arch/arm/mach-kirkwood/Makefile 2012-11-22 21:47:26.775227628 +0100
@@ -18,6 +18,7 @@
obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o lacie_v2-common.o
obj-$(CONFIG_MACH_T5325) += t5325-setup.o
+obj-$(CONFIG_MACH_LINKSTATION_CHLV2) += lschlv2-setup.o
obj-$(CONFIG_MACH_LSXHL) += lsxhl-setup.o
obj-$(CONFIG_MACH_LSVL) += lsvl-setup.o
obj-$(CONFIG_MACH_LSWVL) += lswvl-setup.o
diff -uNr linux-3.3.8-go.orig/arch/arm/tools/mach-types linux-3.3.8-go/arch/arm/tools/mach-types
--- linux-3.3.8-go.orig/arch/arm/tools/mach-types 2012-11-24 05:06:18.763371700 +0100
+++ linux-3.3.8-go/arch/arm/tools/mach-types 2012-11-24 05:06:59.092895630 +0100
@@ -522,6 +522,7 @@
dockstar MACH_DOCKSTAR DOCKSTAR 2998
ti8148evm MACH_TI8148EVM TI8148EVM 3004
seaboard MACH_SEABOARD SEABOARD 3005
+linkstation_chlv2 MACH_LINKSTATION_CHLV2 LINKSTATION_CHLV2 3006
mx53_ard MACH_MX53_ARD MX53_ARD 3010
mx53_smd MACH_MX53_SMD MX53_SMD 3011
msm8x60_rumi3 MACH_MSM8X60_RUMI3 MSM8X60_RUMI3 3016