diff --git a/device/testing/device-bananapi-bpi-cm4-cm4io/APKBUILD b/device/testing/device-bananapi-bpi-cm4-cm4io/APKBUILD new file mode 100644 index 000000000..449b4b4ca --- /dev/null +++ b/device/testing/device-bananapi-bpi-cm4-cm4io/APKBUILD @@ -0,0 +1,33 @@ +# Reference: +# Maintainer: Ferass El Hafidi +pkgname=device-bananapi-bpi-cm4-cm4io +pkgdesc="BananaPi BPI-CM4IO Baseboard with BPI-CM4" +pkgver=1 +pkgrel=0 +url="https://postmarketos.org" +license="MIT" +arch="aarch64" +options="!check !archcheck" +depends="postmarketos-base u-boot-bananapi-bpi-cm4 soc-amlogic-s905 linux-postmarketos-amlogic" +makedepends="devicepkg-dev" +subpackages="$pkgname-nonfree-firmware:nonfree_firmware" +source="deviceinfo modules-initfs" + +build() { + devicepkg_build $startdir $pkgname +} + +package() { + devicepkg_package $startdir $pkgname +} + +nonfree_firmware() { + pkgdesc="vdec firmware" + depends="linux-firmware-meson" + mkdir "$subpkgdir" +} + +sha512sums=" +86d5fa7949be1199361f76ba91704ff9d70f2a8cd68bf927bbded3b7592c1ada240762385c02320c42f763a8c92c4c1c578540655b3baf0e108b30f37b01fce6 deviceinfo +52948c2884a6f6384e12b7a598f70878526d0d3293c214425170145231144ec7de805c038641741a4a5d75b50e554f6a3fa3769784a674217ed032f9b6a233c8 modules-initfs +" diff --git a/device/testing/device-bananapi-bpi-cm4-cm4io/deviceinfo b/device/testing/device-bananapi-bpi-cm4-cm4io/deviceinfo new file mode 100644 index 000000000..c0d9fb257 --- /dev/null +++ b/device/testing/device-bananapi-bpi-cm4-cm4io/deviceinfo @@ -0,0 +1,31 @@ +# Reference: +# Please use double quotes only. You can source this file in shell +# scripts. + +deviceinfo_format_version="0" +deviceinfo_name="BananaPi BPI-CM4IO Baseboard with BPI-CM4" +deviceinfo_manufacturer="BananaPi" +deviceinfo_codename="bananapi-bpi-cm4-cm4io" +deviceinfo_dtb="amlogic/meson-g12b-bananapi-cm4-cm4io" +deviceinfo_year="2023" +deviceinfo_arch="aarch64" +deviceinfo_disable_dhcpd="true" +deviceinfo_partition_type="msdos" + +# Device related +deviceinfo_gpu_accelerated="true" +deviceinfo_chassis="desktop" +deviceinfo_keyboard="true" +deviceinfo_external_storage="true" +deviceinfo_screen_width="1920" +deviceinfo_screen_height="1080" + +# Bootloader related +deviceinfo_flash_method="none" +deviceinfo_sd_embed_firmware_step_size="512" +deviceinfo_sd_embed_firmware="u-boot/bananapi-bpi-cm4/u-boot.bin.sd-stripped.bin:1" +deviceinfo_boot_part_start="4096" +deviceinfo_generate_extlinux_config="true" +# Kernel options +deviceinfo_kernel_cmdline="quiet loglevel=2" + diff --git a/device/testing/device-bananapi-bpi-cm4-cm4io/modules-initfs b/device/testing/device-bananapi-bpi-cm4-cm4io/modules-initfs new file mode 100644 index 000000000..da28a74ff --- /dev/null +++ b/device/testing/device-bananapi-bpi-cm4-cm4io/modules-initfs @@ -0,0 +1,3 @@ +meson_drm +meson_dw_hdmi +display_connector diff --git a/device/testing/u-boot-bananapi-bpi-cm4/APKBUILD b/device/testing/u-boot-bananapi-bpi-cm4/APKBUILD new file mode 100644 index 000000000..b009803ba --- /dev/null +++ b/device/testing/u-boot-bananapi-bpi-cm4/APKBUILD @@ -0,0 +1,61 @@ +# Reference: +# Maintainer: Ferass El Hafidi +pkgname=u-boot-bananapi-bpi-cm4 +pkgver=2024.04 +pkgrel=0 +pkgdesc="U-Boot bootloader for BananaPi BPI-CM4" +url="https://source.denx.de/u-boot" +arch="aarch64" +license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs + ISC LGPL-2.0-only LGPL-2.1-only X11 proprietary" +makedepends="$depends_dev + bc + bison + dtc + flex + openssl-dev + py3-setuptools + python3-dev + swig + bash + qemu-x86_64 + " +options="!check" +# https://u-boot.readthedocs.io/en/latest/board/amlogic/pre-generated-fip.html +_amlogicblob_commit="8599bc77b17f38e69275f6145acc5792faab735e" + +source=" + https://source.denx.de/u-boot/u-boot/-/archive/v$pkgver/u-boot-v$pkgver.tar.gz + amlogicblobs-$_amlogicblob_commit.tar.gz::https://github.com/LibreELEC/amlogic-boot-fip/archive/$_amlogicblob_commit.tar.gz +" +builddir="$srcdir/u-boot-v$pkgver" +_fipbuilddir="$srcdir/amlogic-boot-fip-$_amlogicblob_commit" + +build() { + touch include/config.h + LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h + LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h + + make bananapi-cm4-cm4io_defconfig + make all + cd $_fipbuilddir + mkdir build + ./build-fip.sh bananapi-cm4io $builddir/u-boot.bin ./build + cd ./build + dd if=u-boot.bin.sd.bin of=u-boot.bin.sd-stripped.bin conv=fsync,notrunc bs=512 skip=1 +} + +package() { + _installdir="$pkgdir/usr/share/u-boot/bananapi-bpi-cm4" + install -Dm644 "$_fipbuilddir/build/u-boot.bin.sd-stripped.bin" -t "$_installdir" + install -Dm644 "$_fipbuilddir/build/u-boot.bin.sd.bin" -t "$_installdir" + install -Dm644 "$_fipbuilddir/build/u-boot.bin" -t "$_installdir" + install -Dm644 "$_fipbuilddir/build/u-boot.bin.usb.bl2" -t "$_installdir" + install -Dm644 "$_fipbuilddir/build/u-boot.bin.usb.tpl" -t "$_installdir" +} + + +sha512sums=" +be9b0176337fe9321ac244a16a17dfc1fb976b019de36c78d52149fe7c9d89d2907321be4c0c2faf0d47a4982212501f29063dbd01a005ce2c54e072159e0e3e u-boot-v2024.04.tar.gz +74c57daff859e7f449bd2743c7a8c0358b8dbe5d321ddb3a5b242b4d35683890d500d23e769490b1419a18bed233aea03ee11103bb4d646c502e4018283ba975 amlogicblobs-8599bc77b17f38e69275f6145acc5792faab735e.tar.gz +"