368 Commits

Author SHA1 Message Date
Abhishek Singh Tomar 81aa2af275 Fix compilation waning "Missing #interrupt-cells"
Resolve : "Missing #interrupt-cells" warning duriing dts(device tree source) compilation
hdata/test/p81-811.spira.dts:1434.37-1442.4: Warning (interrupt_provider): /interrupt-controller@3ffff80030000: Missing #interrupt-cells in interrupt provider

An #interrupt-cells added to both reference dts for testing and source code to generate dtb from hdata.

Signed-off-by: Abhishek Singh Tomar <abhishek@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-02-04 08:35:25 +01:00
Abhishek Singh Tomar a9bc782c84 Fix array-bound compilation warnings
Resolves : the warray bounds warning during compilation

/build/libc/include/string.h:34:16: warning: '__builtin_memset' offset [0, 2097151] is out of the bounds [0, 0] [-Warray-bounds]
34 | #define memset __builtin_memset
hw/fsp/fsp.c:1855:9: note: in expansion of macro 'memset'
1855 | memset(fsp_tce_table, 0, PSI_TCE_TABLE_SIZE);

use volatile pointer to avoid optimization introduced with gcc-11 on constant
address assignment to pointer.

Signed-off-by: Abhishek Singh Tomar <abhishek@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-02-04 08:35:25 +01:00
Nicholas Piggin 9b85f7d961 hdata: add mmu-pid-bits and mmu-lpid-bits for POWER10 CPUs
This adds ibm,mmu-pid-bits and a new ibm,mmu-lpid-bits to POWER10 CPUs.
POWER9 Linux has some workarounds for processors bugs that means it's
probably safer to not add the entries there.

Linux already hard codes these values correctly on these processors, but
this allows more flexibility to change things.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2021-11-10 07:28:47 +01:00
Christophe Lombard 768f67e686 pau: introduce support
OpenCapi for P10 is included in the P10 chip. This requires OCAPI capable
PHYs, Datalink Layer Logic and Transaction Layer Logic to be included.
The PHYs are the physical connection to the OCAPI interconnect.
The Datalink Layer provides link training.
The Transaction Layer executes the cache coherent and data movement
commands on the P10 chip.
The PAU provides the Transaction Layer functionality for the OCAPI
link(s) on the P10 chip.

The P10 PAU supports two OCAPI links. Six accelerator units PAUs are
instantiated on the P10 chip for a total of twelve OCAPI links.

This patch adds PAU opencapi structure for supporting OpenCapi5.
hw/pau.c file contains main of PAU management functions.

Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-10-19 12:26:01 +05:30
Vasant Hegde 636bf0fe24 platform: Add Denali platform support
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-06 12:24:32 +05:30
Frederic Barrat 7706e3300c hdata/iohub: Read PCI Gen5 equalization settings for P10
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-06 12:22:07 +05:30
Vasant Hegde e813a0c09d phys/P10: Use topology index to get phys mapping
This fixes multipchip rainier boot issue.

for Rainer:

chip0: ibm,primary-topology-index = < 0x0>;
chip1: ibm,primary-topology-index = < 0x4>;
chip2: ibm,primary-topology-index = < 0x8>;
chip3: ibm,primary-topology-index = < 0xc>;

for Denali:

node0:
chip0: ibm,primary-topology-index = < 0x0>;
chip1: ibm,primary-topology-index = < 0x1>;
chip2: ibm,primary-topology-index = < 0x2>;
chip3: ibm,primary-topology-index = < 0x3>;

node1:
chip0: ibm,primary-topology-index = < 0x4>;
chip1: ibm,primary-topology-index = < 0x5>;
chip2: ibm,primary-topology-index = < 0x6>;
chip3: ibm,primary-topology-index = < 0x7>;

Note that bmc_create_node() gets called very early in the boot process.
Hence we have to traverse through HDAT ntuple to get right topology index.

May be we can optimize pcid_to_topology_idx() function as its pretty
much duplicate of pcid_to_chip_id(). But for now lets keep it as
separate function.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Ryan Grimm <grimm@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-08-06 12:21:54 +05:30
Vasant Hegde a2d4d7f9e1 hdata/P10: Fix xscom address and ibm, chip-id property
`xscom_id` is deprecated in P10. Instead we should use topology ID's
("Primary topology table index") to calculate xscom address. Also
use ("Processor fabric topology id") for "ibm,chip-id" property.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-08-06 12:21:39 +05:30
Haren Myneni 55d2c4837a hdat/spira: Add ibm, power10-vas-x string to VAS compatible property
VAS SCOM base address and paste address format are changed on P10.
This patch adds ibm,power10-vas-x string to compatible property per
each VAS node. This compatible string is used to define the paste
base address later during VAS initialization.

Also enables NX on P10 without adding any compatible string since
the NX SCOM base address is not changed.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-08-06 12:21:19 +05:30
Haren Myneni 2ce3f083f3 hdat/spira: Define ibm, primary-topology-index property per chip
HDAT provides Topology ID table and the primary topology location on
P10. This primary location points to primary topology entry in ID table
which contains the primary topology index and this index is used to
define the paste base address per chip.

This patch reads Topology ID table and the primary topology location
from hdata and retrieves the primary topology index in the ID table.

Make this primaty topology index value available with
ibm,primary-topology-index property per chip. VAS reads this property
to setup paste base address for each chip.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-08-06 12:20:48 +05:30
Vasant Hegde d7ffcd939d hdata: Add POWER10 support
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>
2021-08-06 12:20:41 +05:30
Oliver O'Halloran 8d248c3972 hdat/i2c: Rework i2c device creation
We've got functions to instantiate I2C buses at various places inside of
the skiboot code base (in hdat, firenze-pci, and in witherspoon). The
HDAT ones are the most generic so re-work those a bit and export the
functions used to add DT nodes for I2C masters and the ports below them.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-06-30 15:05:55 +05:30
Vasant Hegde 0345237a3f hdata/vpd: Add new FRU part number keyword
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-06-30 15:05:55 +05:30
Philippe Mathieu-Daudé bb4530b1f4 hdata/i2c: Use inclusive language, replace the word 'whitelist'
Follow the inclusive terminology from the "Conscious Language in
your Open Source Projects" guidelines [*] and replace the word
"whitelist" appropriately.

[*] https://github.com/conscious-lang/conscious-lang-docs/blob/main/faq.md

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2021-02-04 13:56:22 +05:30
Vasant Hegde 6236804f35 hw/ocmb: Clear top bit from offset before searching addr range
Looks like HBRT sets top bit in pcbaddress before making OCMB SCOM request.
We have to clear that bit so that we can find proper address range
for SCOM operation.

Sample failure:
  [ 2578.156011925,3] OCMB: no matching address range!
  [ 2578.156044481,3] scom_read: to 80000028 off: 8006430d4008c000 rc = -26

Also move HRMOR_BIT macro to common include file (hdata/spira.h -> skiboot.h).

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2020-12-15 13:18:06 +05:30
Vasant Hegde e12574f5cc hdata: assert if we fail to add xscom nodes
If we have duplicate xscom nodes then it will fail to attach xscom
node to device tree and we will fail eventully. Better to call assert()
and fail here.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2020-12-15 13:17:23 +05:30
Vasant Hegde 0b34470e02 hdata: Replace hardcoded string with macro
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Reviewed-by: Dan Horák <dan@danny.cz>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2020-12-15 13:16:59 +05:30
Vasant Hegde ae1ddf7e12 hdata: Update ipmi sensors structure
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Reviewed-by: Dan Horák <dan@danny.cz>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2020-12-15 13:16:39 +05:30
Nayna Jain 31f662a51b hdata/spira: add physical presence flags
This patch reads the hdata bits to check for physical presence
assertion, and creates device tree entries to be consumed later in the
boot.

Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
Signed-off-by: Eric Richter <erichte@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-10-01 13:44:06 +10:00
Ryan Grimm 2d065e249f Add basic P9 fused core support
P9 cores can be configured into fused core mode where two core chiplets
function as an 8-threaded, single core.  So, bump four to eight in boot_entry
when in fused core mode and cpu_thread_count in init_boot_cpu.

The HID, AMOR, TSCR, RPR require the first active thread on that core chiplet
to load the copy for that core chiplet.  So, send thread 1 of a fused core to
init_shared_sprs in boot_entry.

The code checks for fused core mode in the core thead state register and puts a
field in struct cpu_thread.  This flag is checked when updating the HID and in
XIVE code when setting the special bar.

For XSCOM, the core ID is the non-fused EX.  So, create macros to arrange the
bits.  It's fairly verbose but somewhat readable.

