Page MenuHomeFreeBSD

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

Authored by val_packett.cool on Jun 9 2020, 7:42 PM.
Tags
Referenced Files
F80132493: D25201.diff
Thu, Mar 28, 8:30 AM
Unknown Object (File)
Feb 26 2024, 3:24 PM
Unknown Object (File)
Feb 18 2024, 12:39 PM
Unknown Object (File)
Feb 10 2024, 8:14 PM
Unknown Object (File)
Feb 10 2024, 8:14 PM
Unknown Object (File)
Feb 10 2024, 8:14 PM
Unknown Object (File)
Feb 10 2024, 8:14 PM
Unknown Object (File)
Feb 10 2024, 8:13 PM
Subscribers

Details

Summary

(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 (https://github.com/pftf/RPi4/issues/50).

Inspired by NetBSD: https://github.com/NetBSD/src/blob/792df501ab0f93d73372a9bc2c7f19ccb733c1e5/sys/arch/arm/acpi/acpi_machdep.c#L70

Test Plan

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
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
sys/arm64/arm64/machdep.c
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.

val_packett.cool edited the test plan for this revision. (Show Details)
val_packett.cool marked an inline comment as done.
This revision is now accepted and ready to land.Jun 28 2020, 2:07 PM