Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ELBERT: fpga_util: verify parition before programming (#98)
Summary: ELBERT: fpga_util: verify parition before programming Add some additional checks in fpga_util to prevent programming the wrong image type in the partition. Only enforcing partition 1, 2 at the moment. Testing: # Program the wrong image type root@bmc-oob:/tmp# sha1sum elbert_pim_pim16q_0x6v4.abin 0c4520e203726c6f0edd07afd10b348c314cd4e9 elbert_pim_pim16q_0x6v4.abin root@bmc-oob:/tmp# fpga_util.sh pim8ddm program elbert_pim_pim16q_0x6v4.abin Detected PIM Flash device. Selected partition pim8ddm to program. FPGA type in image, 1, does not match expected FPGA type, 2, for partition pim8ddm # Program the wrong image type root@bmc-oob:/tmp# sha1sum elbert_pim_pim8ddm_0x7v3.abin 1cb2ed7139d62aceaf3642bfe80b9d28430f9c11 elbert_pim_pim8ddm_0x7v3.abin root@bmc-oob:/tmp# fpga_util.sh pim16q program elbert_pim_pim8ddm_0x7v3.abin Detected PIM Flash device. Selected partition pim16q to program. FPGA type in image, 2, does not match expected FPGA type, 1, for partition pim16q #Test programming correct image root@bmc-oob:/tmp# fpga_util.sh pim16q program elbert_pim_pim16q_0x6v4.abin Detected PIM Flash device. Selected partition pim16q to program. /tmp/stripped_pim_image size 442733 < 33554432 (32MB) Resizing /tmp/stripped_pim_image by 33111699 bytes to /tmp/pim_image_32mb.bin flashrom v1.2 on Linux 5.6.19-elbert (armv7l) flashrom is free software, get the source code at https://flashrom.org Using region: "pim16q". Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Micron flash chip "MT25QL256" (32768 kB, SPI) on linux_spi. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE The test status of this chip may have been updated in the latest development version of flashrom. If you are running the latest development version, please email a report to [email protected] if any of the above operations work correctly for you with this flash chip. Please include the flashrom log file for all operations you tested (see the man page for details), and mention which mainboard or programmer you tested in the subject line. Thanks for your help! Reading old flash chip contents... done. Erasing and writing flash chip... Erase/write done. Verifying flash... VERIFIED. # Running just the verify command. This is not needed right after as program command also verifies. root@bmc-oob:/tmp# fpga_util.sh pim16q verify elbert_pim_pim16q_0x6v4.abin Detected PIM Flash device. Selected partition pim16q to program. /tmp/stripped_pim_image size 442733 < 33554432 (32MB) Resizing /tmp/stripped_pim_image by 33111699 bytes to /tmp/pim_image_32mb.bin flashrom v1.2 on Linux 5.6.19-elbert (armv7l) flashrom is free software, get the source code at https://flashrom.org Using region: "pim16q". Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Using default 2000kHz clock. Use 'spispeed' parameter to override. Found Micron flash chip "MT25QL256" (32768 kB, SPI) on linux_spi. === This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE The test status of this chip may have been updated in the latest development version of flashrom. If you are running the latest development version, please email a report to [email protected] if any of the above operations work correctly for you with this flash chip. Please include the flashrom log file for all operations you tested (see the man page for details), and mention which mainboard or programmer you tested in the subject line. Thanks for your help! Verifying flash... VERIFIED. Pull Request resolved: facebookexternal/openbmc.arista#98 Reviewed By: benwei13 fbshipit-source-id: e2d400e982
- Loading branch information