From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by mx.groups.io with SMTP id smtpd.web11.89286.1597847487381580033 for ; Wed, 19 Aug 2020 07:31:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=jAKTB0iN; spf=pass (domain: linaro.org, ip: 209.85.216.68, mailfrom: tanmay.jagdale@linaro.org) Received: by mail-pj1-f68.google.com with SMTP id c10so1232918pjn.1 for ; Wed, 19 Aug 2020 07:31:27 -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=rTdD1A2yw7+0Ahxt3+5SKSIahyZsivos48wDG6V2e5A=; b=jAKTB0iNWxv6PpTFL4urH6kcoRxcQRWeH2i5Ur8vqYbEwTWzPz56+B5sEWtXIWgQYl 28SYSecIhHXaHQZjvD+4GgR+PhfxBs67gZa/eev169WfpYqi0EZeulV/4fTUUVKZecGG itORMCNH0gKhU4DfCUoIsJBWq2Q8/oMzoSO261lWHGQ3t7h32QPAZ9qxHAT2CUZzsf6q Jt5RVPRjaMtvLfbkfMg3XYNLlTOB07cjZ7Q1ya5btzto7uELb98HhJH5jJxFSH9V1rrV Neqh+t+hN2Vk8L3eFKkfi0q2N+pmESwQLQYJKIW5zZHnaktRcnn+p2D8xuqXdcLBbTU8 z7NQ== 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=rTdD1A2yw7+0Ahxt3+5SKSIahyZsivos48wDG6V2e5A=; b=rWFh6mTbVZ6D/DJenaaKaAAtsAjAsTEBbLvNrC7Fe8QQJlAQqfL5uWlt7KVgEGv7iS itoykY129MnVSgxrd0XCc55iNppgeVbQ7Fmx+CzdgFs6JFoUiPXWFCEQZfGTbNKZOncq afxo8XqZyIBkC33sRUy1enFOQMPqXRUuIEwvKrtUd0F0wI8RxgfSbpgFaMYS9didVdQb sB7aD6kDVS6Yqfn1krB7FZdPR474OC8NKKUUvRiyUtCJmkQCwFnEIyqzcRE1Dee2ATTN lVVTvyY+9/KXJX3FtIpiinL4KRqtpM2TIb23sHKNoGliNMNdBYn23rhG8YsQma2ohyG7 EOvg== X-Gm-Message-State: AOAM530O/VpmiZ7F5oPiETneA3doslzhHc5o45eeSqRd5RxdnFbWTQB1 9Yja5oZq9sjg4pTt1//wW34Q3A== X-Google-Smtp-Source: ABdhPJxL0vsSKNfYZpdzge7M6zVmyuoaV5PSTft94VjfB90M8EvdHfxq7iFvQBqU1d0q959CxgL+Mg== X-Received: by 2002:a17:90a:e94c:: with SMTP id kp12mr4118821pjb.115.1597847486994; Wed, 19 Aug 2020 07:31:26 -0700 (PDT) Return-Path: Received: from bean-canyon.localdomain ([106.51.140.68]) by smtp.googlemail.com with ESMTPSA id y10sm3320752pjv.55.2020.08.19.07.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 07:31:26 -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 edk2-platforms 7/7] SbsaQemu: AcpiTables: Add DBG2 Table Date: Wed, 19 Aug 2020 20:00:05 +0530 Message-Id: <20200819143005.13999-8-tanmay.jagdale@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200819143005.13999-1-tanmay.jagdale@linaro.org> References: <20200819143005.13999-1-tanmay.jagdale@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Tanmay Jagdale --- .../Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 1 + Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc | 68 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf index 0b5017ce81c5..cf6628c9e491 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf @@ -17,6 +17,7 @@ [Defines] [Sources] Dsdt.asl + Dbg2.aslc Fadt.aslc Gtdt.aslc Spcr.aslc diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc b/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc new file mode 100644 index 000000000000..801b05b59a42 --- /dev/null +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dbg2.aslc @@ -0,0 +1,68 @@ +/** @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 +#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