A/B boot on PhyCORE iMX6 with U-Boot env

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Mar 5 20:23:57 GMT 2021


Hello Sébastien,

On 05.03.21 18:30, Sébastien Merle wrote:
> First, I am a newbie to this and if I should use another channel to ask these questions, please forgive me and redirect me to the proper place.

Here is ok.

> I am trying to setup A/B boot on a a phyCORE imx6 board with barebox from EMMC. To test the state framework I added Barebox’s imx6ul-phytec-state.dtsi to my device tree. 
>  
> I am confused about the &eeprom node in imx6ul-phytec-state.dtsi used for the state backend, what is this defining ? Is this really storing the state in the EMMC ?

The state node has a backend property, which points at a partition within EEPROM.
You can have state in eMMC as well if your prefer, but EEPROM works well too.

(Note that older Linux versions might not like partitions within eMMC devices.
 If you have problems, you can cherry-pick 0445efacec7 ("nvmem: core: skip child
 nodes not matching binding"))
 
> We would rather use U-Boot env, as our firmware creation tools only support that for now.

As mentioned on IRC, this is a bad idea. Better have your image updater
use dt-utils' barebox-state utility. See how RAUC does it for an example.

> To setup my firmware update I need to define the offset of barebox, barebox environment and U-Boot environment but I can’t find what offsets I should use so nothing clash. How could I figure out these offsets ?

They are all fixed-partitions, so you specify them in the device tree.

> The idea was to add a U-Boot environment and use a script to boot A or B in function of the U-Boot variables. Is it even possible ?

Possible, yes. Good idea? probably not.

> If it is possible, do I need to add a partition of the EMMC in my device tree as shown in https://www.barebox.org/doc/latest/devicetree/bindings/barebox/barebox,uboot-environment.html ?

arch/arm/dts has one example of using it. It was used for migrating from U-Boot to barebox.

> I would be grateful for any pointers to documentation or examples to setup A/B boot on similar platform (without yocto).
> 
> Thank you very much for your time.

Cheers,
Ahmad

> 
> Best regards,
> Sebastien Merle,
> Peer Stritzinger GmbH.
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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 |



More information about the barebox mailing list