odroid-c4: new device (MR 5949)

This commit is contained in:
hexaheximal
2024-12-27 21:58:02 +09:00
committed by Robert Eckelmann
parent 1eab02a18d
commit 501db74b86
4 changed files with 136 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: hexaheximal <hexaheximal@proton.me>
pkgname=device-odroid-c4
pkgdesc="ODROID C4"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base u-boot-odroid-c4 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="ODROID C4 firmware"
depends="linux-firmware-meson"
mkdir "$subpkgdir"
}
sha512sums="
1468be3d14b10ceed3921fb4f76fa147ea83b31d0c70d25537deae8717503adf2ceb9c792ec1417fa3d4712d3855c191934699c3e7a736f1fe09eb6de58563e5 deviceinfo
b9f3e1902c17909de928c99868265a257ba5873f6ea6aa1097ad10721f59d68342d50ee51992472ecd23722f7664a13dd15f4e26071a40595c7c3e5161e533d7 modules-initfs
"
@@ -0,0 +1,31 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Hardkernel ODROID C4"
deviceinfo_manufacturer="Hardkernel"
deviceinfo_codename="odroid-c4"
deviceinfo_dtb="amlogic/meson-sm1-odroid-c4"
deviceinfo_year="2020"
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/odroid-c4/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"
@@ -0,0 +1,12 @@
fixed
meson_gxbb_wdt
meson_wdt
meson-gx-mmc
dw_hdmi
drm_display_helper
cec
display_connector
drm_kms_helper
drm
meson_drm
meson_dw_hdmi
+60
View File
@@ -0,0 +1,60 @@
# Reference: <https://u-boot.readthedocs.io/en/latest/board/amlogic/radxa-zero.html>
# Maintainer: hexaheximal <hexaheximal@proton.me>
pkgname=u-boot-odroid-c4
pkgver=2024.04
pkgrel=0
pkgdesc="U-Boot bootloader for ODROID C4"
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 odroid-c4_defconfig
make all
cd $_fipbuilddir
mkdir build
./build-fip.sh odroid-c4 $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/odroid-c4"
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
"