quick&dirty Hacking /sysutils/u-boot-master to your preferred u-boot-version

using the example of the ROCKPro64-board

Disclaimer :

please only do this if you as a developer know what you are doing and if you want to improve/patch u-boot future-versions.
In no case any liability for hardware/software-damage by FreeBSD or the author of this article .
Please subscribe/post to freebsd-arm@freebsd.org if you are aware of improvements for u-boot 2020.xx .

preRequisites:

1.FreeBSD-X86-host (metal or vm )

2.installed ports-collection

3. ATF(Arm Trusted Firmware) binary

https://github.com/rockchip-linux/rkbin/blob/master/bin/rk33/rk3399pro_bl31_v1.30.elf (This link is broken.)

--

There can be many reasons to test a newer u-boot-version or even to need it urgently.

There can also be good reasons not to publish a new u-boot-version as an official supported port.

So the best way of enjoying FreeBSD, is to decide for yourself whether you want to use the official FreeBSD ports version, or if you want to follow the u-boot upstream and e.g. want to update backport patches from the u-boot-upstream itself.

As of March/6/2020 :

the current u-boot version is 2020.01 whereas the supported ports-version is 2019.10 . the current ATF-version is 2.2 whereas the supported ports-version is 2.1 .

Step 1 :

Simply first change nothing and compile /usr/ports/sysutils/u-boot-rockpro64 (2019.10)

files in this directory :

1. Makefile
2. pkg-descr(you can ignore)
3. AFTER or while compiling you'll see a folder "work" .
for the first compilation "work" must not been deleted  by "make clean" (because you will be interested in having a look into it to understand what's going on ),
but the next compilations should all be prepared by the "make clean " command .

Step 2 :

now: " make install "

this will compile /usr/ports/sysutils/u-boot-master into /usr/ports/sysutils/u-boot-rockpro64 with special output-files :

1. /usr/local/share/u-boot/u-boot-rockpro64 :

1. u-boot.itb
2. README(you can ignore)
3. idbloader.img

we will later DELETE the above files before every next compilation, although "make deinstall reinstall" will overwrite the files.

2. /usr/local/share/atf-rk3399

bl31.elf

Step 3 :

we will now OVERWRITE bl31.elf with the downloaded elf-binary from :

https://github.com/rockchip-linux/rkbin/blob/master/bin/rk33/rk3399pro_bl31_v1.30.elf (This link is broken.)

and RENAME rk3399pro_bl31_v1.30.elf to bl31.elf again .

but the first thing to do(after the 1st default compilation) is to hack the MAKEFILE of /usr/ports/sysutils/u-boot-master to force it to compile 2020.01 :

Step 4 :

root@freebsd:/usr/ports/sysutils/u-boot-master # cat Makefile
# $FreeBSD: head/sysutils/u-boot-master/Makefile 517038 2019-11-08 09:06:27Z lwhsu $
#
# Common infrastructure for u-boot ports
#

PORTNAME=    u-boot
PORTVERSION=    ${UBOOT_VERSION}
CATEGORIES=    sysutils
PKGNAMESUFFIX?=    -${MODEL}
MASTER_SITES=    ftp://ftp.denx.de/pub/u-boot/
DIST_SUBDIR=    u-boot

MAINTAINER?=    uboot@FreeBSD.org
COMMENT=    Cross-build das u-boot for model ${MODEL}

LICENSE=    GPLv2

BUILD_DEPENDS+=    gsed:textproc/gsed \
        swig3.0:devel/swig30 \
        dtc>=1.4.1:sysutils/dtc \
        mkimage:sysutils/u-boot-tools
BUILD_DEPENDS+=    ${COMPILER}:devel/${COMPILER}

USES=        bison gmake python:2.7,build shebangfix tar:bz2
BINARY_ALIAS=    bison=${LOCALBASE}/bin/bison dtc=${LOCALBASE}/bin/dtc sed=gsed swig=swig3.0 python2=python2.7

SHEBANG_FILES=    tools/binman/binman.py arch/arm/mach-rockchip/make_fit_atf.py
SSP_UNSAFE=    yes
UBOOT_DIR=    share/u-boot/${PORTNAME}${PKGNAMESUFFIX}
INST=        ${PREFIX}/${UBOOT_DIR}
DESCR?=        ${.CURDIR}/pkg-descr

MAKE_ARGS+=    V=1 CROSS_COMPILE=${CROSS_COMPILE} PYTHON=${PYTHON_CMD} ${ARCHFLAGS}

NO_ARCH=    yes

# Use upstreamed patches not yet mainlined
PATCH_DIST_STRIP=    -p1
PATCH_SITES+=    https://patchwork.ozlabs.org/patch/

# Sanity checks
.if !defined(MODEL) && !defined(BOARD_CONFIG) && !defined(FAMILY)
MODEL=        NONE
IGNORE=        is a metaport; there is nothing to build
.else
.if !defined(MODEL)
IGNORE+=    MODEL is not defined
.endif
.if !defined(BOARD_CONFIG)
IGNORE+=    BOARD_CONFIG is not defined
.endif
.if !defined(FAMILY)
IGNORE+=    FAMILY is not defined
.endif
.endif

# Overrides for OMAP family
UBOOT_PLIST_OMAP=u-boot.img MLO
UBOOT_METADATA_OMAP_FILES=    ${UBOOT_PLIST_OMAP}
UBOOT_METADATA_OMAP_METHOD=    file

# Overrides for ALLWINNER family
UBOOT_PLIST_ALLWINNER=u-boot-sunxi-with-spl.bin
UBOOT_METADATA_ALLWINNER_FILES=        ${UBOOT_PLIST_ALLWINNER}
UBOOT_METADATA_ALLWINNER_METHOD=    raw
UBOOT_METADATA_ALLWINNER_RAW_OFFSET=    8
UBOOT_METADATA_ALLWINNER_RAW_BS=    1k

# Overrides for ALLWINNER64 family
UBOOT_PLIST_ALLWINNER64=${UBOOT_PLIST_ALLWINNER}
UBOOT_ARCH_ALLWINNER64=aarch64
UBOOT_METADATA_ALLWINNER64_FILES=    ${UBOOT_PLIST_ALLWINNER64}
UBOOT_METADATA_ALLWINNER64_METHOD=    raw
UBOOT_METADATA_ALLWINNER64_RAW_OFFSET=    8
UBOOT_METADATA_ALLWINNER64_RAW_BS=    1k

# Overrides for Zynq 7000 family
UBOOT_PLIST_ZYNQ_7000=u-boot.img boot.bin uEnv.txt
UBOOT_MOVE_ZYNQ_7000=${WRKSRC}/spl/boot.bin ${.CURDIR}/files/uEnv.txt

# Overrides for RPI family
UBOOT_PLIST_RPI=    u-boot.bin
UBOOT_METADATA_RPI_FILES=    ${UBOOT_PLIST_RPI}
UBOOT_METADATA_RPI_METHOD=    file

# Overrides for IMX6 family
UBOOT_METADATA_IMX6_FILES=    u-boot.imx
UBOOT_METADATA_IMX6_METHOD=    raw
UBOOT_METADATA_IMX6_RAW_OFFSET=    2
UBOOT_METADATA_IMX6_RAW_BS=    512

# Override for RK3328 family
UBOOT_PLIST_RK3328=    idbloader.img u-boot.itb
UBOOT_ARCH_RK3328=    aarch64

# Override for RK3399 family
UBOOT_PLIST_RK3399=    idbloader.img u-boot.itb
UBOOT_ARCH_RK3399=    aarch64

# Override for ARMADA38X family
UBOOT_PLIST_ARMADA38X=    u-boot-spl.kwb
UBOOT_METADATA_ARMADA38X_FILES=        ${UBOOT_PLIST_ARMADA38X}
UBOOT_METADATA_ARMADA38X_METHOD=    raw
UBOOT_METADATA_ARMADA38X_RAW_OFFSET=    1
UBOOT_METADATA_ARMADA38X_RAW_BS=    512

# Uboot variables
.if !defined(UBOOT_VERSION) && defined(UBOOT_VERSION_${FAMILY:tu})
UBOOT_VERSION=${UBOOT_VERSION_${FAMILY:tu}}
.endif
UBOOT_VERSION?=    2020.01

# If a slave port defines a PORTREVISION use it
.if defined(U_BOOT_SLAVE_PORTREVISION_${UBOOT_VERSION})
PORTREVISION=    ${U_BOOT_SLAVE_PORTREVISION_${UBOOT_VERSION}}
.endif

.if !defined(UBOOT_PLIST) && defined(UBOOT_PLIST_${FAMILY:tu})
UBOOT_PLIST=${UBOOT_PLIST_${FAMILY:tu}}
.endif
UBOOT_PLIST?=u-boot.img

.if !defined(UBOOT_ARCH) && defined(UBOOT_ARCH_${FAMILY:tu})
UBOOT_ARCH=${UBOOT_ARCH_${FAMILY:tu}}
.endif
UBOOT_ARCH?=    arm

.if ${UBOOT_ARCH} == arm
CROSS_COMPILE=arm-none-eabi-
ARCHFLAGS=ARCH=${UBOOT_ARCH}
UBOOT_PLIST+=    boot.scr
.elif ${UBOOT_ARCH} == aarch64
CROSS_COMPILE=aarch64-none-elf-
ARCHFLAGS=ARCH=arm
.else
# Best guess for other architectures
CROSS_COMPILE=${UBOOT_ARCH}-none-elf-
ARCHFLAGS=ARCH=${UBOOT_ARCH}
.endif
COMPILER?=${CROSS_COMPILE}gcc

.if !defined(UBOOT_MOVE) && defined(UBOOT_MOVE_${FAMILY:tu})
UBOOT_MOVE=${UBOOT_MOVE_${FAMILY:tu}}
.endif

# Per family dependancies
.if defined(FAMILY) && ${FAMILY} == allwinner64
BUILD_DEPENDS+= ${LOCALBASE}/share/atf-sun50i_a64/bl31.bin:sysutils/atf-sun50i_a64
MAKE_ENV+=    BL31=${LOCALBASE}/share/atf-sun50i_a64/bl31.bin
.endif

.if defined(FAMILY) && ${FAMILY} == rk3328
BUILD_DEPENDS+= ${LOCALBASE}/share/atf-rk3328/bl31.elf:sysutils/atf-rk3328 \
${PYTHON_PKGNAMEPREFIX}pyelftools>0:devel/py-pyelftools@${PY_FLAVOR}
MAKE_ENV+=    BL31=${LOCALBASE}/share/atf-rk3328/bl31.elf
.endif

.if defined(FAMILY) && ${FAMILY} == rk3399
BUILD_DEPENDS+= ${LOCALBASE}/share/atf-rk3399/bl31.elf:sysutils/atf-rk3399 \
${PYTHON_PKGNAMEPREFIX}pyelftools>0:devel/py-pyelftools@${PY_FLAVOR}
MAKE_ENV+=    BL31=${LOCALBASE}/share/atf-rk3399/bl31.elf
.endif

# Each u-boot family has different files to include, bring them in.
.for i in ${UBOOT_PLIST}
PLIST_FILES+=    ${UBOOT_DIR}/${i}
.endfor
PLIST_FILES+=    ${UBOOT_DIR}/README

.if defined(UBOOT_METADATA_${FAMILY:tu}_METHOD)
METADATA_METHOD=${UBOOT_METADATA_${FAMILY:tu}_METHOD}
METADATA_FILES=${UBOOT_METADATA_${FAMILY:tu}_FILES}
PLIST_FILES+=    ${UBOOT_DIR}/metadata
UBOOT_PLIST+=    metadata
.if ${METADATA_METHOD} == "raw"
METADATA_OFFSET=${UBOOT_METADATA_${FAMILY:tu}_RAW_OFFSET}
METADATA_BS=${UBOOT_METADATA_${FAMILY:tu}_RAW_BS}
.elif ${METADATA_METHOD} == "file"
.else
.error "Unsupported METADATA_METHOD"
.endif
.endif

post-patch:
    @${REINPLACE_CMD} -e "s|make|${MAKE_CMD}|" ${WRKSRC}/scripts/kconfig/merge_config.sh
    ${CP} ${FILESDIR}/boot.cmd ${WRKSRC}/
.if defined(METADATA_METHOD)
    @echo "METHOD=uboot-${METADATA_METHOD}" > ${WRKSRC}/metadata
    @echo "FILES=\"${METADATA_FILES}\"" >> ${WRKSRC}/metadata
.if ${METADATA_METHOD} == "raw"
    @echo "OFFSET=${METADATA_OFFSET}" >> ${WRKSRC}/metadata
    @echo "BS=${METADATA_BS}" >> ${WRKSRC}/metadata
.elif ${METADATA_METHOD} == "file"
.endif
.endif

.if ${UBOOT_ARCH} == arm && !defined(CONFIG_FRAGMENT)
# For armv6/v7 we want CONFIG_API
# Use a KConfig fragment for that
FRAGMENT_NAME=        FreeBSD_Fragment
CONFIG_FRAGMENT=    ${FILESDIR}/${FRAGMENT_NAME}
.endif

.if defined(CONFIG_FRAGMENT)
do-configure:
    ${CP} ${CONFIG_FRAGMENT} ${WRKSRC}/configs/
    (cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} scripts/kconfig/merge_config.sh configs/${BOARD_CONFIG} configs/${FRAGMENT_NAME})
