From patchwork Fri Dec 8 17:31:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 121221 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp928869qgn; Fri, 8 Dec 2017 09:31:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMb2Zc4NtQ7EUzh2D5f45qajQu7AJS8Ftz7WC9B4lDMb6TD4GDcVBrCxD6WiQ7PisVTB4Lvf X-Received: by 10.84.178.195 with SMTP id z61mr30946847plb.205.1512754303257; Fri, 08 Dec 2017 09:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512754303; cv=none; d=google.com; s=arc-20160816; b=XtqHl/nJCzp34FbPD6iU8fHfgAQ4hk7UKYjbcebCcTMk2j36ZJCD6b3V0KpjXGBjCy 1j7AB3OyinpHhgL8GxNWE+jZgukm1+qQL5ziDuITtv0F64oov1nsBjPor4ifKikb61EW fVMgNcYBJ4Ovmt9auV4gZumMWR638Yu6s45IKyNCAYqC6gjGqeYP40Pj1DSNby81KBdD u3VixiYUSc9UEhk/V1c8axGA2tV4bqpv3ngc5cxvV+HidN7/zy22O1ScyDXzsiS8szeg oeF+Q86kO2Vb7qPdbQXTf3mGBoJ4UrcApH7EZxb5dDaq1M31bx2KLMwfb735J0leDx4w QlHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=dRkmadUALO/kN7Cunfzgs7fEyrPNZhIgMKN4GR+SdTU=; b=AmyHUFyEUvc5UwVIzCkR2rzIYMR4Z2FtPgHXj8aSocPoqPIABj8WtM7OyMEhUbDQEe uYXMP3wggzCP2o4P7uqy78e9cLB1owmyajPVot+Eo0PFaE2ElRJtsZfU7NlGzMysj8Tg 4FqsTqNM+aRCFikVutLQxb7yCmQKSFiFOSiwxCh9nYe9Sk6Aw4iV0KyhH6pBtmgZ1hXB 3L9aHPtz+dVrGiXvTVaDBnO0+ynKMLba4TjOAxRAlvx7sLE9OyhYl+WndENyfGVsE2nI o4zmydTODYR6AOSHCzpfYKyZZrMA10kyTujsiYJolaVf4MU1EO0a3aW2qRTUVf4DB+Bk RgFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YWJKNwDp; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id g14si3081748plj.470.2017.12.08.09.31.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Dec 2017 09:31:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YWJKNwDp; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 450A1221EA0C0; Fri, 8 Dec 2017 09:27:08 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 50E5F221EA0BA for ; Fri, 8 Dec 2017 09:27:06 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id h1so11466107wre.12 for ; Fri, 08 Dec 2017 09:31:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OGlj+CBDTrqLnoWMQoK/IB25mtOzOz3/jcn1k2i/9bo=; b=YWJKNwDpSiE+JTbDF6F8Cnao3JFnN5netbUl9GrEtMZNihl34sPwPstckgHKh6repu LAbfqk6x/tbbHCycwW3U9XShaW84IJTpBahmYV2OqJav/8plajDImQEhPI8u7Zec4/Lo VSVrgXlKJdsMU02n1F07Ao4ry3AHm5v8hE2b4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OGlj+CBDTrqLnoWMQoK/IB25mtOzOz3/jcn1k2i/9bo=; b=YpstPAJ2cANEUxDZS3WaQMKU7jThXyZyNRLpTXy0p3APAAzhuyc9VJNIE1aLSL3llA heeXSWAGbFo0b2HqGctyx/aR2kxPsU+uwMIzlylGtYL8+jVpd8ZMBlxoBCIZJEoMnJhS zPzLk19MC3CQNHL4ky8HQdno0gUcFROeZ/vmPjmReHX75qbstGEc8R2JGHBydAZvKIfZ itYHoe3T5rXc033WGBs3lHOBmuIq3c+WPibxWL4mVH2yRk2UriiU+nzYT54LJBgJlE45 661SyTrPgiaSwvwfcU7uOSR6xp94/NM+OzOAjXEQFOzmEYU3O+HiIcLO9Wz37nx34FC7 UNWw== X-Gm-Message-State: AJaThX7JfNcZtOr7qQ+rU8PsppVN8d5TXoN6oSFME72w8Iw69gjNVEAD 3lW3Pz1ks2JLz6KQ+iVsFBxpHoGUWh8= X-Received: by 10.223.150.175 with SMTP id u44mr29060174wrb.115.1512754299105; Fri, 08 Dec 2017 09:31:39 -0800 (PST) Received: from localhost.localdomain ([160.171.158.223]) by smtp.gmail.com with ESMTPSA id q15sm8904685wra.91.2017.12.08.09.31.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Dec 2017 09:31:38 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 8 Dec 2017 17:31:24 +0000 Message-Id: <20171208173128.28485-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171208173128.28485-1-ard.biesheuvel@linaro.org> References: <20171208173128.28485-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 1/5] ArmPlatformPkg: introduce LcdHwLib library class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add the declaration and include file for the new LcdHwLib library class, which will allow us to abstract away from platform variations in the LCD graphics output driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Girish Pathak Signed-off-by: Evan Lloyd [ardb: add NULL implementation as well and add it to ArmPlatformPkg.dsc] Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmPlatformPkg.dec | 1 + ArmPlatformPkg/ArmPlatformPkg.dsc | 1 + ArmPlatformPkg/Include/Library/LcdHwLib.h | 68 ++++++++++++++++++ ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c | 75 ++++++++++++++++++++ ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf | 28 ++++++++ 5 files changed, 173 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatformPkg.dec index 6a7bbc02d011..b33b6e630d85 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -33,6 +33,7 @@ [Includes.common] [LibraryClasses] ArmPlatformLib|Include/Library/ArmPlatformLib.h + LcdHwLib|Include/Library/LcdHwLib.h LcdPlatformLib|Include/Library/LcdPlatformLib.h NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h PL011UartLib|Include/Library/PL011UartLib.h diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc index c3a8c257cb02..9dd64b472acf 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dsc +++ b/ArmPlatformPkg/ArmPlatformPkg.dsc @@ -101,6 +101,7 @@ [Components.common] ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf + ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf ArmPlatformPkg/Library/NorFlashPlatformNullLib/NorFlashPlatformNullLib.inf ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf diff --git a/ArmPlatformPkg/Include/Library/LcdHwLib.h b/ArmPlatformPkg/Include/Library/LcdHwLib.h new file mode 100644 index 000000000000..0c0480862aea --- /dev/null +++ b/ArmPlatformPkg/Include/Library/LcdHwLib.h @@ -0,0 +1,68 @@ +/** @file LcdHwLib.h + + This file contains interface functions for LcdHwLib of ArmPlatformPkg + + Copyright (c) 2017, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef LCD_HW_LIB_H_ +#define LCD_HW_LIB_H_ + +#include + +/** + Check for presence of display + + @retval EFI_SUCCESS Platform implements display. + @retval EFI_NOT_FOUND Display not found on the platform. + +**/ +EFI_STATUS +LcdIdentify ( + VOID + ); + +/** + Initialize display. + + @param FrameBaseAddress Address of the frame buffer. + @retval EFI_SUCCESS Display initialization success. + @retval !(EFI_SUCCESS) Display initialization failure. + +**/ +EFI_STATUS +LcdInitialize ( + EFI_PHYSICAL_ADDRESS FrameBaseAddress + ); + +/** + Set requested mode of the display. + + @param ModeNumber Display mode number. + @retval EFI_SUCCESS Display set mode success. + @retval EFI_DEVICE_ERROR If mode not found/supported. + +**/ +EFI_STATUS +LcdSetMode ( + IN UINT32 ModeNumber + ); + +/** + De-initializes the display. +**/ +VOID +LcdShutdown ( + VOID + ); + +#endif /* LCD_HW_LIB_H_ */ diff --git a/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c new file mode 100644 index 000000000000..2d31b5183c95 --- /dev/null +++ b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c @@ -0,0 +1,75 @@ +/** @file + + Copyright (c) 2017, Linaro, Ltd. All rights reserved. + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include +#include +#include +#include + +/** + Check for presence of display + + @retval EFI_SUCCESS Platform implements display. + @retval EFI_NOT_FOUND Display not found on the platform. + +**/ +EFI_STATUS +LcdIdentify ( + VOID + ) +{ + return EFI_SUCCESS; +} + +/** + Initialize display. + + @param FrameBaseAddress Address of the frame buffer. + @retval EFI_SUCCESS Display initialization success. + @retval !(EFI_SUCCESS) Display initialization failure. + +**/ +EFI_STATUS +LcdInitialize ( + EFI_PHYSICAL_ADDRESS FrameBaseAddress + ) +{ + return EFI_SUCCESS; +} + +/** + Set requested mode of the display. + + @param ModeNumber Display mode number. + @retval EFI_SUCCESS Display set mode success. + @retval EFI_DEVICE_ERROR If mode not found/supported. + +**/ +EFI_STATUS +LcdSetMode ( + IN UINT32 ModeNumber + ) +{ + return EFI_SUCCESS; +} + +/** + De-initializes the display. +**/ +VOID +LcdShutdown ( + VOID + ) +{ +} diff --git a/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf new file mode 100644 index 000000000000..d556bed65548 --- /dev/null +++ b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf @@ -0,0 +1,28 @@ +#/** @file +# +# Copyright (c) 2017, Linaro, Ltd. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +#**/ + +[Defines] + INF_VERSION = 0x0001001A + BASE_NAME = LcdHwNullLib + FILE_GUID = bb1fde98-1de2-410e-8850-fdcb8e67ebc0 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = LcdHwLib + +[Sources] + LcdHwNullLib.c + +[Packages] + ArmPlatformPkg/ArmPlatformPkg.dec + MdePkg/MdePkg.dec