Skip to content

Commit e550200

Browse files
committed
suit: Use cache pool 1 for SDFW updates
Change the default SUIT cache pool ID for SDFW updates to 1, so it matches other update scenarios that uses external memory for SDFW and SCFW FW transfers. Ref: NCSDK-30810 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 4fa19dc commit e550200

File tree

7 files changed

+38
-16
lines changed

7 files changed

+38
-16
lines changed

subsys/suit/cache/Kconfig

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,31 @@ config SUIT_CACHE_RW
3939
depends on SUIT_UTILS
4040
depends on !SUIT_PLATFORM_VARIANT_SDFW
4141

42-
config SUIT_CACHE_SDFW_IPUC_ID
43-
int "IPUC-based parition number, capable of performing SDFW updates"
42+
config SUIT_CACHE_SDFW_IPUC
43+
bool "Enable IPUC-based partition, capable of performing SDFW updates"
4444
depends on SUIT_CACHE_RW
4545
depends on FLASH_IPUC
46-
default 254
46+
depends on !$(dt_nodelabel_enabled,dfu_cache_partition_1)
47+
help
48+
Enables IPCU-based SUIT cache partition, capable of performing SDFW
49+
updates.
50+
Since this partition is always registered as DFU cache partition 1,
51+
it cannot be used if the application defines dfu_cache_partition_1
52+
prtition in the DTS.
4753

48-
config SUIT_CACHE_APP_IPUC_ID
49-
int "IPUC-based parition number, without address restrictions"
54+
config SUIT_CACHE_SDFW_IPUC_ID
55+
int
56+
depends on SUIT_CACHE_SDFW_IPUC
57+
default 1
58+
59+
config SUIT_CACHE_APP_IPUC
60+
bool "Enable IPUC-based partition, without address restrictions"
5061
depends on SUIT_CACHE_RW
5162
depends on FLASH_IPUC
63+
64+
config SUIT_CACHE_APP_IPUC_ID
65+
int "IPUC-based partition number, without address restrictions"
66+
depends on SUIT_CACHE_APP_IPUC
5267
default 255
5368

5469
endif # SUIT_CACHE

subsys/suit/cache/src/suit_dfu_cache_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ suit_plat_err_t suit_dfu_cache_partition_slot_foreach(struct dfu_cache_pool *cac
6262
*
6363
* @param cache_pool Pointer to the SUIT cache pool structure.
6464
*
65-
* @retval SUIT_PLAT_ERR_IO if unable to read parition contents.
65+
* @retval SUIT_PLAT_ERR_IO if unable to read partition contents.
6666
* @retval SUIT_PLAT_ERR_NOT_FOUND if partition contains inconsistent data.
6767
* @retval SUIT_PLAT_SUCCESS if partition initialized.
6868
*/

subsys/suit/cache/src/suit_dfu_cache_rw.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ static struct dfu_cache_partition_ext dfu_partitions_ext[] = {
8383
.id = 0,
8484
},
8585
LISTIFY(CONFIG_SUIT_CACHE_MAX_CACHES, PARTITION_DEFINE, (), dfu_cache_partition_)
86+
/* clang-format off */
8687
#ifdef CONFIG_SUIT_CACHE_SDFW_IPUC_ID
87-
{
88-
.id = CONFIG_SUIT_CACHE_SDFW_IPUC_ID,
89-
},
88+
{
89+
.id = CONFIG_SUIT_CACHE_SDFW_IPUC_ID,
90+
},
9091
#endif /* CONFIG_SUIT_CACHE_SDFW_IPUC_ID */
92+
/* clang-format on */
9193
#ifdef CONFIG_SUIT_CACHE_APP_IPUC_ID
9294
{
9395
.id = CONFIG_SUIT_CACHE_APP_IPUC_ID,
@@ -817,7 +819,7 @@ suit_plat_err_t suit_dfu_cache_rw_slot_drop(struct suit_cache_slot *slot)
817819

818820
#ifdef CONFIG_FLASH_IPUC
819821
/**
820-
* @brief Check the availability of IPUCs that can be used as SUIT cache parition.
822+
* @brief Check the availability of IPUCs that can be used as SUIT cache partition.
821823
*/
822824
static void dfu_cache_ipuc_init(void)
823825
{

tests/subsys/suit/fetch/Kconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ endchoice # TEST_SUIT_PLATFORM_FETCH_VARIANT
3535

3636
if TEST_SUIT_PLATFORM_FETCH_VARIANT_APP
3737

38+
config SUIT_CACHE_SDFW_IPUC
39+
default y
40+
3841
config SUIT_CACHE_SDFW_IPUC_ID
39-
default 254
42+
default 1
43+
44+
config SUIT_CACHE_APP_IPUC
45+
default y
4046

4147
config SUIT_CACHE_APP_IPUC_ID
4248
default 255

tests/subsys/suit/fetch/boards/native_sim.overlay

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
reg = <0xf5000 DT_SIZE_K(4)>;
1919
};
2020

21-
dfu_cache_partition_1: partition@f6000 {
21+
dfu_cache_partition_2: partition@f6000 {
2222
reg = <0xf6000 DT_SIZE_K(4)>;
2323
};
2424

tests/subsys/suit/fetch/boards/native_sim_64.overlay

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
reg = <0xf5000 DT_SIZE_K(4)>;
1919
};
2020

21-
dfu_cache_partition_1: partition@f6000 {
21+
dfu_cache_partition_2: partition@f6000 {
2222
reg = <0xf6000 DT_SIZE_K(4)>;
2323
};
2424

tests/subsys/suit/fetch/src/test_app_ipuc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,8 @@ ZTEST(fetch_app_cache_tests, test_fetch_to_ipuc_cache_sdfw_scfw_OK)
412412
0x4B, /* bytes(11) */
413413
0x6A, /* text(10) */
414414
'C', 'A', 'C', 'H', 'E', '_', 'P', 'O', 'O', 'L',
415-
0x42, /* bytes(2) */
416-
0x18, /* uint8_t */
417-
CONFIG_SUIT_CACHE_SDFW_IPUC_ID,
415+
0x41, /* bytes(1) */
416+
CONFIG_SUIT_CACHE_SDFW_IPUC_ID, /* uint8_t == 0x01 */
418417
};
419418
/* clang-format on */
420419
struct zcbor_string valid_dst_component_id = {

0 commit comments

Comments
 (0)