Problem writing to flash with writeb()

J B mad_flasher at
Tue Nov 12 14:02:27 EST 2002

>   	physmap_map.map_priv_1 = (unsigned 
>	...
>	//Read Manufacturer and Device code
>	physmap_write8(&physmap_map,0x90,physmap_map.map_priv_1);

Are you sure you want to pass physmap_map.map_priv_1 as the address?  That 
would imply that the address you are writing 0x90 to is (2 * 
physmap_map.map_priv_1) because physmap_writeX will add map->map_priv_1 to 
whatever address you pass it.  If that is bigger than WINDOW_SIZE, I don't 
think the command will actually reach the flash chip because the address 
isn't mapped to a flash chip.  I am assuming you are using a cfi compliant 
flash chip and 0x90 is putting it into "Read Identifier Codes".  Try using 0 
for the address instead, which is what you did below.

>If I do it like this:
>	p = physmap_map.map_priv_1;
>	p[0] = 0x90;

Looks like this is the equivalent of:

I could be very wrong however.  I still consider myself a newbie, so sorry 
if this doesn't make any sense.  Hope it helps though.


The new MSN 8: smart spam protection and 2 months FREE*

More information about the linux-mtd mailing list