aboutsummaryrefslogtreecommitdiff
path: root/hdata/iohub.c
AgeCommit message (Collapse)AuthorFilesLines
2023-10-11hdata: Remove legacy SPIRA structureNicholas Piggin1-2/+2
skiboot only supports POWER8 > DD1 now, all supported platforms should use the new SPIRA-S/H structure. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2021-08-06platform: Add Denali platform supportVasant Hegde1-0/+4
Denali is P10 system. But FSP interaction (MBOX protocol) is same as ZZ. Hence add denali platform detection code inside zz.c for now. We can think of adding separate platform later. Also enable : - P10 TCE mapping support - Detect PHBs Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-08-06hdata/iohub: Read PCI Gen5 equalization settings for P10Frederic Barrat1-9/+18
HDAT spec added fields to define the equalization settings for PCI Gen5 link. Format is the same as PCI Gen4, so we just need to add extra fields in the "ibm,lane-eq" in the device tree. Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-08-06hdata: Add POWER10 supportVasant Hegde1-11/+39
Initial P10 support - LPC : This contains two useful information: LPC MCTP Memory Window Base Address Second vUART console details - Enable memory-buffer mmio - Fix ipmi sensors IPMI sensors are deprecated in P10. Hence do not parse ipmi sensors. - I2C support - Detect PHB5 - Create p10 xscom, xive, chiptod nodes - Set pa-features bit for 2nd DAWR Availability of 2nd DAWR depends on 0th bit of 64th byte of ibm,pa-features property. Set it for p10. Co-authored-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Co-authored-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Co-authored-by: Reza Arbab <arbab@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Co-authored-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2020-03-12Re-license IBM written files as Apache 2.0 OR GPLv2+Stewart Smith1-1/+1
SPDX makes it a simpler diff. I have audited the commit history of each file to ensure that they are exclusively authored by IBM and thus we have the right to relicense. The motivation behind this is twofold: 1) We want to enable experiments with coreboot, which is GPLv2 licensed 2) An upcoming firmware component wants to incorporate code from skiboot and code from the Linux kernel, which is GPLv2 licensed. I have gone through the IBM internal way of gaining approval for this. The following files are not exclusively authored by IBM, so are *not* included in this update (I will be seeking approval from contributors): core/direct-controls.c core/flash.c core/pcie-slot.c external/common/arch_flash_unknown.c external/common/rules.mk external/gard/Makefile external/gard/rules.mk external/opal-prd/Makefile external/pflash/Makefile external/xscom-utils/Makefile hdata/vpd.c hw/dts.c hw/ipmi/ipmi-watchdog.c hw/phb4.c include/cpu.h include/phb4.h include/platform.h libflash/libffs.c libstb/mbedtls/sha512.c libstb/mbedtls/sha512.h platforms/astbmc/barreleye.c platforms/astbmc/garrison.c platforms/astbmc/mihawk.c platforms/astbmc/nicole.c platforms/astbmc/p8dnu.c platforms/astbmc/p8dtu.c platforms/astbmc/p9dsu.c platforms/astbmc/vesnin.c platforms/rhesus/ec/config.h platforms/rhesus/ec/gpio.h platforms/rhesus/gpio.c platforms/rhesus/rhesus.c platforms/astbmc/talos.c platforms/astbmc/romulus.c Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [oliver: fixed up the drift] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-12-16dt: assorted cleanupsNicholas Piggin1-14/+7
This replaces several instances dt accesses with higher level primitives throughout the tree. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-12-16cpu: use dt accessor device tree accessNicholas Piggin1-16/+16
In several cases the make test reference .dts files were incorrectly byteswapped, these are fixed here too. Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-08-23hdata: Add Axone IOHUB supportOliver O'Halloran1-0/+4
The PEC / PHB mapping is the same on P9P / Axone as it is on Nimbus add it to the HDAT parser so we get PCI. Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-07-26SPDX-ify all skiboot codeStewart Smith1-15/+2
Use Software Package Data Exchange (SPDX) to indicate license for each file that is unique to skiboot. At the same time, ensure the (C) who and years are correct. See https://spdx.org/ Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [oliver: Added a few missing files] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-07-19sparse: hdata/iohub: correctly convert endiannessStewart Smith1-1/+1
hdata/iohub.c:723:22: warning: restricted beint16_t degrades to integer Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-06-04Remove POWER7 and POWER7+ supportStewart Smith1-94/+0
It's been a good long while since either OPAL POWER7 user touched a machine, and even longer since they'd have been okay using an old version rather than tracking master. There's also been no testing of OPAL on POWER7 systems for an awfully long time, so it's pretty safe to assume that it's very much bitrotted. It also saves a whole 14kb of xz compressed payload space. Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Enthusiasticly-Acked-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-28hdata/iohub: Look for IOVPD on P9Oliver O'Halloran1-2/+1
P8 and P9 use the same IO VPD setup, so we need to load the IOHUB VPD on P9 systems too. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart: fixup op920 hdat_to_dt dts expected result, remove incorrect comment, skip IOVPD loading on non-FSP.] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-20hdata: Prevent NULL dereference on duplicate slot map infoStewart Smith1-0/+4
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-01-25Remove POWER9N DD1 supportNicholas Piggin1-9/+0
This is not a shipping product and is no longer supported by Linux or other firmware components. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-12-10hdata/iohub.c: remove condition that was always trueStewart Smith1-2/+1
Caught by static analysis. The previous if() condition was ensuring lxr was not null, so we don't need this additional check. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-06-18hdata: Remove hn variable where it is unusedJoel Stanley1-6/+5
Whatever this was used for appears to pre-date the public release of skiboot. Found using scan-build. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-04-23hdata/slots: Apply slot label to the parent slotOliver O'Halloran1-1/+15
Slot names only really make sense when applied to an actual slot rather than a device. On witherspoon the GPU devices have a name associated with the device rather than the slot for the GPUs. Add a hack that moves the slot label to the parent slot rather than on the device itself. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-02-20hdata/iohub: Use only wildcard slots for pluggablesOliver O'Halloran1-1/+1
We don't want to cause a VID:DID check against pluggable devices, as they may use multiple devids. Narrow the condition under which VID:DID is listed in the dt, so that we'll end up creating a wildcard slot for these instead. Cc: stable # 5.9.x Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-11-15hdata: Fix copying GEN4 lane equalisation settingsMichael Neuling1-0/+2
These aren't copied currently but should be. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-10-10hdata/iohub: Check IOHUB child count before usingVasant Hegde1-1/+4
..else we endup getting below calltrace in older system. [ 169.179598388,3] HDIF: child array idx out of range! CPU 085c Backtrace: S: 0000000033d739b0 R: 00000000300136e8 .backtrace+0x40 S: 0000000033d73a50 R: 00000000300a1510 .HDIF_child_arr+0x34 S: 0000000033d73ac0 R: 00000000300a47a8 .io_parse+0x708 S: 0000000033d73c80 R: 000000003009f4ec .parse_hdat+0x177c S: 0000000033d73e30 R: 0000000030014750 .main_cpu_entry+0x148 S: 0000000033d73f00 R: 0000000030002690 boot_entry+0x198 Fixes: ad484081 (hdata: Parse IOSLOT information) CC: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-18hdat: fix parsing of P8 hdatStewart Smith1-5/+2
Also fixes hdat_to_dt test cases. Fixes: ad484081ef8a51811e7902aec436fa8f1ca9604a Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15hdata: Parse NVLink informationOliver O'Halloran1-2/+2
Add the per-chip structures that descibe how the A-Bus/NVLink/OpenCAPI phy is configured. This generates the npu@xyz nodes for each chip on systems that support it. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15hdata: Parse IOSLOT informationOliver O'Halloran1-0/+382
Add structure definitions that describe the physical PCIe topology of a system and parse them into the device-tree based PCIe slot description. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-24hdata/iohub: fix load of misaligned address for type 'long unsigned int', ↵Stewart Smith1-4/+7
which requires 8 byte alignment UBSan caught this: hdata/test/../iohub.c:83:2: runtime error: load of misaligned address 0x7f1dc7b0210a for type 'long unsigned int', which requires 8 byte alignment 0x7f1dc7b0210a: note: pointer points here 31 4c 58 08 31 00 04 01 00 30 00 42 50 46 02 00 00 78 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ #0 0x41470a in io_get_lx_info hdata/test/../iohub.c:83 #1 0x41759f in io_add_p8_cec_vpd hdata/test/../iohub.c:450 #2 0x417d35 in io_parse_fru hdata/test/../iohub.c:538 #3 0x41812a in io_parse hdata/test/../iohub.c:600 #4 0x425aa2 in parse_hdat hdata/test/../spira.c:1337 #5 0x43d9f8 in main hdata/test/hdata_to_dt.c:358 #6 0x7f1dcb868509 in __libc_start_main (/lib64/libc.so.6+0x20509) #7 0x4019e9 in _start (/home/stewart/skiboot/hdata/test/hdata_to_dt+0x4019e9) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-11hdat: Fix PCIe GEN4 lane-eq setting for DD2Michael Neuling1-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>
2017-07-17hdat: Add missing newline to printMichael Neuling1-1/+1
Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-07-13hdata: Fix phb4 lane-eq property generationMichael Neuling1-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>
2017-05-16hdata: Don't use printfOliver O'Halloran1-1/+2
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>
2017-01-15hdat: Add support for PHB4Oliver O'Halloran1-0/+122
Adds support for parsing the PHB4 entries in the IOHUB array and populating the devicetree appropriately. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: s/DOUMO/DUOMO/, assert(), spotted by Vasant] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-21tree-wide: use dt_add_property_u64s() where we canOliver O'Halloran1-9/+4
A few places (mostly old code) were using: add_property_cells(hi32(number), lo32(number)); This patch converts them to use the helper rather than doing it manually. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-18Remove missed bit of p5ioc codeStewart Smith1-52/+0
Probably due to bad merge by me Fixes: 0baf63f38757 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-18Drop support for p5ioc2Daniel Axtens1-214/+0
p5ioc2 is used by approximately 2 machines in the world, and has never ever been a supported configuration. Not only is the code virtually unused and very tricky to test, but keeping it around is making life unnecessarily difficult: - It's more complexity to manage for things such as PCI slot support - It's more code for static analysis to cover, which means more time fixing bugs that affect no-one. - It's bloating every single install of skiboot for no benefit. - It's reducing coverage stats, which is sad. Drop p5ioc2. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-16Enable -Werror for -WformatStewart Smith1-10/+11
We create our own inttypes.h to get the correct printf formatting for 64bit numbers. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-10sparse: fix beintXX_t degrades to integer warnings in hdata/iohub.cStewart Smith1-8/+8
No generated code change due to skiboot being BE hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:209:16: warning: restricted beint32_t degrades to integer hdata/iohub.c:356:19: warning: restricted beint32_t degrades to integer hdata/iohub.c:490:19: warning: restricted beint32_t degrades to integer hdata/iohub.c:536:21: warning: restricted beint64_t degrades to integer hdata/iohub.c:554:9: warning: restricted beint32_t degrades to integer hdata/iohub.c:554:9: warning: restricted beint32_t degrades to integer Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-09sparse: fix endian conversions in hdata/iohub.cStewart Smith1-7/+7
Since skiboot is all BE and hdat is BE, this changes nothing except for silencing the sparse warnings hdata/iohub.c:35:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:35:9: expected unsigned int hdata/iohub.c:35:9: got restricted beint32_t const [usertype] buid_ext hdata/iohub.c:36:9: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:36:9: expected unsigned int [unsigned] [usertype] proc_chip_id hdata/iohub.c:36:9: got restricted beint32_t const [usertype] proc_chip_id hdata/iohub.c:36:9: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:36:9: expected unsigned int [unsigned] [usertype] proc_chip_id hdata/iohub.c:36:9: got restricted beint32_t const [usertype] proc_chip_id hdata/iohub.c:38:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:38:9: expected unsigned int hdata/iohub.c:38:9: got restricted beint32_t const [usertype] gx_index hdata/iohub.c:39:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:39:9: expected unsigned int hdata/iohub.c:39:9: got restricted beint32_t const [usertype] ec_level hdata/iohub.c:114:63: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:114:63: expected unsigned short [unsigned] [usertype] slca_index hdata/iohub.c:114:63: got restricted beint16_t const [usertype] slca_index hdata/iohub.c:634:17: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:634:17: expected restricted beint32_t [usertype] be_val hdata/iohub.c:634:17: got restricted beint16_t const [usertype] hub_num hdata/iohub.c:708:22: warning: incorrect type in assignment (different base types) hdata/iohub.c:708:22: expected unsigned int [unsigned] type hdata/iohub.c:708:22: got restricted beint32_t const [usertype] card_type Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-05hdat: Add Venice hub ID to HDAT conversionBenjamin Herrenschmidt1-5/+9
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-15Rework hdata/iohub.c CEC log messages to appropriate log levelsStewart Smith1-54/+69
We're mostly PR_DEBUG here, except for the basics, which are PR_INFO. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt1-0/+715
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>