public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Support of stupid devices
@ 2004-08-16  0:39 Ian Molton
  2004-08-16 13:11 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Molton @ 2004-08-16  0:39 UTC (permalink / raw)
  To: linux-mtd

Hi.

Im porting linux to the toshiba e7xx and 8xx PDAs which contain a nand flash controller.

Im not certain, but it appears the controllerhas an odd quirk meaning byte-reads of the data register dont work as the linux mtd code expects.

AFAICT if I read a word (after issuing a chipid command) I get:

0xYYZZ75ec   -- this is good - Samsung, 32MB device.

if I do two byte reads I get 0xec 0xec.

a halfword access gets me 0xYYZZ.

a misaligned (by one byte) word access gives me 0xecYYZZ75, but this fails to work for byte accesses. halfword misaligned accesses are just weird.

so basically, the only way to read the chipid is to do:

a word access to the data reg and then shift the data out

or

a word access (and mask off the high 3 bytes followed by a misaligned word access and mask off the upper 3 bytes.

clearly the former solution is the better one, but this doesnt fit in the nand driver model very well (read_byte() et.al.)

the chip is a TC6393XB (system on chip) and the flash is a samsung K9F5608UOC YCBO

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Support of stupid devices
  2004-08-16  0:39 Support of stupid devices Ian Molton
@ 2004-08-16 13:11 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2004-08-16 13:11 UTC (permalink / raw)
  To: Ian Molton; +Cc: linux-mtd

On Mon, 2004-08-16 at 02:39, Ian Molton wrote:
> Hi.
> 
> Im porting linux to the toshiba e7xx and 8xx PDAs
> which contain a nand flash controller.
> Im not certain, but it appears the controllerhas an
> odd quirk meaning byte-reads of the data register
> dont work as the linux mtd code expects.
> 
> AFAICT if I read a word (after issuing a chipid command) I get:
> 
> 0xYYZZ75ec   -- this is good - Samsung, 32MB device.
> 
> if I do two byte reads I get 0xec 0xec.
> 
> a halfword access gets me 0xYYZZ.
> a misaligned (by one byte) word access gives me 0xecYYZZ75, 

Sounds really stupid :)

> but this fails to work for byte accesses. halfword misaligned
> accesses are just weird.
> so basically, the only way to read the chipid is to do:
> a word access to the data reg and then shift the data out
> or
> a word access (and mask off the high 3 bytes followed by a
> misaligned word access and mask off the upper 3 bytes.
> clearly the former solution is the better one, but this 
> doesnt fit in the nand driver model very well 
> (read_byte() et.al.)

You can provide your own read_byte() et. al. functions which do all the
magic. Look into the other Toshiba nand driver implementations. They do
the same. I don't have the header files which implement the real access
but Alice should be a source of help.

> the chip is a TC6393XB (system on chip) and the flash 
> is a samsung K9F5608UOC YCBO

tglx


> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-16 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-16  0:39 Support of stupid devices Ian Molton
2004-08-16 13:11 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox