From 8a44103558b3ad6d945ce2aba061fe9c21a4edeb Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 22 Mar 2018 23:48:45 +0100 Subject: [PATCH] Use states --- .../board/ova/barebox-state.dtb | Bin 0 -> 1030 bytes .../board/ova/barebox-state.dts | 61 ++++++++++++++++++ buildroot-external/board/ova/genimage.cfg | 8 +++ buildroot-external/board/ova/post-image.sh | 2 + 4 files changed, 71 insertions(+) create mode 100644 buildroot-external/board/ova/barebox-state.dtb create mode 100644 buildroot-external/board/ova/barebox-state.dts diff --git a/buildroot-external/board/ova/barebox-state.dtb b/buildroot-external/board/ova/barebox-state.dtb new file mode 100644 index 0000000000000000000000000000000000000000..c7b58aa05a381ffc7bc264759417d380ce622ed5 GIT binary patch literal 1030 zcma)5%}N6?5T4qiR{Se?5Iji{1Y7K?h@MxD$$sp7e*!et0pJFp{*L=8qJ`K;(3+tA$%%8{TA|f(Zxk}wN_`Jy z(rZi#rnx2;I@?7YoomAk@5ek&)tF8I))2KIO^rSBd%5R%y|4vLxYDO}*%UXkmd;Ie#@Y10pfspg6A{eG+NANs4laxUfGY_lj*TY zV!{jAJw3$-AX&gANRf>4PBvsoBss)vAVLV!IAcZxXb4#N%9E&T##yCQMs1XcIFUod JU)V?*_yLpYi3$J! literal 0 HcmV?d00001 diff --git a/buildroot-external/board/ova/barebox-state.dts b/buildroot-external/board/ova/barebox-state.dts new file mode 100644 index 000000000..b9f720c0b --- /dev/null +++ b/buildroot-external/board/ova/barebox-state.dts @@ -0,0 +1,61 @@ +/dts-v1/; +/ { + #address-cells = <1>; + #size-cells = <1>; + + aliases { + state = &state_sd; + }; + + backend_state_sd: bootstate@0x111000 { + reg = <0x111000 0x418>; + label = "state-sd"; + }; + + state_sd: state_memory { + magic = <0xef784236>; + compatible = "barebox,state"; + backend-type = "raw"; + backend = <&backend_state_sd>; + backend-stridesize = <1024>; + + bootstate { + #address-cells = <1>; + #size-cells = <1>; + + system0 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts@0 { + reg = <0x0 0x4>; + type = "uint32"; + default = <3>; + }; + priority@4 { + reg = <0x4 0x4>; + type = "uint32"; + default = <10>; + }; + }; + system1 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts@8 { + reg = <0x8 0x4>; + type = "uint32"; + default = <3>; + }; + priority@c { + reg = <0xc 0x4>; + type = "uint32"; + default = <20>; + }; + }; + last_chosen@10 { + reg = <0x10 0x4>; + type = "uint32"; + }; + }; + }; +}; + diff --git a/buildroot-external/board/ova/genimage.cfg b/buildroot-external/board/ova/genimage.cfg index 94cb9bddc..b0ad54080 100644 --- a/buildroot-external/board/ova/genimage.cfg +++ b/buildroot-external/board/ova/genimage.cfg @@ -5,6 +5,9 @@ image boot.vfat { file EFI/BOOT/BOOTx64.EFI { image = "barebox.bin" } + file EFI/barebox/state.dtb { + image = "barebox-state.dtb" + } } size = 32M } @@ -32,6 +35,11 @@ image sdcard.img { size = 256M } + partition bootstate { + partition-type = 0x83 + size = 2M + } + partition overlay { partition-type = 0x83 image = "overlay.ext4" diff --git a/buildroot-external/board/ova/post-image.sh b/buildroot-external/board/ova/post-image.sh index 84e955028..3a2b1f373 100755 --- a/buildroot-external/board/ova/post-image.sh +++ b/buildroot-external/board/ova/post-image.sh @@ -16,6 +16,8 @@ dd if=/dev/zero of="$DATA_IMG" bs=4k count=16000 mkfs.ext4 "$OVERLAY_IMG" && tune2fs -L "overlay" -c0 -i0 "$OVERLAY_IMG" mkfs.ext4 "$DATA_IMG" && tune2fs -L "data" -c0 -i0 "$DATA_IMG" +cp "$BOARD_DIR/barebox-state.dtb" "$BINARIES_DIR/" + genimage \ --rootpath "$TARGET_DIR" \ --tmppath "$GENIMAGE_TMP" \