| e634411b | 26-Nov-2025 |
Henry Wu <Henry_Wu@quantatw.com> |
common: add GPIO controller function
The CPLD update process requires toggling a GPIO pin to control the debug card mux. BIOS and EEPROM updates use the same logic, so refactor the duplicated code i
common: add GPIO controller function
The CPLD update process requires toggling a GPIO pin to control the debug card mux. BIOS and EEPROM updates use the same logic, so refactor the duplicated code into a common GPIO controller function. Update BIOS, EEPROM, and CPLD code paths to use the new helper.
Tested: - Verified CPLD update with GPIO mux toggling - Verified BIOS update with GPIO mux toggling
Verified CPLD update with GPIO mux toggling ``` Dec 18 18:33:35 bmc phosphor-cpld-software-update[1064]: Requesting chip gpiochip0, GPIO line debug-card-mux to 1 Dec 18 18:33:35 bmc phosphor-cpld-software-update[1064]: Updating Lattice CPLD firmware Dec 18 18:33:45 bmc phosphor-cpld-software-update[1064]: [48K blob data] Dec 18 18:34:14 bmc phosphor-cpld-software-update[1064]: [48K blob data] Dec 18 18:34:31 bmc phosphor-cpld-software-update[1064]: Successfully updated CPLD Dec 18 18:34:31 bmc phosphor-cpld-software-update[1064]: Requesting chip gpiochip0, GPIO line debug-card-mux to 0 ```
Verified BIOS update with GPIO mux toggling ``` Dec 18 18:45:53 bmc phosphor-bios-software-update[1063]: Requesting chip gpiochip0, GPIO line FM_MUX1_SEL_R to 1 Dec 18 18:46:24 bmc phosphor-bios-software-update[2158]: [14.8K blob data] Dec 18 18:46:30 bmc phosphor-bios-software-update[2158]: [47.9K blob data] Dec 18 18:46:37 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:46:44 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:46:51 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:46:58 bmc phosphor-bios-software-update[2158]: [47.9K blob data] Dec 18 18:46:58 bmc phosphor-bios-software-update[2158]: [4.5K blob data] Dec 18 18:47:01 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:47:04 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:47:07 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:47:10 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:47:13 bmc phosphor-bios-software-update[2158]: [48K blob data] Dec 18 18:47:15 bmc phosphor-bios-software-update[2158]: [20.5K blob data] Dec 18 18:47:17 bmc phosphor-bios-software-update[1063]: Successfully updated SPI flash Dec 18 18:47:17 bmc phosphor-bios-software-update[1063]: Requesting chip gpiochip0, GPIO line FM_MUX1_SEL_R to 0 ```
Change-Id: I8d3c128951fd833a0cd25e1440236f82d37b776f Signed-off-by: Henry Wu <Henry_Wu@quantatw.com>
show more ...
|
| 2e168dba | 08-Sep-2025 |
Daniel Hsu <Daniel-Hsu@quantatw.com> |
All: add purpose parameter to setVersion calls
All calls to setVersion now include a purpose argument, changing the purpose string from "unknown" to "other".
Change-Id: I201db1719333b51deead2dd99c9
All: add purpose parameter to setVersion calls
All calls to setVersion now include a purpose argument, changing the purpose string from "unknown" to "other".
Change-Id: I201db1719333b51deead2dd99c9f637c782efd6c Signed-off-by: Daniel Hsu <Daniel-Hsu@quantatw.com>
show more ...
|
| 5afc9aa0 | 08-Jul-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: simplify systemd dependency
Reduce duplication of the systemd dependency and name the dependency `systemd_dep` to follow meson conventions.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz
meson: simplify systemd dependency
Reduce duplication of the systemd dependency and name the dependency `systemd_dep` to follow meson conventions.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ibf1b6ead42f51611b2b2ae9eca5421de079c53c8
show more ...
|
| a7bf31b4 | 08-Jul-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: fix gpiod dependency
gpiod is not a "common" dependency, but only needed for specific options. Add it as a dependency only when necessary.
Name the dependency as `libgpiod_dep` to follow me
meson: fix gpiod dependency
gpiod is not a "common" dependency, but only needed for specific options. Add it as a dependency only when necessary.
Name the dependency as `libgpiod_dep` to follow meson conventions.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib650f5fe4e7085733f43eba608502e7e21a5c8db
show more ...
|
| 9ce83ded | 09-Jul-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: use non-deprecated systemd packageconfig
Systemd's packageconfig file has both `systemdsystemunitdir` and `systemd_system_unit_dir` defined. The non-underscore one appears to be a deprecated
meson: use non-deprecated systemd packageconfig
Systemd's packageconfig file has both `systemdsystemunitdir` and `systemd_system_unit_dir` defined. The non-underscore one appears to be a deprecated alias[1]. Move to the non-deprecated / underscore-separated variant.
[1]: https://github.com/systemd/systemd/commit/4908de44b0a0409f84a7cdc5641b114d6ce8ba03
Change-Id: I0ae94b17ccfe82c1fbc3e4e0602b0a6ecd21762d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| a2eb951f | 05-May-2025 |
Kevin Tung <Kevin.Tung@quantatw.com> |
common: move asyncSystem() to common
asyncSystem() is shared across updaters, so moved to common.
Change-Id: I3545d34ecc1f1bf8a226d020267ae00bcf42c5f9 Signed-off-by: Kevin Tung <Kevin.Tung@quantatw
common: move asyncSystem() to common
asyncSystem() is shared across updaters, so moved to common.
Change-Id: I3545d34ecc1f1bf8a226d020267ae00bcf42c5f9 Signed-off-by: Kevin Tung <Kevin.Tung@quantatw.com>
show more ...
|
| bd5081f0 | 04-Jun-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
clang-tidy: remove some NOLINTS
Since readability-static-accessed-through-instance check has been disabled in [1], the NOLINTs can be removed.
References:
[1] https://gerrit.openbmc.org/c/openbmc/
clang-tidy: remove some NOLINTS
Since readability-static-accessed-through-instance check has been disabled in [1], the NOLINTs can be removed.
References:
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-bmc-code-mgmt/+/80392
Change-Id: If7e80a0bc447bfbd054b6c007d230c2d14a54f41 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
| a2f860be | 12-Jun-2025 |
Patrick Williams <patrick@stwcx.xyz> |
markdownlint: minor fixes
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I12126b088b4c713357416bd50e7883d9fe0786df |
| 5db0c6be | 30-May-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: support for tool: flashcp
flashcp as an alternative to flashrom which is already present in some images.
Tested: On Tyan S8030
Set ``` "Tool": "flashcp" ``` in the EM json config.
Using t
bios: support for tool: flashcp
flashcp as an alternative to flashrom which is already present in some images.
Tested: On Tyan S8030
Set ``` "Tool": "flashcp" ``` in the EM json config.
Using the images from [1], update to v4.01 and v4.03, dump the flash contents and compare md5sum output for both the image and flash dumps after each update.
``` [alex@odroid host-fw]$ md5sum v4.01/8030V401.ROM fbbe6ff9b05b6a21f43d58fb0e5108cd v4.01/8030V401.ROM [alex@odroid host-fw]$ md5sum v4.03/8030V403.ROM 8a0f85d559913ea63b40cd467cc65cd3 v4.03/8030V403.ROM ``` on the bmc: ``` root@s8030-bmc-30303035c0c1:~# md5sum /tmp/mtd6_dump_v4.01.bin fbbe6ff9b05b6a21f43d58fb0e5108cd /tmp/mtd6_dump_v4.01.bin root@s8030-bmc-30303035c0c1:~# md5sum /tmp/mtd6_dump_v4.03.bin 8a0f85d559913ea63b40cd467cc65cd3 /tmp/mtd6_dump_v4.03.bin ```
References: [1] https://www.tyan.com/Motherboards=S8030=S8030GM2NE=downloads=EN/_Motherboards_S8030_S8030GM2NE
Change-Id: I95b473a5e90da38da866f982946855bb9452aafd Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| 7fbe7d82 | 28-May-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: enable configure flashrom tool
Since flashrom can handle cases which the flat write is unable to do, allow for flashrom to be configured as the tool for writing.
Tested: image is written as e
bios: enable configure flashrom tool
Since flashrom can handle cases which the flat write is unable to do, allow for flashrom to be configured as the tool for writing.
Tested: image is written as expected
``` May 28 15:29:23 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: flashrom v1.2.1 on Linux 6.6.86-c94132b-dirty-875bc16-00427-g875bc16d66f8 (armv6l) May 28 15:29:23 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: flashrom is free software, get the source code at https://flashrom.org May 28 15:29:23 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). May 28 15:29:23 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: Opened /dev/mtd6 successfully May 28 15:29:23 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: Found Programmer flash chip "Opaque flash chip" (32768 kB, Programmer-specific) on linux_mtd. May 28 15:29:22 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20341]: [flashrom] running flashrom -p linux_mtd:dev=6 -w /tmp/spi-device-image-9551.bin May 28 15:29:46 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: Reading old flash chip contents... done. May 28 15:33:42 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: Erasing and writing flash chip... Erase/write done. May 28 15:35:08 s8030-bmc-30303035c0c1 phosphor-bios-software-update[20409]: Verifying flash... VERIFIED.
root@s8030-bmc-30303035c0c1:~# cmp -l /tmp/mtd6_dump.bin /tmp/8030V401.ROM root@s8030-bmc-30303035c0c1:~# echo $? 0 ```
Change-Id: I16c561231c2fa040d951c78dd0a76c28560c98d8 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| db0e88cc | 28-May-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: fix log message for gpio mux
Since the function does not know which side the mux will take, the log message can be generic.
Change-Id: I31e96fd230bc13967252a8344a42f0b341076a9d Signed-off-by:
bios: fix log message for gpio mux
Since the function does not know which side the mux will take, the log message can be generic.
Change-Id: I31e96fd230bc13967252a8344a42f0b341076a9d Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| a62ebc9f | 28-May-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: README: update example to align with EM
Drop property 'hasME' which is unsupported and not in EM schema. Drop property 'Tool' from the example which is not in EM schema.
Align the mux gpio no
bios: README: update example to align with EM
Drop property 'hasME' which is unsupported and not in EM schema. Drop property 'Tool' from the example which is not in EM schema.
Align the mux gpio notation with the EM schema.
Change-Id: Ibfac9e2356cd8e59f8981ddf07aebca5d55c48e4 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| ac4fdd05 | 20-May-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: fix driver binding order
spi-aspeed-smc driver was bound but spi-nor driver was not bound which created problems for systems with more than one spi device on the bus.
Update the code to bind
bios: fix driver binding order
spi-aspeed-smc driver was bound but spi-nor driver was not bound which created problems for systems with more than one spi device on the bus.
Update the code to bind spi-nor driver as well for the desired device and not unbind spi-aspeed-smc driver at the end since other spi devices may still be in use on that bus.
Tested: bios update proceeds normally
Config which was used:
``` { "FirmwareInfo": { "CompatibleHardware": "com.tyan.Hardware.S8030.SPI.Host", "VendorIANA": 6653 }, "MuxOutputs": [ { "Name": "BMC_SPI_SEL", "Polarity": "High" } ], "Name": "HostSPIFlash", "SPIControllerIndex": 1, "SPIDeviceIndex": 0, "Type": "SPIFlash", } ```
SPI controller driver says bound throughout the update process
``` root@s8030-bmc-30303035c0c1:/sys/bus/platform# ls /sys/bus/platform/drivers/spi-aspeed-smc/ 1e620000.spi 1e630000.spi bind uevent unbind ```
and SPI flash driver (spi-nor) is bound and then unbound after the update process.
``` root@s8030-bmc-30303035c0c1:/sys/bus/platform# ls /sys/bus/spi/drivers/spi-nor/ bind spi0.0 spi1.0 uevent unbind root@s8030-bmc-30303035c0c1:/sys/bus/platform# ls /sys/bus/spi/drivers/spi-nor/ bind spi0.0 uevent unbind ```
Change-Id: I874670f9fd27f6642359ea078e6e9db4c1b9e249 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| dfb60670 | 07-May-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: find SPI address dynamically
In case of multiple SPI chips on an SPI bus, the address of the SPI controller does not map directly to the SPI device index.
Query sysfs to find the mapping and
bios: find SPI address dynamically
In case of multiple SPI chips on an SPI bus, the address of the SPI controller does not map directly to the SPI device index.
Query sysfs to find the mapping and probe the driver correctly.
Change-Id: I951ff2540aa2ea27150adcc7c5aea47bd221bca1 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| fc4a9741 | 10-Apr-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: better error messages for fetching config
Tested: In case of a missing property, it is clearly shown what is missing.
Change-Id: I1e5ec34ed93e979105a08a451ce22890f0791918 Signed-off-by: Alexa
bios: better error messages for fetching config
Tested: In case of a missing property, it is clearly shown what is missing.
Change-Id: I1e5ec34ed93e979105a08a451ce22890f0791918 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| 0ac64787 | 29-Apr-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
fw update: bios: fix service file
Set Type=dbus and dbus name.
Change-Id: Ic40bfc34fc3f137da0768fdd0fdd6be6e172312a Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> |
| 43c14091 | 19-Apr-2025 |
Patrick Williams <patrick@stwcx.xyz> |
phosphor-bios-software-update: move to libexec
Non-user executables are suppose to be installed into libexec[1].
[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#incorrect-placemen
phosphor-bios-software-update: move to libexec
Non-user executables are suppose to be installed into libexec[1].
[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#incorrect-placement-of-executables-in-sbin-usrsbin-or-bin-usrbin
Tested:
``` $ meson install -C builddir --destdir /tmp/phosphor-bmc-code-mgmt $ find /tmp/phosphor-bmc-code-mgmt/ -name phosphor-bios-software-update /tmp/phosphor-bmc-code-mgmt/usr/local/libexec/phosphor-bmc-code-mgmt/phosphor-bios-software-update ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib0b6da9218dc0ebd67077c8cf0e5e8bb6b64d11b
show more ...
|
| b4dfd140 | 08-Apr-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
bios: fix systemd service file
Restart=always
The current configuration is invalid [1].
References: [1] https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html
Change-Id: I31
bios: fix systemd service file
Restart=always
The current configuration is invalid [1].
References: [1] https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html
Change-Id: I311282d72bbe1db206bc672feab2d873f706f8c3 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| f2c95a08 | 26-Nov-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
SPI device code updater
This code updater is for updating spi flash devices. It can for example update the host firmware on different server boards and has following features:
- power down the host
SPI device code updater
This code updater is for updating spi flash devices. It can for example update the host firmware on different server boards and has following features:
- power down the host before update - set mux gpios to access spi flash - (very limited) communication with ME (Management Engine) - use flashrom to utilize fw with IFD (Intel Flash Descriptor) - otherwise directly write to the flash chip.
The behavior of this code updater can be configured via EM.
Tested: on Tyan S8030 and Tyan S5549 Board. Steps below.
1. Display the fw inventory
``` curl --silent $creds https://$bmc/redfish/v1/UpdateService/FirmwareInventory ```
``` { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory", "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", "Members": [ { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/717f6f4d" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_4950" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios_active" } ], "Members@odata.count": 3, "Name": "Software Inventory Collection" } ```
2. Query BIOS version. The version is "unknown" here since currently there is no interface enabled via which to query it.
``` curl $creds https://$bmc/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_4950 ```
``` { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_4950", "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "Unknown image", "Id": "HostSPIFlash_4950", "Name": "Software Inventory", "Status": { "Health": "Warning", "HealthRollup": "OK", "State": "Disabled" }, "Updateable": true, "Version": "unknown" } ```
3. Trigger the fw update via redfish.
``` curl -k ${creds} \ -H "Content-Type:multipart/form-data" \ -X POST \ -F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_6041\"],\"@Redfish.OperationApplyTime\":\"Immediate\"};type=application/json" \ -F "UpdateFile=@${fwpath};type=application/octet-stream" \ https://${bmc}/redfish/v1/UpdateService/update ```
4. Task is returned
``` { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" } ```
5. Query Task status ``` curl --silent $creds https://$bmc/redfish/v1/TaskService/Tasks/0 ```
``` { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "EndTime": "2025-02-18T14:05:46+00:00", "HidePayload": false, "Id": "0", "Messages": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '0' has started.", "MessageArgs": [ "0" ], "MessageId": "TaskEvent.1.0.TaskStarted", "MessageSeverity": "OK", "Resolution": "None." }, { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '0' has changed to progress 10 percent complete.", "MessageArgs": [ "0", "10" ], "MessageId": "TaskEvent.1.0.TaskProgressChanged", "MessageSeverity": "OK", "Resolution": "None." }, { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '0' has changed to progress 20 percent complete.", "MessageArgs": [ "0", "20" ], "MessageId": "TaskEvent.1.0.TaskProgressChanged", "MessageSeverity": "OK", "Resolution": "None." }, { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '0' has changed to progress 70 percent complete.", "MessageArgs": [ "0", "70" ], "MessageId": "TaskEvent.1.0.TaskProgressChanged", "MessageSeverity": "OK", "Resolution": "None." }, { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '0' has changed to progress 100 percent complete.", "MessageArgs": [ "0", "100" ], "MessageId": "TaskEvent.1.0.TaskProgressChanged", "MessageSeverity": "OK", "Resolution": "None." }, { "@odata.type": "#Message.v1_1_1.Message", "Message": "The task with Id '0' has completed.", "MessageArgs": [ "0" ], "MessageId": "TaskEvent.1.0.TaskCompletedOK", "MessageSeverity": "OK", "Resolution": "None." } ], "Name": "Task 0", "Payload": { "HttpHeaders": [], "HttpOperation": "POST", "JsonBody": "null", "TargetUri": "/redfish/v1/UpdateService/update" }, "PercentComplete": 90, "StartTime": "2025-02-18T14:04:47+00:00", "TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/0", "TaskState": "Completed", "TaskStatus": "OK" } ```
6. Display the fw inventory with newly updated fw. ``` curl --silent $creds https://$bmc/redfish/v1/UpdateService/FirmwareInventory ```
``` { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory", "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", "Members": [ { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/717f6f4d" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_8728" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/bios_active" } ], "Members@odata.count": 3, "Name": "Software Inventory Collection" } ```
7. Query the new fw version.
The version is 'mycompversion' since that's what has been set in the pldm fw update package for testing.
``` curl $creds https://$bmc/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_8728 ```
``` { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_8728", "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "Unknown image", "Id": "HostSPIFlash_8728", "Name": "Software Inventory", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "Updateable": false, "Version": "mycompversion" } ```
Change-Id: I27803b7fded71af2364c2f55fad841a410603dec Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|