public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Tanmay Jagdale <tanmay.jagdale@linaro.org>
Cc: graeme@nuviainc.com, shashi.mallela@linaro.org,
	devel@edk2.groups.io, paul.isaacs@linaro.org, tanmay@marvell.com
Subject: Re: [PATCH edk2-platforms 7/7] SbsaQemu: AcpiTables: Add DBG2 Table
Date: Thu, 20 Aug 2020 13:13:31 +0100	[thread overview]
Message-ID: <20200820121331.GH1191@vanye> (raw)
In-Reply-To: <20200819143005.13999-8-tanmay.jagdale@linaro.org>

On Wed, Aug 19, 2020 at 20:00:05 +0530, Tanmay Jagdale wrote:
> Signed-off-by: Tanmay Jagdale <tanmay.jagdale@linaro.org>
> ---
>  .../Qemu/SbsaQemu/AcpiTables/AcpiTables.inf   |  1 +
>  Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc    | 68 +++++++++++++++++++
>  2 files changed, 69 insertions(+)
>  create mode 100644 Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc
> 
> diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
> index 0b5017ce81c5..cf6628c9e491 100644
> --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
> +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
> @@ -17,6 +17,7 @@ [Defines]
>  
>  [Sources]
>    Dsdt.asl
> +  Dbg2.aslc

That should go before Dsdt.asl.

>    Fadt.aslc
>    Gtdt.aslc
>    Spcr.aslc
> diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc b/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc
> new file mode 100644
> index 000000000000..801b05b59a42
> --- /dev/null
> +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc
> @@ -0,0 +1,68 @@
> +/** @file
> +*  Debug Port Table (DBG2)
> +*
> +*  Copyright (c) 2020 Linaro Ltd. All rights reserved.
> +*
> +*  SPDX-License-Identifier: BSD-2-Clause-Patent
> +*
> +**/
> +#include <IndustryStandard/Acpi.h>
> +#include <IndustryStandard/Acpi63.h>

Can drop Acpi63.h.

/
    Leif

> +#include <IndustryStandard/DebugPort2Table.h>
> +#include <IndustryStandard/SbsaQemuAcpi.h>
> +#include <Library/AcpiLib.h>
> +#include <Library/PcdLib.h>
> +
> +#pragma pack(1)
> +
> +#define SBSAQEMU_UART_STR { '\\', '_', 'S', 'B', '.', 'C', 'O', 'M', '0', 0x00 }
> +
> +typedef struct {
> +  EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;
> +  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE        BaseAddressRegister;
> +  UINT32                                        AddressSize;
> +  UINT8                                         NameSpaceString[10];
> +} DBG2_DEBUG_DEVICE_INFORMATION;
> +
> +typedef struct {
> +  EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE       Description;
> +  DBG2_DEBUG_DEVICE_INFORMATION                 Dbg2DeviceInfo;
> +} DBG2_TABLE;
> +
> +
> +STATIC DBG2_TABLE Dbg2 = {
> +  {
> +    SBSAQEMU_ACPI_HEADER (
> +      EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE,
> +      DBG2_TABLE,
> +      EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION
> +    ),
> +    OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo),
> +    1                                      /* NumberOfDebugPorts */
> +  },
> +  {
> +    {
> +      EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION,
> +      sizeof (DBG2_DEBUG_DEVICE_INFORMATION),
> +      1,                                   /* NumberofGenericAddressRegisters */
> +      10,                                  /* NameSpaceStringLength */
> +      OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString),
> +      0,                                   /* OemDataLength */
> +      0,                                   /* OemDataOffset */
> +      EFI_ACPI_DBG2_PORT_TYPE_SERIAL,
> +      EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART,
> +      {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE},
> +      OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister),
> +      OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize)
> +    },
> +    ARM_GAS32 (SBSAQEMU_UART0_BASE),         /* BaseAddressRegister */
> +    0x1000,                                  /* AddressSize */
> +    SBSAQEMU_UART_STR,                       /* NameSpaceString */
> +  }
> +};
> +
> +#pragma pack()
> +
> +// Reference the table being generated to prevent the optimizer from removing
> +// the data structure from the executable
> +VOID* CONST ReferenceAcpiTable = &Dbg2;
> -- 
> 2.28.0
> 

  reply	other threads:[~2020-08-20 12:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 14:29 [PATCH edk2-platforms 0/7] Add ACPI tables support for SbsaQemu Tanmay Jagdale
2020-08-19 14:29 ` [PATCH edk2-platforms 1/7] SbsaQemu: Initial support for static ACPI tables Tanmay Jagdale
2020-08-20 11:35   ` Leif Lindholm
2020-08-19 14:30 ` [PATCH edk2-platforms 2/7] SbsaQemu: AcpiTables: Add PCI support and MCFG Table Tanmay Jagdale
2020-08-20 11:40   ` Leif Lindholm
2020-08-19 14:30 ` [PATCH edk2-platforms 3/7] SbsaQemu: Add new ACPI driver and FDT parser to count CPUs Tanmay Jagdale
2020-08-20 11:46   ` Leif Lindholm
2020-08-19 14:30 ` [PATCH edk2-platforms 4/7] SbsaQemu: AcpiDxe: Create MADT table at runtime Tanmay Jagdale
2020-08-20 12:02   ` Leif Lindholm
2020-08-19 14:30 ` [PATCH edk2-platforms 5/7] SbsaQemu: AcpiDxe: Create SSDT " Tanmay Jagdale
2020-08-20 12:09   ` Leif Lindholm
2020-08-19 14:30 ` [PATCH edk2-platforms 6/7] SbsaQemu: AcpiDxe: Create PPTT " Tanmay Jagdale
2020-08-20 12:12   ` Leif Lindholm
2020-08-19 14:30 ` [PATCH edk2-platforms 7/7] SbsaQemu: AcpiTables: Add DBG2 Table Tanmay Jagdale
2020-08-20 12:13   ` Leif Lindholm [this message]
2020-08-20 12:15 ` [PATCH edk2-platforms 0/7] Add ACPI tables support for SbsaQemu Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200820121331.GH1191@vanye \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox