Skip to content

Commit

Permalink
suit: Remove legacy implementation
Browse files Browse the repository at this point in the history
Remove pieces, that were required for Eng A board support, as well as
old DTS definitions.

Ref: NCSDK-30398

Signed-off-by: Tomasz Chyrowicz <[email protected]>
(cherry picked from commit b777188)
  • Loading branch information
tomchy authored and github-actions[bot] committed Jan 10, 2025
1 parent 99ed3ed commit 65e2f0f
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 37 deletions.
21 changes: 0 additions & 21 deletions subsys/mgmt/suitfu/src/suitfu_mgmt_suit.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,44 +55,23 @@ static const struct mgmt_handler suit_mgmt_handlers[] = {
#endif
};

#ifdef CONFIG_MGMT_SUITFU_GRP_OS
static const struct mgmt_handler suit_mgmt_os_handlers[] = {
[OS_MGMT_ID_BOOTLOADER_INFO] = {.mh_read = suitfu_mgmt_suit_bootloader_info_read,
.mh_write = NULL},
};
#endif

static struct mgmt_group suit_mgmt_group = {
.mg_handlers = (struct mgmt_handler *)suit_mgmt_handlers,
.mg_handlers_count = ARRAY_SIZE(suit_mgmt_handlers),
.mg_group_id = CONFIG_MGMT_GROUP_ID_SUIT,
};

#ifdef CONFIG_MGMT_SUITFU_GRP_OS
static struct mgmt_group suit_mgmt_os_group = {
.mg_handlers = (struct mgmt_handler *)suit_mgmt_os_handlers,
.mg_handlers_count = ARRAY_SIZE(suit_mgmt_os_handlers),
.mg_group_id = MGMT_GROUP_ID_OS,
};
#endif

void suit_mgmt_register_group(void)
{
#ifdef CONFIG_MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH
suitfu_mgmt_suit_image_fetch_init();
#endif
mgmt_register_group(&suit_mgmt_group);
#ifdef CONFIG_MGMT_SUITFU_GRP_OS
mgmt_register_group(&suit_mgmt_os_group);
#endif
}

void suit_mgmt_unregister_group(void)
{
mgmt_unregister_group(&suit_mgmt_group);
#ifdef CONFIG_MGMT_SUITFU_GRP_OS
mgmt_unregister_group(&suit_mgmt_os_group);
#endif
}

#ifdef CONFIG_MGMT_SUITFU_AUTO_REGISTER_HANDLERS
Expand Down
3 changes: 0 additions & 3 deletions subsys/suit/memory_layout/src/suit_memory_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
#elif (DT_NODE_EXISTS(DT_NODELABEL(flash0))) /* nrf52 or flash simulator */
#define INTERNAL_NVM_START DT_REG_ADDR(DT_NODELABEL(flash0))
#define INTERNAL_NVM_SIZE DT_REG_SIZE(DT_NODELABEL(flash0))
#elif (DT_NODE_EXISTS(DT_NODELABEL(rram0))) /* nrf54l15 */
#define INTERNAL_NVM_START DT_REG_ADDR(DT_NODELABEL(rram0))
#define INTERNAL_NVM_SIZE DT_REG_SIZE(DT_NODELABEL(rram0))
#else
#error "No recognizable internal nvm nodes found."
#endif
Expand Down
8 changes: 3 additions & 5 deletions subsys/suit/storage/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ config SUIT_STORAGE_N_ENVELOPES
- SecDom: firmware + recovery
- SysCtlr: firmware
- Radio: recovery
* Radio: firmware (A)
* Radio: firmware (B)
- Radio: firmware (A)
- Radio: firmware (B)
- ROOT
- Application: recovery
- Application: firmware (A)
- Application: firmware (B)
* Application: user data

Manifests marked with (*) are not available in legacy SUIT storage format.
- Application: user data

For debug and test platforms (POSIX, nRF52840) the following envelopes may be defined:
- ROOT
Expand Down
4 changes: 1 addition & 3 deletions subsys/suit/storage/include/suit_storage_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
extern "C" {
#endif

#define SUIT_STORAGE_NVM_NODE \
COND_CODE_1(DT_NODE_EXISTS(DT_NODELABEL(secdom_nvs)), (DT_NODELABEL(secdom_nvs)), \
(DT_CHOSEN(zephyr_flash)))
#define SUIT_STORAGE_NVM_NODE DT_CHOSEN(zephyr_flash)
#define SUIT_STORAGE_WRITE_SIZE DT_PROP(SUIT_STORAGE_NVM_NODE, write_block_size)
#define SUIT_STORAGE_EB_SIZE DT_PROP(SUIT_STORAGE_NVM_NODE, erase_block_size)
#define SUIT_STORAGE_ACCESS_BLOCK_SIZE \
Expand Down
1 change: 0 additions & 1 deletion subsys/suit/storage/src/suit_storage_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <zephyr/drivers/flash.h>
#include <zephyr/logging/log.h>

#define UPDATE_MAGIC_VALUE_AVAILABLE_RAW 0x5555AAAA
#define UPDATE_MAGIC_VALUE_AVAILABLE_CBOR 0x55AA55AA
#define UPDATE_MAGIC_VALUE_EMPTY 0xFFFFFFFF

Expand Down
4 changes: 0 additions & 4 deletions subsys/suit/utils/src/suit_plat_mem_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ uintptr_t suit_plat_mem_nvm_offset_get(uint8_t *ptr)

#if (DT_NODE_EXISTS(DT_NODELABEL(mram1x)))
address = (((address) & 0xEFFFFFFFUL) - (DT_REG_ADDR(DT_NODELABEL(mram1x)) & 0xEFFFFFFFUL));
#elif (DT_NODE_EXISTS(DT_NODELABEL(mram10)))
address = (((address) & 0xEFFFFFFFUL) - (DT_REG_ADDR(DT_NODELABEL(mram10)) & 0xEFFFFFFFUL));
#endif

return address;
Expand All @@ -88,8 +86,6 @@ uint8_t *suit_plat_mem_nvm_ptr_get(uintptr_t offset)

#if (DT_NODE_EXISTS(DT_NODELABEL(mram1x)))
address = (((offset) & 0xEFFFFFFFUL) + (DT_REG_ADDR(DT_NODELABEL(mram1x)) & 0xEFFFFFFFUL));
#elif (DT_NODE_EXISTS(DT_NODELABEL(mram10)))
address = (((offset) & 0xEFFFFFFFUL) + (DT_REG_ADDR(DT_NODELABEL(mram10)) & 0xEFFFFFFFUL));
#else
address = offset;
#endif
Expand Down

0 comments on commit 65e2f0f

Please sign in to comment.