diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-07-31 20:43:37 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-08-01 18:19:38 +0300 |
commit | d0f63ef62c76c932a2003eaa42c0b250065ae06f (patch) | |
tree | 4c0e3cb32dc80f80460bdbf82ff6d401d4ff194f /meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru | |
parent | b4f66bacb1b8e661d794fa7a189e2f66f5092e2e (diff) | |
download | openbmc-d0f63ef62c76c932a2003eaa42c0b250065ae06f.tar.xz |
Update to internal 7-31-19
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru')
-rw-r--r-- | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb | 14 | ||||
-rw-r--r-- | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.bin | bin | 513 -> 0 bytes | |||
-rw-r--r-- | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.bin | bin | 512 -> 0 bytes | |||
-rw-r--r-- | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.bin | bin | 511 -> 0 bytes | |||
-rw-r--r-- | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.bin | bin | 512 -> 0 bytes | |||
-rw-r--r-- | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.bin | bin | 512 -> 0 bytes | |||
-rwxr-xr-x | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh | 8 | ||||
-rwxr-xr-x | meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py | 154 |
8 files changed, 171 insertions, 5 deletions
diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb index 1ae1680e0..b8b8f7524 100644 --- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb +++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru.bb @@ -8,13 +8,25 @@ SYSTEMD_SERVICE_${PN} = "SetBaseboardFru.service" S = "${WORKDIR}" SRC_URI = "file://checkFru.sh \ file://SetBaseboardFru.service \ - file://*.fru.bin" + file://create_fru.py" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" RDEPENDS_${PN} = "bash" +python do_compile() { + import sys + workdir = d.getVar('WORKDIR', True) + sys.path.insert(0, workdir) + from create_fru import create_fru + create_fru('S2600WFT') + create_fru('WilsonCity') + create_fru('WilsonPoint') + create_fru('M50CYP2SB2U') + create_fru('D50TNP1SB') +} + do_install() { install -d ${D}${bindir} install -m 0755 ${S}/checkFru.sh ${D}/${bindir}/checkFru.sh diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.bin Binary files differdeleted file mode 100644 index ba5b96392..000000000 --- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600CYP.fru.bin +++ /dev/null diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.bin Binary files differdeleted file mode 100644 index afd58e6b9..000000000 --- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600TNP.fru.bin +++ /dev/null diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.bin Binary files differdeleted file mode 100644 index 76c4b8d4b..000000000 --- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WC.fru.bin +++ /dev/null diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.bin Binary files differdeleted file mode 100644 index 1b9f97ff4..000000000 --- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WFT.fru.bin +++ /dev/null diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.bin b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.bin Binary files differdeleted file mode 100644 index fb219c0ce..000000000 --- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/S2600WP.fru.bin +++ /dev/null diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh index 1eb79b299..4b7910198 100755 --- a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh +++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/checkFru.sh @@ -22,16 +22,16 @@ done # wp if (($result == 62)); then - cat S2600WP.fru.bin > $fruFile + cat WilsonPoint.fru.bin > $fruFile # wc elif (($result == 45)); then - cat S2600WC.fru.bin > $fruFile + cat WilsonCity.fru.bin > $fruFile # cyp elif (($result == 60)); then - cat S2600CYP.fru.bin > $fruFile + cat M50CYP2SB2U.fru.bin > $fruFile # tnp elif (($result == 12)); then - cat S2600TNP.fru.bin > $fruFile + cat D50TNP1SB.fru.bin > $fruFile # default to wft else cat S2600WFT.fru.bin > $fruFile diff --git a/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py new file mode 100755 index 000000000..7f11cbf2d --- /dev/null +++ b/meta-openbmc-mods/meta-ast2500/recipes-phosphor/fru/default-fru/create_fru.py @@ -0,0 +1,154 @@ +#!/usr/bin/python3 + +""" +This script generates a default baseboard fru file. +""" + + +def create_fru(name): + if len(name) > 16: + raise Exception('Product Name Too Large: {}'.format(name)) + + fill_char = ord('.') + eof = 0xC1 + + filename = '{}.fru.bin'.format(name) + name = name.encode('ascii') + + name_len = (0x3 << 6) | len(name) + + # internal area + internal = [0x01] + ([0] * 6) + [0x01] + + # chassis area + chassis = [0x01, # Chassis Info Area Format Version Bit Fields + 0xFF, # Chassis Info Area Length (in multiples of 8 bytes) + 0x17] # Chassis Type (Main Server Chassis) + + fill_len = 18 + + # Chassis Part Number + chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) + + # Chassis Serial Number + chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) + + fill_len = 31 + chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # Info AM1 + chassis += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # Info AM2 + + chassis.append(eof) + + chassis.append(0) # need room for checksum + + while len(chassis) % 8: # pad + chassis.append(0) + + chassis[1] = int(len(chassis) / 8) # populate length + chassis[-1] = (256 - sum(chassis)) & 0xFF # populate checksum + + # board area + board = [0x1, # Board Info Area Format Version Bit Fields + 0xFF, # Board Info Area Length (in multiples of 8 bytes) + 0x0, # Language Code + 0x0, # Mfg. Date/Time + 0x0, # Mfg. Date/Time + 0x0, # Mfg. Date/Time + 0xD1] # Product Manufacturer Name Len + + corp = b'Intel Corporation' + board += bytearray(corp) # Manufacturer Name + + board.append(name_len) + board += bytearray(name) # Board Product Name + + fill_len = 12 + board += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # board SN + + fill_len = 10 + board += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) # board PN + + version = b'FRU Ver 0.01' + + board += [0x3 << 6 | len(version)] # FRU File version ID string + board += bytearray(version) + + board.append(eof) + + board.append(0) # need room for checksum + + while len(board) % 8: + board.append(0) + + board[1] = int(len(board) / 8) # populate length + board[-1] = (256 - sum(board)) & 0xFF # populate checksum + + # product area + product = [1, # Product Info Area Format Version Bit Fields + 0xFF, # Product Info Area Length (in multiples of 8 bytes) + 0x0, # Language Code + 0xD1] # Product Manufacturer Name Len + + product += bytearray(corp) # Manufacturer Name + + product.append(name_len) # Product Name Len + product += bytearray(name) # Product Name + + fill_len = 10 + + # Product Part Number + product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) + + # Product Version + fill_len = 20 + product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) + + # Product Serial Number + fill_len = 12 + product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) + + # Asset Tag + fill_len = 20 + product += [0x3 << 6 | fill_len] + ([fill_char] * fill_len) + + product.append(0xC0) # FRU File ID (Not used) + product.append(eof) + + product.append(0) # need room for checksum + + while len(product) % 8: + product.append(0) + + product[1] = int(len(product) / 8) + product[-1] = (256 - sum(product)) & 0xFF + + header = [0x1] + length = 1 # internal + header.append(length) + length += int(len(internal) / 8) + header.append(length) + length += int(len(chassis) / 8) + header.append(length) + length += int(len(board) / 8) + header.append(length) + header.append(0) + header.append(0) + header.append((256 - sum(header)) & 0xFF) + + result = header + internal + chassis + board + product + + while len(result) < 0x1FF: + result.append(0) + + result = bytearray(result) + + # print(result) + + with open(filename, 'wb') as out: + out.write(result) + + +if __name__ == '__main__': + product_name = input('Enter Product Name: ') + create_fru(product_name) + |