From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AGs4zMa5eKFgfQKgp/HND08L52+SLr+0VOde7fnZFZBfoE2c/M3Cxg3vpS+mkX3X0vvK5RQZiSeU8A== 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 Cc: leif.lindholm@linaro.org, Ard Biesheuvel , Girish Pathak , Evan Lloyd 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: [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: , X-List-Received-Date: Fri, 08 Dec 2017 17:27:06 -0000 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(+) 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 -- 2.11.0