From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web12.9308.1638519179178782612 for ; Fri, 03 Dec 2021 00:12:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=cJjJkb9U; spf=pass (domain: linaro.org, ip: 209.85.216.52, mailfrom: masami.hiramatsu@linaro.org) Received: by mail-pj1-f52.google.com with SMTP id gx15-20020a17090b124f00b001a695f3734aso1883013pjb.0 for ; Fri, 03 Dec 2021 00:12:59 -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=cJjJkb9UOocnnpQLLVjnnEohyPL+R2G1lH+oll9q0DTAU9Mv0Px5RyzPfWP8Dgk01e Pedj3g+cRQ7QdtpRZM0o2tMJhszClHN4SzqROah8haw8c6JYdi9RpSPUtGMWurW0bqcz 64rB4S4Jgj3vWJKHkkv1desQxk934d80JlemQyQlW9Zgre3ZROJGKOy32N9GLUDOf3AM X2bt7DK/4sB5PMOyav6crJ1jrXp4QFyD1hoT3oxyhXeGm3fxg9g94JxKP7marElmBX/k wRZggnyypopTOrtANEXe2a9BESo3/uENIkZIDtQ4JhS2oTLD/FJU4CC5f5cV91fdXCMN Yodg== 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=P1IO3hP4I8Bz0CxyR+3VF/1YYWzNJjSmT1cvb7pEISeBvueHqaP/8gZTReV1uwZDsH UCccGEdyDW7npKjQcjs1hpEAyMTHPYM2RXxcRvjAvcMe5yrVxKPxVcsG1+CzczrftPm2 a8gQy1ZsDC0mT6cidkkOj8tM9taWTtOUiAqLM4eWJu6ifEFUYWlK0S5mrjKjKqr+KZlW iOpk4UHhd3CegeA/AeQiCZayseD5qpt2UkuRB99HvDCK6hgLGGUAv2HLhENeu3J5K/Zf d5rwtWUj7oWQPUDzFp7fzLVk+2X6Am1IEcUc9x6XuC3BYpG4alG1yRgJ46x4Fe8AAdEY PeHw== X-Gm-Message-State: AOAM531jCHlOWhTiNXZAYix/2QWG1bnpCqkBF8kDsInUOzMpgtw/iJto JkayYFuIAflz26+7Vs1TmJSPDw== X-Google-Smtp-Source: ABdhPJyM+B6VWirZrw6FMHu3TOFdGalmHv/H64M6q10ZrTC6q0WVmR0UJPuZdvWS6AJw045s5zxv5g== X-Received: by 2002:a17:90a:6886:: with SMTP id a6mr12421009pjd.78.1638519178736; Fri, 03 Dec 2021 00:12:58 -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 o124sm2142602pfb.177.2021.12.03.00.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 00:12:58 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [PATCH v2 5/5] [edk2-platforms] Silicon/SynQuacer: add DBG2 ACPI table Date: Fri, 3 Dec 2021 17:12:55 +0900 Message-Id: <163851917557.1636051.61892798163129130.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163851913341.1636051.3357297397950801289.stgit@localhost> References: <163851913341.1636051.3357297397950801289.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;