public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 0/7] RaspberryPi: SPI Variables, again
@ 2024-01-11  0:04 Jeremy Linton
  2024-01-11  0:04 ` [edk2-devel] [PATCH 1/7] Platform/RaspberryPi: Move GPIO/SPI/I2C to SSDT Jeremy Linton
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Jeremy Linton @ 2024-01-11  0:04 UTC (permalink / raw)
  To: devel; +Cc: ardb+tianocore, quic_llindhol, Jeremy Linton

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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

end of thread, other threads:[~2024-01-11  0:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-11  0:04 [edk2-devel] [PATCH 0/7] RaspberryPi: SPI Variables, again Jeremy Linton
2024-01-11  0:04 ` [edk2-devel] [PATCH 1/7] Platform/RaspberryPi: Move GPIO/SPI/I2C to SSDT Jeremy Linton
2024-01-11  0:04 ` [edk2-devel] [PATCH 2/7] Platform/RaspberryPi: Add menu item to enable/disable GPIO Jeremy Linton
2024-01-11  0:04 ` [edk2-devel] [PATCH 3/7] Platform/RaspberryPi: Add constants for controlling SPI Jeremy Linton
2024-01-11  0:04 ` [edk2-devel] [PATCH 4/7] Platform/RaspberryPi: Add mailbox cmd to control audio amp Jeremy Linton
2024-01-11  0:04 ` [edk2-devel] [PATCH 5/7] Platform/RaspberryPi: Add SPI/GPIO to memory map Jeremy Linton
2024-01-11  0:04 ` [edk2-devel] [PATCH 6/7] Platform/RaspberryPi: Allow pin function selection at runtime Jeremy Linton
2024-01-11  0:04 ` [edk2-devel] [PATCH 7/7] Platform/RaspberryPi: Add SPI flash variable store Jeremy Linton

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