summaryrefslogtreecommitdiffstats
path: root/hdata
Commit message (Collapse)AuthorAgeFilesLines
...
* opal: Extract sw checkstop fir address from HDAT.Mahesh Salgaonkar2017-08-222-1/+28
| | | | | | | | | | | | | | | | | | | Extract sw checkstop fir address info from HDAT and populate device tree node ibm,sw-checkstop-fir. This patch is required for OPAL_CEC_REBOOT2 OPAL call to work as expected on p9. With this patch a device property 'ibm,sw-checkstop-fir' is now properly populated: # lsprop ibm,sw-checkstop-fir ibm,sw-checkstop-fir 05012000 0000001f Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* HDAT/device-tree: only add lid-type on pre-POWER9 systemsStewart Smith2017-08-221-2/+4
| | | | | | | | | | | Largely a relic of back when we had multiple entry points into OPAL depending on which mechanism on an FSP we were using to get loaded, this isn't needed on modern P9 as we only have one entry point (we don't do the PHYP LID hack). Fixes: https://github.com/open-power/skiboot/issues/82 Reported-by: Pavaman Subramaniyam <pavsubra@linux.vnet.ibm.com> Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Fix possible NULL dereference (CID 144258)Cyril Bur2017-08-151-3/+1
| | | | | | | | | Only use devicetree model if there was one. Fixes: CID 144258 Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/paca: Fix possible dereference of NULL (CID 141080)Cyril Bur2017-08-151-0/+3
| | | | | | | Fixes: CID 141080 Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/i2c: Work around broken I2C array versionOliver O'Halloran2017-08-111-2/+8
| | | | | | | | | Work around a bug in the I2C devices array that shows the array version as being v2 when only the v1 data is populated. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: only parse V2 as V1, still pass on >v2] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* HDAT: Add chip-id property to ipmi sensorsVasant Hegde2017-08-111-0/+36
| | | | | | | | | | | Presently we do not have a way to map sensor to chip id. Hence we are always passing chip id 0 for occ_reset request (see occ_sensor_id_to_chip()). This patch adds chip-id property to sensors (whenever its available) so that we can map occ sensor to chip-id and pass valid chip-id to occ_reset request. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Fix PCIe GEN4 lane-eq setting for DD2Michael Neuling2017-08-111-4/+19
| | | | | | | | | | For PCIe GEN4, DD2 uses only 1 byte per PCIe lane for the lane-eq settings (DD1 uses 2 bytes). This fixes the HDAT parsing to cope with this. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Add POWER9 DD2.0 specific pa_featuresMichael Neuling2017-08-111-1/+20
| | | | | | | Same as the default but with TM off. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Make is_power9n() globalMichael Neuling2017-08-112-12/+16
| | | | | | | | | This splits out is_power9n() so it can be used elsewhere. It also adds a check for for POWER9 so the function does more of what it's name suggests (and so the caller doesn't need to do it). Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: use a realistic PVR and chip revisionStewart Smith2017-08-113-42/+53
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/spira: POWER9 NX isn't software compatible with P7/P8 NX, don't claim soStewart Smith2017-08-101-8/+10
| | | | | Fixes: 2512953c7c6dc3b479d159d9bce8206219951164 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nx: Add device tree node for Power9Sukadev Bhattiprolu2017-08-011-0/+3
| | | | | Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* vas: Create xscom DT node in hdataSukadev Bhattiprolu2017-08-011-0/+15
| | | | | | | | Create the VAS xscom node in hdata and use that when initializing VAS. Suggested-by: Ben Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat/i2c: Fix array version checkOliver O'Halloran2017-07-251-1/+1
| | | | | | | We should be checking the array version, not the HDIF header version. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/memory: Add newlines to debug messagesOliver O'Halloran2017-07-251-2/+2
| | | | | | | Missed a few. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/memory: Add memory reservations to the DTOliver O'Halloran2017-07-252-4/+55
| | | | | | | | | | | | | | | | Currently we just add these to a list of pre-boot reserved regions which is then converted into a the contents of the /reserved-memory/ node just before Skiboot jumps into the firmware kernel. This approach is insufficent because we need to add the ibm,prd-instance labels to the various hostboot reserved regions. To do this we want to create these resevation nodes inside the HDAT parser rather than having the mem_region flattening code handle it. On P8 systems Hostboot placed its memory reservations under the /ibm,hostboot/ node and this patch makes the HDAT parser do the same. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Add missing newline to printMichael Neuling2017-07-171-1/+1
| | | | | Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* HDAT: Add IPMI sensor data under /bmc nodeVasant Hegde2017-07-133-2/+75
| | | | | | | | | | Add IPMI sensor data under /bmc node. CC: Joel Stanley <joel@jms.id.au> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Tested-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Fix phb4 lane-eq property generationMichael Neuling2017-07-131-4/+5
| | | | | | | | | | | | | | | | | The lane-eq data we get from hdat is all 7s but what we end up in the device tree is: xscom@603fc00000000/pbcq@4010c00/stack@0/ibm,lane-eq 00000000 31c339e0 00000000 0000000c 00000000 00000000 00000000 00000000 00000000 31c30000 77777777 77777777 77777777 77777777 77777777 77777777 This fixes grabbing the properties from hdat and fixes the call to put them in the device tree. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Don't dereference possible NULL model_nameStewart Smith2017-07-041-4/+4
| | | | | | | | | | It's legitimate to just add model-name to the device tree if we have one, which is what the hdata logic tries to do, but subtley fails in one of the code paths. Found by static analysis Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Big log level reduction...Benjamin Herrenschmidt2017-06-261-1/+1
| | | | | | | | | | | | | 90% of what we print isn't useful to a normal user. This dramatically reduces the amount of messages printed by OPAL in normal circumstances. We still need to add a way to bump the log level at boot based on a BMC scratch register or some HDAT property. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat/vpd: Don't warn and don't create a dummy "model-name"Benjamin Herrenschmidt2017-06-261-3/+0
| | | | | | | | | | If the model property doesn't contain a known model number that we can translate into a name, assume it's already a name, stop warning and don't create an extraneous property. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Ensure P9 DD1 workarounds apply only to NimbusMichael Neuling2017-06-191-7/+19
| | | | | | | | | | | The workarounds for P9 DD1 are only needed for Nimbus. P9 Cumulus will be DD1 but don't need these same workarounds. This patch ensures the P9 DD1 workarounds only apply to Nimbus. It also renames some things to make clear what's what. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: Add PVR overrides to the usage textOliver O'Halloran2017-06-191-1/+8
| | | | | | | Save us a few headaches in the future. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hw/phys_map: Use GCIDs as a chip indexOliver O'Halloran2017-06-161-1/+1
| | | | | | | | | | | | | | Currently we pass in a proc_chip structure to phys_map_get(). All we we really need from this structure is the Global Chip ID (GCID). This patch reworks the function so that we only need to pass the GCID which allows us to use it before the proc_chip structures have been initialised (i.e in the HDAT parser). Cc: Michael Neuling <mikey@neuling.org> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Acked-By: Michael Neuling <mikey@neuling.org> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Use GCID in LPC setupOliver O'Halloran2017-06-161-2/+7
| | | | | | | | | | The HDAT has a notion of "chip ID" which is an arbitrary numbering of chips. This numbering isn't useful outside of the HDAT so we refer to chips uing their Global Chip ID (GCID). Currently we're using the HDAT chip ID in a few places and this patch fixes them. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Move enable_mambo_console() into chip initialisationMichael Ellerman2017-06-151-0/+1
| | | | | | | | | | | | | | Rather than having a wart in main_cpu_entry() that initialises the mambo console, we can move it into init_chips() which is where we discover that we're on mambo. This also means we don't need to check the quirk again, and has the added bonus that an assert in chip initialisation (which follows immediately) will actually produce output. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> [stewart@linux.vnet.ibm.com: fix make check by adding no-op stub] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/test: Add memory reservations to hdata_to_dtOliver O'Halloran2017-06-062-6/+24
| | | | | | | | | | | | | | Currently memory reservations are parsed, but since they are not processed until mem_region_init() they don't appear in the output device tree blob. Several bugs have been found with memory reservations so we want them to be part of the test output. Add them and clean up several usages of printf() since we want only the dtb to appear in standard out. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Make out-of-range idata print at PR_DEBUGOliver O'Halloran2017-06-061-2/+2
| | | | | | | | Some fields just aren't populated on some systems. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Ignore unnamed memory reservations.Oliver O'Halloran2017-05-261-4/+6
| | | | | | | | | | | | | | Hostboot should name any and all memory reservations that it provides. Currently some hostboots export a broken reservation covering the first 256MB of memory and this causes the system to crash at boot due to an invalid free because this overlaps with the static "ibm,os-reserve" region (which covers the first 768MB of memory). According to the hostboot team unnamed reservations are invalid and can be ignored. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Check the Host I2C devices array versionOliver O'Halloran2017-05-261-0/+33
| | | | | | | | | | | | Currently this is not populated on FSP machines which causes some obnoxious errors to appear in the boot log. We also only want to parse version 1 of this structure since future versions will completely change the array item format. Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: return -1 on error rather than 1] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Reserve Trace AreasOliver O'Halloran2017-05-263-0/+53
| | | | | | | | | When hostboot is configured to setup in memory tracing it will reserve some memory for use by the hardware tracing facility. We need to mark these areas as off limits to the operating system and firmware. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mem_region: Add HW-only memory resevationsOliver O'Halloran2017-05-261-0/+1
| | | | | | | | | | | | Add a new type of memory reservation that indicates a memory region is only used by hardware and should not be touched by software. This is needed for the in-memory tracing buffers. These reservations have the "no-map" property which indicates that the host kernel should not setup any virtual address mappings that cover this range, unless of course a device driver does so explicitly. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mem_region: rename HW_RESERVE to FW_RESERVEOliver O'Halloran2017-05-262-3/+2
| | | | | | | | | | | Currently all existing reservations are made by hostboot itself or on behalf of some other part of system firmware (e.g. the OCCs). We want to add a "true" hardware reservation type that should not be touched by the host OS. To prepare for that this patch renames the existing reservation type to refect it's actual usage. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: Output up to PR_DEBUGOliver O'Halloran2017-05-161-4/+4
| | | | | | | | | | | | | A lot of stuff that is useful for debugging and general sanity checking of the HDAT parser is only printed at PR_DEBUG. Bump up the log level for hdata_to_dt so that more of this is output by default. The actual test cases only look at the DTS output so there's no harm in being verbose. Clean up the space indentation while we're here. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Add no-op stub functionsOliver O'Halloran2017-05-161-2/+8
| | | | | | | These are useful for side-stepping various HW specific functions. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Don't use printfOliver O'Halloran2017-05-162-3/+4
| | | | | | | | | Using printf() here results in the output going into the stdout stream when running the hdata_to_dt test. This results in an invalid dtb output so lets not do that. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Respect OCC and HOMER resevationsOliver O'Halloran2017-05-161-6/+0
| | | | | | | | | | | | | In the past we've ignored these since Hostboot insisted in exporting broken reservations and the OCC was not being used yet. This situation seems to have resolved itself so we should respect the reservations that hostboot provides. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Acked-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Tested-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/i2c: avoid possible int32_t overflowStewart Smith2017-05-121-1/+1
| | | | | | | | | We're safe up until engine number 524288. Found by static analysis Fixes: ae4e50eb35695 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* test/hdata_to_dt: fix build breakage caused by phys_map_getStewart Smith2017-05-101-0/+3
| | | | | Fixes: 5f67c1e253788691d376e4e639d4a6e7785efa55 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* lpc: Migrate BAR assignment to phys_map_get()Michael Neuling2017-05-101-4/+3
| | | | | | | Keeps existing address. No functional change. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/test: Fix proc_gen when testingOliver O'Halloran2017-05-103-62/+70
| | | | | | | | | In the hdata_to_dt test application the PVR override flags do not correctly set proc_gen. This causes some butchering of the compatible strings and some XSCOM addresses. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: indicate when booted with elevated risk levelOliver O'Halloran2017-05-032-0/+6
| | | | | | | | | | When the system is IPLed with an elevated risk level Hostboot will set a flag in the IPL parameters structure. Parse and export this in the device tree at: /ipl-params/sys-params/elevated-risk-level Cc: Adrian Barrera <abarrera@us.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Make FSPv1 work againOliver O'Halloran2017-05-031-0/+1
| | | | | | | One less thing to work around for those crazy enough to try. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/spira.c: Add device-tree bindings for nest mmuAlistair Popple2017-05-011-0/+17
| | | | | | | | | The nest mmu will only get initialised by opal_nmmu_set_ptcr() if the appropriate device-tree entries exist. Add them during hdata parsing. Signed-off-by: Alistair Popple <alistair@popple.id.au> Acked-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/i2c: Fix bus and clock frequenciesBenjamin Herrenschmidt2017-04-281-3/+8
| | | | | | | | | | | | The clock-frequency of the i2c master should be derived from the xscom bus frequency (itself derived from the nest frequency). The bus-frequency of the i2c bus should be in Hz so convert the HDAT value from kHz to Hz. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/i2c: Workaround broken i2c devicesOliver O'Halloran2017-04-131-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some older revisions of hostboot populate the host i2c device fields with all zero entires. Detect and ignore these so we don't crash on boot. Without this we get: [ 151.251240444,3] DT: dt_attach_root failed, duplicate unknown@0 [ 151.251300274,3] *********************************************** [ 151.251339330,3] Unexpected exception 200 ! [ 151.251363654,3] SRR0 : 0000000030090c28 SRR1 : 9000000000201000 [ 151.251409207,3] HSRR0: 0000000000000010 HSRR1: 9000000000001000 [ 151.251444114,3] LR : 30034018300c5ab0 CTR : 30034018300a343c [ 151.251478314,3] CFAR : 0000000030024804 [ 151.251500346,3] CR : 40004208 XER: 00000000 <snip GPRS> [ 151.252083372,0] Aborting! CPU 0034 Backtrace: S: 0000000031cd36a0 R: 000000003001364c .backtrace+0x2c S: 0000000031cd3730 R: 0000000030018db8 ._abort+0x4c S: 0000000031cd37b0 R: 0000000030025c6c .exception_entry+0x114 S: 0000000031cd3840 R: 0000000000001f00 * +0x1f00 S: 0000000031cd3a10 R: 0000000031cd3ab0 * S: 0000000031cd3aa0 R: 00000000300248b8 .new_property+0x90 S: 0000000031cd3b30 R: 0000000030024b50 .__dt_add_property_cells+0x30 S: 0000000031cd3bd0 R: 000000003009abec .parse_i2c_devs+0x350 S: 0000000031cd3cf0 R: 0000000030093ffc .parse_hdat+0x11e4 S: 0000000031cd3e30 R: 00000000300144c8 .main_cpu_entry+0x138 S: 0000000031cd3f00 R: 0000000030002648 boot_entry+0x198 (Modified: removed backtrace() call and added in backtrace to commit) Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Michael Neuling <mikey@neuling.org>
* hdat: parse processor attached i2c devicesOliver O'Halloran2017-04-076-2/+201
| | | | | | | | Adds basic parsing for i2c devices that are attached to the processor I2C interfaces. This is mainly VPD SEEPROMs. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: fix reservation sizeOliver O'Halloran2017-04-051-1/+2
| | | | | | | | | The hostboot reserved ranges are [start, end] pairs rather than [start, end) so we need to stick a +1 in there to calculate the size properly. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Use dt_add_property_nstr instead of duplicating codeVasant Hegde2017-04-051-9/+3
| | | | | Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud