From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wang Jian Date: Tue, 03 Jan 2006 21:16:03 +0800 Subject: [U-Boot-Users] Suggestion on flash init In-Reply-To: <20051226094054.F3FC.LARK@linux.net.cn> References: <20051225163450.08533353ACD@atlas.denx.de> <20051226094054.F3FC.LARK@linux.net.cn> Message-ID: <20060103205317.0711.LARK@linux.net.cn> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 wrote: > Hi Wolfgang Denk, > > > On Sun, 25 Dec 2005 17:34:49 +0100, Wolfgang Denk wrote: > > > In message <20051225190658.F3F9.LARK@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