U-Boot SPL not getting generated

Simon Glass sjg at chromium.org
Wed Nov 23 03:09:02 CET 2022


Hi Venkatakrishnan,

On Tue, 22 Nov 2022 at 05:48, Venkatakrishnan S ic11539
<venkatakrishnan.sutharsan at imail.iitm.ac.in> wrote:
>
> I looked into the Kconfig and made changes so that it can be selected. I have some issues while generating u-boot-spl and log is as follows.

Can you please avoid top posting?

>
>   HOSTCC  tools/mkenvimage.o
>   HOSTCC  tools/fit_image.o
>   HOSTCC  tools/image-host.o
>   HOSTCC  tools/dumpimage.o
>   HOSTCC  tools/mkimage.o
>   HOSTLD  tools/mkenvimage
>   HOSTLD  tools/dumpimage
>   HOSTLD  tools/mkimage
>   CC      cmd/version.o
>   CC      common/main.o
> In file included from include/config.h:4,
>                  from include/common.h:16,
>                  from cmd/version.c:7:
> include/configs/shakti-arty100.h:21: warning: "CONFIG_SPL_LOAD_FIT_ADDRESS" redefined
>    21 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x84000000

My guess is that this is supposed in be in defconfig, not the config.h file

>       |
> In file included from ././include/linux/kconfig.h:4,
>                  from <command-line>:
> include/generated/autoconf.h:74: note: this is the location of the previous definition
>    74 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80000000
>       |
> In file included from include/config.h:4,
>                  from include/common.h:16,
>                  from common/main.c:9:
> include/configs/shakti-arty100.h:21: warning: "CONFIG_SPL_LOAD_FIT_ADDRESS" redefined
>    21 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x84000000
>       |
> In file included from ././include/linux/kconfig.h:4,
>                  from <command-line>:
> include/generated/autoconf.h:74: note: this is the location of the previous definition
>    74 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80000000
>       |
>   LD      cmd/built-in.o
>   CC      lib/smbios.o
>   CC      lib/display_options.o
> In file included from include/config.h:4,
>                  from include/common.h:16,
>                  from lib/smbios.c:8:
> include/configs/shakti-arty100.h:21: warning: "CONFIG_SPL_LOAD_FIT_ADDRESS" redefined
>    21 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x84000000
>       |
> In file included from ././include/linux/kconfig.h:4,
>                  from <command-line>:
> include/generated/autoconf.h:74: note: this is the location of the previous definition
>    74 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80000000
>       |
>   LD      common/built-in.o
> In file included from include/config.h:4,
>                  from include/common.h:16,
>                  from lib/display_options.c:7:
> include/configs/shakti-arty100.h:21: warning: "CONFIG_SPL_LOAD_FIT_ADDRESS" redefined
>    21 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x84000000
>       |
> In file included from ././include/linux/kconfig.h:4,
>                  from <command-line>:
> include/generated/autoconf.h:74: note: this is the location of the previous definition
>    74 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80000000
>       |
>   LD      lib/built-in.o
>   LD      u-boot
>   OBJCOPY u-boot.srec
>   OBJCOPY u-boot-nodtb.bin
>   SYM     u-boot.sym
>   CC      spl/common/spl/spl.o
> In file included from include/config.h:4,
>                  from include/common.h:16,
>                  from common/spl/spl.c:9:
> include/configs/shakti-arty100.h:21: warning: "CONFIG_SPL_LOAD_FIT_ADDRESS" redefined
>    21 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x84000000
>       |
> In file included from ././include/linux/kconfig.h:4,
>                  from <command-line>:
> include/generated/autoconf.h:74: note: this is the location of the previous definition
>    74 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80000000
>       |
>   CC      spl/lib/display_options.o
> In file included from include/config.h:4,
>                  from include/common.h:16,
>                  from lib/display_options.c:7:
> include/configs/shakti-arty100.h:21: warning: "CONFIG_SPL_LOAD_FIT_ADDRESS" redefined
>    21 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x84000000
>       |
> In file included from ././include/linux/kconfig.h:4,
>                  from <command-line>:
> include/generated/autoconf.h:74: note: this is the location of the previous definition
>    74 | #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80000000
>       |
>   LD      spl/lib/built-in.o
>   LD      spl/common/spl/built-in.o
>   LD      spl/u-boot-spl
> riscv-gnu-toolchain-installation/bin/riscv64-unknown-linux-gnu-ld.bfd: common/spl/built-in.o: in function `board_boot_order':
> linux-devkit/bootloaders/uboot/common/spl/spl.c:503: undefined reference to `spl_boot_device'

I suppose you need to define that function like other boards do.

> riscv-gnu-toolchain-installation/bin/riscv64-unknown-linux-gnu-ld.bfd: drivers/built-in.o: in function `mmc_spi_readdata':
> linux-devkit/bootloaders/uboot/drivers/mmc/mmc_spi.c:206: undefined reference to `crc16_ccitt'
> riscv-gnu-toolchain-installation/bin/riscv64-unknown-linux-gnu-ld.bfd: drivers/built-in.o: in function `dm_mmc_spi_request':
> linux-devkit/bootloaders/uboot/drivers/mmc/mmc_spi.c:442: undefined reference to `crc16_ccitt'

For these, you should find the function and figure out why it is not
being compiled in SPL. Since lib/Makefile always compiles this file,
it likely means that the whole lib/ directory is not included in the
SPL build, so you can enable SPL_LIBGENERIC_SUPPORT to fix that.

> make[2]: *** [scripts/Makefile.spl:439: spl/u-boot-spl] Error 1
> make[1]: *** [Makefile:1947: spl/u-boot-spl] Error 2
> make[1]: Leaving directory 'linux-devkit/bootloaders/uboot'
> make: *** [Makefile:227: image] Error 2
>
> Any idea on where I am missing something which can be causing this.?
>
> Thanks in advacne
>
> On Sat, Nov 19, 2022 at 2:20 AM Simon Glass <sjg at chromium.org> wrote:
>>
>> Hi Venkatakrishnan,
>>
>> On Wed, 16 Nov 2022 at 16:56, Venkatakrishnan S ic11539
>> <venkatakrishnan.sutharsan at imail.iitm.ac.in> wrote:
>> >
>> > Hi,
>> >
>> > I am trying to generate u-boot spl for a custom processor based out of
>> > risc-v arch. I have done the defconfig for u-boot proper and is
>> > working now. I am able to use that alone with opensbi. I am trying to
>> > generate u-boot spl for the same board and I am not able to generate
>> > it despite adding the config option in the defconfig for the board.
>> >
>> > The options enabled/added for u-boot spl are :
>> >
>> > CONFIG_SPL_DM_SPI=y
>> > CONFIG_SPL_MMC_SUPPORT=y
>> > CONFIG_SPL=y
>> > CONFIG_SPL_BUILD=y
>> > CONFIG_SPL_SPI_FLASH_SUPPORT=y
>> > CONFIG_SPL_SPI_SUPPORT=y
>> > CONFIG_SPL_LOAD_FIT_ADDRESS=0x80000000
>> > CONFIG_SPL_CLK=y
>>
>> You cannot enable CONFIG_SPL=y in the defconfig, if that is what you
>> are doing. It needs to happen in the Kconfig as with other boards.
>>
>> Check the .config to see what is actually enabled.
>>
>> Regards,
>> Simon

Regards,
Simon


More information about the U-Boot mailing list