From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-yx0-f177.google.com ([209.85.213.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SZJAU-0001NA-4h for barebox@lists.infradead.org; Tue, 29 May 2012 09:56:47 +0000 Received: by yenr9 with SMTP id r9so2126487yen.36 for ; Tue, 29 May 2012 02:56:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20120529092958.GP30400@pengutronix.de> References: <20120522184240.GM30400@pengutronix.de> <20120523134733.6164c4fb@eb-e6520> <20120524145837.42085b83@eb-e6520> <20120524153119.6d724afc@eb-e6520> <20120525120858.77dd6e7a@eb-e6520> <20120529092958.GP30400@pengutronix.de> From: Roberto Nibali Date: Tue, 29 May 2012 11:56:24 +0200 Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3512053337003411697==" Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: Booting mx25 based device from SD and NOR To: Sascha Hauer Cc: barebox@lists.infradead.org --===============3512053337003411697== Content-Type: multipart/alternative; boundary=bcaec539650c2bc09c04c129da15 --bcaec539650c2bc09c04c129da15 Content-Type: text/plain; charset=ISO-8859-1 Hi Sascha > > 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? > Yep, the corresponing dcdheader.S entries: DCDGEN( 1, 4, 0xB8002000, 0x0000D003) /* CS0_CSCRU */ DCDGEN( 2, 4, 0xB8002004, 0x00330d01) /* CS0_CSCRL */ DCDGEN( 3, 4, 0xB8002008, 0x00220800) /* CS0_CSCRA */ So I reckon at least I got this part working fine. > /* Set up 16bit NOR flash on WEIM CS0 */ > > writel(0xB8002000, 0x0000D003); > > writel(0xB8002004, 0x00330D01); > > writel(0xB8002008, 0x00220800); > > You mixed up the argument order. > > Yikes!!!! I hope I didn't fry something. I'll quickly try the reversed order and report back. > > > > 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. > > Make perfect sense (*slapping forehead*). Thank you for your patience. I reckon those questions of mine could be compiled into some sort of FAQ for the newcomers into the barebox world to flatten the learning curve. Cheers Roberto --bcaec539650c2bc09c04c129da15 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Sascha

=
> > 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 ha= ve
> working support for NOR on boot. The values are:
>
> =A0 =A0 =A0 =A0 { .ptr_type =3D 4, .addr =3D 0xB8002000, .val =3D 0x00= 00D003, },
> =A0 =A0 =A0 =A0 { .ptr_type =3D 4, .addr =3D 0xB8002004, .val =3D 0x00= 330D01, },
> =A0 =A0 =A0 =A0 { .ptr_type =3D 4, .addr =3D 0xB8002008, .val =3D 0x00= 220800, },

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

Yep, the corresponing dcdheader= .S entries:

DCDGEN( 1, 4, 0xB8002000, 0x0000D= 003) /* CS0_CSCRU */
DCDGEN( 2, 4, 0xB8002004, 0x00330d01) /* CS0= _CSCRL */
DCDGEN( 3, 4, 0xB8002008, 0x00220800) /* CS0_CSCRA */
=
So I reckon at least I got this part working fine.

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

You mixed up the argument order.

Yikes!!!! I hope I didn't= fry something. I'll quickly try the reversed order and report back.
=A0
>
> 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.

M= ake perfect sense (*slapping forehead*). Thank you for your patience. I rec= kon those questions of mine could be compiled into some sort of FAQ for the= newcomers into the barebox world to flatten the learning curve.

Cheers
Roberto


<= /div>
--bcaec539650c2bc09c04c129da15-- --===============3512053337003411697== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============3512053337003411697==--