Page MenuHomeFreeBSD

Use EFI memory map to determine attributes for AcpiOsMapMemory mappings on arm64

Authored by on Jun 9 2020, 7:42 PM.
Referenced Files
Unknown Object (File)
Mon, Nov 27, 11:50 AM
Unknown Object (File)
Mon, Nov 27, 11:50 AM
Unknown Object (File)
Mon, Nov 27, 11:50 AM
Unknown Object (File)
Mon, Nov 27, 11:50 AM
Unknown Object (File)
Sat, Nov 25, 11:24 AM
Unknown Object (File)
Wed, Nov 22, 6:13 PM
Unknown Object (File)
Tue, Nov 21, 8:38 PM
Unknown Object (File)
Mon, Nov 13, 12:17 AM



(WIP, please help me improve this, or just do it better :D)

AcpiOsMapMemory is used for device memory when e.g. an _INI method wants to access physical memory.
However, aarch64 pmap_mapbios is hardcoded to writeback, which is no good.
We need to default to device memory and use EFI memory map attributes to detect different modes.

This fixes XHCI initialization on the Raspberry Pi 4 UEFI firmware (

Inspired by NetBSD:

Test Plan

Works on my RPi4 :) no-harm on the Marvell MACCHIATObin (Armada8k)

Diff Detail

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

andrew requested changes to this revision.Jun 9 2020, 8:39 PM

You should teach pmap_mapbios to take into account the EFI memory type.

The parsing on the EFI map should be in machdep.c as that already has the EFI support code.

This revision now requires changes to proceed.Jun 9 2020, 8:39 PM
1108 ↗(On Diff #72905)

I think you can add a break or return a device memory type at the end of the loop as we shouldn't see overlapping entries. edited the test plan for this revision. (Show Details) marked an inline comment as done.
This revision is now accepted and ready to land.Jun 28 2020, 2:07 PM