Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35545 )
Change subject: soc/intel/(apl,skl,cnl,common): Move mkhi_hdr structure definition to common ......................................................................
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 --- M src/soc/intel/apollolake/cse.c M src/soc/intel/cannonlake/me.c M src/soc/intel/common/block/cse/cse.c M src/soc/intel/common/block/include/intelblocks/cse.h M src/soc/intel/skylake/me.c 5 files changed, 18 insertions(+), 48 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Subrata Banik: Looks good to me, approved
diff --git a/src/soc/intel/apollolake/cse.c b/src/soc/intel/apollolake/cse.c index 260c6c6..6ee1a15 100644 --- a/src/soc/intel/apollolake/cse.c +++ b/src/soc/intel/apollolake/cse.c @@ -52,17 +52,6 @@
#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 @@ 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 @@ } __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 @@ 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 @@ { 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 @@ } __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 @@ 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 @@ 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 d6dfec9..776ff8b 100644 --- a/src/soc/intel/cannonlake/me.c +++ b/src/soc/intel/cannonlake/me.c @@ -128,14 +128,6 @@ */ 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 debbf1f..0bd5c72 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -90,14 +90,6 @@ 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 378f417..b4bfe68 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 @@ } __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 dcde348..5a378a2 100644 --- a/src/soc/intel/skylake/me.c +++ b/src/soc/intel/skylake/me.c @@ -200,14 +200,6 @@
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;