* [issue] Arrow key can't be read on tty terminal in release build
@ 2018-02-07 15:50 Haojian Zhuang
2018-02-07 15:52 ` Ard Biesheuvel
2018-02-09 15:52 ` [Linaro-uefi] " Jeremy Linton
0 siblings, 2 replies; 7+ messages in thread
From: Haojian Zhuang @ 2018-02-07 15:50 UTC (permalink / raw)
To: edk2-devel-01, Linaro UEFI Mailman List; +Cc: Leif Lindholm, Ard Biesheuvel
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?
Best Regards
Haojian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [issue] Arrow key can't be read on tty terminal in release build
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-09 15:52 ` [Linaro-uefi] " Jeremy Linton
1 sibling, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2018-02-07 15:52 UTC (permalink / raw)
To: Haojian Zhuang; +Cc: edk2-devel-01, Linaro UEFI Mailman List, Leif Lindholm
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [issue] Arrow key can't be read on tty terminal in release build
2018-02-07 15:52 ` Ard Biesheuvel
@ 2018-02-07 16:12 ` Haojian Zhuang
2018-02-07 16:13 ` Ard Biesheuvel
0 siblings, 1 reply; 7+ messages in thread
From: Haojian Zhuang @ 2018-02-07 16:12 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: edk2-devel-01, Linaro UEFI Mailman List, Leif Lindholm
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.
Best Regards
Haojian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [issue] Arrow key can't be read on tty terminal in release build
2018-02-07 16:12 ` Haojian Zhuang
@ 2018-02-07 16:13 ` Ard Biesheuvel
2018-02-07 16:43 ` Haojian Zhuang
0 siblings, 1 reply; 7+ messages in thread
From: Ard Biesheuvel @ 2018-02-07 16:13 UTC (permalink / raw)
To: Haojian Zhuang; +Cc: edk2-devel-01, Linaro UEFI Mailman List, Leif Lindholm
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [issue] Arrow key can't be read on tty terminal in release build
2018-02-07 16:13 ` Ard Biesheuvel
@ 2018-02-07 16:43 ` Haojian Zhuang
2018-02-07 16:52 ` Ard Biesheuvel
0 siblings, 1 reply; 7+ messages in thread
From: Haojian Zhuang @ 2018-02-07 16:43 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: edk2-devel-01, Linaro UEFI Mailman List, Leif Lindholm
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?
Best Regards
Haojian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [issue] Arrow key can't be read on tty terminal in release build
2018-02-07 16:43 ` Haojian Zhuang
@ 2018-02-07 16:52 ` Ard Biesheuvel
0 siblings, 0 replies; 7+ messages in thread
From: Ard Biesheuvel @ 2018-02-07 16:52 UTC (permalink / raw)
To: Haojian Zhuang; +Cc: edk2-devel-01, Linaro UEFI Mailman List, Leif Lindholm
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Linaro-uefi] [issue] Arrow key can't be read on tty terminal in release build
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-09 15:52 ` Jeremy Linton
1 sibling, 0 replies; 7+ messages in thread
From: Jeremy Linton @ 2018-02-09 15:52 UTC (permalink / raw)
To: Haojian Zhuang, edk2-devel-01, Linaro UEFI Mailman List
Hi,
On 02/07/2018 09:50 AM, Haojian Zhuang 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?
Just to add an additional data point.
I see arrow key issue on the hikey as well as the ARM models. The
problem seems to have shown up sometime late last year and happens in my
case when the machine directly boots into distro provided grub.
Strangely, exiting to the BDS and then starting the boot from the BDS
seems to clear up the problem and the arrow keys work (or pressing
escape and going to the BDS first, either way poping up the BDS menus
seem to work around the issue).
>
> Best Regards
> Haojian
> _______________________________________________
> Linaro-uefi mailing list
> Linaro-uefi@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/linaro-uefi
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-02-09 15:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-02-09 15:52 ` [Linaro-uefi] " Jeremy Linton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox