commit | 994a77ff25aeb28b2cce7142d081af767f9eb542 | [log] [tgz] |
---|---|---|
author | Kevin Tung <Kevin.Tung@quantatw.com> | Mon Dec 23 17:48:56 2024 +0800 |
committer | Kevin Tung <Kevin.Tung@quantatw.com> | Mon May 05 09:13:58 2025 +0800 |
tree | d2d65c0722293b744e6d2c7c9d6f773bfb464ed7 | |
parent | 887bd3d67af38e53f7dd1265e22310079a9fde9a [diff] |
eeprom device code updater This commit introduces a code updater for EEPROM-based devices, such as Retimer connected to an EEPROM. Key features include: - Configuring MUX GPIOs to switch EEPROM access to the BMC - Writing firmware directly to the EEPROM flash memory The behavior and configuration of this updater are managed via EM, enabling flexibility and adaptability across different hardware setups. https://gerrit.openbmc.org/c/openbmc/entity-manager/+/77198 Tested on Harma: 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/MB_Retimer_9355" }, {...} ], "Members@odata.count": 26, "Name": "Software Inventory Collection" } ``` 2. Query Retimer version. ``` curl $creds https://$bmc/redfish/v1/UpdateService/FirmwareInventory/MB_Retimer_9355 ``` ``` { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/MB_Retimer_9355", "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "Unknown image", "Id": "MB_Retimer_9355", "Name": "Software Inventory", "Status": { "Health": "Warning", "HealthRollup": "OK", "State": "Disabled" }, "Updateable": false, "Version": "1.31.23" } ``` 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/MB_Retimer_9355\"],\"@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-04-17T08:35:58+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 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 40 percent complete.", "MessageArgs": [ "0", "40" ], "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 60 percent complete.", "MessageArgs": [ "0", "60" ], "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 80 percent complete.", "MessageArgs": [ "0", "80" ], "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": 100, "StartTime": "2025-04-17T08:35:12+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/MB_Retimer_5686" }, {...} ], "Members@odata.count": 26, "Name": "Software Inventory Collection" } ``` 7. Query the new fw version. ``` curl $creds https://$bmc/redfish/v1/UpdateService/FirmwareInventory/MB_Retimer_5686 ``` ``` { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/MB_Retimer_5686", "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "Unknown image", "Id": "MB_Retimer_5686", "Name": "Software Inventory", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "Updateable": false, "Version": "2.8.19" } ``` Change-Id: Ic09f9289fa16d5df738e792348c0c817a15cb808 Signed-off-by: Kevin Tung <Kevin.Tung@quantatw.com>
Phosphor BMC Code Management provides a set of system software management applications. More information can be found at Software Architecture
To build this package, do the following steps:
meson build
ninja -C build
To clean the repository run rm -r build
.