From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::22e; helo=mail-wm0-x22e.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 9AE3521F3884B for ; Thu, 12 Oct 2017 12:40:09 -0700 (PDT) Received: by mail-wm0-x22e.google.com with SMTP id b189so15863845wmd.4 for ; Thu, 12 Oct 2017 12:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=01gjAby0iqRG4cadRuApJw/J8veNSozafr9YtnkXDo8=; b=izzUagIdW7ZzKtW0dnC0O4HbAql0QC6bVNUUIQr0dQhzS+7MA4o7YBmngCWhCU74ML PLD4+oYzsHAj0TMj9RTNqc1dSZHwwnUIESlj67OaYB6sggKPy9fGDYwNZbaTdmYqKu8v jpKRPnxLmEkq/JbUAyXEpUVEnVM+VSgWAvNSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=01gjAby0iqRG4cadRuApJw/J8veNSozafr9YtnkXDo8=; b=KDhV2e/GnuARH99E1dQNzVBkJGZU082e3itOdw9E0FUOBfrGjqpOqhTRjz/6IRyCZl BHvQdBKAh5dQBeQlKZrRf4ARWBQptN6YEXpgDqfA73GgNf4urSs483Q3n8yHJyu2j5fN XAaShV72uPtBQHCliDnpwQMT/AV9BNPL2xW/4hNYnLp4XpNi73L0aKwsLcEzJJZSZplq i795vSWirKPdHQ0iMlY233itFVcyf3rrVZCmQDRKVlYWczmyJ4OXKgBL65SVBVrsOseu tJ+qh7MS3slDJajq950eWUdSGcL+mn1GZn4IMTV2VgupsZhBbKJLca37VnbxRsJVJ80j y5Kw== X-Gm-Message-State: AMCzsaVCzE6w+FZNbgsoLT1jLzKEWAwR1hzVxTZad9dVNr7btxnC7JHQ MD+eLwwm0M2LYVXiOzOr8Shh/W33ld4= X-Google-Smtp-Source: ABhQp+Qz+q/IgwNHZgk0sZ4/Vl/sc7FE9OynWbev0sKJKjKettHfLMF3rrLWU3L/95nfFtOQIjtm3Q== X-Received: by 10.28.66.16 with SMTP id p16mr2973656wma.11.1507837419067; Thu, 12 Oct 2017 12:43:39 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 5sm8933377wrt.59.2017.10.12.12.43.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 12:43:38 -0700 (PDT) Date: Thu, 12 Oct 2017 20:43:36 +0100 From: Leif Lindholm To: evan.lloyd@arm.com Cc: edk2-devel@lists.01.org Message-ID: <20171012194336.zp2tc4acw3vn33yt@bivouac.eciton.net> References: <20170926201529.11644-1-evan.lloyd@arm.com> <20170926201529.11644-12-evan.lloyd@arm.com> MIME-Version: 1.0 In-Reply-To: <20170926201529.11644-12-evan.lloyd@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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: , X-List-Received-Date: Thu, 12 Oct 2017 19:40:10 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 26, 2017 at 09:15:21PM +0100, evan.lloyd@arm.com 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 > --- > 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/Include/Drivers/HdLcd.h > index 6df97a9dfee60e9fda615cf3bea1b6a164a42333..69b47cd720bae86081753affe2f3fafc8aa6c4d0 100644 > --- a/ArmPlatformPkg/Include/Drivers/HdLcd.h > +++ b/ArmPlatformPkg/Include/Drivers/HdLcd.h > @@ -1,6 +1,6 @@ > /** @file HDLcd.h > > - Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
> + Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
> > 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) > > +#define HDLCD_PRODUCT_ID 0x1CDC > + > #endif /* _HDLCD_H_ */ > diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c > index a266671a26f01d31e8ddb0cf7cbfe59d2f4dc49c..33c555e75cafaf9affddd0992c4bd9f9289f6703 100644 > --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c > +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcd.c > @@ -159,6 +159,22 @@ LcdShutdown ( > MmioWrite32 (HDLCD_REG_COMMAND, HDLCD_DISABLE); > } > > +/** Get the HDLCD Product Id (from the version register). > +**/ > +STATIC > +UINT32 GetHdlcdProductId(VOID) > +{ > + return ((MmioRead32 (HDLCD_REG_VERSION)) >> 16) ; I was about to complain that this didn't use the functions from the common PrimeCell helper library. Then I realised we didn't have one :( One for the todo list. Reviewed-by: Leif Lindholm > +} > + > +/** Check if an HDLCD is present. > +**/ > +STATIC > +BOOLEAN HdlcdPresent(VOID) > +{ > + return (GetHdlcdProductId() == 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; > } > -- > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel