From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by mx.groups.io with SMTP id smtpd.web11.8807.1598340280208400962 for ; Tue, 25 Aug 2020 00:24:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=AbU3Gz2l; spf=pass (domain: linaro.org, ip: 209.85.216.66, mailfrom: tanmay.jagdale@linaro.org) Received: by mail-pj1-f66.google.com with SMTP id n3so431719pjq.1 for ; Tue, 25 Aug 2020 00:24:40 -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 :mime-version:content-transfer-encoding; bh=N9JVLoYWWh8q3mPcARlb6rdOw1gckssOh4hBwbWWVNo=; b=AbU3Gz2lt/I+ZrsK3NQ3J8WUHJj+CH02SqfmflPVe484JSln2aOWvoAEyCGLaB0lBO EGMg+eZZqSihmh5wJCYf75iAmTsX5z+7yokpkISxcqH4kYRb4gchDZgt1Bl+dZz0QRnv edB8PJOi3TEap/toMHsf0t4cUNmToC6jDuv7nTAWG6kaHxOFuAJkShRB/t7GwcS52P38 x8CuU4OqgboqEe2rHP1sZdZZvjeM2W2Z51LF/k3ExZYqAQnoFjD390cbsAf6Cu4IDXQe LpuVNLzO429BhLUMMPR0m/BlkJQDv/6mKrEM/D3jFFfWbh2fWAKdK1VientkrYZALC/L cr8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N9JVLoYWWh8q3mPcARlb6rdOw1gckssOh4hBwbWWVNo=; b=eBqfXdH4RVOIP6MD6b79BaTGPBcdQoW/PDaVfnpS8ew5LRuMgVe6f7VbZCKhOy4jKq KEUyoj9tNAmOdloUyfq6Vm+mWCdvBB+aPSG3nNP04BNbSDx4yV8+WOUkT1C6RgMBpKuC QxDx4ewGvKln4HWhLBJNGTjL7TxbIrxa3KZHdAu9Pc7W/eAzLiVGK68XT36f2HwcpiQ5 EkOj3vOahSbl+pNf3Ezqjd1o4CLLFwrCKskDSqjp2jS/T7qEoiCZ9R9VaNk/TC9jiD+y xkqSZDDk9V3DSNWRqEXAf7kGMbQp3D5s+2aztUoj1rz4JaU3HmYinLH315a6XG6thoZA YJtw== X-Gm-Message-State: AOAM532EwzYbQ3M3h+rq8ORgDr4Zo7LyhUZDVAJDkECwjhm7z/QbE+0a fptrYR58gNTYJp2Pgq7358urNA== X-Google-Smtp-Source: ABdhPJx2ZlfRZ1E5X63bG8n6VLo20wth5LGuGjs05cdSY2lWSlT7d05QiNqUaUSB40lneJZ0rzjZ/g== X-Received: by 2002:a17:90a:887:: with SMTP id v7mr504823pjc.177.1598340279808; Tue, 25 Aug 2020 00:24:39 -0700 (PDT) Return-Path: Received: from bean-canyon.localdomain ([106.51.140.68]) by smtp.googlemail.com with ESMTPSA id d5sm1722417pjw.18.2020.08.25.00.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 00:24:39 -0700 (PDT) From: "Tanmay Jagdale" To: leif@nuviainc.com, graeme@nuviainc.com, shashi.mallela@linaro.org, devel@edk2.groups.io Cc: paul.isaacs@linaro.org, tanmay@marvell.com, Tanmay Jagdale Subject: [PATCH v2 edk2-platforms 8/8] SbsaQemu: AcpiTables: Add DBG2 Table Date: Tue, 25 Aug 2020 12:53:22 +0530 Message-Id: <20200825072322.10848-9-tanmay.jagdale@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200825072322.10848-1-tanmay.jagdale@linaro.org> References: <20200825072322.10848-1-tanmay.jagdale@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Tanmay Jagdale --- Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 1 + Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc | 67 ++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf index 57d717fefafc..7216a53304df 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf @@ -16,6 +16,7 @@ [Defines] VERSION_STRING = 1.0 [Sources] + Dbg2.aslc Dsdt.asl Fadt.aslc Gtdt.aslc diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc b/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc new file mode 100644 index 000000000000..c9e3ca77ab53 --- /dev/null +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc @@ -0,0 +1,67 @@ +/** @file +* Debug Port Table (DBG2) +* +* Copyright (c) 2020 Linaro Ltd. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ +#include +#include +#include +#include +#include + +#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