This was tested on a P9 ZZ with 16 fused cores and ran HTX for over 24 hours.

Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-08-07 16:00:20 +10:00
Klaus Heinrich Kiwi ef58f69f34 hdata: Add new "smp-cable-connector" VPD keyword
Recent FSP versions are defining a new VPD keyword
'SN' that brings SMP Cable Connector FRU info.

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-08-07 16:00:20 +10:00
Oliver O'Halloran 80cb77739c hdata: Ensure the prd-label hbrt-code-image is prefixed
Older versions of opal-prd (i.e. most of them shipped by distros)
expect the HBRT image to have the PRD label of "ibm,hbrt-code-image".
Commit c3bfa32095 ("hdata: Fix reserved node label search") made
opal-prd check for both strings, but since opal-prd itself is the only
component interested in locating the hbrt-code-image we might as well
just add the prefix in firmware.

Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-08-07 16:00:20 +10:00
Thiago Jung Bauermann 5021a037a7 dt: Set new property length in dt_resize_property()
All callers of dt_resize_property() need to set the new property length
after calling it. append_chip_id() wasn't doing it, which caused this
assert when booting my machine:

[  136.387213258,3] Unable to use memory range 0 from MSAREA 0
[  136.387356677,3] Unable to use memory range 0 from MSAREA 2
[  136.387408390,3] ***********************************************
[  136.387454272,3] < assert failed at core/device.c:605 >
[  136.387493225,3]     .
[  136.387512799,3]      .
[  136.387534056,3]       .
[  136.387550294,3]         OO__)
[  136.387579530,3]        <"__/
[  136.387605086,3]         ^ ^
[  136.387719329,3] Fatal TRAP at 0000000030028a18   .dt_property_set_cell+0x34  MSR 9000000000021002
[  136.387801707,3] CFAR : 00000000300bfd3c MSR  : 9000000000001000
[  136.387847032,3] SRR0 : 0000000030028a18 SRR1 : 9000000000021002
[  136.387893119,3] HSRR0: 0000000030012524 HSRR1: 9000000000001000
[  136.387936830,3] DSISR: 40000000         DAR  : 00000002019df000
[  136.387983570,3] LR   : 00000000300bfd40 CTR  : 0000000000000000
[  136.388046031,3] CR   : 20004202         XER  : 00000000
[  136.388094553,3] GPR00: 00000000300bfd40 GPR16: 0000000000000001
[  136.388139862,3] GPR01: 0000000031e536e0 GPR17: 00000000300ca3c9
[  136.388181131,3] GPR02: 0000000030121200 GPR18: 0000000030103e1c
[  136.388224105,3] GPR03: 000000003053fc60 GPR19: 0000000000000008
[  136.388270356,3] GPR04: 0000000000000001 GPR20: 000000003053fba0
[  136.388313950,3] GPR05: 0000000000000008 GPR21: 0000000000000001
[  136.388363021,3] GPR06: 0000000031e50060 GPR22: 0000000000000001
[  136.388416754,3] GPR07: 0000000000000000 GPR23: 0000000000000000
[  136.388465729,3] GPR08: 0000000000000000 GPR24: 0000000000000000
[  136.388508156,3] GPR09: 0000000000000004 GPR25: 0000000031204060
[  136.388556203,3] GPR10: 0000000000000008 GPR26: 000000003120402c
[  136.388599076,3] GPR11: 0000000000000000 GPR27: 0000000030010000
[  136.388642108,3] GPR12: 0000000040004204 GPR28: 0000000000000002
[  136.388694064,3] GPR13: 0000000031e50000 GPR29: 0000000031203ee0
[  136.388743298,3] GPR14: 00000000300cbf03 GPR30: 0000000031202e80
[  136.388797131,3] GPR15: 00000000300cc01c GPR31: 0000000030103a33
CPU 0048 Backtrace:
 S: 0000000031e539e0 R: 0000000030028874   .dt_resize_property+0x28
 S: 0000000031e53a60 R: 00000000300bfd40   .memory_parse+0xd84
 S: 0000000031e53c40 R: 00000000300bc4d8   .parse_hdat+0xed0
 S: 0000000031e53e30 R: 000000003001504c   .main_cpu_entry+0x1ac
 S: 0000000031e53f00 R: 0000000030002760   boot_entry+0x1b0

Avoid further appearances of the unidentified animal of doom by making
dt_resize_property() do the length updating itself, freeing its callers
from that need.

Suggested-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-06-30 12:07:23 +10:00
Nicholas Piggin 1e0ac5f5ef hdata: MS AREA endian fix
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[oliver: fix up drift]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-06-11 12:52:55 +10:00
Klaus Heinrich Kiwi 11d12c6fb6 hdata/memory.c: Fix "Inconsistent MSAREA" warnings
add_memory_buffer_mmio() should be exclusive to P9P (AXONE).
Running it on non P9P systems resulted in warnings such as:

MS AREA: Inconsistent MSAREA version 40 for P9P system

So check for PVR and quietly return if not P9P.

Fixes: 38b5c3179 (Add support for memory-buffer mmio)
Cc: skiboot-stable@lists.ozlabs.org
Cc: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2020-05-26 14:30:29 +10:00