diff options
author | Sridhar Siricilla <sridhar.siricilla@intel.com> | 2019-09-23 19:38:21 +0530 |
---|---|---|
committer | Subrata Banik <subrata.banik@intel.com> | 2019-09-25 06:26:14 +0000 |
commit | f35eee94bd810c9403b9fe65a8341a2eb8c8a722 (patch) | |
tree | b839c03cbf3140dba0111d699758d4386e12acfc /src/soc/intel/apollolake | |
parent | e39becf5216419fa0a08c1d8632474fd8a9a5738 (diff) | |
download | coreboot-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/intel/apollolake')
-rw-r--r-- | src/soc/intel/apollolake/cse.c | 33 |
1 files changed, 9 insertions, 24 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; } |