Rename A and B images to RW and RW_B, part 1

All of our current EC configs have RO and a single RW image.  Calling
that image 'A' is confusing, particularly when combined with EC
software sync (where the RW image is updated from either the A or B AP
RW firmware).  So, rename it.

This changes all the build artifacts and constants.  Internal EC
commands and host commands still refer to A/B; that will be fixed in
part 2.

BUG=none
TEST=build link, snow, bds

Change-Id: Icfed4914745f0799bb71befb6a6563cfd8bc90ab
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27649
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Randall Spangler
2012-07-17 09:35:48 -07:00
committed by Gerrit
parent dae19428a6
commit c44c17890c
12 changed files with 97 additions and 96 deletions

View File

@@ -50,18 +50,18 @@ cmd_sign = vbutil_ec --sign $@ \
cmd_mv = mv $^ $@
cmd_extractab-y = cd $(out) && \
dump_fmap -x $(PROJECT).bin.tmp RW_SECTION_A $(silent) && \
mv RW_SECTION_A $(PROJECT).A.bin
mv RW_SECTION_A $(PROJECT).RW.bin
cmd_extractab-$(CONFIG_RW_B) += && \
dump_fmap -x $(PROJECT).bin.tmp RW_SECTION_B $(silent) && \
mv RW_SECTION_B $(PROJECT).B.bin
cmd_copyab-y = cd $(out) && cp $(PROJECT).A.flat $(PROJECT).A.bin
cmd_copyab-$(CONFIG_RW_B) += && cp $(PROJECT).B.flat $(PROJECT).B.bin
mv RW_SECTION_B $(PROJECT).RW_B.bin
cmd_copyab-y = cd $(out) && cp $(PROJECT).RW.flat $(PROJECT).RW.bin
cmd_copyab-$(CONFIG_RW_B) += && cp $(PROJECT).RW_B.flat $(PROJECT).RW_B.bin
.PHONY: all tests utils
all: $(out)/$(PROJECT).bin utils
dis-y = $(out)/$(PROJECT).RO.dis $(out)/$(PROJECT).A.dis
dis-$(CONFIG_RW_B) += $(out)/$(PROJECT).B.dis
dis-y = $(out)/$(PROJECT).RO.dis $(out)/$(PROJECT).RW.dis
dis-$(CONFIG_RW_B) += $(out)/$(PROJECT).RW_B.dis
dis: $(dis-y)
utils: $(build-utils) $(host-utils)
@@ -96,8 +96,8 @@ $(out)/%.bin.tmp: $(out)/%.obj
$(if $(sign-y),$(call quiet,extractab-y,EXTR_AB), \
$(call quiet,copyab-y,COPY_AB))
flat-y = $(out)/$(PROJECT).RO.flat $(out)/$(PROJECT).A.flat
flat-$(CONFIG_RW_B) += $(out)/$(PROJECT).B.flat
flat-y = $(out)/$(PROJECT).RO.flat $(out)/$(PROJECT).RW.flat
flat-$(CONFIG_RW_B) += $(out)/$(PROJECT).RW_B.flat
$(out)/%.obj: common/firmware_image.S $(out)/firmware_image.lds $(flat-y)
$(call quiet,flat_to_obj,CAT )

View File

