Intel protection register read

Clive Davies cdavies at
Thu Nov 8 09:41:04 EST 2001

> > +	unsigned char *ProtRegData;  /* Protection register 
> data bytes */
> > 	struct flchip chips[0];  /* per-chip data structure for 
> each chip */
> The ProtRegData are per-chip, but you've only left space for 
> one pointer. 
> What happens when people have arrays of multiple chips 
> side-by-side and/or
> consecutively mapped?

Hmm, this is a problem. Am I correct in thinking that the code only reads
the cfi tables from the first device and assumes that any additional devices
are of the same type? (That's what it looks like to me) If so there is no
way to read the protection register data from subsequent devices. 

I reckon the best way to handle the multiple/interleaved chip configuration
would be to concatenate all the protection registers together into one
block. All the other interfaces I can think of would require a chip number
to be passed in, which doesn't seem that nice to me. Does that sound

> Also, isn't it possible to _write_ to the user areas of the chips?

Yes it is, but I haven't implemented that because I don't need it. If adding
writes is a condition for getting read functionality into cvs then I can do
that too.

> do you need 
> to check the version number?
Yes, I'd assumed that the data in the table would default to zero for
earlier versions but I'm not so sure now. I'll fix that.


More information about the linux-mtd mailing list