From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.web08.27146.1637950215918698023 for ; Fri, 26 Nov 2021 10:10:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20210112.gappssmtp.com header.s=20210112 header.b=11Wmgx8T; spf=pass (domain: nuviainc.com, ip: 209.85.128.44, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f44.google.com with SMTP id d72-20020a1c1d4b000000b00331140f3dc8so7335135wmd.1 for ; Fri, 26 Nov 2021 10:10:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ott3TuJ8sr9794Yp1x8SdzHNZlAN6aPCqs4u9omH1XA=; b=11Wmgx8Tsrkkd45ilI7UYz+4LQdh30Z0SboFu5a+kgWikP5S7BA6nMHNttXXjP/p5Q Tl9njRwdFykhO/0bmJWgpeCTlaT281sIigrHTMSayAU9xXzKYG/vbZfYPZ6jcpjlaZiK LcQZLUXlo6v7isUvH8ROWnvbSnqSB4TRMD49W3SiBIqpOcL5oQNjt8vNCnpkg/FrbcDw v5yu0xtkMgwY/CLxSsqmZ6d5gpz1YuuZNa8m1/A5AqaTXZ7QmYHKEgTTMW8CXXeFJNRP yjRXGgPUwVfSWe86QXNk0cQXiN+mcGgx6j3KSI2LD9AZ0LOCpZcv2GL2gFigwYfqDLSi d0yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ott3TuJ8sr9794Yp1x8SdzHNZlAN6aPCqs4u9omH1XA=; b=VTKCDC2n7a+F8hkPEJKiH1C4Huav2Ycfajz0GUZzX7cdt18ZuVXb/QgUZty0mdG2+k pfyyPMyVUvqiJq/hZXPBTPaihbl4FWIudhoV73CRSrV+Gfbdyk+kg8t/U+ohivV94vLi TxR6zZt5FQSEtOYY/5zJp962tjL1gqTeOpct3CduSVs3JU/qczlS+i49YclHgE/iu5y4 6c4AidUmZrw03zudHGe0ixSy9kL7ApBS3b9kO3Bt/JZV0dVSAEcHFYfYWb7MW9Lg/TYm gv3Y9rvQkMbGceleXRrJ19rf1CedDaexRlc2+RoMH2S0A8kMM64eWeVu1V8AhErLBdUV 6UYw== X-Gm-Message-State: AOAM530xCAZFRENCNqDGwCxTjhzeiotOkB47G0u5c4MHsAXg09GIGImP Xot12lWeBu8+/zTnIz8EuLjYhA== X-Google-Smtp-Source: ABdhPJzoeK4sb/i8xDBvoyKjfEB8tNVoFPMMGneh4Y2/DfdMcEUJXvUuiRQhyR4pbdQCyYNsBgbb2g== X-Received: by 2002:a1c:1903:: with SMTP id 3mr17325005wmz.89.1637950214196; Fri, 26 Nov 2021 10:10:14 -0800 (PST) Return-Path: Received: from leviathan (cpc92314-cmbg19-2-0-cust559.5-4.cable.virginm.net. [82.11.186.48]) by smtp.gmail.com with ESMTPSA id r7sm5989488wrq.29.2021.11.26.10.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 10:10:13 -0800 (PST) Date: Fri, 26 Nov 2021 18:10:11 +0000 From: "Leif Lindholm" To: Masami Hiramatsu Cc: Ard Biesheuvel , devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: Re: [PATCH 4/5] [edk2-platforms] Silicon/SynQuacer: add DBG2 ACPI table Message-ID: References: <163610419943.391624.9289897029386201296.stgit@localhost> <163610423326.391624.7578010263371252647.stgit@localhost> MIME-Version: 1.0 In-Reply-To: <163610423326.391624.7578010263371252647.stgit@localhost> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 05, 2021 at 18:23:53 +0900, Masami Hiramatsu wrote: > Add DBG2 table to ACPI tables. The COM1 uart port will be used > for OS debug, and it is 16550 compatible. > > Signed-off-by: Masami Hiramatsu > --- > .../Socionext/SynQuacer/AcpiTables/AcpiTables.inf | 1 > Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc | 70 ++++++++++++++++++++ > 2 files changed, 71 insertions(+) > create mode 100644 Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc > > diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf > index 886777a0fa..3023206330 100644 > --- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf > +++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf > @@ -22,6 +22,7 @@ > Dsdt.asl > Fadt.aslc > Gtdt.aslc > + Dbg2.aslc Please move this before Dsdt.asl, to keep the list alphabetically sorted. > Iort.aslc > Madt.aslc > Mcfg.aslc > diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc b/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc > new file mode 100644 > index 0000000000..027b3b658b > --- /dev/null > +++ b/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc > @@ -0,0 +1,70 @@ > +/** @file > +* Debug Port Table (DBG2) > +* > +* Copyright (c) 2020,2021 Linaro Ltd. All rights reserved. > +* > +* SPDX-License-Identifier: BSD-2-Clause-Patent > +* > +**/ > +#include > +#include > +#include > +#include > +#include > + > +#include "AcpiTables.h" > + > +#pragma pack(1) > + > +#define SYNQUACER_UART1_STR { '\\', '_', 'S', 'B', '.', 'C', 'O', 'M', '1', 0x00 } > +#define SQ_GAS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_BYTE, Address } Use EFI_ACPI_6_3_ consistently? / Leif > + > +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 = { > + { > + __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_16550_WITH_GAS, > + {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, > + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), > + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) > + }, > + SQ_GAS32 (SYNQUACER_UART1_BASE), /* BaseAddressRegister */ > + SYNQUACER_UART1_SIZE, /* AddressSize */ > + SYNQUACER_UART1_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; >