public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Start of new ARM920T target
@ 2003-07-08  2:43 Marc Singer
  2003-07-17 23:34 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Singer @ 2003-07-08  2:43 UTC (permalink / raw)
  To: u-boot

I'm sending an initial patch for the KEV7A400 dev board in order to
get some feedback about the configuration extension I'm proposing.
This is *not* complete.  It ought not break any of the non-ARM9 builds
though it may break one of the ARM9 ones.  

How it works:

  1) The top-level script, ./mkconfigx, takes the configured
     include/config.h file and compiles a list of defines roughly of
     the (regex) form CONFIG_.*
  2) These are transformed into CONFIG_.*=y
  3) The written to ./configx.mk in a form that can be included
     in Makefiles.
  4) The cpu/arm920t/Makefile includes this file.  I believe this
     could be included in the ./config.mk file so that everyone
     benefits.
  5) The cpu/arm920t/Makefile has been turned up-side down to make it
     more amenable to this form of configuration.  The present form
     isn't as elegant as it should, and will, be.  It's there to make
     the point of 'how' it might look.  Notice that source files are
     declared instead of object files. 
  6) The board/kev7a400/u-boot.lds has an important change.
     Previously, the name of the start.o object file was hard coded.
     Instead, start.S has been moved to a named section, .start, and
     the linker script reflects this.  The effect is the same as
     before, but the dependency is removed.

The serial_lh7a400.c file could be moved to share a home with other
serial drivers.  

With this sort of configuration methodology, the configuration file
selects the desired driver with something like this:

  #define CONFIG_SERIAL_LH7A400

or

  #define CONFIG_SERIAL_NS16550

Why do I prefer this?  Ifdefs tend to make code harder to read.  A few
are usually OK.  As the code grows, it is desirable to separate the
conditionally compiled code.  Likewise, whole file ifdefs are not very
clear.  One can see the #ifdef at the top, and may not know if it
matches the one at the bottom of a long source file.  With this
configuration method, needed files are explicitly built and linked
when the appropriate configuration option is present.

Cheers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot-2.diff.gz
Type: application/octet-stream
Size: 19845 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20030707/a48fdc85/attachment.obj 

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

end of thread, other threads:[~2003-07-26 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-08  2:43 [U-Boot-Users] Start of new ARM920T target Marc Singer
2003-07-17 23:34 ` Wolfgang Denk
2003-07-18  0:30   ` Marc Singer
2003-07-26 23:11     ` Wolfgang Denk

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