From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Packham Date: Tue, 8 May 2018 22:34:18 +1200 Subject: [U-Boot] [PATCH 09/12] ARM: kirkwood: Add device-tree for nsa310s In-Reply-To: <20180508103421.8422-1-judge.packham@gmail.com> References: <20180508103421.8422-1-judge.packham@gmail.com> Message-ID: <20180508103421.8422-10-judge.packham@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Import the dts files from Linux 4.17 and enable CONFIG_OF_CONTROL. Signed-off-by: Chris Packham --- arch/arm/dts/kirkwood-nsa310.dts | 139 ++++++++++++++++++++ arch/arm/dts/kirkwood-nsa3x0-common.dtsi | 158 +++++++++++++++++++++++ configs/nsa310s_defconfig | 3 +- 3 files changed, 299 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/kirkwood-nsa310.dts create mode 100644 arch/arm/dts/kirkwood-nsa3x0-common.dtsi diff --git a/arch/arm/dts/kirkwood-nsa310.dts b/arch/arm/dts/kirkwood-nsa310.dts new file mode 100644 index 000000000000..9b861c2e76c5 --- /dev/null +++ b/arch/arm/dts/kirkwood-nsa310.dts @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "kirkwood-nsa3x0-common.dtsi" + +/ { + compatible = "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; + + ocp at f1000000 { + pinctrl: pin-controller at 10000 { + pinctrl-0 = <&pmx_unknown>; + pinctrl-names = "default"; + + pmx_led_esata_green: pmx-led-esata-green { + marvell,pins = "mpp12"; + marvell,function = "gpio"; + }; + + pmx_led_esata_red: pmx-led-esata-red { + marvell,pins = "mpp13"; + marvell,function = "gpio"; + }; + + pmx_led_usb_green: pmx-led-usb-green { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + + pmx_led_usb_red: pmx-led-usb-red { + marvell,pins = "mpp16"; + marvell,function = "gpio"; + }; + + pmx_led_sys_green: pmx-led-sys-green { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + + pmx_led_sys_red: pmx-led-sys-red { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + + pmx_led_hdd_green: pmx-led-hdd-green { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + + pmx_led_hdd_red: pmx-led-hdd-red { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + + pmx_unknown: pmx-unknown { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + + }; + + i2c at 11000 { + status = "okay"; + + adt7476: adt7476a at 2e { + compatible = "adi,adt7476"; + reg = <0x2e>; + }; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = <&pmx_led_esata_green &pmx_led_esata_red + &pmx_led_usb_green &pmx_led_usb_red + &pmx_led_sys_green &pmx_led_sys_red + &pmx_led_copy_green &pmx_led_copy_red + &pmx_led_hdd_green &pmx_led_hdd_red>; + pinctrl-names = "default"; + + green-sys { + label = "nsa310:green:sys"; + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + }; + red-sys { + label = "nsa310:red:sys"; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + green-hdd { + label = "nsa310:green:hdd"; + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + }; + red-hdd { + label = "nsa310:red:hdd"; + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + }; + green-esata { + label = "nsa310:green:esata"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + red-esata { + label = "nsa310:red:esata"; + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + green-usb { + label = "nsa310:green:usb"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + }; + red-usb { + label = "nsa310:red:usb"; + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + }; + green-copy { + label = "nsa310:green:copy"; + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + }; + red-copy { + label = "nsa310:red:copy"; + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/arch/arm/dts/kirkwood-nsa3x0-common.dtsi b/arch/arm/dts/kirkwood-nsa3x0-common.dtsi new file mode 100644 index 000000000000..2c4037b07282 --- /dev/null +++ b/arch/arm/dts/kirkwood-nsa3x0-common.dtsi @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "ZyXEL NSA310"; + + ocp at f1000000 { + pinctrl: pin-controller at 10000 { + + pmx_usb_power: pmx-usb-power { + marvell,pins = "mpp21"; + marvell,function = "gpio"; + }; + + pmx_pwr_off: pmx-pwr-off { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; + + pmx_btn_reset: pmx-btn-reset { + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + + pmx_btn_copy: pmx-btn-copy { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + + pmx_btn_power: pmx-btn-power { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + + pmx_led_copy_green: pmx-led-copy-green { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + + pmx_led_copy_red: pmx-led-copy-red { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + }; + + serial at 12000 { + status = "ok"; + }; + + sata at 80000 { + status = "okay"; + nr-ports = <2>; + }; + }; + + gpio_poweroff { + compatible = "gpio-poweroff"; + pinctrl-0 = <&pmx_pwr_off>; + pinctrl-names = "default"; + gpios = <&gpio1 16 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"; + + power { + label = "Power Button"; + linux,code = ; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + }; + copy { + label = "Copy Button"; + linux,code = ; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + reset { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + }; + }; + + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_usb_power>; + pinctrl-names = "default"; + + usb0_power: regulator at 1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "USB Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&nand { + status = "okay"; + chip-delay = <35>; + + partition at 0 { + label = "uboot"; + reg = <0x0000000 0x0100000>; + read-only; + }; + partition at 100000 { + label = "uboot_env"; + reg = <0x0100000 0x0080000>; + }; + partition at 180000 { + label = "key_store"; + reg = <0x0180000 0x0080000>; + }; + partition at 200000 { + label = "info"; + reg = <0x0200000 0x0080000>; + }; + partition at 280000 { + label = "etc"; + reg = <0x0280000 0x0a00000>; + }; + partition at c80000 { + label = "kernel_1"; + reg = <0x0c80000 0x0a00000>; + }; + partition at 1680000 { + label = "rootfs1"; + reg = <0x1680000 0x2fc0000>; + }; + partition at 4640000 { + label = "kernel_2"; + reg = <0x4640000 0x0a00000>; + }; + partition at 5040000 { + label = "rootfs2"; + reg = <0x5040000 0x2fc0000>; + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/configs/nsa310s_defconfig b/configs/nsa310s_defconfig index 2529687414fa..d3ea933d378b 100644 --- a/configs/nsa310s_defconfig +++ b/configs/nsa310s_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_KIRKWOOD=y CONFIG_SYS_TEXT_BASE=0x600000 CONFIG_TARGET_NSA310S=y +CONFIG_DEFAULT_DEVICE_TREE="kirkwood-nsa310" CONFIG_BOOTDELAY=3 # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_HUSH_PARSER=y @@ -21,6 +22,7 @@ CONFIG_CMD_JFFS2=y CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000 at 0x0(uboot),0x20000 at 0xe0000(uboot_env),0x100000 at 0x100000(second_stage_uboot),- at 0x200000(root)" CONFIG_CMD_UBI=y CONFIG_ISO_PARTITION=y +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_NAND=y CONFIG_MVSATA_IDE=y # CONFIG_MMC is not set @@ -29,4 +31,3 @@ CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y CONFIG_LZMA=y -CONFIG_OF_LIBFDT=y -- 2.17.0