From nobody Thu Dec 26 11:58:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1506456972666137.60500556333523; Tue, 26 Sep 2017 13:16:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9BD7320945BBA; Tue, 26 Sep 2017 13:12:30 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A224F21EC8D16 for ; Tue, 26 Sep 2017 13:12:26 -0700 (PDT) Received: from E111747.Emea.Arm.com (e111747.emea.arm.com [10.1.27.40]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v8QKFY5a017392; Tue, 26 Sep 2017 21:15:37 +0100 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.96.140; helo=cam-smtp0.cambridge.arm.com; envelope-from=evan.lloyd@arm.com; receiver=edk2-devel@lists.01.org From: evan.lloyd@arm.com To: edk2-devel@lists.01.org Date: Tue, 26 Sep 2017 21:15:21 +0100 Message-Id: <20170926201529.11644-12-evan.lloyd@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170926201529.11644-1-evan.lloyd@arm.com> References: <20170926201529.11644-1-evan.lloyd@arm.com> Subject: [edk2] [PATCH 11/19] ArmPlatformPkg: Implement LcdIdentify function for HDLCD GOP 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: "ard.biesheuvel@linaro.org"@arm.com, "leif.lindholm@linaro.org"@arm.com, "nd@arm.com"@arm.com, "Matteo.Carlini@arm.com"@arm.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Girish Pathak 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 Signed-off-by: Evan Lloyd Reviewed-by: Leif Lindholm --- ArmPlatformPkg/Include/Drivers/HdLcd.h | 4 +++- ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c | 22 +++++++++++++++++= ++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/Include/Drivers/HdLcd.h b/ArmPlatformPkg/Includ= e/Drivers/HdLcd.h index 6df97a9dfee60e9fda615cf3bea1b6a164a42333..69b47cd720bae86081753affe2f= 3fafc8aa6c4d0 100644 --- a/ArmPlatformPkg/Include/Drivers/HdLcd.h +++ b/ArmPlatformPkg/Include/Drivers/HdLcd.h @@ -1,6 +1,6 @@ /** @file HDLcd.h =20 - Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
+ Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD= License @@ -86,4 +86,6 @@ // Number of bytes per pixel #define HDLCD_4BYTES_PER_PIXEL ((4 - 1) << 3) =20 +#define HDLCD_PRODUCT_ID 0x1CDC + #endif /* _HDLCD_H_ */ diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c b/ArmPlatf= ormPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c index a266671a26f01d31e8ddb0cf7cbfe59d2f4dc49c..33c555e75cafaf9affddd0992c4= bd9f9289f6703 100644 --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c @@ -159,6 +159,22 @@ LcdShutdown ( MmioWrite32 (HDLCD_REG_COMMAND, HDLCD_DISABLE); } =20 +/** Get the HDLCD Product Id (from the version register). +**/ +STATIC +UINT32 GetHdlcdProductId(VOID) +{ + return ((MmioRead32 (HDLCD_REG_VERSION)) >> 16) ; +} + +/** Check if an HDLCD is present. +**/ +STATIC +BOOLEAN HdlcdPresent(VOID) +{ + return (GetHdlcdProductId() =3D=3D HDLCD_PRODUCT_ID); +} + /** Check for presence of HDLCD. * * @retval EFI_SUCCESS Platform implements HDLCD. @@ -170,5 +186,9 @@ LcdIdentify ( VOID ) { - return EFI_SUCCESS; + if (HdlcdPresent()) { + return EFI_SUCCESS; + } + + return EFI_NOT_FOUND; } --=20 Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel