History log of /openbmc/phosphor-bmc-code-mgmt/i2c-vr/i2cvr_device.cpp (Results 1 – 4 of 4)
Revision Date Author Comments
# ee551174 22-Aug-2025 Kevin Tung <kevin.tung@quantatw.com>

i2cvr: restrict apply time to OnReset

Applying VR firmware updates with Immediate ApplyTime may trigger
power fluctuations in a running system and lead to unstable or
abnormal behavior. To ensure sa

i2cvr: restrict apply time to OnReset

Applying VR firmware updates with Immediate ApplyTime may trigger
power fluctuations in a running system and lead to unstable or
abnormal behavior. To ensure safe updates, the ApplyTime for VR
devices is restricted to OnReset. This guarantees updates occur
only during a system reset, when power rails are stable.

Change-Id: If7e4bc5d8fb5bb187b3baacd9e6f782f41738bcd
Signed-off-by: Kevin Tung <kevin.tung.openbmc@gmail.com>

show more ...


# fd34144b 16-Jun-2025 Christopher Meis <christopher.meis@9elements.com>

i2c-vr/xdpe1x2xx: General improvements and debugs

General improvements:
- Change const to constexpr for all kind of constants
- Add more product ids for the XDPE192XX
- Add info struct with device s

i2c-vr/xdpe1x2xx: General improvements and debugs

General improvements:
- Change const to constexpr for all kind of constants
- Add more product ids for the XDPE192XX
- Add info struct with device specific information.
- Add GetHWAddress function to get scratchpad address dynamically
- Add debug statements in multiple locations
- Add pcTime (process time) to mfrFWcmd functions parameter list\
- Add constants for different process times
- Change wait calls to milliseconds from microseconds
- Change co_return value types. Code had leftovers integer values, but
function returned bool already

Fix:
- Add missing bracket in `DataStartTag`

Tested locally with [81278]:
```
./xdpe1x2xx-manual-update vr_firmware.mic
CRC sum: 44b858d2
<7> configuration.sumExp = 0xffb60363
27Z 0xFFB60363/XV0 Config
0000000sing: //XV0 PMBus LoopA User
50505055ing: //XV0 PMBus LoopB User
07> Parsing: //XV0 FW SVI3 LoopA
07> Parsing: //XV0 FW SVI3 LoopB
00000000ing: [End Configuration Data]
<7> Value CRC: 2799942320
<7> Value CRC: 3852089771
<7> Value CRC: 4027591577
<7> Value CRC: 925496414
<7> Value CRC: 3114726333
<7> Scratchpad Address: 0x2005e000
<7> CRC before programming: 0x44b858d2
<7> CRC of configuration: 0xffb60363
<7> VR Device ID: 0x95
<7> VR Device Rev: 0x1
<7> Remaining write cycles of VR: 16
<7> Invalidate current Configuration
<7> Programming section: 0
<7> Section Type: 0x4
<7> Invalidating section type: 4
<7> Setting scratchpad address: 537255936
<7> Upload from scratch pad to OTP with soak time: 1600ms
<7> Programming section: 1
<7> Section Type: 0x7
<7> Invalidating section type: 7
<7> Setting scratchpad address: 537255936
<7> Upload from scratch pad to OTP with soak time: 700ms
<7> Programming section: 2
<7> Section Type: 0x9
<7> Invalidating section type: 9
<7> Setting scratchpad address: 537255936
<7> Upload from scratch pad to OTP with soak time: 700ms
<7> Programming section: 3
<7> Section Type: 0xd
<7> Invalidating section type: 13
<7> Setting scratchpad address: 537255936
<7> Upload from scratch pad to OTP with soak time: 300ms
<7> Programming section: 4
<7> Section Type: 0xe
<7> Invalidating section type: 14
<7> Setting scratchpad address: 537255936
<7> Upload from scratch pad to OTP with soak time: 300ms
CRC sum: ffb60363
```

Change-Id: I01f27a13cc9a245b23645e1aa56581ca92442e01
Signed-off-by: Christopher Meis <christopher.meis@9elements.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 ...


# 7e446a40 22-Oct-2024 Christopher Meis <christopher.meis@9elements.com>

Add i2c voltage regulator updater

