Trouble running u-boot and SPL on Digilent Genesys ZU

Alvaro Gamez alvaro.gamez at hazent.com
Tue Jun 22 15:39:56 CEST 2021


Hi,

El mar, 22 jun 2021 a las 15:20, Michal Simek (<monstr at monstr.eu>) escribió:
>
> Hi,
>
> On 6/22/21 2:43 PM, Alvaro Gamez wrote:
> > Hi Michal,
> >
> > El mar, 22 jun 2021 a las 13:16, Michal Simek (<monstr at monstr.eu>) escribió:
> >>
> >>
> >>
> >> On 6/22/21 12:42 PM, Alvaro Gamez wrote:
> >>> Hi again
> >>>
> >>> El jue, 17 jun 2021 a las 15:07, Alvaro Gamez
> >>> (<alvaro.gamez at hazent.com>) escribió:
> >>>>
> >>>> Hi!
> >>>>
> >>>> I'm trying to use buildroot to generate a system for the Digilent
> >>>> Genesys ZU board, which is based on the zynqmp SOC.
> >>>> I'm having trouble getting it to boot, and I was hoping I could get
> >>>> some guidance on what to do next. My issue is basically that
> >>>> nothing seems to work, since I don't have an output at all on the
> >>>> serial console.
> >>>>
> >>>> I'm using u-boot version 2021.04, which has the latest patches from
> >>>> Luca Ceresoli that should allow booting completely via u-boot and
> >>>> u-boot SPL, without using Xilinx' FSBL. My method of cross compiling
> >>>> is via buildroot version 2021.05, which eases the process of gathering
> >>>> also Arm Trusted Firmware, building the linux kernel and filesystem, etc.
> >>>>
> >>>> Out of Digilent's reference design, Vivado/Vitis generates for me
> >>>> configuration object pm_cfg_obj.c and PSU init file psu_init_gpl.c,
> >>>> which shall be fed to u-boot. Alongside these files, I use PMU firmware
> >>>> built by Luca at
> >>>> https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin
> >>>>
> >>>> To provide Arm Trusted Firmware, I'm passing buildroot the same
> >>>> configuration as already exists on configs/zynqmp_zcu106_defconfig
> >>>> which is version 1.5 of :
> >>>> https://github.com/ARM-software/arm-trusted-firmware.git
> >>>> but I don't think my board has reached the state of needing this firmware yet,
> >>>> since I don't get any SPL serial console output.
> >>>>
> >>>> The device tree I'm using is extracted from Digilent's kernel image,
> >>>> and matches perfectly with the one generated by petalinux for this
> >>>> Digilent's Vivado design, so it should be correct
> >>>>
> >>>> Provided image by Digilent follows the Xilinx' booting workflow, so
> >>>> only a BOOT.BIN file is on the sdcard which includes xilinx' FSBL, PMU
> >>>> firmware with configuration object, u-boot, kernel, device tree, etc,
> >>>> so at least I know that the board is fine as this firmware works
> >>>> flawlessly. I also was able to load the kernel and device tree as
> >>>> built by buildroot over this instance of u-boot, so at least I can
> >>>> load my own kernel, but I can't progress deeper than that.
> >>>
> >>> I've been able to load u-boot proper via Xilinx FSBL, so it seems that my u-boot
> >>> configuration is not very far from what should be, but I'm still
> >>> unable to see any
> >>> reaction when trying to load SPL. I'm attaching my u-boot configuration, just
> >>> in case any of you can provide any guidance on this.
> >>>
> >>> CONFIG_ARM=y
> >>> CONFIG_ARCH_ZYNQMP=y
> >>> CONFIG_SYS_TEXT_BASE=0x8000000
> >>> CONFIG_SYS_MALLOC_F_LEN=0x8000
> >>> CONFIG_ENV_OFFSET=0x100000
> >>> CONFIG_ENV_SECT_SIZE=0x20000
> >>> CONFIG_DM_GPIO=y
> >>> CONFIG_SPL=y
> >>> CONFIG_DEBUG_UART_BASE=0xFF000000
> >>> CONFIG_DEBUG_UART_CLOCK=100000000
> >>> CONFIG_XILINX_PS_INIT_FILE="/tmp/psu_init_gpl.c"
> >>> CONFIG_PMUFW_INIT_FILE="/tmp/pmufw-v2018.3.bin"
> >>> CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE="/tmp/pm_cfg_obj.bin"
> >>> CONFIG_ZYNQMP_USB=y
> >>> CONFIG_DEFAULT_DEVICE_TREE="zynqmp-zcu102-rev1.0"
> >>
> >> please make sure that default DT points to DT file for your board.
> >
> > I am using my own DT file, orig.dts, which is copied to arch/arm/dts and
> > its Makefile modified to include it as a target of ZYNQMP.
> >
> > Does it matter what's here in that case? In any case, I've just
> > changed it to my DT,
> > but nothing different happens.
> >
> >>
> >>
> >>> CONFIG_DEBUG_UART=y
> >>> CONFIG_DISTRO_DEFAULTS=y
> >>> CONFIG_FIT=y
> >>> CONFIG_FIT_VERBOSE=y
> >>> CONFIG_LOG=y
> >>> # CONFIG_DISPLAY_CPUINFO is not set
> >>> CONFIG_BOARD_EARLY_INIT_R=y
> >>> CONFIG_CMD_BOOTMENU=y
> >>> CONFIG_CMD_THOR_DOWNLOAD=y
> >>> CONFIG_CMD_MEMTEST=y
> >>> CONFIG_SYS_ALT_MEMTEST=y
> >>> CONFIG_CMD_CLK=y
> >>> CONFIG_CMD_DFU=y
> >>> CONFIG_CMD_FPGA_LOADBP=y
> >>> CONFIG_CMD_FPGA_LOADP=y
> >>> CONFIG_CMD_FPGA_LOAD_SECURE=y
> >>> CONFIG_CMD_GPIO=y
> >>> CONFIG_CMD_GPT=y
> >>> CONFIG_CMD_I2C=y
> >>> CONFIG_CMD_MMC=y
> >>> CONFIG_CMD_SDRAM=y
> >>> CONFIG_CMD_SPI=y
> >>> CONFIG_CMD_USB=y
> >>> CONFIG_CMD_TFTPPUT=y
> >>> CONFIG_CMD_TIME=y
> >>> CONFIG_CMD_TIMER=y
> >>> CONFIG_CMD_EXT4_WRITE=y
> >>> CONFIG_CMD_UBI=y
> >>> CONFIG_SPL_OF_CONTROL=y
> >>> CONFIG_OF_EMBED=y
> >>> CONFIG_ENV_IS_NOWHERE=y
> >>> CONFIG_ENV_IS_IN_FAT=y
> >>> CONFIG_ENV_IS_IN_SPI_FLASH=y
> >>> CONFIG_NET_RANDOM_ETHADDR=y
> >>> CONFIG_CLK_ZYNQMP=y
> >>> CONFIG_DFU_MMC=y
> >>> CONFIG_DFU_RAM=y
> >>> CONFIG_USB_FUNCTION_FASTBOOT=y
> >>> CONFIG_FASTBOOT_FLASH=y
> >>> CONFIG_FASTBOOT_FLASH_MMC_DEV=0
> >>> CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
> >>> CONFIG_FPGA_XILINX=y
> >>> CONFIG_FPGA_ZYNQMPPL=y
> >>> CONFIG_XILINX_GPIO=y
> >>> CONFIG_DM_I2C=y
> >>> CONFIG_SYS_I2C_CADENCE=y
> >>> CONFIG_I2C_MUX=y
> >>> CONFIG_I2C_MUX_PCA954x=y
> >>> CONFIG_LED=y
> >>> CONFIG_LED_GPIO=y
> >>> CONFIG_MISC=y
> >>> CONFIG_MMC_IO_VOLTAGE=y
> >>> CONFIG_MMC_UHS_SUPPORT=y
> >>> CONFIG_MMC_SDHCI=y
> >>> CONFIG_MMC_SDHCI_ZYNQ=y
> >>> CONFIG_MTD=y
> >>> CONFIG_SPI_FLASH_BAR=y
> >>> CONFIG_SPI_FLASH_ISSI=y
> >>> CONFIG_SPI_FLASH_MACRONIX=y
> >>> CONFIG_SPI_FLASH_SPANSION=y
> >>> CONFIG_SPI_FLASH_STMICRO=y
> >>> CONFIG_SPI_FLASH_WINBOND=y
> >>> # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
> >>> CONFIG_MTD_UBI_BEB_LIMIT=0
> >>> CONFIG_PHY_MARVELL=y
> >>> CONFIG_PHY_REALTEK=y
> >>> CONFIG_PHY_TI=y
> >>> CONFIG_PHY_VITESSE=y
> >>> CONFIG_PHY_FIXED=y
> >>> CONFIG_PHY_GIGE=y
> >>> CONFIG_MII=y
> >>> CONFIG_ZYNQ_GEM=y
> >>> CONFIG_DEBUG_UART_ANNOUNCE=y
> >>> CONFIG_ZYNQ_SERIAL=y
> >>> CONFIG_SPI=y
> >>> CONFIG_ZYNQMP_GQSPI=y
> >>> CONFIG_USB=y
> >>> CONFIG_USB_XHCI_HCD=y
> >>> CONFIG_USB_XHCI_DWC3=y
> >>> CONFIG_USB_DWC3=y
> >>> CONFIG_USB_DWC3_GENERIC=y
> >>> CONFIG_USB_ULPI_VIEWPORT=y
> >>> CONFIG_USB_ULPI=y
> >>> CONFIG_USB_GADGET=y
> >>> CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
> >>> CONFIG_USB_GADGET_VENDOR_NUM=0x03FD
> >>> CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
> >>> CONFIG_USB_FUNCTION_THOR=y
> >>> CONFIG_PANIC_HANG=y
> >>> # CONFIG_EFI_LOADER is not set
> >>
> >> And you should normally just add psu_init_gpl.c/h to
> >> board/xilinx/zynqmp/<dt_name>/* and run export DEVICE_TREE=<dt_name> and
> >> add dt file to arch/arm/dts + wiring in Makefile.
> >
> > I should have mentioned that I am building uboot via Buildroot, so buildroot
> > is taking care of this, by compiling my own dts, which I did in fact
> > had to manually add
> > under dtb-$(CONFIG_ARCH_ZYNQMP) += \ (as explained above too).
> >
> > The same happens with psu_init_gpl.* files, which are managed by Buildroot too,
> > so I can be relatively sure that these steps are correct. The fact
> > that uboot proper
> > boots also seems to confirm this.
> >
> >> The rest should be done automatically.
> >> If you export link to BL31 (atf)
> >> export BL31=/tmp/bl31.bin
> >
> > Buildroot already manages that for me too, thankfully
> >
> >> after make you will get spl/boot.bin and u-boot.itb. And just copy them
> >> to SD card and boot from it. If you use different boot medium just check
> >> that addresses which u-boot SPL is looking for.
> >
> > Ah, things are different here. I am using u-boot.elf file. Trying to
> > compile itb results in the following error:
> >
> >   HOSTCC  scripts/basic/fixdep
> >   HOSTCC  scripts/kconfig/conf.o
> >   HOSTCC  scripts/kconfig/zconf.tab.o
> >   HOSTLD  scripts/kconfig/conf
> > scripts/kconfig/conf  --syncconfig Kconfig
> >   GEN     include/autoconf.mk.dep
> >   CFG     u-boot.cfg
> >   CFG     spl/u-boot.cfg
> >   GEN     include/autoconf.mk
> >   GEN     spl/include/autoconf.mk
> > ===================== WARNING ======================
> > CONFIG_OF_EMBED is enabled. This option should only
> > be used for debugging purposes. Please use
>
> I would recommend you to ignore buildroot configurations. I don't think
> anybody is keeping it up2date. Definitely not Xilinx that's why couple
> of issues can come from there. Just simply use toolchain and build
> things directly from u-boot source code.

Buildroot does not include uboot configurations, they just have "boards"
that, if selected, refer to configurations already existing on uboot. Otherwise,
you (I) are left on your own, regarding uboot config, it only takes care of
moving around some files, like DT and psu_init_gpl.c.

Whatever is wrong is my fault, buildroot is literally only calling make
with the proper toolchain variables set.

The config I'm using was selected by me and can definitely be wrong in one
or more places, although I started off with Digilent's petalinux project uboot
configuration and compared it against xilinx_zynqmp_mini_emmc0_defconfig

The process was: configure buildroot to build the same uboot version and
configuration as Digilent's petalinux project (uboot xilinx-v2019.1). After
verifying that it boots, I instructed buildroot to build the same configuration
but with uboot 2021.04, and there were no meaningful changes to the conf.
Both versions are able to boot the board and launch linux flawlessly it seems.

So, basically I have the same config as Digilent's original project,
which buildroot
compiles OK in both uboot-xilinx-v2019.1 and uboot 2021.04.
But adding SPL options to this config and version, results in a
silent/non working SPL.

I could just use xilinx' FSBL with the help of petalinux, but that would
definitely be the opposite of what I want/need, which is using as much
of buildroot as possible, and as little extra software as possible too.

Thanks!

--
Álvaro Gámez Machado


More information about the U-Boot mailing list