From 6823b80abee6ef7373fc84a667be8ad70efdffcb Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Tue, 21 Apr 2020 02:55:39 -0700 Subject: [PATCH 1/2] New Package: atf-rk3399-bl31-2.3. --- srcpkgs/atf-rk3399-bl31/template | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 srcpkgs/atf-rk3399-bl31/template diff --git a/srcpkgs/atf-rk3399-bl31/template b/srcpkgs/atf-rk3399-bl31/template new file mode 100644 index 00000000000..58e3c24209a --- /dev/null +++ b/srcpkgs/atf-rk3399-bl31/template @@ -0,0 +1,27 @@ +# Template file for 'atf-rk3399-bl31' +pkgname=atf-rk3399-bl31 +version=2.3 +revision=1 +archs="aarch64*" +wrksrc="trusted-firmware-a-${version}" +hostmakedepends="cross-arm-none-eabi" +short_desc="ARM Trusted Firmware for Rockchip rk3399 boards (ARMv8, bl31 option)" +maintainer="Cameron Nemo " +license="BSD-3-Clause" +homepage="https://developer.trustedfirmware.org/dashboard/view/6/" +distfiles="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-${version}.tar.gz" +checksum=37f917922bcef181164908c470a2f941006791c0113d738c498d39d95d543b21 +nostrip=yes + +do_build() { + unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS + if [ "$CROSS_BUILD" ]; then + export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}- + fi + make ${makejobs} PLAT=rk3399 bl31 +} + +do_install() { + vinstall build/rk3399/release/bl31/bl31.elf 0755 usr/lib/trusted-firmware-a/rk3399 + vlicense docs/license.rst +} From 0207127ebe355df2c2da089defe0a87d107c76dd Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Tue, 21 Apr 2020 02:55:45 -0700 Subject: [PATCH 2/2] pinebookpro-uboot: use upstream release Switch from forked repo to upstream repo. Also use the atf-rk3399-bl31 package for ARM trusted firmware blob. --- .../patches/sdcard-boot.patch | 32 ++++++++++++ srcpkgs/pinebookpro-uboot/template | 49 +++++-------------- 2 files changed, 44 insertions(+), 37 deletions(-) create mode 100644 srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch diff --git a/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch new file mode 100644 index 00000000000..fb4ce822ae4 --- /dev/null +++ b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch @@ -0,0 +1,32 @@ +diff --git configs/pinebook-pro-rk3399_defconfig configs/pinebook-pro-rk3399_defconfig +index 9a7487b0..59c83396 100644 +--- configs/pinebook-pro-rk3399_defconfig ++++ configs/pinebook-pro-rk3399_defconfig +@@ -11,7 +11,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI_SUPPORT=y + CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" + CONFIG_DEBUG_UART=y +-CONFIG_BOOTDELAY=3 ++CONFIG_BOOTDELAY=1 + CONFIG_USE_PREBOOT=y + CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" + CONFIG_MISC_INIT_R=y +diff --git include/configs/pinebook-pro-rk3399.h include/configs/pinebook-pro-rk3399.h +index d478b199..59780bfb 100644 +--- include/configs/pinebook-pro-rk3399.h ++++ include/configs/pinebook-pro-rk3399.h +@@ -14,6 +14,14 @@ + + #include + ++/* On Pinebook Pro, mmc1 is SD and mmc0 is eMMC */ ++#if CONFIG_IS_ENABLED(CMD_MMC) ++ #undef BOOT_TARGET_MMC ++ #define BOOT_TARGET_MMC(func) \ ++ func(MMC, mmc, 1) \ ++ func(MMC, mmc, 0) ++#endif ++ + #define SDRAM_BANK_SIZE (2UL << 30) + + #define CONFIG_USB_OHCI_NEW diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template index 7df07bb9a71..4d472d5637d 100644 --- a/srcpkgs/pinebookpro-uboot/template +++ b/srcpkgs/pinebookpro-uboot/template @@ -1,38 +1,22 @@ # Template file for 'pinebookpro-uboot' pkgname=pinebookpro-uboot reverts="20200212_1 20200212_2" -version=0.0.20200212 -revision=3 -_commit_uboot=365495a329c8e92ca4c134562d091df71b75845e -_commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2 +version=2020.07 +revision=1 archs="aarch64*" -hostmakedepends="git flex cross-arm-none-eabi dtc python3 bc" -depends="u-boot-tools" +wrksrc="u-boot-${version}" +hostmakedepends="flex bc dtc python3" +makedepends="atf-rk3399-bl31" short_desc="U-Boot for Pinebook Pro" maintainer="Renato Aguiar " license="GPL-2.0-only, BSD-3-Clause" -homepage="https://git.eno.space/pbp-uboot" - -do_fetch() { - mkdir -p "${wrksrc}" - - cd "${wrksrc}" - git clone https://git.eno.space/pbp-uboot.git - cd pbp-uboot - git reset --hard ${_commit_uboot} - - cd "${wrksrc}" - git clone https://github.com/ARM-software/arm-trusted-firmware.git - cd arm-trusted-firmware - git reset --hard ${_commit_atf} -} +homepage="https://www.denx.de/wiki/U-Boot/" +distfiles="ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2" +checksum=c1f5bf9ee6bb6e648edbf19ce2ca9452f614b08a9f886f1a566aa42e8cf05f6a do_configure() { unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS - - cd pbp-uboot - make ${makejobs} pinebook_pro-rk3399_defconfig - echo 'CONFIG_IDENT_STRING=" Voidlinux"' >> .config + make ${makejobs} pinebook-pro-rk3399_defconfig } do_build() { @@ -40,22 +24,13 @@ do_build() { if [ "$CROSS_BUILD" ]; then export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}- fi - - cd arm-trusted-firmware - make ${makejobs} PLAT=rk3399 - - cd ../pbp-uboot make ${makejobs} EXTRAVERSION=-${revision} \ - BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf + BL31="${XBPS_CROSS_BASE}/usr/lib/trusted-firmware-a/rk3399/bl31.elf" } do_install() { - cd pbp-uboot - vmkdir boot - vinstall idbloader.img 0644 boot - vinstall u-boot.itb 0644 boot - vinstall "${FILESDIR}/kernel.d/uboot" 750 \ - etc/kernel.d/post-install 60-uboot + vinstall idbloader.img 0644 usr/lib/pinebookpro-uboot + vinstall u-boot.itb 0644 usr/lib/pinebookpro-uboot vlicense Licenses/Exceptions vlicense Licenses/OFL.txt