- /i2c-vr: Classes following the design in [1]
- /i2c-vr/vr.cpp, vr.hpp: General representation of a voltage regulators
communication interface
- /vr-i2c/xdpe1x2x

Add i2c voltage regulator updater

- /i2c-vr: Classes following the design in [1]
- /i2c-vr/vr.cpp, vr.hpp: General representation of a voltage regulators
communication interface
- /vr-i2c/xdpe1x2xx: Support for Infineon XDPE1x2xx class of voltage
regulators
- /common/i2c/: Basic I2C communication interface

The configuration of a voltage regulator relies on the EM-Schema in [2]

1: https://github.com/openbmc/docs/blob/master/designs/code-update.md
2: https://gerrit.openbmc.org/c/openbmc/entity-manager/+/77463

Tested on QEMU/Yosemite4:

1. Display the firmware inventory
```
curl --insecure --user root:0penBmc \
https://127.0.0.1:2443/redfish/v1/UpdateService/FirmwareInventory
```

Output:
```
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory",
"@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection",
"Members": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/16bae6fd"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/DummyDeviceFirmwareName_6637"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Management_Board_cpld"
},
{...}
```

2. Query voltage regulator version

The dummy device sets the default version to 0xBEEF (Decimal: 48879)
```
curl --insecure --user root:0penBmc \
https://127.0.0.1:2443/redfish/v1/UpdateService/FirmwareInventory/
DummyDeviceFirmwareName_4390
```

Output:
```
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/DummyDeviceFirmwareName_4390",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "Other image",
"Id": "DummyDeviceFirmwareName_4390",
"Name": "Software Inventory",
"Status": {
"Health": "Warning",
"HealthRollup": "OK",
"State": "Disabled"
},
"Updateable": false,
"Version": "48879"
}
```

3. Trigger the update
```
curl -k --insecure --user root:0penBmc \
-H "Content-Type:multipart/form-data" \
-X POST \
-F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/DummyDeviceFirmwareName_4390\"],\"@Redfish.OperationApplyTime\":\"Immediate\"};type=application/json" \
-F "UpdateFile=@fw_vr_update.bin;type=application/octet-stream" \
https://127.0.0.1:2443/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 the task
```
curl --insecure --user root:0penBmc \
https://127.0.0.1:2443/redfish/v1/TaskService/Tasks/0
```

Output:
```
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"EndTime": "2025-03-10T13:47:34+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 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": 0,
"StartTime": "2025-03-10T13:47:34+00:00",
"TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/0",
"TaskState": "Completed",
"TaskStatus": "OK"
}
```

6. Display fw inventory after update
```
curl --insecure --user root:0penBmc \
https://127.0.0.1:2443/redfish/v1/UpdateService/FirmwareInventory
```

Output:
```
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory",
"@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection",
"Members": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/16bae6fd"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/DummyDeviceFirmwareName_282"
},
{...}
}
```

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 --insecure --user root:0penBmc \
https://127.0.0.1:2443/redfish/v1/UpdateService/FirmwareInventory/
DummyDeviceFirmwareName_282
```

Output:
```
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/DummyDeviceFirmwareName_282",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "Other image",
"Id": "DummyDeviceFirmwareName_282",
"Name": "Software Inventory",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"Updateable": false,
"Version": "mycompversion"
}
```

8. Update in progress error

```
curl -k --insecure --user root:0penBmc \
-H "Content-Type:multipart/form-data" \
-X POST \
-F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/${TARGET}\"],\"@Redfish.OperationApplyTime\":\"Immediate\"};type=application/json" \
-F "UpdateFile=@${FWPATH};type=application/octet-stream" \
https://127.0.0.1:2443/redfish/v1/UpdateService/update
```

Output:
```
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request failed due to an internal service error. The service is still operational.",
"MessageArgs": [],
"MessageId": "Base.1.19.InternalError",
"MessageSeverity": "Critical",
"Resolution": "Resubmit the request. If the problem persists, consider resetting the service."
}
],
"code": "Base.1.19.InternalError",
"message": "The request failed due to an internal service error. The service is still operational."
}
```

Change-Id: I2e11a6c10ae40ed7719ceb86dfd6a38dd5b27017
Signed-off-by: Christopher Meis <christopher.meis@9elements.com>

show more ...