summaryrefslogtreecommitdiff
path: root/util/cbfstool/bpdt_formats
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2021-10-09 23:06:09 -0700
committerFurquan Shaikh <furquan@google.com>2021-10-19 16:10:12 +0000
commit8b4ca15d7ef1b1397e8f21bd78e411397f43b9e5 (patch)
treece1724ff702463b5df25733afd243291d06689dc /util/cbfstool/bpdt_formats
parent5d8f4badda7b8cb0a26312454efef3beabc2f8f0 (diff)
util/cse_serger: Replace cse_layout_regions with array of regions
This change replaces `struct cse_layout_regions` with an array of `struct region` and introduces enums for DP and BP[1-4]. This makes it easier to loop over the different regions in following changes. BUG=b:189177186 Change-Id: If3cced4506d26dc534047cb9c385aaa9418d8522 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58214 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'util/cbfstool/bpdt_formats')
-rw-r--r--util/cbfstool/bpdt_formats/bpdt_1_6.c18
-rw-r--r--util/cbfstool/bpdt_formats/bpdt_1_7.c22
2 files changed, 20 insertions, 20 deletions
diff --git a/util/cbfstool/bpdt_formats/bpdt_1_6.c b/util/cbfstool/bpdt_formats/bpdt_1_6.c
index eaa2902670..b894936543 100644
--- a/util/cbfstool/bpdt_formats/bpdt_1_6.c
+++ b/util/cbfstool/bpdt_formats/bpdt_1_6.c
@@ -142,21 +142,21 @@ static void inc_bpdt_entry_count(bpdt_hdr_ptr ptr)
h->descriptor_count++;
}
-static cse_layout_ptr create_cse_layout(const struct cse_layout_regions *r)
+static cse_layout_ptr create_cse_layout(const struct region *r)
{
struct cse_layout *l = malloc(sizeof(*l));
if (!l)
return NULL;
- l->data_offset = r->data_partition.offset;
- l->data_size = r->data_partition.size;
- l->bp1_offset = r->bp1.offset;
- l->bp1_size = r->bp1.size;
- l->bp2_offset = r->bp2.offset;
- l->bp2_size = r->bp2.size;
- l->bp3_offset = r->bp3.offset;
- l->bp3_size = r->bp3.size;
+ l->data_offset = r[DP].offset;
+ l->data_size = r[DP].size;
+ l->bp1_offset = r[BP1].offset;
+ l->bp1_size = r[BP1].size;
+ l->bp2_offset = r[BP2].offset;
+ l->bp2_size = r[BP2].size;
+ l->bp3_offset = r[BP3].offset;
+ l->bp3_size = r[BP3].size;
l->checksum = 0; /* unused */
return 0;
diff --git a/util/cbfstool/bpdt_formats/bpdt_1_7.c b/util/cbfstool/bpdt_formats/bpdt_1_7.c
index 53294242ca..9badc82c11 100644
--- a/util/cbfstool/bpdt_formats/bpdt_1_7.c
+++ b/util/cbfstool/bpdt_formats/bpdt_1_7.c
@@ -185,7 +185,7 @@ static uint32_t calculate_layout_checksum(struct cse_layout *l)
return calc_checksum;
}
-static cse_layout_ptr create_cse_layout(const struct cse_layout_regions *r)
+static cse_layout_ptr create_cse_layout(const struct region *r)
{
struct cse_layout *l = calloc(1, sizeof(*l));
@@ -196,16 +196,16 @@ static cse_layout_ptr create_cse_layout(const struct cse_layout_regions *r)
l->size = sizeof(struct cse_layout) - sizeof(l->rom_bypass);
l->redundancy = 0;
l->checksum = 0;
- l->data_offset = r->data_partition.offset;
- l->data_size = r->data_partition.size;
- l->bp1_offset = r->bp1.offset;
- l->bp1_size = r->bp1.size;
- l->bp2_offset = r->bp2.offset;
- l->bp2_size = r->bp2.size;
- l->bp3_offset = r->bp3.offset;
- l->bp3_size = r->bp3.size;
- l->bp4_offset = r->bp4.offset;
- l->bp4_size = r->bp4.size;
+ l->data_offset = r[DP].offset;
+ l->data_size = r[DP].size;
+ l->bp1_offset = r[BP1].offset;
+ l->bp1_size = r[BP1].size;
+ l->bp2_offset = r[BP2].offset;
+ l->bp2_size = r[BP2].size;
+ l->bp3_offset = r[BP3].offset;
+ l->bp3_size = r[BP3].size;
+ l->bp4_offset = r[BP4].offset;
+ l->bp4_size = r[BP4].size;
l->bp5_offset = 0;
l->bp5_size = 0;
l->temp_base_addr = 0;