From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.82]) by mx.groups.io with SMTP id smtpd.web09.6031.1618489161751142750 for ; Thu, 15 Apr 2021 05:19:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=q1KXZZOO; spf=pass (domain: arm.com, ip: 40.107.7.82, 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=KdcaVEiAmSd2E9i9pQbrLUzwaRWFCGos7IFpZxuUMms=; b=q1KXZZOOUjfdmCdmSbOFv/0WPgvFEBkQflGsgkeRjQYpGI6ROxwrJfwGwZXOWkK8CoYRCDaH3FUIpIYwFE5ENMcEmgYw8/461p2Roh4KO8vvqiwKornVmgVkG3cMkUw15TUmxUR82hlobFyJIu0cOxWEE9O3AYnO4B4muT9M8dA= Received: from MR2P264CA0159.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:1::22) by HE1PR0801MB1930.eurprd08.prod.outlook.com (2603:10a6:3:57::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16; Thu, 15 Apr 2021 12:19:18 +0000 Received: from VE1EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:501:1::4) by MR2P264CA0159.outlook.office365.com (2603:10a6:501:1::22) 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:19:18 +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 VE1EUR03FT021.mail.protection.outlook.com (10.152.18.117) 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:19:17 +0000 Received: ("Tessian outbound b610e7b4d771:v90"); Thu, 15 Apr 2021 12:19:17 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 018c2899ab17678a X-CR-MTA-TID: 64aa7808 Received: from ceab533ea348.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 277971DC-2D07-4830-B275-B100933B5883.1; Thu, 15 Apr 2021 12:19:10 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ceab533ea348.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 15 Apr 2021 12:19:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hAFfMsOweyHdcsabGyNAhGvm+t4bCGzfP50svZIk/RUw/taSDfPsUp+Kxe65MBqlnY4K3Um+Kr+PXzIf1nPLMaAfvnYrtFCBjP1RzVIItvuzuR6L7VqZ37zaZM5pZarYf7nllwXCAswB3DrPg6z2UrxUxg1cazD0kAbS2nY2F4l08zHHfJOXB4ifSA33SHVkNlR2ES0dOkkp6ZDO6wyMdZoL4N+YevMnybQPprPKxTQi6BCIsQRKP0LWPobIiJoN8S2OUurx/KQECIDPvPe+A0xfwaujo/HFn/FO8Zyd4YlBs7SEQeYAG7gbjjw6NN/L7svx49kLgUQXG/0upJSezw== 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=KdcaVEiAmSd2E9i9pQbrLUzwaRWFCGos7IFpZxuUMms=; b=Smm0hzeKwWPsj9NhLoFyABp1jB5vAtKBttK8k2tKv5ceMT2U4NKc8WXyXOW1yAndclR2KkgABtkAGc8ic4hZfZUjgsimtxz5m7MhUBe58SzBVuEjVAV+S5PSJAVCIGx7zfzWRkbp0nK4YtiX9Wlj/MoQltqrilWnX/Qode8Ckw4G8alJLQuIyvz9j1lUYVmgyo2/LthS/2VlxI2vr5dTeJtzJ5DHtu6OSAChV6SQc+eRD63iVu54SXB22wE/uu/cL4vCVCapZnTY0nx8ikraklCFtBq0xuI9H5fNvQI2ZEg7xt3TgNn84rceqQaQQoYude5OmPK0x6oRWZ3tZUI4eQ== 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=KdcaVEiAmSd2E9i9pQbrLUzwaRWFCGos7IFpZxuUMms=; b=q1KXZZOOUjfdmCdmSbOFv/0WPgvFEBkQflGsgkeRjQYpGI6ROxwrJfwGwZXOWkK8CoYRCDaH3FUIpIYwFE5ENMcEmgYw8/461p2Roh4KO8vvqiwKornVmgVkG3cMkUw15TUmxUR82hlobFyJIu0cOxWEE9O3AYnO4B4muT9M8dA= Received: from MR2P264CA0175.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501::14) by PA4PR08MB6301.eurprd08.prod.outlook.com (2603:10a6:102:e9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.16; Thu, 15 Apr 2021 12:19:07 +0000 Received: from VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:501:0:cafe::63) by MR2P264CA0175.outlook.office365.com (2603:10a6:501::14) 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:19:07 +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 VE1EUR03FT030.mail.protection.outlook.com (10.152.18.66) 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:19:06 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 15 Apr 2021 12:18:51 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) 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 3/4] DynamicTablesPkg: Set the Access size for the SPCR table Date: Thu, 15 Apr 2021 13:17:19 +0100 Message-ID: <20210415121720.11553-4-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: cf00a7bc-b116-4894-e854-08d90008b0fd X-MS-TrafficTypeDiagnostic: PA4PR08MB6301:|HE1PR0801MB1930: 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: 1QIqeCrzckfQnr61Xz0nTXtbYupe8uFfGFWLa6n7/w7c29GQ4mNQGNQOEz/d/MS+03GwEu3xdn9fYCC4tRi8cmzSYynQEvKVcPxO9idmM35Xu91MQL3pkRocgOtvX8ofTbr/urpXSBInTZtoCdYZJKfQSygxFTRcJcoiGkjgcFF5c3IevHXsR1n/HuSi/EfjC0kwOPrf4fbqJTIPxEWMyw+ENodK9/Ixr9GdYYKnZgbjzfqR/2VZXJBV31aiEI7aZFlED/W0B/OOUHEwSqf8jZbMpsYwcvqpscUHnonzAtiRUsHNHTqZdyCecBLSAHr0twIp62NTkxegkmjQA4ZMi0usmv6avkGzCsomD8JQtg3gW/5N8hugQetHA0n4ZrIJ6NQKBkvxhvA6v28jS4KKEXq2Q55qrp4x+E7rI90jIY9IFxVkHfU1H1nvLNzqPM8NkhG8sW2yxi+JlNIQVImdJtNZebB6l7pt2Q8gyiGqkAnxvd52mPHXKP4izGwRBe6+ztjPIUdvTuBZn2PjIIbrNFBDHdPKab8U5hlm9WaMj/lWCn1Dw8B58Oq+VU13rAlO/V/D4u8MN9LRvstrNg3uT56kNI3Sll6E27/qoJDrRuYwTknQ9GtIeo6LcxjI1V7rFjBwo/00TZzMHL1khEkoo6vd15Drng9sJDTn8mjtJBssF5YDoEdi5IZ5Mrv5zAeP 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)(376002)(346002)(39860400002)(396003)(136003)(46966006)(36840700001)(70586007)(36860700001)(70206006)(54906003)(5660300002)(47076005)(478600001)(36756003)(356005)(7696005)(8676002)(316002)(2906002)(44832011)(8936002)(2616005)(426003)(336012)(186003)(82310400003)(82740400003)(83380400001)(6916009)(86362001)(1076003)(4326008)(26005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6301 Return-Path: Joey.Gouly@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 8dbc0076-0bd9-49f8-f297-08d90008aa6d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vb709CQlcmJTwmJRPTPlnApWeKl6BHeSCfcLfj8qUXAQQCFiTDIk9WgZDqu6l5I87xVxnWE7+ofe2xiUmsdXZRHkcVQcScp2yOWmGvxGCcl51Zb01DA3WdrkPR/3GeqMvAMdWT9XXQxqPKy8lxaV98BV0pdWgMnr3bFW0VaE0FH2JJ2YLxWa3MhgEu6zdmaInAeqw5AOHbbblJg+vKPZozfI2zCGagTnrlpyENjq1wE1+CxbWBCaK7OjZPrFlVHqjYuUyYUR12UYMfvo1BjUIhCwnIPJhUrbpNPXTWEm4A2JtVfQbLInE7hKDX/nfv0hOiPARfw8dpXCU+T5xtLBmhbnXI272BN92GiJ3pvjQ6uPJphQgvC6803IxOuYLVsRDgcEuqlZ59A7JJTrQrjSI0PfHQLq6TuFaoI6SIoU3rXOBy9xOLSxpGHTCJQtf7174vcmveDcIyNbePVRjzS9UM0bt0frABW3UIy5vGd2X4WzbBCB5+vn8JjbQS30zUy9pG6mYfVCOnJjae/fMK5YwdgNqdjx1yNzvBRiPyicXwVffeycHD/V/FTzv6dpFkEakLHStf5s0TNd6gUkxjzniRgWuCA+1aN5FF7Tin7IMeJNNvzOo4jpVLCAAreNXF3tQWNdrVeHOsTePrbYrviiN3pJ1jzlQ0AL+C33UHSW8uI= 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)(346002)(376002)(39860400002)(396003)(136003)(46966006)(36840700001)(70586007)(36860700001)(186003)(4326008)(316002)(47076005)(54906003)(8676002)(82740400003)(70206006)(7696005)(86362001)(82310400003)(83380400001)(2616005)(26005)(81166007)(5660300002)(336012)(1076003)(6916009)(478600001)(8936002)(44832011)(426003)(36756003)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2021 12:19:17.7515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf00a7bc-b116-4894-e854-08d90008b0fd 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: VE1EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1930 Content-Type: text/plain The SPCR 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 SPCR generator to setup the AccessSize field in the Generic Address Structure (GAS) for the UART in the SPCR table with information provided by the platform. Signed-off-by: Joey Gouly --- DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c index 24bb5c014607b0746c4a8bb8bd260510fbdff08b..fecfd6bbabd63698f5f45f6bfbd494f25cf0faeb 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c @@ -1,7 +1,7 @@ /** @file SPCR 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 @@ -313,6 +313,26 @@ BuildSpcrTableEx ( // Update the base address AcpiSpcr.BaseAddress.Address = SerialPortInfo->BaseAddress; + // Set the access size + if (SerialPortInfo->AccessSize >= EFI_ACPI_6_3_QWORD) { + Status = EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: SPCR: 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 + AcpiSpcr.BaseAddress.AccessSize = EFI_ACPI_6_3_DWORD; + } else { + AcpiSpcr.BaseAddress.AccessSize = SerialPortInfo->AccessSize; + } + // Update the UART interrupt AcpiSpcr.GlobalSystemInterrupt = SerialPortInfo->Interrupt; -- Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")