Repository navigation
airoha: an7581: add uboot chainloader - #22151
Conversation
b585aff to
d9c8c48
Compare
|
I was also working on this... Does it work or it's just POC? |
|
I'm going to test as soon as I get my SBE1V1K set up to replace my main W1700K. |
58293ac to
aa3a1cc
Compare
aa3a1cc to
0fd8262
Compare
|
So any news for this? ... |
0fd8262 to
9f6a4d7
Compare
On further testing on the W1700K, the vendor bootloader disables STANDALONE image booting from flash - I had to repack the uboot image as a Linux kernel image, add a fake Linux image header and attempt to undo some of the boot setup done for booting a Linux kernel. Unfortunately this device doesn't have CPU JTAG so I can't debug where it's hanging in the shim sequence... |
I was having the same problem booting an u-boot image built by the python script. (stuck at loading kernel) but using the an7581-uboot-fit recipe from hurrian@d6402ea#diff-0425cf93ddfbcbf40599dfea716c3fb0aede54889a0bfd454c060d1290f26112 works for me. The stock u-boot boots the chainloader u-boot. I'll post my changes soon on github. I've used the instructions provide by @hurrian : https://gist.github.com/hurrian/2f72c006becaedb564714a63fca9caf5 See my comment below in the gist. |
|
BTW During the switch to ubi I erased the entire stock bootloader by accident :-( I've used the instructions from @Rondom https://forum.openwrt.org/t/quantum-fiber-w1700k-support/222776/565?u=kirdes to recover. Boot the device with the reset button pressed and press 'x'. Send the FIP via XModem, ATF is booting in RAM and after another press 'x" send the entire bootloader via XModem. I've used the one that came with the latest stock firmware https://gcs-firmware-details-prod-002.storage.googleapis.com/W1700K/WXK001-05.00.30.82.bin (path: /opt/econet/tcboot.bin) Last step is to tftp the same tcboot.bin, stock u-boot is then writing the bootloader automatically to the flash. |
|
@kirdesde thanks for confirming that the same signed bootloader can be used to recover... that is nice. Anyway my test were done with simply loading the uboot with tftp and then use the go command... Didn't manage to make the bootm command work. Nice to have... Can we finalize this so we can finally progress and have the device merged? Also if bootm works we can also compress it with lzma that decrease the size from 700kb to 200kb and it means even smaller uboot partition. |
u-boot is already lzma compressed, kirdesde@1def477 I hope @andrewjlamarche and @hurrian can confirm this is working. Next step would be to merge that into the w1700k PR i think. Thanks @hurrian for providing all the groundwork ;-) |
884b1ce to
fdbd57f
Compare
|
ping @Ansuel this should be ready for review; in this latest revision I got rid of the python script and the static Once done, the other half of this would be migrating #17869 to UBI and building an installer script; since manually typing in |
|
@hurrian maybe we can rework the FIP_COMPRESS part a bit and change it to LZMA_COMPRESS. I would like to compress the .bin in uboot makefile instead of in the target. |
fdbd57f to
cb2adb5
Compare
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions.
However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot.
During testing for the Gemtek W1700K (#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick.
An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI.
UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT.
This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel.
Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used.
[1] #17869 (comment)
[2] #17869 (comment)
Signed-off-by: Kenneth Kasilag [email protected]