boards: nxp: Switch the rest from Swap-Scratch to Swap-Move

Switch the default MCUBoot FW Update mode from Swap & Scratch
to more preferable Swap & Move for the rest of NXP boards.
Delete the scratch partition. Save RAM & ROM.
Slot 0 has one additional sector, for use with
the swap move algorithm.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
This commit is contained in:
Andrej Butok 2024-04-18 15:32:05 +02:00 committed by Fabio Baltieri
parent 1e8051af34
commit 31aadda646
5 changed files with 41 additions and 55 deletions

View file

@ -92,18 +92,18 @@
label = "mcuboot"; label = "mcuboot";
reg = <0x00000000 DT_SIZE_K(64)>; reg = <0x00000000 DT_SIZE_K(64)>;
}; };
/* Note slot 0 has one additional sector,
* this is intended for use with the swap move algorithm
*/
slot0_partition: partition@10000 { slot0_partition: partition@10000 {
label = "image-0"; label = "image-0";
reg = <0x00010000 DT_SIZE_K(960)>; reg = <0x00010000 DT_SIZE_K(992)>;
}; };
slot1_partition: partition@100000 { slot1_partition: partition@100000 {
label = "image-1"; label = "image-1";
reg = <0x00100000 DT_SIZE_K(960)>; reg = <0x00108000 DT_SIZE_K(984)>;
};
scratch_partition: partition@1f0000 {
label = "image-scratch";
reg = <0x001f0000 DT_SIZE_K(64)>;
}; };
/* storage_partition is placed in WINBOND flash memory*/
}; };
}; };

View file

@ -187,24 +187,20 @@
reg = <0x00000000 0x00010000>; reg = <0x00000000 0x00010000>;
read-only; read-only;
}; };
/* Note slot 0 has one additional sector,
/* * this is intended for use with the swap move algorithm
* The flash starting at 0x00010000 and ending at
* 0x0001ffff (sectors 16-31) is reserved for use
* by the application.
*/ */
slot0_partition: partition@10000 {
slot0_partition: partition@20000 {
label = "image-0"; label = "image-0";
reg = <0x00020000 0x00060000>; reg = <0x00010000 0x00069000>;
}; };
slot1_partition: partition@80000 { slot1_partition: partition@79000 {
label = "image-1"; label = "image-1";
reg = <0x00080000 0x00060000>; reg = <0x00079000 0x00068000>;
}; };
scratch_partition: partition@e0000 { storage_partition: partition@e1000 {
label = "image-scratch"; label = "storage";
reg = <0x000e0000 0x00020000>; reg = <0x000e1000 0x0001f000>;
}; };
}; };
}; };

View file

@ -239,28 +239,20 @@ zephyr_udc0: &usbotg {
reg = <0x00000000 0x00010000>; reg = <0x00000000 0x00010000>;
read-only; read-only;
}; };
/* Note slot 0 has one additional sector,
/* * this is intended for use with the swap move algorithm
* The flash starting at 0x00010000 and ending at
* 0x0001ffff (sectors 16-31) is reserved for use
* by the application.
*/ */
storage_partition: partition@1e000 { slot0_partition: partition@10000 {
label = "storage";
reg = <0x0001e000 0x00002000>;
};
slot0_partition: partition@20000 {
label = "image-0"; label = "image-0";
reg = <0x00020000 0x00060000>; reg = <0x00010000 0x000E9000>;
}; };
slot1_partition: partition@80000 { slot1_partition: partition@F9000 {
label = "image-1"; label = "image-1";
reg = <0x00080000 0x00060000>; reg = <0x000F9000 0x000E8000>;
}; };
scratch_partition: partition@e0000 { storage_partition: partition@1e1000 {
label = "image-scratch"; label = "storage";
reg = <0x000e0000 0x00020000>; reg = <0x001e1000 0x0001f000>;
}; };
}; };
}; };

View file

@ -341,21 +341,20 @@
label = "mcuboot"; label = "mcuboot";
reg = <0x00000000 0xc000>; reg = <0x00000000 0xc000>;
}; };
/* Note slot 0 has one additional sector,
* this is intended for use with the swap move algorithm
*/
slot0_partition: partition@c000 { slot0_partition: partition@c000 {
label = "image-0"; label = "image-0";
reg = <0x0000c000 0x32000>; reg = <0x0000c000 0x37000>;
}; };
slot1_partition: partition@3e000 { slot1_partition: partition@43000 {
label = "image-1"; label = "image-1";
reg = <0x0003e000 0x32000>; reg = <0x00043000 0x36000>;
}; };
scratch_partition: partition@70000 { storage_partition: partition@79000 {
label = "image-scratch";
reg = <0x00070000 0xa000>;
};
storage_partition: partition@7a000 {
label = "storage"; label = "storage";
reg = <0x0007a000 0x00006000>; reg = <0x00079000 0x00007000>;
}; };
}; };
}; };

View file

@ -118,21 +118,20 @@
label = "mcuboot"; label = "mcuboot";
reg = <0x00000000 0x10000>; reg = <0x00000000 0x10000>;
}; };
storage_partition: partition@10000 { /* Note slot 0 has one additional sector,
label = "storage"; * this is intended for use with the swap move algorithm
reg = <0x00010000 0x10000>; */
}; slot0_partition: partition@10000 {
slot0_partition: partition@20000 {
label = "image-0"; label = "image-0";
reg = <0x00020000 0x60000>; reg = <0x00010000 0x68000>;
}; };
slot1_partition: partition@80000 { slot1_partition: partition@78000 {
label = "image-1"; label = "image-1";
reg = <0x00080000 0x60000>; reg = <0x00078000 0x66000>;
}; };
scratch_partition: partition@e0000 { storage_partition: partition@de000 {
label = "image-scratch"; label = "image-scratch";
reg = <0x000e0000 0x20000>; reg = <0x000de000 0x22000>;
}; };
}; };
}; };