From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web09.29.1575287725545926280 for ; Mon, 02 Dec 2019 03:55:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=U8ZPREBB; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.67, mailfrom: pete@akeo.ie) Received: by mail-wr1-f67.google.com with SMTP id q10so7706493wrm.11 for ; Mon, 02 Dec 2019 03:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=agg6tzY0nPyj2I5nv3rde6+aMlO5tkQnWG7EN5c1isg=; b=U8ZPREBBnr0/SOW0StUBgAvbgQfMZzmD3O/OxPBghFcrNmtJvGurdR3OiKYcYMSJxM h/g0PR0m4F+cUpmdFvmzKxlJY0R8uf0JKOZwVBWNJOeT49f6oPBCOl9bzEKFkxMM7YMY HFc0ZYaskt92IiRoLjJ6RPaAQ0vciqdv1TFNuiukzpEKNgDmcM3OUcQ0mOHQ03yurzQ6 RvdXAyeUoyLk1TQ/XUroj+DuQW9E4FcYkdJFt96SEus+qphHY0Tw3cEFXjHp0ZXY5xuS bmvAYk6DB1Ikr0/nBwxnAjoahiUFky+prW9jQO6X4FlFjKkqQNAO1TS6V/5YOSID9uo/ We7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=agg6tzY0nPyj2I5nv3rde6+aMlO5tkQnWG7EN5c1isg=; b=Hu7yznKgeACZM0NweVafD1RJvpSyy9/qqr+yGQMgm39Saw96pqE3/QOzK6LdAqKkJd LjmqZCtDbPXBg195wzlO4DuzfUiuL7TXSXuwTYwbiS9DoFVx4drWYPUbcWvUwlKxG7AX x3DSc66CMbodsE9RD9n254FF+4AWeCLh+/MoxVO0M3GdJ6+4LFOF7sapgmttmWDiMY8Q 3cfujQ/Djdl7jG0hElJMsFIrFGeUCK3fGL56tlisxo1bE3aBS4MrvmT6Y+gbmnhyrHt0 whYUaLrkk/npaMp6f0PRh7PRN43tgf1djE9LBZGLKCNj1bi5rR3LqPywADrt7slPGP29 y8bg== X-Gm-Message-State: APjAAAXJ5kLiA83i9E7x5CGsnNNjLdsFL10Ee1QuFtiLW2bQoitZn/8y CHnhYcSfK8oxkmg5cn5/Tmv0ANdCNBw= X-Google-Smtp-Source: APXvYqx15XswcQ7oLKw8N2+bi376dmxVbqT4nQePK5qR77kV7kTw2DIOf72zcLXbjWkxYqRkubqCqQ== X-Received: by 2002:adf:b193:: with SMTP id q19mr21173111wra.78.1575287723684; Mon, 02 Dec 2019 03:55:23 -0800 (PST) Return-Path: Received: from localhost.localdomain ([84.203.45.230]) by smtp.gmail.com with ESMTPSA id p10sm8500291wmi.15.2019.12.02.03.55.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Dec 2019 03:55:22 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, philmd@redhat.com Subject: [edk2-platforms][PATCH 2/3] Silicon/Broadcom/Bcm283x: Move Bcm2835 RNG defines to their own header Date: Mon, 2 Dec 2019 11:55:05 +0000 Message-Id: <20191202115506.4068-3-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20191202115506.4068-1-pete@akeo.ie> References: <20191202115506.4068-1-pete@akeo.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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__ */ -- 2.21.0.windows.1