aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-01-15tpm_i2c_nuvoton: Add support for Nuvoton 75x TPMsEric Richter2-1/+16
This patch adds the new expected values for the 75x chip to the hdat i2c devices table, and the requisite new constants to the Nuvoton driver as according to the TCG TPM I2C Interfact Specification for TPM 2.0 Revision 1.0[1]. [1] https://trustedcomputinggroup.org/resource/tcg-tpm-i2c-interface-specification/ Signed-off-by: Eric Richter <erichte@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-15tpm_i2c_nuvoton: Use struct of constants instead of macrosEric Richter1-20/+39
This driver was originally developed with only the npct650 chip in mind, which was developed before there was a TCG standard for a TPM on the i2c bus. Therefore, many constants were hardcoded using macros for the specific expected offsets and vendor information for this particular chip. To allow support for other potential Nuvoton (or maybe other i2c) chips, this patch factors out the constants into a struct so that other chips may be added, and the correct set of constants can be selected at runtime. Signed-off-by: Eric Richter <erichte@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10platforms/qemu: QEMU now has support for direct controls on Power10Nicholas Piggin3-7/+10
The QUIRK_NO_DIRECT_CTL quirk is no longer required for Power10 on QEMU. Older QEMU versions won't work, but skiboot and Linux should just time out the NMI IPIs and fall back. Add QUIRK_NO_DIRECT_CTL to mambo rather than check mambo explicitly. There are some hacks around the fast reboot code for mambo still, but they have never worked too well. Now that QEMU supports it, the mambo stuff there could be removed eventually. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10hw/occ: Endian fixesNicholas Piggin1-26/+34
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10hw/occ: Tidy code and add error messageNicholas Piggin1-50/+1
The POWER10 init case is just a duplicate of POWER9 for now, so consolidate it. Add an error message for unknown response type. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10hw/occ: Fix OCC structure layoutNicholas Piggin1-6/+8
POWER10 addition accidentally changed a structure size by one byte. Fixes: c8c36ada1d9a ("occ: Add POWER10 support") Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10hw/occ: Fix version checkNicholas Piggin1-1/+1
This test is always false due to a typo, which disables OCC sensor and command functions. Not sure why compiler doesn't warn about always true condition. Fixes: c8c36ada1d9a ("occ: Add POWER10 support") Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10hw/psi: Add LPC client names to PSI SIRQ interruptsNicholas Piggin7-41/+79
Add a name string to LPC client irq sources. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10hw/bt: Work around QEMU lost interrupt bugNicholas Piggin1-0/+10
QEMU has a bug where it loses the BT interrupt somewhere between BT and XIVE when the OS boots. For now, add a workaround QEMU quirk in the poller to try to kick things along again. SBE suffers the same problem but it has a poller that kicks the SBE and gets it going again. Suspect the PSI interrupts may not be re-presented after the OS re-initialises XIVE. This issue does not seem to appear on real hardware. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-10platforms/astbmc: Fix IPMI set BMC global enables commandNicholas Piggin1-31/+16
The bitfields were in the wrong order. Use bit operations instead. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-08core/cpu: Fix invalid SMT indexesNicholas Piggin1-26/+34
Code using cpu_thread_count is dangerous because that is the maximum number of threads that a CPU type supports, not the actual number of threads. For real hardware that hardly matters, but QEMU can run a single thread Power10, for example. This causes some code (e.g., xive_init_cpu_properties) to access beyond the end of allocated arrays. Fix this by making cpu_thread_count the actual number of threads discovered via dt. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-08hw/phb4: Avoid wait for PERST when running on QEMUNicholas Piggin1-0/+4
Waiting for PCI reset is the most costly component of a QEMU boot, mostly due to 1s delay between PERST deassert and device config space access. These PCI hardware delays are not required with QEMU, so skip them on that platform. On a single-CPU QEMU powernv10 machine where PCI probing is not well parallelised, this reduces skiboot boot time from 6.3s to 0.4s. This is important for testing and CI. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-08libstb: endian annotationsNicholas Piggin4-9/+9
Add endian annotations to silence sparse endian warnings in libstb. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-08npu/pau: endian fixesNicholas Piggin5-14/+15
Add endian annotations to NPU OPAL APIs, and fix warnings and bugs reported by sparse. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-08core/hmi: fix endian conversion bugNicholas Piggin1-1/+1
Fix an endian conversion bug in HMI checkstop reporting. Noticed by sparse. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-08opal-ci: Drop fedora39, add fedora41Reza Arbab4-3/+3
Fedora 39 has reached end-of-life. Remove it and add Fedora 41. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz>
2024-09-10opal-ci: Remove centos7Reza Arbab3-46/+1
CentOS 7 end of life was June 30, 2024. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz>
2024-09-10Makefile: Use '--ignore-errors unused' with lcovReza Arbab1-1/+1
We are a bit overzealous in specifying arguments to 'lcov -r', listing files (via wildcard) that are not actually in the tracefile. This is harmless, but will cause newer lcov to generate an error message of type 'unused'. Reduce this error to a warning. Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2024-09-10ci: Update github actions to run on Node 20Reza Arbab2-2/+2
Github is deprecating Node 16 for actions[1]. Update our workflow from using actions/checkout@v3 to v4, which runs on Node 20. [1] https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2024-08-02core/pldm: Fix Use of uninitialised valueAbhishek Singh Tomar1-1/+1
In decode_platform_event_message_resp() when response.completion_code is not PLDM_SUCCESS then response.platform_event_status remain uninitialized this end up triggering following warning ==48024== Use of uninitialised value of size 8 ==48024== at 0x48D12CB: _itoa_word (_itoa.c:183) ==48024== by 0x48DBFA1: __printf_buffer (vfprintf-process-arg.c:155) ==48024== by 0x48DE072: __vfprintf_internal (vfprintf-internal.c:1559) ==48024== by 0x42DD97: vprintf (stdio.h:41) ==48024== by 0x42DD97: _prlog (stubs.c:27) ==48024== by 0x426C92: send_repository_changed_event (pldm-platform-requests.c:929) ==48024== by 0x426E7D: add_hosted_pdrs (pldm-platform-requests.c:973) ==48024== by 0x427752: pldm_platform_init (pldm-platform-requests.c:1226) Fix issue by intializing struct response with 0. Signed-off-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2024-08-02core/pldm: Fix dangling point issueAbhishek Singh Tomar1-1/+3
When calling pldm_platform_init() and the GET_PDR PLDM request fails, the 'pdrs_repo' global variable is freed but becomes a dangling pointer. Subsequent calls to pldm_platform_init will lead to an invalid read. ==28652== Invalid read of size 8 ==28652== at 0x40A4C8: pldm_pdr_destroy (pdr.c:130) ==28652== by 0x424BA3: pdr_init_complete (pldm-platform-requests.c:42) ==28652== by 0x4274DA: pldm_platform_load_pdrs (pldm-platform-requests.c:1170) ==28652== by 0x42759C: pdrs_init (pldm-platform-requests.c:1190) ==28652== by 0x427703: pldm_platform_init (pldm-platform-requests.c:1221) Signed-off-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2024-08-02core/pldm: Fix pdr handle to add first pdr requestAbhishek Singh Tomar1-0/+3
As per the specification: To retrieve the first PDR record, use the get_pdr_req function with handle 0. On the BMC side, the first PDR is sent in response, along with the next_record_hndl which can be used to access consecutive PDR records. However, it's important to note that the first PDR may not necessarily have a handle of 1. In the current scenario, providing a record_hndl value of 0 to pldm_pdr_add() will always result in the addition of a record to the repository with a PDR handle of 1. In current fix record handle is extracted from pdr record data. Signed-off-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2024-08-02opal-ci: Drop fedora38, add fedora40Reza Arbab4-3/+3
Fedora 38 has reached end-of-life. Remove it and add Fedora 40. Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2024-01-02opal-ci: Drop fedora37, add fedora39Reza Arbab4-3/+3
Fedora 37 has reached end-of-life. Remove it and add Fedora 39. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz>
2023-11-27hw/imc: Detect BML and fix core countersRyan Grimm3-5/+10
On systems running BML we started noticing this in the skiboot log: [ 409.088819302,3] XSCOM: write error gcid=0x0 pcb_addr=0x20000060 stat=0x4 [ 409.088823446,3] ELOG: Error getting buffer to log error [ 409.088824806,3] XSCOM: Write failed, ret = -26 [ 409.088825797,3] IMC: error in xscom_write for pdbar [ 0.468976][ T19] core_imc memory allocation for cpu 0 failed [ 0.468993][ T1] IMC PMU core_imc Register failed I tracked down that bad pcb_addr to this line in the code: pdbar_addr = get_imc_scom_addr_for_quad(phys_core_id, pdbar_scom_index[port_id]); I found that pdbar_scom_index was not initialized because, like mambo, we don't have the IMC catalog in memory. So, in imc_init we error out and never initialize it in setup_imc_scoms. This patch adds a chip quirk QUIRK_BML because it seems like a reasonable thing to do and it's easy to put a BML {}; in the device tree like Mambo, Awan, etc. It is tested on a Rainier and errors are gone and /sys/devices/core_imc shows up as expected. Signed-off-by: Ryan Grimm <grimm@linux.ibm.com> Reviewed-By: Madhavan Srinivasan <maddy@linux.ibm.com>
2023-10-11hdata: Use existing define for PCIA signature checkNicholas Piggin1-1/+1
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-10-11hdata: make for_each_pcia take spiras as an argumentNicholas Piggin4-4/+4
Have for_each_pcia take spiras as an argument rather than use the global variable. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-10-11hdata: Remove legacy SPIRA structureNicholas Piggin15-284/+101
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>
2023-10-11hdata: split idata accessor functionNicholas Piggin1-7/+17
Add HDIF_idata that returns the idata pointer structure, not a pointer to the data itself. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-10-11hdata: Make hdata child accessors check the headerNicholas Piggin1-0/+12
Like other (idata) accessors already do, check the common header in hdata child accessor calls. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-10-11hdata: Use common code for HDIF header checkNicholas Piggin2-4/+8
Make the HDIF header check use a common function. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-10-11hdata: Add POWER10 Rainier testsNicholas Piggin3-0/+4237
Grab a SPIRA-S from a booted Rainier system and plug it in. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-15hw/imc: Update IMC PMU node names for power10Athira Rajeev1-10/+186
The nest IMC (In Memory Collection) Performance Monitoring Unit(PMU) node names are saved as "struct nest_pmus_struct" in the "hw/imc.c" IMC code. Not all the IMC PMUs listed in the device tree may be available. Nest IMC PMU names along with their bit values is represented in imc availability vector. This struct is used to remove the unavailable nodes by checking this vector. For power10, the imc_chip_avl_vector ie, imc availability vector ( which is a part of the IMC control block structure ), has change in mapping of units and bit positions. Hence rename the existing nest_pmus array to nest_pmus_p9 and add entry for power10 as nest_pmus_p10. Also the avl_vector has another change in bit positions 11:34. These bit positions tells the availability of Xlink/Alink/CAPI. There are total 8 links and three bit field combination says which link is available. Patch implements all these change to handle nest_pmus_p10. Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-15hw/imc: Update IMC code to use dt_find_by_name_before_addr for checking dt nodesAthira Rajeev1-9/+9
The nest IMC (In Memory Collection) Performance Monitoring Unit(PMU) node names are saved in nest_pmus[] array in the "hw/imc.c" IMC code. Not all the IMC PMUs listed in the device tree may be available. Nest IMC PMU names along with their bit values is represented in imc availability vector. The nest_pmus[] array is used to remove the unavailable nodes by checking this vector. To check node availability, code was using "dt_find_by_substr". But since the node names have format like: "name@offset", dt_find_by_name doesn't return the expected result. Fix this by using dt_find_by_name_before_addr. Also, update the char array to use correct node names. Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-15core/device: Add function to return child node using name at substring "@"Athira Rajeev3-0/+39
Add a function dt_find_by_name_before_addr() that returns the child node if it matches till first occurrence at "@" of a given name, otherwise NULL. This is helpful for cases with node name like: "name@addr". In scenarios where nodes are added with "name@addr" format and if the value of "addr" is not known, that node can't be matched with node name or addr. Hence matching with substring as node name will return the expected result. Patch adds dt_find_by_name_before_addr() function and testcase for the same in core/test/run-device.c Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> [arbab: Refactor the loop to fix possible memory leak] Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-14opal-ci: Use the Fedora container registryReza Arbab3-3/+3
The Fedora images in the Docker hub container registry are updated less frequently and lag the ones from Fedora's offical repo. In my experience, this often leads to periods where our CI testing is broken on rawhide due to some short-lived issue that is already fixed in current images. So, change our Dockerfiles to pull specifically from the upstream registry.fedoraproject.org instead. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-by: Dan Horák <dan@danny.cz> Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com>
2023-09-12platforms/astbmc: Enable PLDM supportChristophe Lombard5-1/+84
Last BMC firmware is available with a complete PLDM support on Rainier system. This patch allows initially to: - Initialize the MCTP core. - Enable the mctp binding over LPC bus interface and new wrappers to send and receive PLDM messages over the mctp library. - Retrieve all needed PLDM data. - "Virtualize" the content of a BMC flash based on lid files. Then, others mandatory support (watchdog, opal rtc, opal ipmi) are enabled. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Register OPAL_IPMI_SEND/RECV calls backChristophe Lombard3-1/+304
backend apis to support partially: OPAL_IPMI_SEND: send an IPMI message to the service processor OPAL_IPMI_RECV: read an ipmi message of type ``ipmi_msg`` from ipmi message queue ``msgq`` into host OS structure ``opal_ipmi_msg`` Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Register OPAL_RTC_READ/WRITE calls backChristophe Lombard3-1/+266
OPAL_RTC_READ/WRITE are used to retrieve and write the time. PLDM stack provides GetBiosDateTimeReq and SetBiosDateTimeReq commands to exercise. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Update boot progress stateChristophe Lombard3-0/+280
PLDM Event Messages are PLDM monitoring and control messages that are used by a PLDM terminus to synchronously or asynchronously report PLDM events to a central party called the PLDM Event Receiver. This patch allows to send a: - generic sensor events (events related to PLDM numeric and state sensors). - boot progress sensor event. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Decode the GetFruRecordTable requestChristophe Lombard3-0/+96
The GetFRURecordTable command is used to get the FRU Record Table data. This command is defined to allow the FRU Record Table data to be transferred using a sequence of one or more command/response messages. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Decode the GetFRURecordTableMetadata requestChristophe Lombard3-0/+157
The GetFRURecordTableMetadata command is used to get the FRU Record Table metadata information that includes the FRU Record major version, the FRU Record minor version, the size of the largest FRU Record data, total length of the FRU Record Table, total number of FRU Record Data structures, and the integrity checksum on the FRU Record Table data. Add an "IBM, skiboot" FRU Record product requested by the BMC. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Decode the GetPDR requestChristophe Lombard1-0/+123
The GetPDR command is used to retrieve individual PDRs from a PDR repository. The record is identified by the PDR recordHandle value that is passed in the request. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Create boot progress and terminus locator in the given repoChristophe Lombard2-0/+343
The boot progress record will be used to report Opal's progress to the BMC during the boot. The Terminus Locator PDR forms the association between a TID and PLDM Terminus Handle for a terminus. This patch allows to add terminus locator record in the repository. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Encode PLDM PDR Repository Change eventDataChristophe Lombard1-0/+124
Encode the platform PDR repository change event message request that tells the BMC that a specific PDR entry has changed. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Find PDR record by record handleChristophe Lombard2-0/+29
Add a wrapper for the libpldm api: pldm_pdr_find_record() Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Decode the SetStateEffecterStates requestChristophe Lombard1-0/+117
The SetStateEffecterStates command is used to set the state of one or more effecters within a PLDM State Effecter. The field comp_effecter_count indicates the number of individual sets of state effecter information that are accessed by this command. The Event Receiver acknowledges receiving the PLDM Event Message in the response to this command. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Decode the GetStateSensorReadings requestChristophe Lombard1-0/+84
The GetStateSensorReadings command can return readings for multiple state sensors (a PLDM State Sensor that returns more than one set of state information is called a composite state sensor). The Event Receiver acknowledges receiving the PLDM Event Message in the response to this command. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Decode the PlatformEventMessage requestChristophe Lombard3-1/+123
PLDM Event Messages are sent as PLDM request messages to the Event Receiver using the PlatformEventMessage command. The Event Receiver acknowledges receiving the PLDM Event Message in the response to this command. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Decode the SetEventReceiver requestChristophe Lombard2-0/+92
The SetEventReceiver command is used to set the address of the Event Receiver into a terminus that generates event messages. It is also used to globally enable or disable whether event messages are generated from the terminus. For the time being, only the following global event message is supported: PLDM_EVENT_MESSAGE_GLOBAL_ENABLE_ASYNC_KEEP_ALIVE. The Event Receiver acknowledges receiving the PLDM Event Message in the response to this command. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>