From patchwork Mon Jul 6 23:04:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 50799 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B1FA8229FC for ; Mon, 6 Jul 2015 23:05:25 +0000 (UTC) Received: by widjy10 with SMTP id jy10sf56280555wid.3 for ; Mon, 06 Jul 2015 16:05:24 -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=tYC17iNUtm93i1/8KzfaDSuYVC7bvCEhAyuPsy3CO7U=; b=a5mmBk1AoluW9Nz8JgUUk4iP/gkNMPNpcsnnOalCmBYGK5bWpl9CYD6NDfgy6ZiuWU jU8widHBwIzVkBZ743uWGwNajvrziTrrTT49ybLCWcfuOIGWaKWI7pdQCAgRRb6HyqtH czVETTME1kXuHHa0x1t6BCO1Aj2IumT++Vy3wV5nqTfMnBaLWax7wbqoDJ/V0lg9ZCAI POGIV1rpTKsD/KsUtuEtQYePxpVmNktE+UU1aXbUJ/KluGXY3CXrL71xiaYwEwfnBcmT RDsb3/K3/SdOvswASWOcUItsz34WWs243X6BDer5Siq47xkN70xtgb1kb6ZG4jUcCvIp GeQw== X-Gm-Message-State: ALoCoQmrCkKdHDJUTwy3/nCsnxtmmaq4gYmorqILghxMEi3uYB7Drs2ZF7A4Zu4M7G/JXK08MpFP X-Received: by 10.152.8.9 with SMTP id n9mr586446laa.1.1436223924913; Mon, 06 Jul 2015 16:05:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.34 with SMTP id n2ls686645laj.15.gmail; Mon, 06 Jul 2015 16:05:24 -0700 (PDT) X-Received: by 10.112.13.97 with SMTP id g1mr1184847lbc.52.1436223924628; Mon, 06 Jul 2015 16:05:24 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id sj10si4024288lac.29.2015.07.06.16.05.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 16:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagc2 with SMTP id c2so172713204lag.3 for ; Mon, 06 Jul 2015 16:05:24 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr1161618lbb.35.1436223924480; Mon, 06 Jul 2015 16:05:24 -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 hn6csp2009616lbb; Mon, 6 Jul 2015 16:05:23 -0700 (PDT) X-Received: by 10.50.141.164 with SMTP id rp4mr73833043igb.2.1436223922874; Mon, 06 Jul 2015 16:05:22 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id r5si14647129ign.7.2015.07.06.16.05.21 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 06 Jul 2015 16:05:22 -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 1ZCFRp-0006B2-0z; Mon, 06 Jul 2015 23:05:13 +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 1ZCFRo-0006Aw-7B for edk2-devel@lists.sourceforge.net; Mon, 06 Jul 2015 23:05:12 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.192.181 as permitted sender) client-ip=209.85.192.181; envelope-from=roy.franz@linaro.org; helo=mail-pd0-f181.google.com; Received: from mail-pd0-f181.google.com ([209.85.192.181]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZCFRi-0000kE-MJ for edk2-devel@lists.sourceforge.net; Mon, 06 Jul 2015 23:05:12 +0000 Received: by pdbci14 with SMTP id ci14so113501269pdb.2 for ; Mon, 06 Jul 2015 16:05:01 -0700 (PDT) X-Received: by 10.69.27.39 with SMTP id jd7mr2243008pbd.49.1436223901085; Mon, 06 Jul 2015 16:05:01 -0700 (PDT) Received: from localhost.localdomain (c-73-41-93-56.hsd1.ca.comcast.net. [73.41.93.56]) by mx.google.com with ESMTPSA id m2sm19544337pdp.4.2015.07.06.16.04.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jul 2015 16:04:59 -0700 (PDT) From: Roy Franz To: edk2-devel@lists.sourceforge.net, feng.tian@intel.com, lersek@redhat.com, ard.biesheuvel@linaro.org Date: Mon, 6 Jul 2015 16:04:39 -0700 Message-Id: <1436223879-27956-5-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436223879-27956-1-git-send-email-roy.franz@linaro.org> References: <1436223879-27956-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 X-Headers-End: 1ZCFRi-0000kE-MJ Subject: [edk2] [PATCH V2 4/4] 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.215.49 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