2010-04-21

Slitaz -- arm / uboot

1.Env:
gcc version 4.4.1 (Sourcery G++ 4.4-170)
bootloader.tgz / u-boot-1.1.6 (mini2440)
2.tar xzvf bootloader.tgz
cd bootloader/u-boot-1.1.6/
3.add include/configs/100ask24x0.h
4.vi u-boot-1.1.6/Makefile
5.make distclean
6.make open24x0_config
7.make

----
3.add include/configs/100ask24x0.h

#if0
#define CONFIG_DRIVER_CS8900 1
#define CS8900_BASE 0x19000300
#define CS8900_BUS16 1
#endif
#if!defined(CONFIF_DRIVER_CS8900)
#define CONFIG_DRIVER_DM9000 1
#define CONFIG_DM9000_USE_16BIT 1
#define CONFIG_DM9000_BASE 0x20000000
#define DM9000_IO 0x20000000
#define DM_9000_DATA 0x20000004
#endif

4.vi u-boot-1.1.6/Makefile

line #218 del -lc
crosstool:gcc version 4.4.1 (Sourcery G++ 4.4-170)

root@slitaz:/mnt/data/arm9/mini2440/bootloader/u-boot-1.1.6/# diff -U0 Makefile-orig Makefile
--- Makefile-orig Wed Apr 1 10:51:24 2009
+++ Makefile Wed Apr 21 14:04:42 2010
@@ -218 +218 @@
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc -lc -L/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/armv4t/usr/lib
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc -L/opt/sourcery/lib/gcc/arm-none-eabi/4.4.1/thumb

5. make distclean <== clean all && create .depend
6. make open24x0_config
Configuring for open24x0 board...

7. make
[..]
--start-group lib_generic/libgeneric.a board/open24x0/libopen24x0.a cpu/arm920t/libarm920t.a cpu/arm920t/s3c24x0/libs3c24x0.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/usb/libusb.a drivers/sk98lin/libsk98lin.a common/libcommon.a --end-group -L /opt/sourcery/bin/../lib/gcc/arm-none-eabi/4.4.1/thumb -lgcc -L/opt/sourcery/lib/gcc/arm-none-eabi/4.4.1/thumb \
-Map u-boot.map -o u-boot
arm-linux-objcopy --gap-fill=0xff -O srec u-boot u-boot.srec
arm-linux-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
root@slitaz:/mnt/data/arm9/mini2440/bootloader/u-boot-1.1.6/# ls -l u-boot*
-rwxrwxrwx 1 root root 648704 Apr 21 14:05 u-boot
-rwxrwxrwx 1 root root 172028 Apr 21 14:05 u-boot.bin
-rwxrwxrwx 1 root root 148234 Apr 21 14:05 u-boot.map
-rwxrwxrwx 1 root root 516202 Apr 21 14:05 u-boot.srec
root@slitaz:/mnt/data/arm9/mini2440/bootloader/u-boot-1.1.6/# file u-boot
u-boot: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
root@slitaz:/mnt/data/arm9/mini2440/bootloader/u-boot-1.1.6/# file u-boot.bin
u-boot.bin: data
root@slitaz:/mnt/data/arm9/mini2440/bootloader/u-boot-1.1.6/# file u-boot.map
u-boot.map: ASCII assembler program text
root@slitaz:/mnt/data/arm9/mini2440/bootloader/u-boot-1.1.6/# file u-boot.srec
u-boot.srec: Motorola S-Record; binary data in text format
root@slitaz:/mnt/data/arm9/mini2440/bootloader/u-boot-1.1.6/# arm-linux-gcc -v
Using built-in specs.
Target: arm-none-eabi
Configured with: /scratch/dan/eabi-stable-respin/src/gcc-4.4/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-eabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxx-multilibs --with-gnu-as --with-gnu-ld --with-specs='%{!fcommon:%{!fno-common:-fno-common}} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --disable-shared --disable-lto --with-newlib --with-pkgversion='Sourcery G++ 4.4-170' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-headers=yes --with-sysroot=/opt/codesourcery/arm-none-eabi --with-build-sysroot=/scratch/dan/eabi-stable-respin/install/arm-none-eabi --with-gmp=/scratch/dan/eabi-stable-respin/obj/host-libs-4.4-170-arm-none-eabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/dan/eabi-stable-respin/obj/host-libs-4.4-170-arm-none-eabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/dan/eabi-stable-respin/obj/host-libs-4.4-170-arm-none-eabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/dan/eabi-stable-respin/obj/host-libs-4.4-170-arm-none-eabi-i686-pc-linux-gnu/usr --disable-libgomp --with-license=/scratch/dan/eabi-stable-respin/obj/host-libs-4.4-170-arm-none-eabi-i686-pc-linux-gnu/usr --with-csl-license-version=20100330 --with-csl-license-feature=gcc_ARM_EABI --enable-poison-system-directories --with-debug-prefix-map='/scratch/dan/eabi-stable-respin/install=/opt/codesourcery /scratch/dan/eabi-stable-respin/src/gcc-4.4=/opt/codesourcery/arm-none-eabi/src/gcc /scratch/dan/eabi-stable-respin/obj/gcc-4.4-170-arm-none-eabi-i686-pc-linux-gnu=/opt/codesourcery/arm-none-eabi/src/generated/gcc' --with-build-time-tools=/scratch/dan/eabi-stable-respin/install/arm-none-eabi/bin --with-build-time-tools=/scratch/dan/eabi-stable-respin/install/arm-none-eabi/bin
Thread model: single
gcc version 4.4.1 (Sourcery G++ 4.4-170)


Ref:
1. mini2440用戶手冊-2010-2-4.pdf
p388 ch-8.3 U-Boot

2. u-boot的Makefile分析
[http://blog.mcuol.com/User/lvembededsys/Article/4355_1.htm]

3. 逐行分析u-boot http://blog.csdn.net/huafulan/archive/2009/05/11/4169248.aspx