ArmPlatformPkg: introduce LcdHwLib library class
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 1 Dec 2017 09:41:10 +0000 (09:41 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 12 Dec 2017 17:37:29 +0000 (17:37 +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 <girish.pathak@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
[ardb: add NULL implementation as well and add it to ArmPlatformPkg.dsc]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/ArmPlatformPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dsc
ArmPlatformPkg/Include/Library/LcdHwLib.h [new file with mode: 0644]
ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c [new file with mode: 0644]
ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf [new file with mode: 0644]

index 6a7bbc0..b33b6e6 100644 (file)
@@ -33,6 +33,7 @@
 \r
 [LibraryClasses]\r
   ArmPlatformLib|Include/Library/ArmPlatformLib.h\r
+  LcdHwLib|Include/Library/LcdHwLib.h\r
   LcdPlatformLib|Include/Library/LcdPlatformLib.h\r
   NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h\r
   PL011UartLib|Include/Library/PL011UartLib.h\r
index c3a8c25..9dd64b4 100644 (file)
 \r
   ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf\r
   ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
+  ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf\r
   ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf\r
   ArmPlatformPkg/Library/NorFlashPlatformNullLib/NorFlashPlatformNullLib.inf\r
   ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf\r
diff --git a/ArmPlatformPkg/Include/Library/LcdHwLib.h b/ArmPlatformPkg/Include/Library/LcdHwLib.h
new file mode 100644 (file)
index 0000000..0c04808
--- /dev/null
@@ -0,0 +1,68 @@
+/** @file LcdHwLib.h\r
+\r
+  This file contains interface functions for LcdHwLib of ArmPlatformPkg\r
+\r
+  Copyright (c) 2017, ARM Ltd. All rights reserved.<BR>\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef LCD_HW_LIB_H_\r
+#define LCD_HW_LIB_H_\r
+\r
+#include <Uefi/UefiBaseType.h>\r
+\r
+/**\r
+  Check for presence of display\r
+\r
+  @retval EFI_SUCCESS            Platform implements display.\r
+  @retval EFI_NOT_FOUND          Display not found on the platform.\r
+\r
+**/\r
+EFI_STATUS\r
+LcdIdentify (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Initialize display.\r
+\r
+  @param  FrameBaseAddress       Address of the frame buffer.\r
+  @retval EFI_SUCCESS            Display initialization success.\r
+  @retval !(EFI_SUCCESS)         Display initialization failure.\r
+\r
+**/\r
+EFI_STATUS\r
+LcdInitialize (\r
+  EFI_PHYSICAL_ADDRESS  FrameBaseAddress\r
+  );\r
+\r
+/**\r
+  Set requested mode of the display.\r
+\r
+  @param  ModeNumber             Display mode number.\r
+  @retval EFI_SUCCESS            Display set mode success.\r
+  @retval EFI_DEVICE_ERROR       If mode not found/supported.\r
+\r
+**/\r
+EFI_STATUS\r
+LcdSetMode (\r
+  IN UINT32  ModeNumber\r
+  );\r
+\r
+/**\r
+  De-initializes the display.\r
+**/\r
+VOID\r
+LcdShutdown (\r
+  VOID\r
+  );\r
+\r
+#endif /* LCD_HW_LIB_H_ */\r
diff --git a/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c
new file mode 100644 (file)
index 0000000..2d31b51
--- /dev/null
@@ -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 <Base.h>
+#include <Uefi/UefiBaseType.h>
+#include <Library/DebugLib.h>
+#include <Library/LcdPlatformLib.h>
+
+/**
+  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 (file)
index 0000000..d556bed
--- /dev/null
@@ -0,0 +1,28 @@
+#/** @file\r
+#\r
+#  Copyright (c) 2017, Linaro, Ltd. All rights reserved.\r
+#\r
+#  This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution.  The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x0001001A\r
+  BASE_NAME                      = LcdHwNullLib\r
+  FILE_GUID                      = bb1fde98-1de2-410e-8850-fdcb8e67ebc0\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = LcdHwLib\r
+\r
+[Sources]\r
+  LcdHwNullLib.c\r
+\r
+[Packages]\r
+  ArmPlatformPkg/ArmPlatformPkg.dec\r
+  MdePkg/MdePkg.dec\r