difos/target/linux/kirkwood/base-files/etc/board.d/02_network
Zoltan HERPAI 8619d7af67 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>
2024-06-01 01:29:09 +02:00

93 lines
1.8 KiB
Text

#
# Copyright (C) 2012-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
kirkwood_setup_interfaces()
{
local board="$1"
case "$board" in
checkpoint,l-50)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 dmz" "eth0"
;;
cisco,on100)
ucidef_set_interface_lan "eth0 eth1"
;;
cloudengines,pogoe02|\
cloudengines,pogoplugv4|\
ctera,c200-v1|\
dlink,dns320l|\
globalscale,sheevaplug|\
iom,iconnect-1.1|\
iom,ix2-200|\
iptime,nas1|\
netgear,readynas-duo-v2|\
netgear,stora|\
raidsonic,ib-nas62x0|\
seagate,blackarmor-nas220|\
seagate,dockstar|\
seagate,goflexhome|\
seagate,goflexnet|\
zyxel,nsa310b|\
zyxel,nsa310s|\
zyxel,nsa325)
ucidef_set_interface_lan "eth0" "dhcp"
;;
endian,4i-edge-200)
ucidef_set_interface_lan "port1 port2 port3 port4 eth1"
;;
iom,ix4-200d)
ucidef_set_interface_lan "eth0 eth1" "dhcp"
;;
linksys,e4200-v2|\
linksys,ea3500|\
linksys,ea4500)
ucidef_set_interfaces_lan_wan "ethernet1 ethernet2 ethernet3 ethernet4" "internet"
;;
*)
ucidef_set_interface_lan "eth0"
;;
esac
}
kirkwood_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
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
;;
linksys,e4200-v2|\
linksys,ea3500|\
linksys,ea4500)
wan_mac=$(mtd_get_mac_ascii u_env eth1addr)
;;
zyxel,nsa310b|\
zyxel,nsa325)
lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
}
board_config_update
board=$(board_name)
kirkwood_setup_interfaces $board
kirkwood_setup_macs $board
board_config_flush
exit 0