[U-Boot] A Problem of u-boot on TI PandaBoard porting

Hi, I encounter some problems of u-boot porting on PandaBoard.
I’m working on modifying u-boot to verify the hardware devices working well. Although there’s already a board configuration for PandaBoard (omap4_panda), I would like to create another one for my own project. The u-boot version is “U-Boot 2011.12-00046”, and I just duplicated the item of omap4_panda of “boards.cfg” and renamed it to “panda_test”, and did the same things as some u-boot porting guides which can be found on the web. Finally, after compiling, I can get ‘u-boot’, ‘u-boot.bin’, ‘u-boot.img’, ‘u-boot.lds’, ‘u-boot.map’ and ‘u-boot.srec’ in the top directory, but no MLO. There were error message prompt as below:
*u-boot/spl/u-boot-spl.lds:1: syntax error make[1]: *** [/home/qian/Desktop/u-boot/spl/u-boot-spl] Error 1 make[1]: Leaving directory `/home/qian/Desktop/u-boot/spl' make: *** [spl/u-boot-spl.bin] Error 2*
I’ve check the file ‘spl/u-boot-spl.lds’, the first line is a comment as below: *// add PandaTest Configuration*
and the rest of the file are the same as defult PandaBoard build result.
But when I just build defult "omap4_panda_config", this comment would not appear.
I guess that’s the syntax error, the *arm-none-eabi-ld* generate the ‘u-boot-spl.lds’ with a comment at first line. But it doesn’t happened when I just build u-boot for default PandaBoard. Is there any step I missed? Please let me know.
Thank you very much!
Qiao

*u-boot/spl/u-boot-spl.lds:1: syntax error make[1]: *** [/home/qian/Desktop/u-boot/spl/u-boot-spl] Error 1 make[1]: Leaving directory `/home/qian/Desktop/u-boot/spl' make: *** [spl/u-boot-spl.bin] Error 2*
I’ve check the file ‘spl/u-boot-spl.lds’, the first line is a comment as below: *// add PandaTest Configuration*
Change that comment to a C style one like /* ..... */ and I think the problem will go away.

2012/1/6 John Rigby john.rigby@linaro.org
*u-boot/spl/u-boot-spl.lds:1: syntax error make[1]: *** [/home/qian/Desktop/u-boot/spl/u-boot-spl] Error 1 make[1]: Leaving directory `/home/qian/Desktop/u-boot/spl' make: *** [spl/u-boot-spl.bin] Error 2*
I’ve check the file ‘spl/u-boot-spl.lds’, the first line is a comment as below: *// add PandaTest Configuration*
Change that comment to a C style one like /* ..... */ and I think the problem will go away.
But it doesn't work...because the 'spl/u-boot-spl.lds' is automatically generated while building. Even if I modify this file, it will be replaced again when I rebuild.
However, thanks for your reply.

On 01/06/2012 12:21 AM, Qiao.HelloWorld@gmail.com wrote:
2012/1/6 John Rigbyjohn.rigby@linaro.org
*u-boot/spl/u-boot-spl.lds:1: syntax error make[1]: *** [/home/qian/Desktop/u-boot/spl/u-boot-spl] Error 1 make[1]: Leaving directory `/home/qian/Desktop/u-boot/spl' make: *** [spl/u-boot-spl.bin] Error 2*
I’ve check the file ‘spl/u-boot-spl.lds’, the first line is a comment as below: *// add PandaTest Configuration*
Change that comment to a C style one like /* ..... */ and I think the problem will go away.
But it doesn't work...because the 'spl/u-boot-spl.lds' is automatically generated while building. Even if I modify this file, it will be replaced again when I rebuild.
However, thanks for your reply.
Then dig through the build log to find where the file is generated from and modify that file...

