[edk2-devel] [PATCH 0/7] RaspberryPi: SPI Variables, again

Jeremy Linton posted 7 patches 3 months, 2 weeks ago
Failed in applying to current master (apply log)
.../RaspberryPi/AcpiTables/AcpiTables.inf     |   1 +
Platform/RaspberryPi/AcpiTables/Dsdt.asl      |   7 -
Platform/RaspberryPi/AcpiTables/GpuDevs.asl   | 126 ----
Platform/RaspberryPi/AcpiTables/SsdtGpio.asl  | 159 +++++
.../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c |  37 +
.../Drivers/ConfigDxe/ConfigDxe.inf           |   1 +
.../Drivers/ConfigDxe/ConfigDxeHii.uni        |   5 +
.../Drivers/ConfigDxe/ConfigDxeHii.vfr        |  15 +
.../Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c   |  60 +-
.../Drivers/VarBlockServiceDxe/FvbInfo.c      |   8 +-
.../VarBlockServiceDxe/VarBlockService.c      | 669 +++++++++++++++++-
.../VarBlockServiceDxe/VarBlockService.h      |  10 +
.../VarBlockServiceDxe/VarBlockServiceDxe.c   |  69 +-
.../VarBlockServiceDxe/VarBlockServiceDxe.inf |   7 +
Platform/RaspberryPi/Include/ConfigVars.h     |   4 +
.../Include/IndustryStandard/RpiMbox.h        |   1 +
.../Include/Protocol/RpiFirmware.h            |   7 +
Platform/RaspberryPi/RPi3/RPi3.dsc            |   6 +
Platform/RaspberryPi/RPi4/RPi4.dsc            |  12 +-
Platform/RaspberryPi/RaspberryPi.dec          |   1 +
.../Include/IndustryStandard/Bcm2836.h        |  34 +
.../Bcm283x/Include/Library/GpioLib.h         |   6 +
.../Bcm283x/Library/GpioLib/GpioLib.c         |  16 +-
23 files changed, 1100 insertions(+), 161 deletions(-)
create mode 100644 Platform/RaspberryPi/AcpiTables/SsdtGpio.asl
[edk2-devel] [PATCH 0/7] RaspberryPi: SPI Variables, again
Posted by Jeremy Linton 3 months, 2 weeks ago
There is a 512KB SPI flash EEPROM on the RPi4, which is used to hold
the early boot firmware. Versions of this this firmware which predate
the network recovery have 160-300+KB unused, which is a perfect place
to drop a UEFI variable store.

This code scans the region and makes the decision at runtime if there
is sufficient space available and falls back to updating the SD/USB
firmware image if not. This behavior is now enabled/disabled at
compile time with -DSPI_VARIABLES=1/0

This is a rehash of a previous set I posted from a few years back, and
I'm largely re-posting it because its still useful for people who are
willing to back that firmware down to gain the functionality, as well
as fixing a crash caused by the variable store code garbage collecting
the storage region when it starts to get full

Beyond providing some example SPI programming on the platform, it also
moves I2C/SPI/GPIO devices which are debatably usable on Linux in
ACPI mode into its own SSDT.

Jeremy Linton (7):
  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.

 .../RaspberryPi/AcpiTables/AcpiTables.inf     |   1 +
 Platform/RaspberryPi/AcpiTables/Dsdt.asl      |   7 -
 Platform/RaspberryPi/AcpiTables/GpuDevs.asl   | 126 ----
 Platform/RaspberryPi/AcpiTables/SsdtGpio.asl  | 159 +++++
 .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c |  37 +
 .../Drivers/ConfigDxe/ConfigDxe.inf           |   1 +
 .../Drivers/ConfigDxe/ConfigDxeHii.uni        |   5 +
 .../Drivers/ConfigDxe/ConfigDxeHii.vfr        |  15 +
 .../Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c   |  60 +-
 .../Drivers/VarBlockServiceDxe/FvbInfo.c      |   8 +-
 .../VarBlockServiceDxe/VarBlockService.c      | 669 +++++++++++++++++-
 .../VarBlockServiceDxe/VarBlockService.h      |  10 +
 .../VarBlockServiceDxe/VarBlockServiceDxe.c   |  69 +-
 .../VarBlockServiceDxe/VarBlockServiceDxe.inf |   7 +
 Platform/RaspberryPi/Include/ConfigVars.h     |   4 +
 .../Include/IndustryStandard/RpiMbox.h        |   1 +
 .../Include/Protocol/RpiFirmware.h            |   7 +
 Platform/RaspberryPi/RPi3/RPi3.dsc            |   6 +
 Platform/RaspberryPi/RPi4/RPi4.dsc            |  12 +-
 Platform/RaspberryPi/RaspberryPi.dec          |   1 +
 .../Include/IndustryStandard/Bcm2836.h        |  34 +
 .../Bcm283x/Include/Library/GpioLib.h         |   6 +
 .../Bcm283x/Library/GpioLib/GpioLib.c         |  16 +-
 23 files changed, 1100 insertions(+), 161 deletions(-)
 create mode 100644 Platform/RaspberryPi/AcpiTables/SsdtGpio.asl

-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113549): https://edk2.groups.io/g/devel/message/113549
Mute This Topic: https://groups.io/mt/103653085/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-