summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authorGirish Pathak <girish.pathak at arm.com>2017-09-26 21:15:21 +0100
committerLeif Lindholm <leif.lindholm@linaro.org>2018-04-23 12:00:52 +0100
commitc18ef81e79c2beccc5738e564fb56f1b78d2d5fc (patch)
tree12733b7dda6ab371cd4402ebd058b75467c1fec7 /ArmPlatformPkg
parentb5daabdcd8a88db615a5d1dfb7b35b61b1ede0c5 (diff)
downloadedk2-c18ef81e79c2beccc5738e564fb56f1b78d2d5fc.tar.gz
edk2-c18ef81e79c2beccc5738e564fb56f1b78d2d5fc.tar.bz2
edk2-c18ef81e79c2beccc5738e564fb56f1b78d2d5fc.zip
ArmPlatformPkg: Implement LcdIdentify function for HDLCD GOP
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>
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/Library/HdLcd/HdLcd.c8
-rw-r--r--ArmPlatformPkg/Library/HdLcd/HdLcd.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c b/ArmPlatformPkg/Library/HdLcd/HdLcd.c
index 28306c530e..039048398c 100644
--- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c
+++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c
@@ -175,11 +175,17 @@ LcdShutdown (
@retval EFI_SUCCESS Returns success if platform implements a HDLCD
controller.
+ @retval EFI_NOT_FOUND HDLCD display controller not found on the
+ platform.
**/
EFI_STATUS
LcdIdentify (
VOID
)
{
- return EFI_SUCCESS;
+ if ((MmioRead32 (HDLCD_REG_VERSION) >> 16) == HDLCD_PRODUCT_ID) {
+ return EFI_SUCCESS;
+ }
+
+ return EFI_NOT_FOUND;
}
diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.h b/ArmPlatformPkg/Library/HdLcd/HdLcd.h
index cd2c0366c7..1efa78eedc 100644
--- a/ArmPlatformPkg/Library/HdLcd/HdLcd.h
+++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.h
@@ -85,4 +85,6 @@
// Number of bytes per pixel
#define HDLCD_4BYTES_PER_PIXEL ((4 - 1) << 3)
+#define HDLCD_PRODUCT_ID 0x1CDC
+
#endif /* HDLCD_H_ */