@@ -50,13 +50,13 @@
#define CONFIG_SECTION_RO_SIZE (40 * CONFIG_FLASH_BANK_SIZE)
#define CONFIG_SECTION_RO_OFF CONFIG_FLASH_BASE
#define CONFIG_SECTION_A_SIZE (40 * CONFIG_FLASH_BANK_SIZE)
#define CONFIG_SECTION_A_OFF (CONFIG_SECTION_RO_OFF \
#define CONFIG_SECTION_RW_SIZE (40 * CONFIG_FLASH_BANK_SIZE)
#define CONFIG_SECTION_RW_OFF (CONFIG_SECTION_RO_OFF \
+ CONFIG_SECTION_RO_SIZE)
#define CONFIG_SECTION_B_SIZE (40 * CONFIG_FLASH_BANK_SIZE)
#define CONFIG_SECTION_B_OFF (CONFIG_SECTION_A_OFF \
+ CONFIG_SECTION_A_SIZE)
#define CONFIG_SECTION_RW_B_SIZE (40 * CONFIG_FLASH_BANK_SIZE)
#define CONFIG_SECTION_RW_B_OFF (CONFIG_SECTION_RW_OFF \
+ CONFIG_SECTION_RW_SIZE)
/* The top of each section will hold the vboot stuff, since the firmware vector
* table has to go at the start. The root key will fit in 2K, but the vblocks
@@ -71,17 +71,18 @@
#define CONFIG_VBOOT_ROOTKEY_OFF (CONFIG_FW_RO_OFF + CONFIG_FW_RO_SIZE)
/* A: firmware, vblock */
#define CONFIG_FW_A_OFF CONFIG_SECTION_A_OFF
#define CONFIG_FW_A_SIZE (CONFIG_SECTION_A_SIZE \
#define CONFIG_FW_RW_OFF CONFIG_SECTION_RW_OFF
#define CONFIG_FW_RW_SIZE (CONFIG_SECTION_RW_SIZE \
- CONFIG_VBLOCK_SIZE)
#define CONFIG_VBLOCK_A_OFF (CONFIG_FW_A_OFF + CONFIG_FW_A_SIZE)
#define CONFIG_VBLOCK_RW_OFF (CONFIG_FW_RW_OFF + CONFIG_FW_RW_SIZE)
/* B: firmware, vblock */
#define CONFIG_FW_B_SIZE (CONFIG_SECTION_B_SIZE \
#define CONFIG_FW_RW_B_SIZE (CONFIG_SECTION_RW_B_SIZE \
- CONFIG_VBLOCK_SIZE)
#define CONFIG_FW_B_OFF (CONFIG_SECTION_A_OFF \
+ CONFIG_SECTION_A_SIZE)
#define CONFIG_VBLOCK_B_OFF (CONFIG_FW_B_OFF + CONFIG_FW_B_SIZE)
#define CONFIG_FW_RW_B_OFF (CONFIG_SECTION_RW_OFF \
+ CONFIG_SECTION_RW_SIZE)
#define CONFIG_VBLOCK_RW_B_OFF (CONFIG_FW_RW_B_OFF \
+ CONFIG_FW_RW_B_SIZE)
/****************************************************************************/

View File

@@ -23,12 +23,12 @@ proc flash_link_ro { } {
flash_lm4 ../../../build/link/ec.RO.flat 0 81920
}
proc flash_link_a { } {
flash_lm4 ../../../build/link/ec.A.bin 81920 81920
proc flash_link_rw { } {
flash_lm4 ../../../build/link/ec.RW.bin 81920 81920
}
proc flash_link_b { } {
flash_lm4 ../../../build/link/ec.B.bin 163840 81920
proc flash_link_rw_b { } {
flash_lm4 ../../../build/link/ec.RW_B.bin 163840 81920
}
proc flash_bds { } {

View File

@@ -15,26 +15,26 @@
#define CONFIG_FW_RO_OFF 0
#define CONFIG_FW_RO_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_A_OFF CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_A_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_B_OFF (2 * CONFIG_FW_IMAGE_SIZE)
#define CONFIG_FW_B_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_RW_OFF CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_RW_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_RW_B_OFF (2 * CONFIG_FW_IMAGE_SIZE)
#define CONFIG_FW_RW_B_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_SECTION_RO_OFF CONFIG_FW_RO_OFF
#define CONFIG_SECTION_RO_SIZE CONFIG_FW_RO_SIZE
#define CONFIG_SECTION_A_OFF CONFIG_FW_A_OFF
#define CONFIG_SECTION_A_SIZE CONFIG_FW_A_SIZE
#define CONFIG_SECTION_B_OFF CONFIG_FW_B_OFF
#define CONFIG_SECTION_RW_OFF CONFIG_FW_RW_OFF
#define CONFIG_SECTION_RW_SIZE CONFIG_FW_RW_SIZE
#define CONFIG_SECTION_RW_B_OFF CONFIG_FW_RW_B_OFF
#ifdef CONFIG_RW_B
#define CONFIG_SECTION_B_SIZE CONFIG_FW_B_SIZE
#define CONFIG_SECTION_RW_B_SIZE CONFIG_FW_RW_B_SIZE
#else /* CONFIG_RW_B */
#define CONFIG_SECTION_B_SIZE 0
#define CONFIG_SECTION_RW_B_SIZE 0
#endif /* CONFIG_RW_B */
/* no keys for now */
#define CONFIG_VBOOT_ROOTKEY_OFF (CONFIG_FW_RO_OFF + CONFIG_FW_RO_SIZE)
#define CONFIG_VBLOCK_A_OFF (CONFIG_FW_A_OFF + CONFIG_FW_A_SIZE)
#define CONFIG_VBLOCK_B_OFF (CONFIG_FW_B_OFF + CONFIG_FW_B_SIZE)
#define CONFIG_VBLOCK_RW_OFF (CONFIG_FW_RW_OFF + CONFIG_FW_RW_SIZE)
#define CONFIG_VBLOCK_RW_B_OFF (CONFIG_FW_RW_B_OFF + CONFIG_FW_RW_B_SIZE)
#define CONFIG_VBOOT_ROOTKEY_SIZE 0
#define CONFIG_VBLOCK_SIZE 0

View File

@@ -13,24 +13,24 @@
/* Size of one firmware image in flash */
#define CONFIG_FW_IMAGE_SIZE (64 * 1024)
#define CONFIG_FW_RO_OFF 0
#define CONFIG_FW_RO_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_A_OFF CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_A_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_B_OFF (2 * CONFIG_FW_IMAGE_SIZE)
#define CONFIG_FW_B_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_RO_OFF 0
#define CONFIG_FW_RO_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_RW_OFF CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_RW_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_FW_RW_B_OFF (2 * CONFIG_FW_IMAGE_SIZE)
#define CONFIG_FW_RW_B_SIZE CONFIG_FW_IMAGE_SIZE
#define CONFIG_SECTION_RO_OFF CONFIG_FW_RO_OFF
#define CONFIG_SECTION_RO_SIZE CONFIG_FW_RO_SIZE
#define CONFIG_SECTION_A_OFF CONFIG_FW_A_OFF
#define CONFIG_SECTION_A_SIZE CONFIG_FW_A_SIZE
#define CONFIG_SECTION_B_OFF CONFIG_FW_B_OFF
#define CONFIG_SECTION_B_SIZE CONFIG_FW_B_SIZE
#define CONFIG_SECTION_RO_OFF CONFIG_FW_RO_OFF
#define CONFIG_SECTION_RO_SIZE CONFIG_FW_RO_SIZE
#define CONFIG_SECTION_RW_OFF CONFIG_FW_RW_OFF
#define CONFIG_SECTION_RW_SIZE CONFIG_FW_RW_SIZE
#define CONFIG_SECTION_RW_B_OFF CONFIG_FW_RW_B_OFF
#define CONFIG_SECTION_RW_B_SIZE CONFIG_FW_RW_B_SIZE
/* no keys for now */
#define CONFIG_VBOOT_ROOTKEY_OFF (CONFIG_FW_RO_OFF + CONFIG_FW_RO_SIZE)
#define CONFIG_VBLOCK_A_OFF (CONFIG_FW_A_OFF + CONFIG_FW_A_SIZE)
#define CONFIG_VBLOCK_B_OFF (CONFIG_FW_B_OFF + CONFIG_FW_B_SIZE)
#define CONFIG_VBLOCK_RW_OFF (CONFIG_FW_RW_OFF + CONFIG_FW_RW_SIZE)
#define CONFIG_VBLOCK_RW_B_OFF (CONFIG_FW_RW_B_OFF + CONFIG_FW_RW_B_SIZE)
#define CONFIG_VBOOT_ROOTKEY_SIZE 0
#define CONFIG_VBLOCK_SIZE 0

View File

@@ -18,11 +18,11 @@
.incbin FW_IMAGE(RO)
/* Read Write firmware copy A */
.section .image.A, "ax"
.incbin FW_IMAGE(A)
.section .image.RW, "ax"
.incbin FW_IMAGE(RW)
#ifdef CONFIG_RW_B
/* Read Write firmware copy B */
.section .image.B, "ax"
.incbin FW_IMAGE(B)
.section .image.RW_B, "ax"
.incbin FW_IMAGE(RW_B)
#endif

View File

@@ -19,14 +19,14 @@ SECTIONS
*(.image.RO)
} > FLASH =0xff
. = ALIGN(CONFIG_FLASH_BANK_SIZE);
.image.A : AT(CONFIG_FLASH_BASE + CONFIG_SECTION_A_OFF) {
*(.image.A)
.image.RW : AT(CONFIG_FLASH_BASE + CONFIG_SECTION_RW_OFF) {
*(.image.RW)
BYTE(0xEA) /* Mark end explicitly */
} > FLASH =0xff
#ifdef CONFIG_RW_B
. = ALIGN(CONFIG_FLASH_BANK_SIZE);
.image.B : AT(CONFIG_FLASH_BASE + CONFIG_SECTION_B_OFF) {
*(.image.B)
.image.RW_B : AT(CONFIG_FLASH_BASE + CONFIG_SECTION_RW_B_OFF) {
*(.image.RW_B)
BYTE(0xEB) /* Mark end explicitly */
} > FLASH =0xff
#endif

View File

@@ -110,9 +110,9 @@ const struct _ec_fmap {
{
/* The range for autoupdate to update A/B at once. */
.area_name = "EC_RW",
.area_offset = CONFIG_SECTION_A_OFF,
.area_size = CONFIG_SECTION_A_SIZE
+ CONFIG_SECTION_B_SIZE,
.area_offset = CONFIG_SECTION_RW_OFF,
.area_size = CONFIG_SECTION_RW_SIZE
+ CONFIG_SECTION_RW_B_SIZE,
.area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO,
},
{
@@ -127,19 +127,19 @@ const struct _ec_fmap {
/* Firmware A */
{
.area_name = "RW_SECTION_A",
.area_offset = CONFIG_SECTION_A_OFF,
.area_size = CONFIG_SECTION_A_SIZE,
.area_offset = CONFIG_SECTION_RW_OFF,
.area_size = CONFIG_SECTION_RW_SIZE,
.area_flags = FMAP_AREA_STATIC,
},
{
.area_name = "FW_MAIN_A",
.area_offset = CONFIG_FW_A_OFF,
.area_size = CONFIG_FW_A_SIZE,
.area_offset = CONFIG_FW_RW_OFF,
.area_size = CONFIG_FW_RW_SIZE,
.area_flags = FMAP_AREA_STATIC,
},
{
.area_name = "RW_FWID_A", /* FIXME: Where is it? */
.area_offset = CONFIG_FW_A_OFF +
.area_offset = CONFIG_FW_RW_OFF +
(uint32_t)__version_struct_offset +
offsetof(struct version_struct, version),
.area_size = sizeof(version_data.version),
@@ -147,7 +147,7 @@ const struct _ec_fmap {
},
{
.area_name = "VBLOCK_A",
.area_offset = CONFIG_VBLOCK_A_OFF,
.area_offset = CONFIG_VBLOCK_RW_OFF,
.area_size = CONFIG_VBLOCK_SIZE,
.area_flags = FMAP_AREA_STATIC,
},
@@ -156,19 +156,19 @@ const struct _ec_fmap {
/* Firmware B */
{
.area_name = "RW_SECTION_B",
.area_offset = CONFIG_SECTION_B_OFF,
.area_size = CONFIG_SECTION_B_SIZE,
.area_offset = CONFIG_SECTION_RW_B_OFF,
.area_size = CONFIG_SECTION_RW_B_SIZE,
.area_flags = FMAP_AREA_STATIC,
},
{
.area_name = "FW_MAIN_B",
.area_offset = CONFIG_FW_B_OFF,
.area_size = CONFIG_FW_B_SIZE,
.area_offset = CONFIG_FW_RW_B_OFF,
.area_size = CONFIG_FW_RW_B_SIZE,
.area_flags = FMAP_AREA_STATIC,
},
{
.area_name = "RW_FWID_B", /* FIXME: Where is it? */
.area_offset = CONFIG_FW_B_OFF +
.area_offset = CONFIG_FW_RW_B_OFF +
(uint32_t)__version_struct_offset +
offsetof(struct version_struct, version),
.area_size = sizeof(version_data.version),
@@ -176,7 +176,7 @@ const struct _ec_fmap {
},
{
.area_name = "VBLOCK_B",
.area_offset = CONFIG_VBLOCK_B_OFF,
.area_offset = CONFIG_VBLOCK_RW_B_OFF,
.area_size = CONFIG_VBLOCK_SIZE,
.area_flags = FMAP_AREA_STATIC,
},

View File

@@ -221,12 +221,12 @@ enum system_image_copy_t system_get_image_copy(void)
my_addr < (CONFIG_SECTION_RO_OFF + CONFIG_SECTION_RO_SIZE))
return SYSTEM_IMAGE_RO;
if (my_addr >= CONFIG_SECTION_A_OFF &&
my_addr < (CONFIG_SECTION_A_OFF + CONFIG_SECTION_A_SIZE))
if (my_addr >= CONFIG_SECTION_RW_OFF &&
my_addr < (CONFIG_SECTION_RW_OFF + CONFIG_SECTION_RW_SIZE))
return SYSTEM_IMAGE_RW_A;
if (my_addr >= CONFIG_SECTION_B_OFF &&
my_addr < (CONFIG_SECTION_B_OFF + CONFIG_SECTION_B_SIZE))
if (my_addr >= CONFIG_SECTION_RW_B_OFF &&
my_addr < (CONFIG_SECTION_RW_B_OFF + CONFIG_SECTION_RW_B_SIZE))
return SYSTEM_IMAGE_RW_B;
return SYSTEM_IMAGE_UNKNOWN;
@@ -247,12 +247,12 @@ int system_unsafe_to_overwrite(uint32_t offset, uint32_t size) {
r_size = CONFIG_FW_RO_SIZE;
break;
case SYSTEM_IMAGE_RW_A:
r_offset = CONFIG_FW_A_OFF;
r_size = CONFIG_FW_A_SIZE;
r_offset = CONFIG_FW_RW_OFF;
r_size = CONFIG_FW_RW_SIZE;
break;
case SYSTEM_IMAGE_RW_B:
r_offset = CONFIG_FW_B_OFF;
r_size = CONFIG_FW_B_SIZE;
r_offset = CONFIG_FW_RW_B_OFF;
r_size = CONFIG_FW_RW_B_SIZE;
break;
default:
return 0;
@@ -318,10 +318,10 @@ static uint32_t get_base(enum system_image_copy_t copy)
case SYSTEM_IMAGE_RO:
return CONFIG_FLASH_BASE + CONFIG_FW_RO_OFF;
case SYSTEM_IMAGE_RW_A:
return CONFIG_FLASH_BASE + CONFIG_FW_A_OFF;
return CONFIG_FLASH_BASE + CONFIG_FW_RW_OFF;
#ifdef CONFIG_RW_B
case SYSTEM_IMAGE_RW_B:
return CONFIG_FLASH_BASE + CONFIG_FW_B_OFF;
return CONFIG_FLASH_BASE + CONFIG_FW_RW_B_OFF;
#endif
default:
return 0xffffffff;
@@ -335,10 +335,10 @@ static uint32_t get_size(enum system_image_copy_t copy)
case SYSTEM_IMAGE_RO:
return CONFIG_FW_RO_SIZE;
case SYSTEM_IMAGE_RW_A:
return CONFIG_FW_A_SIZE;
return CONFIG_FW_RW_SIZE;
#ifdef CONFIG_RW_B
case SYSTEM_IMAGE_RW_B:
return CONFIG_FW_B_SIZE;
return CONFIG_FW_RW_B_SIZE;
#endif
default:
return 0;

View File

@@ -113,8 +113,8 @@ static void vboot_hash_init(void)
data_size = tag->size;
} else {
/* Start computing the hash of firmware A */
vboot_hash_start(CONFIG_FW_A_OFF - CONFIG_FLASH_BASE,
CONFIG_FW_A_SIZE, NULL, 0);
vboot_hash_start(CONFIG_FW_RW_OFF - CONFIG_FLASH_BASE,
CONFIG_FW_RW_SIZE, NULL, 0);
}
}
@@ -187,8 +187,8 @@ DECLARE_HOOK(HOOK_SYSJUMP, vboot_hash_preserve_state, HOOK_PRIO_DEFAULT);
static int command_hash(int argc, char **argv)
{
uint32_t offset = CONFIG_FW_A_OFF - CONFIG_FLASH_BASE;
uint32_t size = CONFIG_FW_A_SIZE;
uint32_t offset = CONFIG_FW_RW_OFF - CONFIG_FLASH_BASE;
uint32_t size = CONFIG_FW_RW_SIZE;
char *e;
if (argc == 2 && !strcasecmp(argv[1], "abort")) {

View File

@@ -134,8 +134,8 @@ int vboot_check_signature(void)
ts1 = get_time();
r = good_image((uint8_t *)CONFIG_VBOOT_ROOTKEY_OFF,
(uint8_t *)CONFIG_VBLOCK_A_OFF, CONFIG_VBLOCK_SIZE,
(uint8_t *)CONFIG_FW_A_OFF, CONFIG_FW_A_SIZE);
(uint8_t *)CONFIG_VBLOCK_RW_OFF, CONFIG_VBLOCK_SIZE,
(uint8_t *)CONFIG_FW_RW_OFF, CONFIG_FW_RW_SIZE);
ts2 = get_time();
CPRINTF("[%T Vboot result=%d, elapsed time=%ld us]\n",
@@ -160,8 +160,8 @@ int vboot_check_signature(void)
ts1 = get_time();
r = good_image((uint8_t *)CONFIG_VBOOT_ROOTKEY_OFF,
(uint8_t *)CONFIG_VBLOCK_B_OFF, CONFIG_VBLOCK_SIZE,
(uint8_t *)CONFIG_FW_B_OFF, CONFIG_FW_B_SIZE);
(uint8_t *)CONFIG_VBLOCK_RW_B_OFF, CONFIG_VBLOCK_SIZE,
(uint8_t *)CONFIG_FW_RW_B_OFF, CONFIG_FW_RW_B_SIZE);
ts2 = get_time();
CPRINTF("[%T Vboot result=%d, elapsed time=%ld us]\n",

View File

@@ -141,11 +141,11 @@ int main(int argc, char *argv[])
return -3;
#ifdef CONFIG_RW_B
flash_partition(EC_IMAGE_RW_B, data + CONFIG_FW_B_OFF,
CONFIG_FW_B_OFF, CONFIG_FW_B_SIZE);
flash_partition(EC_IMAGE_RW_B, data + CONFIG_FW_RW_B_OFF,
CONFIG_FW_RW_B_OFF, CONFIG_FW_RW_B_SIZE);
#endif /* CONFIG_RW_B */
flash_partition(EC_IMAGE_RW_A, data + CONFIG_FW_A_OFF,
CONFIG_FW_A_OFF, CONFIG_FW_A_SIZE);
flash_partition(EC_IMAGE_RW_A, data + CONFIG_FW_RW_OFF,
CONFIG_FW_RW_OFF, CONFIG_FW_RW_SIZE);
flash_partition(EC_IMAGE_RO, data + CONFIG_FW_RO_OFF,
CONFIG_FW_RO_OFF, CONFIG_FW_RO_SIZE);