From: luka Date: Sun, 1 Nov 2015 01:13:16 +0000 (+0000) Subject: kirkwood: add initial support for NSA310s X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=commitdiff_plain;h=32f449826f602c691e8417dfe441c806737c4fa5 kirkwood: add initial support for NSA310s Signed-off-by: Tony Dinh Signed-off-by: Luka Perkov git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47330 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network index f0628cd618..150926e3a6 100644 --- a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network @@ -33,6 +33,7 @@ case "$board" in "goflexnet"|\ "iconnect"|\ "ib62x0"|\ +"nsa310s"|\ "pogo_e02") set_lan_dhcp "eth0" ;; diff --git a/target/linux/kirkwood/base-files/lib/kirkwood.sh b/target/linux/kirkwood/base-files/lib/kirkwood.sh index aa16daf4c0..6e0f444d3e 100755 --- a/target/linux/kirkwood/base-files/lib/kirkwood.sh +++ b/target/linux/kirkwood/base-files/lib/kirkwood.sh @@ -57,6 +57,10 @@ kirkwood_board_detect() { name="sheevaplug-esata" ;; + "ZyXEL NSA310S") + name="nsa310s" + ;; + *) name="generic" ;; diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index da462a271d..0aa75ff1fe 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -130,6 +130,9 @@ Image/InstallKernel/Template/ICONNECT=$(call Image/InstallKernel/Template,iconne Image/BuildKernel/Template/IOMEGA_IX2_200=$(call Image/BuildKernel/Template,iomega_ix2_200) Image/InstallKernel/Template/IOMEGA_IX2_200=$(call Image/InstallKernel/Template,iomega_ix2_200) +Image/BuildKernel/Template/NSA310S=$(call Image/BuildKernel/Template,nsa310s) +Image/InstallKernel/Template/NSA310S=$(call Image/InstallKernel/Template,nsa310s) + Image/BuildKernel/Template/POGOE02=$(call Image/BuildKernel/Template,pogo_e02) Image/InstallKernel/Template/POGOE02=$(call Image/InstallKernel/Template,pogo_e02) diff --git a/target/linux/kirkwood/patches-3.18/190-nsa310s.patch b/target/linux/kirkwood/patches-3.18/190-nsa310s.patch new file mode 100644 index 0000000000..b646693763 --- /dev/null +++ b/target/linux/kirkwood/patches-3.18/190-nsa310s.patch @@ -0,0 +1,300 @@ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-nsa310s.dts +@@ -0,0 +1,287 @@ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "ZyXEL NSA310S"; ++ compatible = "zyxel,nsa320s", "marvell,kirkwood-88f6702", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x10000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8 earlyprintk"; ++ stdout-path = &uart0; ++ }; ++ ++ mbus { ++ pcie-controller { ++ status = "okay"; ++ ++ pcie@1,0 { ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-names = "default"; ++ ++ pmx_sata0: pmx-sata0 { ++ marvell,pins; ++ marvell,function = "sata0"; ++ }; ++ pmx_sata1: pmx-sata1 { ++ marvell,pins; ++ marvell,function = "sata1"; ++ }; ++ pmx_usb_power: pmx-usb-power { ++ marvell,pins = "mpp21"; ++ marvell,function = "gpio"; ++ }; ++ pmx_pwr_off: pmx-pwr-off { ++ marvell,pins = "mpp27"; ++ marvell,function = "gpio"; ++ }; ++ pmx_btn_reset: pmx-btn-reset { ++ marvell,pins = "mpp24"; ++ marvell,function = "gpio"; ++ }; ++ pmx_btn_copy: pmx-btn-copy { ++ marvell,pins = "mpp25"; ++ marvell,function = "gpio"; ++ }; ++ pmx_btn_power: pmx-btn-power { ++ marvell,pins = "mpp26"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_hdd2_green: pmx-led-hdd2-green { ++ marvell,pins = "mpp34"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_hdd2_red: pmx-led-hdd2-red { ++ marvell,pins = "mpp12"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_usb_green: pmx-led-usb-green { ++ marvell,pins = "mpp15"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_copy_green: pmx-led-copy-green { ++ marvell,pins = "mpp22"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_copy_red: pmx-led-copy-red { ++ marvell,pins = "mpp23"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_sys_green: pmx-led-sys-green { ++ marvell,pins = "mpp28"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_sys_orange: pmx-led-sys-orange { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_hdd1_green: pmx-led-hdd1-green { ++ marvell,pins = "mpp16"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_hdd1_red: pmx-led-hdd1-red { ++ marvell,pins = "mpp13"; ++ marvell,function = "gpio"; ++ }; ++ pmx_pwr_sata1: pmx-pwr-sata1 { ++ marvell,pins = "mpp33"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ sata@80000 { ++ status = "okay"; ++ nr-ports = <2>; ++ }; ++ ++ rtc@10300 { ++ status = "disabled"; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ ht1382: rtc@68 { ++ compatible = "htk,ht1382"; ++ reg = <0x68>; ++ }; ++ }; ++ }; ++ ++ regulators { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmx_usb_power &pmx_pwr_sata1>; ++ ++ usb0_power: regulator@1 { ++ compatible = "regulator-fixed"; ++ reg = <1>; ++ regulator-name = "USB Power"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ sata1_power: regulator@2 { ++ compatible = "regulator-fixed"; ++ reg = <2>; ++ regulator-name = "SATA1 Power"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-0 = <&pmx_btn_reset &pmx_btn_copy &pmx_btn_power>; ++ pinctrl-names = "default"; ++ ++ button@1 { ++ label = "Power Button"; ++ linux,code = ; ++ gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; ++ }; ++ button@2 { ++ label = "Copy Button"; ++ linux,code = ; ++ gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; ++ }; ++ button@3 { ++ label = "Reset Button"; ++ linux,code = ; ++ gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-0 = <&pmx_led_hdd2_green &pmx_led_hdd2_red ++ &pmx_led_usb_green ++ &pmx_led_sys_green &pmx_led_sys_orange ++ &pmx_led_copy_green &pmx_led_copy_red ++ &pmx_led_hdd1_green &pmx_led_hdd1_red>; ++ pinctrl-names = "default"; ++ ++ green-sys { ++ label = "nsa310s:green:sys"; ++ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "timer"; ++ }; ++ orange-sys { ++ label = "nsa310s:orange:sys"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; ++ }; ++ green-hdd1 { ++ label = "nsa310s:green:hdd1"; ++ gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; ++ }; ++ red-hdd1 { ++ label = "nsa310s:red:hdd1"; ++ gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; ++ }; ++ green-hdd2 { ++ label = "nsa310s:green:hdd2"; ++ gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; ++ }; ++ red-hdd2 { ++ label = "nsa310s:red:hdd2"; ++ gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; ++ }; ++ green-usb { ++ label = "nsa310s:green:usb"; ++ gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; ++ }; ++ green-copy { ++ label = "nsa310s:green:copy"; ++ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "ide-disk"; ++ }; ++ red-copy { ++ label = "nsa310s:red:copy"; ++ gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ gpio_poweroff { ++ compatible = "gpio-poweroff"; ++ pinctrl-0 = <&pmx_pwr_off>; ++ pinctrl-names = "default"; ++ gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ chip-delay = <35>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0000000 0xe0000>; ++ }; ++ ++ partition@e0000 { ++ label = "u-boot environment"; ++ reg = <0xe0000 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "second stage u-boot"; ++ reg = <0x100000 0x200000>; ++ }; ++ ++ partition@200000 { ++ label = "root"; ++ reg = <0x200000 0xfe00000>; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ethphy0: ethernet-phy@1 { ++ compatible = "marvell,88e1318s"; ++ reg = <1>; ++ marvell,reg-init = <0x1 0x16 0x0 0x3>, ++ <0x1 0x10 0x0 0x1017>, ++ <0x1 0x11 0x0 0x4408>, ++ <0x1 0x16 0x0 0x0>, ++ <0x1 0x4 0x0 0x1e1>, ++ <0x1 0x9 0x0 0x300>, ++ <0x1 0x10 0x0 0x3860>, ++ <0x1 0x0 0x0 0x9140>; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ++ ethernet0-port@0 { ++ phy-handle = <ðphy0>; ++ }; ++}; +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -145,6 +145,7 @@ + kirkwood-ns2mini.dtb \ + kirkwood-nsa310.dtb \ + kirkwood-nsa310a.dtb \ ++ kirkwood-nsa310s.dtb \ + kirkwood-openblocks_a6.dtb \ + kirkwood-openblocks_a7.dtb \ + kirkwood-openrd-base.dtb \ diff --git a/target/linux/kirkwood/profiles/110-nas.mk b/target/linux/kirkwood/profiles/110-nas.mk index 748efacd56..bf97437871 100644 --- a/target/linux/kirkwood/profiles/110-nas.mk +++ b/target/linux/kirkwood/profiles/110-nas.mk @@ -100,6 +100,22 @@ IOMEGA_IX2_200_UBI_OPTS:="-m 512 -p 16384 -s 256" $(eval $(call Profile,IOMEGA_IX2_200)) +define Profile/NSA310S + NAME:=ZyXEL NSA310S + PACKAGES:= \ + kmod-ata-core kmod-ata-marvell-sata \ + kmod-rtc-marvell kmod-usb2 kmod-usb-storage +endef + +define Profile/NSA310S/Description + Package set compatible with ZyXEL NSA310S board. +endef + +NSA310S_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096" +NSA310S_UBI_OPTS:="-m 2048 -p 128KiB -s 512" + +$(eval $(call Profile,NSA310S)) + define Profile/POGOE02 NAME:=Cloud Engines Pogoplug E02 PACKAGES:= \