[U-Boot] Reg. CFI flash_init and hardware write protected devices

Wolfgang Denk
2011-06-24T20:26:08Z

Dear Frank,

In message <BANLkTindk4f2An2VqhSftPcGuvsEqLY7wQ@mail.gmail.com> you wrote:
>
> > Difficult to speculate - I don't know your hardware (eventually you
> > have two 16 bit flash chips in parallel to build a 32 bit bus, and
> > have to double the chip's erase block size?), and I don;t know how you
> > created the JFFS2 file system.
...
> factory default version). 16 bits databus and each sector is 64k
> words, ie. 128k bytes. I created the jffs2 images using ELDKs
> mkfs.jffs2. Thanks for providing me this tool :)

You need to provide the correct parameters to mkfs.jffs2...

> No, not sure. I've got two reasons for staying with JFFS2. 1) We
> normally don't write to flash except when upgrading, so flash
> performance/duration isn't very critical 2) I discovered UBIFS after I

Hm... JFFS2 is probaly not a good choice anyway. On NOR, where you
don't have to deal with bad blocks, you might use ext2 or cramfs or
... - all of them are more efficient than JFFS2 then.

> had JFFS2 working and haven't seen the real need for it yet.

Mount time?

> Did you mean I should adapt the general CFI driver to support our
> configuration, or... Based on what you say below I'm not sure what you
> actually mean.

You have two different use cases that require (if we don't want to use
a proprietary driver) two different, mutually exclusive drivers. I
would load the driver I need as module, and unload it if I need the
other one. This is pretty simple in principle, but a bit ore of a
challange in your case as you use this as a root file system
(including to load the modules from).

> Me too. Small chances. So we have two options I guess: 1) Ditch
> hardware write protection and use CFI as it is supposed to be used, or
> 2) write a custom out-of-tree driver. What would you go for?

If this is an option: 1)

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Do not simplify the design of a program if a way can be found to make
it complex and wonderful.