Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fby3: move fw-util in fby3 to common (#1015)
Summary: -move fw-util in fby3 to common. -log the update event in log-util. For example: Updating 1OU BIC Bootloader on slot2. File: DVT_BIC_PKG/Y3BB1M_D01.bin Updated 1OU BIC Bootloader on slot2. File: DVT_BIC_PKG/Y3BB1M_D01.bin. Result: Success Updating 1OU BIC Bootloader on slot2. File: DVT_BIC_PKG/Y3BBDL_D01.bin Updated 1OU BIC Bootloader on slot2. File: DVT_BIC_PKG/Y3BBDL_D01.bin. Result: Fail -libbic a) add force update to compatible with the previous CPLD b) declare FW_XXX variables for all components c) modify bic_get_fw_ver and bic_update_fw for fw-util d) add the string names of all components Pull Request resolved: facebookexternal/openbmc.wiwynn#1015 Test Plan: -build code(pass) -update bmc/rom(pass) -update sb/1ou/2ou bic/bicbl(pass) -update vr(pass) -update 1ou/2ou/bb/sb cpld(pass) root@bmc-oob:~# fw-util bmc --update cpld Y3CNIC_E03.rpd image is not a valid CPLD image for NIC expansion board Upgrade of bmc : cpld failed root@bmc-oob:~# fw-util bmc --force --update cpld Y3CNIC_E03.rpd rpd file size = 376832 bytes. OnChip Flash Status = 0xFFFFFD80. image type = 0x1. Max10 Unprotect Sector 5. Max10 Erase Sector 5 Erase sector SUCCESS. Max10 Erase Sector 0 Erase sector SUCCESS. Progress: Addr: 0xBFFFC [100 %] Done! Force upgrade of bmc : cpld succeeded root@bmc-oob:~# fw-util bmc --update cpld Y3CNIC_D02_signed.rpd rpd file size = 376832 bytes. OnChip Flash Status = 0xFFFFFD98. image type = 0x1. Max10 Unprotect Sector 5. Max10 Erase Sector 5 Erase sector SUCCESS. Max10 Erase Sector 0 Erase sector SUCCESS. Progress: Addr: 0xBFFFC [100 %] Done! Upgrade of bmc : cpld succeeded root@bmc-oob:~# power-util slot1 12V-cycle 12V Power cycling fru 1... packet_write_wait: Connection to 192.168.88.182 port 22: Broken pipe root@guaigaui-Freedom:/home/tony# ssh 192.168.88.182 [email protected]'s password: root@bmc-oob:~# fw-util bmc --version | grep -i cpld BMC CPLD Version: 00060D02 root@bmc-oob:~# fw-util slot1 --update bb_cpld Y3CBD_D02_signed.rpd slot_id: 1, comp: f, intf: 0, img: Y3CBD_D02_signed.rpd, force: 0 OnChip Flash Status = 0xFFFFFD80., slot_id 0x1, sectype 0x0, intf: 0x10, read 376833 bytes. Erase sector SUCCESS. Erase sector SUCCESS. updated cpld: 100 % Elapsed time: 312 sec. Upgrade of slot1 : bb_cpld succeeded root@bmc-oob:~# fw-util slot1 --update bb_cpld Y3CM_D01.jed slot_id: 1, comp: f, intf: 0, img: Y3CM_D01.jed, force: 0 OnChip Flash Status = 0xFFFFFD94., slot_id 0x1, sectype 0x0, intf: 0x10, read 505952 bytes. The size of image is not expected! Upgrade of slot1 : bb_cpld failed root@bmc-oob:~# fw-util slot1 --update cpld Y3CDL_D01_signed.rpd slot_id: 1, comp: 1, intf: 0, img: Y3CDL_D01_signed.rpd, force: 0 OnChip Flash Status = 0xFFFFFC00., slot_id 0x1, sectype 0x0, intf: 0xff, read 376833 bytes. Erase sector SUCCESS. Erase sector SUCCESS. updated cpld: 100 % Elapsed time: 301 sec. Upgrade of slot1 : cpld succeeded root@bmc-oob:~# fw-util slot1 --update cpld Y3CBD_D02_signed.rpd slot_id: 1, comp: 1, intf: 0, img: Y3CBD_D02_signed.rpd, force: 0 OnChip Flash Status = 0xFFFFFC14., slot_id 0x1, sectype 0x0, intf: 0xff, read 376833 bytes. The image is not the valid CPLD image for this component. Upgrade of slot1 : cpld failed root@bmc-oob:/mnt/data1# fw-util bmc --update rom flash-fby3-v2020.15.3 Flashing to device: /dev/mtd12 Erasing block: 401/401 (100%) Writing kb: 25635/25635 (100%) Verifying kb: 25635/25635 (100%) Upgrade of bmc : rom succeeded root@bmc-oob:/mnt/data1# fw-util bmc --update bmc flash-fby3-v2020.15.3 Flashing to device: /dev/mtd5 Erasing block: 401/401 (100%) Writing kb: 25635/25635 (100%) Verifying kb: 25635/25635 (100%) Upgrade of bmc : bmc succeeded root@bmc-oob:/mnt/data1# fw-util bmc --update cpld DVT_CPLD_PKG/Y3CDL_D01_signed.rpd image is not a valid CPLD image for baseboard Upgrade of bmc : cpld failed root@bmc-oob:/mnt/data1# fw-util bmc --update cpld DVT_CPLD_PKG/Y3CBD_D02_signed.rpd rpd file size = 376832 bytes. OnChip Flash Status = 0xFFFFFC00. image type = 0x1. Max10 Unprotect Sector 5. Max10 Erase Sector 5 Erase sector SUCCESS. Max10 Erase Sector 0 Erase sector SUCCESS. Progress: Addr: 0xBFFFC [100 %] Done! Upgrade of bmc : cpld succeeded root@bmc-oob:/mnt/data1# fw-util slot2 --update 1ou_bic DVT_BIC_PKG/Y3BR1M_D02.bin slot_id: 2, comp: 7, intf: 0, img: DVT_BIC_PKG/Y3BR1M_D02.bin, force: 0 file size = 146002 bytes, slot = 2, intf = 0x5 bytes/per read = 244 updated bic: 5 % updated bic: 10 % updated bic: 15 % updated bic: 20 % updated bic: 25 % updated bic: 30 % updated bic: 35 % updated bic: 40 % updated bic: 45 % updated bic: 50 % updated bic: 55 % updated bic: 60 % updated bic: 65 % updated bic: 70 % updated bic: 75 % updated bic: 80 % updated bic: 85 % updated bic: 90 % updated bic: 95 % updated bic: 100 % Upgrade of slot2 : 1ou_bic succeeded root@bmc-oob:/mnt/data1# fw-util slot2 --version | grep -i 1ou 1OU Bridge-IC Version: v25.02 root@bmc-oob:/mnt/data1# fw-util slot2 --update 1ou_cpld DVT_CPLD_PKG/Y3CM_D01.jed slot_id: 2, comp: 9, intf: 0, img: DVT_CPLD_PKG/Y3CM_D01.jed, force: 0 [ChkSUM]bb18 CPLD DevID: 612BB043 updated cpld: 5 % updated cpld: 10 % updated cpld: 15 % updated cpld: 20 % updated cpld: 25 % updated cpld: 30 % updated cpld: 35 % updated cpld: 40 % updated cpld: 45 % updated cpld: 50 % updated cpld: 55 % updated cpld: 60 % updated cpld: 65 % updated cpld: 70 % updated cpld: 75 % updated cpld: 80 % updated cpld: 85 % updated cpld: 90 % updated cpld: 95 % updated cpld: 100 % Upgrade of slot2 : 1ou_cpld succeeded root@bmc-oob:/mnt/data1# power-util slot2 12V-cycle 12V Power cycling fru 2... root@bmc-oob:/mnt/data1# fw-util slot2 --version | grep -i 1ou 1OU Bridge-IC Version: v25.02 1OU Bridge-IC Bootloader Version: v15.02 1OU CPLD Version: 00050D01 root@bmc-oob:/mnt/data1# fw-util slot1 --update bic DVT_BIC_PKG/Y3BRDL_D03.bin slot1 is empty root@bmc-oob:/mnt/data1# fw-util slot2 --update bic DVT_BIC_PKG/Y3BBDL_D01.bin slot_id: 2, comp: 2, intf: 0, img: DVT_BIC_PKG/Y3BBDL_D01.bin, force: 0 file size = 16400 bytes, slot = 2, intf = 0xff This file cannot be updated to this component! Invalid BIC file! Upgrade of slot2 : bic failed root@bmc-oob:/mnt/data1# fw-util slot2 --update bicbl DVT_BIC_PKG/Y3BBDL_D01.bin slot_id: 2, comp: 4, intf: 0, img: DVT_BIC_PKG/Y3BBDL_D01.bin, force: 0 file size = 16400 bytes, slot = 2, comp = 0x2 Update BIC bootloader updated bic bootloader: 5 % updated bic bootloader: 10 % updated bic bootloader: 15 % updated bic bootloader: 20 % updated bic bootloader: 25 % updated bic bootloader: 30 % updated bic bootloader: 35 % updated bic bootloader: 40 % updated bic bootloader: 45 % updated bic bootloader: 50 % updated bic bootloader: 55 % updated bic bootloader: 60 % updated bic bootloader: 65 % updated bic bootloader: 70 % updated bic bootloader: 75 % updated bic bootloader: 80 % updated bic bootloader: 85 % updated bic bootloader: 90 % updated bic bootloader: 95 % updated bic bootloader: 100 % Upgrade of slot2 : bicbl succeeded root@bmc-oob:/mnt/data1# fw-util slot2 --update 1ou_bicbl DVT_BIC_PKG/Y3BBDL_D01.bin slot_id: 2, comp: 8, intf: 0, img: DVT_BIC_PKG/Y3BBDL_D01.bin, force: 0 file size = 16400 bytes, slot = 2, comp = 0x2 This file cannot be updated to this component! Invalid BIC bootloader file! Upgrade of slot2 : 1ou_bicbl failed root@bmc-oob:/mnt/data1# fw-util slot2 --update 1ou_bicbl DVT_BIC_PKG/Y3BB1M_D01.bin slot_id: 2, comp: 8, intf: 0, img: DVT_BIC_PKG/Y3BB1M_D01.bin, force: 0 file size = 16400 bytes, slot = 2, comp = 0x2 Update BIC bootloader updated bic bootloader: 5 % updated bic bootloader: 10 % updated bic bootloader: 15 % updated bic bootloader: 20 % updated bic bootloader: 25 % updated bic bootloader: 30 % updated bic bootloader: 35 % updated bic bootloader: 40 % updated bic bootloader: 45 % updated bic bootloader: 50 % updated bic bootloader: 55 % updated bic bootloader: 60 % updated bic bootloader: 65 % updated bic bootloader: 70 % updated bic bootloader: 75 % updated bic bootloader: 80 % updated bic bootloader: 85 % updated bic bootloader: 90 % updated bic bootloader: 95 % updated bic bootloader: 100 % Upgrade of slot2 : 1ou_bicbl succeeded root@bmc-oob:~# fw-util slot2 --update vr 01D2_SN1906016_VCCIN.csv slot_id: 2, comp: 5, intf: 0, img: 01D2_SN1906016_VCCIN.csv, force: 0 VR vendor=TI(6.1) Update VCCIN/VSA...Upgrade of slot2 : vr succeeded root@bmc-oob:~# fw-util slot2 --update vr E2AA_SN1906016_VCCIO.csv slot_id: 2, comp: 5, intf: 0, img: E2AA_SN1906016_VCCIO.csv, force: 0 VR vendor=TI(6.1) Update VCCIO...Upgrade of slot2 : vr succeeded root@bmc-oob:~# fw-util slot2 --update vr 855B_SN1906016_VDDQ_ABC.csv slot_id: 2, comp: 5, intf: 0, img: 855B_SN1906016_VDDQ_ABC.csv, force: 0 VR vendor=TI(6.1) Update VDDQ_ABC...Upgrade of slot2 : vr succeeded root@bmc-oob:~# fw-util slot2 --update vr B629_SN1906016_VDDQ_DEF.csv slot_id: 2, comp: 5, intf: 0, img: B629_SN1906016_VDDQ_DEF.csv, force: 0 VR vendor=TI(6.1) Update VDDQ_DEF...Upgrade of slot2 : vr succeeded root@bmc-oob:~# fw-util slot2 --update bios Y3DLD03.bin slot_id: 2, comp: 6, intf: 0, img: Y3DLD03.bin, force: 0 `````````````````````` Input: Y3DLD03.bin, USB timeout: 3000ms updated bios: 5 % updated bios: 10 % updated bios: 15 % updated bios: 20 % updated bios: 25 % updated bios: 30 % updated bios: 35 % updated bios: 40 % updated bios: 45 % updated bios: 50 % updated bios: 55 % updated bios: 60 % updated bios: 65 % updated bios: 70 % updated bios: 75 % updated bios: 80 % updated bios: 85 % updated bios: 90 % updated bios: 95 % updated bios: 100 % Elapsed time: 808 sec. Upgrade of slot2 : bios succeeded root@bmc-oob:~# ./fw-util slot1 --update vt Y3DLD03.bin USAGE: ./fw-util all|FRU --version [all|COMPONENT] ./fw-util FRU --update [--]COMPONENT IMAGE_PATH ./fw-util FRU --force --update [--]COMPONENT IMAGE_PATH ./fw-util FRU --dump [--]COMPONENT IMAGE_PATH FRU : Components ---------- : ---------- bmc : bmc cpld fscd rom tpm nic : nic slot1 : 1ou_bic 1ou_bicbl 1ou_cpld 2ou_bic 2ou_bicbl 2ou_cpld bb_bic bb_bicbl bb_cpld bic bicbl bios cpld me vr slot2 : 1ou_bic 1ou_bicbl 1ou_cpld 2ou_bic 2ou_bicbl 2ou_cpld bic bicbl bios cpld me vr slot3 : 1ou_bic 1ou_bicbl 1ou_cpld 2ou_bic 2ou_bicbl 2ou_cpld bic bicbl bios cpld me vr slot4 : 1ou_bic 1ou_bicbl 1ou_cpld 2ou_bic 2ou_bicbl 2ou_cpld bic bicbl bios cpld me vr Reviewed By: amithash fbshipit-source-id: a1e0ebaf0a
- Loading branch information