wlan-ap-Telecominfraproject/patches/ipq807x/0007-uboot-envtools-add-ipq807x-support.patch
John Crispin d53a31e59e ipq807x: add CIG WF188 support
This patch adds support for the Cigtech WF188 AP.

Specification:
- SoC: Qualcomm Atheros IPQ6018 ARM64 quad core
- RAM: 512MB
- NOR Flash: 32MB SPI NOR
- Ethernet: 1 x 1G
- WLAN: 2x IPQ60xx AX

Installation instructions:

1) enter uboot console
- setenv bootargs mtdparts=spi32766.0:6144k@3712k(0:HLOS),20608k@9856k(rootfs) console=ttyMSM0,115200n8
- tftpboot 0x44000000 wf188-initramfs
- bootm
2) inside the in ramfs, scp the sysupgrade image to the device and run sysupgrade.

Signed-off-by: John Crispin <john@phrozen.org>
2020-08-02 15:49:29 +02:00

58 lines
1.5 KiB
Diff

From 3e58efc4643555c1fe6df69174e972c9e071e382 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Tue, 28 Jul 2020 10:50:21 +0200
Subject: [PATCH 7/7] uboot-envtools: add ipq807x support
Signed-off-by: John Crispin <john@phrozen.org>
---
package/boot/uboot-envtools/files/ipq807x | 37 +++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 package/boot/uboot-envtools/files/ipq807x
diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x
new file mode 100644
index 0000000000..6c429f1852
--- /dev/null
+++ b/package/boot/uboot-envtools/files/ipq807x
@@ -0,0 +1,37 @@
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(board_name)
+
+ubootenv_mtdinfo () {
+ UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV)
+ mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
+ mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
+ mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
+ nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev})
+
+ if [ -n "$nor_flash" ]; then
+ ubootenv_size=$mtd_size
+ else
+ # size is fixed to 0x40000 in u-boot
+ ubootenv_size=0x40000
+ fi
+
+ sectors=$(( $ubootenv_size / $mtd_erase ))
+ echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
+}
+
+case "$board" in
+*)
+ ubootenv_add_uci_config $(ubootenv_mtdinfo)
+ ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
--
2.25.1