From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::442; helo=mail-wr1-x442.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 28731211C3870 for ; Thu, 31 Jan 2019 07:05:57 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id p7so3722088wru.0 for ; Thu, 31 Jan 2019 07:05:57 -0800 (PST) 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=EfutARdkZ4Ok1MrFJz+fTFZ1t/4+DZGjR4hG6CPg/O8=; b=VELKUApCTYrU8847R7ZXowQLb7USzngoftLKKZSxIuXe9HZhtJTGgjHZ3vgLcgJuo1 +N2v+sJOp52wkYox/aZGdf4eh2hUDaeeKWLk6GmudAdToSm3RlyJRyJRHqLM9VB7HAJQ P28e2YrgWwt0BZ/2lLBL2w8Yc4wJE4fawk50o= 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=EfutARdkZ4Ok1MrFJz+fTFZ1t/4+DZGjR4hG6CPg/O8=; b=i/Hh/nWzZU3X5+O84NP7S9vS+AuIKgOb+gHnjmX76rzFCg3wpyDx37IEX0WHMSPjJ9 z7DseAdtlZE6w7U8BQRdvM8Yp9d141CG6iIm/NYO2kN7AUcDlh7/TguCThGPEkMsXzCI TFdEl9/aSHG3cdoAWbYjRK11mCrPiALETJDVY0c2AHW/CYd3kynVXwQOTm2T8Mutqa4d H/TR83dOHyXLjKKcvGd0UzEud4LiYQJzeq9BgPGOdl2XiBCKiT8wUMe8KX/JuZs9gW45 5n45BOW23MSLnkyeoXGDNiLpqPwZRWS0BGEZ1QdMV/70iqpswBfu6ThK4DknNuKLFQIZ IMbQ== X-Gm-Message-State: AJcUukflFni4/m8EcinpXREhdOG5J0IHKkiw/aEVPzC7ltpqvJpHlA3t 4MKOSQ/HqSiZzzpqWbuyoCAKfg== X-Google-Smtp-Source: ALg8bN4w2GEtkimtc5SbiJY0YIMecjac7RdlyLEtrB4kxYWX3mYDSQFqgTLrFYtJP2T8J3+ztnvWyQ== X-Received: by 2002:adf:9d4c:: with SMTP id o12mr32758253wre.94.1548947156459; Thu, 31 Jan 2019 07:05:56 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id e17sm9246095wri.36.2019.01.31.07.05.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 07:05:55 -0800 (PST) Date: Thu, 31 Jan 2019 15:05:53 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, pete@akeo.ie Message-ID: <20190131150553.tte2ed3ik6fiazpd@bivouac.eciton.net> References: <20190130193943.12023-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20190130193943.12023-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms] Silicon/Bcm2836: add random number generator driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 15:05:58 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 30, 2019 at 08:39:43PM +0100, Ard Biesheuvel wrote: > Expose the SoC's RNG peripheral via the EFI_RNG_PROTOCOL. > This is used by Linux to seed the KASLR routines. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel Not tested, but looks fine. Only question: could we add those few #defines to IndustryStandard/Bcm2836.h (should that really be #IndustryStandard, btw?) rather than creating a tiny standalone one? (more below) > --- > Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c | 204 ++++++++++++++++++++ > Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf | 45 +++++ > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Rng.h | 26 +++ > 3 files changed, 275 insertions(+) > > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Rng.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Rng.h > new file mode 100644 > index 000000000000..8274e2fe8f77 > --- /dev/null > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Rng.h > @@ -0,0 +1,26 @@ > + /** @file > + * > + * Copyright (c) 2019 Linaro, Ltd. All rights reserved. > + * > + * This program and the accompanying materials > + * are licensed and made available under the terms and conditions of the BSD License > + * which accompanies this distribution. The full text of the license may be found at > + * http://opensource.org/licenses/bsd-license.php > + * > + * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > + * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > + * > + **/ > + > +#ifndef __BCM2836_RNG_H__ > +#define __BCM2836_RNG_H__ > + > +#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00104000) If we can't, this file needs to pull in Bcm2836.h anyway. / Leif > + > +#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_RNG_H__ */ > -- > 2.20.1 >