Skip to content

Commit df0121d

Browse files
maje-embnordicjm
authored andcommitted
applications: nrf_desktop: nrf54h20: use mapped-partition binding
Align the nrf54h20dk/nrf54h20/cpuapp memory map overlay with the platform's expected partition binding. After the Zephyr Kconfig rework that stopped subtracting zephyr,flash base from CONFIG_FLASH_LOAD_OFFSET, "fixed-partitions" caused MCUboot and the application image to be linked outside MRAM. Ref: NCSDK-39186 Signed-off-by: Marcin Jelinski <marcin.jelinski@nordicsemi.no>
1 parent 337c111 commit df0121d

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/memory_map.dtsi

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
/* Redefine the "partitions" DTS node. */
1111
partitions {
12-
compatible = "fixed-partitions";
1312
#address-cells = <1>;
1413
#size-cells = <1>;
1514
ranges;
@@ -19,24 +18,27 @@
1918
*/
2019

2120
cpuapp_boot_partition: partition@30000 {
21+
compatible = "zephyr,mapped-partition";
2222
reg = <0x30000 DT_SIZE_K(32)>;
2323
};
2424

2525
/* When using merged slots, the definition of MCUboot slots is common for all
2626
* images and points to the "merged" partition.
2727
*/
2828
slot0_partition: partition@38000 {
29-
compatible = "fixed-subpartitions";
29+
compatible = "zephyr,mapped-partition";
3030
reg = <0x38000 DT_SIZE_K(800)>;
3131
ranges = <0x0 0x38000 DT_SIZE_K(800)>;
3232
#address-cells = <1>;
3333
#size-cells = <1>;
3434

3535
cpuapp_slot0_partition: partition@800 {
36+
compatible = "zephyr,mapped-partition";
3637
reg = <0x800 DT_SIZE_K(330)>;
3738
};
3839

3940
cpurad_slot0_partition: partition@53000 {
41+
compatible = "zephyr,mapped-partition";
4042
reg = <0x53000 DT_SIZE_K(220)>;
4143
};
4244

@@ -50,17 +52,19 @@
5052
/* Partitions belonging to the MRAM_11 memory block. */
5153

5254
slot1_partition: partition@100000 {
53-
compatible = "fixed-subpartitions";
55+
compatible = "zephyr,mapped-partition";
5456
reg = <0x100000 DT_SIZE_K(800)>;
5557
ranges = <0x0 0x100000 DT_SIZE_K(800)>;
5658
#address-cells = <1>;
5759
#size-cells = <1>;
5860

5961
cpuapp_slot1_partition: partition@800 {
62+
compatible = "zephyr,mapped-partition";
6063
reg = <0x800 DT_SIZE_K(330)>;
6164
};
6265

6366
cpurad_slot1_partition: partition@53000 {
67+
compatible = "zephyr,mapped-partition";
6468
reg = <0x53000 DT_SIZE_K(220)>;
6569
};
6670

@@ -72,10 +76,12 @@
7276
};
7377

7478
storage_partition: partition@1c8000 {
79+
compatible = "zephyr,mapped-partition";
7580
reg = <0x1c8000 DT_SIZE_K(40)>;
7681
};
7782

7883
periphconf_partition: partition@1d2000 {
84+
compatible = "zephyr,mapped-partition";
7985
reg = <0x1d2000 DT_SIZE_K(8)>;
8086
};
8187

@@ -85,25 +91,29 @@
8591
* there is no more space after secure_storage_partition.
8692
*/
8793
secure_storage_partition: partition@1fd000 {
88-
compatible = "fixed-subpartitions";
94+
compatible = "zephyr,mapped-partition";
8995
reg = <0x1fd000 DT_SIZE_K(12)>;
9096
ranges = <0x0 0x1fd000 DT_SIZE_K(12)>;
9197
#address-cells = <1>;
9298
#size-cells = <1>;
9399

94100
cpuapp_crypto_partition: partition@0 {
101+
compatible = "zephyr,mapped-partition";
95102
reg = <0x0 DT_SIZE_K(4)>;
96103
};
97104

98105
cpurad_crypto_partition: partition@1000 {
106+
compatible = "zephyr,mapped-partition";
99107
reg = <0x1000 DT_SIZE_K(4)>;
100108
};
101109

102110
cpuapp_its_partition: partition@2000 {
111+
compatible = "zephyr,mapped-partition";
103112
reg = <0x2000 DT_SIZE_K(2)>;
104113
};
105114

106115
cpurad_its_partition: partition@2800 {
116+
compatible = "zephyr,mapped-partition";
107117
reg = <0x2800 DT_SIZE_K(2)>;
108118
};
109119
};

applications/nrf_desktop/src/modules/dfu.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,12 @@ LOG_MODULE_REGISTER(MODULE, CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_LOG_LEVEL);
130130
#define MCUBOOT_PRIMARY_NODE DT_NODELABEL(slot0_partition)
131131
#define MCUBOOT_SECONDARY_NODE DT_NODELABEL(slot1_partition)
132132

133-
BUILD_ASSERT(UTIL_OR(DT_PARTITION_EXISTS(MCUBOOT_PRIMARY_NODE),
134-
DT_FIXED_SUBPARTITION_EXISTS(MCUBOOT_PRIMARY_NODE)),
133+
BUILD_ASSERT(DT_PARTITION_EXISTS(MCUBOOT_PRIMARY_NODE),
135134
"Missing primary partition definition in DTS.");
136-
BUILD_ASSERT(UTIL_OR(DT_PARTITION_EXISTS(MCUBOOT_SECONDARY_NODE),
137-
DT_FIXED_SUBPARTITION_EXISTS(MCUBOOT_SECONDARY_NODE)),
135+
BUILD_ASSERT(DT_PARTITION_EXISTS(MCUBOOT_SECONDARY_NODE),
138136
"Missing secondary partition definition in DTS.");
139137

140-
141-
#define NVM_ADDRESS(node) \
142-
(COND_CODE_1(DT_FIXED_SUBPARTITION_EXISTS(node), \
143-
(DT_FIXED_SUBPARTITION_ADDR(node)), \
144-
(DT_PARTITION_ADDR(node))))
138+
#define NVM_ADDRESS(node) DT_PARTITION_ADDR(node)
145139
#define CODE_PARTITION_START_ADDR NVM_ADDRESS(CODE_PARTITION_NODE)
146140
#define MCUBOOT_PRIMARY_START_ADDR NVM_ADDRESS(MCUBOOT_PRIMARY_NODE)
147141
#define MCUBOOT_SECONDARY_START_ADDR NVM_ADDRESS(MCUBOOT_SECONDARY_NODE)

0 commit comments

Comments
 (0)