From patchwork Wed Jul 8 00:44:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 50854 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0590E229FC for ; Wed, 8 Jul 2015 00:45:03 +0000 (UTC) Received: by laar3 with SMTP id r3sf62461065laa.1 for ; Tue, 07 Jul 2015 17:45:02 -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=cTtZJ7quYzzKAPjV+pDg9aAq7WggktZZ0KxnevuVvV99DodRTFFN4u1P6yHemSvIJz TsPqHe+DxTdMSsJn0u3u7YgVvjYNHP0EOXIoJhX4GyYFYFxVuEP+vPvQqlpUtO7j0w5K D8c1Ka/9Q+/Y4MeQ5BPz7j5h/q/utjO9SjMXW4aAoMCgRNOh1jzTjukXU6Ki+ydrX0d3 W5HRdxHNfBjR9X/+VHZjwSH7fkQuCYQmyEuKv3T8FCRLEYXqghTNfjfzBHdQeuc0AuhD uZSOlZQmUFWXh658S4rWoevGfDy03R/N2j2TX7LJtcyXf9j+hkYcu3SEkkJ92q/8s9fq MC/w== X-Gm-Message-State: ALoCoQkEBuSA1210KIkVKkHMUXVhKRxptkzTXHXUdJjJFNSyu2YIDPVdUJga6NZnLz3Q2oyWdFNF X-Received: by 10.152.27.130 with SMTP id t2mr3417237lag.2.1436316301673; Tue, 07 Jul 2015 17:45:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.227 with SMTP id n3ls925559lan.0.gmail; Tue, 07 Jul 2015 17:45:01 -0700 (PDT) X-Received: by 10.152.9.137 with SMTP id z9mr6581227laa.68.1436316301493; Tue, 07 Jul 2015 17:45:01 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id k5si375030lbq.22.2015.07.07.17.45.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 17:45:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcpe5 with SMTP id pe5so46673014lbc.2 for ; Tue, 07 Jul 2015 17:45:01 -0700 (PDT) X-Received: by 10.112.42.50 with SMTP id k18mr6016740lbl.76.1436316301354; Tue, 07 Jul 2015 17:45:01 -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 hn6csp2725764lbb; Tue, 7 Jul 2015 17:45:00 -0700 (PDT) X-Received: by 10.50.13.98 with SMTP id g2mr55560859igc.16.1436316294121; Tue, 07 Jul 2015 17:44:54 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id n202si912685ion.63.2015.07.07.17.44.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 Jul 2015 17:44:54 -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-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZCdTh-0005xS-6F; Wed, 08 Jul 2015 00:44:45 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZCdTf-0005xI-Qb for edk2-devel@lists.sourceforge.net; Wed, 08 Jul 2015 00:44:43 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.192.170 as permitted sender) client-ip=209.85.192.170; envelope-from=roy.franz@linaro.org; helo=mail-pd0-f170.google.com; Received: from mail-pd0-f170.google.com ([209.85.192.170]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZCdTe-000684-Uz for edk2-devel@lists.sourceforge.net; Wed, 08 Jul 2015 00:44:43 +0000 Received: by pdbdz6 with SMTP id dz6so40206577pdb.0 for ; Tue, 07 Jul 2015 17:44:37 -0700 (PDT) X-Received: by 10.70.128.226 with SMTP id nr2mr14289486pdb.139.1436316277356; Tue, 07 Jul 2015 17:44:37 -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 tm3sm337917pac.44.2015.07.07.17.44.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jul 2015 17:44:36 -0700 (PDT) From: Roy Franz To: edk2-devel@lists.sourceforge.net, feng.tian@intel.com, lersek@redhat.com, ard.biesheuvel@linaro.org Date: Tue, 7 Jul 2015 17:44:17 -0700 Message-Id: <1436316258-19655-5-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436316258-19655-1-git-send-email-roy.franz@linaro.org> References: <1436316258-19655-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: 1ZCdTe-000684-Uz Subject: [edk2] [PATCH V3 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.180 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