From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::22f; helo=mail-wm0-x22f.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 65D0621F0DA7E for ; Wed, 7 Feb 2018 08:37:29 -0800 (PST) Received: by mail-wm0-x22f.google.com with SMTP id b21so4556741wme.4 for ; Wed, 07 Feb 2018 08:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sMaftDWhzSFvpH1kjYsJYBrwpOYgLx5eZFUuWX05sK4=; b=gkYat7Pz1JBNV5/FrG9WEdFYlFilEZTT+TY+dwy8pH9P8y3HSi5P8nl34ZhNPXruPn BZxpJrcMOIlgLO7j1T3zjW6LHB6CHoKYFJOimq+p1XGoiLoZmrohp/VTYJM4aYIxaGNh p4+YjY/luap+sOmtUdWKN1WW+pW00ivCt1PjI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sMaftDWhzSFvpH1kjYsJYBrwpOYgLx5eZFUuWX05sK4=; b=d+tvusI0jtRFPZFFH+ZF2ZepBBw4l8ujHt0/sFK5a+Sj9QKvDpySSY1pNT0WLKsZJI X2dD39sXhzgSK0WtMam/DAmgbtPjVCy/LLRcstTtVNJFD7eU8EwI1jQisZkWKypzhYY1 Qd0ljheshtk7NQyQ424Scjz1fxw4itWLIdOiXUHicLjNNd2oKKB/j3DkdhYi1loOvocZ gy8uIG9dDbQrM0PH/3PK9HHf5kIpuR81oGAbCV23FJV8axj1Rjy8sQpjaKAi8ltLyp/V Jquw84cbXp7yZ0bWDLU9qdtDnKxwJZj42OeGP9EkTHafCj46Ot5Bd8J4wB6n9ZqzXBFx TTcg== X-Gm-Message-State: APf1xPDwgX9K5fPB616axkc8q4hX8ayTrDg/gNFW6jOArtJFrT52dFyL FIGE58v1X0dXusgZavPj/bqlkBMdH5dzCwizQxTQkA== X-Google-Smtp-Source: AH8x225tz/s9TygWGFmoC2vYVA+PZk5xuNE6jSFNXVPUdNCrS0a/jqja22yr8i6RLn8Z7zcueN1MYf3whDsRxrmJHD0= X-Received: by 10.28.191.148 with SMTP id o20mr5404970wmi.63.1518021791808; Wed, 07 Feb 2018 08:43:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.132.12 with HTTP; Wed, 7 Feb 2018 08:43:11 -0800 (PST) In-Reply-To: References: <78656541-A557-41BE-A302-0CB8F9CAAA5B@linaro.org> From: Haojian Zhuang Date: Thu, 8 Feb 2018 00:43:11 +0800 Message-ID: To: Ard Biesheuvel Cc: edk2-devel-01 , Linaro UEFI Mailman List , Leif Lindholm Subject: Re: [issue] Arrow key can't be read on tty terminal in release build X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 16:37:30 -0000 Content-Type: text/plain; charset="UTF-8" On 8 February 2018 at 00:13, Ard Biesheuvel wrote: > On 7 February 2018 at 16:12, Haojian Zhuang wrote: >> On 7 February 2018 at 23:52, Ard Biesheuvel wrote: >>> >>>> On 7 Feb 2018, at 15:50, 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? >>>> >>>> >>> >>> 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