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
Unknown Object (File)
Tue, Dec 17, 3:32 AM
Unknown Object (File)
Tue, Dec 10, 4:25 PM
Unknown Object (File)
Sun, Dec 8, 11:21 PM
Unknown Object (File)
Sat, Nov 30, 3:26 PM
Unknown Object (File)
Nov 10 2024, 7:07 AM
Unknown Object (File)
Nov 8 2024, 2:35 AM
Unknown Object (File)
Sep 28 2024, 7:42 AM
Unknown Object (File)
Sep 26 2024, 4:34 PM
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!