Skip to content

Commit 5197386

Browse files
Revert "[nrf noup] tree-wide: support NCS Partition Manager (PM) definitions"
This reverts commit 1fb3734. Signed-off-by: Martí Bolívar <[email protected]>
1 parent d9b9477 commit 5197386

File tree

9 files changed

+5
-138
lines changed

9 files changed

+5
-138
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,10 +1104,6 @@ set(logical_target_for_zephyr_elf ${logical_target_for_zephyr_elf} PARENT_SCOPE)
11041104
# 2. it can be defined in Kconfig
11051105
set_target_properties(${logical_target_for_zephyr_elf} PROPERTIES OUTPUT_NAME ${KERNEL_NAME})
11061106

1107-
if (ZEPHYR_NRF_MODULE_DIR)
1108-
include(${ZEPHYR_NRF_MODULE_DIR}/cmake/s1.cmake)
1109-
endif()
1110-
11111107
set(post_build_commands "")
11121108
set(post_build_byproducts "")
11131109

Kconfig.zephyr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ config FLASH_LOAD_SIZE
119119
endif # HAS_FLASH_LOAD_OFFSET
120120

121121
config TEXT_SECTION_OFFSET
122-
hex "TEXT section offset"
122+
hex
123+
prompt "TEXT section offset" if !BOOTLOADER_MCUBOOT
124+
default 0x200 if BOOTLOADER_MCUBOOT
123125
default 0
124126
help
125127
If the application is built for chain-loading by a bootloader this

cmake/app/boilerplate.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,6 @@ set_property(TARGET app PROPERTY ARCHIVE_OUTPUT_DIRECTORY app)
585585

586586
add_subdirectory(${ZEPHYR_BASE} ${__build_dir})
587587

588-
if(ZEPHYR_NRF_MODULE_DIR)
589-
include(${ZEPHYR_NRF_MODULE_DIR}/cmake/partition_manager.cmake)
590-
endif()
591-
592588
# Link 'app' with the Zephyr interface libraries.
593589
#
594590
# NB: This must be done in boilerplate.cmake because 'app' can only be

drivers/flash/soc_flash_nrf.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030

3131
#define SOC_NV_FLASH_NODE DT_INST(0, soc_nv_flash)
3232

33-
#if CONFIG_ARM_NONSECURE_FIRMWARE && CONFIG_SPM
34-
#include <secure_services.h>
35-
#if USE_PARTITION_MANAGER
36-
#include <pm_config.h>
37-
#endif /* USE_PARTITION_MANAGER */
38-
#endif /* CONFIG_ARM_NONSECURE_FIRMWARE && CONFIG_SPM */
39-
4033
#if defined(CONFIG_SOC_FLASH_NRF_RADIO_SYNC)
4134
#include <sys/__assert.h>
4235
#include <bluetooth/hci.h>
@@ -183,12 +176,6 @@ static int flash_nrf_read(struct device *dev, off_t addr,
183176
return 0;
184177
}
185178

186-
#if CONFIG_ARM_NONSECURE_FIRMWARE && CONFIG_SPM && USE_PARTITION_MANAGER
187-
if (addr < PM_APP_ADDRESS) {
188-
return spm_request_read(data, addr, len);
189-
}
190-
#endif
191-
192179
memcpy(data, (void *)addr, len);
193180

194181
return 0;

include/arch/arm/aarch32/cortex_m/scripts/linker.ld

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,6 @@
3333
#define _DATA_IN_ROM
3434
#endif
3535

