From: "Pete Batard" <pete@akeo.ie>
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 [thread overview]
Message-ID: <20191202115506.4068-3-pete@akeo.ie> (raw)
In-Reply-To: <20191202115506.4068-1-pete@akeo.ie>
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 <pete@akeo.ie>
---
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 <Library/IoLib.h>
#include <Library/UefiBootServicesTableLib.h>
-#include <IndustryStandard/Bcm2836.h>
+#include <IndustryStandard/Bcm2835Rng.h>
#include <Protocol/Rng.h>
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 <pete@akeo.ie>.
+ *
+ * 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
next prev parent reply other threads:[~2019-12-02 11:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-02 11:55 [edk2-platforms][PATCH 0/3] Silicon/Broadcom/Bcm283x: RNG improvements Pete Batard
2019-12-02 11:55 ` [edk2-platforms][PATCH 1/3] Silicon/Broadcom/Bcm283x: Rename Bcm2835 RNG driver Pete Batard
2019-12-02 12:16 ` Philippe Mathieu-Daudé
2019-12-02 11:55 ` Pete Batard [this message]
2019-12-02 12:17 ` [edk2-platforms][PATCH 2/3] Silicon/Broadcom/Bcm283x: Move Bcm2835 RNG defines to their own header Philippe Mathieu-Daudé
2019-12-02 11:55 ` [edk2-platforms][PATCH 3/3] Silicon/Broadcom/Bcm283x: Add Bcm2838 RNG driver Pete Batard
2019-12-02 16:03 ` [edk2-platforms][PATCH 0/3] Silicon/Broadcom/Bcm283x: RNG improvements Ard Biesheuvel
2019-12-02 16:53 ` [edk2-devel] " Pete Batard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191202115506.4068-3-pete@akeo.ie \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox