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] mvebu: rn2120: Make available all RAM
Date: Wed, 15 Feb 2017 12:18:05 +0100	[thread overview]
Message-ID: <20170215111805.31261-1-u.kleine-koenig@pengutronix.de> (raw)

binary.0 sets up all RAM but the address decoding isnt' adapted accordingly
which makes barebox assume that there are only 512 MiB of RAM on a single
bank instead of two banks with 1 GiB each.

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

diff --git a/arch/arm/boards/netgear-rn2120/lowlevel.c b/arch/arm/boards/netgear-rn2120/lowlevel.c
index 6026166e3201..5cde2b657bd5 100644
--- a/arch/arm/boards/netgear-rn2120/lowlevel.c
+++ b/arch/arm/boards/netgear-rn2120/lowlevel.c
@@ -34,6 +34,21 @@ ENTRY_FUNCTION(start_netgear_rn2120, r0, r1, r2)
 	writel((1 << 10) | readl((void *)0xd0018140), (void *)0xd0018140);
 	writel(~(1 << 10) & readl((void *)0xd0018144), (void *)0xd0018144);
 
+	/*
+	 * The vendor binary that initializes RAM doesn't program the SDRAM
+	 * Address Decoding registers to match the actual available RAM. But as
+	 * barebox later determines the RAM size from these, fix them up here.
+	 */
+
+	/* Win 1 Base Address Register: base=0x40000000 */
+	writel(0x40000000, (void *)0xd0020188);
+	/* Win 1 Control Register: size=0x4000000, wincs=1, en=1*/
+	writel(0x3fffffe5, (void *)0xd002018c);
+
+	/* Win 0 Base Address Register is already 0, base=0x00000000 */
+	/* Win 0 Control Register: size=0x4000000, wincs=0, en=1 */
+	writel(0x3fffffe1, (void *)0xd0020184);
+
 	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

                 reply	other threads:[~2017-02-15 11:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20170215111805.31261-1-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