From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8F4EC21184AA1 for ; Sun, 10 Jun 2018 19:41:45 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2018 19:41:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,500,1520924400"; d="scan'208";a="236317611" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 10 Jun 2018 19:41:44 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 10 Jun 2018 19:41:44 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.223]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.87]) with mapi id 14.03.0319.002; Mon, 11 Jun 2018 10:41:42 +0800 From: "Zeng, Star" To: "Duran, Leo" , "Dong, Eric" CC: "edk2-devel@lists.01.org" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: Ensure FIFO Polled Mode Thread-Index: AQHT85KFbSIpfcpq/ECPOM2elVP7P6RASzXQ//+i2gCAEcrygIAAvl5g//+AKYCAAQuhgIAFIzwAgAJNywA= Date: Mon, 11 Jun 2018 02:41:42 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB5546D@shsmsx102.ccr.corp.intel.com> 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: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 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: Mon, 11 Jun 2018 02:41:45 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks. Just pushed patch at a05a8a5aa17da4bc7144706a9931d68beec1a61f. Star -----Original Message----- From: Duran, Leo [mailto:leo.duran@amd.com]=20 Sent: Sunday, June 10, 2018 7:30 AM To: Zeng, Star ; Dong, Eric Cc: edk2-devel@lists.01.org Subject: RE: [edk2] [PATCH] MdeModulePkg/Library/BaseSerialPortLib16550: En= sure FIFO Polled Mode 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=20 > 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,=20 > 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=20 > UART 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=20 > > 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=20 > > > > 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=20 > > Duran, Leo > > Sent: Friday, May 25, 2018 8:38 AM > > To: Zeng, Star ; edk2-devel@lists.01.org > > Cc: Dong, Eric ; Zeng, Star=20 > > > > 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=20 > > ________________________________ > > 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=20 > > Of Leo Duran > > Sent: Friday, May 25, 2018 3:08 AM > > To: edk2-devel@lists.01.org > > Cc: Dong, Eric ; Zeng, Star=20 > > > > 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=20 > > 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=20 > > the BSD License > > which accompanies this distribution. The full text of the=20 > > license may be found at @@ -30,10 +32,11 @@ // // 16550 UART=20 > > 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 |=20 > > 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