[Skiboot] [PATCH 3/8] nx: Migrate P9 RNG BAR assignment to phys_map_get()

Michael Neuling mikey at neuling.org
Tue May 2 13:23:08 AEST 2017


Keeps existing address.  No functional change.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 hw/nx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/nx.c b/hw/nx.c
index 921273c733..d962b01a75 100644
--- a/hw/nx.c
+++ b/hw/nx.c
@@ -23,9 +23,7 @@
 #include <nx.h>
 #include <chip.h>
 #include <xscom-p9-regs.h>
-
-#define MMIO_CALC(__c, __b) \
-	(MMIO_CHIP_STRIDE * (__c) | __b)
+#include <phys-map.h>
 
 extern void nx_p9_rng_init(void);
 
@@ -52,7 +50,7 @@ void nx_p9_rng_init(void)
 	 */
 	for_each_chip(chip) {
 		/* 1) NX RNG BAR */
-		bar = MMIO_CALC(chip->id, P9X_NX_MMIO_OFFSET);
+		phys_map_get(chip, NX_RNG, 0, &bar, NULL);
 		xscom_write(chip->id, P9X_NX_MMIO_BAR,
 			    bar | P9X_NX_MMIO_BAR_EN);
 		/* Read config register for pace info */
-- 
2.11.0



More information about the Skiboot mailing list