Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions soc/nordic/nrf54h/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
#define HSFLL_NODE DT_NODELABEL(cpurad_hsfll)
#endif

#ifdef CONFIG_USE_DT_CODE_PARTITION
#define FLASH_LOAD_OFFSET DT_REG_ADDR(DT_CHOSEN(zephyr_code_partition))
#elif defined(CONFIG_FLASH_LOAD_OFFSET)
#define FLASH_LOAD_OFFSET CONFIG_FLASH_LOAD_OFFSET
#endif

#define PARTITION_IS_RUNNING_APP_PARTITION(label) \
(DT_REG_ADDR(DT_NODELABEL(label)) == FLASH_LOAD_OFFSET)

sys_snode_t soc_node;

#define FICR_ADDR_GET(node_id, name) \
Expand All @@ -44,8 +53,6 @@ sys_snode_t soc_node;
ADDRESS_DOMAIN_Msk | \
ADDRESS_BUS_Msk)))

#define DT_NODELABEL_CPURAD_SLOT0_PARTITION DT_NODELABEL(cpurad_slot0_partition)

static void power_domain_init(void)
{
/*
Expand Down Expand Up @@ -172,11 +179,24 @@ void soc_late_init_hook(void)
*/
uint8_t *msg = NULL;
size_t msg_size = 0;

void *radiocore_address =
(void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL_CPURAD_SLOT0_PARTITION)) +
DT_REG_ADDR(DT_NODELABEL_CPURAD_SLOT0_PARTITION) +
CONFIG_ROM_START_OFFSET);
void *radiocore_address = NULL;

if (PARTITION_IS_RUNNING_APP_PARTITION(slot0_partition)) {
radiocore_address =
(void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot0_partition))) +
DT_REG_ADDR(DT_NODELABEL(cpurad_slot0_partition)) +
CONFIG_ROM_START_OFFSET);
#if DT_NODE_EXISTS(DT_NODELABEL(cpurad_slot1_partition))
} else if (PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
radiocore_address =
(void *)(DT_REG_ADDR(DT_GPARENT(DT_NODELABEL(cpurad_slot1_partition))) +
DT_REG_ADDR(DT_NODELABEL(cpurad_slot1_partition)) +
CONFIG_ROM_START_OFFSET);
#endif
} else {
__ASSERT(radiocore_address != NULL, "Unable to find radio core code parition");
return;
}

/* Don't wait as this is not yet supported. */
bool cpu_wait = false;
Expand Down
4 changes: 3 additions & 1 deletion subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ int img_mgmt_active_slot(int image)
#if CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1
slot = (image << 1);

#if CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE
#if defined(CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE) || \
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) || \
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT)
if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
slot += 1;
}
Expand Down