public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	 Linaro UEFI Mailman List <linaro-uefi@lists.linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [issue] Arrow key can't be read on tty terminal in release build
Date: Wed, 7 Feb 2018 16:52:42 +0000	[thread overview]
Message-ID: <CAKv+Gu_yPjRU3qLTomJPWLTTwx_y4a7rJyL0Og50aXFAYd+viw@mail.gmail.com> (raw)
In-Reply-To: <CAD6h2NRyKjZ0pSts7kc2j-emm_QDsYDt39b+W+Bu3vOUH75N6w@mail.gmail.com>

On 7 February 2018 at 16:43, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
> On 8 February 2018 at 00:13, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> On 7 February 2018 at 16:12, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
>>> On 7 February 2018 at 23:52, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>>>
>>>>> On 7 Feb 2018, at 15:50, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I have an issue on tty terminal. I setup PL011 serial console as the
>>>>> tty terminal on HiKey platform. When it's built in debug mode, arrow
>>>>> key works well. When it's built in release mode, arrow key can't work.
>>>>>
>>>>> For example, DOWN key is gotten in terminal with "~[B" value in debug
>>>>> build. DOWN key is gotten in terminal with "~" value in release build.
>>>>> These values are fetched by GetOneKeyFromSerial().
>>>>>
>>>>> But I can't find any difference on PL011 serial driver between debug
>>>>> and release mode.
>>>>>
>>>>> Do you have any idea on this?
>>>>>
>>>>>
>>>>
>>>> You need to set the FIFO depth to 16 iirc
>>>
>>> I think you mean the initialization code in PL011UartInitializePort ().
>>>
>>>   HardwareFifoDepth = (PL011_UARTPID2_VER (MmioRead32 (UartBase + UARTPID2)) \
>>>                        > PL011_VER_R1P4) \
>>>                       ? 32 : 16 ;
>>>
>>> I tried to hardcode the value with both 32 and 16. The issue still exists.
>>>
>>
>> Actually, it is the other way around. You need to set
>>
>> gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0
>>
>> as the default is 1, which makes no sense at all.
>
> After updating the PCD value to 0, this issue is gone. Great thanks
> for your help.
>
> Now I have a new question. Why do I miss the issue in debug build? Do
> you have any idea?
>

Because the DEBUG build uses the serial port for DEBUG output, and
performs its own initialization.


  reply	other threads:[~2018-02-07 16:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 15:50 [issue] Arrow key can't be read on tty terminal in release build Haojian Zhuang
2018-02-07 15:52 ` Ard Biesheuvel
2018-02-07 16:12   ` Haojian Zhuang
2018-02-07 16:13     ` Ard Biesheuvel
2018-02-07 16:43       ` Haojian Zhuang
2018-02-07 16:52         ` Ard Biesheuvel [this message]
2018-02-09 15:52 ` [Linaro-uefi] " Jeremy Linton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKv+Gu_yPjRU3qLTomJPWLTTwx_y4a7rJyL0Og50aXFAYd+viw@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox