diff options
author | Roland Hieber <rhi@pengutronix.de> | 2023-06-23 14:47:49 +0200 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2023-08-15 09:58:58 +0200 |
commit | 8e204806f616af482f8509d17acc1978777ac8f6 (patch) | |
tree | f5deac451d96d5b819d10f0c6d44a4be43ccf4d4 | |
parent | 24aed411fc563460fa595798674223471ce14302 (diff) | |
download | DistroKit-8e204806f616af482f8509d17acc1978777ac8f6.tar.gz DistroKit-8e204806f616af482f8509d17acc1978777ac8f6.tar.xz |
v7a: add RAUC support for riotboard
* Enable barebox bootchooser framework
* Add a redundant root partition to the genimage config
* Add appropriate variables to the barebox defaultenv so the bootchooser
can decide into which partition to boot
* Add a state backend to the device tree fragment
* Map partitions in rauc-udev compatibility layer
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
11 files changed, 52 insertions, 4 deletions
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource b/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource index ba04809..852cfd7 100644 --- a/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource +++ b/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource @@ -4,10 +4,10 @@ if [ -n "$nv.boot.default" ]; then exit fi - if [ $bootsource = mmc ]; then detect mmc$bootsource_instance - global.boot.default="mmc$bootsource_instance net" + global.boot.default="bootchooser net" else - global.boot.default="net mmc1 mmc2 mmc3" + global.boot.default="net bootchooser" fi + diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default b/configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default new file mode 100644 index 0000000..d7d9a37 --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default @@ -0,0 +1 @@ +bootchooser net diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix new file mode 100644 index 0000000..6246412 --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix @@ -0,0 +1 @@ +state.bootstate diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot new file mode 100644 index 0000000..597dd55 --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot @@ -0,0 +1 @@ +mmc2.0 diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot new file mode 100644 index 0000000..069ba36 --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot @@ -0,0 +1 @@ +mmc2.1 diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets new file mode 100644 index 0000000..f0fb14e --- /dev/null +++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets @@ -0,0 +1 @@ +system0 system1 diff --git a/configs/platform-v7a/barebox-mx6.config b/configs/platform-v7a/barebox-mx6.config index 79e41dd..0484d35 100644 --- a/configs/platform-v7a/barebox-mx6.config +++ b/configs/platform-v7a/barebox-mx6.config @@ -285,7 +285,7 @@ CONFIG_BTHREAD=y CONFIG_STATE=y # CONFIG_STATE_CRYPTO is not set # CONFIG_STATE_BACKWARD_COMPATIBLE is not set -# CONFIG_BOOTCHOOSER is not set +CONFIG_BOOTCHOOSER=y CONFIG_RESET_SOURCE=y # CONFIG_MACHINE_ID is not set # CONFIG_SYSTEMD_OF_WATCHDOG is not set @@ -376,6 +376,7 @@ CONFIG_CMD_GO=y # CONFIG_CMD_LOADY is not set CONFIG_CMD_RESET=y CONFIG_CMD_UIMAGE=y +CONFIG_CMD_BOOTCHOOSER=y # end of Boot # diff --git a/configs/platform-v7a/barebox-mx6.config.diff b/configs/platform-v7a/barebox-mx6.config.diff index 5b99586..93775f6 100644 --- a/configs/platform-v7a/barebox-mx6.config.diff +++ b/configs/platform-v7a/barebox-mx6.config.diff @@ -21,10 +21,12 @@ CONFIG_AT803X_PHY=y CONFIG_BAREBOX_UPDATE_IMX_NAND_FCB=y CONFIG_BCH=y # CONFIG_BMP is not set +CONFIG_BOOTCHOOSER=y CONFIG_BOOTM_OFTREE_UIMAGE=y # CONFIG_CACHE_L2X0 is not set # CONFIG_CLOCKSOURCE_BCM283X is undefined CONFIG_CLOCKSOURCE_IMX_GPT=y +CONFIG_CMD_BOOTCHOOSER=y # CONFIG_CMD_FBTEST is not set CONFIG_CMD_FCB=y # CONFIG_CMD_KEYSTORE is not set diff --git a/configs/platform-v7a/config/images/riotboard.config b/configs/platform-v7a/config/images/riotboard.config index 32ca817..f311fd5 100644 --- a/configs/platform-v7a/config/images/riotboard.config +++ b/configs/platform-v7a/config/images/riotboard.config @@ -15,6 +15,12 @@ image @IMAGE@ { image = root.ext2 partition-type = 0x83 } + + partition root-B { + image = root.ext2 + partition-type = 0x83 + } + partition data { partition-type = 0x83 size = 512M diff --git a/configs/platform-v7a/dts/bootstate.dtsi b/configs/platform-v7a/dts/bootstate.dtsi index 6415dcc..b118975 100644 --- a/configs/platform-v7a/dts/bootstate.dtsi +++ b/configs/platform-v7a/dts/bootstate.dtsi @@ -74,6 +74,33 @@ }; #endif +/** RIoTboard i.MX6S **********************************************************/ +#ifdef imx6s_riotboard_dts +/ { + aliases { + state = &state_usdhc4; + }; + + state_usdhc4: state { + #address-cells = <1>; + #size-cells = <1>; + compatible = "barebox,state"; + magic = <0x95ab2de7>; + backend-type = "raw"; + backend = <&backend_state_usdhc4>; + backend-storage-type = "direct"; + backend-stridesize = <0x40>; + }; +}; + +&usdhc4 { + backend_state_usdhc4: partition@100000 { + label = "barebox-state"; + reg = <0x100000 0x40000>; + }; +}; +#endif + /** Generic bootstate node for all platforms **********************************/ / { state: state { diff --git a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules index fde6c84..456aa24 100644 --- a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules +++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules @@ -29,6 +29,13 @@ KERNEL=="mmcblk0p4", SYMLINK+="disk/by-usage/data" GOTO="rauc_partitions_end" LABEL="rpi3_end" +ENV{OF_BASE_COMPATIBLE}!="*riot,imx6s-riotboard*", GOTO="riotboard_end" +KERNEL=="mmcblk2p1", SYMLINK+="disk/by-usage/rootfs0" +KERNEL=="mmcblk2p2", SYMLINK+="disk/by-usage/rootfs1" +KERNEL=="mmcblk2p3", SYMLINK+="disk/by-usage/data" +GOTO="rauc_partitions_end" +LABEL="riotboard_end" + # fallback for boards not yet supported by RAUC KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data" |