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
F102774909: D25201.diff
Sun, Nov 17, 12:19 AM
Unknown Object (File)
Sat, Nov 2, 1:05 PM
Unknown Object (File)
Oct 5 2024, 12:32 PM
Unknown Object (File)
Oct 5 2024, 8:24 AM
Unknown Object (File)
Oct 5 2024, 4:56 AM
Unknown Object (File)
Oct 4 2024, 8:19 AM
Unknown Object (File)
Oct 2 2024, 7:51 PM
Unknown Object (File)
Oct 2 2024, 10:56 AM
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 Skipped
Unit
Tests Skipped

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