From patchwork Wed Jul 8 19:02:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 50909 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9BD84213FD for ; Wed, 8 Jul 2015 19:03:39 +0000 (UTC) Received: by laer2 with SMTP id r2sf68888453lae.3 for ; Wed, 08 Jul 2015 12:03:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=6RdbFCpFBZK8BRMskEkf1ujadGO4gTZ89X7yl0UIVvA=; b=SpLzwlXcZQBqN+zPHLFlWszUeJ7vC4NwkG0x2HqeDmuqS6tRcMdnxLBIf++QhSd1G5 P1HgXK7rdox5y/yVfAtOob/6F+1DNRs7G9SxuQKKexDber4SpMeheSobArmec3C8cxDH IQvH5W1JEhz5OiHOy7gfBSXwMu9DotYai6V6OJna9M7N++zmlGoybAQLuSbnb4qPkcUD 3Kh2bcKddFGUv32YJje/tc2jvP4hKQBAY3PBiaZ2tA+0e3Ryp+F6bLUBXZKq6ccow3Ip cF1l0Y++8ItaWe1k9PAkGm4s3UZ1oMbkQRYDj7CrfO9lFWRKAepyCIoYcQIGFe/fQNEg ZjDQ== X-Gm-Message-State: ALoCoQmRtwxHn+KXDockM70H0EKVoZOE7REa5Z2GKgM9M6zhfRAKn0bm5Heds12RdPBqwBeBPqjL X-Received: by 10.112.54.166 with SMTP id k6mr5731819lbp.0.1436382218562; Wed, 08 Jul 2015 12:03:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.130 with SMTP id b2ls838398lah.97.gmail; Wed, 08 Jul 2015 12:03:38 -0700 (PDT) X-Received: by 10.112.24.71 with SMTP id s7mr10729489lbf.37.1436382218295; Wed, 08 Jul 2015 12:03:38 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id gj2si2694748lbc.159.2015.07.08.12.03.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2015 12:03:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbzd8 with SMTP id d8so16660830lbz.0 for ; Wed, 08 Jul 2015 12:03:38 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr10891082lbc.117.1436382217985; Wed, 08 Jul 2015 12:03:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp153155lbb; Wed, 8 Jul 2015 12:03:36 -0700 (PDT) X-Received: by 10.107.136.153 with SMTP id s25mr20766434ioi.65.1436382210863; Wed, 08 Jul 2015 12:03:30 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id m21si3451191iod.28.2015.07.08.12.03.30 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 08 Jul 2015 12:03:30 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZCucq-00047o-Iv; Wed, 08 Jul 2015 19:03:20 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZCuco-00047g-TP for edk2-devel@lists.sourceforge.net; Wed, 08 Jul 2015 19:03:18 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.220.42 as permitted sender) client-ip=209.85.220.42; envelope-from=roy.franz@linaro.org; helo=mail-pa0-f42.google.com; Received: from mail-pa0-f42.google.com ([209.85.220.42]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZCucn-0006o6-T7 for edk2-devel@lists.sourceforge.net; Wed, 08 Jul 2015 19:03:18 +0000 Received: by pacgz10 with SMTP id gz10so62769291pac.3 for ; Wed, 08 Jul 2015 12:03:12 -0700 (PDT) X-Received: by 10.68.206.7 with SMTP id lk7mr23063219pbc.52.1436382192241; Wed, 08 Jul 2015 12:03:12 -0700 (PDT) Received: from localhost.localdomain (c-73-41-93-56.hsd1.ca.comcast.net. [73.41.93.56]) by smtp.gmail.com with ESMTPSA id nk1sm3322254pdb.36.2015.07.08.12.03.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jul 2015 12:03:11 -0700 (PDT) From: Roy Franz To: edk2-devel@lists.sourceforge.net, feng.tian@intel.com, lersek@redhat.com, ard.biesheuvel@linaro.org Date: Wed, 8 Jul 2015 12:02:51 -0700 Message-Id: <1436382172-27491-5-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436382172-27491-1-git-send-email-roy.franz@linaro.org> References: <1436382172-27491-1-git-send-email-roy.franz@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1ZCucn-0006o6-T7 Subject: [edk2] [PATCH V4 4/5] Add PCD for selecting terminal type at build time X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Laszlo Ersek Add a fixed pointer PCD to allow build-time selection of VT100 or TTY terminal type. The default remains VT100 emulation. Add support for building the ARM QEMU platforms with the TTY terminal with the "-D TTY_TERMINAL" build option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek [Roy Franz: minor edits: add TtyTerminal GUID, rename LINUX_TERMINAL to TTY_TERMINAL] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Roy Franz Reviewed-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++ ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++ ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++---- ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 7ec0de4..2feebd3 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -15,6 +15,7 @@ [Defines] DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F + DEFINE TTY_TERMINAL = FALSE [LibraryClasses.common] !if $(TARGET) == RELEASE @@ -359,6 +360,11 @@ gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04 !endif +!if $(TTY_TERMINAL) == TRUE + # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID + gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94} +!endif + [Components.common] # # Networking stack diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index 7bbd9ff..9833c5a 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -49,6 +49,13 @@ # gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding|256|UINT32|0x00000002 + # + # Binary representation of the GUID that determines the terminal type. The + # size must be exactly 16 bytes. The default value corresponds to + # EFI_VT_100_GUID. + # + gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007 + [PcdsDynamic, PcdsFixedAtBuild] # # ARM PSCI function invocations can be done either through hypervisor diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c index 13830cb..b242a29 100644 --- a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c +++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c @@ -35,7 +35,7 @@ typedef struct { VENDOR_DEVICE_PATH SerialDxe; UART_DEVICE_PATH Uart; - VENDOR_DEFINED_DEVICE_PATH Vt100; + VENDOR_DEFINED_DEVICE_PATH TermType; EFI_DEVICE_PATH_PROTOCOL End; } PLATFORM_SERIAL_CONSOLE; #pragma pack () @@ -67,14 +67,16 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = { }, // - // VENDOR_DEFINED_DEVICE_PATH Vt100 + // VENDOR_DEFINED_DEVICE_PATH TermType // { { MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, DP_NODE_LEN (VENDOR_DEFINED_DEVICE_PATH) - }, - EFI_VT_100_GUID + } + // + // Guid to be filled in dynamically + // }, // @@ -421,6 +423,8 @@ PlatformBdsPolicyBehavior ( // // Add the hardcoded serial console device path to ConIn, ConOut, ErrOut. // + CopyGuid (&mSerialConsole.TermType.Guid, + PcdGetPtr (PcdTerminalTypeGuidBuffer)); BdsLibUpdateConsoleVariable (L"ConIn", (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL); BdsLibUpdateConsoleVariable (L"ConOut", diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf index d998216..9a3cfcd 100644 --- a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf +++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf @@ -39,6 +39,7 @@ MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec + ArmVirtPkg/ArmVirtPkg.dec [LibraryClasses] BaseLib @@ -61,6 +62,9 @@ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits +[Pcd] + gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer + [Guids] gEfiFileInfoGuid gEfiFileSystemInfoGuid