We intend to allow the OS to update the RTC after exit boot services.
THis means we need to assure that the I2C IO map is marked correctly.

Signed-off-by: Jeremy Linton <jeremy.lin...@arm.com>
---
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c 
b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 377ef438ff..fec8f63ea8 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -505,6 +505,7 @@ ApplyVariables (
   }
 
   if (mModelFamily == 4) {
+    // add memoryspaces for the runtime flash/variable store
     Status = gDS->AddMemorySpace (EfiGcdMemoryTypeMemoryMappedIo, 
BCM2836_SPI0_BASE_ADDRESS,
                                   SIZE_4KB, EFI_MEMORY_UC | 
EFI_MEMORY_RUNTIME);
     ASSERT_EFI_ERROR (Status);
@@ -517,6 +518,13 @@ ApplyVariables (
     Status = gDS->SetMemorySpaceAttributes (GPIO_BASE_ADDRESS,
                                             SIZE_4KB, 
EFI_MEMORY_UC|EFI_MEMORY_RUNTIME);
 
+    // add memoryspace for the runtime rtc/i2c
+    Status = gDS->AddMemorySpace (EfiGcdMemoryTypeMemoryMappedIo, 
BCM2836_I2C1_BASE_ADDRESS,
+                                  SIZE_4KB, EFI_MEMORY_UC | 
EFI_MEMORY_RUNTIME);
+    ASSERT_EFI_ERROR (Status);
+    Status = gDS->SetMemorySpaceAttributes (BCM2836_I2C1_BASE_ADDRESS,
+                                            SIZE_4KB, 
EFI_MEMORY_UC|EFI_MEMORY_RUNTIME);
+
     ASSERT_EFI_ERROR (Status);
   }
 
-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113562): https://edk2.groups.io/g/devel/message/113562
Mute This Topic: https://groups.io/mt/103653101/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to