[U-Boot-Users] Start of new ARM920T target

Marc Singer elf at buici.com
Tue Jul 8 04:43:22 CEST 2003


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 


More information about the U-Boot mailing list