Skip to content

Commit 2d736ad

Browse files
davidvinczed3zd3z
authored andcommitted
Replace flash partitioning terminology
This change replaces the slot 0/1 terminology with primary/secondary slot and replaces FLASH_AREA_IMAGE_0/1 with FLASH_AREA_IMAGE_PRIMARY/SECONDARY. This naming convention may be more understandable, fits better to MCUs with multiple images and it is an architecture agnostic alternative as well. Change-Id: I655a585f6ae023852c671ee6635399efe25209c9 Signed-off-by: David Vincze <[email protected]> Signed-off-by: David Brown <[email protected]>
1 parent 59bcb37 commit 2d736ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+918
-823
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ matrix:
1414
- os: linux
1515
env: SINGLE_FEATURES="sig-ecdsa enc-kw bootstrap" TEST=sim
1616
- os: linux
17-
env: SINGLE_FEATURES="none sig-rsa overwrite-only validate-slot0" TEST=sim
17+
env: SINGLE_FEATURES="none sig-rsa overwrite-only validate-primary-slot" TEST=sim
1818
- os: linux
1919
env: SINGLE_FEATURES="enc-rsa" TEST=sim
2020

@@ -25,19 +25,19 @@ matrix:
2525
- os: linux
2626
env: MULTI_FEATURES="sig-rsa overwrite-only,sig-ecdsa overwrite-only" TEST=sim
2727
- os: linux
28-
env: MULTI_FEATURES="sig-rsa validate-slot0,sig-ecdsa validate-slot0" TEST=sim
28+
env: MULTI_FEATURES="sig-rsa validate-primary-slot,sig-ecdsa validate-primary-slot" TEST=sim
2929
- os: linux
3030
env: MULTI_FEATURES="enc-kw overwrite-only,enc-rsa overwrite-only" TEST=sim
3131
- os: linux
32-
env: MULTI_FEATURES="sig-rsa enc-rsa validate-slot0" TEST=sim
32+
env: MULTI_FEATURES="sig-rsa enc-rsa validate-primary-slot" TEST=sim
3333
- os: linux
34-
env: MULTI_FEATURES="sig-rsa enc-kw validate-slot0 bootstrap" TEST=sim
34+
env: MULTI_FEATURES="sig-rsa enc-kw validate-primary-slot bootstrap" TEST=sim
3535
- os: linux
36-
env: MULTI_FEATURES="sig-ecdsa enc-kw validate-slot0" TEST=sim
36+
env: MULTI_FEATURES="sig-ecdsa enc-kw validate-primary-slot" TEST=sim
3737

3838
# FIXME: this test actually fails and must be fixed
3939
#- os: linux
40-
# env: MULTI_FEATURES="sig-rsa validate-slot0 overwrite-only"
40+
# env: MULTI_FEATURES="sig-rsa validate-primary-slot overwrite-only"
4141

4242
- os: linux
4343
language: go

boot/boot_serial/test/src/testcases/boot_serial_img_msg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ TEST_CASE(boot_serial_img_msg)
5959
tx_msg(buf, len);
6060

6161
/*
62-
* Validate contents inside image 0 slot
62+
* Validate contents inside the primary slot
6363
*/
64-
rc = flash_area_open(FLASH_AREA_IMAGE_0, &fap);
64+
rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &fap);
6565
assert(rc == 0);
6666

6767
rc = flash_area_read(fap, 0, enc_img, sizeof(img));

boot/boot_serial/test/src/testcases/boot_serial_upload_bigger_image.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ TEST_CASE(boot_serial_upload_bigger_image)
103103
}
104104

105105
/*
106-
* Validate contents inside image 0 slot
106+
* Validate contents inside the primary slot
107107
*/
108-
rc = flash_area_open(FLASH_AREA_IMAGE_0, &fap);
108+
rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &fap);
109109
assert(rc == 0);
110110

111111
for (off = 0; off < sizeof(img); off += sizeof(enc_img)) {

boot/bootutil/include/bootutil/bootutil.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@
2626
extern "C" {
2727
#endif
2828

29-
/** Attempt to boot the contents of slot 0. */
29+
/** Attempt to boot the contents of the primary slot. */
3030
#define BOOT_SWAP_TYPE_NONE 1
3131

32-
/** Swap to slot 1. Absent a confirm command, revert back on next boot. */
32+
/**
33+
* Swap to the secondary slot.
34+
* Absent a confirm command, revert back on next boot.
35+
*/
3336
#define BOOT_SWAP_TYPE_TEST 2
3437

35-
/** Swap to slot 1, and permanently switch to booting its contents. */
38+
/**
39+
* Swap to the secondary slot,
40+
* and permanently switch to booting its contents.
41+
*/
3642
#define BOOT_SWAP_TYPE_PERM 3
3743

3844
/** Swap back to alternate slot. A confirm changes this state to NONE. */

boot/bootutil/include/bootutil/caps.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ extern "C" {
3232
*/
3333
uint32_t bootutil_get_caps(void);
3434

35-
#define BOOTUTIL_CAP_RSA2048 (1<<0)
36-
#define BOOTUTIL_CAP_ECDSA_P224 (1<<1)
37-
#define BOOTUTIL_CAP_ECDSA_P256 (1<<2)
38-
#define BOOTUTIL_CAP_SWAP_UPGRADE (1<<3)
39-
#define BOOTUTIL_CAP_OVERWRITE_UPGRADE (1<<4)
40-
#define BOOTUTIL_CAP_ENC_RSA (1<<5)
41-
#define BOOTUTIL_CAP_ENC_KW (1<<6)
42-
#define BOOTUTIL_CAP_VALIDATE_SLOT0 (1<<7)
35+
#define BOOTUTIL_CAP_RSA2048 (1<<0)
36+
#define BOOTUTIL_CAP_ECDSA_P224 (1<<1)
37+
#define BOOTUTIL_CAP_ECDSA_P256 (1<<2)
38+
#define BOOTUTIL_CAP_SWAP_UPGRADE (1<<3)
39+
#define BOOTUTIL_CAP_OVERWRITE_UPGRADE (1<<4)
40+
#define BOOTUTIL_CAP_ENC_RSA (1<<5)
41+
#define BOOTUTIL_CAP_ENC_KW (1<<6)
42+
#define BOOTUTIL_CAP_VALIDATE_PRIMARY_SLOT (1<<7)
4343

4444
#ifdef __cplusplus
4545
}

0 commit comments

Comments
 (0)