From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.56]) by mx.groups.io with SMTP id smtpd.web09.6010.1618489076324412530 for ; Thu, 15 Apr 2021 05:17:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=7xcl0M94; spf=pass (domain: arm.com, ip: 40.107.6.56, mailfrom: joey.gouly@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8/1QEKQHB6Fm4oGsittkbgldOZ9eLtLNHlzc3yX9pgs=; b=7xcl0M94QdynH/e3bp6j5pjIdtcO0yP0kM6rVnFRIXMxPmy2pAG1yMpMDdOZq/Q07Hj+eHLsgZM05J3sW+yh1iNMOupkejK4Traf+PHH6F1x0ATFiY3XsLO7zu4XgJ9xi8y7JN80mft30fPyCFhVI9OYaAKQ4ZVrIpvOdIUHSzg= Received: from AM6P195CA0097.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::38) by VE1PR08MB5101.eurprd08.prod.outlook.com (2603:10a6:803:106::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Thu, 15 Apr 2021 12:17:50 +0000 Received: from VE1EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:86:cafe::28) by AM6P195CA0097.outlook.office365.com (2603:10a6:209:86::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16 via Frontend Transport; Thu, 15 Apr 2021 12:17:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT017.mail.protection.outlook.com (10.152.18.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16 via Frontend Transport; Thu, 15 Apr 2021 12:17:50 +0000 Received: ("Tessian outbound 82c2d58b350b:v90"); Thu, 15 Apr 2021 12:17:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 10068dfe2ce447ab X-CR-MTA-TID: 64aa7808 Received: from 478039097243.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D856270C-329A-42A7-A977-E9AB10A7F2A8.1; Thu, 15 Apr 2021 12:17:41 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 478039097243.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 15 Apr 2021 12:17:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cUyHn8QCa+45UGnwX24I9M52Rq4UcP5U+AsP4NgOsSGS4yo6319CHXfKBwBlz7/zsluGL/x2h4j/7q9xm7rmbloa6aHNebRmdlDc6XdakeOJ/BBXWMjhzXY6rHKBNsuoJKjXVT+P4CwCEToEQNcj8SRE7HWjky0l6Cf6UPHMoGw4VWcoXeQyI0DJIkRgf9de1enF1WWjzhj9aETYCtR1RGyf2dzQ3fZXTDh4dq079PUeA2+QaSU0MCIJLTBKbdH9h7BVnfb1eA6I0kqVOmkd2uMBe0nKtFXECL3SZfT01mreP2wr/cuNiyv78RPk0HowdxduNrLp+Du6RIZIS7StKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8/1QEKQHB6Fm4oGsittkbgldOZ9eLtLNHlzc3yX9pgs=; b=lDL3BOgXJMUg1do6SAJzWL8IfQu+REW/N3v7RMw1BBNHtw+ptZrGAo2fcNuycbNCq/lIhqOz1eBdd57xyZEsHvJdyVTaCDdKfd3UxugSyC5zeDlq4jSoJntGrh0ZNvW0BvhdNR3HDuyN55W/1nngNQdK+BvPH6oGxznYIJBdmJzPhQRK7ymld8m8gS4wyA5RatUjKqUEkOBzoz5o6LsBxk0GSYQjYNSenQr5MbOmI/SD/h+1lX71VnM1RvwAzdtXbaqjYHrTwHAUIXfLl7g5NOyxCJXBmKzTTM6maXzyKQSej0wzpqMEKTNNbs3JrYDgYwk8DsnocM16UOxuTKYdtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8/1QEKQHB6Fm4oGsittkbgldOZ9eLtLNHlzc3yX9pgs=; b=7xcl0M94QdynH/e3bp6j5pjIdtcO0yP0kM6rVnFRIXMxPmy2pAG1yMpMDdOZq/Q07Hj+eHLsgZM05J3sW+yh1iNMOupkejK4Traf+PHH6F1x0ATFiY3XsLO7zu4XgJ9xi8y7JN80mft30fPyCFhVI9OYaAKQ4ZVrIpvOdIUHSzg= Received: from AM6PR0202CA0046.eurprd02.prod.outlook.com (2603:10a6:20b:3a::23) by DB7PR08MB3897.eurprd08.prod.outlook.com (2603:10a6:10:7e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16; Thu, 15 Apr 2021 12:17:38 +0000 Received: from VE1EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:3a:cafe::5e) by AM6PR0202CA0046.outlook.office365.com (2603:10a6:20b:3a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16 via Frontend Transport; Thu, 15 Apr 2021 12:17:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT023.mail.protection.outlook.com (10.152.18.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4042.16 via Frontend Transport; Thu, 15 Apr 2021 12:17:38 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 15 Apr 2021 12:17:21 +0000 Received: from e124191.cambridge.arm.com (10.11.7.12) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 15 Apr 2021 12:17:21 +0000 From: "Joey Gouly" To: CC: , , , Subject: [PATCH v1 4/4] DynamicTablesPkg: Set the Access size for the DBG2 table Date: Thu, 15 Apr 2021 13:17:20 +0100 Message-ID: <20210415121720.11553-5-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210415121720.11553-1-joey.gouly@arm.com> References: <20210415121720.11553-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ce773d7c-6a12-4e33-5da9-08d900087cca X-MS-TrafficTypeDiagnostic: DB7PR08MB3897:|VE1PR08MB5101: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: nGobmkpKCAkNP0M8foi1f9si/mpVBy81azbgvY/bLKZ4SbBIGYFO2/jrDD8lDhh+T+RprnQGw8aclyOSNP/72otKGnFwoF+e0rx+QC1pSY1I2S6aJfAC9TizqRwz4TvVp1WFC7Bfr6Ipk50bs670AghkVWozM9PjOYkq6NEzJegoWavwokopE0ETznjM/Gu7+BzsrgZFYQAtPb5Ei1GHpB+s1C3JMccHQY1Ue3Kjz5FK6CtGx70vZzkU6lR7tGWyDH5L52IybHtjmU4LviMSqdOjdXyJne2RPtidm9KcaglC9jsY3nEsvTxlzfbpKllpCCW7gdEPJovngT/JU1fp3Y/u+PP2GqB0fYfx0Qc/+tV0YJriftFSz6yI6QQVh9u57DnGB5rjChZ9pKIK5qOPgVdolxJJ/J+hlAbV7Z0lHCLKUNAs1RpHjck6PNqUoTQJdGLn4/xQAh3dG0W/BVw92kn3E6rgpehizy+cZlYUyQMu+52BSQYLB2KU1ZqpVWHMh2pmk02GcfpTtClKWUJNZ8LhjWA8bCu2lG9waXiqZd4okJ4mE39eRO5XCOahduywxxxNPz/R3zcXBRYgM/IohfRQike5JEw0tFhoqDHxFtos6FYv1S9jFS1ATiJRA7g2N3hgvmsK+z+D2XEpFWl5483EBC4Dc9F8LzJ+LdoKXJFoVVyk4SuGUOR1yY8vf/Gw X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(136003)(396003)(39860400002)(346002)(376002)(36840700001)(46966006)(8936002)(86362001)(426003)(81166007)(8676002)(2906002)(36860700001)(316002)(47076005)(82310400003)(356005)(4326008)(186003)(6916009)(336012)(5660300002)(478600001)(1076003)(26005)(44832011)(70206006)(2616005)(83380400001)(82740400003)(36756003)(7696005)(54906003)(70586007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3897 Return-Path: Joey.Gouly@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: afc47c39-1885-46a0-9fe0-08d90008758e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q3R6ynzXe/PcHwwtjJ2yM4uBOqXdyDbRqNynh2qWCoKa0g4Y5Y6649wSIMSjynlxHUwr8Q+xQPiMW+v6ZJtIVirsxcDza6EvFUmfP58ww/rUYYXzxBFMaPkcbtXyuV3M/gjrchj1NtKvvsOVPF0jVJeRZz8tVx5JOJL4WrCYE90d91BJn8+HKTTPph9b5w4Vfzg8Q1rg05fANzg0DD0OX+NCwJ8iA+fo3TUHfKl7D/qRCmwSIJI7ipsOPume1WcVA4sN/CtRDd9AycwPag3s6cESvtczoYfS3XIh22dOFC3Qt2gtbFjJGzEG4mOPSNXO4wx5XewD/9odV0XGhYQIzNqFJVZgEeb6Tz3SnmVgRz0RlErTSCRo8gz/o+noeTqM1KLwddDhI8AxhDkHhDcScOVuF3Pwpl1sqrW740TRJrR2M78xVVgKRSPZeJImqlq0wDN/9Kl2lAb+xmwwkT2wk8DdNvDWR1qZjOum5Bd+zyRrCYputR2bMXyQrbBLwK49N5i75pApLvNLMAaWAfCqWc/paf0bXSuZ4udd6f9RbuddMKN9SJUwm+TOpcLLJ6xv2E3Ld/PFn8pNUvegGUtqgiNy5iic5bsrAQjhUml6EGxXnze70nT77iYOsjTqTRXeZ0wg+SzgwuHnVzNdBTTgiN0RhDHvVKOR+jjMlou+qsI= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(396003)(136003)(39860400002)(346002)(376002)(46966006)(36840700001)(36860700001)(47076005)(316002)(5660300002)(8676002)(81166007)(26005)(1076003)(6916009)(4326008)(54906003)(83380400001)(7696005)(82310400003)(336012)(86362001)(70206006)(44832011)(70586007)(2906002)(478600001)(82740400003)(186003)(426003)(36756003)(2616005)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2021 12:17:50.1681 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce773d7c-6a12-4e33-5da9-08d900087cca X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5101 Content-Type: text/plain The DBG2 table generator set the access size for the UART to DWORD (4 bytes) by default. However, according to Section B Generic UART, Arm Base System Architecture 1.0, Platform Design Document, a Generic UART can have BYTE, WORD or DWORD access sizes. To address this an AccessSize field has been introduced in CM_ARM_SERIAL_PORT_INFO object. This patch updates the DBG2 generator to setup the AccessSize field in the Generic Address Structure (GAS) for the UART in the DBG2 table with information provided by the platform. Signed-off-by: Joey Gouly --- DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c index d902bbc8463921624f1a6333e8d6bd84c6cb38f2..a7508d4a8834fd2038946a62de39e9cd0894bf79 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c @@ -1,7 +1,7 @@ /** @file DBG2 Table Generator - Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.
+ Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -420,6 +420,28 @@ BuildDbg2TableEx ( AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].BaseAddressRegister.Address = SerialPortInfo->BaseAddress; + // Set the access size + if (SerialPortInfo->AccessSize >= EFI_ACPI_6_3_QWORD) { + Status = EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: DBG2: Access size must be <= 3 (DWORD). Status = %r\n", + Status + )); + goto error_handler; + } else if (SerialPortInfo->AccessSize == EFI_ACPI_6_3_UNDEFINED) { + // 0 Undefined (legacy reasons) + // Default to DWORD access size as the access + // size field was introduced at a later date + // and some ConfigurationManager implementations + // may not be providing this field data + AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].BaseAddressRegister.AccessSize = + EFI_ACPI_6_3_DWORD; + } else { + AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].BaseAddressRegister.AccessSize = + SerialPortInfo->AccessSize; + } + // Update the serial port subtype AcpiDbg2.Dbg2DeviceInfo[INDEX_DBG_PORT0].Dbg2Device.PortSubtype = SerialPortInfo->PortSubtype; -- Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")