aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mkits-zyxel-fit.sh
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2022-05-27 17:48:06 +0200
committerDavid Bauer <mail@david-bauer.net>2022-10-14 23:14:50 +0200
commit2050bc4f64e3824d6a632cce5fabc0b816ea0508 (patch)
tree4717cb2400e0a9a03f6444147dd7f2630210bd44 /scripts/mkits-zyxel-fit.sh
parentbc8e24c654050d7fcafd8d6f179bf1ffdf6045fa (diff)
downloadupstream-2050bc4f64e3824d6a632cce5fabc0b816ea0508.tar.gz
upstream-2050bc4f64e3824d6a632cce5fabc0b816ea0508.tar.bz2
upstream-2050bc4f64e3824d6a632cce5fabc0b816ea0508.zip
ramips: add support for ZyXEL NWA50AX / NWA55AXE
Hardware -------- CPU: Mediatek MT7621 RAM: 256M DDR3 FLASH: 128M NAND ETH: 1x Gigabit Ethernet WiFi: Mediatek MT7915 (2.4/5GHz 802.11ax 2x2 DBDC) BTN: 1x Reset (NWA50AX only) LED: 1x Multi-Color (NWA50AX only) UART Console ------------ NWA50AX: Available below the rubber cover next to the ethernet port. NWA55AXE: Available on the board when disassembling the device. Settings: 115200 8N1 Layout: <12V> <LAN> GND-RX-TX-VCC Logic-Level is 3V3. Don't connect VCC to your UART adapter! Installation Web-UI ------------------- Upload the Factory image using the devices Web-Interface. As the device uses a dual-image partition layout, OpenWrt can only installed on Slot A. This requires the current active image prior flashing the device to be on Slot B. If the currently installed image is started from Slot A, the device will flash OpenWrt to Slot B. OpenWrt will panic upon first boot in this case and the device will return to the ZyXEL firmware upon next boot. If this happens, first install a ZyXEL firmware upgrade of any version and install OpenWrt after that. Installation TFTP ----------------- This installation routine is especially useful in case * unknown device password (NWA55AXE lacks reset button) * bricked device Attach to the UART console header of the device. Interrupt the boot procedure by pressing Enter. The bootloader has a reduced command-set available from CLI, but more commands can be executed by abusing the atns command. Boot a OpenWrt initramfs image available on a TFTP server at 192.168.1.66. Rename the image to owrt.bin $ atnf owrt.bin $ atna 192.168.1.88 $ atns "192.168.1.66; tftpboot; bootm" Upon booting, set the booted image to the correct slot: $ zyxel-bootconfig /dev/mtd10 get-status $ zyxel-bootconfig /dev/mtd10 set-image-status 0 valid $ zyxel-bootconfig /dev/mtd10 set-active-image 0 Copy the OpenWrt ramboot-factory image to the device using scp. Write the factory image to NAND and reboot the device. $ mtd write ramboot-factory.bin firmware $ reboot Signed-off-by: David Bauer <mail@david-bauer.net> (cherry picked from commit a0b7fef0ffe4cd9cca39a652a37e4f3ce8f0a681)
Diffstat (limited to 'scripts/mkits-zyxel-fit.sh')
-rwxr-xr-xscripts/mkits-zyxel-fit.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/mkits-zyxel-fit.sh b/scripts/mkits-zyxel-fit.sh
new file mode 100755
index 0000000000..8ace1941eb
--- /dev/null
+++ b/scripts/mkits-zyxel-fit.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+#
+# Licensed under the terms of the GNU GPL License version 2 or later.
+# Author: David Bauer <mail@david-bauer.net>, based on mkits-zyxel-factory.sh.
+
+usage() {
+ echo "Usage: `basename $0` output file compat-models"
+ exit 1
+}
+
+# We need at least 3 arguments
+[ "$#" -lt 3 ] && usage
+
+# Target output file
+OUTPUT="$1"; shift
+FILE="$1"; shift
+MODELS="$1"; shift
+
+# Create a default, fully populated DTS file
+echo "\
+/dts-v1/;
+
+/ {
+ description = \"Zyxel FIT (Flattened Image Tree)\";
+ compat-models = [${MODELS}];
+ #address-cells = <1>;
+
+ images {
+ firmware {
+ data = /incbin/(\"${FILE}\");
+ type = \"firmware\";
+ compression = \"none\";
+ hash@1 {
+ algo = \"sha1\";
+ };
+ };
+ };
+};" > ${OUTPUT}