From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by mx.groups.io with SMTP id smtpd.web10.3402.1592856885157779361 for ; Mon, 22 Jun 2020 13:14:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=M7IOu8Hj; spf=pass (domain: nvidia.com, ip: 216.228.121.143, mailfrom: ipark@nvidia.com) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 22 Jun 2020 13:13:13 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 22 Jun 2020 13:14:44 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 22 Jun 2020 13:14:44 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 22 Jun 2020 20:14:44 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 22 Jun 2020 20:14:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUxku6ooRvMjjWLZSwPn3mPOYLbacfmlagQZ/M2Ac+94P4L/n9cUm8lD9szGksfvLONWSn5CKPkjYQAZTcZlXZnMZPUarfVMbe0ZBnTyJ2pdM3X9pjiXMzX9/s3fnfSSg3I+7r4aoI6/5hNY14/QYGJySKqZlx4KWiLRybSlU65IToI9qGhwO5zfdW8uBydjykfEpY77+dw1WPKIhhHDUpPdmIp8pyoX1tjF+TMpQQDXNW4pzySqmBQvUE/6DYk1WuObP6saA3rRPUZvb2zxzJf/7hY2y7DQH+KP4jDdMYhRwgq7nZOz8FrfMhnYlbJX8Co+o3aHJzQydddO4EzRDQ== 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=XI633+W9OQtSWw0Uy+NToXY5oZNCo8YvAbXXDSutySU=; b=HOlikbZQgStlft0QHk8Xm/PJUmQX/ashIIpoIrXyWBaV0RGpjSwHCG0Gb8C/IXAp4zbQqyGL4wHJE1+I4CDRHSBPogvzevASeNs3qoc38M1GrjQBCBv6SV5D1nH4xeCOeXwkEEtyUsxzc/rxWlYmtIs6y/X4t4RVH/U03y94pRwlUmTzd4zUcRFJnJ7P8j8jq78Ud3DClXxRQ5zAXFq3OlR36OPmcGFcVW7Ajz7vqx+38f6Z2lpmWAFOXPyOc4GkQ5NOWTpL5aynC9Q3UsS7wJSoCY3dEZISFnzssDTgwkvv9btMSfcZLpaeo0Zr9v1d9LAyOTRdwzc5VQKhRlZEtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from BN8PR12MB3458.namprd12.prod.outlook.com (2603:10b6:408:44::32) by BN6PR12MB1396.namprd12.prod.outlook.com (2603:10b6:404:1b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Mon, 22 Jun 2020 20:14:42 +0000 Received: from BN8PR12MB3458.namprd12.prod.outlook.com ([fe80::3489:4bde:b7b9:3aec]) by BN8PR12MB3458.namprd12.prod.outlook.com ([fe80::3489:4bde:b7b9:3aec%7]) with mapi id 15.20.3109.027; Mon, 22 Jun 2020 20:14:42 +0000 From: "Irene Park" To: "devel@edk2.groups.io" , "ard.biesheuvel@linaro.org" Subject: Re: [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero Thread-Topic: [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is zero Thread-Index: AQHWSNHD2r2jRm628ECbYabK/HzdqA== Date: Mon, 22 Jun 2020 20:14:41 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ipark@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2020-06-22T20:14:39.1314960Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_ActionId=192ae5ab-a83e-4663-94d7-10711a9bba9d; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [12.22.141.131] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7339004d-1666-44c4-b97a-08d816e8e61c x-ms-traffictypediagnostic: BN6PR12MB1396: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0442E569BC x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FKjpkcF9wVl6oD2/9cfht7pxhWvU+bsJyAMuXDF6ID+zCGfYYMRI4giJJ5MqGQm/6ZULoLnfvh3zi/hFi4pYKPN695nKimQFcCTyEc6YLq6lC215+kLnomIK4N7ynq8yYlHu2hJcxwN7sDyJQC//el3cK+bBAebtaqK1FEfFlGOE1CQwPFIPzyqI65MmON5gRg4SM4j1TBagEZIXYcF0MT5yCfFLOo/atTVTw2KaPGFlbcX55SgI+mgQ47F66W3GQkZFu5iANLyM4MNx9mzSH71nW6yjNvgnZbRKcUf/WChvoxrHZWti2ROfFKozBazy7w4UXZMcM3jwxuVZtl0gMA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3458.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(6029001)(376002)(396003)(136003)(346002)(39860400002)(366004)(110136005)(26005)(2906002)(186003)(478600001)(7696005)(86362001)(52536014)(71200400001)(83380400001)(5660300002)(316002)(33656002)(6506007)(53546011)(66556008)(66446008)(64756008)(66946007)(55016002)(66476007)(9686003)(8676002)(19627235002)(8936002)(76116006);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: qJGVgtD25W1JdCLxLP48M7e+1mOHg0DRzyOtSeNvjVbg6cSt5zsehxBeUGmqOfNdUmibzXOkzQxesrs+Gkz11BKN9i+Cz4wKB3y2vAyXtfM2spLmKcR4v9MUEyzhQ5hEV+44Vwogi/c2XRakjc3RzsBEMex7SgT4nUWbwwEVoYzLKeb06nJaCr2GWIXUUc7/QxlLkkxnWtuB6AKf09Th/jpzPgxteTKSXABUqtsbcDuIxWEgXwhlX8DKVtN42aptNtIkhGJduPTMURIP0J/RJylQunlehx8Fm16pRNSq8507UM8egt2r+Lp7UTjFrZs/4B+m+MqTEaKzK3z9zTMVwaa5E3t1rj12RbBy4Y7GnpzGjSIDBU0cRH6fufvyshV1FbUh/2Kpb2VKk06Rmn/6egj+KPyEgXI3cCmRFy2Y5pW72Obp6HbCulYOOtTVeH1VtxtzViu3wzd6Cu6sUMr9hcu016LDaUkmMm7HtAazRPY= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7339004d-1666-44c4-b97a-08d816e8e61c X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jun 2020 20:14:42.0311 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Rcx/qufm58WuCy6qXu0BHol41BnZqfBmjC/lF0v3GuPhMlGOz+3s81TT82dv4kLXzMPgYZDJfW0eC6kGEsD9ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1396 Return-Path: ipark@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1592856793; bh=XI633+W9OQtSWw0Uy+NToXY5oZNCo8YvAbXXDSutySU=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:msip_labels: authentication-results:x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-ms-traffictypediagnostic: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-forefront-prvs:x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:x-ms-exchange-transport-forked: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type:Content-Transfer-Encoding; b=M7IOu8Hj1b3k15h/JU7kMLnr8YscRK7Om2cLIzjrJSQAaVk0utVLcsVjKB9LQ94gp kDWk9oCtOyHn5Q5fdDvmWF7ozKz5aHeR0IOqSIUvO1duEAOL+jgwi/tZaVEkCA3QUr MfgBASWdPj9LAhQP4tLj/3jUCPsT1JYYPTNkCtWdSq0Os9d5zQkECI0EeXRQdgsoe0 O1Tmx+GlBRtg1rGwgox5SxHN9LpVuUBSC5WT3vV8UQlojyqjlErWzJvREK+wmroXHW W7hFBV6fglCAwx7tFt954lkRc9tqntLXjRiBIIH7zbm2ANWOh+YHlQbCPdLfxog/hj 99gbeDJGgoYaQ== Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ard, Would you please review this change ? I also wonder what you think of the following. #if FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth) =3D=3D 0 VS if (FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth) =3D=3D 0) or if (Hardwar= eFifoDepth =3D=3D 0) Thank you, Irene -----Original Message----- From: Irene Park =20 Sent: Tuesday, June 9, 2020 1:59 PM To: devel@edk2.groups.io Cc: Irene Park Subject: [PATCH v2] ArmPlatformPkg/PL011UartLib: Check PID2 if FiFoDepth is= zero From: Irene Park PL011UartLib determines its FIFO depth based on the PID2 value but the regi= ster PID2 is not mandatory as per the SBSA spec. This change won't check PID2 if PcdUartDefaultReceiveFifoDepth is set to a = value > 0. Signed-off-by: Irene Park --- ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c | 4 ++++ ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf | 1 + 2 files changed, 5 insertions(+) diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c b/ArmPlatfo= rmPkg/Library/PL011UartLib/PL011UartLib.c index 801990d..05ad1ad 100644 --- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c +++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c @@ -79,9 +79,13 @@ PL011UartInitializePort ( UINT32 Fractional; UINT32 HardwareFifoDepth; =20 + HardwareFifoDepth =3D FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth);=20 +#if FixedPcdGet16 (PcdUartDefaultReceiveFifoDepth) =3D=3D 0 HardwareFifoDepth =3D (PL011_UARTPID2_VER (MmioRead32 (UartBase + UARTPI= D2)) \ > PL011_VER_R1P4) \ ? 32 : 16 ; +#endif + // The PL011 supports a buffer of 1, 16 or 32 chars. Therefore we can ac= cept // 1 char buffer as the minimum FIFO size. Because everything can be rou= nded // down, there is no maximum FIFO size. diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf b/ArmPlat= formPkg/Library/PL011UartLib/PL011UartLib.inf index d99e89f..e3da507 100644 --- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf +++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf @@ -30,6 +30,7 @@ ArmPlatformPkg/ArmPlatformPkg.dec =20 [FixedPcd] + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate =20 gArmPlatformTokenSpaceGuid.PL011UartInteger -- 2.7.4