[U-Boot] FDT: Question about embedded fdt enable

Donghwa Lee dh09.lee at samsung.com
Wed May 30 09:37:22 CEST 2012


On Wed, May 23, 2012 at 15:13, Simon Glass wrote:

> HI Donghwa,
> 
> On Wed, May 23, 2012 at 12:39 AM, Donghwa Lee <dh09.lee at samsung.com <mailto:dh09.lee at samsung.com>> wrote:
> 
>     Dear, Simon Glass
> 
>     I am preparing device tree in Exynos SoC and had already tested by using
>     CONFIG_OF_SEPARATE. But, I couldn't test by using CONFIG_OF_EMBED because
>     it has a compiler problem to make a binary in the dts/Makefile.
> 
>     When I had used configuration as seaboard that I had changed configuration
>     from CONFIG_OF_SEPARATE to CONFIG_OF_EMBED, it had a same problem.
> 
>     How did you test in seaboard as it embedded? Is there any more configuration
>     to compile ebedded option?
> 
> 
> Can you please send me the compiler output - then I can help with this.
> 
> I do use embedded for testing only. But there is an alignment patch which is needed and was NAKed. So it is not reliable at present.
>  
> 
> 
>     please reply my question.
> 
>     Thank you,
>     Donghwa Lee
> 
> 
> Regards,
> Simon
> 

Dear, Simon Glass

Thank you for your reply. Below log is my compiler problem that was stopped while objcopy.

# We want the output format and arch.
# We also hope to win a prize for ugliest Makefile / shell interaction
# We look in the LDSCRIPT first.
# Then try the linker which should give us the answer.
# Then check it worked.
oformat=`cat  | sed -r -n 's/^OUTPUT_FORMAT[ ("]*([^")]*).*/\1/p'` ;\
	oarch=`cat  | sed -r -n 's/^OUTPUT_ARCH[ ("]*([^")]*).*/\1/p'` ;\
	\
	[ -z ${oformat} ] && \
		oformat=`/opt/tools/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi-gcc -g  -Os   -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x63300000 -I/home/leedonghwa/project/mainline/u-boot-trats/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/tools/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/../lib/gcc/arm-linux-gnueabi/4.7.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage  -Wl,--verbose 2>&1 | sed -r -n 's/^OUTPUT_FORMAT[ ("]*([^")]*).*/\1/p'` ;\
	[ -z ${oarch} ] && \
		oarch=`/opt/tools/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi-gcc -g  -Os   -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x63300000 -I/home/leedonghwa/project/mainline/u-boot-trats/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/tools/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/../lib/gcc/arm-linux-gnueabi/4.7.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage  -Wl,--verbose 2>&1 | sed -r -n 's/^OUTPUT_ARCH[ ("]*([^")]*).*/\1/p'` ;\
	\
	[ -z ${oformat} ] && \
		echo "Cannot read OUTPUT_FORMAT from lds file " && \
		exit 1 || true ;\
	[ -z ${oarch} ] && \
		echo "Cannot read OUTPUT_ARCH from lds file " && \
		exit 1 || true ;\
	\
	cd ./ && \
	/opt/tools/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi-objcopy -I binary -O ${oformat} -B ${oarch} \
		dt.dtb dt.o

And I have one more question about passing *.dtb to kernel.
I had make a .dtb binary by using CONFIG_OF_SEPARATE and confirmed normally working in u-boot. 
When kernel is booting, how could kernel access .dtb binary? 
Could kernel access dtb binary by setting /memreserve/ in u-boot .dts file or by using "fdtaddrcontrol" 
environment variable in u-boot board file?
But, by my result, dt_phys address in setup_machine_fdt() in arch/arm/devtree.c had always indicated only 
one point regardless of /memreserve/ or fdtcontroladdr.

Thank you,
Donghwa Lee



More information about the U-Boot mailing list