public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms: PATCH] Marvell/Armada7k8k: Set SPCR RegisterBitWidth back to 32
@ 2019-04-15 15:19 Marcin Wojtas
  2019-04-15 22:37 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Wojtas @ 2019-04-15 15:19 UTC (permalink / raw)
  To: devel
  Cc: leif.lindholm, ard.biesheuvel, mw, jsd, jaz, kostap,
	jeremy.linton, Jici.Gao, kettenis

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@jive.eu>
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-platforms: PATCH] Marvell/Armada7k8k: Set SPCR RegisterBitWidth back to 32
  2019-04-15 15:19 [edk2-platforms: PATCH] Marvell/Armada7k8k: Set SPCR RegisterBitWidth back to 32 Marcin Wojtas
@ 2019-04-15 22:37 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2019-04-15 22:37 UTC (permalink / raw)
  To: Marcin Wojtas
  Cc: edk2-devel-groups-io, Leif Lindholm, Jan Dąbroś,
	Grzegorz Jaszczyk, Kostya Porotchkin, Jeremy Linton, Jici Gao,
	kettenis

On Mon, 15 Apr 2019 at 08:20, Marcin Wojtas <mw@semihalf.com> 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@jive.eu>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-15 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-15 15:19 [edk2-platforms: PATCH] Marvell/Armada7k8k: Set SPCR RegisterBitWidth back to 32 Marcin Wojtas
2019-04-15 22:37 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox