From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mx.groups.io with SMTP id smtpd.web12.3125.1636104237320381422 for ; Fri, 05 Nov 2021 02:23:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=wuZhtqqy; spf=pass (domain: linaro.org, ip: 209.85.216.51, mailfrom: masami.hiramatsu@linaro.org) Received: by mail-pj1-f51.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so2917529pjl.2 for ; Fri, 05 Nov 2021 02:23:57 -0700 (PDT) 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=TzLgO+iTsmBuD8PSAU8BRdE6vea5ZhbrVtEzYAIU4PU=; b=wuZhtqqy4l5JOxc9tdC4LxTIdQmPBAwxx3J8OtmYwYheKf3fPh35Ryy7rjSg8oCAwU 9MTVtK2tmmowsBCqzQIalVMSkP9wMot7nMWJPv+jY0SRoJ8RV0n2b7LkPv+rKk1WbuWj lxwKR5V95Q2NUf9s2gPav27e+Arckn/kfMwpKZSEAkPZ9IzhhRhTF2YcMck8OQARwdZm EdfeyHQbmh3B5S1gp5FL91oNi53T6qOa3SB+7A4/ngBOmgkUOtLtS0rv1FXTnYTG2J89 LL5VrdRNCxKHFIOLKRUJlfgBfYiuZ7g5S7hvcep7jVMaxt6UBcyeVHU+bFACMT6aDBve VbdQ== 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=TzLgO+iTsmBuD8PSAU8BRdE6vea5ZhbrVtEzYAIU4PU=; b=NteQ/HhqJxkt5tF8SvWzr2LSTMTUteNTwETvz8HG1uvujPfIeI2Tyg56tYRPX2m4Bn +EqTPm2pyYduxTlSjb5OBSyrf0flMywvLOnmlw+mPC1NPc+2+1EG9gT3GNf0TJ6pLNf+ rSvZa7xxUkdhseeWDk31OPa0jhR/JCVms6zrE3abyj28A7n+twn6poTcGB7rGQdeU8tR OZ3HRmq2d0ZsFv2U1NM9JX4YMsbI1yXVM6xgjJPEI5JNcUz1k4HWBsCREt4zBxy5T9BN Ovr9wbsJJyYF6g5k2yyFqeMIOmkfLg0MsK0faYisWKBdZ99V+csvTK8CCQaWI60yLOIi IWQQ== X-Gm-Message-State: AOAM533JPcHQXrw3lv4IRBXgwnjpCKoc93WCPYE51xhwkbI40w6Uedzb XTBgOuSP4DZutzckHZCA3lx8aw== X-Google-Smtp-Source: ABdhPJzEKz2gV+t1ZBOMEAIFbjseHuNyGXY1GQ7lFS6qaul05p02s5zehEtCCswA4i33gfmTkLsKfg== X-Received: by 2002:a17:902:b084:b0:141:f5f8:1c5a with SMTP id p4-20020a170902b08400b00141f5f81c5amr28325328plr.40.1636104236171; Fri, 05 Nov 2021 02:23:56 -0700 (PDT) Return-Path: Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id y32sm7564401pfa.145.2021.11.05.02.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 02:23:55 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [PATCH 4/5] [edk2-platforms] Silicon/SynQuacer: add DBG2 ACPI table Date: Fri, 5 Nov 2021 18:23:53 +0900 Message-Id: <163610423326.391624.7578010263371252647.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163610419943.391624.9289897029386201296.stgit@localhost> References: <163610419943.391624.9289897029386201296.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 --- .../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 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 } + +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;