From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22a; helo=mail-io0-x22a.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 1D93D223972B2 for ; Wed, 7 Feb 2018 08:46:59 -0800 (PST) Received: by mail-io0-x22a.google.com with SMTP id m11so2702986iob.2 for ; Wed, 07 Feb 2018 08:52:43 -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=+LG9W61sppDL2haujJTkwNpdzB9ANIzWdCzya9CpyL4=; b=Sgij72+++DidtFRaa+Ng33EKqDd3r1zItxDNhXUoo9nJDOglJvt+dDbGLjZ6ReFaV+ gBrMFC39tUXSZUT/79NeLXMPuDCcr4kRQij0I7bwOdd6WvVb1RCzHcPESuYp8fOjMOJg de4VNhuENnHR4Dtq6dxpGN6zreS9YSezRp5Bg= 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=+LG9W61sppDL2haujJTkwNpdzB9ANIzWdCzya9CpyL4=; b=BgwHPFqVxc76V/vxxIyGuxBolIwliscdR8uBf3aqqSm4CItTmw+zj2mh5fLzGdpBel HRdBnHkDlZ9PDhtzC7YaIh8nJZyFRFyxVmcl02hGdVDm3BSixa/A/WbxhI6TtUSAy5tZ lZILT1LWBxQYDIUhzkNj/Q3WQD0jv26KIB+lxWf3JUoFg57obzUo1aJ1XRdIPOtiOzud YYnMqz0ebFxhX/QdXQJ8kSTLBMx0NcSBW8FrZ/XFWd0bSthSGC6n9TT0eqRcLFFFrFoy e0xeGxlP+61TqSwH8HxJoRSoGZjrqvMJXloUFJP5FRo8Pb3jpwH2UmNYhQobs/VGB9YS p3nQ== X-Gm-Message-State: APf1xPDgtPdUlniQ/fIXi0lSSiA8gRUX/QNlYWl1RYNAdNo+oENZ8n/E lRNk4TpBBS6ui1ii+cLO6M6huO/oUXWmdJxfuSuAQQ== X-Google-Smtp-Source: AH8x227xCvyB/kPa6VBxzJN3bmuefXXOE9nRDCYWdjpWv6sYak0Bi6CvXf1DHWhDWpDr5dpNwsBqhHDx68GtMbFdnrQ= X-Received: by 10.107.6.161 with SMTP id f33mr8941895ioi.196.1518022363077; Wed, 07 Feb 2018 08:52:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.112.13 with HTTP; Wed, 7 Feb 2018 08:52:42 -0800 (PST) In-Reply-To: References: <78656541-A557-41BE-A302-0CB8F9CAAA5B@linaro.org> From: Ard Biesheuvel Date: Wed, 7 Feb 2018 16:52:42 +0000 Message-ID: To: Haojian Zhuang 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:47:00 -0000 Content-Type: text/plain; charset="UTF-8" On 7 February 2018 at 16:43, Haojian Zhuang wrote: > 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? > Because the DEBUG build uses the serial port for DEBUG output, and performs its own initialization.