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.