.else
do-configure:
    (cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${MAKE_CMD} ${BOARD_CONFIG})
.endif

post-build:
.if ${UBOOT_ARCH} == arm
    mkimage -C none -A arm -T script -d ${FILESDIR}/boot.cmd ${WRKSRC}/boot.scr
.endif
.if defined(UBOOT_EXTRA_TARGETS)
.for i in ${UBOOT_EXTRA_TARGETS}
    (cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${i})
.endfor
.endif
# If we need to put anything into WRKSRC, do so now so we can build the PLIST
# in do-install
.if defined(UBOOT_MOVE)
pre-install:
    ${CP} ${UBOOT_MOVE} ${WRKSRC}
.endif

do-install:
    ${MKDIR} ${STAGEDIR}/${INST}
.for i in ${UBOOT_PLIST}
    ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}/${INST}
.endfor
    ${INSTALL_DATA} ${DESCR} ${STAGEDIR}/${INST}/README

.include <bsd.port.mk>

the next hack is to change /usr/ports/sysutils/u-boot-master/distfile :

root@freebsd:/usr/ports/sysutils/u-boot-master # cat distinfo

TIMESTAMP = 1573202420
SHA256 (u-boot/u-boot-2020.01.tar.bz2) = qkU8YDIIsbJ70DUld1p/ebRDrexXf9xujwaXQCWhNfE=
SIZE (u-boot/u-boot-2020.01.tar.bz2) = 14716125