On Fri, Jan 06, 2012 at 12:35:28AM -0500, Peter Barada wrote:
On 01/06/2012 12:21 AM, Qiao.HelloWorld@gmail.com wrote:
2012/1/6 John Rigbyjohn.rigby@linaro.org
*u-boot/spl/u-boot-spl.lds:1: syntax error make[1]: *** [/home/qian/Desktop/u-boot/spl/u-boot-spl] Error 1 make[1]: Leaving directory `/home/qian/Desktop/u-boot/spl' make: *** [spl/u-boot-spl.bin] Error 2*
I’ve check the file ‘spl/u-boot-spl.lds’, the first line is a comment as below: *// add PandaTest Configuration*
Change that comment to a C style one like /* ..... */ and I think the problem will go away.
But it doesn't work...because the 'spl/u-boot-spl.lds' is automatically generated while building. Even if I modify this file, it will be replaced again when I rebuild.
However, thanks for your reply.
Then dig through the build log to find where the file is generated from and modify that file...
I've run into a problem similar to this before. You probably have a C++ style comment inside your board configuration file. Change it to a C style comment instead, and the problem goes away.
Ira

Thanks for your reply, I modified the comment of include/configs/panda_test.h to C-style, and the problem solved!
However, I encountered another problem...I can build u-boot.img, u-boot.bin, u-boot.srec, but still NOT MLO
the error message is as below: ============================================================== /arm-2010q1/bin/arm-none-eabi-gcc -E -g -Os -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -ffunction-sections -fdata-sections -DCONFIG_SYS_TEXT_BASE=0x80E80000 -DCONFIG_SPL_TEXT_BASE=0x40304350 -DCONFIG_SPL_BUILD -I/home/qian/Desktop/SVN/OMAP4/u-boot_panda/include -fno-builtin -ffreest anding -nostdinc -isystem /arm-2010q1/bin/../lib/gcc/arm-none-eabi/4.4.1/include -pipe -DCONFIG_ARM -D__ARM__ -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -include /home/qian/Desktop/SVN/OMAP4/u-boot_panda/include/u-boot/u-boot.lds.h -include /home/qian/Desktop/SVN/OMAP4/u-boot_panda/include/config.h -ansi -D__ASSEMBLY__ -P - < /home/qian/Desktop/SVN/OMAP4/u-boot_panda/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
/home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/u-boot-spl.lds
UNDEF_SYM=`/arm-2010q1/bin/arm-none-eabi-objdump -x / home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/arch/arm/cpu/armv7/libarmv7.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/arch/arm/cpu/armv7/omap-common/libomap-common.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/arch/arm/cpu/armv7/omap4/libomap4.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/arch/arm/lib/libarm.o / home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/board/ti/panda/libpanda.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/common/libcommon.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/disk/libdisk.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/drivers/i2c/libi2c.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/drivers/mm c/libmmc.o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/drivers/power/libpower. o /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/drivers/serial/libserial.o /home /qian/Desktop/SVN/OMAP4/u-boot_panda/spl/fs/fat/libfat.o /home/qian/Desktop/SVN/ OMAP4/u-boot_panda/spl/lib/libgeneric.o | sed -n -e 's/.*(__u_boot_cmd_.*)/-u \1/p'|sort|uniq`; cd /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/ && /home/qia n/Desktop/Sourcery/arm-2010q1/bin/arm-none-eabi-ld -T /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/u-boot-spl.lds --gc-sections -Bstatic -Ttext 0x40304350 $UNDEF_SYM arch/arm/cpu/armv7/start.o --start-group arch/arm/cpu/armv7/libarmv7.o arch/arm/cpu/armv7/omap-common/libomap-common.o arch/arm/cpu/armv7/omap4/libomap4.o arch/arm/lib/libarm.o board/ti/panda/libpanda.o common/libcommon.o disk/libdisk.o drivers/i2c/libi2c.o drivers/mmc/libmmc.o drivers/power/libpower.o drivers/serial/libserial.o fs/fat/libfat.o lib/libgeneric.o --end-group /home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/arch/arm/lib/eabi_compat.o -L /home/qian/Desktop/Sourcery/arm-2010q1/bin/../lib/gcc/arm-none-eabi/4.4.1 -lgcc -Map u-boot-spl.map -o u-boot-spl common/libcommon.o: In function `do_gpioTest': /home/qian/Desktop/SVN/OMAP4/u-boot_panda/common/panda_test/cmd_gpioTest.c:108: undefined reference to `cmd_usage' common/libcommon.o: In function `pmic_dump': /home/qian/Desktop/SVN/OMAP4/u-boot_panda/common/panda_test/cmd_pmicTest.c:80: undefined reference to `twl6030_i2c_read_u8' common/libcommon.o: In function `do_pmic': /home/qian/Desktop/SVN/OMAP4/u-boot_panda/common/panda_test/cmd_pmicTest.c:123: undefined reference to `twl6030_i2c_read_u8' /home/qian/Desktop/SVN/OMAP4/u-boot_panda/common/panda_test/cmd_pmicTest.c:135: undefined reference to `cmd_usage' /home/qian/Desktop/SVN/OMAP4/u-boot_panda/common/panda_test/cmd_pmicTest.c:141: undefined reference to `twl6030_i2c_write_u8' common/libcommon.o: In function `do_ramTest': /home/qian/Desktop/SVN/OMAP4/u-boot_panda/common/panda_test/cmd_ramTest.c:33: undefined reference to `cmd_usage' make[1]: *** [/home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl/u-boot-spl] Error 1 make[1]: Leaving directory `/home/qian/Desktop/SVN/OMAP4/u-boot_panda/spl' make: *** [spl/u-boot-spl.bin] Error 2 ==============================================================
I'm wondering why these errors didn't appear while building 'u-boot.img' but appeared while building MLO? Is there any other things I need to do for SPL?
thanks!
*u-boot/spl/u-boot-spl.lds:1: syntax error make[1]: *** [/home/qian/Desktop/u-boot/spl/u-boot-spl] Error 1 make[1]: Leaving directory `/home/qian/Desktop/u-boot/spl' make: *** [spl/u-boot-spl.bin] Error 2*
I’ve check the file ‘spl/u-boot-spl.lds’, the first line is a comment as below: *// add PandaTest Configuration*
participants (4)
-
Ira W. Snyder
-
John Rigby
-
Peter Barada
-
Qiao.HelloWorld@gmail.com