diff options
author | Willy Tu <wltu@google.com> | 2022-06-01 09:53:35 +0300 |
---|---|---|
committer | Willy Tu <wltu@google.com> | 2022-06-03 23:36:11 +0300 |
commit | e5ffc52b405319038480c826d0ed8c76edef7338 (patch) | |
tree | e198e5bda63648856b8866a5b48492a16d69911c /meta-google/recipes-phosphor/ipmi | |
parent | d2401e58404b9a880d995b5f74fa561bcdf746f6 (diff) | |
download | openbmc-e5ffc52b405319038480c826d0ed8c76edef7338.tar.xz |
meta-google- ipmi-config: Add google-version support
Read GBMC_VERSION and configure the ipmi firmware revision with the
major/minor. The aux is used for the point and subpoint. This allow gBMC
to remove the internal patch that we used to support our versioning
format.
Requires the change in
https://gerrit.openbmc.org/c/openbmc/phosphor-host-ipmid/+/54147/
Tested:
With firmware_revision in dev_id.json
```
$ cat /usr/share/ipmi-providers/dev_id.json
$ ipmitool mc info
{
"id": 0,
"revision": 0,
"addn_dev_support": 0,
"firmware_revision": {
"major": 35,
"minor": 16
},
"manuf_id": 11129,
"prod_id": 14426,
"aux": 0
}
ipmitool mc info
Device ID : 0
Device Revision : 0
Firmware Revision : 35.10
IPMI Version : 2.0
Manufacturer ID : 11129
Manufacturer Name : Google, Inc.
Product ID : 14426 (0x385a)
Product Name : Unknown (0x385A)
Device Available : yes
Provides Device SDRs : no
Additional Device Support :
Aux Firmware Rev Info :
0x00
0x00
0x00
0x00
```
Change-Id: I64ed6f54612d45732e366a2b245d33db00540093
Signed-off-by: Willy Tu <wltu@google.com>
Diffstat (limited to 'meta-google/recipes-phosphor/ipmi')
-rw-r--r-- | meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend index 2f2d9e0881..1ae745908e 100644 --- a/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend +++ b/meta-google/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend @@ -41,3 +41,38 @@ do_install:append:gbmc() { echo "[]" > ${D}${datadir}/ipmi-providers/entity-map.json fi } + +python do_gbmc_version () { + import json + + if d.getVar('GBMC_VERSION') is None: + return + + version = d.getVar('GBMC_VERSION').split('.') + major = min(int(version[0]), 0x7F) & 0x7F + minor = min(int(version[1]), 99) + minor = int(minor / 10) * 16 + minor % 10; + point = int(version[2]) + subpoint = int(version[3]) + + dev_id = { + "id": 0, + "revision": 0, + "addn_dev_support": 0, + "firmware_revision": { + "major": major, + "minor": minor + }, + "manuf_id": 11129, + "prod_id": 14426, + "aux": subpoint << 16 | (0xFFFF & point) + } + + dir = d.getVar('WORKDIR') + os.makedirs(dir, exist_ok=True) + path = os.path.join(dir, 'dev_id.json') + with open(path, 'w') as f: + json.dump(dev_id, f, sort_keys=True, indent=4) +} + +addtask gbmc_version before do_install |