]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: Implement LcdIdentify function for HDLCD GOP
authorGirish Pathak <girish.pathak at arm.com>
Tue, 26 Sep 2017 20:15:21 +0000 (21:15 +0100)
committerLeif Lindholm <leif.lindholm@linaro.org>
Mon, 23 Apr 2018 11:00:52 +0000 (12:00 +0100)
LcdIdentify function does not currently check presence of HDLCD
controller.

Implement this functionality by reading HDLCD_REG_VERSION and checking
against the PRODUCT_ID field to detect presence of HDLCD controller.

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>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/Library/HdLcd/HdLcd.c
ArmPlatformPkg/Library/HdLcd/HdLcd.h

index 28306c530e08b5e0fcef4308435045da3c9e093c..039048398c531ec944bc4b43a5551a554a368481 100644 (file)
@@ -175,11 +175,17 @@ LcdShutdown (
 \r
   @retval EFI_SUCCESS            Returns success if platform implements a HDLCD\r
                                  controller.\r
+  @retval EFI_NOT_FOUND          HDLCD display controller not found on the\r
+                                 platform.\r
 **/\r
 EFI_STATUS\r
 LcdIdentify (\r
   VOID\r
   )\r
 {\r
-  return EFI_SUCCESS;\r
+  if ((MmioRead32 (HDLCD_REG_VERSION) >> 16) == HDLCD_PRODUCT_ID) {\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
+  return EFI_NOT_FOUND;\r
 }\r
index cd2c0366c7b563d7fb313f82abeef7eb1aa3ef72..1efa78eedc3013b3ab4615181a59c7d15b851ab5 100644 (file)
@@ -85,4 +85,6 @@
 // Number of bytes per pixel\r
 #define HDLCD_4BYTES_PER_PIXEL           ((4 - 1) << 3)\r
 \r
+#define HDLCD_PRODUCT_ID                 0x1CDC\r
+\r
 #endif /* HDLCD_H_ */\r