[U-Boot-Users] Re: Suggestion on flash init

Bastos Fernandez Alexandre ALEBAS at televes.com
Wed Jan 4 09:01:27 CET 2006


Iark,

Just for reference, some time ago I posted two patches which may be useful
for you in this case. Those weren't accepted yet, but this worked for me.

First, x8 bit support for AMD.

http://sourceforge.net/mailarchive/message.php?msg_id=12799051
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/18621

I also posted another one which allows buffer writing on Spansion flashes

http://sourceforge.net/mailarchive/message.php?msg_id=12797909
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/18620

Patches are included on those messages.

Best regards,

Alex

>    5. Re: Suggestion on flash init (Wang Jian)
>    7. Re: Suggestion on flash init (Wolfgang Denk)
>    8. Re: Suggestion on flash init (Wang Jian)
>    9. Re: Suggestion on flash init (Wolfgang Denk)
> 
> Message: 5
> Date: Tue, 03 Jan 2006 21:16:03 +0800
> From: Wang Jian <lark at linux.net.cn>
> To: Wang Jian <lark at linux.net.cn>
> 
> Subject: Re: [U-Boot-Users] Suggestion on flash init 
> Cc: u-boot-users at lists.sourceforge.net
> 
> Hi Denk,
> 
> Me again.
> 
> In my situation, S29AL016M works in x8 mode, which has different command
> sequence from in x16 mode.
> 
> The following are from datasheet.
> 
> Providing
> vu_char *addr = (vu_char *) info->start[sect];
> 
> x16 mode sector erase
> addr[0x555] = 0xAA;
> addr[0x2AA] = 0x55;
> addr[0x555] = 0x80;
> addr[0x555] = 0xAA;
> addr[0x2AA] = 0x55;
> addr[0x000] = 0x30;
> udelay(50); // at least 50 us before polling for status
> 
> x16 mode program
> addr[0x555] = 0xAA;
> addr[0x2AA] = 0x55;
> addr[0x555] = 0xA0;
> addr[offset] = data;
> 
> x8 mode sector erase
> addr[0xAAA] = 0xAA;
> addr[0x555] = 0x55;
> addr[0xAAA] = 0x80;
> addr[0xAAA] = 0xAA;
> addr[0x555] = 0x55;
> addr[0x000] = 0x30;
> udelay(50); // at least 50 us before polling for status
> 
> x8 mode program
> addr[0xAAA] = 0xAA;
> addr[0x555] = 0x55;
> addr[0xAAA] = 0xA0;
> addr[offset] = data;
> 
> I have little knowledge about other flash chips, so it is not easy for
> me to write clean patch for cfi_flash.c, although I want to.
> 
> Regards
> 
> On Mon, 26 Dec 2005 09:49:10 +0800, Wang Jian <lark at linux.net.cn> wrote:
> 
> > Hi Wolfgang Denk,
> > 
> > 
> > On Sun, 25 Dec 2005 17:34:49 +0100, Wolfgang Denk <wd at denx.de> wrote:
> > 
> > > In message <20051225190658.F3F9.LARK at linux.net.cn> you wrote:
> > > > 
> > > > I have tested cfi_flash.c for a while. Unfortuanately, it fails for
> > > > Spansion S29AL016M. The chip can be recognized, chip information is
> all
> > > > correct, but the erase and write routines fail.
> > > 
> > > Then please (lets) fix the problem instead of inventing the wheel
> again.
> > 
> > After a bad sleep, I read the manual again. This time, I find the
> cfi_flash.c
> > DOES do as what manual says. I will set some debug information and find
> > what happend. Stay tune.
> > 
> 
> -- 
>   lark
> 
> 
> 
> --__--__--
> 
> Message: 7
> To: Wang Jian <lark at linux.net.cn>
> cc: u-boot-users at lists.sourceforge.net
> From: Wolfgang Denk <wd at denx.de>
> Subject: Re: [U-Boot-Users] Suggestion on flash init 
> Date: Tue, 03 Jan 2006 15:08:42 +0100
> 
> In message <20060103205317.0711.LARK at linux.net.cn> you wrote:
> >=20
> > In my situation, S29AL016M works in x8 mode, which has different comman=
> d
> > sequence from in x16 mode.
> 
> If you look closer it is not so different at all.
> 
> > x16 mode sector erase
> > addr[0x555] =3D 0xAA;
> > addr[0x2AA] =3D 0x55;
> > addr[0x555] =3D 0x80;
> > addr[0x555] =3D 0xAA;
> > addr[0x2AA] =3D 0x55;
> > addr[0x000] =3D 0x30;
> ...
> > x8 mode sector erase
> > addr[0xAAA] =3D 0xAA;
> > addr[0x555] =3D 0x55;
> > addr[0xAAA] =3D 0x80;
> > addr[0xAAA] =3D 0xAA;
> > addr[0x555] =3D 0x55;
> > addr[0x000] =3D 0x30;
> 
> 0x555 =3D 0xAAA >> 1
> 0x2AA =3D 0x555 >> 1
> 
> > I have little knowledge about other flash chips, so it is not easy for
> > me to write clean patch for cfi_flash.c, although I want to.
> 
> The code is actually the very same,  just  taking  into  account  the
> different addressing mode.
> 
> Best regards,
> 
> Wolfgang Denk
> 
> --=20
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> Another Armenia, Belgium ... the weak innocents who always seem to be
> located on a natural invasion route.
> 	-- Kirk, "Errand of Mercy", stardate 3198.4
> 
> 
> --__--__--
> 
> Message: 8
> Date: Tue, 03 Jan 2006 23:34:51 +0800
> From: Wang Jian <lark at linux.net.cn>
> To: Wolfgang Denk <wd at denx.de>
> Subject: Re: [U-Boot-Users] Suggestion on flash init 
> Cc: u-boot-users at lists.sourceforge.net
> 
> Hi Wolfgang Denk,
> 
> 
> On Tue, 03 Jan 2006 15:08:42 +0100, Wolfgang Denk <wd at denx.de> wrote:
> 
> > In message <20060103205317.0711.LARK at linux.net.cn> you wrote:
> > > 
> > > In my situation, S29AL016M works in x8 mode, which has different
> command
> > > sequence from in x16 mode.
> > 
> > If you look closer it is not so different at all.
> > 
> > > x16 mode sector erase
> > > addr[0x555] = 0xAA;
> > > addr[0x2AA] = 0x55;
> > > addr[0x555] = 0x80;
> > > addr[0x555] = 0xAA;
> > > addr[0x2AA] = 0x55;
> > > addr[0x000] = 0x30;
> > ...
> > > x8 mode sector erase
> > > addr[0xAAA] = 0xAA;
> > > addr[0x555] = 0x55;
> > > addr[0xAAA] = 0x80;
> > > addr[0xAAA] = 0xAA;
> > > addr[0x555] = 0x55;
> > > addr[0x000] = 0x30;
> > 
> > 0x555 = 0xAAA >> 1
> > 0x2AA = 0x555 >> 1
> > 
> > > I have little knowledge about other flash chips, so it is not easy for
> > > me to write clean patch for cfi_flash.c, although I want to.
> > 
> > The code is actually the very same,  just  taking  into  account  the
> > different addressing mode.
> > 
> 
> I am not sure if other kind of AMD flash chips use such x8/x16 command
> sequence. I am afraid that I will fix one thing and break other things.
> 
> 
> -- 
>   lark
> 
> 
> 
> --__--__--
> 
> Message: 9
> To: Wang Jian <lark at linux.net.cn>
> cc: u-boot-users at lists.sourceforge.net
> From: Wolfgang Denk <wd at denx.de>
> Subject: Re: [U-Boot-Users] Suggestion on flash init 
> Date: Tue, 03 Jan 2006 16:44:04 +0100
> 
> In message <20060103232431.EB1F.LARK at linux.net.cn> you wrote:
> >=20
> > I am not sure if other kind of AMD flash chips use such x8/x16 command
> > sequence. I am afraid that I will fix one thing and break other things.
> 
> They all do. At least all I can remember.
> 
> Best regards,
> 
> Wolfgang Denk
> 
> --=20
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> Peace was the way.
> 	-- Kirk, "The City on the Edge of Forever", stardate unknown
> 
> 
> 




More information about the U-Boot mailing list