temp/u-boot-librem5: upgrade to latest u-boot from purism (MR 2023)
Changes from purism: - 2 second boot delay removed - This includes an updated DDR memory training firmware version. - patch to work around wifi device not being available on boot Package changes: - u-boot installed in location consistent with other pmaports/u-boot packages - update-u-boot script added for upgrading u-boot on the device - devkit u-boot split off into a sep. subpackage
This commit is contained in:
parent
27c3de6c82
commit
d2014e2606
4 changed files with 185 additions and 17 deletions
|
@ -0,0 +1,29 @@
|
|||
From 08579a1a7c2a6897af952ef8dd5511b1f4830f88 Mon Sep 17 00:00:00 2001
|
||||
From: Angus Ainslie <angus@akkea.ca>
|
||||
Date: Mon, 8 Feb 2021 07:50:28 -0800
|
||||
Subject: [PATCH] board: purism: librem5: Enable WiFi SW kill switch
|
||||
|
||||
Due to probe ordering in the kernel the SW kill switch might not get enabled
|
||||
before the wifi driver is probed.
|
||||
|
||||
Signed-off-by: Angus Ainslie <angus@akkea.ca>
|
||||
---
|
||||
board/purism/librem5/librem5.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/board/purism/librem5/librem5.h b/board/purism/librem5/librem5.h
|
||||
index 461b1f7339..420b8d17b3 100644
|
||||
--- a/board/purism/librem5/librem5.h
|
||||
+++ b/board/purism/librem5/librem5.h
|
||||
@@ -138,6 +138,8 @@ static inline void init_pinmux(void)
|
||||
gpio_direction_output(WWAN_EN, 0);
|
||||
gpio_direction_output(WWAN_nRESET, 1);
|
||||
|
||||
+ gpio_direction_output(WIFI_EN, 1);
|
||||
+
|
||||
gpio_direction_output(HUB_EN, 0);
|
||||
gpio_direction_output(HUB_nRESET, 1);
|
||||
gpio_direction_output(SD_EN, 0);
|
||||
--
|
||||
2.26.2
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
# Forked from Alpine, so we can build it with Librem 5 phone support
|
||||
pkgname=u-boot-librem5
|
||||
pkgver=0.8
|
||||
pkgrel=1
|
||||
pkgver=0.9
|
||||
pkgrel=0
|
||||
# 'librem5' branch in atf repo
|
||||
_atfversion="92c2de12d36b31938ce940d5cac3c30a98665237"
|
||||
# 'librem5' branch in uboot repo
|
||||
_ubootversion="c6956b68d33fa08a17629cddceb00b93ce6d4d41"
|
||||
_ubootversion="e9f7caf70a5c4f468ba00392ad0ca0badecea20a"
|
||||
_m4version="a017421c340a69f2392086da93841244f78a03c5"
|
||||
_firmwareversion="8.8"
|
||||
_firmwareversion="8.10"
|
||||
pkgdesc="u-boot bootloader for the Purism Librem5 phone"
|
||||
url="http://www.denx.de/wiki/U-Boot/"
|
||||
arch="aarch64"
|
||||
|
@ -19,14 +19,29 @@ source="
|
|||
m4-${_m4version}.tar.gz::https://source.puri.sm/Librem5/Cortex_M4/-/archive/${_m4version}/Cortex_M4-${_m4version}.tar.gz
|
||||
arm-trusted-firmware-${_atfversion}.tar.gz::https://source.puri.sm/Librem5/arm-trusted-firmware/-/archive/${_atfversion}/arm-trusted-firmware-${_atfversion}.tar.gz
|
||||
https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-${_firmwareversion}.bin
|
||||
update-u-boot
|
||||
0001-board-purism-librem5-Enable-WiFi-SW-kill-switch.patch
|
||||
"
|
||||
install="$pkgname.post-upgrade"
|
||||
subpackages="$pkgname-devkit"
|
||||
|
||||
_ubootbuilddir="$srcdir"/uboot-imx-${_ubootversion}
|
||||
_atfbuilddir="$srcdir"/arm-trusted-firmware-${_atfversion}
|
||||
_m4builddir="$srcdir"/Cortex_M4-${_m4version}
|
||||
_firmwarebuilddir="$srcdir"/firmware-imx-${_firmwareversion}
|
||||
|
||||
builddir="$_ubootbuilddir"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
msg "Extracting DDR & HDMI firmware"
|
||||
cd "$srcdir"
|
||||
chmod +x firmware-imx-${_firmwareversion}.bin
|
||||
./firmware-imx-${_firmwareversion}.bin --auto-accept
|
||||
cp -v "$_firmwarebuilddir"/firmware/ddr/synopsys/lpddr4*.bin "$_ubootbuilddir"/
|
||||
cp -v "$_firmwarebuilddir"/firmware/hdmi/cadence/signed*.bin "$_ubootbuilddir"/
|
||||
}
|
||||
|
||||
build() {
|
||||
msg "Building M4"
|
||||
cd "$_m4builddir"
|
||||
|
@ -38,13 +53,6 @@ build() {
|
|||
# Overwrite default bl31 binary with one made here
|
||||
cp -v "$_atfbuilddir"/build/imx8mq/release/bl31.bin "$_ubootbuilddir"/
|
||||
|
||||
msg "Extracting DDR & HDMI firmware"
|
||||
cd "$srcdir"
|
||||
chmod +x firmware-imx-${_firmwareversion}.bin
|
||||
./firmware-imx-${_firmwareversion}.bin --auto-accept
|
||||
cp -v "$_firmwarebuilddir"/firmware/ddr/synopsys/lpddr4*.bin "$_ubootbuilddir"/
|
||||
cp -v "$_firmwarebuilddir"/firmware/hdmi/cadence/signed*.bin "$_ubootbuilddir"/
|
||||
|
||||
msg "Building u-boot"
|
||||
cd "$_ubootbuilddir"
|
||||
# Note: HOSTCC is set explicitly here else it tries to use cc, which
|
||||
|
@ -76,14 +84,24 @@ build() {
|
|||
}
|
||||
|
||||
package() {
|
||||
install -D -m644 "$_ubootbuilddir"/devkit-boot.img \
|
||||
"$pkgdir/usr/share/firmware/librem5/devkit-boot.img"
|
||||
install -D -m644 "$_ubootbuilddir"/phone-boot.img \
|
||||
"$pkgdir/usr/share/firmware/librem5/phone-boot.img"
|
||||
"$pkgdir/usr/share/u-boot/librem5/phone-boot.img"
|
||||
install -D -m 755 "$srcdir"/update-u-boot \
|
||||
"$pkgdir"/usr/sbin/update-u-boot
|
||||
}
|
||||
|
||||
devkit() {
|
||||
pkgdesc="u-boot bootloader for the Purism Librem5 devkit"
|
||||
install -D -m644 "$_ubootbuilddir"/devkit-boot.img \
|
||||
"$subpkgdir/usr/share/u-boot/librem5/devkit-boot.img"
|
||||
install -D -m 755 "$srcdir"/update-u-boot \
|
||||
"$subpkgdir"/usr/sbin/update-u-boot
|
||||
}
|
||||
|
||||
|
||||
sha512sums="ed4832f2ffacc1fa63cca361db32e1e8b267fe7e25d7e9c7d2e0ed5d4ac9f9db629e201bd1a77ac31e40a91aaf46f8aa52d3fdf48c2a03cf40cea24d7a0d41f8 uboot-imx-c6956b68d33fa08a17629cddceb00b93ce6d4d41.tar.gz
|
||||
sha512sums="feab35fae6450f24da54998b44b1d834bc33c9597ff8f9a4275e9ec7a1d1f442e133e51635eaabb9b759499728a0f70256d7bd6bc8bbeeb2133992f9c606d607 uboot-imx-e9f7caf70a5c4f468ba00392ad0ca0badecea20a.tar.gz
|
||||
035a4358ddf586c829da7fa2fb0d9d1df913c0c454f2d0e57ff0c6794552e49950fb6373f9aaf72e0e4c78ab411496aabbc60bf66cd76e35053f7a2d77911735 m4-a017421c340a69f2392086da93841244f78a03c5.tar.gz
|
||||
cd8c9411ae0e57d2c8c700bf3e8c8d03e7dab955ace249a00911dd8c42b42929e0de3a5885eb9b1d945174abc8cfb177595d83c235e757c70640f451b62547ba arm-trusted-firmware-92c2de12d36b31938ce940d5cac3c30a98665237.tar.gz
|
||||
309d3b8afd0884b055037396098f7eb938e4768604affc60e18b09e67596a593ccebe85ad130abf1e81a8fad257e5473152f259fa6cbb6d9730f6b3c11a3809d firmware-imx-8.8.bin"
|
||||
24d4466b3c2202ceb1c22be2b3db4482eee54d09e167083cc53e82cd9f22ef9ac0cba5a1a3341cacf8ee01adf014eb25f4aa437f35a43ac102dd2f22e935821b firmware-imx-8.10.bin
|
||||
1a98f50e572f3001bf5a37c037cf5649f9de5b6b3b0192c04ece51154f0eaec9b3bd625422cf1604f9c83e4c5d76fa980766380a214418610fab8234fd65d223 update-u-boot
|
||||
acec9f7fa5fb3f4e84c6f6f74794325d5d18ea4557ab98fd0915ba5e41748e338f94604815b2f6d595119359462b48d2ee285b2e4025282d3118051b601b23a1 0001-board-purism-librem5-Enable-WiFi-SW-kill-switch.patch"
|
||||
|
|
9
temp/u-boot-librem5/u-boot-librem5.post-upgrade
Normal file
9
temp/u-boot-librem5/u-boot-librem5.post-upgrade
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
cat 1>&2 <<EOF
|
||||
*
|
||||
* A new version of u-boot was installed.
|
||||
* For instructions on installing this update to your device, see:
|
||||
* https://wiki.postmarketos.org/wiki/Purism_Librem5_(purism-librem5)#U-boot_Updates
|
||||
*
|
||||
EOF
|
112
temp/u-boot-librem5/update-u-boot
Normal file
112
temp/u-boot-librem5/update-u-boot
Normal file
|
@ -0,0 +1,112 @@
|
|||
#!/bin/sh
|
||||
|
||||
board=
|
||||
device=
|
||||
dryrun=
|
||||
imagedir=
|
||||
|
||||
get_boot_blockdev() {
|
||||
# Find the blockdevice where /boot is mounted from
|
||||
mount | sed -n -E 's:.*(/dev/mmcblk\d)p\d on /boot .*:\1:p'
|
||||
}
|
||||
|
||||
get_defaults() {
|
||||
if [ -z "$board" ] && [ -e /sys/firmware/devicetree/base/compatible ]; then
|
||||
case "$(cat /sys/firmware/devicetree/base/compatible 2>/dev/null)" in
|
||||
purism,librem5r*) board=librem5;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -z "$device" ]; then
|
||||
case "$board" in
|
||||
librem5) device=/dev/mmcblk0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -z "$imagedir" ]; then
|
||||
imagedir="/usr/share/u-boot"
|
||||
fi
|
||||
}
|
||||
|
||||
die() {
|
||||
echo "ERROR: $@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage() {
|
||||
get_defaults
|
||||
|
||||
cat <<EOF
|
||||
usage: $0 [-n,--dry-run] [-i,--imagedir <imagedir>] [-b|--board <board-type>] [-d|--device <device>]
|
||||
|
||||
options:
|
||||
|
||||
-b,--board <board> Specify the board type: librem5
|
||||
(current default: ${board:-none})
|
||||
|
||||
-d,--device <device> Specify the device where to install u-boot
|
||||
(current default: ${device:-none})
|
||||
|
||||
-i,--imagedir <imagedir> Specify u-boot image directory
|
||||
(current default: ${imagedir:-none})
|
||||
|
||||
-n,--dry-run Print commands but don't execute them
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
opt="$1"
|
||||
shift
|
||||
case "$opt" in
|
||||
-b|--board)
|
||||
case "$1" in
|
||||
librem5) board="librem5" ;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
;;
|
||||
-d|--device)
|
||||
device="$1"
|
||||
shift
|
||||
;;
|
||||
-i|--imagedir)
|
||||
imagedir="$1"
|
||||
shift
|
||||
;;
|
||||
-n|--dry-run)
|
||||
dryrun="echo"
|
||||
;;
|
||||
--)
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
get_defaults
|
||||
if [ -z "$board" -o -z "$device" -o -z "$imagedir" -o ! -e "$imagedir" ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$dryrun" ]; then
|
||||
echo "Updating $board u-boot in $device in 3 seconds..."
|
||||
sleep 3
|
||||
fi
|
||||
|
||||
(
|
||||
set -e
|
||||
case "$board" in
|
||||
librem5)
|
||||
[ -e "$imagedir/librem5" ] || die "librem5 images not installed, apk add u-boot-librem5"
|
||||
$dryrun dd if=$imagedir/librem5/phone-boot.img of=$device bs=1k seek=2 status=none
|
||||
;;
|
||||
esac
|
||||
$dryrun sync
|
||||
) || die "U-Boot installation in $device failed"
|
||||
|
||||
[ -z "$dryrun" ] && echo "Completed successfully."
|
Loading…
Reference in a new issue