From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.32.56; helo=nam01-sn1-obe.outbound.protection.outlook.com; envelope-from=leo.duran@amd.com; receiver=edk2-devel@lists.01.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0056.outbound.protection.outlook.com [104.47.32.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C92D21250168 for ; Sat, 9 Jun 2018 16:30:22 -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=qcWEnFFcYWlrbQyeOudHC2RnfedzxNXNMv88ABn4ZNI=; b=e+52poHenO/g1w1S/aH/pWA6QbwUJ+OqoDWhernxsUM4XHK2oawJHc3xVB3kDhDIT/xs+aGIBXxKm/3tKI9Bdh4vqYHyHAmFfDjhCfBbchfh7ipzA39K5XklRmjnMKdm/hKP+QZ3urWH8VghgP9qE7ZTtdbRyYpPox4Fwelmw8Q= Received: from CY4PR12MB1815.namprd12.prod.outlook.com (10.175.63.21) by CY4PR12MB1464.namprd12.prod.outlook.com (10.172.71.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Sat, 9 Jun 2018 23:30:18 +0000 Received: from CY4PR12MB1815.namprd12.prod.outlook.com ([fe80::6f:4d87:1352:6ac0]) by CY4PR12MB1815.namprd12.prod.outlook.com ([fe80::6f:4d87:1352:6ac0%6]) with mapi id 15.20.0841.018; Sat, 9 Jun 2018 23:30:18 +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: AQHT85KA32p5JwR1qkCtnAFfoM8r16RAS5wAgAAoj7uAEcoNEIAAOV4AgAAFNDCAAIeLgIAFpuZA Date: Sat, 9 Jun 2018 23:30:18 +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> <0C09AFA07DD0434D9E2A0C6AEB0483103BB53B9A@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BB54038@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BB54038@shsmsx102.ccr.corp.intel.com> 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; CY4PR12MB1464; 7:C3sv1jihZgKuA86xoEY/RTUtbabNOG2ACi91s8JvPpDOq7505/g5ZQ8w/+mWlsSH5hz30vO5d9OeqA0+0IMK2n98sQilGs4m1KMZALc9LOBYrbkJGz49fLux0Npm/7lCs77HHR9EGQRmaF23gOsiW/gsod2C7xVC/RdVF9elLjzhWB1kf5HU5vSI7wx8c1NvmxApdGbcUrJ54mmupVQfhnjqFBTYzw7kUrvAkEI7NSrnB1+49oy0LVxQFwlQbz7J; 20:jqblPg8lfsBWINvTbW61Go5MpuSFZ/kuTKnZsO6dVdOtLjhyca2PrfXls4B4yOqhxJjv3EueZn1mNL0hm8zWlZ2szkSjhZ1D8v9dMunEt/tH94FiWauwnozvWYl4wPirZPPx+V2RoB/adPF7QDKtTLBeOdARwuSaOhnI1hOl9/wB1W7jZTV3/1gbnrQBmJsZT3HrQmJxefd3p7gYWAHdK0pbNwoXFOuQQSJI3VVsubHic/yhnG4qVbkEUwTo816N x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:CY4PR12MB1464; x-ms-traffictypediagnostic: CY4PR12MB1464: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(31051911155226)(767451399110)(106291317490208)(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)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:CY4PR12MB1464; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1464; x-forefront-prvs: 06989017E3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(396003)(346002)(366004)(13464003)(189003)(199004)(4326008)(66066001)(97736004)(229853002)(55016002)(6436002)(2900100001)(5660300001)(105586002)(33656002)(74316002)(5250100002)(305945005)(186003)(26005)(76176011)(7736002)(102836004)(53546011)(6506007)(59450400001)(7696005)(3660700001)(6116002)(2906002)(3846002)(3280700002)(106356001)(8936002)(8676002)(316002)(81156014)(81166006)(99286004)(15760500003)(110136005)(476003)(486006)(93886005)(9686003)(45080400002)(68736007)(6306002)(478600001)(86362001)(11346002)(25786009)(966005)(53936002)(446003)(14454004)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1464; H:CY4PR12MB1815.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LbQcHcdayg4bApel7hrGUPRd5w+3CdF7H5DLsoE3klhWedSmHI5mQcLSDAshXHUnRMm17jeMn2B06f7E7SfzGvsF/uBJmCtbKOUgHzB/jY15fuaoegjWIQA+fzLAtz9vrD8U5Er1AZ3P5wWhC+WJGrYVBj/OCOTwt5ftSKsztNBQMIj9d0nZW2WpSoxz/rJH spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ccdbec02-931d-460f-0c61-08d5ce60f65c X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccdbec02-931d-460f-0c61-08d5ce60f65c X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jun 2018 23:30:18.7890 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1464 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: Sat, 09 Jun 2018 23:30:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Star, Please see my replies below. Thanks, Leo > -----Original Message----- > From: Zeng, Star [mailto:star.zeng@intel.com] > Sent: Wednesday, June 06, 2018 4:07 AM > To: Duran, Leo ; Dong, Eric > Cc: edk2-devel@lists.01.org; Zeng, Star > Subject: RE: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: > Ensure FIFO Polled Mode >=20 > Hi Leo, >=20 > I am ok with the code change. > I was just curious about the motivation for the change. > 1. No real issue met, but just to follow the doc 8.4.2 ? > 2. Real issue met, then what is the issue ? [Duran, Leo] Real issue met (Please see answer to next questions). > 3. What is the default value of IER for your case ? [Duran, Leo] Don't care : the state machine in 16550 model required clearin= g IER to enter FIFO Polled mode. >=20 > If the information are valuable, then they can be added into the commit > message for further easy maintenance. >=20 > -----Original Message----- > From: Duran, Leo [mailto:leo.duran@amd.com] > Sent: Wednesday, June 6, 2018 9:05 AM > To: Zeng, Star ; Dong, Eric > Cc: edk2-devel@lists.01.org > Subject: RE: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: > Ensure FIFO Polled Mode >=20 > Hi Star, >=20 > I came across a 16550 model (simulation) which required clearing IER, and= it > seems that's allowed in the 16650 spec, as noted here: > http://www.ti.com/lit/ds/symlink/pc16550d.pdf >=20 > 8.4.2 FIFO Polled Mode Operation > With FCR0=3D1 resetting IER0, IER1, IER2, IER3 or all to zero puts the UA= RT in the > FIFO Polled Mode of operation. >=20 > Thanks, > Leo. >=20 > > -----Original Message----- > > From: Zeng, Star [mailto:star.zeng@intel.com] > > Sent: Tuesday, June 05, 2018 7:43 PM > > To: Duran, Leo ; Dong, Eric > > Cc: edk2-devel@lists.01.org; Zeng, Star > > Subject: RE: [edk2] [PATCH] > MdeModulePkg/Library/BaseSerialPortLib16550: > > Ensure FIFO Polled Mode > > > > It will be better to have the information that may could be added into > > the commit message. > > > > 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: Duran, Leo [mailto:leo.duran@amd.com] > > Sent: Wednesday, June 6, 2018 5:21 AM > > To: Zeng, Star ; Dong, Eric > > Cc: edk2-devel@lists.01.org > > Subject: RE: [edk2] [PATCH] > MdeModulePkg/Library/BaseSerialPortLib16550: > > Ensure FIFO Polled Mode > > > > 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: > > Ensure 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: > > Ensure 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/BaseSerialPortLib16550.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 BSD License > > which accompanies this distribution. The full text of the license > > may be found at @@ -30,10 +32,11 @@ // // 16550 UART register > > offsets and bitfields // > > -#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 // > > + 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