[U-Boot-Users] flash.c for various boards

Wolfgang Denk wd at denx.de
Thu Jun 24 10:09:06 CEST 2004


In message <20040624024122.9097A21AFF9 at ws5-6.us4.outblaze.com> you wrote:
> 
> There is a flash.c in every board directory in the sourcetree.But some are almost the same.

Yes.

> I think we should not do it with this style. But I feel the RTC is a clear style. We should write the different flash.c for various flash chips but not for various boards. 
> Do you think so??

No, I don't.

> A clear source tree directory can make users understand the code quickly.

Yes.

There are two reasons for the code being as it is now:

(1) historical: the first implementation of PPCBoot  (or  maybe  even
    8xxrom as it was called by then) used a very simple flash driver,
    just to get things going. As usual, this layout survived.

(2) Code size: In general, the flash drivers in the board directories
    allow  for  optimized  code  that  supports  exactly  the   flash
    configurations  that  may  be  present  on  a specific board, and
    nothing else.

There is a generic CFI flash driver (drivers/cfi_flash.c) if you want
to use it.

This has been discussed many times before.  Search  the  archive.  My
replay  has always been that I will be happy to accept patches to get
rid of all the board specific driver code if:
- the new code works on  all  existing  (or  at  least  the  actively
  maintained) boards in all existing configuration
- the new code does not increase the memory footprint

I am aware that these requirements are very hard to conform to.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
The speed of time is one second per second.




More information about the U-Boot mailing list