temp/u-boot-pinephone: build with 3 RAM clocks (MR 1998)
U-Boot package will be built and packaged with tree different images, each with a custom RAM clock. Supported clocks: 528, 552 and 624
This commit is contained in:
parent
4e4230093c
commit
5322350898
6 changed files with 66 additions and 26 deletions
|
@ -4,7 +4,7 @@
|
|||
pkgname=device-pine64-pinetab
|
||||
pkgdesc="PINE64 PineTab"
|
||||
pkgver=0.7
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
|
@ -144,7 +144,7 @@ plasma_mobile() {
|
|||
}
|
||||
|
||||
sha512sums="8d1ef04911f1cfa7eda8185f4f4d807af23105a7c8f23d8c18f02afeccd8ab124de70c2e2760c154a3128fe3793447039fb0abf37aa496f597d27051e275033e 99-pinetab-keyboard.hwdb
|
||||
b04bf42ac8d474320576f0187db6b6a082a4c32c69195f64d7b421583d3d763ae8bc8d9e436d2d4140b580ebef8df980224b6822c70e46eb4114a1527eeb192d deviceinfo
|
||||
61600cca656bcc64936e32f0fd85e7ffde331ac8437bfd782de638e5e1875f28735877c8fe25943fa658f3ebfbdc5250904a1660fac6f7a2a25a7a6f6a033177 deviceinfo
|
||||
6bc22b369b2d9058b702ac7a7862abaefaf8179b43491868bdb008d181b59104f1ded89db1da51a810e1ccdc803a579b924a438674283a65afc3a9c4d2894caf kirigami-lowpower.sh
|
||||
38827d9636c48b133eb333764a6799a6e93454e01ecb0cfde1ecad3ee149606ba59eb1a5e6c8366e3b3891e54bd664a0a5acdd89d38ac3a3551260e9b9a6d3fc rootston.ini
|
||||
9e71c61bfa72b60e749c4dc04f17eb59d25de822765e81e65c937d6be5236d3951a652b69a1ab973abe6add9f34705be5dbaa98bbfa25daf7504dd50b28524c2 sway.conf
|
||||
|
|
|
@ -26,7 +26,7 @@ deviceinfo_dev_internal_storage_repartition="true"
|
|||
# Bootloader related
|
||||
deviceinfo_flash_method="none"
|
||||
deviceinfo_generate_legacy_uboot_initfs="true"
|
||||
deviceinfo_sd_embed_firmware="u-boot/pine64-pinephone/u-boot-sunxi-with-spl.bin:8"
|
||||
deviceinfo_sd_embed_firmware="u-boot/pine64-pinephone/u-boot-sunxi-with-spl-552.bin:8"
|
||||
|
||||
# USB related
|
||||
deviceinfo_usb_idVendor="0x1f3a" # Allwinner Technology Co., Ltd.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Co-Maintainer: Bart Ribbers <bribbers@disroot.org>
|
||||
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
|
||||
pkgname=device-pine64-pinephone
|
||||
pkgver=0.24
|
||||
pkgver=0.25
|
||||
pkgrel=0
|
||||
pkgdesc="PINE64 PinePhone"
|
||||
url="https://postmarketos.org"
|
||||
|
@ -162,7 +162,7 @@ b53cc6f2531854cc9c1e4c334185a20551d64c8675ee8a8eaa03b99d80808fad421a0f6e99e5be21
|
|||
9170da7ac869254644f2fc8d914102f2c16e917dbeb53e33b96c76936711d0540f55fa5c2526d73d5fe244500bc2728bc9d629e2524cf52c573d11e833aee666 60-flashlight.rules
|
||||
8b6fa7b12c15f439c561901f3ffe24a1ef2a0c343401c0a79281060854ab29e08a1fb5e7adae8684b12aa9f535ed99e2dad993dce9724822cb0fbf2497dd86e5 70-wifi-pm.rules
|
||||
7dc2b7c20b4a2b15f597a6417bd01797643dad84a3683b0dee648e030fb6326e9d020307643fdcdf1bb43fc44af9975697e417003bd359610bae2d8ce614fc00 90-modem-eg25.rules
|
||||
25cbbda91ea93e1bfe4b1f05d2f50c68e0c23d6392b1c9f437ccb8bf131cb16f7600b42bf3549ccf33aae83432f49c6547c1551c1745f3203961e36100a18a17 deviceinfo
|
||||
5add558e0683cd6fb946121bfa9b1fafdc6a1263cac8f0cc00ff61eb8e6c84ca8584725d7e9f1e9f262c68c26c47bbbe93986d56503366cf1e6e803444615908 deviceinfo
|
||||
ccbc83b84b5028bc2c8e526759004ce71b50b2675ecffee98f5676c70a3332197a231ff9d2fd46444dd3c0a637ec08ce6125b18240fe6bfc13f624a15192e648 gpsd_device-hook.sh
|
||||
1017fc3f325227da58c77abdc59e9735288d91a7ccc63ec784fe0241c523786b617a11ce8045dab2a74ca12a7dd70aaa334af91836418db1e96a3266fecaa4fd gpsd_pinephone.initd
|
||||
3dd6d612c381cb0002049d1974d8fb5aa5a53a1eb4d6bcbf62eb2ad52cfdc45f0f6ad24a699716d3513b0371aa1316f25dc72afc10d7176cc3b99d0965c3f030 hwtest.ini
|
||||
|
@ -173,7 +173,7 @@ f9386dfd902028988c9659bd6e001ba46ea87b35f5dce7723dd4cfbe971928c75f6fef9d706201d6
|
|||
cf7d4a611701745762f19746e40d87b6df14a6b24f2d466c4177b7ab5ee87a048bab719a6c66722198020e1aa73d3e12d3715b5588bc33bf207f3e86040dcc44 eg25-pinephone-1.1.toml
|
||||
8adeca98002ff8ee850512f72f2e126348cfa817a1aefdd77d103aee76a6b2e6a024deffcbeef1235ee2fcc766003f55b67cedb3eb06ca92a58d5b81f2bf6848 eg25-pinephone-1.2.toml
|
||||
f4b5509fd6a8b23f3667f5e7262b3a19c607a37cb9eaf7d0e93eb826d45c26ec12df4810879bacb8e4042bb83cc80b2b436224c8d47b6d67361369a724bbf7ee sysrq.conf
|
||||
b20d4fb9f08a1bbc1c12ce6940e438a00f5c8d400fbc5071e951ffc69f77d2421204472e86f1a7df0488d250f3ec16205b75d4eac8c3cb5521fe9a02ea24865a uboot-script.cmd
|
||||
9d4bcc02c6c501b3a205516c8f276ef4293d88edea61ac725887ec28f9f6788320e9f9edd7f1cf29bbf6122acfad2ef5b3ad5e4b33763fe867bd23d2ac17ed5c uboot-script.cmd
|
||||
de88fc198c11637d9c6465f8a6fb4deab3d0802bdb52ffaa9a08833aa0ef63689b674b12b44cb314f3870d9d21fc3ae55f8db03c9a838860301be60a88e48835 HiFi.conf
|
||||
e852b48a687f9b2a0eca444aa3d00a1818aead9f5e5d28e070b51c9d6f8ec648e66f1d88e2bfa94d74533f9ffb9aacc1703da2a06693f85fa04ff97fd7528012 PinePhone.conf
|
||||
6c6ffd481a1ac66864f2c713ac4c16c8e112e49a6bc2ff3bb0d492426504cad0e953275a8ed13f247ef8c95bdd1814d9aea934ff76bb4dfada6b1b7b2eedea19 VoiceCall.conf"
|
||||
|
|
|
@ -25,5 +25,5 @@ deviceinfo_dev_internal_storage_repartition="true"
|
|||
# Bootloader related
|
||||
deviceinfo_flash_method="none"
|
||||
deviceinfo_generate_legacy_uboot_initfs="true"
|
||||
deviceinfo_sd_embed_firmware="u-boot/pine64-pinephone/u-boot-sunxi-with-spl.bin:8"
|
||||
deviceinfo_sd_embed_firmware="u-boot/pine64-pinephone/u-boot-sunxi-with-spl-552.bin:8"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# U-boot with patches to make the PinePhone boot faster and have control over the ddr clock speed
|
||||
pkgname=u-boot-pinephone
|
||||
pkgver=2021.01_git20201228
|
||||
pkgrel=0
|
||||
pkgrel=1
|
||||
# Last commit from "crust" branch, as used in "crust-meta":
|
||||
# https://gitlab.com/pine64-org/crust-meta/-/blob/8886bcc829179bf77216fade71f0ede9bd014e67/Makefile#L78
|
||||
_commit="7492749fec31b1086bc8933bf113a766aea021aa"
|
||||
|
@ -17,6 +17,8 @@ source="https://gitlab.com/pine64-org/u-boot/-/archive/$_commit/u-boot-$_commit.
|
|||
"
|
||||
builddir="$srcdir/u-boot-$_commit"
|
||||
|
||||
frequencies='528 552 624'
|
||||
|
||||
build() {
|
||||
touch include/config.h
|
||||
LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h
|
||||
|
@ -25,26 +27,23 @@ build() {
|
|||
export BL31="/usr/share/arm-trusted-firmware-sun50i/bl31.bin"
|
||||
export SCP="/usr/share/crust/pinephone/scp.bin"
|
||||
export BUILD_DIR="$builddir"/build
|
||||
mkdir -p "$BUILD_DIR"
|
||||
make O="$BUILD_DIR" HOSTCC=gcc ARCH=arm pinephone_defconfig
|
||||
make O="$BUILD_DIR" HOSTCC=gcc ARCH=arm all
|
||||
}
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
if ! grep -q "CONFIG_DRAM_CLK=552" configs/pinephone_defconfig; then
|
||||
error "CONFIG_DRAM_CLK must be 552!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
for freq in $frequencies; do
|
||||
mkdir -p "$BUILD_DIR-$freq"
|
||||
sed -rie "s/^(CONFIG_DRAM_CLK=).*$/CONFIG_DRAM_CLK=$freq/" configs/pinephone_defconfig
|
||||
cat configs/pinephone_defconfig | grep CONFIG_DRAM_CLK
|
||||
make O="$BUILD_DIR-$freq" HOSTCC=gcc ARCH=arm pinephone_defconfig
|
||||
make O="$BUILD_DIR-$freq" HOSTCC=gcc ARCH=arm all
|
||||
done
|
||||
}
|
||||
|
||||
package() {
|
||||
cd build
|
||||
install -D -m644 "u-boot-sunxi-with-spl.bin" \
|
||||
"$pkgdir"/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl.bin
|
||||
for freq in $frequencies; do
|
||||
install -D -m644 "build-$freq/u-boot-sunxi-with-spl.bin" \
|
||||
"$pkgdir"/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl-$freq.bin
|
||||
done
|
||||
install -D -m 755 "$srcdir"/update-u-boot "$pkgdir"/usr/sbin/update-u-boot
|
||||
}
|
||||
|
||||
sha512sums="73b132cdc26113a83d060f0d243320ca989b4efa98fe95a2205526a42f615ced7046bb9d4878c67a9a550b04c2519d90be3c2272be97c878d759bf5d027cf536 u-boot-7492749fec31b1086bc8933bf113a766aea021aa.tar.gz
|
||||
4a3a1772a7309d44e7977dee4aca499d5c79675d99cda1395d8765abb415b8456260c7a989650f0bd2dfda0377af2346917fbcbf3e356a36265ed07e161ddc3b update-u-boot"
|
||||
f45b86839992472f2264d3651b28ef7ebe84c77c00fb557db1b381e48350f9687eac1555be8f0c6b1dc5a62299f06010208c73daa9422d58c344ba6bb8c7e22a update-u-boot"
|
||||
|
|
|
@ -5,6 +5,8 @@ board=
|
|||
device=
|
||||
dryrun=
|
||||
imagedir=
|
||||
default_freq=552
|
||||
freq=
|
||||
|
||||
get_boot_blockdev() {
|
||||
# Find the blockdevice where /boot is mounted from
|
||||
|
@ -34,6 +36,15 @@ get_defaults() {
|
|||
imagedir="$(realpath $(dirname $0))"
|
||||
[ -f "$imagedir/README.txt" ] || imagedir="/usr/share/u-boot"
|
||||
fi
|
||||
|
||||
if [ -z "$freq" -a -e /proc/device-tree/memory/ram_freq ]; then
|
||||
freq=$(cat /proc/device-tree/memory/ram_freq 2>/dev/null)
|
||||
echo Detected custom clock: $freq MHz
|
||||
elif [ -z "$freq" ]; then
|
||||
echo Using default clock: $default_freq MHz
|
||||
else
|
||||
echo Changing clock: $freq MHz
|
||||
fi
|
||||
}
|
||||
|
||||
die() {
|
||||
|
@ -45,7 +56,7 @@ usage() {
|
|||
get_defaults
|
||||
|
||||
cat <<EOF
|
||||
usage: $0 [-n,--dry-run] [-i,--imagedir <imagedir>] [-b|--board <board-type>] [-d|--device <device>]
|
||||
usage: $0 [-n,--dry-run] [-i,--imagedir <imagedir>] [-b|--board <board-type>] [-d|--device <device>] [-r|--ram-freq <freq>]
|
||||
|
||||
options:
|
||||
|
||||
|
@ -60,6 +71,11 @@ options:
|
|||
|
||||
-n,--dry-run Print commands but don't execute them
|
||||
|
||||
-r,--ram-freq RAM clock speed, one of:
|
||||
* 528 (default for new postmarketOS installations)
|
||||
* 552 (default before v21.03 / edge 2021-04-05)
|
||||
* 624
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
|
@ -90,6 +106,15 @@ while [ $# -gt 0 ]; do
|
|||
-n|--dry-run)
|
||||
dryrun="echo"
|
||||
;;
|
||||
-r|--ram-freq)
|
||||
case "$1" in
|
||||
528) freq="528" ;;
|
||||
552) freq="552" ;;
|
||||
624) freq="624" ;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
break
|
||||
;;
|
||||
|
@ -107,6 +132,22 @@ if [ -z "$board" -o -z "$device" -o -z "$imagedir" -o ! -e "$imagedir" ]; then
|
|||
fi
|
||||
|
||||
if [ -z "$dryrun" ]; then
|
||||
if [ ! -z "$freq" ]; then
|
||||
echo "/!\ Disclaimer warning:"
|
||||
echo "Overclocking your device may render it unstable or prevent it to boot"
|
||||
echo "If you're unable to boot your device you'll have to flash an image to a mSD card"
|
||||
echo "then boot on it and update u-boot running this command:"
|
||||
echo "update-u-boot -d /dev/mmcblk2"
|
||||
echo
|
||||
read -p "Continue? [y/Y] " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
freq=$default_freq
|
||||
fi
|
||||
echo "Updating $board u-boot in $device in 3 seconds..."
|
||||
sleep 3
|
||||
fi
|
||||
|
@ -134,7 +175,7 @@ pinebookpro|rockpro64)
|
|||
;;
|
||||
pinephone)
|
||||
[ -e "$imagedir/pine64-pinephone/" ] || die "pinephone images not installed, apk add u-boot-pinephone"
|
||||
$dryrun dd if=$imagedir/pine64-pinephone/u-boot-sunxi-with-spl.bin of=$device bs=1024 seek=8 status=none
|
||||
$dryrun dd if=$imagedir/pine64-pinephone/u-boot-sunxi-with-spl-$freq.bin of=$device bs=1024 seek=8 status=none
|
||||
;;
|
||||
esac
|
||||
$dryrun sync
|
||||
|
|
Loading…
Add table
Reference in a new issue