diff --git a/core/linux-kirkwood/PKGBUILD b/core/linux-kirkwood/PKGBUILD index 0eca4c300..10e184894 100644 --- a/core/linux-kirkwood/PKGBUILD +++ b/core/linux-kirkwood/PKGBUILD @@ -7,7 +7,7 @@ pkgbase=linux-kirkwood pkgname=('linux-kirkwood' 'linux-headers-kirkwood') #pkgname=linux-test # Build kernel with a different name _kernelname=${pkgname#linux} -_basekernel=3.5.2 +_basekernel=3.5.3 pkgver=${_basekernel} pkgrel=1 cryptover=1.5 @@ -25,11 +25,11 @@ source=("ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-${_basekernel}.tar.bz2 'change-default-console-loglevel.patch' 'usb-add-reset-resume-quirk-for-several-webcams.patch' "http://download.gna.org/cryptodev-linux/cryptodev-linux-${cryptover}.tar.gz") -md5sums=('f0341109ba14a8f9f455c131ccc8ddd3' - 'f483cfe0a98fdf9075e0d9e9574ae1be' +md5sums=('925bc1a6e2c98cb1e4d9ed8d30986dfb' + '468b0f29653a18d9debd17c99086dc4f' 'f5d3635da03cb45904bedd69b47133de' '227356bd0efdc6b9a6925d46b3701141' - '90e89427b0395f6886cfaed8ee6f0104' + 'd6ac249788b8fd06c71783464b6678b2' '9506a43fff451fda36d5d7b1f5eaed04' '9d3c56a4b999c8bfbd4018089a62f662' 'd00814b57448895e65fbbc800e8a58ba' diff --git a/core/linux-kirkwood/archlinuxarm.patch b/core/linux-kirkwood/archlinuxarm.patch index 498bda4ce..0c3426cf1 100644 --- a/core/linux-kirkwood/archlinuxarm.patch +++ b/core/linux-kirkwood/archlinuxarm.patch @@ -1,5 +1,5 @@ diff -ruN a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts ---- a/arch/arm/boot/dts/kirkwood-iconnect.dts 2012-08-09 11:23:56.000000000 -0400 +--- a/arch/arm/boot/dts/kirkwood-iconnect.dts 2012-08-25 22:32:13.000000000 -0400 +++ b/arch/arm/boot/dts/kirkwood-iconnect.dts 1969-12-31 19:00:00.000000000 -0500 @@ -1,26 +0,0 @@ -/dts-v1/; @@ -29,8 +29,8 @@ diff -ruN a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood - }; -}; diff -ruN a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c ---- a/arch/arm/mach-kirkwood/board-dt.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/board-dt.c 2012-08-10 14:00:08.000000000 -0400 +--- a/arch/arm/mach-kirkwood/board-dt.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/board-dt.c 2012-09-06 13:36:28.000000000 -0400 @@ -62,9 +62,6 @@ if (of_machine_is_compatible("dlink,dns-kirkwood")) dnskw_init(); @@ -42,7 +42,7 @@ diff -ruN a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt. ib62x0_init(); diff -ruN a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c ---- a/arch/arm/mach-kirkwood/board-iconnect.c 2012-08-09 11:23:56.000000000 -0400 +--- a/arch/arm/mach-kirkwood/board-iconnect.c 2012-08-25 22:32:13.000000000 -0400 +++ b/arch/arm/mach-kirkwood/board-iconnect.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,162 +0,0 @@ -/* @@ -208,8 +208,8 @@ diff -ruN a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/boa -} -subsys_initcall(iconnect_pci_init); diff -ruN a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h ---- a/arch/arm/mach-kirkwood/common.h 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/common.h 2012-08-10 13:56:00.000000000 -0400 +--- a/arch/arm/mach-kirkwood/common.h 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/common.h 2012-09-06 13:36:28.000000000 -0400 @@ -65,12 +65,6 @@ static inline void dnskw_init(void) {}; #endif @@ -224,8 +224,8 @@ diff -ruN a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h void ib62x0_init(void); #else diff -ruN a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c ---- a/arch/arm/mach-kirkwood/dockstar-setup.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/dockstar-setup.c 2012-08-10 10:47:31.000000000 -0400 +--- a/arch/arm/mach-kirkwood/dockstar-setup.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/dockstar-setup.c 2012-09-06 13:36:28.000000000 -0400 @@ -29,6 +29,10 @@ .offset = 0, .size = SZ_1M @@ -271,7 +271,7 @@ diff -ruN a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/doc diff -ruN a/arch/arm/mach-kirkwood/goflexhome-setup.c b/arch/arm/mach-kirkwood/goflexhome-setup.c --- a/arch/arm/mach-kirkwood/goflexhome-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/goflexhome-setup.c 2012-08-10 11:00:53.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/goflexhome-setup.c 2012-09-06 14:14:44.000000000 -0400 @@ -0,0 +1,124 @@ +/* + * arch/arm/mach-kirkwood/goflexhome-setup.c @@ -399,7 +399,7 @@ diff -ruN a/arch/arm/mach-kirkwood/goflexhome-setup.c b/arch/arm/mach-kirkwood/g + diff -ruN a/arch/arm/mach-kirkwood/goflexnet-setup.c b/arch/arm/mach-kirkwood/goflexnet-setup.c --- a/arch/arm/mach-kirkwood/goflexnet-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/goflexnet-setup.c 2012-08-10 11:01:57.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/goflexnet-setup.c 2012-09-06 14:14:20.000000000 -0400 @@ -0,0 +1,177 @@ +/* + * arch/arm/mach-kirkwood/goflexnet-setup.c @@ -579,8 +579,8 @@ diff -ruN a/arch/arm/mach-kirkwood/goflexnet-setup.c b/arch/arm/mach-kirkwood/go +MACHINE_END + diff -ruN a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c ---- a/arch/arm/mach-kirkwood/guruplug-setup.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/guruplug-setup.c 2012-08-10 11:03:53.000000000 -0400 +--- a/arch/arm/mach-kirkwood/guruplug-setup.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/guruplug-setup.c 2012-09-06 13:36:28.000000000 -0400 @@ -57,22 +57,24 @@ static struct gpio_led guruplug_led_pins[] = { @@ -612,7 +612,7 @@ diff -ruN a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/gur }, diff -ruN a/arch/arm/mach-kirkwood/iconnect-setup.c b/arch/arm/mach-kirkwood/iconnect-setup.c --- a/arch/arm/mach-kirkwood/iconnect-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/iconnect-setup.c 2012-08-10 11:05:01.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/iconnect-setup.c 2012-09-06 13:36:28.000000000 -0400 @@ -0,0 +1,204 @@ +/* + * arch/arm/mach-kirkwood/iconnect-setup.c @@ -820,7 +820,7 @@ diff -ruN a/arch/arm/mach-kirkwood/iconnect-setup.c b/arch/arm/mach-kirkwood/ico +MACHINE_END diff -ruN a/arch/arm/mach-kirkwood/ionics-stratus-setup.c b/arch/arm/mach-kirkwood/ionics-stratus-setup.c --- a/arch/arm/mach-kirkwood/ionics-stratus-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/ionics-stratus-setup.c 2012-08-10 11:05:45.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/ionics-stratus-setup.c 2012-09-06 13:36:28.000000000 -0400 @@ -0,0 +1,137 @@ +/* + * arch/arm/mach-kirkwood/ionics-stratus-setup.c @@ -960,8 +960,8 @@ diff -ruN a/arch/arm/mach-kirkwood/ionics-stratus-setup.c b/arch/arm/mach-kirkwo + .restart = kirkwood_restart, +MACHINE_END diff -ruN a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig ---- a/arch/arm/mach-kirkwood/Kconfig 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/Kconfig 2012-08-10 13:55:37.000000000 -0400 +--- a/arch/arm/mach-kirkwood/Kconfig 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/Kconfig 2012-09-06 13:42:40.000000000 -0400 @@ -58,12 +58,6 @@ Say 'Y' here if you want your kernel to support the Marvell DreamPlug (Flattened Device Tree). @@ -1030,9 +1030,28 @@ diff -ruN a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig config MACH_OPENRD bool +@@ -166,6 +208,18 @@ + Say 'Y' here if you want your kernel to support the + HP t5325 Thin Client. + ++config MACH_NSA310 ++ bool "ZyXEL NSA310 1-Bay Power Media Server" ++ help ++ Say 'Y' here if you want your kernel to support the ++ ZyXEL NSA310. ++ ++config MACH_NSA320 ++ bool "ZyXEL NSA320 2-Bay Power Media Server" ++ help ++ Say 'Y' here if you want your kernel to support the ++ ZyXel NSA320. ++ + endmenu + + endif diff -ruN a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile ---- a/arch/arm/mach-kirkwood/Makefile 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/Makefile 2012-08-10 14:01:03.000000000 -0400 +--- a/arch/arm/mach-kirkwood/Makefile 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/Makefile 2012-09-06 13:43:49.000000000 -0400 @@ -8,6 +8,14 @@ obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o @@ -1048,7 +1067,13 @@ diff -ruN a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o -@@ -22,6 +30,5 @@ +@@ -18,10 +26,11 @@ + 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_NSA310) += nsa310-setup.o ++obj-$(CONFIG_MACH_NSA320) += nsa320-setup.o + obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o @@ -1056,8 +1081,8 @@ diff -ruN a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o diff -ruN a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot ---- a/arch/arm/mach-kirkwood/Makefile.boot 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/Makefile.boot 2012-08-10 14:01:12.000000000 -0400 +--- a/arch/arm/mach-kirkwood/Makefile.boot 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/Makefile.boot 2012-09-06 13:36:29.000000000 -0400 @@ -5,5 +5,4 @@ dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb @@ -1065,8 +1090,8 @@ diff -ruN a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefi -dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb diff -ruN a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h ---- a/arch/arm/mach-kirkwood/mpp.h 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/mpp.h 2012-08-10 11:10:55.000000000 -0400 +--- a/arch/arm/mach-kirkwood/mpp.h 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/mpp.h 2012-09-06 13:36:29.000000000 -0400 @@ -102,7 +102,7 @@ #define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 0, 0, 1, 1, 1, 1 ) @@ -1078,7 +1103,7 @@ diff -ruN a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h #define MPP12_SPI_MOSI MPP( 12, 0xb, 0, 0, 0, 0, 0, 0, 1 ) diff -ruN a/arch/arm/mach-kirkwood/nas6210-setup.c b/arch/arm/mach-kirkwood/nas6210-setup.c --- a/arch/arm/mach-kirkwood/nas6210-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/nas6210-setup.c 2012-08-10 11:12:03.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/nas6210-setup.c 2012-09-06 13:36:29.000000000 -0400 @@ -0,0 +1,186 @@ +/* + * arch/arm/mach-kirkwood/nas6210-setup.c @@ -1266,9 +1291,624 @@ diff -ruN a/arch/arm/mach-kirkwood/nas6210-setup.c b/arch/arm/mach-kirkwood/nas6 + .timer = &kirkwood_timer, + .restart = kirkwood_restart, +MACHINE_END +diff -ruN a/arch/arm/mach-kirkwood/nsa310-setup.c b/arch/arm/mach-kirkwood/nsa310-setup.c +--- a/arch/arm/mach-kirkwood/nsa310-setup.c 1969-12-31 19:00:00.000000000 -0500 ++++ b/arch/arm/mach-kirkwood/nsa310-setup.c 2012-09-06 14:12:34.000000000 -0400 +@@ -0,0 +1,299 @@ ++/* ++ * arch/arm/mach-kirkwood/nsa310-setup.c ++ * ++ * ZyXEL NSA310 1-Bay Power Media Server 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include /* for SPEED_1000, DUPLEX_FULL */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "common.h" ++#include "mpp.h" ++ ++static struct mtd_partition nsa310_nand_parts[] = { ++ { ++ .name = "uboot", ++ .offset = 0, ++ .size = SZ_1M, ++ .mask_flags = MTD_WRITEABLE ++ }, { ++ .name = "uboot_env", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = SZ_512K ++ }, { ++ .name = "key_store", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = SZ_512K ++ }, { ++ .name = "info", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = SZ_512K ++ }, { ++ .name = "etc", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 10 * SZ_1M ++ }, { ++ .name = "kernel_1", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 10 * SZ_1M ++ }, { ++ .name = "rootfs1", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 48 * SZ_1M - SZ_256K ++ }, { ++ .name = "kernel_2", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 10 * SZ_1M ++ }, { ++ .name = "rootfs2", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 48 * SZ_1M - SZ_256K ++ }, ++}; ++ ++static struct mv_sata_platform_data nsa310_sata_data = { ++ .n_ports = 2, ++}; ++ ++static struct gpio_keys_button nsa310_button_pins[] = { ++ { ++ .code = KEY_RESTART, ++ .gpio = 36, ++ .desc = "Reset", ++ .active_low = 1, ++ }, { ++ .code = KEY_COPY, ++ .gpio = 37, ++ .desc = "Copy", ++ .active_low = 1, ++ }, { ++ .code = KEY_POWER, ++ .gpio = 46, ++ .desc = "Power", ++ .active_low = 0, ++ }, ++}; ++ ++static struct gpio_keys_platform_data nsa310_button_data = { ++ .buttons = nsa310_button_pins, ++ .nbuttons = ARRAY_SIZE(nsa310_button_pins), ++}; ++ ++static struct platform_device nsa310_buttons = { ++ .name = "gpio-keys", ++ .id = -1, ++ .num_resources = 0, ++ .dev = { ++ .platform_data = &nsa310_button_data, ++ }, ++}; ++ ++static struct gpio_led nsa310_led_pins[] = { ++ { ++ .name = "nsa310:green:hdd2", ++ .default_trigger = "default-off", ++ .gpio = 12, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:red:hdd2", ++ .default_trigger = "default-off", ++ .gpio = 13, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:green:usb", ++ .default_trigger = "default-off", ++ .gpio = 15, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:green:sys", ++ .default_trigger = "default-off", ++ .gpio = 28, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:orange:sys", ++ .default_trigger = "default-on", ++ .gpio = 29, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:green:copy", ++ .default_trigger = "default-off", ++ .gpio = 39, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:red:copy", ++ .default_trigger = "default-off", ++ .gpio = 40, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:green:hdd1", ++ .default_trigger = "default-off", ++ .gpio = 41, ++ .active_low = 0, ++ }, { ++ .name = "nsa310:red:hdd1", ++ .default_trigger = "default-off", ++ .gpio = 42, ++ .active_low = 0, ++ }, ++}; ++ ++static struct gpio_led_platform_data nsa310_led_data = { ++ .leds = nsa310_led_pins, ++ .num_leds = ARRAY_SIZE(nsa310_led_pins), ++}; ++ ++static struct platform_device nsa310_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = &nsa310_led_data, ++ }, ++}; ++ ++static struct nsa3xx_hwmon_platform_data nsa310_hwmon_data = { ++ /* GPIOs connected to Holtek HT46R065 MCU */ ++ .act_pin = 17, ++ .clk_pin = 16, ++ .data_pin = 14, ++}; ++ ++static struct platform_device nsa310_hwmon = { ++ .name = "nsa3xx-hwmon", ++ .id = -1, ++ .num_resources = 0, ++ .dev = { ++ .platform_data = &nsa310_hwmon_data, ++ }, ++}; ++ ++static unsigned int nsa310_mpp_config[] __initdata = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_GPO, ++ MPP8_TW0_SDA, /* PCF8563 RTC chip */ ++ MPP9_TW0_SCK, /* connected to TWSI */ ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_GPO, /* HDD2 LED (green) */ ++ MPP13_GPIO, /* HDD2 LED (red) */ ++ MPP14_GPIO, /* MCU DATA pin (in) */ ++ MPP15_GPIO, /* USB LED (green) */ ++ MPP16_GPIO, /* MCU CLK pin (out) */ ++ MPP17_GPIO, /* MCU ACT pin (out) */ ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GPIO, ++ MPP21_GPIO, /* USB power */ ++ MPP22_GPIO, ++ MPP23_GPIO, ++ MPP24_GPIO, ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, /* SYS LED (green) */ ++ MPP29_GPIO, /* SYS LED (orange) */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPO, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_GPIO, /* reset button */ ++ MPP37_GPIO, /* copy button */ ++ MPP38_GPIO, /* VID B0 */ ++ MPP39_GPIO, /* COPY LED (green) */ ++ MPP40_GPIO, /* COPY LED (red) */ ++ MPP41_GPIO, /* HDD1 LED (green) */ ++ MPP42_GPIO, /* HDD1 LED (red) */ ++ MPP43_GPIO, /* HTP pin */ ++ MPP44_GPIO, /* buzzer */ ++ MPP45_GPIO, /* VID B1 */ ++ MPP46_GPIO, /* power button */ ++ MPP47_GPIO, /* power resume data */ ++ MPP48_GPIO, /* power off */ ++ MPP49_GPIO, /* power resume clock */ ++ 0 ++}; ++ ++#define NSA310_GPIO_USB_POWER 21 ++#define NSA310_GPIO_POWER_OFF 48 ++ ++static void nsa310_power_off(void) ++{ ++ gpio_set_value(NSA310_GPIO_POWER_OFF, 1); ++} ++ ++static int __initdata usb_power = 1; /* default "on" */ ++ ++static int __init nsa310_usb_power(char *str) ++{ ++ usb_power = strncmp(str, "off", 3) ? 1 : 0; ++ return 1; ++} ++/* Parse boot_command_line string nsa310_usb_power=on|off */ ++__setup("nsa310_usb_power=", nsa310_usb_power); ++ ++static void __init nsa310_init(void) ++{ ++ /* ++ * Basic setup. Needs to be called early. ++ */ ++ kirkwood_init(); ++ kirkwood_mpp_conf(nsa310_mpp_config); ++ ++ kirkwood_uart0_init(); ++ kirkwood_nand_init(ARRAY_AND_SIZE(nsa310_nand_parts), 40); ++ ++ kirkwood_i2c_init(); ++ ++ if (gpio_request(NSA310_GPIO_USB_POWER, "USB Power Enable") || ++ gpio_direction_output(NSA310_GPIO_USB_POWER, usb_power)) ++ pr_err("nsa310: failed to configure USB power enable GPIO)\n"); ++ gpio_free(NSA310_GPIO_USB_POWER); ++ ++ kirkwood_ehci_init(); ++ kirkwood_sata_init(&nsa310_sata_data); ++ platform_device_register(&nsa310_leds); ++ platform_device_register(&nsa310_buttons); ++ platform_device_register(&nsa310_hwmon); ++ ++ if (gpio_request(NSA310_GPIO_POWER_OFF, "power-off") || ++ gpio_direction_output(NSA310_GPIO_POWER_OFF, 0)) ++ pr_err("nsa310: failed to configure power-off GPIO\n"); ++ else ++ pm_power_off = nsa310_power_off; ++} ++ ++MACHINE_START(NSA310, "ZyXEL NSA310 1-Bay Power Media Server") ++ /* Maintainer: Peter Oostewechel */ ++ .atag_offset = 0x100, ++ .init_machine = nsa310_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 -ruN a/arch/arm/mach-kirkwood/nsa320-setup.c b/arch/arm/mach-kirkwood/nsa320-setup.c +--- a/arch/arm/mach-kirkwood/nsa320-setup.c 1969-12-31 19:00:00.000000000 -0500 ++++ b/arch/arm/mach-kirkwood/nsa320-setup.c 2012-09-06 14:13:43.000000000 -0400 +@@ -0,0 +1,308 @@ ++/* ++ * arch/arm/mach-kirkwood/nsa320-setup.c ++ * ++ * ZyXEL NSA320 2-Bay Power Media Server 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "common.h" ++#include "mpp.h" ++ ++static struct mtd_partition nsa320_nand_parts[] = { ++ { ++ .name = "uboot", ++ .offset = 0, ++ .size = SZ_1M, ++ .mask_flags = MTD_WRITEABLE ++ }, { ++ .name = "uboot_env", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = SZ_512K ++ }, { ++ .name = "key_store", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = SZ_512K ++ }, { ++ .name = "info", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = SZ_512K ++ }, { ++ .name = "etc", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 10 * SZ_1M ++ }, { ++ .name = "kernel_1", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 10 * SZ_1M ++ }, { ++ .name = "rootfs1", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 48 * SZ_1M - SZ_256K ++ }, { ++ .name = "kernel_2", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 10 * SZ_1M ++ }, { ++ .name = "rootfs2", ++ .offset = MTDPART_OFS_NXTBLK, ++ .size = 48 * SZ_1M - SZ_256K ++ }, ++}; ++ ++static struct i2c_board_info __initdata nsa320_i2c_rtc = { ++ I2C_BOARD_INFO("pcf8563", 0x51), ++}; ++ ++static struct mv643xx_eth_platform_data nsa320_ge00_data = { ++ .phy_addr = MV643XX_ETH_PHY_ADDR(1), ++}; ++ ++static struct mv_sata_platform_data nsa320_sata_data = { ++ .n_ports = 2, ++}; ++ ++static struct gpio_keys_button nsa320_button_pins[] = { ++ { ++ .code = KEY_RESTART, ++ .gpio = 36, ++ .desc = "Reset", ++ .active_low = 1, ++ }, { ++ .code = KEY_COPY, ++ .gpio = 37, ++ .desc = "Copy", ++ .active_low = 1, ++ }, { ++ .code = KEY_POWER, ++ .gpio = 46, ++ .desc = "Power", ++ .active_low = 0, ++ }, ++}; ++ ++static struct gpio_keys_platform_data nsa320_button_data = { ++ .buttons = nsa320_button_pins, ++ .nbuttons = ARRAY_SIZE(nsa320_button_pins), ++}; ++ ++static struct platform_device nsa320_buttons = { ++ .name = "gpio-keys", ++ .id = -1, ++ .num_resources = 0, ++ .dev = { ++ .platform_data = &nsa320_button_data, ++ }, ++}; ++ ++static struct gpio_led nsa320_led_pins[] = { ++ { ++ .name = "nsa320:green:hdd2", ++ .default_trigger = "default-off", ++ .gpio = 12, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:red:hdd2", ++ .default_trigger = "default-off", ++ .gpio = 13, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:green:usb", ++ .default_trigger = "default-off", ++ .gpio = 15, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:green:sys", ++ .default_trigger = "default-off", ++ .gpio = 28, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:orange:sys", ++ .default_trigger = "default-on", ++ .gpio = 29, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:green:copy", ++ .default_trigger = "default-off", ++ .gpio = 39, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:red:copy", ++ .default_trigger = "default-off", ++ .gpio = 40, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:green:hdd1", ++ .default_trigger = "default-off", ++ .gpio = 41, ++ .active_low = 0, ++ }, { ++ .name = "nsa320:red:hdd1", ++ .default_trigger = "default-off", ++ .gpio = 42, ++ .active_low = 0, ++ }, ++}; ++ ++static struct gpio_led_platform_data nsa320_led_data = { ++ .leds = nsa320_led_pins, ++ .num_leds = ARRAY_SIZE(nsa320_led_pins), ++}; ++ ++static struct platform_device nsa320_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = &nsa320_led_data, ++ }, ++}; ++ ++static struct nsa3xx_hwmon_platform_data nsa320_hwmon_data = { ++ /* GPIOs connected to Holtek HT46R065 MCU */ ++ .act_pin = 17, ++ .clk_pin = 16, ++ .data_pin = 14, ++}; ++ ++static struct platform_device nsa320_hwmon = { ++ .name = "nsa3xx-hwmon", ++ .id = -1, ++ .num_resources = 0, ++ .dev = { ++ .platform_data = &nsa320_hwmon_data, ++ }, ++}; ++ ++static unsigned int nsa320_mpp_config[] __initdata = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_GPO, ++ MPP8_TW0_SDA, /* PCF8563 RTC chip */ ++ MPP9_TW0_SCK, /* connected to TWSI */ ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_GPO, /* HDD2 LED (green) */ ++ MPP13_GPIO, /* HDD2 LED (red) */ ++ MPP14_GPIO, /* MCU DATA pin (in) */ ++ MPP15_GPIO, /* USB LED (green) */ ++ MPP16_GPIO, /* MCU CLK pin (out) */ ++ MPP17_GPIO, /* MCU ACT pin (out) */ ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GPIO, ++ MPP21_GPIO, /* USB power */ ++ MPP22_GPIO, ++ MPP23_GPIO, ++ MPP24_GPIO, ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, /* SYS LED (green) */ ++ MPP29_GPIO, /* SYS LED (orange) */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPO, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_GPIO, /* reset button */ ++ MPP37_GPIO, /* copy button */ ++ MPP38_GPIO, /* VID B0 */ ++ MPP39_GPIO, /* COPY LED (green) */ ++ MPP40_GPIO, /* COPY LED (red) */ ++ MPP41_GPIO, /* HDD1 LED (green) */ ++ MPP42_GPIO, /* HDD1 LED (red) */ ++ MPP43_GPIO, /* HTP pin */ ++ MPP44_GPIO, /* buzzer */ ++ MPP45_GPIO, /* VID B1 */ ++ MPP46_GPIO, /* power button */ ++ MPP47_GPIO, /* power resume data */ ++ MPP48_GPIO, /* power off */ ++ MPP49_GPIO, /* power resume clock */ ++ 0 ++}; ++ ++#define NSA320_GPIO_USB_POWER 21 ++#define NSA320_GPIO_POWER_OFF 48 ++ ++static void nsa320_power_off(void) ++{ ++ gpio_set_value(NSA320_GPIO_POWER_OFF, 1); ++} ++ ++static int __initdata usb_power = 1; /* default "on" */ ++ ++static int __init nsa320_usb_power(char *str) ++{ ++ usb_power = strncmp(str, "off", 3) ? 1 : 0; ++ return 1; ++} ++/* Parse boot_command_line string nsa320_usb_power=on|off */ ++__setup("nsa320_usb_power=", nsa320_usb_power); ++ ++static void __init nsa320_init(void) ++{ ++ /* ++ * Basic setup. Needs to be called early. ++ */ ++ kirkwood_init(); ++ kirkwood_mpp_conf(nsa320_mpp_config); ++ ++ kirkwood_uart0_init(); ++ kirkwood_nand_init(ARRAY_AND_SIZE(nsa320_nand_parts), 40); ++ ++ kirkwood_i2c_init(); ++ i2c_register_board_info(0, &nsa320_i2c_rtc, 1); ++ ++ if (gpio_request(NSA320_GPIO_USB_POWER, "USB Power Enable") || ++ gpio_direction_output(NSA320_GPIO_USB_POWER, usb_power)) ++ pr_err("nsa320: failed to configure USB power enable GPIO)\n"); ++ gpio_free(NSA320_GPIO_USB_POWER); ++ ++ kirkwood_ehci_init(); ++ kirkwood_ge00_init(&nsa320_ge00_data); ++ kirkwood_sata_init(&nsa320_sata_data); ++ platform_device_register(&nsa320_leds); ++ platform_device_register(&nsa320_buttons); ++ platform_device_register(&nsa320_hwmon); ++ ++ if (gpio_request(NSA320_GPIO_POWER_OFF, "power-off") || ++ gpio_direction_output(NSA320_GPIO_POWER_OFF, 0)) ++ pr_err("nsa320: failed to configure power-off GPIO\n"); ++ else ++ pm_power_off = nsa320_power_off; ++} ++ ++MACHINE_START(NSA320, "ZyXEL NSA320 2-Bay Power Media Server") ++ /* Maintainer: Peter Schildmann */ ++ .atag_offset = 0x100, ++ .init_machine = nsa320_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 -ruN a/arch/arm/mach-kirkwood/pogo_e02-setup.c b/arch/arm/mach-kirkwood/pogo_e02-setup.c --- a/arch/arm/mach-kirkwood/pogo_e02-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/pogo_e02-setup.c 2012-08-10 11:12:53.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/pogo_e02-setup.c 2012-09-06 13:36:29.000000000 -0400 @@ -0,0 +1,115 @@ +/* + * arch/arm/mach-kirkwood/pogo_e02-setup.c @@ -1387,7 +2027,7 @@ diff -ruN a/arch/arm/mach-kirkwood/pogo_e02-setup.c b/arch/arm/mach-kirkwood/pog +MACHINE_END diff -ruN a/arch/arm/mach-kirkwood/pogoplugv4-setup.c b/arch/arm/mach-kirkwood/pogoplugv4-setup.c --- a/arch/arm/mach-kirkwood/pogoplugv4-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/pogoplugv4-setup.c 2012-08-10 14:34:19.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/pogoplugv4-setup.c 2012-09-06 13:36:29.000000000 -0400 @@ -0,0 +1,194 @@ +/* + * arch/arm/mach-kirkwood/pogoplugv4-setup.c @@ -1584,8 +2224,8 @@ diff -ruN a/arch/arm/mach-kirkwood/pogoplugv4-setup.c b/arch/arm/mach-kirkwood/p + .restart = kirkwood_restart, +MACHINE_END diff -ruN a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c ---- a/arch/arm/mach-kirkwood/sheevaplug-setup.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c 2012-08-10 11:19:35.000000000 -0400 +--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c 2012-09-06 13:36:29.000000000 -0400 @@ -43,7 +43,7 @@ .phy_addr = MV643XX_ETH_PHY_ADDR(0), }; @@ -1666,7 +2306,7 @@ diff -ruN a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/s diff -ruN a/arch/arm/mach-kirkwood/topkick-setup.c b/arch/arm/mach-kirkwood/topkick-setup.c --- a/arch/arm/mach-kirkwood/topkick-setup.c 1969-12-31 19:00:00.000000000 -0500 -+++ b/arch/arm/mach-kirkwood/topkick-setup.c 2012-08-10 11:20:38.000000000 -0400 ++++ b/arch/arm/mach-kirkwood/topkick-setup.c 2012-09-06 13:36:29.000000000 -0400 @@ -0,0 +1,165 @@ +/* + * arch/arm/mach-kirkwood/topkick-setup.c @@ -1834,8 +2474,8 @@ diff -ruN a/arch/arm/mach-kirkwood/topkick-setup.c b/arch/arm/mach-kirkwood/topk + .restart = kirkwood_restart, +MACHINE_END diff -ruN a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c ---- a/arch/arm/plat-orion/common.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/arch/arm/plat-orion/common.c 2012-08-10 11:22:56.000000000 -0400 +--- a/arch/arm/plat-orion/common.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/arch/arm/plat-orion/common.c 2012-09-06 13:36:29.000000000 -0400 @@ -252,7 +252,9 @@ /***************************************************************************** * GE00 @@ -1847,9 +2487,298 @@ diff -ruN a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c static struct resource orion_ge00_shared_resources[] = { { +diff -ruN a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig +--- a/drivers/hwmon/Kconfig 2012-08-25 22:32:13.000000000 -0400 ++++ b/drivers/hwmon/Kconfig 2012-09-06 14:18:09.000000000 -0400 +@@ -1391,6 +1391,19 @@ + help + Support for the A/D converter on MC13783 and MC13892 PMIC. + ++config SENSORS_NSA3XX ++ tristate "ZyXEL NSA3xx fan speed and temperature sensors" ++ depends on (MACH_NSA310 || MACH_NSA320) && GENERIC_GPIO ++ help ++ If you say yes here you get support for hardware monitoring ++ for the ZyXEL NSA3XX Media Servers. ++ ++ The sensor data is taken from a Holtek HT46R065 microcontroller ++ connected to GPIO lines. ++ ++ This driver can also be built as a module. If so, the module ++ will be called nsa3xx-hwmon. ++ + if ACPI + + comment "ACPI drivers" +diff -ruN a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile +--- a/drivers/hwmon/Makefile 2012-08-25 22:32:13.000000000 -0400 ++++ b/drivers/hwmon/Makefile 2012-09-06 14:18:57.000000000 -0400 +@@ -96,6 +96,7 @@ + obj-$(CONFIG_SENSORS_MAX6642) += max6642.o + obj-$(CONFIG_SENSORS_MAX6650) += max6650.o + obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o ++obj-$(CONFIG_SENSORS_NSA3XX) += nsa3xx-hwmon.o + obj-$(CONFIG_SENSORS_MCP3021) += mcp3021.o + obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o + obj-$(CONFIG_SENSORS_PC87360) += pc87360.o +diff -ruN a/drivers/hwmon/nsa3xx-hwmon.c b/drivers/hwmon/nsa3xx-hwmon.c +--- a/drivers/hwmon/nsa3xx-hwmon.c 1969-12-31 19:00:00.000000000 -0500 ++++ b/drivers/hwmon/nsa3xx-hwmon.c 2012-09-06 14:19:30.000000000 -0400 +@@ -0,0 +1,251 @@ ++/* ++ * drivers/hwmon/nsa3xx-hwmon.c ++ * ++ * ZyXEL NSA3xx Media Servers ++ * hardware monitoring ++ * ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License v2 as published by the ++ * Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ++ * more details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MAGIC_NUMBER 0x55 ++ ++struct nsa3xx_hwmon { ++ struct platform_device *pdev; ++ struct device *classdev; ++ struct mutex update_lock; /* lock GPIO operations */ ++ unsigned long last_updated; /* jiffies */ ++ unsigned long mcu_data; ++}; ++ ++enum nsa3xx_inputs { ++ NSA3XX_FAN = 1, ++ NSA3XX_TEMP = 0, ++}; ++ ++static const char *nsa3xx_input_names[] = { ++ [NSA3XX_FAN] = "Chassis Fan", ++ [NSA3XX_TEMP] = "System Temperature", ++}; ++ ++static unsigned long nsa3xx_hwmon_update(struct device *dev) ++{ ++ int i; ++ unsigned long mcu_data; ++ struct nsa3xx_hwmon *hwmon = dev_get_drvdata(dev); ++ struct nsa3xx_hwmon_platform_data *pdata = hwmon->pdev->dev.platform_data; ++ ++ mutex_lock(&hwmon->update_lock); ++ ++ mcu_data = hwmon->mcu_data; ++ ++ if (time_after(jiffies, hwmon->last_updated + (3 * HZ)) || mcu_data == 0) { ++ dev_dbg(dev, "Reading MCU data\n"); ++ ++ gpio_set_value(pdata->act_pin, 0); ++ msleep(100); ++ ++ for (i = 31; i >= 0; i--) { ++ gpio_set_value(pdata->clk_pin, 0); ++ udelay(100); ++ ++ gpio_set_value(pdata->clk_pin, 1); ++ udelay(100); ++ ++ mcu_data |= gpio_get_value(pdata->data_pin) ? (1 << i) : 0; ++ } ++ ++ gpio_set_value(pdata->act_pin, 1); ++ ++ if ((mcu_data & 0xff000000) != (MAGIC_NUMBER << 24)) { ++ dev_err(dev, "Failed to read MCU data\n"); ++ mcu_data = 0; ++ } ++ ++ hwmon->mcu_data = mcu_data; ++ hwmon->last_updated = jiffies; ++ } ++ ++ mutex_unlock(&hwmon->update_lock); ++ ++ return mcu_data; ++} ++ ++static ssize_t show_name(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ return sprintf(buf, "nsa3xx\n"); ++} ++ ++static ssize_t show_label(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ int channel = to_sensor_dev_attr(attr)->index; ++ return sprintf(buf, "%s\n", nsa3xx_input_names[channel]); ++} ++ ++static ssize_t show_value(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ int channel = to_sensor_dev_attr(attr)->index; ++ unsigned long mcu_data = nsa3xx_hwmon_update(dev); ++ unsigned long value = 0; ++ switch(channel) { ++ case NSA3XX_TEMP: ++ value = (mcu_data & 0xffff) * 100; ++ break; ++ case NSA3XX_FAN: ++ value = ((mcu_data & 0xff0000) >> 16) * 100; ++ break; ++ } ++ return sprintf(buf, "%lu\n", value); ++} ++ ++static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); ++static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, show_label, NULL, NSA3XX_TEMP); ++static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_value, NULL, NSA3XX_TEMP); ++static SENSOR_DEVICE_ATTR(fan1_label, S_IRUGO, show_label, NULL, NSA3XX_FAN); ++static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_value, NULL, NSA3XX_FAN); ++ ++static struct attribute *nsa3xx_attributes[] = { ++ &dev_attr_name.attr, ++ &sensor_dev_attr_temp1_label.dev_attr.attr, ++ &sensor_dev_attr_temp1_input.dev_attr.attr, ++ &sensor_dev_attr_fan1_label.dev_attr.attr, ++ &sensor_dev_attr_fan1_input.dev_attr.attr, ++ NULL ++}; ++ ++static const struct attribute_group nsa3xx_attr_group = { ++ .attrs = nsa3xx_attributes, ++}; ++ ++static int nsa3xx_hwmon_request_gpios(struct nsa3xx_hwmon_platform_data *pdata) ++{ ++ int ret; ++ ++ if ((ret = gpio_request(pdata->act_pin, "act pin"))) ++ return ret; ++ ++ if ((ret = gpio_request(pdata->clk_pin, "clk pin"))) ++ return ret; ++ ++ if ((ret = gpio_request(pdata->data_pin, "data pin"))) ++ return ret; ++ ++ if ((ret = gpio_direction_output(pdata->act_pin, 1))) ++ return ret; ++ ++ if ((ret = gpio_direction_output(pdata->clk_pin, 1))) ++ return ret; ++ ++ if ((ret = gpio_direction_input(pdata->data_pin))) ++ return ret; ++ ++ return 0; ++} ++ ++static void nsa3xx_hwmon_free_gpios(struct nsa3xx_hwmon_platform_data *pdata) ++{ ++ gpio_free(pdata->act_pin); ++ gpio_free(pdata->clk_pin); ++ gpio_free(pdata->data_pin); ++} ++ ++static int __devinit nsa3xx_hwmon_probe(struct platform_device *pdev) ++{ ++ int ret; ++ struct nsa3xx_hwmon *hwmon; ++ struct nsa3xx_hwmon_platform_data *pdata = pdev->dev.platform_data; ++ ++ hwmon = kzalloc(sizeof(struct nsa3xx_hwmon), GFP_KERNEL); ++ if (!hwmon) ++ return -ENOMEM; ++ ++ platform_set_drvdata(pdev, hwmon); ++ hwmon->pdev = pdev; ++ hwmon->mcu_data = 0; ++ mutex_init(&hwmon->update_lock); ++ ++ ret = sysfs_create_group(&pdev->dev.kobj, &nsa3xx_attr_group); ++ if (ret) ++ goto err; ++ ++ hwmon->classdev = hwmon_device_register(&pdev->dev); ++ if (IS_ERR(hwmon->classdev)) { ++ ret = PTR_ERR(hwmon->classdev); ++ goto err_sysfs; ++ } ++ ++ ret = nsa3xx_hwmon_request_gpios(pdata); ++ if (ret) ++ goto err_free_gpio; ++ ++ dev_info(&pdev->dev, "initialized\n"); ++ ++ return 0; ++ ++err_free_gpio: ++ nsa3xx_hwmon_free_gpios(pdata); ++ hwmon_device_unregister(hwmon->classdev); ++err_sysfs: ++ sysfs_remove_group(&pdev->dev.kobj, &nsa3xx_attr_group); ++err: ++ platform_set_drvdata(pdev, NULL); ++ kfree(hwmon); ++ return ret; ++} ++ ++static int __devexit nsa3xx_hwmon_remove(struct platform_device *pdev) ++{ ++ struct nsa3xx_hwmon *hwmon = platform_get_drvdata(pdev); ++ ++ nsa3xx_hwmon_free_gpios(pdev->dev.platform_data); ++ hwmon_device_unregister(hwmon->classdev); ++ sysfs_remove_group(&pdev->dev.kobj, &nsa3xx_attr_group); ++ platform_set_drvdata(pdev, NULL); ++ kfree(hwmon); ++ ++ return 0; ++} ++ ++static struct platform_driver nsa3xx_hwmon_driver = { ++ .probe = nsa3xx_hwmon_probe, ++ .remove = __devexit_p(nsa3xx_hwmon_remove), ++ .driver = { ++ .name = "nsa3xx-hwmon", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++module_platform_driver(nsa3xx_hwmon_driver); ++ ++MODULE_AUTHOR("Peter Schildmann "); ++MODULE_DESCRIPTION("NSA3XX Hardware Monitoring"); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:nsa3xx-hwmon"); diff -ruN a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c ---- a/drivers/mmc/core/core.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/drivers/mmc/core/core.c 2012-08-10 11:24:17.000000000 -0400 +--- a/drivers/mmc/core/core.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/drivers/mmc/core/core.c 2012-09-06 13:36:29.000000000 -0400 @@ -537,7 +537,7 @@ */ limit_us = 3000000; @@ -1860,8 +2789,8 @@ diff -ruN a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c /* * SDHC cards always use these fixed values. diff -ruN a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c ---- a/drivers/mmc/core/sd.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/drivers/mmc/core/sd.c 2012-08-10 11:25:11.000000000 -0400 +--- a/drivers/mmc/core/sd.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/drivers/mmc/core/sd.c 2012-09-06 13:36:29.000000000 -0400 @@ -389,6 +389,15 @@ return -ENOMEM; } @@ -1879,8 +2808,8 @@ diff -ruN a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c if (err) goto out; diff -ruN a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c ---- a/drivers/mmc/host/mvsdio.c 2012-08-09 11:23:56.000000000 -0400 -+++ b/drivers/mmc/host/mvsdio.c 2012-08-10 11:26:52.000000000 -0400 +--- a/drivers/mmc/host/mvsdio.c 2012-08-25 22:32:13.000000000 -0400 ++++ b/drivers/mmc/host/mvsdio.c 2012-09-06 13:36:29.000000000 -0400 @@ -22,6 +22,7 @@ #include #include @@ -1897,3 +2826,28 @@ diff -ruN a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c cmdreg = MVSD_CMD_INDEX(cmd->opcode); +diff -ruN a/include/linux/nsa3xx-hwmon.h b/include/linux/nsa3xx-hwmon.h +--- a/include/linux/nsa3xx-hwmon.h 1969-12-31 19:00:00.000000000 -0500 ++++ b/include/linux/nsa3xx-hwmon.h 2012-09-06 14:20:54.000000000 -0400 +@@ -0,0 +1,21 @@ ++/* ++ * include/linux/nsa3xx.hwmon.h ++ * ++ * Platform data structure for ZyXEL NSA3xx hwmon driver ++ * ++ * 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. ++ */ ++ ++#ifndef __LINUX_NSA3XX_HWMON_H ++#define __LINUX_NSA3XX_HWMON_H ++ ++struct nsa3xx_hwmon_platform_data { ++ /* GPIO pins */ ++ unsigned act_pin; ++ unsigned clk_pin; ++ unsigned data_pin; ++}; ++ ++#endif /* __LINUX_NSA3XX_HWMON_H */ diff --git a/core/linux-kirkwood/config b/core/linux-kirkwood/config index d454d7a0e..3a5001915 100644 --- a/core/linux-kirkwood/config +++ b/core/linux-kirkwood/config @@ -357,6 +357,8 @@ CONFIG_MACH_D2NET_V2=y CONFIG_MACH_NET2BIG_V2=y CONFIG_MACH_NET5BIG_V2=y CONFIG_MACH_T5325=y +CONFIG_MACH_NSA310=y +CONFIG_MACH_NSA320=y CONFIG_PLAT_ORION=y # @@ -2351,6 +2353,7 @@ CONFIG_SENSORS_LM90=m # CONFIG_SENSORS_W83L786NG is not set # CONFIG_SENSORS_W83627HF is not set # CONFIG_SENSORS_W83627EHF is not set +CONFIG_SENSORS_NSA3XX=m CONFIG_THERMAL=m CONFIG_THERMAL_HWMON=y CONFIG_WATCHDOG=y @@ -3405,7 +3408,7 @@ CONFIG_RTC_INTF_DEV=y # CONFIG_RTC_DRV_ISL1208 is not set # CONFIG_RTC_DRV_ISL12022 is not set # CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8563 is not set +CONFIG_RTC_DRV_PCF8563=m # CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_M41T80 is not set # CONFIG_RTC_DRV_BQ32K is not set diff --git a/core/linux-kirkwood/linux-kirkwood.install b/core/linux-kirkwood/linux-kirkwood.install index b9e111cfc..7972f7a4e 100644 --- a/core/linux-kirkwood/linux-kirkwood.install +++ b/core/linux-kirkwood/linux-kirkwood.install @@ -2,7 +2,7 @@ # arg 2: the old package version KERNEL_NAME=-kirkwood -KERNEL_VERSION=3.5.2-0-ARCH +KERNEL_VERSION=3.5.3-0-ARCH post_install () { # updating module dependencies