Repository navigation
xm: openipc.c as on openipc-hisilicon; drop the SPI NAND images - #46
Conversation
…ecovery The file is meant to be the same on every branch. Take openipc-hisilicon's, together with the recovery change proposed there (OpenIPC/u-boot recovery/wrapper-payload), byte for byte: - script.txt on the card or stick still runs first; - otherwise every *.img in its root that is a valid uImage whose load address and size fit the flash, on an erase boundary, gets its payload written there -- never the wrapper header -- U-Boot at 0 included; - an image already on the flash is skipped, and the boot goes on. The NAND gate is CONFIG_FMC_SPI_NAND again, as there; the next commit drops this branch's NAND images, which used CONFIG_ENV_IS_IN_NAND. Under qemu-hisilicon xm530 from an SD card, two boots: a kernel image is written at 0x50000, a bad data CRC and a non-uImage are skipped, U-Boot and then the kernel are found already on the flash, and the saved environment loads.
No XM530/XM550 board with SPI NAND has turned up, the OpenIPC XM530 kernel has no SPI NAND driver, and the images rested on a guess at how the boot ROM starts from NAND that only qemu-hisilicon's model, built on the same guess, ever ran. Remove the xmsfc_nand.c driver and its hook, openipc/nand_config, the NAND build in build.sh and CONFIG_SYS_MAX_NAND_DEVICE. build.sh builds u-boot-<soc>-nor.bin for xm510, xm530 and xm550 only (all three build). CI, on the openipc branch, needs the matching change (ci/xm-nor-only).
PR Summary by QodoAdd generic XM recovery and remove unsupported SPI NAND images
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1.
|
…iled script - script.txt was read to CONFIG_SYS_LOAD_ADDR whatever its size; one larger than the free RAM below the stack would have run over U-Boot. It now gets the same bound as the images (recovery_ram_room()). - a uImage wrapper with a data size of 0 passed every check and was then read with length 0, which the FAT read takes as "the rest of the file", past the RAM bound. It is skipped now. - a script that fails is reported as failed. It still ends recovery: the card author chose a script over the images. Under qemu-hisilicon gk7102: a 0-length wrapper in front of 2 MiB is "has no data, skipped", and the rest of the card recovers as before. Reported by Qodo on #44, #45 and #46.
Reported by Qodo on #46.
…iled script - script.txt was read to CONFIG_SYS_LOAD_ADDR whatever its size; one larger than the free RAM below the stack would have run over U-Boot. It now gets the same bound as the images (recovery_ram_room()). - a uImage wrapper with a data size of 0 passed every check and was then read with length 0, which the FAT read takes as "the rest of the file", past the RAM bound. It is skipped now. - a script that fails is reported as failed. It still ends recovery: the card author chose a script over the images. Under qemu-hisilicon gk7102: a 0-length wrapper in front of 2 MiB is "has no data, skipped", and the rest of the card recovers as before. Reported by Qodo on #44, #45 and #46.
…iled script - script.txt was read to CONFIG_SYS_LOAD_ADDR whatever its size; one larger than the free RAM below the stack would have run over U-Boot. It now gets the same bound as the images (recovery_ram_room()). - a uImage wrapper with a data size of 0 passed every check and was then read with length 0, which the FAT read takes as "the rest of the file", past the RAM bound. It is skipped now. - a script that fails is reported as failed. It still ends recovery: the card author chose a script over the images. Under qemu-hisilicon gk7102: a 0-length wrapper in front of 2 MiB is "has no data, skipped", and the rest of the card recovers as before. Reported by Qodo on #44, #45 and #46.
script.txt is read on SPI NAND builds too, so its RAM bound has to be there as well; the helper sat in the NOR-only section and every NOR+NAND HiSilicon build failed to link (undefined reference to recovery_ram_room).
common/openipc.cbyte for byte as on openipc-hisilicon, with the generic SD/USB recovery (the openipc-hisilicon PR fromrecovery/wrapper-payload).xmsfc_nand.c, its hook,openipc/nand_config, the NAND build andCONFIG_SYS_MAX_NAND_DEVICE; CLAUDE.md updated. The NAND block in the sharedopenipc-common.his left as is; it is never compiled now.Needs the openipc-branch PR from
ci/xm-nor-onlymerged first, or CI looks for-nand.bin.Tested: xm510/xm530/xm550 build. On qemu-hisilicon xm530 from an SD card, over two boots: a kernel image was written at 0x50000; bad CRC and non-uImage files were skipped; U-Boot and then the kernel were found already on the flash; the saved env loaded.