mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Roberto Nibali <rnibali@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: Booting mx25 based device from SD and NOR
Date: Tue, 29 May 2012 11:29:58 +0200	[thread overview]
Message-ID: <20120529092958.GP30400@pengutronix.de> (raw)
In-Reply-To: <CAONxwYPWmxz1uraADOW2mV6x-qzjSLpZ=3BuFx3AaVKdvxTOrQ@mail.gmail.com>

On Tue, May 29, 2012 at 11:06:00AM +0200, Roberto Nibali wrote:
> Hi Eric
> 
> > >
> > http://git.pengutronix.de/?p=barebox.git;a=blob;f=arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c;h=63e87c9551c440edab572f5252a503ba4d533161;hb=c48de4beee21c3a5573cec084123c33ae08f6f7a
> > > >
> > > >
> > > Now that piece certainly was missing, but how the heck did you find out
> > > those register values? Where did you get the information about writing to
> > > chip select 0 and selecting:
> > >
> > > CSCR0U: 0x00008F03
> > > CSCR0L: 0xA0330D01
> > > CSCR0A: 0x002208C0
> > >
> > you need the reference manual of the i.MX25 to know the meaning of
> > these registers and the datasheet of your flash to know it's timings
> > then you can calculate the value to put in the registers.
> >
> >
> I have found them in an old uboot tree a previous person patched to have
> working support for NOR on boot. The values are:
> 
>         { .ptr_type = 4, .addr = 0xB8002000, .val = 0x0000D003, },
>         { .ptr_type = 4, .addr = 0xB8002004, .val = 0x00330D01, },
>         { .ptr_type = 4, .addr = 0xB8002008, .val = 0x00220800, },

Do these values match the ones you read out of the registers using your
U-Boot?

> 
> /* Set up 16bit NOR flash on WEIM CS0 */
> writel(0xB8002000, 0x0000D003);
>  writel(0xB8002004, 0x00330D01);
> writel(0xB8002008, 0x00220800);

You mixed up the argument order.

> 
> board_init_lowlevel_return();
> }
> 
> Why can't I printf() from low_level?

Because the console hasn't been setup yet. That's exactly the reason why
I recommend doing only the absolutely necessary stuff in lowlevel_init.

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

  reply	other threads:[~2012-05-29  9:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 12:11 Roberto Nibali
2012-05-22 18:42 ` Sascha Hauer
2012-05-23 10:43   ` Roberto Nibali
2012-05-23 11:47     ` Eric Bénard
2012-05-24 12:49       ` Roberto Nibali
2012-05-24 12:58         ` Eric Bénard
2012-05-24 13:18           ` Roberto Nibali
2012-05-24 13:31             ` Eric Bénard
2012-05-25  9:04               ` Roberto Nibali
2012-05-25 10:08                 ` Eric Bénard
2012-05-29  9:06                   ` Roberto Nibali
2012-05-29  9:29                     ` Sascha Hauer [this message]
2012-05-29  9:56                       ` Roberto Nibali
2012-05-29 10:14                         ` Roberto Nibali
2012-05-30  5:47                           ` Sascha Hauer
2012-05-30  6:39                             ` Juergen Beisert
2012-05-31 13:12                             ` Roberto Nibali
2012-05-31 17:06                               ` Sascha Hauer
2012-06-01 10:25                                 ` Roberto Nibali
2012-06-05  7:09                                   ` Sascha Hauer
2012-05-24 17:17             ` Sascha Hauer
2012-05-25  9:19               ` Roberto Nibali
2012-05-25 10:01                 ` Sascha Hauer
2012-05-29  9:26                   ` Roberto Nibali

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=20120529092958.GP30400@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=rnibali@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