From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by mx.groups.io with SMTP id smtpd.web10.13863.1598362901416506650 for ; Tue, 25 Aug 2020 06:41:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=a2myMk++; spf=pass (domain: linaro.org, ip: 209.85.215.193, mailfrom: tanmay.jagdale@linaro.org) Received: by mail-pg1-f193.google.com with SMTP id v15so6847188pgh.6 for ; Tue, 25 Aug 2020 06:41:41 -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=a2myMk++EAOpgPmT9kE57Xp3K7KlgPhbQgSub5PS1OKXCIDOm0GFcDuK0Q8lD4J/0K O4h6E2wU5d8GJBYMsfsxMYF0znkzjbX3CJK/lCB6cCwNrNR7/WAvYzdDbeSc+oTCIJ7C qy9goQYUS9bW+taYkljRXuyaqd3OAQuyCEzAjX1eecnYNMVUAFfelfwVvZbZNQVIwUfO kvypaIz/WiFPvqdrFjyRcIXK1Bm4MuFuJ8/VTPC0+gb7KFMzsYLdUMVhEYNh4vC0Yt7g wcCTWf6bS3pVtsU7EJ7RBjWLU2YQOcF4vO7j3K17HY3B3sPIWx+hZcK7uIifo/lnx1lI cw9Q== 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=gmIZkGBCYEs4DudM3OTfwgZdPJH23pRxuVsCEFv3n5IFVNl/2LUZtk1nJrN7CzRzbB cq5Exv+MxUq1sNZKO/M4LBqXm7szZmQJFAVir1sFifgkFEaAGJFaTvQB0AISlFBJ2XU/ NcNMqk1Lc++GNwJJlstlmcPMTsEAT2dTC6hQKGasmay6C15zKwqz9yq6fBOy1cePKytQ Msw0axM0peuwC0HRiFZ63w0yxa9JopyCc8Kudmh016Kf4sEm7d5vEdA7IbGM5WPLHGgm fvTnZdCfjowiDmSYhIjFDgx9k/O+B2j/N4KFIA1aCzHXiNYR7P0xzpYTaSNdn1QlU5Hj iAPw== X-Gm-Message-State: AOAM530tzwsh7hblzhiu93TXU1yTQHR+pIy2gskEB8r5nqTFknFCb/xO X8Kznc2wxOJR8aFvrmsZwp/g7VWZs+uSOg== X-Google-Smtp-Source: ABdhPJz3u/klgrDYM0BMAyUsaZnn8NGFTX1CMDMsO/2rWDYyeYYR1o3Uyx6iSvdonxjchbXqgwDSBw== X-Received: by 2002:a17:902:6841:: with SMTP id f1mr7217828pln.228.1598362900996; Tue, 25 Aug 2020 06:41:40 -0700 (PDT) Return-Path: Received: from bean-canyon.localdomain ([106.51.140.68]) by smtp.googlemail.com with ESMTPSA id z186sm3913768pfb.199.2020.08.25.06.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 06:41:40 -0700 (PDT) From: "Tanmay Jagdale" To: leif@nuviainc.com, graeme@nuviainc.com, devel@edk2.groups.io Cc: shashi.mallela@linaro.org, Tanmay Jagdale Subject: [PATCH v3 edk2-platforms 8/8] SbsaQemu: AcpiTables: Add DBG2 Table Date: Tue, 25 Aug 2020 19:09:58 +0530 Message-Id: <20200825133958.17372-9-tanmay.jagdale@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200825133958.17372-1-tanmay.jagdale@linaro.org> References: <20200825133958.17372-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