Hello All,

I faced an issue with my UEFI implementation (Armv8 64 bit platform).
I need to convert a device physical address to the virtual on
VirtualAddressChange event.
EfiConvertPointer always returns EFI_NOT_FOUND.

I tried to allocate just an address:
gBS->AllocatePages(AllocateAddress, EfiRuntimeServicesCode, 1,
&MyAddress); // Allocate one page
where MyAddress is 0x65042000.
Which also returns  EFI_NOT_FOUND.

I declared this device's memory in the Platform memory lib as

  // Mydevice
  // 1MB @0x65000000 (0x65000000 - 0x650fffff)
  MMUTable[++Index].PhysicalBase    = MY_DEV_BASE;
  MMUTable[Index].VirtualBase            = MY_DEV_BASE;
  MMUTable[Index].Length                     = MY_DEV_SZ; // SIZE_1MB
  MMUTable[Index].Attributes              =
ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;

I can access this device perfectly from BootServices (read/write) with MMU
(1:1) on.
But it is nowhere in virtual table map which
AllocatePages()/EfiConvertPointer() eventually use.

Please let me know what I am missing here?
I have declared this memory as a Runtime with

  Status = gDS->AddMemorySpace (
                EfiGcdMemoryTypeMemoryMappedIo,
                AlignedAddr, SIZE_64KB,
                EFI_MEMORY_UC | EFI_MEMORY_RUNTIME
                  );
  if (!EFI_ERROR (Status)) {
      Status = gDS->SetMemorySpaceAttributes (
                    AlignedAddr,
                    SIZE_64KB,
                    EFI_MEMORY_UC | EFI_MEMORY_RUNTIME
                      );
  }

Thank you,
Vladimir
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to