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:c0b::234; helo=mail-it0-x234.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (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 A5C1E221660C6 for ; Wed, 7 Feb 2018 08:08:06 -0800 (PST) Received: by mail-it0-x234.google.com with SMTP id n206so2850849itg.1 for ; Wed, 07 Feb 2018 08:13:50 -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=m6x9HjE44l3jn34hlycYQEY8uiZFFU7BpLJZjTVIDcs=; b=g8fBNIgXFy7TlQi2wCIwlFcuzwklAaVa14bMbZsSJvTZNkKcVyzsiFEJSz7XxaUpHd 2fUvxFBvA2aReqlo/2JnU6DnLKjNzCIHKyc1+7dI+LdboWdL7zHHNXWB18nZL6JaJ1/l 5dQjCPkYrTmfbZSebrJUtZipKk93Pvfd0ath4= 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=m6x9HjE44l3jn34hlycYQEY8uiZFFU7BpLJZjTVIDcs=; b=LQYfXInk5tlQRjc3Svz8lK5D1iKxmccOJiNnOiT+BYm/9Po0qJENfmyU14iVvsaH+U QoIbLJf9pnFOTzz6V0zugtND+Sds40AITfCmZBtLWF661gul+HDsn47Nt76zI6/BMgZt wc8FpRaZjlYVCNoPGjHSsXbAcBGBwMoBaxXymd26LDDlk/PlREflRaVL0TaAJeq+Orgm bDo0RoDMI9y3Rjy8yjCG8Jidtwrd2W7vOdzpE5vWpCVAJ1c8/vczICcONggFX6BjSx4X CtTQJIKSe11BS0PZhKHT5Wp1WWNHKs73d+L4jNduTm6HhiD4zzMwUl73rNdTqvUKpwGW i0FA== X-Gm-Message-State: APf1xPAepgFgiYjsM9u2wD0oLodOufVOmtO9JdZ4bT6PCoTlWa7fvpjQ KNUyPE4LwxKYTYfVxYe0vdJb8vPPHN9+xMGt+sG3vQ== X-Google-Smtp-Source: AH8x225miAVrLxD/romQPZkLRnNVigCq7plL7kyXYC8+KAboL2vx9dAEKlCjooS98iccqr7FA5ZmkIeIGaQW8UefMUE= X-Received: by 10.36.216.65 with SMTP id b62mr2652016itg.17.1518020029686; Wed, 07 Feb 2018 08:13:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.112.13 with HTTP; Wed, 7 Feb 2018 08:13:48 -0800 (PST) In-Reply-To: References: <78656541-A557-41BE-A302-0CB8F9CAAA5B@linaro.org> From: Ard Biesheuvel Date: Wed, 7 Feb 2018 16:13:48 +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:08:07 -0000 Content-Type: text/plain; charset="UTF-8" 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.