Skip to contentSkip to conversation

Updating barebox from Linux

DISCUSSION Christian Eggers 2 participants 2 messages Feb 4, 2020

lore
Share & tools
lore
#0 lore raw

Platform: i.MX6 (booting from NAND)

I would like to be able to update Barebox from Linux using a framework like RAUC or swupdate. The RAUC documentation states:

https://rauc.readthedocs.io/en/latest/advanced.html#bootloader-update-ideas

Quoted 11 lines

7.6.3. Bootloader Update Ideas

The NXP i.MX6 supports up to four bootloader copies when booting from NAND flash. The ROM code will try each copy in turn until it finds one which is readable without uncorrectable ECC errors and has a correct header. By using the trait of NAND flash that interrupted writes cause ECC errors and writing the first page (containing the header) last, the bootloader images can be replaced one after the other, while ensuring that the system will boot even in case of a crash or power failure.

The slot type could be called “boot-imx6-nand” analogous to eMMC.

In the barebox documentation I only found how to update barebox via the barebox_update command within barebox itself.

Updating barebox seems to be SoC specific. Is there already any existing code to do this from Linux? Or would it be more wise to write the new barebox image to a temporary UBI partition and let barebox do the update itself on next reboot?

regards
Christian

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw
Quoted 16 lines · Christian Eggers

Platform: i.MX6 (booting from NAND)

I would like to be able to update Barebox from Linux using a framework like RAUC or swupdate. The RAUC documentation states:

https://rauc.readthedocs.io/en/latest/advanced.html#bootloader-update-ideas

Quoted 10 lines

7.6.3. Bootloader Update Ideas

The NXP i.MX6 supports up to four bootloader copies when booting from NAND flash. The ROM code will try each copy in turn until it finds one which is readable without uncorrectable ECC errors and has a correct header. By using the trait of NAND flash that interrupted writes cause ECC errors and writing the first page (containing the header) last, the bootloader images can be replaced one after the other, while ensuring that the system will boot even in case of a crash or power failure.

Quoted 7 lines
Quoted 1 line

The slot type could be called “boot-imx6-nand” analogous to eMMC.

In the barebox documentation I only found how to update barebox via the barebox_update command within barebox itself.

Updating barebox seems to be SoC specific. Is there already any existing code to do this from Linux?

I remember that someone asked for updating i.MX6 NAND bootloader from Linux and also that in the end he reported he was successful. Unfortunately I can't remember who it was :(

Quoted 3 lines

Or would it be more wise to write the new barebox image
to a temporary UBI partition and let barebox do the update itself on next reboot?

At least this is the easiest way out in the current situation.

It would be great to have code similar to what barebox has in the barebox_update code under Linux, especially for cases where updating barebox is more than just writing plain to a device or file, like it is on i.MX6 NAND.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox