mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jose Luis Zabalza <jlz.3008@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: Configure RAM size on iMX53 board
Date: Fri, 4 Nov 2016 08:18:21 +0100	[thread overview]
Message-ID: <20161104071821.jqrhtfmgz3432527@pengutronix.de> (raw)
In-Reply-To: <CAKZffXFSfTJJiwj2ZOB7nT-DWZ7_AqyysZkavNM++c4LSp6tZg@mail.gmail.com>

Hi,

On Thu, Nov 03, 2016 at 09:30:03PM +0100, Jose Luis Zabalza wrote:
> Hello everybody
> 
> I have two iMX53 custom boards. They are the same board but 512MB vs
> 1GB RAM version.  Both boards are working with the same Uboot binary
> but I would like use Barebox.
> 
> I have to be able to run Barebox on 1GB version but the same Barebox
> binary don't work on 512MB version.
> 
> I use imx-usb-loader to put Barebox on the board. On 1GB version
> Barebox are working OK and load Linux kernel successfully. On 512MB
> Barebox are loaded successfully but don't work. lsusb tell me the
> board is working on Serial Download mode yet. No message is printed on
> the console.
> 
> Do I have to set Barebox for work with different RAM size?

Just like Andrey already said, barebox detects the RAM size by reading
back the values from the SDRAM controller to determine its memory
layout, so the configured values must be correct. In your case they can
only be correct for the 1GB version.

What you can do in this case is:

- in your boards lowlevel.c detect your actual RAM size by testing for
  mirrors in the SDRAM Address space.
- Instead of imx53_barebox_entry() call barebox_arm_entry() with the
  actual RAM size.

This should already bring you through the lowlevel setup succesfully.

Then in your board file add this:

#include <mach/esdctl.h>

static int myboard_init(void)
{
	imx_esdctl_disable();

	arm_add_mem_device("ram0", MX53_CSD0_BASE_ADDR, size);

	return 0;
}
core_initcall(myboard_init);

Note you can't use a variable to safe the calculated SDRAM size from
lowlevel.c to your board file. It's probably best to do the same test
again.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  parent reply	other threads:[~2016-11-04  7:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 20:30 Jose Luis Zabalza
2016-11-03 22:42 ` Andrey Smirnov
2016-11-04  7:18 ` Sascha Hauer [this message]
2016-11-05  6:39   ` Jose Luis Zabalza
2016-11-07  7:43     ` Sascha Hauer
2016-11-08  5:09       ` Jose Luis Zabalza
2016-11-08  7:53         ` Sascha Hauer
2016-11-08 20:51           ` Jose Luis Zabalza
2016-11-08 21:24             ` Sascha Hauer
2016-11-09  4:23               ` Jose Luis Zabalza
2016-11-09  6:41                 ` Sascha Hauer

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=20161104071821.jqrhtfmgz3432527@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jlz.3008@gmail.com \
    /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