openwrt-mirror/target/linux
Christian Lamparter 82c8c38a5c apm821xx: prepare WNDR4700 for 6.6 - add preliminary u-boot-env access
With the default BUILD_BOT configuration on a linux 6.6 kernel,
the WNDR4700's kernel no longer fits into the alloted ~3.5MiB,
even with LZMA compression.

Bigger kernels are possible, but there's a problem 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 the image now requires to update 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 0xce0000 && chk_dniimg 0xce0000; then bootm 0xd00000 - 0xce0040;else fw_recovery; fi"
 saveenv
 run bootcmd

Note: This new bootcmd will also unbrick devices that were bricked
by the bigger 4.19-6.1 kernels.

Note2: This method was tested with a WNDR4700. A big kernel with most
debug features enabled on v6.6.22 measured 4.30 MiB when compressed
with lzma. The uncompressed kernel is 12.34 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

Note4: the fw_recovery uboot command to transfer the factory image to
the flash still works.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2024-04-05 09:26:26 +02:00
..
airoha airoha: remove 5.15 support 2024-03-28 13:06:43 +01:00
apm821xx apm821xx: prepare WNDR4700 for 6.6 - add preliminary u-boot-env access 2024-04-05 09:26:26 +02:00
archs38 archs38: remove 5.15 support 2024-03-29 09:58:45 +01:00
armsr kernel: bump 6.1 to 6.1.72 2024-01-19 21:24:44 +01:00
at91 kernel: bump 5.15 to 5.15.153 2024-03-31 18:34:04 +02:00
ath79 ath79: add support for Huawei AP5030DN 2024-03-31 18:09:43 +02:00
bcm27xx bcm27xx: refresh patches 2024-04-03 11:47:18 +02:00
bcm47xx bcm47xx: refresh kernel 6.1 config 2024-03-29 00:12:50 +01:00
bcm53xx kernel: bump 5.15 to 5.15.152 2024-03-29 13:44:41 +01:00
bcm4908 kernel: bump 5.15 to 5.15.153 2024-03-31 18:34:04 +02:00
bmips bmips: add support for SmartRG SR505n 2024-03-10 20:26:07 +01:00
d1 kernel: bump 6.1 to 6.1.80 2024-03-05 00:23:59 +01:00
gemini kernel: bump 6.1 to 6.1.71 2024-01-06 12:52:49 +01:00
generic generic: fix detect_memory_region() function 2024-04-05 07:58:15 +02:00
imx imx: kernel: add imx8mp PCI support 2024-03-24 21:19:10 +01:00
ipq40xx ipq40xx: add kernel 6.6 as a testing kernel version 2024-04-02 23:45:21 +02:00
ipq806x ipq806x: add kernel 6.6 as a testing kernel version 2024-04-02 23:46:02 +02:00
ixp4xx ixp4xx: add Generic subtarget definition 2023-12-09 14:45:50 +01:00
kirkwood kirkwood: add 6.6 kernel as testing version 2024-04-04 18:31:21 +02:00
lantiq lantiq: Fix build after kernel 5.15.150 2024-03-08 14:49:09 +01:00
layerscape treewide: disable spectre mitigation on unaffected Arm32 targets 2024-03-23 20:00:49 +01:00
malta malta: Remove kernel 5.15 configuration 2024-02-03 04:35:25 +00:00
mediatek mediatek: add support for OpenEmbed SOM7981 2024-03-31 20:20:59 +02:00
mpc85xx mpc85xx: add 6.6 testing kernel 2024-03-24 21:20:46 +01:00
mvebu mvebu: 6.6: refresh patches 2024-04-03 18:42:26 +02:00
mxs mxs: switch default kernel to 6.1 2024-03-14 14:24:16 +01:00
octeon octeon: convert to new LED color/function format where possible 2024-02-07 14:48:41 +01:00
octeontx kernel: bump 5.15 to 5.15.153 2024-03-31 18:34:04 +02:00
omap omap: drop kernel 5.15 2024-02-13 19:05:48 +01:00
oxnas kernel: bump 5.15 to 5.15.153 2024-03-31 18:34:04 +02:00
pistachio kernel: fix mtd/NVMEM regression affecting U-Boot env NVMEM driver 2023-10-31 17:33:28 +01:00
qoriq qoriq: pad rootfs with zeros 2023-12-02 14:06:56 +02:00
qualcommax qualcommax: ipq60xx: add yuncore fap650 support 2024-04-04 09:29:17 +02:00
ramips ramips: 6.6: set testing kernel 2024-04-05 07:58:15 +02:00
realtek realtek: add Zyxel GS1900-8 v2 2024-03-25 21:28:44 +01:00
rockchip rockchip: remove redundant 'console' parameter from boot script 2024-03-29 19:34:42 +01:00
sifiveu kernel: remove CONFIG_DEVTMPFS_SAFE from target config 2023-11-19 16:46:24 +01:00
starfive generic: 6.1: backport AXP PMIC support 2024-03-26 21:56:57 +01:00
sunxi sunxi: backport h616 thermal sensor support 2024-03-26 21:56:57 +01:00
tegra
uml uml: restore 6.1 config + patches 2024-03-23 21:38:00 +01:00
x86 x86: 6.6: set testing kernel 2024-04-04 08:56:10 +02:00
zynq
Makefile linux: add dtb makefile target to targets list 2024-02-08 23:04:55 +01:00