mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] mvebu: netgear-rn2120: make use of mvebu_get_initial_int_reg_base
Date: Sat, 25 Feb 2017 21:52:42 +0100	[thread overview]
Message-ID: <20170225205242.18106-5-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20170225205242.18106-1-u.kleine-koenig@pengutronix.de>

This is necessary to make second stage booting work when the register
window is already moved.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/boards/netgear-rn2120/lowlevel.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/netgear-rn2120/lowlevel.c b/arch/arm/boards/netgear-rn2120/lowlevel.c
index 5cde2b657bd5..59b9985ca9d8 100644
--- a/arch/arm/boards/netgear-rn2120/lowlevel.c
+++ b/arch/arm/boards/netgear-rn2120/lowlevel.c
@@ -16,12 +16,14 @@
 #include <asm/barebox-arm-head.h>
 #include <asm/io.h>
 #include <mach/lowlevel.h>
+#include <mach/common.h>
 
 extern char __dtb_armada_xp_rn2120_bb_start[];
 
 ENTRY_FUNCTION(start_netgear_rn2120, r0, r1, r2)
 {
 	void *fdt;
+	void __iomem *base = mvebu_get_initial_int_reg_base();
 
 	arm_cpu_lowlevel_init();
 
@@ -31,8 +33,8 @@ ENTRY_FUNCTION(start_netgear_rn2120, r0, r1, r2)
 	 * SoC reset.
 	 * This is effectively gpio_direction_output(42, 1);
 	 */
-	writel((1 << 10) | readl((void *)0xd0018140), (void *)0xd0018140);
-	writel(~(1 << 10) & readl((void *)0xd0018144), (void *)0xd0018144);
+	writel((1 << 10) | readl(base + 0x18140), base + 0x18140);
+	writel(~(1 << 10) & readl(base + 0x18144), base + 0x18144);
 
 	/*
 	 * The vendor binary that initializes RAM doesn't program the SDRAM
@@ -41,13 +43,13 @@ ENTRY_FUNCTION(start_netgear_rn2120, r0, r1, r2)
 	 */
 
 	/* Win 1 Base Address Register: base=0x40000000 */
-	writel(0x40000000, (void *)0xd0020188);
+	writel(0x40000000, base + 0x20188);
 	/* Win 1 Control Register: size=0x4000000, wincs=1, en=1*/
-	writel(0x3fffffe5, (void *)0xd002018c);
+	writel(0x3fffffe5, base + 0x2018c);
 
 	/* Win 0 Base Address Register is already 0, base=0x00000000 */
 	/* Win 0 Control Register: size=0x4000000, wincs=0, en=1 */
-	writel(0x3fffffe1, (void *)0xd0020184);
+	writel(0x3fffffe1, base + 0x20184);
 
 	fdt = __dtb_armada_xp_rn2120_bb_start -
 		get_runtime_offset();
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-02-25 20:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 20:52 [PATCH 0/4] mvebu: Make 2nd-stage booting possible Uwe Kleine-König
2017-02-25 20:52 ` [PATCH 1/4] mvebu: get initial position of register window from image header Uwe Kleine-König
2017-02-25 20:52 ` [PATCH 2/4] filetype: Add image type for boot images used on Armada 370 and XP Uwe Kleine-König
2017-02-25 20:52 ` [PATCH 3/4] kwbimage_v1: add support to boot a mvebu image Uwe Kleine-König
2017-02-25 20:52 ` Uwe Kleine-König [this message]
2017-02-28  6:59 ` [PATCH 0/4] mvebu: Make 2nd-stage booting possible Sascha Hauer
2017-02-28 16:06   ` Uwe Kleine-König

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-all 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=20170225205242.18106-5-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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