36-
#if USE_PARTITION_MANAGER
37-
#include <pm_config.h>
38-
39-
#ifdef LINK_INTO_s1
40-
/* We are linking against S1, create symbol containing the flash ID of S0.
41-
* This is used when writing code operating on the "other" slot.
42-
*/
43-
_image_1_primary_slot_id = PM_S0_ID;
44-
45-
#define ROM_ADDR PM_ADDRESS + PM_S1_ADDRESS - PM_S0_ADDRESS
46-
47-
#else /* ! LINK_INTO_s1 */
48-
49-
#ifdef PM_S1_ID
50-
/* We are linking against S0, create symbol containing the flash ID of S1.
51-
* This is used when writing code operating on the "other" slot.
52-
*/
53-
_image_1_primary_slot_id = PM_S1_ID;
54-
#endif /* PM_S1_ID */
55-
56-
#define ROM_ADDR PM_ADDRESS
57-
#endif /* LINK_MCUBOOT_INTO_s1 */
58-
#define ROM_SIZE PM_SIZE
59-
#else
60-
6136
#if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0)
6237
#define ROM_ADDR RAM_ADDR
6338
#else
@@ -74,9 +49,8 @@ _image_1_primary_slot_id = PM_S1_ID;
7449
#define ROM_SIZE CONFIG_FLASH_LOAD_SIZE
7550
#else
7651
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET)
77-
#endif /* CONFIG_FLASH_LOAD_SIZE > 0 */
78-
#endif /* CONFIG_HAS_TI_CCFG */
79-
#endif /* USE_PARTITION_MANAGER */
52+
#endif
53+
#endif
8054

8155
#if defined(CONFIG_XIP)
8256
#if defined(CONFIG_IS_BOOTLOADER)

include/storage/flash_map.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -209,39 +209,6 @@ int flash_area_has_driver(const struct flash_area *fa);
209209
*/
210210
struct device *flash_area_get_device(const struct flash_area *fa);
211211

212-
#if USE_PARTITION_MANAGER
213-
#include <pm_config.h>
214-
#include <sys/util.h>
215-
216-
/* Aliases for zephyr - mcuboot/ncs style naming */
217-
#define image_0 mcuboot_primary
218-
#define image_1 mcuboot_secondary
219-
220-
#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS)
221-
#define storage settings_storage
222-
#elif CONFIG_FILE_SYSTEM_LITTLEFS
223-
#define storage littlefs_storage
224-
#endif
225-
226-
#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS) && CONFIG_FILE_SYSTEM_LITTLEFS
227-
#error "Not supported"
228-
#endif
229-
230-
#define PM_ID(label) PM_##label##_ID
231-
232-
#define FLASH_AREA_ID(label) PM_ID(label)
233-
234-
#define FLASH_AREA_OFFSET(label) \
235-
UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), _OFFSET))
236-
237-
#define FLASH_AREA_SIZE(label) \
238-
UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), _SIZE))
239-
240-
#define FLASH_AREA_LABEL_EXISTS(label) \
241-
IS_ENABLED(FLASH_AREA_SIZE(label))
242-
243-
#else
244-
245212
#define FLASH_AREA_LABEL_EXISTS(label) \
246213
DT_HAS_FIXED_PARTITION_LABEL(label)
247214

@@ -254,8 +221,6 @@ struct device *flash_area_get_device(const struct flash_area *fa);
254221
#define FLASH_AREA_SIZE(label) \
255222
DT_REG_SIZE(DT_NODE_BY_FIXED_PARTITION_LABEL(label))
256223

257-
#endif /* USE_PARTITION_MANAGER */
258-
259224
#ifdef __cplusplus
260225
}
261226
#endif

subsys/dfu/boot/mcuboot.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ struct mcuboot_v1_raw_header {
7272
#define FLASH_MIN_WRITE_SIZE \
7373
DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)
7474

