aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/phb3.c12
-rw-r--r--include/capp.h9
2 files changed, 19 insertions, 2 deletions
diff --git a/hw/phb3.c b/hw/phb3.c
index b5729df..8b0b3f1 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -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,