Topics

[edk2-platforms: PATCH] Marvell/Armada7k8k: Set SPCR RegisterBitWidth back to 32

Marcin Wojtas
 

Recent modification of the Armada7k8k SPCR to ARM_GAS8 broke the OpenBSD
booting with ACPI, as the initial console could mistakenly
interpret (with the reg-shift=0), that the registers are 8-bits apart.

Fix that by restoring 32-bit register width, however leaving
the AccessSize field EFI_ACPI_5_0_BYTE. This way the HW is described
more proper way, and the latest Linux is still capable of booting
without additional commandline parameters.

Contributed-under: TianoCore Contribution Agreement 1.1
Suggested-by: Mark Kettenis <kettenis@...>
Signed-off-by: Marcin Wojtas <mw@...>
---
Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc b/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
index 556b2ee..1c7c842 100644
--- a/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
@@ -21,6 +21,8 @@

#include "AcpiHeader.h"

+#define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_BYTE, Address }
+
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
__ACPI_HEADER(EFI_ACPI_6_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
@@ -30,7 +32,7 @@ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
{ EFI_ACPI_RESERVED_BYTE,
EFI_ACPI_RESERVED_BYTE,
EFI_ACPI_RESERVED_BYTE }, // Reserved1[3]
- ARM_GAS8 (FixedPcdGet64(PcdSerialRegisterBase)), // BaseAddress
+ MV_UART_AS32 (FixedPcdGet64(PcdSerialRegisterBase)), // BaseAddress
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC, // InterruptType
0, // Irq
51, // GlobalSystemInterrupt
--
2.7.4

Ard Biesheuvel
 

On Mon, 15 Apr 2019 at 08:20, Marcin Wojtas <mw@...> wrote:

Recent modification of the Armada7k8k SPCR to ARM_GAS8 broke the OpenBSD
booting with ACPI, as the initial console could mistakenly
interpret (with the reg-shift=0), that the registers are 8-bits apart.

Fix that by restoring 32-bit register width, however leaving
the AccessSize field EFI_ACPI_5_0_BYTE. This way the HW is described
more proper way, and the latest Linux is still capable of booting
without additional commandline parameters.

Contributed-under: TianoCore Contribution Agreement 1.1
Suggested-by: Mark Kettenis <kettenis@...>
Signed-off-by: Marcin Wojtas <mw@...>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@...>

Pushed as dc31a7feb81a..e25adb5da09b

---
Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc b/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
index 556b2ee..1c7c842 100644
--- a/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc
@@ -21,6 +21,8 @@

#include "AcpiHeader.h"

+#define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_BYTE, Address }
+
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
__ACPI_HEADER(EFI_ACPI_6_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
@@ -30,7 +32,7 @@ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
{ EFI_ACPI_RESERVED_BYTE,
EFI_ACPI_RESERVED_BYTE,
EFI_ACPI_RESERVED_BYTE }, // Reserved1[3]
- ARM_GAS8 (FixedPcdGet64(PcdSerialRegisterBase)), // BaseAddress
+ MV_UART_AS32 (FixedPcdGet64(PcdSerialRegisterBase)), // BaseAddress
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC, // InterruptType
0, // Irq
51, // GlobalSystemInterrupt
--
2.7.4