75-
#if USE_PARTITION_MANAGER
76-
#include <pm_config.h>
77-
78-
#define FLASH_AREA_IMAGE_PRIMARY PM_MCUBOOT_PRIMARY_ID
79-
#define FLASH_AREA_IMAGE_SECONDARY PM_MCUBOOT_SECONDARY_ID
80-
#ifdef PM_MCUBOOT_SCRATCH_ID
81-
#define FLASH_AREA_IMAGE_SCRATCH PM_MCUBOOT_SCRATCH_ID
82-
#endif
83-
84-
#else
85-
8675
/* FLASH_AREA_ID() values used below are auto-generated by DT */
8776
#ifdef CONFIG_TRUSTED_EXECUTION_NONSECURE
8877
#define FLASH_AREA_IMAGE_PRIMARY FLASH_AREA_ID(image_0_nonsecure)
@@ -96,8 +85,6 @@ struct mcuboot_v1_raw_header {
9685
#define FLASH_AREA_IMAGE_SCRATCH FLASH_AREA_ID(image_scratch)
9786
#endif
9887

99-
#endif /* USE_PARTITION_MANAGER */
100-
10188
#ifdef CONFIG_MCUBOOT_TRAILER_SWAP_TYPE
10289
#define SWAP_TYPE_OFFS(bank_area) ((bank_area)->fa_size -\
10390
BOOT_MAGIC_SZ - BOOT_MAX_ALIGN * 3)

subsys/dfu/img_util/flash_img.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,13 @@
1717
#endif
1818

1919
#include <devicetree.h>
20-
21-
#if USE_PARTITION_MANAGER
22-
23-
#include <pm_config.h>
24-
#define FLASH_AREA_IMAGE_SECONDARY PM_MCUBOOT_SECONDARY_ID
25-
#else
26-
2720
/* FLASH_AREA_ID() values used below are auto-generated by DT */
2821
#ifdef CONFIG_TRUSTED_EXECUTION_NONSECURE
2922
#define FLASH_AREA_IMAGE_SECONDARY FLASH_AREA_ID(image_1_nonsecure)
3023
#else
3124
#define FLASH_AREA_IMAGE_SECONDARY FLASH_AREA_ID(image_1)
3225
#endif /* CONFIG_TRUSTED_EXECUTION_NONSECURE */
3326

34-
#endif /* USE_PARTITION_MANAGER */
35-
3627
#define FLASH_WRITE_BLOCK_SIZE \
3728
DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)
3829

subsys/storage/flash_map/flash_map_default.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,6 @@
1010
#include <zephyr.h>
1111
#include <storage/flash_map.h>
1212

13-
#if USE_PARTITION_MANAGER
14-
15-
/**
16-
* Have flash_map_default use Partition Manager information instead of
17-
* DeviceTree information when we are using the Partition Manager.
18-
*/
19-
20-
#include <pm_config.h>
21-
#include <sys/util.h>
22-
23-
#define FLASH_MAP_OFFSET(i) UTIL_CAT(PM_, UTIL_CAT(PM_##i##_LABEL, _ADDRESS))
24-
#define FLASH_MAP_DEV(i) UTIL_CAT(PM_, UTIL_CAT(PM_##i##_LABEL, _DEV_NAME))
25-
#define FLASH_MAP_SIZE(i) UTIL_CAT(PM_, UTIL_CAT(PM_##i##_LABEL, _SIZE))
26-
#define FLASH_MAP_NUM PM_NUM
27-
28-
#define FLASH_AREA_FOO(i, _) \
29-
{ \
30-
.fa_id = i, \
31-
.fa_off = FLASH_MAP_OFFSET(i), \
32-
.fa_dev_name = FLASH_MAP_DEV(i), \
33-
.fa_size = FLASH_MAP_SIZE(i) \
34-
},
35-
36-
const struct flash_area default_flash_map[] = {
37-
UTIL_LISTIFY(FLASH_MAP_NUM, FLASH_AREA_FOO, ~)
38-
};
39-
40-
#else
41-
4213
/* Get the grand parent of a node */
4314
#define GPARENT(node_id) DT_PARENT(DT_PARENT(node_id))
4415

@@ -79,7 +50,5 @@ const struct flash_area default_flash_map[] = {
7950
DT_INST_FOREACH_STATUS_OKAY(FOREACH_PARTION)
8051
};
8152

82-
#endif /* USE_PARTITION_MANAGER */
83-
8453
const int flash_map_entries = ARRAY_SIZE(default_flash_map);
8554
const struct flash_area *flash_map = default_flash_map;

0 commit comments

Comments
 (0)