summaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/base-files/etc/board.d/02_network
diff options
context:
space:
mode:
authorAndré Valentin <avalentin@marcant.net>2019-10-23 11:30:30 +0200
committerJohn Crispin <john@phrozen.org>2019-10-27 13:38:49 +0100
commit99835e09992bb411519fda1f8d16a6d07df7f598 (patch)
tree8e5328dbe3d187e30f9bd7c9b62a5c4191f8be26 /target/linux/ath79/base-files/etc/board.d/02_network
parent353ecbbf648e9a607bf75853b81127745f32a4fb (diff)
downloadopenwrt-99835e09992bb411519fda1f8d16a6d07df7f598.tar.gz
openwrt-99835e09992bb411519fda1f8d16a6d07df7f598.tar.bz2
openwrt-99835e09992bb411519fda1f8d16a6d07df7f598.zip
ath79: add support for ZyXEL NBG6716
Attention: Kernel partition size has been enlarged to 4MB. To switch, you must update to latest ar71xx-nand snapshort and flash the sysupgrade-4M-Kernel.bin: zcat openwrt-ath79-nand-zyxel_nbg6716-squashfs-sysupgrade-4M-Kernel.bin | mtd -r -e ubi write - firmware; reboot -f You will end up with a fresh config if you do not inject config into the image. The NBG6716 may come with 128MB or 256MB NAND. ar71xx was able to use all, but ath79 can only use the first 128MB. Therefore the complete NAND needs to be overwritten. If not, the old UBI may make problems and lead to reboot loop. Access the real u-boot shell: ZyXEL uses a proprietary loader/shell on top of u-boot: "ZyXEL zloader v2.02" When the device is starting up, the user can enter the the loader shell by simply pressing a key within the 3 seconds once the following string appears on the serial console: | Hit any key to stop autoboot: 3 The user is then dropped to a locked shell. |NBG6716> HELP |ATEN x[,y] set BootExtension Debug Flag (y=password) |ATSE x show the seed of password generator |ATSH dump manufacturer related data in ROM |ATRT [x,y,z,u] RAM read/write test (x=level, y=start addr, z=end addr, u=iterations) |ATGO boot up whole system |ATUR x upgrade RAS image (filename) |NBG6716> In order to escape/unlock a password challenge has to be passed. Note: the value is dynamic! you have to calculate your own! First use ATSE $MODELNAME (MODELNAME is the hostname in u-boot env) to get the challange value/seed. |NBG6716> ATSE NBG6716 |012345678901 This seed/value can be converted to the password with the help of this bash script (Thanks to http://www.adslayuda.com/Zyxel650-9.html authors): - tool.sh - ror32() { echo $(( ($1 >> $2) | (($1 << (32 - $2) & (2**32-1)) ) )) } v="0x$1" a="0x${v:2:6}" b=$(( $a + 0x10F0A563)) c=$(( 0x${v:12:14} & 7 )) p=$(( $(ror32 $b $c) ^ $a )) printf "ATEN 1,%X\n" $p - end of tool.sh - |# bash ./tool.sh 012345678901 | |ATEN 1,879C711 copy and paste the result into the shell to unlock zloader. |NBG6716> ATEN 1,0046B0017430 If the entered code was correct the shell will change to use the ATGU command to enter the real u-boot shell. |NBG6716> ATGU |NBG6716# Signed-off-by: André Valentin <avalentin@marcant.net>
Diffstat (limited to 'target/linux/ath79/base-files/etc/board.d/02_network')
-rwxr-xr-xtarget/linux/ath79/base-files/etc/board.d/02_network8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network
index c40c07a906..b5209f7014 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -304,6 +304,10 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "3:lan:1" "4:lan:2"
;;
+ zyxel,nbg6716)
+ ucidef_add_switch "switch0" \
+ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
+ ;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
@@ -443,6 +447,10 @@ ath79_setup_macs()
wd,mynet-wifi-rangeextender)
lan_mac=$(nvram get et0macaddr)
;;
+ zyxel,nbg6716)
+ lan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2)
+ wan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3)
+ ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac