Skip to content

Commit

Permalink
boards: Fix nrf9160 NS flash partition layout
Browse files Browse the repository at this point in the history
Fix secure and non-secure images overlapping because of incompatible
flash layout configurations.

Align the board configurations to match the nRF9160 DK default
partition layout.

This enforces that the SPU alignment requirement is satisfied for
the nrf9160 MCU.

(cherry picked from commit dc431a7)

Original-Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
GitOrigin-RevId: dc431a7
Change-Id: I43cf610738d44448a838861ffd11b0b1ff1429ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4976616
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Tested-by: Al Semjonovs <asemjonovs@google.com>
Commit-Queue: Al Semjonovs <asemjonovs@google.com>
  • Loading branch information
joerchan authored and Chromeos LUCI committed Oct 25, 2023
1 parent 96247e6 commit b41be83
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,19 @@
slot0_partition: partition@10000 {
label = "image-0";
};
slot0_ns_partition: partition@40000 {
slot0_ns_partition: partition@50000 {
label = "image-0-nonsecure";
};
slot1_partition: partition@80000 {
label = "image-1";
};
slot1_ns_partition: partition@b0000 {
slot1_ns_partition: partition@c0000 {
label = "image-1-nonsecure";
};
scratch_partition: partition@f0000 {
label = "image-scratch";
reg = <0x000f0000 0xa000>;
};
storage_partition: partition@fa000 {
/* 0xf0000 to 0xf7fff reserved for TF-M partitions */
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000fa000 0x00006000>;
reg = <0x000f8000 0x00008000>;
};
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain:
- xtools
- zephyr
ram: 128
flash: 256
flash: 192
supported:
- i2c
- pwm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
*/

&slot0_partition {
reg = <0x00010000 0x30000>;
reg = <0x00010000 0x40000>;
};

&slot0_ns_partition {
reg = <0x00040000 0x40000>;
reg = <0x00050000 0x30000>;
};

&slot1_partition {
reg = <0x00080000 0x30000>;
reg = <0x00080000 0x40000>;
};

&slot1_ns_partition {
reg = <0x000b0000 0x40000>;
reg = <0x000c0000 0x30000>;
};

/* Default SRAM planning when building for nRF9160 with
Expand Down
18 changes: 7 additions & 11 deletions boards/arm/nrf9160_innblue21/nrf9160_innblue21_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,23 @@

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xc000>;
reg = <0x00000000 0x10000>;
};
slot0_partition: partition@c000 {
slot0_partition: partition@10000 {
label = "image-0";
};
slot0_ns_partition: partition@3e000 {
slot0_ns_partition: partition@50000 {
label = "image-0-nonsecure";
};
slot1_partition: partition@7e000 {
slot1_partition: partition@80000 {
label = "image-1";
};
slot1_ns_partition: partition@b0000 {
slot1_ns_partition: partition@c0000 {
label = "image-1-nonsecure";
};
scratch_partition: partition@f0000 {
label = "image-scratch";
reg = <0x000f0000 0xa000>;
};
storage_partition: partition@fa000 {
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000fa000 0x00006000>;
reg = <0x000f8000 0x00008000>;
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/nrf9160_innblue21/nrf9160_innblue21_ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain:
- xtools
- zephyr
ram: 128
flash: 256
flash: 192
supported:
- i2c
- pwm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
*/

&slot0_partition {
reg = <0x0000c000 0x30000>;
reg = <0x00010000 0x40000>;
};

&slot0_ns_partition {
reg = <0x0003e000 0x40000>;
reg = <0x00050000 0x30000>;
};

&slot1_partition {
reg = <0x0007e000 0x30000>;
reg = <0x00080000 0x40000>;
};

&slot1_ns_partition {
reg = <0x000b0000 0x40000>;
reg = <0x000c0000 0x30000>;
};

/* Default SRAM planning when building for nRF9160 with
Expand Down
19 changes: 8 additions & 11 deletions boards/arm/nrf9160_innblue22/nrf9160_innblue22_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -171,27 +171,24 @@

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xc000>;
reg = <0x00000000 0x10000>;
};
slot0_partition: partition@c000 {
slot0_partition: partition@10000 {
label = "image-0";
};
slot0_ns_partition: partition@3e000 {
slot0_ns_partition: partition@50000 {
label = "image-0-nonsecure";
};
slot1_partition: partition@7e000 {
slot1_partition: partition@80000 {
label = "image-1";
};
slot1_ns_partition: partition@b0000 {
slot1_ns_partition: partition@c0000 {
label = "image-1-nonsecure";
};
scratch_partition: partition@f0000 {
label = "image-scratch";
reg = <0x000f0000 0xa000>;
};
storage_partition: partition@fa000 {
/* 0xf0000 to 0xf7fff reserved for TF-M partitions */
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000fa000 0x00006000>;
reg = <0x000f8000 0x00008000>;
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/nrf9160_innblue22/nrf9160_innblue22_ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain:
- xtools
- zephyr
ram: 128
flash: 256
flash: 192
supported:
- i2c
- pwm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
*/

&slot0_partition {
reg = <0x0000c000 0x30000>;
reg = <0x00010000 0x40000>;
};

&slot0_ns_partition {
reg = <0x0003e000 0x40000>;
reg = <0x00050000 0x30000>;
};

&slot1_partition {
reg = <0x0007e000 0x30000>;
reg = <0x00080000 0x40000>;
};

&slot1_ns_partition {
reg = <0x000b0000 0x40000>;
reg = <0x000c0000 0x30000>;
};

/* Default SRAM planning when building for nRF9160 with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,19 @@
slot0_partition: partition@10000 {
label = "image-0";
};
slot0_ns_partition: partition@40000 {
slot0_ns_partition: partition@50000 {
label = "image-0-nonsecure";
};
slot1_partition: partition@80000 {
label = "image-1";
};
slot1_ns_partition: partition@b0000 {
slot1_ns_partition: partition@c0000 {
label = "image-1-nonsecure";
};
scratch_partition: partition@f0000 {
label = "image-scratch";
reg = <0x000f0000 0xa000>;
};
storage_partition: partition@fa000 {
/* 0xf0000 to 0xf7fff reserved for TF-M partitions */
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000fa000 0x00006000>;
reg = <0x000f8000 0x00008000>;
};
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain:
- xtools
- zephyr
ram: 128
flash: 256
flash: 192
supported:
- i2c
- pwm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
*/

&slot0_partition {
reg = <0x00010000 0x30000>;
reg = <0x00010000 0x40000>;
};

&slot0_ns_partition {
reg = <0x00040000 0x40000>;
reg = <0x00050000 0x30000>;
};

&slot1_partition {
reg = <0x00080000 0x30000>;
reg = <0x00080000 0x40000>;
};

&slot1_ns_partition {
reg = <0x000b0000 0x40000>;
reg = <0x000c0000 0x30000>;
};

/* Default SRAM planning when building for nRF9160 with
Expand Down

0 comments on commit b41be83

Please sign in to comment.