Page MenuHomeFreeBSD

Add ACPI entries for Synopsys Designware UARTs used on ARM platforms
ClosedPublic

Authored by greg_unrelenting.technology on Jun 25 2019, 11:48 PM.

Details

Summary

This fixes (userspace) console on the Marvell MACCHIATObin in ACPI mode with latest TianoCore EDK2 firmware.

(clock frequency for Synquacer found here; idk if actual HiSilicon chips use a different one from the mcbin?)

Ideally, we would also read this kind of stuff:

Name (_DSD, Package () {
  ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  Package () {
    Package () { "clock-frequency", 62500000 },
    Package () { "reg-io-width", 4 },
    Package () { "reg-shift", 2 },
  }
})

(woo, devicetrees)

but as a quick fix, let's have the entries with the clock-frequency from the mcbin?

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bcran accepted this revision.Jun 26 2019, 3:09 AM
This revision is now accepted and ready to land.Jun 26 2019, 3:09 AM
mw accepted this revision.Jun 26 2019, 5:28 AM
bcran added a comment.Jun 27 2019, 6:49 PM

I just tried booting with this patch applied and with EDK2 firmware built from master yesterday, and I still don't see any output - both with devicetree and acpi.

I just tried booting with this patch applied and with EDK2 firmware built from master yesterday, and I still don't see any output - both with devicetree and acpi.

You still need the fixed SPCR for early console:

--- i/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
+++ w/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
@@ -15,7 +15,7 @@

 #include "AcpiHeader.h"

-#define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_BYTE, Address }
+#define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 8, 0, EFI_ACPI_5_0_DWORD, Address }

 EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
   __ACPI_HEADER(EFI_ACPI_6_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,

I'm not sure why exactly the userspace console wouldn't work without a working SPCR here, uart_bus_acpi doesn't do any matching against the early console..

btw, you're setting ACPI via kern.cfg.order, right? just switching to ACPI in the EDK2 menu doesn't do anything for me, seems like the DT is always visible to the OS

bcran added a comment.Jun 28 2019, 1:10 AM

You still need the fixed SPCR for early console:

Ah, it started working after making that change!

btw, you're setting ACPI via kern.cfg.order, right? just switching to ACPI in the EDK2 menu doesn't do anything for me, seems like the DT is always visible to the OS

Yup, and now it's working. Thanks!