Commit 2d736ad4 authored by David Vincze's avatar David Vincze Committed by David Brown
Browse files

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: default avatarDavid Vincze <david.vincze@arm.com>
Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 59bcb378
Loading
Loading
Loading
Loading
+6 −6
Changes for .travis.yml: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ matrix:
    - os: linux
      env: SINGLE_FEATURES="sig-ecdsa enc-kw bootstrap" TEST=sim
    - os: linux
      env: SINGLE_FEATURES="none sig-rsa overwrite-only validate-slot0" TEST=sim
      env: SINGLE_FEATURES="none sig-rsa overwrite-only validate-primary-slot" TEST=sim
    - os: linux
      env: SINGLE_FEATURES="enc-rsa" TEST=sim

@@ -25,19 +25,19 @@ matrix:
    - os: linux
      env: MULTI_FEATURES="sig-rsa overwrite-only,sig-ecdsa overwrite-only" TEST=sim
    - os: linux
      env: MULTI_FEATURES="sig-rsa validate-slot0,sig-ecdsa validate-slot0" TEST=sim
      env: MULTI_FEATURES="sig-rsa validate-primary-slot,sig-ecdsa validate-primary-slot" TEST=sim
    - os: linux
      env: MULTI_FEATURES="enc-kw overwrite-only,enc-rsa overwrite-only" TEST=sim
    - os: linux
      env: MULTI_FEATURES="sig-rsa enc-rsa validate-slot0" TEST=sim
      env: MULTI_FEATURES="sig-rsa enc-rsa validate-primary-slot" TEST=sim
    - os: linux
      env: MULTI_FEATURES="sig-rsa enc-kw validate-slot0 bootstrap" TEST=sim
      env: MULTI_FEATURES="sig-rsa enc-kw validate-primary-slot bootstrap" TEST=sim
    - os: linux
      env: MULTI_FEATURES="sig-ecdsa enc-kw validate-slot0" TEST=sim
      env: MULTI_FEATURES="sig-ecdsa enc-kw validate-primary-slot" TEST=sim

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

    - os: linux
      language: go
+2 −2
Changes for boot/boot_serial/test/src/testcases/boot_serial_img_msg.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -59,9 +59,9 @@ TEST_CASE(boot_serial_img_msg)
    tx_msg(buf, len);

    /*
     * Validate contents inside image 0 slot
     * Validate contents inside the primary slot
     */
    rc = flash_area_open(FLASH_AREA_IMAGE_0, &fap);
    rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &fap);
    assert(rc == 0);

    rc = flash_area_read(fap, 0, enc_img, sizeof(img));
+2 −2
Changes for boot/boot_serial/test/src/testcases/boot_serial_upload_bigger_image.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -103,9 +103,9 @@ TEST_CASE(boot_serial_upload_bigger_image)
    }

    /*
     * Validate contents inside image 0 slot
     * Validate contents inside the primary slot
     */
    rc = flash_area_open(FLASH_AREA_IMAGE_0, &fap);
    rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &fap);
    assert(rc == 0);

    for (off = 0; off < sizeof(img); off += sizeof(enc_img)) {
+9 −3
Changes for boot/bootutil/include/bootutil/bootutil.h: 9 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -26,13 +26,19 @@
extern "C" {
#endif

/** Attempt to boot the contents of slot 0. */
/** Attempt to boot the contents of the primary slot. */
#define BOOT_SWAP_TYPE_NONE     1

/** Swap to slot 1.  Absent a confirm command, revert back on next boot. */
/**
 * Swap to the secondary slot.
 * Absent a confirm command, revert back on next boot.
 */
#define BOOT_SWAP_TYPE_TEST     2

/** Swap to slot 1, and permanently switch to booting its contents. */
/**
 * Swap to the secondary slot,
 * and permanently switch to booting its contents.
 */
#define BOOT_SWAP_TYPE_PERM     3

/** Swap back to alternate slot.  A confirm changes this state to NONE. */
+1 −1
Changes for boot/bootutil/include/bootutil/caps.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ uint32_t bootutil_get_caps(void);
#define BOOTUTIL_CAP_OVERWRITE_UPGRADE      (1<<4)
#define BOOTUTIL_CAP_ENC_RSA                (1<<5)
#define BOOTUTIL_CAP_ENC_KW                 (1<<6)
#define BOOTUTIL_CAP_VALIDATE_SLOT0     (1<<7)
#define BOOTUTIL_CAP_VALIDATE_PRIMARY_SLOT  (1<<7)

#ifdef __cplusplus
}
Loading