From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mx.groups.io with SMTP id smtpd.web12.4027.1639119075882991755 for ; Thu, 09 Dec 2021 22:51:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=aOQkDW9d; spf=pass (domain: linaro.org, ip: 209.85.215.178, mailfrom: masami.hiramatsu@linaro.org) Received: by mail-pg1-f178.google.com with SMTP id r5so7257904pgi.6 for ; Thu, 09 Dec 2021 22:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=QExIVZ06WNrsrzCLbYmkZ+pBW0caCM7XZWYg8FoWzG0=; b=aOQkDW9dkmrV86jklXcyc8gC1iUeM4mex8Mipo53VgUGJsQu98ff6QWElFzjlM/T9N t5hcrOato4M4Lg5JI3VFkYzw3dICX7AmvSQyer4hr3P73wyC6iNDh+a+BVPiSX7WUAVa buejkW2c1SxWbLhSIfp022whIxvfJf2ltRWP0GGhIwmeB6hYQd29cLloq2dj3GiKUvqA dgPhf1sl7fV8z+7p2hcgRMJ54UBRlEePtWsRRP+Zz+BHFHYEd/jBWUgunwIqXfoeW/ql xf+Jl7PX+tDCZgbYVD7QL+EoLKmWrOtpYf11cTrbhKRym92nuN8ULMwqC/QQ9bH0pYBr uZgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=QExIVZ06WNrsrzCLbYmkZ+pBW0caCM7XZWYg8FoWzG0=; b=1O1gSLq198kHJAl92ZrqPC6Xr60mhnZG/MCdJoubTguuy9JytChR0xzgACB0fuyjOn 6Paf0TYCpDPGY7RT9Q5G/Qwnb6L0UTst/o87CJf+4hpxDXUMASPZBC0EiqNLbF4rFGba SFbsj5JOSiCk/liOBJbmZEmAEmNoEo9IuyXUvhLX4Gbe1q4Qg1bIwbYjihc1o3j9nsYD ZyN6BeoGSeZm72K2LZtdzWONcSHzRXsXZtnI7fLgImY/K+xVNUOY+e3yJzwSIk3T9ns5 nK1qe/eQF78Nq2+Mr9vFB+DeJy0fRy/n/A2JvT3p1nj7w4rHb5c5KiuKovtlwHDPG+Oo 3N+A== X-Gm-Message-State: AOAM531ABaSonhtTjMnRFzsTYQe94nSsj3hzDAPUTq5t+GKecLh0Tohn /HByz5FzDEcYN/yuac49ZejOwQ== X-Google-Smtp-Source: ABdhPJwnWhYUwqrXrNnc3Tfh7uIBttTCXkmwoJqvQJbJco+RlF4U55VvrkA2juPVJkDg5QWaXYZ8Dw== X-Received: by 2002:aa7:8219:0:b0:4a4:bec7:ef10 with SMTP id k25-20020aa78219000000b004a4bec7ef10mr16303843pfi.37.1639119075392; Thu, 09 Dec 2021 22:51:15 -0800 (PST) Return-Path: Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id c2sm1879213pfv.112.2021.12.09.22.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:51:15 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [PATCH v3 5/6] [edk2-platforms] Silicon/SynQuacer: add DBG2 ACPI table Date: Fri, 10 Dec 2021 15:51:12 +0900 Message-Id: <163911907249.561661.11382999726925773930.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163911902995.561661.9429300579159746333.stgit@localhost> References: <163911902995.561661.9429300579159746333.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 --- Changes in v2: - Move Dbg2.aslc before Dsdt.asl to keep the list alphabetically sorted. - Use EFI_ACPI_6_3_SYSTEM_MEMORY and EFI_ACPI_6_3_BYTE for initialization. --- .../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..e77d7a3056 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf +++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf @@ -19,6 +19,7 @@ [Sources] AcpiTables.h AcpiSsdtRootPci.asl + Dbg2.aslc Dsdt.asl Fadt.aslc Gtdt.aslc diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc b/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc new file mode 100644 index 0000000000..89c9dbd998 --- /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_6_3_SYSTEM_MEMORY, 32, 0, EFI_ACPI_6_3_BYTE, Address } + +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;