[U-Boot] building u-boot x86 with device tree disabled , still refers to device tree function
Bin Meng
bmeng.cn at gmail.com
Fri Aug 12 06:12:01 CEST 2016
Hi,
On Thu, Aug 11, 2016 at 10:36 PM, Ding, ChiX <chix.ding at intel.com> wrote:
> Hi there
> I'm building u-boot as payload for x86 platform. I didn't enable device tree in menuconfig (CONFIG_OF_CONTROL is not set) because I use a board config file coreboot.h. When I built u-boot, it reports error during linking stage : undefined reference to dm_scan_fdt_dev
>
Which board are you building?
> arch/x86/lib/built-in.o:(.u_boot_list_2_uclass_2_lpc+0x8): undefined reference to `dm_scan_fdt_dev'
> common/built-in.o:(.u_boot_list_2_uclass_2_usb_hub+0x8): undefined reference to `dm_scan_fdt_dev'
> drivers/built-in.o:(.u_boot_list_2_uclass_2_pch+0x8): undefined reference to `dm_scan_fdt_dev'
> drivers/pci/built-in.o:(.u_boot_list_2_uclass_2_pci+0x8): undefined reference to `dm_scan_fdt_dev'
> drivers/spi/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined reference to `dm_scan_fdt_dev'
> drivers/usb/host/built-in.o:(.u_boot_list_2_uclass_2_usb+0x8): more undefined references to `dm_scan_fdt_dev' follow
> Makefile:1189: recipe for target 'u-boot' failed
>
> I looked at the code and see arch/x86/lib/lpc-uclass.c refers to a function "dm_scan_fdt_dev " which is defined in drivers/core/root.c and it looks like a device tree function
>
>
> UCLASS_DRIVER(lpc) = {
> .id = UCLASS_LPC,
> .name = "lpc",
> .post_bind = dm_scan_fdt_dev,
> };
>
> Because device tree isn't enabled, the function isn't compiled and causes the problem while linking.
> It's only compiled when the following is true
> #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
> If I comment out the line, it would compile and build. But I'm not sure if it's the right way to do it.
>
> Is it normal behavior? I thought that when not enabling device tree, the code shouldn't use device tree function?
> Can anyone help on this please?
>
Please refer to README.x86 for how to build U-Boot as the coreboot payload.
Regards,
Bin
More information about the U-Boot
mailing list