you will notice that in the above distfile something is ripped out from the original distfile. this Wiki-article is primary meant as a quick&dirty-hack- manual , u-boot patches will be handled later here.

Please make copies of all files you change BEFORE e.g. :

root@freebsd:# mv distfile distfile_old
root@freebsd:# touch distfile ;-)
root@freebsd:#  vi distfile
.. and so on

If I haven`t forgotten something by quick writing this article we should now be prepared to make the first u-boot 2020.01 -compilation under FreeBSD :

root@freebsd:/usr/ports/sysutils/u-boot-rockpro64 # make NO_CHECKSUM=yes deinstall reinstall

now we can grab idbloader.img & u-boot.itb and begin to install FreeBSD onto the SD-card like described here :

arm64/ROCKPro64

so this is the first start point to begin patching/testing u-boot ... output :

U-Boot TPL 2020.01 (Mar 06 2020 - 23:12:15)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 D BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8  Die BW=16 Size=2048MB
256B stride
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.01 (Mar 06 2020 - 23:12:15 +0000)
Trying to boot from MMC1
NOTICE:  BL31: v1.3(debug):42583b6
NOTICE:  BL31: Built : 07:55:13, Oct 15 2019
NOTICE:  BL31:p release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initializ opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    If lpddr4 need support multi frequency,
INFO:    please update loader!
INFO:    CurreINFO:    Current ctl index[1] freq=800MHz
INFO:    plat_rockchip_pmu_init(1190): pd status 3e
NFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Bootlization. SMC`s destined for OPTE will return SMC_UNK
ERROR:   Error initializing runtime servieparing for EL3 exit to normal wrld
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x

U-Boot 2020.01 (Mar 06 2020 - 23:12:15 +0000)

Model: Pine64 RockPro64
DRAM:  3.9 GiB
PMIC:  RK808
MMC:   dwmmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMC... Card did not respond to voltage select!
*** Warning - No block device, using default environment

In:    serial@ff1a0000
Out:   serial@ff1a0000
Err:   serial@ff1a0000
Model: Pine64 RockPro64
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:   eth0: ethernet@fe300000
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
73632 bytes read in 10 ms (7 MiB/s)
Found EFI removable media binary efi/boot/bootaa64.efi
Scanning disk dwmmc@fe320000.blk...
** Unrecognized filesystem type **
Card did not respond to voltage select!
Scanning disk sdhci@fe30000.blk...
Disk sdhci@fe330000BootOrder not defined
EFI boot manager: Cannot load any image
679128 bytes read in 36 ms (18 MiB/s)
Consoles: EFIcons
    Read5hloader en varm /ef[?25hi/frebsder.en[?25hv
25h Feb[?25h27 0:36:C 202[?25h0 rot@re.nyi.[?25hfreesd.o?25h
   Command lrguments: loadi
   Ima?25hge bh0xf4e6a00025h
25hFI F[?25hrmwae: DBoot [?25h(rev8224
  Console: 0x100)
5h   Lo5hath: 5h/efi\[?25hbootaa64.efi
   Lad De5hvice:[?25h /Ve61d73b9-a3[?25h84-4eab-82e828?25hf362(1)/SD(0)25h/HD(1,0,0x81f,25h0x18
Trying ESP: /enHwe61d73b9-4accaeab82e825h28b)[?25hSD(1/SD((1,0x[?25h01,00x818fa8)[?25h
Setting?25hdev o disk0pTrying: /VenHw(e619-a384-4ac25hc-aee828f3628b25h)/SDD(0)/HD(2,5h0x01,197c7,0x76da839hetting cur[?25hrdevisk0p2:
Loading /bh/defaults/?25hloadhnf
Loading /boot/loaderf.hints
Loading /boot/loadef.local
[?25h\

 Loading kernel../boot/kernel/kernel text=9cc data=0x1917a8 data=0x0+05h79db625h0 syms=[0x8+10d760+0x8+0x132204]
Loading co?25hnfigmodules...5h
/boot/entropy ize=0x100[?25h0
/boot/kernel/umodem.ko t=0x25h100 t[?25hext=0 data=0x6e0+0x10 syms=[0x8+[?25h+0x80xb6e]
Hit [Enter?25h] to immediate25hly, y other ke5hy formand prompt.
ing DTB pr5hovide[?25hEFI at 0x80eb0
---<<BOOT>>---
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2020 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regsity of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Found #0 r358358: Thu Feb 27 08:07:51 UTC 2020
    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm
                                                     FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b3159.0.1)
WARNING: WITNESS option enabled, expect reduced performance.
VT: init without driver.
module firmware already present!
KLD file umodem.ko is missing dependencies
Starting CPU 1 (1)
Starting CPU 2 (2)
Starting CPU 3 (3)
Starting CPU 4 (100)
Starting CPU 5 (101)
FreeBSD/SMP: Multiprocessor System Detected: 6 CPUs
random: unblocking device.
random: entropy device external interface
MAP f4f16000 mode 2 pages 1
MAP f4f21000 mode 2 pages 1
MAP f7f30000 mode 2 pages 16
WARNING: Device "kbd" is Giant locked and may be deleted before kbd0 at kbdmux0
WARNING: Device "openfirm" is Giant locked and may be deleted before FreeBSD 13.0.
ofwbus0: <Open Firmware Device Tree>
clk_fixed0: <Fixed clock> on ofwbus0
rk_grf0: <RockChip General Register Files> mem 0xff320000-0xff320fff on ofwbus0
rk3399_pmucru0: <Rockchip RK3399 PMU Clock and Reset Unit> mem 0xff750000-0xff75rk3399_cru0: <Rockchip RK3399 Clock and Reset Unit> mem 0xff7600us0
rk_grf1: <RockChip General Register Files> mem 0xff770000-0xff77clk_fixed1: <Fixed clock> on ofwbus0
regfix0: <Fixed Regulator> on ofwbus0
regfix1: <Fixed Regulator> on ofwbus0
regfix2: <Fixed Regulator> on ofwbus0
regfix3: <Fixed Regulator> on ofwbus0
regfix4: <Fixed Regulator> on ofwbus0
regfix5: <Fixed Regulator> on ofwbus0
regfix6: <Fixed Regulator> on ofwbus0
regfix7: <Fixed Regulator> on ofwbus0
simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0xff310000-0xff310fff on ofwbus0
psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
gic0: <ARM Generic Interrupt Controller v3.0> mem 0xfee00000-0xfee0ffff,0xfef00000-0xfefbffff,0x,0xfff10000-0xfff1ffff,0xfff20000-0xfff2ffff irq 18 on ofwbus0
its0: <ARM GIC Interrupt Translation Service> mem 0xfee20000-0xfee3ffff on gic0
rk_pinctrl0: <RockChip Pinctrl controller> on ofwbus0
gpio0: <RockChip GPIO Bank controller> mem 0xff720000-0xff7200ff irq 70 on rk_pinctrl0
gpiobus0: <OFW GPIO bus> on gpio0
gpio1: <RockChip GPIO Bank controller> mem 0xff730000-0xff7300ff irq 71 on rk_pinctrl0
gpiobus1: <OFW GPIO bus> on gpio1
gpio2: <RockChip GPIO Bank controller> mem 0xff780000-0xff7800ff irq 72 on rk_pinctrl0
gpiobus2: <OFW GPIO bus> on gpio2
gpio3: <RockChip GPIO Bank controller> mem 0xff788000-0xff7880ff irq 73 on rk_pinctrl0
gpiobus3: <OFW GPIO bus> on gpio3
gpio4: <RockChip GPIO Bank controller> mem 0xff790000-0xff7900ff irq 74 on rk_pinctrl0
gpiobus4: <OFW GPIO bus> on gpio4
rk_i2c0: <RockChip I2C> mem 0xff110000-0xff110fff irq 20 on ofwbus0
iicbus0: <OFW I2C bus> on rk_i2c0
rk_i2c1: <RockChip I2C> mem 0xff130000-0xff130fff irq 22 on ofwbus0
iicbus1: <OFW I2C bus> on rk_i2c1
rk_i2c2: <RockChip I2C> mem 0xff3c0000-0xff3c0fff irq 38 on ofwbs0
iicbus2: <OFW I2C bus> on rk_i2c2
syr8270: <Silergy SYR827 regulator> at addr 0x80 on iicbus2
rk_i2c3: <RockChip I2C> mem 0xff3d0000-0xff3d0fff irq 39 on ofwbiicbus3: <OFW I2C bus> on rk_i2c3
rk805_pmu0: <RockChip RK805 PMIC> at addr 0x36 irq 75 on iicbus2
generic_timer0: <ARMv8 Generic Timer> irq 2,3,4,5 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 24000000  1000
rk_tsadc0: <RockChip temperature sensors> mem 0xff260000-0xff2600ff irq 35 on ofwbus0
rk_iodomain0: <RockChip IO Voltage Domain> mem 0-0xff31ffff,0-0xfff on rk_grf0
rk_iodomain1: <RockChip IO Voltage Domain> mem 0-0xff76ffff,0-0xffff on rk_grf1
rk_usb2phy0: <Rockchip RK3399 USB2PHY> mem 0-0xff76ffff,0-0xffff on rk_grf1
rk_usb2phy1: <Rockchip RK3399 USB2PHY> mem 0-0xff76ffff,0-0xffff on rk_grf1
rk_emmcphy0: <Rockchip RK3399 eMMC PHY> mem 0-0xff76ffff,0-0xfffrk_pcie_phy0: <Rockchip RK3399 PCIe PHY> mem 0-0xff76ffff,0-0xffrk_typec_phy0: <Rockchip RK3399 PHY TYPEC> mem 0xff7c0000-0xff7fffff on ofwbus0
rk_typec_phy1: <Rockchip RK3399 PHY TYPEC> mem 0xff800000-0xff83us0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
cpufreq_dt0: <Generic cpufreq driver> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpufreq_dt1: <Generic cpufreq driver> on cpu1
cpu2: <Open Firmware CPU> on cpulist0
cpufreq_dt2: <Generic cpufreq driver> on cpu2
cpu3: <Open Firmware CPU> on cpulist0
cpufreq_dt3: <Generic cpufreq driver> on cpu3
cpu4: <Open Firmware CPU> on cpulist0
cpufreq_dt4: <Generic cpufreq driver> on cpu4
cpu5: <Open Firmware CPU> on cpulist0
cpufreq_dt5: <Generic cpufreq driver> on cpu5
pcib0: <Rockchip PCIe controller> mem 0xf8000000-0xf9ffffff,0xfd,8 on ofwbus0
pcib0: Gen1 link training timeouted: 0x00080001.
pci0: <PCI bus> on pcib0
pcib1: <PCI-PCI bridge> at device 0.0 on pci0
pcib0: failed to reserve resource for pcib1
pcibmory window: 0-0xfffff
pci1: <PCI bus> on pcib1
dwc0: <Rockchip Gigabit Ethernet Controller> mem 0xfe300000-0xfe30ffff irq 9 on ofwbus0
miibus0: <MII bus> on dwc0
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 0 on miibus0
rgephy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
rgephy1: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 iibus0
rgephy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseDX-master, auto
dwc0: Ethernet address: 3e:e5:c3:24:6e:90
rockchip_dwmmc0: <Synopsys DesignWare Mobile Storage Host Controer (RockChip)> mem 0xfe320000-0xe323fff irq 11 on ofwbus0
rockchip_dwmmc0: Hardware version ID is 270a
mmc0: <MMC/SD bus> on rockchip_dwmmc0
sdhci_fdt0: <Rockchip RK3399 fdt SDHCI controller> mem 0xfe33000 ofwbus0
rk_emmcphy0: got emmcclk clock
sdhci_fdt0-slot0: Hardware doesn't specify timeout clock frequency, setting BROKEN_TIMEOUT quirk.
sdhci_fdt0: 1 slot(s) allocated
mmc1: <MMC/SD bus> on sdhci_fdt0
ehci0: <Generic EHCI Controller> mem 0xfe380000-0xfe39ffff irq 1usbus0: EHCI version 1.0
usbus0 on ehci0
ohci0: <Generic OHCI Controller> mem 0xfe3a0000-0xfe3bffff irq 14 on ofwbus0
usbus1 on ohci0
ehci1: <Generic EHCI Controller> mem 0xfe3c0000-0xfe3dffff irq 15 on ofwbus0
usbus2: EHCI version 1.0
usbus2 on ehci1
ohci1: <Generic OHCI Controller> mem 0xfe3e0000-0xfe3fffff irq 16 on ofwbus0
usbus3 on ohci1
rk_dwc30: <Rockchip RK3399 DWC3> on ofwbus0
xhci0: Only host mode is supported
xhci0: Only host mode is supported
rk_dwc31: <Rockchip RK3399 DWC3> on ofwbus0
xhci0: <Synopsys Designware DWC3> mem 0xfe900000-0xfe9fffff irq 78 on rk_dwc31
xhci0: 64 bytes context size, 32-bit DMA
usbus4: trying to attach
usbus4 on xhci0
iic0: <I2C generic I/O> on iicbus0
iic1: <I2C generic I/O> on iicbus1
uart0: <16750 or compatible> mem 0xff180000-0xff1800ff irq 26 on ofwbus0
uart1: <16750 or compatible> mem 0xff1a0000-0xff1a00ff irq 28 onuart1: console (1500000,n,8,1)
spi0: <Rockchip SPI> mem 0xff1d0000-0xff1d0fff irq 31 on ofwbus0
spibus0: <OFW SPI bus> on spi0
spibus0: <unknown card> at cs 0 mode 0
syscon_generic0: <syscon> mem 0xffa58000-0xffa5801f on ofwbus0
syscon_generic1: <syscon> mem 0xffa5c000-0xffa5c01f on ofwbus0
syscon_generic2: <syscon> mem 0xffa60080-0xffa6009f on ofwbus0
syscon_generic3: <syscon> mem 0xffa60100-0xffa6011f on ofwbus0
syscon_generic4: <syscon> mem 0xffa60180-0xffa6019f on ofwbus0
syscon_generic5: <syscon> mem 0xffa70000-0xffa7001f on ofwbus0
syscon_generic6: <syscon> mem 0xffa70080-0xffa7009f on ofwbus0
syscon_generic7: <syscon> mem 0xffa74000-0xffa7401f on ofwbus0
syscon_generic8: <syscon> mem 0xffa76000-0xffa7601f on ofwbus0
syscon_generic9: <syscon> mem 0xffa90000-0xffa9001f on ofwbus0
syscon_generic10: <syscon> mem 0xffa98000-0xffa9801f on ofwbus0
syscon_generic12: <syscon> mem 0xffaa0080-0xffaa009f on ofwbus0
syscon_generic13: <syscon> mem 0xffaa8000-0xffaa801f on ofwbus0
syscon_generic14: <syscon> mem 0xffaa8080-0xffaa809f on ofwbus0
syscon_generic16: <syscon> mem 0xffab0080-0xffab009f on ofwbus0
syscon_generic17: <syscon> mem 0xffab8000-0xffab801f on ofwbus0
syscon_generic19: <syscon> mem 0xffac0080-0xffac009f on ofwbus0
syscon_generic20: <syscon> mem 0xffac8000-0xffac801f on ofwbus0
syscon_generic21: <syscon> mem 0xffac8080-0xffac809f on ofwbus0
syscon_generic22: <syscon> mem 0xffad0000-0xffad001f on ofwbus0
syscon_generic23: <syscon> mem 0xffad8080-0xffad809f on ofwbus0
syscon_generic24: <syscon> mem 0xffae0000-0xffae001f on ofwbus0
iicbus2: <unknown card> at addr 0x82
iic2: <I2C generic I/O> on iicbus2
iicbus3: <unknown card> at addr 0x44
iic3: <I2C generic I/O> on iicbus3
pwm0: <Rockchip PWM> mem 0xff420000-0xff42000f on ofwbus0
pwmbus0: <OFW PWM bus> on pwm0
pwmc0: <PWM Control> channel 0 on pwmpwm1: <Rockchip PWM> mem 0xff420010-0xff42001f on ofwbus0
pwmbus1: <OFW PWM bus> on pwm1
pwmc1: <PWM Control> channel 0 on pwmbus1
pwm2: <Rockchip PWM> mem 0xff420020-0xff42002f on ofwbus0
pwmbus2: <OFW PWM bus> on pwm2
pwmc2: <PWM Control> channel 0 on pwm
gpioc0: <GPIO controller> on gpio0
gpioc1: <GPIO controller> on gpio1
gpioc2: <GPIO controller> on gpio2
gpioc3: <GPIO controller> on gpio3
gpioc4: <GPIO con gpio4
gpioled0: <GPIO LEDs> on ofwbus0
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 480Mbps High Speed USB v2.0
usbus3: 12Mbps Full Speed USB v1.0
usbus4: 5.0Gbps Super Speed USB v3.0
Obsolete code will be removed soon: random(9) is the obsolete Park-Miller LCG from 1988
ugen1.1: <Generic OHCI root HUB> at usbus1
uhub0 on usbus1
uhub0: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen0.1: <Generic EHCI root HUB> at usbus0
uhub1 on usbus0
uhub1: <Generic EHCI root v 2.00/1.00, addr 1> on usbus0
ugen3.1: <Generic OHCI root HUB> at usbus3
uhub2 on usbus3
uhub2: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> onugen2.1: <Generic EHCI root HUB> at usbus2
uhub3 on usbus2
uhub3: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ugen4.1: <Synopsys XHCI root HUB> at usbus4
uhub4 on usbus4
uhub4: <Synopsys XHCI roo addr 1> on usbus4
mmcsd0: 64GB <SDHC SN64G 8.0 SN 1BF55339 MFG 09/2019 by 3 SD> at mmc0 50.0MHz/4bit/256-block
mmc1: No compatible cards found on bus
Release APs...done
CPU  0: ARM Cortex-A53 r0p4 affinity:  0  0
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,VIVT ICache,64 byte ERon Set Attributes 0 = <CRC32,SHASHA1,AES+PMULL>
 Instruction Set Attributes 1 = <>
         Pr,FP,EL3 32,EL2 32,EL1 32,EL0 32>
         Processor Features 1 = <>
      Memory Model FeatureEnd,16bit ASID,1TB PA>
      Memory Model Features 1 = <8bit VM>
Trying to mount root from ufsmory Model Features 2 = <32bit CIDX,48bit VA>
             Debug Features 0 = <2 CTX BKPTs,4 Waugv8>
             Debug Featurs 1 = <>
         Auxiliary Features 0 = <>
         Auxiliaryrtex-A53 r0p4 affinity:  0  1
                   Cache Type = <64 byte D-cacheline,64 byte I-ca64 byte CWG>
      Memory Model Features 0 = <TGran4,TGran64,SNSMem,BigEnd,16bit ASID,1TB PA>
ffinity:  0  2
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,VIVT IC      Memory Model Features 0 = TGran4,TGran64,SNSMem,BigEnd,16bt ASID,1TB PA>
CPU  3: ARM Cort                   Cache Type = <64 byte D-cacheline,64 byte I-ccheline,VIVT ICache,64 byte ERG,Features 0 = <TGran4,TGran64,SNSem,BigEnd,16bit ASID,1TB PA>
CPU  4: ARM Cortex-A72 r0p2 affiniCache Type = <64 byte D-cacheline,64 byte I-cacheline,PIPT ICach,64 byte ERG,64 byte CWG>
     n4,TGran64,SNSMem,BigEnd,16bit AID,16TB PA>
CPU  5: ARM Cortex-A72 r0p2 affinity:  1  1
      byte D-cacheline,64 byte I-cacheine,PIPT ICache,64 byte ERG,64 bte CWG>
      Memory Model FeatBigEnd,16bit ASID,16TB PA>
WARNING: WITNESS option enabled, expect reduced performance.
uhub0: 1 port with 1 removable, self powered
Warning: no time-of-day clock registered, system time will not bub2: 1 port with 1 removable, sef powered
uhub4: 2 ports with 2 removable, self powered
uhub1: 1 port with 1 removable, self powered
uhub3: 1 port with 1 removable, self powered
Setting hostuuid: 35633731-6230-3234-6662-383163623063.
Setting hostid: 0xfb39e765.
No suitable dump device was found.
Starting file system checks:
/dev/ufs/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufs/rootfs: clean, 14373056 free (328 frags, 1796591 blocks, 0.0% fragmentation)
Mounting local filesystems:.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Setting hostname: generic.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding  .
lo0: link state changed to UP
dwc0: link state changed to DOWN
Starting Network: lo0 dwc0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPprefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
dwc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether 3e:e5:c3:24:6e:90
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
dwc0: link state changed to UP
Autoloading module: mx25l.ko
mx25l0: <M25Pxx Flash Family> at cs 0 mode 0 on spibus0
mx25l0: device type gd25q128, size 16384K in 256 sectors of 64K, erase Starting dhclient.
DHCPREQUEST on dwc0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.193 -- renewal in 43200 seconds.
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Creating and/or trimming log files.
Starting syslogd.
Clearing /tmp (X related).
Updating motd:.
Mounting late filesystems:.
Updating /var/run/os-release done.
Performing sanity check on sshd configuration.
Starting sshd.
Starting cron.
Starting background file system checks in 60 seconds.

Thu Feb 27 09:20:31 UTC 2020

FreeBSD/arm64 (generic) (ttyu1)

login:

as often said here : this is not an official installation-instruction or manual, it`s a dirty hack as a start point for understanding, updating and improving u-boot by yourself and for yourself ... and if you made improvements for yourself and for a specific board , please let us know .

H@ve fun !

arm64/compile-u-boot-2020_xx (last edited 2020-10-29T03:20:02+0000 by SashaVigole)