[U-Boot-Users] FLASH AM29LV320DB on AdderII

hello all,
On the AdderII, I am facing some issue w.r.t Flash. I am able to erase sectors but not correctly able to program. The reason I understand so far is because I am trying to write ulong data, while it is writing only a word. Code sample
**************************************************** static int write_word (flash_info_t *info, ulong dest, ulong data) { vu_short *addr = (vu_short *)(info->start[0]); ulong start; int flag;
/* Check if Flash is (sufficiently) erased */ if ((*((vu_long *)dest) & data ) != data ) { return (2); } /* Disable interrupts */ flag = disable_interrupts();
addr[0x0555] = 0xAAAA; addr[0x02AA] = 0x5555; addr[0x0555] = 0xA0A0;
*((vu_short *)dest) = data;
/* re-enable interrupts if necessary */ if (flag) enable_interrupts();
/* data polling for D7 */ start = get_timer (0);
while ((*((vu_short *)dest) & 0x8080) != (data & 0x8080)) { if (get_timer(start) > CFG_FLASH_WRITE_TOUT) { return (1); } }
return (0); }
******************************************************
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

In message 20030805131214.1304.qmail@web40410.mail.yahoo.com you wrote:
On the AdderII, I am facing some issue w.r.t Flash.
What's an AdderII? This is not one of the supported configurations of U-Boot. At least none that I know of.
I am able to erase sectors but not correctly able to program. The reason I understand so far is because I am trying to write ulong data, while it is writing only a word. Code sample
static int write_word (flash_info_t *info, ulong dest, ulong data)
Which source file is this?
Wolfgang Denk

What's an AdderII? This is not one of the supported configurations of U-Boot. At least none that I know of.
yeah, I am trying to port u-boot to this card. Its from analogue-micro ( MPC852T ) and you ( wolfgang ) helped me earlier for sdram and SMC1 issue for this.
Which source file is this?
I picked the flash.c from fads and modified few things.
I went through the code of walnut405 ( flash.c ) looks like it has some kind of fix for this. The ( unsigned short ) declarations. But I am able to detect the sectors correctly. ***************************************************** Bank # 1: AMD AM29LV320B (32 Mbit, bottom boot sect) Size: 4 MB in 70 Sectors Sector Start Addresses: FE000000 (RO) FE002000 (RO) FE004000 (RO) FE006000 (RO) FE008000 (RO) FE00A000 (RO) FE00C000 (RO) FE00E000 (RO) FE020000 FE030000 FE040000 FE050000 FE060000 FE070000 FE080000 FE090000 FE0A0000 FE0B0000 FE0C0000 FE0D0000 FE0E0000 FE0F0000 FE100000 FE110000 FE120000 FE130000 FE140000 FE150000 FE160000 FE170000 FE180000 FE190000 FE1A0000 FE1B0000 FE1C0000 FE1D0000 FE1E0000 FE1F0000 FE200000 FE210000 FE220000 FE230000 FE240000 FE250000 FE260000 FE270000 FE280000 FE290000 FE2A0000 FE2B0000 FE2C0000 FE2D0000 FE2E0000 FE2F0000 FE300000 FE310000 FE320000 FE330000 FE340000 FE350000 FE360000 FE370000 FE380000 FE390000 FE3A0000 FE3B0000 FE3C0000 FE3D0000 FE3E0000 FE3F0000
*****************************************************
regards Raghu.
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

In message 20030805134735.21564.qmail@web40409.mail.yahoo.com you wrote:
I picked the flash.c from fads and modified few things.
I went through the code of walnut405 ( flash.c ) looks like it has some kind of fix for this. The ( unsigned short ) declarations.
This is not a "fix". It is a different configuration for a different board.
You cannot simply pick any flash driver and hope it will work as is for you. You must adapt (port) the flash driver as required by the hardware on your board.
Note that it is generally a bad idea to use the FADS as an example configuration.
But I am able to detect the sectors correctly.
That means nothing.
Wolfgang Denk
participants (2)
-
Raghu
-
Wolfgang Denk