From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::141; helo=mail-it1-x141.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x141.google.com (mail-it1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 07A5C21B02822 for ; Thu, 31 Jan 2019 09:14:56 -0800 (PST) Received: by mail-it1-x141.google.com with SMTP id w18so4793109ite.1 for ; Thu, 31 Jan 2019 09:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=reG2P51VSbnHcNg8VpOVkAWFOIJVjrnEioESga+qNN4=; b=U+VUVrqkRDvJ/MpkS6gs2zRovXddWyQ8kMNbRHLAiO2+H4g800Dae4JpESSOzv0PSe pmmbZ5kFerGkYgvIrMg33QxpSlMBp2fF1YUOFb332lVo8S3JPb8O9m97j8p8LiuuLvvV 3aMiD5UhBRbNc/iEmEDK5jUC9yOyr0mLcgzrY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=reG2P51VSbnHcNg8VpOVkAWFOIJVjrnEioESga+qNN4=; b=NlJDU4Zm5gb+hQjXpHlJTC+qDC17Sft4PtI//Irf7dhbRzEga+dcJUef2kRzzPIvBb P8DvII1emCkbG2JgJCMlgYdkFb6ZCZBGkaF4IhAC3RZfrektI2M0RhUPP2rqCsNlRcM6 HaAyLRHM425vElW1oArBCUfX6wMc/oIkbw7xWb67Nru7Vnvu9SbruCWDhXhEudF8iUS3 Uh9/X7OFQSJ++VkUHYvdC6gPCkmZpfHHngTlCdgovehHRR83ywkDVJamwyhjR3WbESTP 9eeJPpSxoXoD29a9BFWDvUS9pEggitZavh4vYpofPmdl1rrsG99qbKy7Vj/DNRvlmPAn XBqg== X-Gm-Message-State: AJcUukeadCq8BOmgQqDk9iewBK1CX0+h2EZmI4GVD5A1UXghKqZNbeTl AIRQGoBkm9es5yCYdUxQ/P9uM8z0uPj9DSrFtTt1KcGh X-Google-Smtp-Source: ALg8bN6iNqbfMwOvGZYvotsXLOHTJ5ux5djo2bApPg/KovuwiUQA5Lx2kRvu+fDoImCtlfGPcdBizzKlDc8G/5dqRsU= X-Received: by 2002:a24:edc4:: with SMTP id r187mr21217623ith.158.1548954896148; Thu, 31 Jan 2019 09:14:56 -0800 (PST) MIME-Version: 1.0 References: <20190130193943.12023-1-ard.biesheuvel@linaro.org> <20190131150553.tte2ed3ik6fiazpd@bivouac.eciton.net> In-Reply-To: <20190131150553.tte2ed3ik6fiazpd@bivouac.eciton.net> From: Ard Biesheuvel Date: Thu, 31 Jan 2019 18:14:45 +0100 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" , Pete Batard 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 17:14:57 -0000 Content-Type: text/plain; charset="UTF-8" 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. > > --- > > 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.