* More protection register fun.
@ 2003-06-19 12:07 Ken Gordon
0 siblings, 0 replies; only message in thread
From: Ken Gordon @ 2003-06-19 12:07 UTC (permalink / raw)
To: linux-mtd
from cfi_intelext_read_prot_reg in cfi_cmdset_0001.c (in CVS)
int ofs_factor = cfi->interleave * cfi->device_type;
while (count && ((offst-base_offst) < reg_sz)) {
*buf =
map_read8(map,(chip->start+((extp->ProtRegAddr+1)*ofs_factor)+offst));
buf++;
offst++;
count--;
}
In my case (2x Intel Strataflash J3 on a PXA255, configured as 2x16 bit on a
32 bit bus):
interleave = 2
device_type = 2
so ofs_factor = 4
Now ProtRegAddr is 0x100 and appears to be a byte address within the
device. Now I don't claim any understanding of what device_type means and I
can only test this on hardware I have so can someone who fully uderstands
this code say whether it ought to be more like:
while (count && ((offst-base_offst) < reg_sz)) {
*buf =
map_read8(map,(chip->start+((extp->ProtRegAddr+2)*cfi->interleave)+offst));
// also +2 not +1 'cos the lock register is 16 bits
buf++;
offst++;
count--;
}
Actually this doen't really work either 'cos it gets the same bytes for each
of the two chips.
Any ideas (I'm about to hack my one for my hardware and stop spending time
on this)
Ken
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-06-19 12:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-19 12:07 More protection register fun Ken Gordon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox