From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Singer Date: Mon, 7 Jul 2003 19:43:22 -0700 Subject: [U-Boot-Users] Start of new ARM920T target Message-ID: <20030708024322.GA425@buici.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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