You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB
Plaintext

#!/bin/sh
#
# Copyright (C) 2012-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/kirkwood.sh
board_config_update
board=$(kirkwood_board_name)
case "$board" in
"dockstar")
ucidef_set_led_default "health" "health" "status:green:health" "1"
ucidef_set_led_default "fault" "fault" "status:orange:fault" "1"
;;
"linksys-audi")
ucidef_set_led_default "power" "power" "audi:green:power" "1"
;;
"linksys-viper")
ucidef_set_led_default "health" "health" "viper:white:health" "1"
ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1"
;;
"goflexhome" | \
"goflexnet")
ucidef_set_led_default "health" "health" "status:green:health" "1"
ucidef_set_led_default "fault" "fault" "status:orange:fault" "0"
;;
"ib62x0")
ucidef_set_led_default "health" "health" "ib62x0:green:os" "1"
ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1"
;;
"pogo_e02")
ucidef_set_led_default "health" "health" "pogo_e02:green:health" "1"
ucidef_set_led_default "fault" "fault" "pogo_e02:orange:fault" "1"
;;
"guruplug-server-plus")
ucidef_set_led_timer "health" "health" "guruplug:red:health" "200" "800"
;;
kirkwood: add ZyXEL NSA310b The ZyXEL NSA310 device is a Kirkwood based NAS: - SoC: Marvell 88F6702 1200Mhz - SDRAM memory: 256MB DDR2 400Mhz - Gigabit ethernet: Realtek (over pcie) - Flash memory: 128MB - 1 Power button - 1 Power LED (blue) - 5 Status LED (green/red) - 1 Copy/Sync button - 1 Reset button - 2 SATA II port (1 internal and 1 external) - 2 USB 2.0 ports (1 front and 1 back) - Smart fan The stock u-boot cannot read ubi so it should be replaced with the LEDE/OpenWRT's u-boot or with a u-boot from here https://github.com/mibodhi/u-boot-kirkwood This device's boot ROM supports "kwboot" tool (in mainline u-boot, built automatically if CONFIG_KIRKWOOD is declared) that sends an uboot image to the board over serial connection, it is very easy to unbrick. The stock bootloader can use usb and read from FAT filesystems, so the installation process is simple, place the uboot file on a USB flashdrive formatted as FAT (here it is "openwrt-kirkwood-nsa310.bin", then connect TTL to the board and write the following commands in the bootloader console: usb reset fatload usb 0 0x1000000 openwrt-kirkwood-nsa310.bin nand write 0x1000000 0x00000 0x100000 reset Now you are rebooting in the new u-boot, write this in its console to install the firmware: usb reset fatload usb 0 0x2000000 lede-kirkwood-nsa310b-squashfs-factory.bin nand erase.part ubi nand write 0x2000000 ubi 0x600000 If your firmware file is bigger than 6 MiBs you should write its size in hex instead of 0x600000 above, or remove that number entirely (it will take a while in this case). If you are using another uboot that can read ubi, set mtdparts like this mtdparts=mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi) And set your bootcmd to be like this bootcmd=run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000 Then you can install the firmware as described above. After you installed (or configured) the u-boot for booting the firmware, write the device's mac address in the ethaddr u-boot env. The MAC address is usually on a sticker under the device (one of the two codes is the serial), it should begin with "107BEF" as it is assigned to ZyXEL. write in the u-boot console (use your MAC address instead of the example) setenv ethaddr 10:7B:EF:00:00:00 saveenv to save the mac address in the u-boot. Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
7 years ago
"nsa310b")
ucidef_set_led_default "health" "health" "nsa310:green:sys" "1"
ucidef_set_led_usbhost "usb" "USB" "nsa310:green:usb"
ucidef_set_led_ataport "hdd" "HDD" "nsa310:green:hdd" "1"
ucidef_set_led_ataport "esata" "eSata" "nsa310:green:esata" "2"
kirkwood: add ZyXEL NSA310b The ZyXEL NSA310 device is a Kirkwood based NAS: - SoC: Marvell 88F6702 1200Mhz - SDRAM memory: 256MB DDR2 400Mhz - Gigabit ethernet: Realtek (over pcie) - Flash memory: 128MB - 1 Power button - 1 Power LED (blue) - 5 Status LED (green/red) - 1 Copy/Sync button - 1 Reset button - 2 SATA II port (1 internal and 1 external) - 2 USB 2.0 ports (1 front and 1 back) - Smart fan The stock u-boot cannot read ubi so it should be replaced with the LEDE/OpenWRT's u-boot or with a u-boot from here https://github.com/mibodhi/u-boot-kirkwood This device's boot ROM supports "kwboot" tool (in mainline u-boot, built automatically if CONFIG_KIRKWOOD is declared) that sends an uboot image to the board over serial connection, it is very easy to unbrick. The stock bootloader can use usb and read from FAT filesystems, so the installation process is simple, place the uboot file on a USB flashdrive formatted as FAT (here it is "openwrt-kirkwood-nsa310.bin", then connect TTL to the board and write the following commands in the bootloader console: usb reset fatload usb 0 0x1000000 openwrt-kirkwood-nsa310.bin nand write 0x1000000 0x00000 0x100000 reset Now you are rebooting in the new u-boot, write this in its console to install the firmware: usb reset fatload usb 0 0x2000000 lede-kirkwood-nsa310b-squashfs-factory.bin nand erase.part ubi nand write 0x2000000 ubi 0x600000 If your firmware file is bigger than 6 MiBs you should write its size in hex instead of 0x600000 above, or remove that number entirely (it will take a while in this case). If you are using another uboot that can read ubi, set mtdparts like this mtdparts=mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi) And set your bootcmd to be like this bootcmd=run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000 Then you can install the firmware as described above. After you installed (or configured) the u-boot for booting the firmware, write the device's mac address in the ethaddr u-boot env. The MAC address is usually on a sticker under the device (one of the two codes is the serial), it should begin with "107BEF" as it is assigned to ZyXEL. write in the u-boot console (use your MAC address instead of the example) setenv ethaddr 10:7B:EF:00:00:00 saveenv to save the mac address in the u-boot. Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
7 years ago
;;
"nsa325")
ucidef_set_led_default "health" "health" "nsa325:green:sys" "1"
ucidef_set_led_usbhost "usb" "USB" "nsa325:green:usb"
ucidef_set_led_ataport "hdd1" "HDD1" "nsa325:green:sata1" "1"
ucidef_set_led_ataport "hdd2" "HDD2" "nsa325:green:sata2" "2"
;;
"sheevaplug" | \
"sheevaplug-esata")
ucidef_set_led_timer "health" "health" "sheevaplug:blue:health" "200" "800"
;;
*)
;;
esac
board_config_flush
exit 0