summaryrefslogtreecommitdiff
path: root/util/ifdtool/ifdtool.h
diff options
context:
space:
mode:
authorMaximilian Brune <maximilian.brune@9elements.com>2023-03-05 04:34:40 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-03-09 19:36:32 +0000
commitab0e680c8e027ef76b47a87d4d9e13068b50c630 (patch)
tree725c0c367e58d9ffd0815380f0f61b9b46cc58de /util/ifdtool/ifdtool.h
parentd4712010107eab9e6ae897a7912d4407f299eecc (diff)
util/ifdtool/ifdtool.c: Clean up
- Remove functions that are only called in one place. - Add warning if user doesn't supply a platform, since that can lead to dumps/layouts that do not include all IFD regions without the user even reliazing it. - Inform the User if IFD or Flashmap is not found. - Inform the User if there is not a single match between FMAP and IFD region - Avoid printing usage if not specifically asked by the user. It tends to obfuscate the original error message. - Keep indentation consistent throughout the file. - Remove typedefs (coreboot coding style) Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I7bbce63ecb2e920530394766f58b5ea6f72852e9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73448 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Diffstat (limited to 'util/ifdtool/ifdtool.h')
-rw-r--r--util/ifdtool/ifdtool.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h
index 3ad8570981..6029c66d5b 100644
--- a/util/ifdtool/ifdtool.h
+++ b/util/ifdtool/ifdtool.h
@@ -107,13 +107,13 @@ enum component_density {
};
// flash descriptor
-typedef struct {
+struct __packed fdbar {
uint32_t flvalsig;
uint32_t flmap0;
uint32_t flmap1;
uint32_t flmap2;
uint32_t flmap3; // Exist for 500 series onwards
-} __attribute__((packed)) fdbar_t;
+};
// regions
#define MAX_REGIONS 16
@@ -135,23 +135,23 @@ enum flash_regions {
REGION_PTT = 15,
};
-typedef struct {
+struct __packed frba {
uint32_t flreg[MAX_REGIONS];
-} __attribute__((packed)) frba_t;
+};
// component section
-typedef struct {
+struct __packed fcba {
uint32_t flcomp;
uint32_t flill;
uint32_t flpb;
-} __attribute__((packed)) fcba_t;
+};
// pch strap
#define MAX_PCHSTRP 1024
-typedef struct {
+struct __packed fpsba {
uint32_t pchstrp[MAX_PCHSTRP];
-} __attribute__((packed)) fpsba_t;
+};
/*
* WR / RD bits start at different locations within the flmstr regs, but
@@ -163,36 +163,36 @@ typedef struct {
#define FLMSTR_RD_SHIFT_V2 8
// master
-typedef struct {
+struct __packed fmba {
uint32_t flmstr1;
uint32_t flmstr2;
uint32_t flmstr3;
uint32_t flmstr4;
uint32_t flmstr5;
uint32_t flmstr6;
-} __attribute__((packed)) fmba_t;
+};
// processor strap
-typedef struct {
+struct __packed fmsba {
uint32_t data[8];
-} __attribute__((packed)) fmsba_t;
+};
// ME VSCC
-typedef struct {
+struct vscc {
uint32_t jid;
uint32_t vscc;
-} vscc_t;
+};
-typedef struct {
+struct vtba {
// Actual number of entries specified in vtl
/* FIXME: Rationale for the limit of 8.
* AFAICT it's 127, cf. flashrom's ich_descriptors_tool). */
- vscc_t entry[8];
-} vtba_t;
+ struct vscc entry[8];
+};
-typedef struct {
+struct region {
int base, limit, size;
-} region_t;
+};
struct region_name {
const char *pretty;