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::444; helo=mail-wr1-x444.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 5C51D2194D3B8 for ; Thu, 31 Jan 2019 10:35:07 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id 96so4480384wrb.2 for ; Thu, 31 Jan 2019 10:35:07 -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=McAUerejrvH5Zn1KWhRMmg7kSYDWC3qN7funtXD2//k=; b=LzdG1/sI4c+bfkB45XX3cnfwPMTqnOqA1VOh06pAGneTGzxtHgAzUpxKnpQ04/ZvK8 njkXY1X8I1rl5/mM2mOYUhIhMz7s92WsyokIkYnlEYvxgD3KlBB/F37VHxMbGV/PVIz/ qy9SvNDIQPJazazOMfr8ZKu0jfSkKT5N33i6s= 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=McAUerejrvH5Zn1KWhRMmg7kSYDWC3qN7funtXD2//k=; b=T3aecNx/EYo8px8ZjZ4LAIUhZQZ81HHwXJnYDkBCsCozqvZP51slgA2Ekv0hyey93B RCt7JX4TTPoxXQgmHxMFsGGS6PN9C4Rd4p8dfQcluwG19Rb0kUAVAnXMSB3AbvbdUL1x A1OvBqseEG+abpPN/zaovoFAA0kfiK8Qdc55Xm1TkweYpmINku0vVEhZz7dLo4M+ZO8G 9Ix9kPeYiJSStD6bdEGAG9d5xcZDZRReC0KUJCe4FW+3Sfa7xZLxrFiH43140fjuYE5R xUHv5YVW/zlU4e8V6T9cjTx+TQgJY/HmlD32b/yV+aItH4nrEjYwxHwMprnGYkaWqQU1 SbcA== X-Gm-Message-State: AJcUuke1/gKcxBvBzU42Cby5/1FRwnOPUSIYM8MDAtBAETCPJQikvCZ2 z99jniaTtoYnmolrNARNObgGnEzKrpk= X-Google-Smtp-Source: ALg8bN7RCysNbDzQgAdIwC6/tl6gh/gUZG72+RlwaxuhEGMwE6ffAW8mUUGzX0y389fxBij2a6bq8w== X-Received: by 2002:adf:891a:: with SMTP id s26mr35199455wrs.44.1548959705695; Thu, 31 Jan 2019 10:35:05 -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 p10sm58905wmd.14.2019.01.31.10.35.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 10:35:04 -0800 (PST) Date: Thu, 31 Jan 2019 18:35:03 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Pete Batard Message-ID: <20190131183503.tjujxj2anjewsyh6@bivouac.eciton.net> References: <20190130193943.12023-1-ard.biesheuvel@linaro.org> <20190131150553.tte2ed3ik6fiazpd@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: 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 18:35:07 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 31, 2019 at 06:14:45PM +0100, Ard Biesheuvel wrote: > On Thu, 31 Jan 2019 at 16:05, Leif Lindholm wrote: > > > > 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) > > > > Sure. > > Re IndustryStandard/, I deliberately chose something idiomatic for > EDK2, and this is the least inappropriate one. I could live with > Chipset/ as well, but dumping headers under Include/ directly is not > the solution IMO. I disagree. Dumping the main SoC header under the top-level SoC directory (and same pattern for platform) is idiomatic. Dumping all kinds of random files there isn't, I agree (although that happens too). BeagleBoardPkg/Include/BeagleBoard.h OvmfPkg/Include/OvmfPlatforms.h Vlv2TbltDevicePkg/Include/Platform.h Silicon/Hisilicon/Hi6220/Include/Hi6220.h An alternative pattern is an include directory named after the SoC/Platform. Omap35xxPkg/Include/Omap3530/ You used Silicon/Socionext/SynQuacer/Include/Platform/ which I also don't mind. If you'd prefer it, I'd be happy with Platform/ and Silicon/. But we'd better settle on something before Pete changes too much based on my feedback. / Leif > > > --- > > > 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. > > > > Yep.