How to compile & install mainline u-boot?

I’m desperately trying to install mainline u-boot.

I’m using the following docker container (on AMD64) as a cross compile environment:

FROM ubuntu:14.10

# Packaged dependencies
RUN     apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq \
    automake \
    build-essential \
    bc \
    curl \
    ca-certificates \
    device-tree-compiler \
    git \
    libncurses5-dev \
    libncursesw5-dev \
    mercurial \
    u-boot-tools \
    --no-install-recommends; \
    apt-get clean

# Install ARM cross compiler and i386 header files
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq \
    gcc-arm-linux-gnueabihf \
    --no-install-recommends; \
    apt-get clean

ENV ARCH arm
ENV CROSS_COMPILE /usr/bin/arm-linux-gnueabihf-

Inside my container I’m buildig u-boot with the following commands:

git clone git://git.denx.de/u-boot.git
cd u-boot
make distclean
make jetson-tk1_defconfig
make

After this I copied u-boot-dtb-tegra.bin to bootloader/ardbeg/ and tried to flash the new u-boot to my emmc:

sudo ./flash.sh -L bootloader/ardbeg/u-boot-dtb-tegra.bin jetson-tk1 mmcblk0p1

But after reset nothing in my serial console. Not even one character! :-(

After reflashing original u-boot everything is fine:

sudo ./flash.sh -L bootloader/ardbeg/u-boot.bin jetson-tk1 mmcblk0p1

Is u-boot-dtb-tegra.bin the right file? (see https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T/Tegra_Linux_Driver_Package_UBoot_R19.3.pdf )

Anyone an idea?

I think u-boot itself has been modified between R19.x and R21.1. L4T u-boot itself used to use a uimg format, but instead uses zImage now. I have to wonder if mainline u-boot still uses uimg? There have certainly been some other changes between L4T R19.3 and R21.1 since booting SATA versus SD card seems to have been modified between those releases (though I don’t know what was changed).

Whether documentation is still accurate I wouldn’t be able to guess, but if you are going for mainline u-boot I’d actually start by finding out if mainline understands ext4 and if the zImage needs to be added. Certainly those would not matter for the serial console failure since serial console does not depend on kernel. I suspect serial console must be customized for use of the correct UART on tegra124 (perhaps along with pinmux). A certain amount of hardware needs to be hard coded in u-boot because that hardware requires availability long before any ext4 reading ever starts.

I didn’t attempt to install u-boot on the jetson yet …

Quick question:

Have you tried to start with the u-boot src on the Jetson page to see if the steps to install u-boot on the Jetson is valid before jumping with the mainline version?

I have not. I do plan to experiment some with u-boot but I have other things taking priority first and expect u-boot to be a big time-eating task to get up to speed on it…I exclusively use u-boot but I do so with the precompiled version arriving with L4T distributions.

Some hopefully useful info here:

[url]Tegra/Mainline SW/Nouveau - eLinux.org

My u-boot priority dropped a little bit after I managed to get mainline kernel to work with u-boot from l4t. And I figured out that l4t u-boot is almost up-to-date, so no real problem there.

I’ll come back to this topic later…

@kulve: thanks to your link. Some really nice explanations there. I read almost everything, but I never tried the “Nouveau” link. Why is u-boot described there and not on the u-boot page?? Never mind… :-/

I think u-boot itself has been modified between R19.x and R21.1. L4T u-boot itself used to use
a uimg format, but instead uses zImage now

On Tegra at least, U-Boot has never been contained in either a uImage or a zImage. You’re thinking of the kernel that U-Boot loads, not the U-Boot binary itself.

I’m desperately trying to install mainline u-boot.

But after reset nothing in my serial console. Not even one character! :-(

The L4T and upstream boot environments use a slightly different memory layout, which imply different values for the U-Boot link/run address, as represented by U-Boot’s CONFIG_SPL_TEXT_BASE and CONFIG_SYS_TEXT_BASE configuration values. You can find these values in include/configs/tegra124-common.h in the U-Boot source tree.

The L4T flashing tools (flash.sh) assume the values that are contained in the L4T U-Boot source distribution.

The upstream flashing tools (tegra-uboot-flasher) assume the values that are contained in the mainline U-Boot source distribution.

If you want to use mainline U-Boot source with the L4T flashing tools, simply modify the mainline U-Boot source so that the *_TEXT_BASE values match those found in the L4T U-Boot source.

Conversely, if you want to use the L4T U-Boot source with the upstream flashing tools, perform a similar modification so that the U-Boot source matches the *_TEXT_BASE values found in the mainline U-Boot source.

Stephen,

I’m testing 2015.10 upstream U-Boot on Jetson-TK1.
As your advice, I modified both CONFIG_SYS_TEXT_BASE and CONFIG_SPL_TEXT_BASE in include/configs/tegra124-common.h.
However, no output show on the serial terminal at all.

Additional to the BASE addresses, to build I had to adjust CONFIG_SPL_TEXT_BASE from 0x83D88000 to 0x83D87000.
It shows “SPL image plus BSS too big” error mesg.

To run this version, any Idea please?