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>
This commit is contained in:
Sridhar Siricilla 2019-09-23 19:38:21 +05:30 committed by Subrata Banik
parent e39becf521
commit f35eee94bd
5 changed files with 18 additions and 48 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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);
/*

View File

@ -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;