u-boot-amlogic: new aport (MR 4995)
Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
This commit is contained in:
parent
56ed24c1ee
commit
6c6a0bd9da
2 changed files with 241 additions and 0 deletions
126
device/testing/u-boot-amlogic/0001-add-x96-mini-support.patch
Normal file
126
device/testing/u-boot-amlogic/0001-add-x96-mini-support.patch
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
From 6a40398dee7a21df9da032aa2f8b6c5cc08453c0 Mon Sep 17 00:00:00 2001
|
||||
From: "@exkc" <exkc@exkc.moe>
|
||||
Date: Thu, 30 Mar 2023 19:58:52 +0800
|
||||
Subject: [PATCH] add x96-mini support
|
||||
|
||||
---
|
||||
arch/arm/dts/meson-gxl-s905w-x96-mini.dts | 38 ++++++++++++++
|
||||
configs/x96_mini_defconfig | 62 +++++++++++++++++++++++
|
||||
2 files changed, 100 insertions(+)
|
||||
create mode 100644 arch/arm/dts/meson-gxl-s905w-x96-mini.dts
|
||||
create mode 100644 configs/x96_mini_defconfig
|
||||
|
||||
diff --git a/arch/arm/dts/meson-gxl-s905w-x96-mini.dts b/arch/arm/dts/meson-gxl-s905w-x96-mini.dts
|
||||
new file mode 100644
|
||||
index 0000000000..bd69f88973
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/meson-gxl-s905w-x96-mini.dts
|
||||
@@ -0,0 +1,38 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+/*
|
||||
+ * Copyright (c) 2023 Karl Chan <exxxxkc@getgoogleoff.me>.
|
||||
+ * Based on meson-gxl-s905w-tx3-mini.dts:
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+
|
||||
+#include "meson-gxl-s905x.dtsi"
|
||||
+#include "meson-gx-p23x-q20x.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "amediatech,x96-mini", "amlogic,s905w", "amlogic,meson-gxl";
|
||||
+ model = "Shenzhen Amediatech Technology Co., X96 Mini";
|
||||
+
|
||||
+ memory@0 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x0 0x0 0x0 0x40000000>; /* 1 GiB or 2 GiB */
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led-0 {
|
||||
+ label = "x96-mini:blue:power";
|
||||
+ gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&usb {
|
||||
+ dr_mode = "host";
|
||||
+};
|
||||
diff --git a/configs/x96_mini_defconfig b/configs/x96_mini_defconfig
|
||||
new file mode 100644
|
||||
index 0000000000..5d88b83067
|
||||
--- /dev/null
|
||||
+++ b/configs/x96_mini_defconfig
|
||||
@@ -0,0 +1,62 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_ARCH_MESON=y
|
||||
+CONFIG_TEXT_BASE=0x01000000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20000000
|
||||
+CONFIG_ENV_SIZE=0x2000
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="meson-gxl-s905w-x96-mini"
|
||||
+CONFIG_DM_RESET=y
|
||||
+CONFIG_MESON_GXL=y
|
||||
+CONFIG_DEBUG_UART_BASE=0xc81004c0
|
||||
+CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
+CONFIG_IDENT_STRING=" x96-mini"
|
||||
+CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_REMAKE_ELF=y
|
||||
+CONFIG_OF_BOARD_SETUP=y
|
||||
+CONFIG_CONSOLE_MUX=y
|
||||
+# CONFIG_DISPLAY_CPUINFO is not set
|
||||
+CONFIG_MISC_INIT_R=y
|
||||
+CONFIG_SYS_MAXARGS=32
|
||||
+# CONFIG_CMD_BDI is not set
|
||||
+# CONFIG_CMD_IMI is not set
|
||||
+CONFIG_CMD_ADC=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+# CONFIG_CMD_LOADS is not set
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
+# CONFIG_CMD_SETEXPR is not set
|
||||
+CONFIG_CMD_REGULATOR=y
|
||||
+CONFIG_OF_CONTROL=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_SARADC_MESON=y
|
||||
+CONFIG_MMC_MESON_GX=y
|
||||
+CONFIG_PHY_MESON_GXL=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_DM_MDIO_MUX=y
|
||||
+CONFIG_ETH_DESIGNWARE_MESON8B=y
|
||||
+CONFIG_MDIO_MUX_MMIOREG=y
|
||||
+CONFIG_MESON_GXL_USB_PHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCTRL_MESON_GXL=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DEBUG_UART_ANNOUNCE=y
|
||||
+CONFIG_DEBUG_UART_SKIP_INIT=y
|
||||
+CONFIG_MESON_SERIAL=y
|
||||
+CONFIG_SYSINFO=y
|
||||
+CONFIG_SYSINFO_SMBIOS=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_DM_USB_GADGET=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_XHCI_DWC3=y
|
||||
+CONFIG_USB_DWC3=y
|
||||
+# CONFIG_USB_DWC3_GADGET is not set
|
||||
+CONFIG_USB_DWC3_MESON_GXL=y
|
||||
+CONFIG_USB_GADGET=y
|
||||
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e
|
||||
+CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
--
|
||||
2.39.2
|
||||
115
device/testing/u-boot-amlogic/APKBUILD
Normal file
115
device/testing/u-boot-amlogic/APKBUILD
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
# Reference: <https://u-boot.readthedocs.io/en/latest/board/amlogic>
|
||||
# Maintainer: Ferass El Hafidi <funderscore@postmarketos.org>
|
||||
# Co-Maintainer: exkc <exxxxkc@getgoogleoff.me>
|
||||
# Co-Maintainer: hexaheximal <hexaheximal@proton.me>
|
||||
pkgname=u-boot-amlogic
|
||||
pkgver=2024.04
|
||||
pkgrel=0
|
||||
pkgdesc="U-Boot bootloader for Amlogic AArch64-based devices"
|
||||
url="https://u-boot.org/"
|
||||
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
|
||||
crust
|
||||
dtc
|
||||
flex
|
||||
openssl-dev
|
||||
py3-setuptools
|
||||
python3-dev
|
||||
qemu-x86_64
|
||||
swig
|
||||
bash
|
||||
"
|
||||
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
|
||||
0001-add-x96-mini-support.patch
|
||||
amlogic-fip.tar.gz::https://github.com/LibreELEC/amlogic-boot-fip/archive/$_amlogicblob_commit.tar.gz
|
||||
"
|
||||
builddir="$srcdir/u-boot-v$pkgver"
|
||||
provides="u-boot=$pkgver-r$pkgrel"
|
||||
replaces="
|
||||
u-boot-amediatech-x96-mini
|
||||
u-boot-bananapi-bpi-cm4
|
||||
u-boot-beelink-gt1
|
||||
u-boot-librecomputer-lepotato
|
||||
u-boot-odroid-c4
|
||||
u-boot-odroid-n2plus
|
||||
u-boot-radxa-zero
|
||||
"
|
||||
_fip_builddir="$srcdir/amlogic-boot-fip-$_amlogicblob_commit"
|
||||
|
||||
# Format: <board>:<board u-boot defconfig>,<amlogic-boot-fip board files>
|
||||
_boards="
|
||||
amediatech-x96-mini:x96_mini,jethub-j80
|
||||
bananapi-bpi-cm4-cm4io:bananapi-cm4-cm4io,bananapi-cm4io
|
||||
beelink-gt1:beelink-gt1-ultimate,beelink-gt1
|
||||
librecomputer-lepotato:libretech-cc,lepotato
|
||||
odroid-c4:odroid-c4,odroid-c4
|
||||
odroid-n2plus:odroid-n2,odroid-n2-plus
|
||||
radxa-zero:radxa-zero,radxa-zero
|
||||
"
|
||||
|
||||
for board in $_boards; do
|
||||
_board_codename=${board%%:*}
|
||||
subpackages="$subpackages $pkgname-$_board_codename:${_board_codename//-/_}"
|
||||
done
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
}
|
||||
|
||||
build() {
|
||||
for board in $_boards; do
|
||||
local board_names=${board##*:} board_config board_codename="" board_fip_dir
|
||||
board_config=${board_names%%,*}
|
||||
board_codename=${board%%:*}
|
||||
board_fip_dir=${board##*,}
|
||||
|
||||
msg "Building U-Boot for $board_codename (config: $board_config, FIP: $board_fip_dir)"
|
||||
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 -j8 ${board_config}_defconfig all
|
||||
|
||||
msg "Building Amlogic firmware package for $board_codename (FIP: $board_fip_dir)"
|
||||
cd $_fip_builddir
|
||||
mkdir -p ./build
|
||||
./build-fip.sh $board_fip_dir $builddir/u-boot.bin ./build
|
||||
|
||||
cd ./build
|
||||
dd if=u-boot.bin.sd.bin of=u-boot-$board_codename.bin.sd-stripped.bin conv=fsync,notrunc bs=512 skip=1
|
||||
cd $builddir
|
||||
done
|
||||
}
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir"
|
||||
}
|
||||
|
||||
_board_package() {
|
||||
pkgdesc="U-Boot bootloader for Amlogic AArch64-based devices ($1)"
|
||||
depends="u-boot-amlogic"
|
||||
board_codename=$1
|
||||
board_fip_dir=$2
|
||||
mkdir -p "$subpkgdir/usr/share/u-boot/$board_codename/"
|
||||
install -D -m644 "$srcdir/amlogic-boot-fip-$_amlogicblob_commit/build/u-boot-$board_codename.bin.sd-stripped.bin" \
|
||||
"$subpkgdir/usr/share/u-boot/$board_codename/u-boot.bin.sd-stripped.bin"
|
||||
}
|
||||
|
||||
for board in $_boards; do
|
||||
_board_codename=${board%%:*}
|
||||
_board_fip_dir=${board##*,}
|
||||
eval "${_board_codename//-/_}() { _board_package $_board_codename $_board_fip_dir; }"
|
||||
done
|
||||
|
||||
sha512sums="
|
||||
be9b0176337fe9321ac244a16a17dfc1fb976b019de36c78d52149fe7c9d89d2907321be4c0c2faf0d47a4982212501f29063dbd01a005ce2c54e072159e0e3e u-boot-v2024.04.tar.gz
|
||||
415e81dedca92da59bb12025e64a02b14c8cd43c1a7d80b58e808db8f61402ecf396bf6c072c1cc18546254a5c88c9573c255c37496078a71c825abea87211be 0001-add-x96-mini-support.patch
|
||||
74c57daff859e7f449bd2743c7a8c0358b8dbe5d321ddb3a5b242b4d35683890d500d23e769490b1419a18bed233aea03ee11103bb4d646c502e4018283ba975 amlogic-fip.tar.gz
|
||||
"
|
||||
Loading…
Add table
Add a link
Reference in a new issue