** Description changed:

+ [ Impact ]
+ 
+ There is potential for EEPROM chips holding the bootloader (or part of
+ the bootloader on the Pi 4) to be left in a half-written state, breaking
+ boot on affected boards.
+ 
+ [ Test plan ]
+ 
+ Usually I would include a case testing the failure, but in this case it
+ is safer to simply test that reflashing can be done safely. The test
+ cases must be performed on the following boards:
+ 
+ * All Pi models with EEPROM boot (anything from Pi 4 onwards)
+ * Including Compute and x00 variants (400, CM4, 500, CM5)
+ * Including variants with newer Atmel chips (e.g. obtain a Pi 4 3GB)
+ * Excepting Pi 5 models on jammy (unsupported)
+ 
+ Procedure:
+ 
+ * Flash Ubuntu Server for Raspberry Pi to a spare card
+ * Boot card, install rpi-eeprom and flashrom from $series-proposed 
(rpi-eeprom is required on newer boards to ensure compatible boot firmware)
+ * Check latest EEPROM under /lib/firmware/raspberrypi/bootloader-2711 (for Pi 
4, or -2712 for Pi 5)
+ * sudo rpi-eeprom-update -f $file (where $file is the latest EEPROM found in 
the prior step)
+ * Ensure flashrom is called to perform the flash 
(/boot/firmware/rpieeprom.upd should *not* exist afterward)
+ * sudo reboot
+ * Ensure system boots successfully
+ 
+ Further, test any other boards we can find that rely upon flashrom. One
+ example: some Chromebooks use flashrom to re-write (portions of) their
+ boot assets. On those boards:
+ 
+ * Determine where flashrom is called
+ * Install flashrom from $series-proposed
+ * Attempt to re-write existing boot assets with flashrom
+ * sudo reboot
+ * Ensure system boot successfully
+ 
+ [ Where things could go wrong ]
+ 
+ Updating flashrom carries the obvious potential for breakage in any
+ number of EEPROM flashing operations. The test plan covers the new Atmel
+ chips introduced in the patch, the existing bootrom chips on older Pis,
+ and any other platforms we can find to test (note to self: check what
+ systems Tobias has and is willing to test).
+ 
+ Unfortunately, I doubt any amount of testing we can do here will be
+ comprehensive, and testing the failure case is extremely risky so that
+ is deliberately omitted.
+ 
+ In mitigation, the SFDP fix comes direct from upstream, and the
+ additional Atmel patch only *adds* to flashrom's set of supported chips
+ without modifying the definitions of any existing ones.
+ 
+ [ Original description ]
+ 
  The Raspberry Pi flashrom package includes patches an SFDP bug, and for
  (otherwise unknown) Atmel chips. These are required to avoid leaving
  certain chips in a half-written state (these chips are now present on
  some of the flagship models).
  
  Copying note from https://github.com/raspberrypi/rpi-eeprom#flashrom-
  spi-flash-chip-support :
  
-   flashrom SPI flash-chip support
+   flashrom SPI flash-chip support
  
-   Before performing an immediate update, rpi-eeprom-update probes the
+   Before performing an immediate update, rpi-eeprom-update probes the
  SPI flash via flashrom -p linux_spi:dev=<spidev> and aborts back to a
  staged update if the probe fails, or reports Unknown flash chip with an
  unpatched upstream flashrom 1.4 – 1.6. This guards against a class of
  upstream bugs in flashrom 1.4 – 1.6 where erase operations were issued
  incorrectly for chips that are recognised only via SFDP, which can leave
  the EEPROM in a partially-erased state.
  
-   Raspberry Pi OS ships a patched downstream flashrom 1.4 with the SFDP
+   Raspberry Pi OS ships a patched downstream flashrom 1.4 with the SFDP
  erase bugs fixed. If you are running rpi-eeprom-update on another
  distribution, either use that patched build or a flashrom release new
  enough to contain the upstream fix; otherwise leave
  RPI_EEPROM_IMMEDIATE_UPDATE unset and rely on the staged update path.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2160030

Title:
  [SRU] Include patches from Raspberry Pi for Atmel flashchips

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/flashrom/+bug/2160030/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to