aboutsummaryrefslogtreecommitdiff
path: root/hw/phb3.c
diff options
context:
space:
mode:
authorRyan Grimm <grimm@linux.vnet.ibm.com>2014-07-07 22:13:48 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-08 14:59:54 +1000
commit7a790f211b2e79dcb49b650128d50f2f39c4edde (patch)
tree7f98197107dc347aa08654081d6c538610a700b9 /hw/phb3.c
parentbe95322f21a46fe39057e7c04a6a714d62f16181 (diff)
downloadskiboot-7a790f211b2e79dcb49b650128d50f2f39c4edde.zip
skiboot-7a790f211b2e79dcb49b650128d50f2f39c4edde.tar.gz
skiboot-7a790f211b2e79dcb49b650128d50f2f39c4edde.tar.bz2
phb3: Parse capp microcode lid if lid header in memory.
bml load and older firmware loads do not place the lid header in memory. Newer firmware versions do. Look for lid header eyecatcher and if not found try ucode eyecatcher to support bml and older firmware. Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/phb3.c')
-rw-r--r--hw/phb3.c12
1 files changed, 10 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;
}