aboutsummaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)AuthorFilesLines
2025-04-18ipmi: Return error from ipmi_queue_msg_syncNicholas Piggin1-3/+5
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-04-18core/timers: Try to process all poll timersNicholas Piggin1-8/+12
Poll timers are not delay based and have no kind of ordering, so processing does not have to stop if a busy timer is encountered. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-04-18core/timers: Fix running-timer delayNicholas Piggin1-11/+10
When timer run code encounters an alreay-running timer, it has to stop processing and run them later. In the case of poll timers the SBE timer is scheduled for a minimum-delay, and for delay timers nothing is done. This looks backwards: poll timers do not get called from the SBE interrupt so that delay is pointless, whereas it is helpful for delay timers to ensure they're processed again soon. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-04-18cpu: Do not access xscom registers for guarded CPUsNicholas Piggin1-1/+1
Guarded CPUs are powered down so access to their PC xscom registers fails. This prevents the failed attempt and accompanying warnings. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-04-02gcov: Don't print 0x with %pReza Arbab1-1/+1
Remove the extra 0x from this message: [ 0.042561024,5] GCOV: gcov_info_list at 0x0x30481280 Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-04-02flash: Handle nullptr dereference of system_flashAditya Gupta1-1/+10
With QEMU with NO support for MPIPL, 'p9_sbe_terminate' returns early at: /* Return if MPIPL is not supported */ if (!is_mpipl_enabled()) return; But with MPIPL supported in QEMU, 'p9_sbe_terminate' continues further and calls 'flash_unregister' which causes a Machine Check due to nullptr dereference of 'system_flash': [ 13.240783728,5] Reboot: OS reported error. Performing MPIPL [ 13.241662601,5] DUMP: Crashing PIR = 0x0 [ 13.244049276,5] RESET: Fast reboot disabled: Kernel re-entered OPAL [ 1.815018] Disabling lock debugging due to kernel taint [ 1.815518] MCE: CPU0: machine check (Severe) Real address Load (bad) DAR: 0000006000000098 [Not recovered] [ 1.815544] MCE: CPU0: NIP: [0000000030040f54] 0x30040f54 [ 1.815911] MCE: CPU0: Initiator CPU [ 1.815930] MCE: CPU0: Hardware error [ 1.816110] opal: Hardware platform error: Unrecoverable Machine Check exception [ 1.816338] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Tainted: G M 6.12.0-rc4+ #1 [ 1.816531] Tainted: [M]=MACHINE_CHECK [ 1.816546] Hardware name: IBM PowerNV (emulated by qemu) POWER10 0x801200 opal:v7.1 PowerNV [ 1.816629] NIP: 0000000030040f54 LR: 000000003007e528 CTR: 000000003004d75c [ 1.816646] REGS: c0000004d5e47d60 TRAP: 0200 Tainted: G M (6.12.0-rc4+) [ 1.816684] MSR: 9000000002a03002 <SF,HV,VEC,VSX,FP,ME,RI> CR: 28002284 XER: 00000000 [ 1.816863] CFAR: 000000003007e524 DAR: 0000006000000098 DSISR: 00000040 IRQMASK: 3 [ 1.816863] GPR00: 000000003007e528 0000000031c13ac0 0000000030192900 0000006000000060 [ 1.816863] GPR04: 0000000030500028 000000000000000a 0000000031c10068 0000000031c10068 [ 1.816863] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 1.816863] GPR12: 0000000028002284 c000000002e80000 c00000000001192c 0000000000000000 [ 1.816863] GPR16: 0000000031c10000 0000000000000000 0000000000000000 0000000000000000 [ 1.816863] GPR20: 0000000000000003 0000000000000074 0000000000000000 0000000000000000 [ 1.816863] GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 1.816863] GPR28: c000000002d0e8c8 00000000301257de c000000002d0e8c8 000000000000000c [ 1.817061] NIP [0000000030040f54] 0x30040f54 [ 1.817074] LR [000000003007e528] 0x3007e528 [ 1.817165] Call Trace: [ 1.817337] Code: 00000060 80002138 e01d0d48 00000000 01000000 00000180 a602087c 3700223d 602e29e9 100001f8 91ff21f8 180069e8 <380023e9> 0000292c 34008241 280041f8 [ 13.247702490,0] OPAL: Reboot requested due to Platform error. [ 13.247857686,3] OPAL: failed to log an error [ 13.248012502,2] NVRAM: Failed to load Previously above machine check was never hit as QEMU platform didn't had MPIPL, and hence the caller 'p9_sbe_terminate' used to return early. Add null check to ignore the unregister request if system_flash is not set. Signed-off-by: Aditya Gupta <adityag@linux.ibm.com> Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-03-07platform: Identify correct bmc platform based on bmc hw versionMahesh Salgaonkar1-1/+13
At the moment the generic platform sets bmc_generic() as bmc platform which does not have any support to initialize the flash and hence it fails to load petitboot kernel. [ 583.105000325,4] FLASH: Failed to load VERSION data [ 583.105490257,5] INIT: Waiting for kernel... [ 583.105523156,5] INIT: platform wait for kernel load failed [ 583.105555219,5] INIT: Assuming kernel at 0x20000000 [ 583.105589925,3] INIT: ELF header not found. Assuming raw binary. [...] [ 583.299682673,5] INIT: Starting kernel at 0x20000000, fdt at 0x30a44eb0 1274673 bytes [ 583.344432417,3] *********************************************** [ 583.344490230,3] Fatal Exception 0x800 at 0000000020000000 MSR 9000000000000000 [ 583.344535875,3] CFAR : 0000000030022948 MSR : 9000000000000000 [ 583.344578019,3] SRR0 : 0000000020000000 SRR1 : 9000000000000000 [ 583.344620242,3] HSRR0: 0000000020000000 HSRR1: 9000000000000000 OPAL builds the device tree for BMC based system using HDAT. It populates bmc/compatible node with bmc hw version e.g. "ibm,ast2600,openbmc". Use that to identify proper BMC hw board and initialize BMC platform with proper backend. This allows opal to successfully load and boot into petitboot kernel. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-03-07plat/qemu: add support for Power11 platformAditya Gupta1-2/+3
Add support for QEMU simulator for Power11 when it starts supporting "qemu,powernv11" machines. Signed-off-by: Aditya Gupta <adityag@linux.ibm.com> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-03-07cpufeatures: Add Power11 supportMahesh Salgaonkar1-27/+35
Update the cpu_feature structure to support Power11. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-03-07Initial Power11 enablementMahesh Salgaonkar8-27/+47
Detect Power11 PVR and use P10 code path. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> [adityag: Add Power11 chiptod device node] [adityag: Fix the proc_gen checks in pir_to_thread_id and bmc sensor] Signed-off-by: Aditya Gupta <adityag@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-24hw/sbe-p9: Change SBE lagging detectionNicholas Piggin3-3/+8
Disabling the SBE timer entirely is counter-productive: the SBE interrupt can be delayed for a number of reasons including booting or OS bugs, and there is no other timer to replace it. If the SBE timer is detected to be lagging, increase polling rate until it fires but keep it running. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-15core/timer: Always update hardware timerNicholas Piggin1-8/+37
Have the core timer code always call into the SBE timers with the soonest time, so the SBE code can be more careful with maintaining the hardware timer. This fixes a bug where the SBE timer is not being set immediately on schedule_timer. With a subsequent change to SBE code, it allows an SBE timer that fires too early to cause a re-schedule of the SBE timer. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2025-01-15hw/sbe: Add SBE quirk for mambo and awanNicholas Piggin1-2/+2
There appears to be no device-tree test for the P9 SBE presence like there is for P8. The P9 device tree test looks for the "primary" property, but this doesn't really test SBE presence because all chips have an SBE. It just happens to work because mambo must not add that property. So add a platform quirk, and mark mambo and awan as not having SBE. This is needed for a later change that runs a health check on every SBE in the system. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [arbab: Add #include <chip.h>] 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-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-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>
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>
2023-11-27hw/imc: Detect BML and fix core countersRyan Grimm1-0/+4
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-09-15core/device: Add function to return child node using name at substring "@"Athira Rajeev2-0/+36
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-12platforms/astbmc: Enable PLDM supportChristophe Lombard1-1/+15
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 Lombard2-1/+299
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 Lombard2-1/+261
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 Lombard2-0/+268
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>
2023-09-12core/pldm: Handle Watchdog timer.Christophe Lombard2-0/+143
Encode a PLDM platform event message to send the heartbeat to the BMC. Watchdog is "armed" when a PLDM_EVENT_MESSAGE_GLOBAL_ENABLE_ASYNC_KEEP_ALIVE is received. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Register PLDM as a blocklevel deviceChristophe Lombard1-0/+247
In the same way that ipmi-hiomap implements the PNOR access control protocol, this patch allows to "virtualize" the content of a BMC flash based on lid files. Previously, flash PNOR partitions were viewed this way: partitionXX=NAME, start address, end address, flags The content of each partition is now stored in a lid file. In order to continue to use the libflash library, we manually fill in the contents of a fake flash header when accessing offset 0. This reproduces the behavior via ipmi-hiomap of reading the flash header on the BMC. For the reading and writing of BMC lids files, we convert the virtual addresses of these 'fake' partitions by identifying: lid id. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Lid ids string parsingChristophe Lombard2-1/+187
This patch parses the "hb_lid_ids" string from bios tables and complete the global list of lid files. Each entry in the list contains the name, the id, the length of the lid file and the virtual address start access. This virtual address is used for for PNOR Resource Provider operations. 16 MB of VMM address are reserved space per section. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Get file handle and file lengthChristophe Lombard2-0/+79
Retrieve the file handle and file length based on attribute name. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Add file io write requestChristophe Lombard2-0/+128
Send/receive a PLDM WriteFile request message. Due to maximum transfer size for PLDM protocol, we have to send several write requests, if necessary. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Add file io read requestChristophe Lombard2-0/+136
Send/receive a PLDM ReadFile request message. Due to maximum transfer size for PLDM protocol, we have to send several read requests, if necessary. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: PLDM for File-IO operationsChristophe Lombard4-1/+162
The ibm/libpldm library implements IBM OEM commands support for PLDM and specially encode and decode APIs for in-band readFile and writeFile commands. The GetFileTable request message is used to retrieve the file table which contains the list of lid files available and their attributes. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Update "bmc-firmware-version" device-tree fieldChristophe Lombard2-0/+86
Use the GetFruRecordByOptionReq command to retrieve the bmc information with: "FRU Field Type": Version "FRU Record Set Identifier": 1, "FRU Record Type": "General(1)" and update the "bmc-firmware-version" device-tree field. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: PLDM for FRU data SpecificationChristophe Lombard4-2/+153
Specification, defines a FRU data format that provides platform asset information including part number, serial number and manufacturer. Use the GetFruRecordByOptionReq command to get specific FRU (Field Replaceable Unit) record according the Record Set Identifier, the Record Type and the field Type. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Find lid attribute from bios tablesChristophe Lombard2-0/+151
This specification defines the data structures and messages for communicating BIOS settings, BIOS attributes, boot configurations, and boot order settings. Use the GetBIOSTable command to get STRING, Attribute and Attribute values tables from the BIOS. The contents of these tables are needed to read/write the desired lid files located on the BMC. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: PLDM for BIOS Control and Configuration SpecificationChristophe Lombard4-1/+228
This specification defines the data structures and messages for communicating BIOS settings, BIOS attributes, boot configurations, and boot order settings. Use the GetBIOSTable command to get STRING, Attribute and Attribute values tables from the BIOS. The content of these tables is useful to read/write the lid files located on the BMC. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Send a system chassis Off-Soft Graceful requestChristophe Lombard1-0/+32
Set the state information of the PLDM effecter identified by: the entity type (PLDM_ENTITY_SYSTEM_CHASSIS) and the state set PLDM_STATE_SET_SYSTEM_POWER_STATE with the effecter state: PLDM_STATE_SET_SYS_POWER_STATE_OFF_SOFT_GRACEFUL to request a platform off. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Send a system firmware Graceful Restart requestChristophe Lombard1-0/+77
Set the state information of the PLDM effecter identified by: the entity type (PLDM_ENTITY_SYS_FIRMWARE) and the state set PLDM_STATE_SET_SW_TERMINATION_STATUS with the effecter state: PLDM_SW_TERM_GRACEFUL_RESTART_REQUESTED to request a platform restart. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: Encode state effecter requestChristophe Lombard1-0/+82
PLDM effecters provide a general mechanism for controlling or configuring a state or numeric setting of an entity. The entity state and numeric setting values are written into an effecter. PLDM commands are specified for writing the state or numeric setting to an effecter. Effecters are identified by and accessed using an EffecterID that is unique for each effecter within a given terminus. PLDM State Effecters provide a regular command structure for setting state information in order to change the state of an entity. The SetStateEffecterStates command is used to set the state of one or more effecters within a PLDM State Effecter. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2023-09-12core/pldm: PLDM for Platform Monitoring and Control SpecificationChristophe Lombard5-1/+402
This specification defines the functions and data structures used for discovering, describing, initializing, and accessing sensors and effecters within the management controllers and management devices of a platform management subsystem using PLDM messaging. A PDR (Platform Descriptor Record) is a set of data that is used to provide semantic information about sensors, effecters, monitored or controller entities, and functions and services within a PLDM implementation. PDRs are mostly used to support PLDM monitoring and control and platform events. The PDRs for a PLDM subsystem are collected into a single, central PDR Repository. A central repository provides a single place from which PDR information can be retrieved. 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. The patch dump all the PDRs within a PDR Repository. Reviewed-by: Abhishek Singh Tomar <abhishek@linux.ibm.com> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>