From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::244; helo=mail-io0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::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 939BE2219BCAF for ; Sat, 23 Dec 2017 05:20:00 -0800 (PST) Received: by mail-io0-x244.google.com with SMTP id x129so27175378iod.13 for ; Sat, 23 Dec 2017 05:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zqALokn3ab+papRU1lImQ1meh4Ih0AN4uJae+fqkyxw=; b=DH9flIh+e/Tp0Szruel8FqRN7MoZHFeC/BvDSY8TLV3n0mXH/KekUX5kqUaKouLIhl qnASN//xXBUKPmTL6vZfjsdwsSeWCCoNDxRGllmSU69zANkWK3tcRwyOCooFLywqgWK3 9G1iPMpDfDptLugafEeMQNvrxiVjCdmBJU73A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zqALokn3ab+papRU1lImQ1meh4Ih0AN4uJae+fqkyxw=; b=kK+HUjFtUkazkzOIMcFx4MeZlgrX/9S82jdRlNCgb+S5k4mJs8niYPHZGfzO5BfdgI jBRQXem/jdhnBkMgUvF7uD4ABNg+rgz7DSccYGRpkanXNzToPBMADKK3OQrscekEswyr DZPeiiu1a4un8coZv0MAuDiY0ryfuv8xMbbOi22BuMc/sTR2d7y+F8UfGV+/ZyPp5KQR dHmu1l3LXC+XBwRmsg0XBDWg7ySN3I0AD7n6hkwX9UOKdfG0L+mBkhwZDuWBC9qrfJdG yHQOZsWIu8SG1eSVuPPkxcfshDhSjIgdx29/61omKL3RdbX/+/+Apy/MCuKqJu7pUjxY nF0Q== X-Gm-Message-State: AKGB3mL5DVDYo+UxPsx6OQT+uutvOQRoNs5gbp2YgmQw15qud0RiE5yi j2RELrMmcTcjzHlaAFIQEu8K5XSGoA9djg8qBGPnqXMSSmE= X-Google-Smtp-Source: ACJfBouK51jrXHWMPUYW5DHU0tlPFTV1Quv5zyHlRcaXk6lzwAWmSaRkQL+Mbv2xAdk8tP/cO5i8in3GBvhj7fmqVJo= X-Received: by 10.107.2.212 with SMTP id 203mr17684089ioc.186.1514035490955; Sat, 23 Dec 2017 05:24:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.52.14 with HTTP; Sat, 23 Dec 2017 05:24:50 -0800 (PST) In-Reply-To: <20171222183418.8616-7-evan.lloyd@arm.com> References: <20171222183418.8616-1-evan.lloyd@arm.com> <20171222183418.8616-7-evan.lloyd@arm.com> From: Ard Biesheuvel Date: Sat, 23 Dec 2017 13:24:50 +0000 Message-ID: To: Evan Lloyd Cc: "edk2-devel@lists.01.org" , <"ard.biesheuvel@linaro.org"@arm.com>, <"leif.lindholm@linaro.org"@arm.com>, <"Matteo.Carlini@arm.com"@arm.com>, <"nd@arm.com"@arm.com> Subject: Re: [PATCH v2 06/13] ArmPlatformPkg: Implement LcdIdentify function for HDLCD GOP X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 13:20:01 -0000 Content-Type: text/plain; charset="UTF-8" On 22 December 2017 at 18:34, wrote: > 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: Ard Biesheuvel > --- > ArmPlatformPkg/Library/HdLcd/HdLcd.h | 2 ++ > ArmPlatformPkg/Library/HdLcd/HdLcd.c | 8 +++++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.h b/ArmPlatformPkg/Library/HdLcd/HdLcd.h > index 861d3c398f7d6b9a171b4d8718c2816419d8e20a..b69fc3436a190b7b20df63fac42e4bef2b522942 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_ */ > diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c b/ArmPlatformPkg/Library/HdLcd/HdLcd.c > index d71b6020dc0c4b91e74d16e96b06a60601b9628a..b2779af041fae58d712270002cc7d6d277360311 100644 > --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c > +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c > @@ -174,9 +174,15 @@ LcdShutdown (VOID) > > @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; > } > -- > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") >