diff options
-rw-r--r-- | hw/phb3.c | 12 | ||||
-rw-r--r-- | include/capp.h | 9 |
2 files changed, 19 insertions, 2 deletions
@@ -2608,6 +2608,7 @@ static int64_t capp_load_ucode(struct phb3 *p) struct capp_ucode_lid_hdr *ucode_hdr; struct capp_ucode_data_hdr *data_hdr; + struct capp_lid_hdr *lid_hdr; uint64_t data, *val; int size_read = 0; int tmp; @@ -2623,8 +2624,15 @@ static int64_t capp_load_ucode(struct phb3 *p) } PHBINF(p, "Loading capp microcode @%llx\n", p->capp_ucode_base); - ucode_hdr = (struct capp_ucode_lid_hdr *)(p->capp_ucode_base); - if (ucode_hdr->eyecatcher != 0x43415050554c4944) { + lid_hdr = (struct capp_lid_hdr *)p->capp_ucode_base; + if (lid_hdr->eyecatcher != 0x434150504c494448) + /* lid header not present due to older fw or bml boot */ + ucode_hdr = (struct capp_ucode_lid_hdr *)(p->capp_ucode_base); + else + ucode_hdr = (struct capp_ucode_lid_hdr *)(p->capp_ucode_base + + lid_hdr->ucode_offset); + + if (ucode_hdr->eyecatcher != 0x43415050554C4944) { PHBERR(p, "capi ucode lid header eyecatcher not found\n"); return OPAL_HARDWARE; } diff --git a/include/capp.h b/include/capp.h index ddf280d..417e952 100644 --- a/include/capp.h +++ b/include/capp.h @@ -29,6 +29,15 @@ struct capp_ucode_data_hdr uint32_t num_data_chunks; /* Number of 8-byte chunks of data that follow this header */ }; +struct capp_lid_hdr { + uint64_t eyecatcher; + uint64_t version; + uint64_t lid_no; + uint64_t pad; + uint64_t ucode_offset; + uint64_t total_size; +}; + enum capp_reg { apc_master_cresp = 0x1, apc_master_uop_table = 0x2, |