Page MenuHomeFreeBSD

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

Authored by val_packett.cool on Jun 25 2019, 11:48 PM.
Referenced Files
F81696437: D20765.diff
Sat, Apr 20, 2:28 AM
Unknown Object (File)
Mar 9 2024, 8:46 PM
Unknown Object (File)
Mar 9 2024, 8:46 PM
Unknown Object (File)
Mar 9 2024, 8:46 PM
Unknown Object (File)
Mar 9 2024, 8:32 PM
Unknown Object (File)
Dec 23 2023, 12:02 AM
Unknown Object (File)
Dec 18 2023, 1:27 PM
Unknown Object (File)
Nov 14 2023, 1:52 AM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jun 26 2019, 3:09 AM

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

In D20765#449872, @greg_unrelenting.technology wrote:

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!