public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/9] Platform/RaspberryPi: Utilize SPI flash for EFI variables
@ 2021-12-02 16:51 Jeremy Linton
  2021-12-02 16:51 ` [PATCH 1/9] Platform/RaspberryPi: Cleanup menu visibility Jeremy Linton
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Jeremy Linton @ 2021-12-02 16:51 UTC (permalink / raw)
  To: devel
  Cc: pete, ardb+tianocore, leif, awarkentin, Sunny.Wang,
	samer.el-haj-mahmoud, mariobalanica02, Jeremy Linton

The RPi4 has a SPI flash with unused capacity. This set detects if
that capacity is sufficient for a UEFI variable store and utilizes
it as such. This fixes a long list of problems, and along the way likely
also fixes a random boot failure caused by the FaultTolerantWriteDxe
garbage collecting, and erasing the flash volume header which is being
used to return information about the underlying variable storage capacity.

This set was dependent on an earlier, mostly ignored set of changes to
move the GPIO/etc devices into their own SSDT and disable them. Because
of that, the two sets have been merged.

Why is that? Because the SPI flash is mux'ed with the PWM used to play
audio out the 3.5mm audio jack on this device. This causes a long list
of problems we must try and avoid, starting with the fact that the pins
need to be controlled by the uefi runtime service. The other problem is
obviously that any time a variable is updated, if the user is utilizing
the 3.5mm audio they will hear clicks and pops. Turns out that behavior
isn't unique to this patch set because the low level boot/etc exhibits this
when running in a TFA+uboot/edk2 environment. A fairly small tweak to TFA
fixes the majority of this, and the remaining runtime problems caused
by this patch actually are very slight and generally not noticeable unless
one goes looking for them. OTOH, we revert to the earlier non persisted
variable store if the firmware is running in a DT only mode, or the
user enables the ACPI GPIO block.


Jeremy Linton (9):
  Platform/RaspberryPi: Cleanup menu visibility
  Platform/RaspberryPi: Give the user control over the XHCI mailbox
  Platform/RaspberryPi: Move GPIO/SPI/I2C to SSDT
  Platform/RaspberryPi: Add menu item to enable/disable GPIO
  Platform/RaspberryPi: Add constants for controlling SPI
  Platform/RaspberryPi: Add mailbox cmd to control audio amp
  Platform/RaspberryPi: Add SPI/GPIO to memory map
  Platform/RaspberryPi: Allow pin function selection at runtime
  Platform/RaspberryPi: Add SPI flash variable store.

 Platform/RaspberryPi/AcpiTables/AcpiTables.inf     |   1 +
 Platform/RaspberryPi/AcpiTables/Dsdt.asl           |   7 -
 Platform/RaspberryPi/AcpiTables/GpuDevs.asl        | 125 ----
 Platform/RaspberryPi/AcpiTables/SsdtGpio.asl       | 157 +++++
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c |  47 ++
 .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf    |   2 +
 .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni |  10 +
 .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr |  36 +-
 Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c       |  10 +-
 Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf     |   1 +
 .../Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c        |  62 +-
 .../Drivers/VarBlockServiceDxe/FvbInfo.c           |   8 +-
 .../Drivers/VarBlockServiceDxe/VarBlockService.c   | 654 ++++++++++++++++++++-
 .../Drivers/VarBlockServiceDxe/VarBlockService.h   |  10 +
 .../VarBlockServiceDxe/VarBlockServiceDxe.c        |  38 +-
 .../VarBlockServiceDxe/VarBlockServiceDxe.inf      |   6 +
 Platform/RaspberryPi/Include/ConfigVars.h          |   4 +
 .../RaspberryPi/Include/IndustryStandard/RpiMbox.h |   1 +
 .../RaspberryPi/Include/Protocol/RpiFirmware.h     |   7 +
 Platform/RaspberryPi/RPi3/RPi3.dsc                 |  12 +
 Platform/RaspberryPi/RPi4/RPi4.dsc                 |  14 +
 Platform/RaspberryPi/RaspberryPi.dec               |   2 +
 .../Bcm283x/Include/IndustryStandard/Bcm2836.h     |  34 ++
 Silicon/Broadcom/Bcm283x/Include/Library/GpioLib.h |   6 +
 Silicon/Broadcom/Bcm283x/Library/GpioLib/GpioLib.c |  16 +-
 25 files changed, 1107 insertions(+), 163 deletions(-)
 create mode 100644 Platform/RaspberryPi/AcpiTables/SsdtGpio.asl

-- 
2.13.7


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-12-03 19:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-02 16:51 [PATCH 0/9] Platform/RaspberryPi: Utilize SPI flash for EFI variables Jeremy Linton
2021-12-02 16:51 ` [PATCH 1/9] Platform/RaspberryPi: Cleanup menu visibility Jeremy Linton
2021-12-02 16:51 ` [PATCH 2/9] Platform/RaspberryPi: Give the user control over the XHCI mailbox Jeremy Linton
2021-12-02 16:52 ` [PATCH 3/9] Platform/RaspberryPi: Move GPIO/SPI/I2C to SSDT Jeremy Linton
2021-12-02 16:52 ` [PATCH 4/9] Platform/RaspberryPi: Add menu item to enable/disable GPIO Jeremy Linton
2021-12-02 16:52 ` [PATCH 5/9] Platform/RaspberryPi: Add constants for controlling SPI Jeremy Linton
2021-12-02 16:52 ` [PATCH 6/9] Platform/RaspberryPi: Add mailbox cmd to control audio amp Jeremy Linton
2021-12-02 16:52 ` [PATCH 7/9] Platform/RaspberryPi: Add SPI/GPIO to memory map Jeremy Linton
2021-12-02 16:52 ` [PATCH 8/9] Platform/RaspberryPi: Allow pin function selection at runtime Jeremy Linton
2021-12-02 17:03 ` [edk2-devel] [PATCH 0/9] Platform/RaspberryPi: Utilize SPI flash for EFI variables Ard Biesheuvel
2021-12-02 17:09   ` Ard Biesheuvel
2021-12-02 17:29     ` Jeremy Linton
2021-12-02 17:55     ` Jeremy Linton
2021-12-03 18:12       ` Ard Biesheuvel
2021-12-03 19:31         ` Jeremy Linton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox