summaryrefslogtreecommitdiffstats
path: root/pnor_partition_defs.h
Commit message (Collapse)AuthorAgeFilesLines
* misc: Replace license blurb with kernel-style SPDX markersAndrew Jeffery2018-03-241-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was roughly achieved by the following shell script: $ git ls-files | grep '\.[ch]p*$' | while read F; do EXT=${F##*.}; cat spdx.$EXT <(sed '/^\/\*$/,/^ \*\/$/d' $F) > ${F}.tmp; mv ${F}.tmp $F; done With the following context: $ cat spdx.c // SPDX-License-Identifier: Apache-2.0 // Copyright (C) 2018 IBM Corp. $ cat spdx.h /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright (C) 2018 IBM Corp. */ $ ls -l spdx.* -rw-r--r-- 1 andrew andrew 71 Feb 27 12:02 spdx.c lrwxrwxrwx 1 andrew andrew 6 Feb 27 12:02 spdx.cpp -> spdx.c -rw-r--r-- 1 andrew andrew 77 Feb 27 12:02 spdx.h lrwxrwxrwx 1 andrew andrew 6 Feb 27 12:02 spdx.hpp -> spdx.h The `sed` invocation catches a lot of function documentation, so the hunks were manually added to avoid removing information that we want to keep. Change-Id: I63e49ca2593aa0db0568c7a63bfdead388642e76 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* misc: Add license blurb to unlicensed filesAndrew Jeffery2018-03-241-0/+18
| | | | | | | | | | | | | | | This was roughly achieved with: $ git ls-files | grep '.[ch]p*$' | while read F; do head -n 1 $F | fgrep -v '/*' > /dev/null && echo $F; done | while read L; do cat apache $L > ${L}.tmp; mv ${L}.tmp ${L}; done Some fixups performed by hand to eliminate modifications to files that were hit which should not have been. Change-Id: I9fa5af4644687d8b595a6cf70d6f7575a767d11a Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pnor_partition_table: Parse all miscellaneous user flags from TOCAdriana Kobylak2018-02-021-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the remaining miscellaneous flags specified in the Hostboot FFS header, specifically the CLEARECC flag: https://github.com/open-power/hostboot/blob/master/src/usr/pnor/common/ffs_hb.H This requires a change to how the properties string was being parsed so we can differentiate between the ECC and CLEARECC options. In detail: Issue openbmc/openbmc#2704 captures a failure where Hostboot detects flash corruption on an FFS partition with ECC enabled. In some instances, configuration of FFS partitions allows Hostboot to "fix" ECC errors by clearing the entire partition and trying again. In this case, the attempt fails: --== Welcome to Hostboot hostboot-e223708/hbicore.bin ==-- 4.01970|secure|SecureROM valid - enabling functionality 4.01974|secure|Booting in non-secure mode. 5.93358|ISTEP 6. 5 - host_init_fsi 6.06661|ISTEP 6. 6 - host_set_ipl_parms 6.07597|ECC error in PNOR flash in section offset 0x00026000 6.07604|System shutting down with error status 0x60F Looking at the TOC, we find 0x26000 is in HBEL: # cat /tmp/pnor.toc version=IBM-witherspoon-ibm-OP9_v1.19_1.121 extended_version=op-build-v1.19-326-g20bf99a-dirty,buildroot-2017.08-8-g5e23247,skiboot-v5.9.8,hostboot-7f4ced1,linux-4.13.16-openpower1-p686edfa,petitboot-v1.6.3-p191b3ea,machine-xml-758eb02,occ-84f3564,hostboot-binaries-38248b4,capp-ucode-p9-dd2-v2,sbe-99e2fe2 partition00=part,0x00000000,0x00001000,00,READWRITE partition01=HBEL,0x00008000,0x0002c000,00,ECC,REPROVISION,READWRITE partition02=GUARD,0x0002c000,0x00031000,00,ECC,PRESERVED,REPROVISION Except, Dan Crowell identified that the reported offset is merely *indirectly* related to the offending location in the PNOR layout description: 1) There is a bug in the openbmc code that causes them to remove space from our pnor layout. We don't think that has a functional problem but it does confuse things. The number pointed out in the printk was pointing me at the HBEL partition but the problem is really inside the GUARD partition. Adriana is going to be fixing this issue. The GUARD partition requires the ClearOnEccErr flag[1], however Hostboot's output indicates this action isn't taken; phosphor-mboxd failed to add this information to the dynamically generated TOC data structure presented to Hostboot. Thus, add support for all miscellaneous flags to the ToC generator, allowing the ClearOnEccErr (CLEARECC) flag to be propagated. [1] https://github.com/open-power/pnor/blob/22a9eadc0b2afbd2aca1e054faa2cca90e7760c2/p9Layouts/defaultPnorLayout_64.xml#L90 The bug was confirmed on a Witherspoon system by creating a dummy GUARD partition from /dev/urandom and beginning IPL. Leaving the dummy GUARD in place, mboxd was replaced with the patched build and the host rebooted. Hostboot successfully cleared the partition and triggered a reboot, then successfully booted to Petitboot. Resolves openbmc/openbmc#2704 Tested: As described above Change-Id: I21c9bbc60b8c503194fcea03e74ab1d08aff57fe Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> [arj: Reworked the commit message to describe the bug and fallout] Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* vpnor: add partition version check to the TOCDeepak Kodihalli2017-07-191-2/+4
| | | | | Change-Id: If5497476f03484334396e483e251b1e9434137f3 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* pnor : generate partition tableDeepak Kodihalli2017-06-271-0/+121
Implement a class that, upon construction, generates the virtual PNOR partition table. The virtual PNOR is typically a subset of the full PNOR image, by choosing partitions of interest. The generation is based on upon information read from the PNOR partition files and table of contents (toc) file. Provide an interface to the virtual PNOR partition table. Change-Id: I7a68e3833b8cf66e92eb6ca274f6a3c376ce0add Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
OpenPOWER on IntegriCloud