From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web09.260.1575289048543266062 for ; Mon, 02 Dec 2019 04:17:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y26VUVph; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575289047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iAnZ8n3zt0AwNhDMF9vDkxLNRuErNsH5Pbr+bpEWfoI=; b=Y26VUVph+WzDu9kpxiaUk+6YHJUBREwBrbB+37YEUEeoNp4QVlaY345hBlFxGWc28L5y4/ eZ0NBk4ciU6dkeffm5pPgnM9s21zSBIyOculQHol3ZnJUsPmgjbMxGGwBHTHJhLBqp9jn9 HPhVO6p6cTg8k3405U7le9b96peEJ78= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-208-K_pvA-HpOJCT0-F7glecDw-1; Mon, 02 Dec 2019 07:17:23 -0500 Received: by mail-wm1-f70.google.com with SMTP id z2so1236808wmf.5 for ; Mon, 02 Dec 2019 04:17:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iAnZ8n3zt0AwNhDMF9vDkxLNRuErNsH5Pbr+bpEWfoI=; b=sazHJyQsbfyYJna1Bq0dECf973XzMiT6607lQfELuBuN01DOuyNGAXsPrEjslx8PDV izTays81PMIupkVA66x1qorBzpad8Beia8eFNGhqPflpu+0zFHopp31HNLnAtBL/o/cT N5+h2UhNW8b6yXHjDWadI9mFeSvDRoqEAzHbfS54OYTTCOCtXAWoCO3OtqaztNxA+ysR ZJ1tq9o+8S7XE/T2AGot7b1steQf6Ky3kyV+nB/x36uarg5BGametba7OdOXgGtA/4Ku yYmjS4xFN4ma2VYzpuWNOvSr47ZX815+RCTESPx/Ke2OS8ntD9HawAdJ4PD1wsHr8RqR JO1w== X-Gm-Message-State: APjAAAW0A6zaT2ArzvQf5lA+7r7sRR0u3aQ7vwa/sRhA9YwcUGIRsfzq w/Rk/dfHsMuv4Z144O3jJsclagInSIHXueKN0Za3T2UzSAgLn/6FHREnJMc30F+4mgn3rmsDRJ7 1IsmQ4HpWcHVerA== X-Received: by 2002:a1c:f70a:: with SMTP id v10mr26090697wmh.159.1575289042840; Mon, 02 Dec 2019 04:17:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzA6vdECSRh+O65cU/NHSz3vOYY50Tw+1FwUGaz7sQj8OMrYjuNkGTXwoEPJT4T2LmQQF1kaA== X-Received: by 2002:a1c:f70a:: with SMTP id v10mr26090678wmh.159.1575289042645; Mon, 02 Dec 2019 04:17:22 -0800 (PST) Return-Path: Received: from [192.168.1.35] (182.red-88-21-103.staticip.rima-tde.net. [88.21.103.182]) by smtp.gmail.com with ESMTPSA id s65sm7899051wmf.48.2019.12.02.04.17.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Dec 2019 04:17:21 -0800 (PST) Subject: Re: [edk2-platforms][PATCH 2/3] Silicon/Broadcom/Bcm283x: Move Bcm2835 RNG defines to their own header To: Pete Batard , devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org References: <20191202115506.4068-1-pete@akeo.ie> <20191202115506.4068-3-pete@akeo.ie> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <3ec20de1-6d27-e947-d712-52ce63d77156@redhat.com> Date: Mon, 2 Dec 2019 13:17:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191202115506.4068-3-pete@akeo.ie> X-MC-Unique: K_pvA-HpOJCT0-F7glecDw-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 12/2/19 12:55 PM, Pete Batard wrote: > While the Bcm2835 and Bcm2838 RNG appear to share the same register layout, > we prefer moving the RNG specific defines into their own header in case > this assertion doesn't hold true with future RNG drivers. > > Also, this should make it clearer to see which specific elements apply to > which SoC implementation. > > Signed-off-by: Pete Batard > --- > Silicon/Broadcom/Bcm283x/Drivers/Bcm2835RngDxe/Bcm2835RngDxe.c | 2 +- > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2835Rng.h | 22 ++++++++++++++++++++ > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 9 -------- > 3 files changed, 23 insertions(+), 10 deletions(-) > > diff --git a/Silicon/Broadcom/Bcm283x/Drivers/Bcm2835RngDxe/Bcm2835RngDxe.c b/Silicon/Broadcom/Bcm283x/Drivers/Bcm2835RngDxe/Bcm2835RngDxe.c > index ea86f9b3877e..84d194ea8472 100644 > --- a/Silicon/Broadcom/Bcm283x/Drivers/Bcm2835RngDxe/Bcm2835RngDxe.c > +++ b/Silicon/Broadcom/Bcm283x/Drivers/Bcm2835RngDxe/Bcm2835RngDxe.c > @@ -14,7 +14,7 @@ > #include > #include > > -#include > +#include > > #include > > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2835Rng.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2835Rng.h > new file mode 100644 > index 000000000000..817c91cb24c1 > --- /dev/null > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2835Rng.h > @@ -0,0 +1,22 @@ > +/** @file > + * > + * Copyright (c) 2019, Pete Batard . > + * > + * SPDX-License-Identifier: BSD-2-Clause-Patent > + * > + **/ > + > +#ifndef BCM2835_RNG_H__ > +#define BCM2835_RNG_H__ > + > +#define BCM2835_RNG_OFFSET 0x00104000 > +#define RNG_BASE_ADDRESS ((FixedPcdGet64 (PcdBcm283xRegistersAddress)) \ > + + BCM2835_RNG_OFFSET) > + > +#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) > +#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) > +#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) > + > +#define RNG_CTRL_ENABLE 0x1 > + > +#endif /* BCM2835_RNG_H__ */ > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > index 72c8e9dc4b14..02107086d439 100644 > --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > @@ -50,13 +50,4 @@ > #define BCM2836_INTC_TIMER_CONTROL_OFFSET 0x00000040 > #define BCM2836_INTC_TIMER_PENDING_OFFSET 0x00000060 > > -/* random number generator */ > -#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00104000) > - > -#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) > -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) > -#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) > - > -#define RNG_CTRL_ENABLE 0x1 > - > #endif /*__BCM2836_H__ */ > Reviewed-by: Philippe Mathieu-Daude