From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.36.42; helo=nam02-sn1-obe.outbound.protection.outlook.com; envelope-from=leo.duran@amd.com; receiver=edk2-devel@lists.01.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0042.outbound.protection.outlook.com [104.47.36.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4FBD92115742E for ; Tue, 5 Jun 2018 14:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8+JH1527NhDZ6fWkRFfj7u5tvOtJf0Q7S1Wj89WEZdM=; b=WnDb9UWIG9c0GguKUF919gKj717vWgW3LEiZOezPyWHHCB+jn5V6Ih6Tr3HdZi1Z9/euA94nhhKyMpfdrZn7Utytflu53gwT9fCYB+FZ0UjJ/KRSZrFi0n1bF1TYAQaFGovgB+SI8sXRCyrn3ND6GYRYCw5/2nIiLQ1iUa+BaJ8= Received: from CY4PR12MB1815.namprd12.prod.outlook.com (10.175.63.21) by CY4PR12MB1816.namprd12.prod.outlook.com (10.175.63.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Tue, 5 Jun 2018 21:21:13 +0000 Received: from CY4PR12MB1815.namprd12.prod.outlook.com ([fe80::4112:efc5:3d83:464]) by CY4PR12MB1815.namprd12.prod.outlook.com ([fe80::4112:efc5:3d83:464%3]) with mapi id 15.20.0820.015; Tue, 5 Jun 2018 21:21:13 +0000 From: "Duran, Leo" To: "Zeng, Star" , "Dong, Eric" CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: Ensure FIFO Polled Mode Thread-Index: AQHT85KA32p5JwR1qkCtnAFfoM8r16RAS5wAgAAoj7uAEcoNEA== Date: Tue, 5 Jun 2018 21:21:13 +0000 Message-ID: References: <1527188850-4553-1-git-send-email-leo.duran@amd.com> <1527188850-4553-2-git-send-email-leo.duran@amd.com>, <0C09AFA07DD0434D9E2A0C6AEB0483103BAF1160@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR12MB1816; 7:7YnNxY4IcoRmYkwW+E5w9kCMc2+t2IJYYExs76oyQA+7igXvvGpw+EDeY8NYMHnhRjGVlKKeU0VfkCM3oAWvH7vRcZbPqsqyLltMtlbwYkt1X98EwdDgKCahhrUr3dmmUDF4VqK9iqce79tqXK+YzoqxYxTen3N/PQVpEfUOMxYgUrYgMa9GUMNpYZGQuOLKqOpxhpRs2Q13a4pQUCZHMFJD8YTqSTX4xX30EwpdsqY9+24C+/4CcSG5GzyyVMj3; 20:EcVqbWnpkGsLh1alBfWYyqpe3L+lODE3J4xuFlF1P0p48RAeH9OXfm6grJMFPT13Bid05MAjSmhmptRPwTFNgUy5UKO+VOvpRCULwq4puhAxxsbz2aCjWh5KzIhKm/pySfF+osN8/SJuYNegpK1/XEx4a3F0TWNUnUAWEUl0nGE7079m5DWZhLv3Qtn2c/zddLxF9n8mMVsOPJPU3yq+JS4G30IGwWEYG+WJOUzhY5E8X0LC3Pw3IipfqhrDiFC7 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR12MB1816; x-ms-traffictypediagnostic: CY4PR12MB1816: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(162533806227266)(265313219721884)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:CY4PR12MB1816; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1816; x-forefront-prvs: 0694C54398 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(346002)(376002)(39380400002)(366004)(13464003)(199004)(189003)(106356001)(25786009)(5250100002)(15760500003)(7696005)(99286004)(966005)(45080400002)(478600001)(59450400001)(6506007)(11346002)(14454004)(446003)(486006)(8676002)(102836004)(6436002)(3846002)(81156014)(81166006)(6116002)(5660300001)(8936002)(105586002)(26005)(86362001)(110136005)(316002)(76176011)(53546011)(476003)(55016002)(9686003)(229853002)(53936002)(2900100001)(186003)(3660700001)(7736002)(93886005)(6306002)(68736007)(3280700002)(66066001)(2906002)(6246003)(74316002)(305945005)(4326008)(33656002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1816; H:CY4PR12MB1815.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Fp50S0RBPWulvxbS5aNIqll4QYuZWvIJTi5iQ60RBfWwiIVdyXuGko2Ux4Sm+DBhulH0r0pEdBNk7girwqIZeAu048oGpXk/Qc+dUJYnAXxvkxUIctZ8b3At1pPbo6SEo9ganJS1FrdkzktKrNt97vZX3lt9mdbV45Mf+eiMZZDYLp6IPCaoj2CmfJBqeM7Z spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 0c10dba7-8536-4840-195c-08d5cb2a440a X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c10dba7-8536-4840-195c-08d5cb2a440a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2018 21:21:13.1651 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1816 Subject: Re: [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: Ensure FIFO Polled Mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 21:21:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Any updates on this patch? Do you require to know my "default value of IER"? Thanks, Leo. -----Original Message----- From: edk2-devel On Behalf Of Duran, Leo Sent: Friday, May 25, 2018 8:38 AM To: Zeng, Star ; edk2-devel@lists.01.org Cc: Dong, Eric ; Zeng, Star Subject: Re: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: En= sure FIFO Polled Mode Don''t have access to test platform at this time. But will report IER value if I,m able to. Leo Get Outlook for iOS ________________________________ From: Zeng, Star Sent: Friday, May 25, 2018 6:13:16 AM To: Duran, Leo; edk2-devel@lists.01.org Cc: Dong, Eric; Zeng, Star Subject: RE: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: En= sure FIFO Polled Mode Reviewed-by: Star Zeng Just a little curious about 1. Did you meet real issue without this patch? 2. what is the default value of IER in your case? Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Leo = Duran Sent: Friday, May 25, 2018 3:08 AM To: edk2-devel@lists.01.org Cc: Dong, Eric ; Zeng, Star Subject: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: Ensure= FIFO Polled Mode Put the UART in FIFO Polled Mode by clearing IER after setting FCR. Also, add comments to show DLAB state for registers 0 and 1. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leo Duran Cc: Star Zeng CC: Eric Dong --- .../BaseSerialPortLib16550/BaseSerialPortLib16550.c | 16 ++++++++++++= ---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib1= 6550.c b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550= .c index 0ccac96..6532c4d 100644 --- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c +++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550 +++ .c @@ -3,6 +3,8 @@ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2018, AMD Incorporated. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -30,10 +32,11 @@ // // 16550 UART register offsets and bitf= ields // -#define R_UART_RXBUF 0 -#define R_UART_TXBUF 0 -#define R_UART_BAUD_LOW 0 -#define R_UART_BAUD_HIGH 1 +#define R_UART_RXBUF 0 // LCR_DLAB =3D 0 +#define R_UART_TXBUF 0 // LCR_DLAB =3D 0 +#define R_UART_BAUD_LOW 0 // LCR_DLAB =3D 1 +#define R_UART_BAUD_HIGH 1 // LCR_DLAB =3D 1 +#define R_UART_IER 1 // LCR_DLAB =3D 0 #define R_UART_FCR 2 #define B_UART_FCR_FIFOE BIT0 #define B_UART_FCR_FIFO64 BIT5 @@ -554,6 +557,11 @@ SerialPortInitialize ( SerialPortWriteRegister (SerialRegisterBase, R_UART_FCR, (UINT8)(PcdGet8= (PcdSerialFifoControl) & (B_UART_FCR_FIFOE | B_UART_FCR_FIFO64))); // + // Set FIFO Polled Mode by clearing IER after setting FCR // =20 + SerialPortWriteRegister (SerialRegisterBase, R_UART_IER, 0x00); + + // // Put Modem Control Register(MCR) into its reset state of 0x00. // SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, 0x00); -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel