%global debug_package %{nil} %global __strip /bin/true %define _build_id_links none %global gitdate 20250705 %global commit e37de002fac3895e8d0b60ae2015e17bb33e2b5b %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global rkbincommit f43a462e7a1429a9d407ae52b4745033034a6cf9 %global rkbinshortcommit %(c=%{rkbincommit}; echo ${c:0:7}) %global version 2025.07 %global release 2 # set this to "1" if building a git/beta/rc release %global beta_or_rc 0 #============================================================================= # general #----------------------------------------------------------------------------- Name: u-boot-rockchip-rk3568 Version: %{version} %if %{beta_or_rc} Release: 0.%{release}.%{gitdate}.git%{shortcommit}%{?dist} %else Release: %{release}%{?dist} %endif Summary: U-Boot for the Odroid M1 with the Rockchip RK3568 License: GPL-2.0-or-later AND LicenseRef-Callaway-BSD AND LGPL-2.1-or-later AND LGPL-2.0-or-later URL: https://source.denx.de/u-boot/u-boot %if %{beta_or_rc} Source0: u-boot-%{version}-git%{shortcommit}.tar.gz %else Source0: u-boot-v%{version}.tar.gz %endif # alternatively, if is has newer fixes, use: # git repo from Kwiboo/Jonas Karlman #URL: https://github.com/Kwiboo/u-boot-rockchip # or use the rockchip custodian repo #URL: https://source.denx.de/u-boot/custodians/u-boot-rockchip # https://github.com/rockchip-linux/rkbin Source1: rkbin-git%{rkbinshortcommit}.tar.gz # https://github.com/Kwiboo/u-boot-build Source2: README-Kwiboo-u-boot-build.md # https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/upstream_uboot.md?ref_type=heads#building-the-rockchip-loader-binaries Source3: README-Collabora-upstream_uboot.md # from the Fedora spec # https://src.fedoraproject.org/rpms/uboot-tools/blob/rawhide/f/uboot-tools.spec # Fedora patches to enable/disable features Patch1: disable-VBE-by-default.patch Patch2: enable-bootmenu-by-default.patch # This is now legacy, most devices use bootflow, we keep this for the laggards Patch3: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch # Identify VFAT partitions as ESP, allows EFI setvar on our images Patch4: uefi-Add-all-options-for-EFI-System-Partitions.patch # New function to find fdt for loading from disk Patch6: uefi-initial-find_fdt_location-for-finding-the-DT-on-disk.patch # Enable UEFI SetVariable for devices without backed storage Patch7: uefi-enable-SetVariableRT-with-volotile-storage.patch # Enable UEFI HTTPS boot for all Fedora firmware Patch8: uefi-enable-https-boot-by-default.patch ## Fix PPC tools build #Patch9: tools-termios_linux.h-Fix-build-error-on-ppc64.patch # Device improvments # USB-PD improvements Patch10: USB-PD-TCPM-improvements.patch # Rockchips improvements Patch11: rockchip-Enable-preboot-start-for-pci-usb.patch # Rockchip DT rebase for fixes Patch12: Rebase-to-upstream-6.15.5-rockchip-DTs.patch #Patch13: Initial-MNT-Reform2-support.patch ## Fix Jetson Nano #Patch14: p3450-fix-board.patch # Add EFI_PARTITION_INFO_PROTOCOL support Patch20: disk-efi-Move-logic-to-get-a-GPT-entry-into-a-helper.patch Patch21: disk-efi-expose-the-part_get_gpt_pte-helper-function.patch Patch22: efi_loader-disk-add-EFI_PARTITION_INFO_PROTOCOL-supp.patch Patch23: efi_selftest-Add-basic-partition-info-check-to-block.patch # BuildRequires: bc BuildRequires: bison BuildRequires: dtc BuildRequires: flex BuildRequires: gcc BuildRequires: gnutls-devel BuildRequires: libuuid-devel BuildRequires: make BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: openssl-devel-engine BuildRequires: perl-interpreter BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-libfdt BuildRequires: SDL2-devel BuildRequires: swig # for cross compile BuildRequires: gcc-aarch64-linux-gnu BuildRequires: python3-pyelftools # for ARM's BL31 BuildRequires: arm-trusted-firmware-armv8 # for creating rk356x_spl_loader_*.bin BuildRequires: rkdeveloptool Requires: rkdeveloptool %description U-boot %{version} for the Odroid M1 with the Rockchip RK3568. #============================================================================= # prep #----------------------------------------------------------------------------- %prep %if %{beta_or_rc} %autosetup -p1 -n u-boot %else %autosetup -p1 -n u-boot-v%{version} %endif # unpack latest rkbin from https://github.com/rockchip-linux/rkbin tar -xvzf %{SOURCE1} # Kwiboo and Collabora README files cp -av %{SOURCE2} . cp -av %{SOURCE3} . # enable some options in configs/odroid-m1-rk3568_defconfig echo "CONFIG_CMD_BOOTMENU=y" >> configs/odroid-m1-rk3568_defconfig echo "CONFIG_AUTOBOOT_KEYED=y" >> configs/odroid-m1-rk3568_defconfig echo "CONFIG_BOOTDELAY=5" >> configs/odroid-m1-rk3568_defconfig echo "CONFIG_AUTOBOOT_MENU_SHOW=y" >> configs/odroid-m1-rk3568_defconfig echo "CONFIG_CMD_BOOTEFI_BOOTMGR=y" >> configs/odroid-m1-rk3568_defconfig echo "CONFIG_USE_PREBOOT=y" >> configs/odroid-m1-rk3568_defconfig echo 'CONFIG_PREBOOT="pci enum; usb start; scsi scan; nvme scan;"' >> configs/odroid-m1-rk3568_defconfig #============================================================================= # build #----------------------------------------------------------------------------- %build mkdir builds # see https://github.com/Kwiboo/u-boot-build/blob/main/.github/workflows/rk356x.yml # see https://github.com/rockchip-linux/rkbin DDRBIN='bin/rk35/rk3568_ddr_1560MHz_v1.23.bin' sed -i 's/uart baudrate=/uart baudrate=1500000/' rkbin/tools/ddrbin_param.txt sed -i 's/dis_train_print=/dis_train_print=1/' rkbin/tools/ddrbin_param.txt python3 rkbin/tools/ddrbin_tool.py rk3568 rkbin/tools/ddrbin_param.txt rkbin/$DDRBIN export ROCKCHIP_TPL=rkbin/$DDRBIN # BL31 from rkbin repo #export BL31=rkbin/bin/rk35/rk3568_bl31_v1.44.elf # BL31 from arm-trusted-firmware-arm8 export BL31=/usr/share/arm-trusted-firmware/rk3568/bl31.elf # for the 'odroid-m1-rk3568' config name see: # https://source.denx.de/u-boot/u-boot/-/tree/master/configs %make_build mrproper %make_build CROSS_COMPILE=aarch64-linux-gnu- odroid-m1-rk3568_defconfig O=builds/ V=1 %make_build CROSS_COMPILE=aarch64-linux-gnu- O=builds/ V=1 # https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/upstream_uboot.md?ref_type=heads#building-the-rockchip-loader-binaries pushd rkbin # create the SPL loader with both boot_merger and rkdeveloptool ./tools/boot_merger RKBOOT/RK3568MINIALL.ini cp -av RKBOOT/RK3568MINIALL.ini config.ini # rename the loader by adding rkdeveloptool to the filename sed -i -e's|^PATH=rk356x_spl_loader_v1.23.114.bin|PATH=rk356x_spl_loader_v1.23.114_rkdeveloptool.bin|' config.ini # remove incompatible sections sed -i -e'21,25d' config.ini # generate the SPL loader rkdeveloptool pack ls -lia rk356x_spl_loader*.bin popd #============================================================================= # install #----------------------------------------------------------------------------- %install mkdir -p %{buildroot}%{_datadir}/%{name}/Odroid-M1 cp -av builds/u-boot* %{buildroot}%{_datadir}/%{name}/Odroid-M1/ cp -av builds/idbloader* %{buildroot}%{_datadir}/%{name}/Odroid-M1/ # see rkbin/RKBOOT/RK3568MINIALL.ini cp -av rkbin/rk356x_spl_loader_*.bin %{buildroot}%{_datadir}/%{name}/Odroid-M1/ #============================================================================= # files #----------------------------------------------------------------------------- %files %doc README README-Kwiboo-u-boot-build.md README-Collabora-upstream_uboot.md %{_datadir}/%{name}/Odroid-M1 #============================================================================= # changelog #----------------------------------------------------------------------------- %changelog * Sun Aug 10 2025 Patrick Laimbock - 2025.07-2 - build with ARM's BL31 * Sun Aug 10 2025 Patrick Laimbock - 2025.07-1 - update to u-boot version 2025.07 - sync with Fedora, add patches - build with Rockchip's BL31 as it seems to have some HDMI enablement code - add the RK3588 notes from Collabora * Wed Jul 24 2024 Patrick Laimbock - 2024.07-0.6 - disable arm-trusted BL31 again, hangs at boot * Wed Jul 24 2024 Patrick Laimbock - 2024.07-0.5 - build against RK3568 BL31 from arm-trusted-firmware-armv8 * Wed Jul 24 2024 Patrick Laimbock - 2024.07-0.4 - also use rkdeveloptool to create the SPL loader (it's open source) * Tue Jul 23 2024 Patrick Laimbock - 2024.07-0.3 - add the SPL loader rk356x_spl_loader_*.bin * Sun Jul 21 2024 Patrick Laimbock - 2024.07-0.2 - enable the bootmenu and preboot scans * Sun Jul 21 2024 Patrick Laimbock - 2024.07-0.1 - update to git rev 5024a96db8ea6ff2e814f4599af9e5faf09296b7 * Fri Jan 19 2024 Patrick Laimbock - 2024.01-2 - remove debian patch * Wed Jan 17 2024 Patrick Laimbock - 2024.01-1 - switch to rk35xx-2024.01 branch - update to git rev 583d37d192d92c5e92efa68b1d97f8ecdef71c47 - add rockchip-inno-usb.patch from debian - add Fedora patches * Tue Aug 22 2023 Patrick Laimbock - 2023.10-0.3 - update to git rev 84bcf08a3e2b9a67abfb7c980d7d606d0334cc5d * Tue Aug 08 2023 Patrick Laimbock - 2023.10-0.2 - add README-u-boot-build.md from https://github.com/Kwiboo/u-boot-build * Tue Aug 08 2023 Patrick Laimbock - 2023.10-0.1 - build Kwiboo's u-boot 2023.10 for the Odroid M1 - git rev 16cb31d42768767cfc1e274655e9bd1689c0de6d - rkbin git rev b4558da0860ca48bf1a571dd33ccba580b9abe23