[U-Boot-Users] .../board/fads/flash.c confuses me - give me a hint

Wolfgang Denk
2005-01-12T22:29:48Z

In message <41E590B4.6080700@orkun.us> you wrote:
>
> I'll jump in. Initially, each board had its own flash.c. cfi_flash.c
> came later and some board maintainers switched to it and others did not
> update their implementation for some reason. If your board can be

One of the reasons is code size and efficiency. For example:

-> MAKEALL OXC
Configuring for OXC board...
text data bss dec hex filename
126100 8040 35988 170128 29890 u-boot
-> ppc_8xx-size board/oxc/flash.o
text data bss dec hex filename
2256 84 0 2340 924 board/oxc/flash.o
-> MAKEALL uc100
Configuring for uc100 board...
text data bss dec hex filename
164164 10260 218452 392876 5feac u-boot
-> ppc_8xx-size drivers/cfi_flash.o
text data bss dec hex filename
6040 116 0 6156 180c drivers/cfi_flash.o

As you can see, the CFI flash driver is nearly 3 times as big as a
customized flash driver.

In some cases there is ample space and this doesn't matter, in other
cases things are different.

> supported by cfi_flash.c and works well, it is probably not a good idea
> to develop a custom flash driver.

I disagree if you give this as general advice. You have to know the
requirements of the project, and understand what you're doing. Only
then you can give intelligent advice.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The project was large enough and management communication poor enough
to prompt many members of the team to see themselves as contestants
making brownie points, rather than as builders making programming
products. Each suboptimized his piece to meet his targets; few
stopped to think about the total effect on the customer.
- Fred Brooks, "The Mythical Man Month"