From: Christian Lamparter Date: Tue, 11 Aug 2020 17:14:48 +0000 (+0200) Subject: apm821xx: disable Netgear WNDR4700 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=5b5c8834e4ef64af92ae4fa03b508d880c368c24;p=openwrt%2Fstaging%2Fchunkeey.git apm821xx: disable Netgear WNDR4700 This patch disables the Netgear WNDR4700 image, because as it turns out that neither gzipped nor xz'd zImages would work. The reason for the crash is that there are sevaral problems with Netgear's "bootcmd": > if loadn_dniimg 0 0x180000 0x4e0000 && chk_dniimg 0x4e0000; then nand read 0x800000 0x180000 0x20000;bootm 0x500000 - 0x800040;else fw_recovery; fi" This loads the dni-image starting offset 0x180000 from the NAND flash (which is the DTB partition) to 0x4e0000 in the RAM. It then checks whenever the provided image is "valid". If it is then it reads the DTB again to 0x800000 in the RAM and starts the extraction and boot process. (If the image wasn't valid then it starts the automated firmware recovery). The issues here are that first: the kernel image gets "squeezed" between 0x500040 and 0x7fffff... And second, the decompressor only has area 0x0 - 0x500000 for decompression. Hence it would be much easier to "fix" the bootcmd by providing new values (which have been successfully tested with the original Netgear WNDR4700 v1.0.0.56 firmware) for the RAM locations and make full use of the fact that loadn_dniimg loads the DTB as well. This needs to be done only once. Just connect a serial adapter to interface with uboot and overwrite (and save) the new bootcmd. WARNING: The serial port needs a TTL/RS-232 3.3v level converter! Steps: 0. Power-off the WNDR4700 1. Connect the serial interface (you need to open the WNDR4700) 2. Power-up the WNDR4700 3. Monitor the boot-sequence and hit "Enter"-key when it says: "Hit any key to stop autoboot" (Be quick, you have a ~2 second window) 4. in the Prompt enter the following commands (copy & paste) setenv bootcmd "if loadn_dniimg 0 0x180000 0xae0000 && chk_dniimg 0xae0000; then bootm 0xb00000 - 0xae0040;else fw_recovery; fi" saveenv run bootcmd Note: This new bootcmd will also unbrick devices that were bricked by the bigger 4.19/5.4 kernels recently before the buildbot was instructed to skip it. Note2: This method was tested with a WNDR4700. A big kernel with most debug features enabled on v5.4.52 measured 3.10 MiB when compressed with lzma. The uncompressed kernel is 9.83 MiB. This is over the 3 MiB, the device reserves for the kernel... But it booted! For bigger kernels, the device needs repartitioning of the the ubi partition due to the kernel+dtb not fitting into the partition. Note3: For initramfs development. I would advice to load the initramfs images to 0x800000 (or higher). i.e.: tftp 800000 wndr4700.bin Signed-off-by: Christian Lamparter --- diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index db3c9c0722..706533cf21 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -122,6 +122,6 @@ define Device/netgear_wndr4700 NETGEAR_BOARD_ID := WNDR4700 NETGEAR_HW_ID := 29763875+128+256 UBINIZE_OPTS := -E 5 - SUPPORTED_DEVICES += wndr4700 + DEFAULT := n endef TARGET_DEVICES += netgear_wndr4700