diff options
author | Zoltan HERPAI <wigyori@uid0.hu> | 2024-01-05 18:42:53 +0100 |
---|---|---|
committer | Zoltan HERPAI <wigyori@uid0.hu> | 2024-06-01 01:29:09 +0200 |
commit | 8619d7af67c28ff974373c9a2937da1025cd81e5 (patch) | |
tree | 031752137fe1be2cb576af692ee537eb51ca194c /target/linux/kirkwood | |
parent | ab9bb79d8e30a574c7628c73c4522429805d9307 (diff) | |
download | openwrt-8619d7af67c28ff974373c9a2937da1025cd81e5.tar.gz openwrt-8619d7af67c28ff974373c9a2937da1025cd81e5.tar.bz2 openwrt-8619d7af67c28ff974373c9a2937da1025cd81e5.zip |
kirkwood: add D-Link DNS-320L support
Dual-slot NAS based on Marvell Kirkwood.
Specifications:
- Marvell 88F6702 @1GHz
- 256Mb RAM
- 128Mb NAND
- 1x GbE LAN (Marvell 88E1318R)
- 1x USB 2.0
- 2x SATA
- Weltrend WT69P3 ("supervisor" MCU chip)
- Serial on J2 (115200,8n1)
- Newer bootROM so kwboot-ing via serial is possible
Notes:
- The Weltrend MCU is controlled by the package added in utils/dns320l-mcu.
- The original MAC address is stored in the "mini firmware" image's first
17 bytes.
- Compared to the original MTD layout, the uImage+rootfs are now stored in
a common ubi partition.
Installation:
1. Serial console
- Connect your levelshifter to the serial console
on J2 (refer to the wiki page for pinout)
2. Update u-boot
- Download the u-boot.kwb image for the device
- Powercycle the NAS
- Run "kwboot -b u-boot-dns320l/u-boot.kwb /dev/ttyUSB0 -p"
- Connect to the serial console with minicom
- tftp 0x0800000 u-boot-dns320l/u-boot.kwb
(Please note that "PHY reset timed out" seems to be customary
on kirkwood devices, the egiga0 interface works regardless.)
- nand erase 0x0 100000
- nand write 0x0800000 0x0 0x100000
- reset
3. Install OpenWrt
- Boot up the initramfs image
- tftpboot 0x800000 openwrt-kirkwood-generic-dlink_dns320l-initramfs-uImage; bootm 0x800000
- Download the sysupgrade image and perform sysupgrade
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Reviewed-by: Pawel Dembicki <paweldembicki@gmail.com>
Diffstat (limited to 'target/linux/kirkwood')
6 files changed, 486 insertions, 0 deletions
diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index 3ed2fa94b0..ff7897fe13 100644 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -19,6 +19,7 @@ kirkwood_setup_interfaces() cloudengines,pogoe02|\ cloudengines,pogoplugv4|\ ctera,c200-v1|\ + dlink,dns320l|\ globalscale,sheevaplug|\ iom,iconnect-1.1|\ iom,ix2-200|\ @@ -60,6 +61,9 @@ kirkwood_setup_macs() local label_mac="" case "$board" in + dlink,dns320l) + lan_mac=$(mtd_get_mac_text "mini firmware") + ;; iptime,nas1) lan_mac=$(mtd_get_mac_binary u-boot 0x3ffa8) label_mac=$lan_mac diff --git a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts new file mode 100644 index 0000000000..bd86c04ea7 --- /dev/null +++ b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Device Tree file for DLINK DNS-320L + * + * Copyright (C) 2024, Zoltan HERPAI <wigyori@uid0.hu> + * Copyright (C) 2015, Sunke Schlüters <sunke-dev@schlueters.de> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * This file is based on the works of: + * - Sunke Schlüters <sunke-dev@schlueters.de> + * - https://github.com/scus1/dns320l/blob/master/kernel/dts/kirkwood-dns320l.dts + * - Andreas Böhler <dev@aboehler.at>: + * - http://www.aboehler.at/doku/doku.php/projects:dns320l + * - http://www.aboehler.at/hg/linux-dns320l/file/ba7a60ad7687/linux-3.12/kirkwood-dns320l.dts + */ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "D-Link DNS-320L"; + compatible = "dlink,dns320l", "marvell,kirkwood-88f6702", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; + }; + + gpio-keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_buttons>; + pinctrl-names = "default"; + + button@1 { + label = "Reset push button"; + linux,code = <KEY_RESTART>; + gpios = <&gpio0 28 1>; + }; + + button@2 { + label = "USB unmount button"; + linux,code = <KEY_EJECTCD>; + gpios = <&gpio0 27 1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = <&pmx_leds>; + pinctrl-names = "default"; + + blue-usb { + label = "dns320l:usb:blue"; + gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + }; + + orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + orange-l-hdd { + label = "dns320l:orange:l_hdd"; + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; + }; + + orange-r-hdd { + label = "dns320l:orange:r_hdd"; + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + }; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + serial@12000 { + status = "okay"; + }; + + serial@12100 { + pinctrl-0 = <&pmx_uart1>; + pinctrl-names = "default"; + status = "okay"; + }; + }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_power_sata>; + pinctrl-names = "default"; + + sata_power: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "SATA Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 24 0>; + }; + }; +}; + +&nand { + pinctrl-0 = <&pmx_nand>; + pinctrl-names = "default"; + chip-delay = <40>; + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x100000>; + }; + + partition@100000 { + label = "ubootenv"; + reg = <0x100000 0x20000>; + }; + + partition@120000 { + label = "ubi"; + reg = <0x120000 0x6de0000>; + }; + + partition@6f00000 { + label = "mini firmware"; + reg = <0x6f00000 0xa00000>; + }; + + partition@7900000 { + label = "config"; + reg = <0x7900000 0x500000>; + }; + + partition@7e00000 { + label = "my-dlink"; + reg = <0x7e00000 0x200000>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&pinctrl { + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp20"; + marvell,function = "sata1"; + }; + + pmx_sata0: pmx-sata0 { + marvell,pins = "mpp21"; + marvell,function = "sata0"; + }; + + pmx_power_sata: pmx-power-sata { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + + pmx_leds: pmx-leds { + marvell,pins = "mpp22", "mpp23", "mpp25", "mpp26"; + marvell,function = "gpio"; + }; + + pmx_buttons: pmx-buttons { + marvell,pins = "mpp27", "mpp28", "mpp29"; + marvell,function = "gpio"; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; diff --git a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts new file mode 100644 index 0000000000..bd86c04ea7 --- /dev/null +++ b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Device Tree file for DLINK DNS-320L + * + * Copyright (C) 2024, Zoltan HERPAI <wigyori@uid0.hu> + * Copyright (C) 2015, Sunke Schlüters <sunke-dev@schlueters.de> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * This file is based on the works of: + * - Sunke Schlüters <sunke-dev@schlueters.de> + * - https://github.com/scus1/dns320l/blob/master/kernel/dts/kirkwood-dns320l.dts + * - Andreas Böhler <dev@aboehler.at>: + * - http://www.aboehler.at/doku/doku.php/projects:dns320l + * - http://www.aboehler.at/hg/linux-dns320l/file/ba7a60ad7687/linux-3.12/kirkwood-dns320l.dts + */ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "D-Link DNS-320L"; + compatible = "dlink,dns320l", "marvell,kirkwood-88f6702", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; + }; + + gpio-keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_buttons>; + pinctrl-names = "default"; + + button@1 { + label = "Reset push button"; + linux,code = <KEY_RESTART>; + gpios = <&gpio0 28 1>; + }; + + button@2 { + label = "USB unmount button"; + linux,code = <KEY_EJECTCD>; + gpios = <&gpio0 27 1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = <&pmx_leds>; + pinctrl-names = "default"; + + blue-usb { + label = "dns320l:usb:blue"; + gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + }; + + orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + orange-l-hdd { + label = "dns320l:orange:l_hdd"; + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; + }; + + orange-r-hdd { + label = "dns320l:orange:r_hdd"; + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + }; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + serial@12000 { + status = "okay"; + }; + + serial@12100 { + pinctrl-0 = <&pmx_uart1>; + pinctrl-names = "default"; + status = "okay"; + }; + }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_power_sata>; + pinctrl-names = "default"; + + sata_power: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "SATA Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 24 0>; + }; + }; +}; + +&nand { + pinctrl-0 = <&pmx_nand>; + pinctrl-names = "default"; + chip-delay = <40>; + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x100000>; + }; + + partition@100000 { + label = "ubootenv"; + reg = <0x100000 0x20000>; + }; + + partition@120000 { + label = "ubi"; + reg = <0x120000 0x6de0000>; + }; + + partition@6f00000 { + label = "mini firmware"; + reg = <0x6f00000 0xa00000>; + }; + + partition@7900000 { + label = "config"; + reg = <0x7900000 0x500000>; + }; + + partition@7e00000 { + label = "my-dlink"; + reg = <0x7e00000 0x200000>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +&pinctrl { + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp20"; + marvell,function = "sata1"; + }; + + pmx_sata0: pmx-sata0 { + marvell,pins = "mpp21"; + marvell,function = "sata0"; + }; + + pmx_power_sata: pmx-power-sata { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + + pmx_leds: pmx-leds { + marvell,pins = "mpp22", "mpp23", "mpp25", "mpp26"; + marvell,function = "gpio"; + }; + + pmx_buttons: pmx-buttons { + marvell,pins = "mpp27", "mpp28", "mpp29"; + marvell,function = "gpio"; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index cc13648890..48de5bee2b 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -182,6 +182,14 @@ define Device/ctera_c200-v1 endef TARGET_DEVICES += ctera_c200-v1 +define Device/dlink_dns320l + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DNS-320L + DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 kmod-gpio-button-hotplug \ + kmod-usb-storage kmod-usb-ledtrig-usbport dns320l-mcu +endef +TARGET_DEVICES += dlink_dns320l + define Device/endian_4i-edge-200 DEVICE_VENDOR := Endian DEVICE_MODEL := 4i Edge 200 diff --git a/target/linux/kirkwood/patches-6.1/118-dns-320l.patch b/target/linux/kirkwood/patches-6.1/118-dns-320l.patch new file mode 100644 index 0000000000..d6c84e2c59 --- /dev/null +++ b/target/linux/kirkwood/patches-6.1/118-dns-320l.patch @@ -0,0 +1,35 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -310,6 +310,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-db-88f6282.dtb \ + kirkwood-dir665.dtb \ + kirkwood-dns320.dtb \ ++ kirkwood-dns320l.dtb \ + kirkwood-dns325.dtb \ + kirkwood-dockstar.dtb \ + kirkwood-dreamplug.dtb \ +--- a/arch/arm/boot/dts/kirkwood-dns320l.dts ++++ b/arch/arm/boot/dts/kirkwood-dns320l.dts +@@ -32,6 +32,13 @@ + reg = <0x00000000 0x10000000>; + }; + ++ aliases { ++ led-boot = &led_orange_usb; ++ led-failsafe = &led_orange_usb; ++ led-running = &led_orange_usb; ++ led-upgrade = &led_orange_usb; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; +@@ -68,7 +75,7 @@ + linux,default-trigger = "usbport"; + }; + +- orange-usb { ++ led_orange_usb: orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; diff --git a/target/linux/kirkwood/patches-6.6/118-dns-320l.patch b/target/linux/kirkwood/patches-6.6/118-dns-320l.patch new file mode 100644 index 0000000000..8f19441bbe --- /dev/null +++ b/target/linux/kirkwood/patches-6.6/118-dns-320l.patch @@ -0,0 +1,35 @@ +--- a/arch/arm/boot/dts/marvell/Makefile ++++ b/arch/arm/boot/dts/marvell/Makefile +@@ -92,6 +92,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-db-88f6282.dtb \ + kirkwood-dir665.dtb \ + kirkwood-dns320.dtb \ ++ kirkwood-dns320l.dtb \ + kirkwood-dns325.dtb \ + kirkwood-dockstar.dtb \ + kirkwood-dreamplug.dtb \ +--- a/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts ++++ b/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts +@@ -32,6 +32,13 @@ + reg = <0x00000000 0x10000000>; + }; + ++ aliases { ++ led-boot = &led_orange_usb; ++ led-failsafe = &led_orange_usb; ++ led-running = &led_orange_usb; ++ led-upgrade = &led_orange_usb; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; +@@ -68,7 +75,7 @@ + linux,default-trigger = "usbport"; + }; + +- orange-usb { ++ led_orange_usb: orange-usb { + label = "dns320l:usb:orange"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; |