summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorSridhar Siricilla <sridhar.siricilla@intel.com>2019-09-23 19:38:21 +0530
committerSubrata Banik <subrata.banik@intel.com>2019-09-25 06:26:14 +0000
commitf35eee94bd810c9403b9fe65a8341a2eb8c8a722 (patch)
treeb839c03cbf3140dba0111d699758d4386e12acfc /src/soc
parente39becf5216419fa0a08c1d8632474fd8a9a5738 (diff)
downloadcoreboot-f35eee94bd810c9403b9fe65a8341a2eb8c8a722.tar.xz
soc/intel/(apl,skl,cnl,common): Move mkhi_hdr structure definition to common
Removed mkhi_hdr structure definition from multiple SOCs, and moved to common. TEST=Built code for Hatch, apollolake boards. Change-Id: Ifeba0ed4d98975049179d1b47fb22c06a927dc29 Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35545 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Subrata Banik <subrata.banik@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/apollolake/cse.c33
-rw-r--r--src/soc/intel/cannonlake/me.c8
-rw-r--r--src/soc/intel/common/block/cse/cse.c8
-rw-r--r--src/soc/intel/common/block/include/intelblocks/cse.h9
-rw-r--r--src/soc/intel/skylake/me.c8
5 files changed, 18 insertions, 48 deletions
diff --git a/src/soc/intel/apollolake/cse.c b/src/soc/intel/apollolake/cse.c
index 260c6c6dc6..6ee1a155ea 100644
--- a/src/soc/intel/apollolake/cse.c
+++ b/src/soc/intel/apollolake/cse.c
@@ -52,17 +52,6 @@ static enum fuse_flash_state {
#define FPF_STATUS_FMAP "FPF_STATUS"
-union mkhi_header {
- uint32_t data;
- struct {
- uint32_t group_id: 8;
- uint32_t command: 7;
- uint32_t is_response: 1;
- uint32_t reserved: 8;
- uint32_t result: 8;
- } __packed fields;
-};
-
/*
* Read file from CSE internal filesystem.
* size is maximum length of provided buffer buff, which is updated with actual
@@ -76,7 +65,7 @@ static int read_cse_file(const char *path, void *buff, size_t *size,
size_t reply_size;
struct mca_command {
- union mkhi_header mkhi_hdr;
+ struct mkhi_hdr hdr;
char file_name[MCA_MAX_FILE_PATH_SIZE];
uint32_t offset;
uint32_t data_size;
@@ -84,7 +73,7 @@ static int read_cse_file(const char *path, void *buff, size_t *size,
} __packed msg;
struct mca_response {
- union mkhi_header mkhi_hdr;
+ struct mkhi_hdr hdr;
uint32_t data_size;
uint8_t buffer[128];
} __packed rmsg;
@@ -99,8 +88,8 @@ static int read_cse_file(const char *path, void *buff, size_t *size,
return 0;
}
strncpy(msg.file_name, path, sizeof(msg.file_name));
- msg.mkhi_hdr.fields.group_id = MKHI_GROUP_ID_MCA;
- msg.mkhi_hdr.fields.command = READ_FILE;
+ msg.hdr.group_id = MKHI_GROUP_ID_MCA;
+ msg.hdr.command = READ_FILE;
msg.flags = flags;
msg.data_size = *size;
msg.offset = offset;
@@ -195,11 +184,7 @@ static void dump_cse_version(void *unused)
{
int res;
size_t reply_size;
-
- struct fw_version_cmd {
- union mkhi_header mkhi_hdr;
- } __packed msg;
-
+ struct mkhi_hdr msg;
struct version {
uint16_t minor;
uint16_t major;
@@ -208,7 +193,7 @@ static void dump_cse_version(void *unused)
} __packed;
struct fw_version_response {
- union mkhi_header mkhi_hdr;
+ struct mkhi_hdr hdr;
struct version code;
struct version nftp;
struct version fitc;
@@ -221,8 +206,8 @@ static void dump_cse_version(void *unused)
if (!CONFIG(CONSOLE_SERIAL))
return;
- msg.mkhi_hdr.fields.group_id = MKHI_GROUP_ID_GEN;
- msg.mkhi_hdr.fields.command = GET_FW_VERSION;
+ msg.group_id = MKHI_GROUP_ID_GEN;
+ msg.command = GET_FW_VERSION;
res = heci_send(&msg, sizeof(msg), BIOS_HOST_ADDR, HECI_MKHI_ADDR);
@@ -239,7 +224,7 @@ static void dump_cse_version(void *unused)
return;
}
- if (rsp.mkhi_hdr.fields.result != 0) {
+ if (rsp.hdr.result != 0) {
printk(BIOS_ERR, "Failed to get ME version.\n");
return;
}
diff --git a/src/soc/intel/cannonlake/me.c b/src/soc/intel/cannonlake/me.c
index d6dfec9dca..776ff8bae0 100644
--- a/src/soc/intel/cannonlake/me.c
+++ b/src/soc/intel/cannonlake/me.c
@@ -128,14 +128,6 @@ union hfsts6 {
*/
static void print_me_version(void *unused)
{
- struct mkhi_hdr {
- uint8_t group_id;
- uint8_t command :7;
- uint8_t is_resp :1;
- uint8_t rsvd;
- uint8_t result;
- } __packed;
-
struct version {
uint16_t minor;
uint16_t major;
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c
index debbf1fbf4..0bd5c72ef5 100644
--- a/src/soc/intel/common/block/cse/cse.c
+++ b/src/soc/intel/common/block/cse/cse.c
@@ -90,14 +90,6 @@ static struct cse_device {
uintptr_t sec_bar;
} g_cse;
-/* HECI Message Header */
-struct mkhi_hdr {
- uint8_t group_id;
- uint8_t command:7;
- uint8_t is_resp:1;
- uint8_t rsvd;
- uint8_t result;
-} __packed;
/*
* Initialize the device with provided temporary BAR. If BAR is 0 use a
* default. This is intended for pre-mem usage only where BARs haven't been
diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h
index 378f41713c..b4bfe68924 100644
--- a/src/soc/intel/common/block/include/intelblocks/cse.h
+++ b/src/soc/intel/common/block/include/intelblocks/cse.h
@@ -53,6 +53,15 @@ union me_hfsts1 {
} __packed fields;
};
+/* HECI Message Header */
+struct mkhi_hdr {
+ uint8_t group_id;
+ uint8_t command:7;
+ uint8_t is_resp:1;
+ uint8_t rsvd;
+ uint8_t result;
+} __packed;
+
/* set up device for use in early boot enviroument with temp bar */
void heci_init(uintptr_t bar);
/*
diff --git a/src/soc/intel/skylake/me.c b/src/soc/intel/skylake/me.c
index dcde348a25..5a378a2954 100644
--- a/src/soc/intel/skylake/me.c
+++ b/src/soc/intel/skylake/me.c
@@ -200,14 +200,6 @@ static const char *const me_progress_bup_values[] = {
static void print_me_version(void *unused)
{
- struct mkhi_hdr {
- uint8_t group_id;
- uint8_t command:7;
- uint8_t is_resp:1;
- uint8_t rsvd;
- uint8_t result;
- } __packed;
-
struct version {
uint16_t minor;
uint16_t major;