Compare commits
3
Commits
main
...
drop-pp-u-boot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50f78961c5 | ||
|
|
48bb4c6b2f | ||
|
|
97475c024a |
No files matched your search
@@ -4,13 +4,14 @@
|
||||
# Co-Maintainer: Luca Weiss <luca@z3ntu.xyz>
|
||||
# Co-Maintainer: Dylan Van Assche <me@dylanvanassche.be>
|
||||
pkgname=device-pine64-pinephone
|
||||
pkgver=0.42
|
||||
pkgrel=3
|
||||
pkgver=0.44
|
||||
pkgrel=0
|
||||
pkgdesc="PINE64 PinePhone"
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
options="!check !archcheck"
|
||||
# pmb:strict is required for grub
|
||||
options="!check !archcheck pmb:strict"
|
||||
subpackages="
|
||||
$pkgname-gnome
|
||||
$pkgname-nonfree-firmware:nonfree_firmware
|
||||
@@ -39,7 +40,12 @@ depends="
|
||||
fwupd-plugin-modem_manager
|
||||
fwupd-plugin-upower
|
||||
"
|
||||
makedepends="devicepkg-dev dtc"
|
||||
makedepends="
|
||||
devicepkg-dev
|
||||
grub
|
||||
grub-efi
|
||||
dtc
|
||||
"
|
||||
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-upgrade"
|
||||
source="
|
||||
00_alsa_pinephone_dshare.conf
|
||||
@@ -51,6 +57,8 @@ source="
|
||||
90-modem-eg25.rules
|
||||
UPower.conf
|
||||
deviceinfo
|
||||
grub.cfg
|
||||
grub_early.cfg
|
||||
gpsd_device-hook.sh
|
||||
gpsd_pinephone.initd
|
||||
hwtest.ini
|
||||
@@ -73,6 +81,8 @@ provides="$pkgname-elogind=$pkgver-r$pkgrel"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
|
||||
# Legacy U-Boot script installs
|
||||
mkimage \
|
||||
-A arm \
|
||||
-O linux \
|
||||
@@ -83,7 +93,7 @@ build() {
|
||||
-n postmarketos \
|
||||
-d "$srcdir"/uboot-script.cmd \
|
||||
"$srcdir"/boot.scr
|
||||
# Build user U-boot script for vccq-mod
|
||||
# Build legacy user U-boot script for vccq-mod
|
||||
mkimage \
|
||||
-A arm \
|
||||
-O linux \
|
||||
@@ -94,6 +104,36 @@ build() {
|
||||
-n postmarketos-user \
|
||||
-d "$srcdir"/uboot-user.cmd \
|
||||
"$srcdir"/user.scr
|
||||
|
||||
# UEFI installs
|
||||
grub-mkimage \
|
||||
--config="$srcdir/grub_early.cfg" \
|
||||
--prefix="" \
|
||||
--output="bootaa64.efi" \
|
||||
--format="arm64-efi" \
|
||||
--compression="xz" \
|
||||
\
|
||||
all_video \
|
||||
cat \
|
||||
configfile \
|
||||
disk \
|
||||
echo \
|
||||
efi_gop \
|
||||
fat \
|
||||
gzio \
|
||||
help \
|
||||
iso9660 \
|
||||
linux \
|
||||
ls \
|
||||
normal \
|
||||
part_gpt \
|
||||
part_msdos \
|
||||
search \
|
||||
search_label \
|
||||
test \
|
||||
true
|
||||
|
||||
|
||||
# Build Device Tree Overlay for vccq-mod
|
||||
dtc \
|
||||
-@ \
|
||||
@@ -108,10 +148,10 @@ package() {
|
||||
install -Dm644 "$srcdir"/boot.scr \
|
||||
"$pkgdir"/boot/boot.scr
|
||||
|
||||
# Make /boot/allwinner/sun50i-a64-pine64-pinephone*.dtb resolve to
|
||||
# /boot/sun50i-a64-pine64-pinephone*.dtb. This is because the device tree
|
||||
# names in u-boot include the vendor and the one in postmarketOS doesn't.
|
||||
ln -s .. "$pkgdir"/boot/allwinner
|
||||
install -Dm644 -t "$pkgdir"/boot/grub \
|
||||
"$srcdir"/grub.cfg
|
||||
install -Dm644 -t "$pkgdir"/boot/EFI/Boot \
|
||||
"$srcdir"/bootaa64.efi
|
||||
|
||||
install -Dm644 "$srcdir"/hwtest.ini \
|
||||
"$pkgdir"/usr/share/hwtest.ini
|
||||
@@ -199,6 +239,7 @@ vccq_mod() {
|
||||
pkgdesc="Install only if you have done the Vccq hardware mod https://postmarketos.org/pp-vccq-mod"
|
||||
install -Dm644 "$srcdir"/user.scr \
|
||||
"$subpkgdir"/boot/user.scr
|
||||
|
||||
install -Dm644 "$srcdir"/pinephone-vccq-mod.dtbo \
|
||||
"$subpkgdir"/boot/pinephone-vccq-mod.dtbo
|
||||
}
|
||||
@@ -218,7 +259,9 @@ bac664c504d9a3adc6e3d25f24ac63cf7c449a82374544a5b56c259dc25af580897b9dc992865ac8
|
||||
8b6fa7b12c15f439c561901f3ffe24a1ef2a0c343401c0a79281060854ab29e08a1fb5e7adae8684b12aa9f535ed99e2dad993dce9724822cb0fbf2497dd86e5 70-wifi-pm.rules
|
||||
9cb52e3c5d63dde68296f4c1f9b691629182f82181a7f0877a72aad6870698ea9e7d628309970afbcce01041274054d304de1ee3faf8c1d101f7f8e988a43098 90-modem-eg25.rules
|
||||
ed0e03f7e1c0348c06be9a7922414469245604ce813bbf0c8910ef211cb993bbb0d0d4615c9c961d50712415f85d6b73e0cf02780ac784666aac56e4889341e4 UPower.conf
|
||||
4a3e607a8e8249668195c472ba181149add65be515360b4d0f465b9c798e7bf8b2f2e431eb3e95cd8620c2a580779c665762f0386239b2fb2a64352e46702edb deviceinfo
|
||||
132ae4325455bcd872fda2ae65ba4eb8b838dc693630327471864048d754ed88b6f8529750bd7ee579ddd51e460ad2c4e8006cd06cdae6e5e153bb10056780a9 deviceinfo
|
||||
029ae9f2495c6fdac47e86a9d9d53dbb948d91a359437a94a97fb19996fc736a57ac074a2fc0f0e25ba80e2a3c195f88426f055860be68c2958fb184869ce04f grub.cfg
|
||||
0f9357d4eea089628fbceb1e3e96d21a3f4329aeb6743158a6f877f967ef274506404eba949d5f01b7e1adea149f9a3aef992a5e8cd4181f93ab00909b1c5ecd grub_early.cfg
|
||||
ccbc83b84b5028bc2c8e526759004ce71b50b2675ecffee98f5676c70a3332197a231ff9d2fd46444dd3c0a637ec08ce6125b18240fe6bfc13f624a15192e648 gpsd_device-hook.sh
|
||||
1017fc3f325227da58c77abdc59e9735288d91a7ccc63ec784fe0241c523786b617a11ce8045dab2a74ca12a7dd70aaa334af91836418db1e96a3266fecaa4fd gpsd_pinephone.initd
|
||||
3dd6d612c381cb0002049d1974d8fb5aa5a53a1eb4d6bcbf62eb2ad52cfdc45f0f6ad24a699716d3513b0371aa1316f25dc72afc10d7176cc3b99d0965c3f030 hwtest.ini
|
||||
|
||||
@@ -8,7 +8,7 @@ deviceinfo_codename="pine64-pinephone"
|
||||
deviceinfo_year="2019"
|
||||
deviceinfo_dtb="allwinner/sun50i-a64-pinephone-1.1 allwinner/sun50i-a64-pinephone-1.2"
|
||||
# gpio_vibra: needed for osk-sdl haptic feedback
|
||||
deviceinfo_modules_initfs="sun6i_mipi_dsi sun4i_drm pwm_sun4i sun8i_mixer anx7688 gpio_vibra pinephone_keyboard"
|
||||
deviceinfo_modules_initfs="sun6i_mipi_dsi sun4i_drm pwm_sun4i sun8i_mixer anx7688 gpio_vibra pinephone_keyboard vfat nls_cp437 nls_ascii"
|
||||
deviceinfo_arch="aarch64"
|
||||
|
||||
# Device related
|
||||
@@ -25,5 +25,5 @@ deviceinfo_dev_internal_storage_repartition="true"
|
||||
|
||||
# Bootloader related
|
||||
deviceinfo_flash_method="none"
|
||||
deviceinfo_sd_embed_firmware="u-boot/pine64-pinephone/u-boot-sunxi-with-spl-528.bin:8"
|
||||
|
||||
deviceinfo_boot_filesystem="fat32"
|
||||
deviceinfo_partition_type="gpt"
|
||||
@@ -0,0 +1,6 @@
|
||||
timeout=0
|
||||
|
||||
menuentry "postmarketOS" {
|
||||
linux ($root)/vmlinuz console=tty0 console=ttyS0,115200 earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1 PMOS_NO_OUTPUT_REDIRECT
|
||||
initrd ($root)/initramfs
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
search --no-floppy --set=root --label "pmOS_boot"
|
||||
set prefix=($root)/grub
|
||||
@@ -7,7 +7,7 @@ _flavor=postmarketos-allwinner
|
||||
_config="config-$_flavor.$CARCH"
|
||||
pkgname=linux-$_flavor
|
||||
pkgver=5.19.2_git20220818
|
||||
pkgrel=0
|
||||
pkgrel=1
|
||||
_tag="orange-pi-5.19-20220818-0237"
|
||||
pkgdesc="Kernel fork with Pine64 patches (megi's tree, slightly patched)"
|
||||
arch="aarch64 armv7"
|
||||
@@ -98,7 +98,7 @@ dev() {
|
||||
}
|
||||
sha512sums="
|
||||
f7aa9f2f9d481bcd553563c8e287756e112a3b0062c30673d2072ffcd5c47e4dca3640b467a52bfd6227721baca8a71aa703cb9a23b66c2de4c9f6ca773695d7 linux-postmarketos-allwinner-orange-pi-5.19-20220818-0237.tar.gz
|
||||
cb666fc2ec006095975e9d0fbd6b9de6035ec7366a3acd4d5e5520bc933e286e17dbbb9affdf4c453875e12bedc742014630e2f959462d27ce80ce7b1933f687 config-postmarketos-allwinner.aarch64
|
||||
e58269c583fc9c0606da11a1a183654ab0e1b3cbbcffcb8883a5b2d2cc02462baa083eecccb0bb588737b907bfa6c4f35d1859be00cccc78b289f26601a125b2 config-postmarketos-allwinner.aarch64
|
||||
c28dbb586c1f521e07b1dcbc60beeb4c773b60697b381faa5d3ba5623c9a315c2be00521fe337c321991954a8e4acc1d6ab8a83c67bb7d9382427a66d1f921ff config-postmarketos-allwinner.armv7
|
||||
126e0a65e04f22f14eac1281a69000d9d5b107ed8fd1b52f37e812751f55e6c45b0240ceac61c9d95ae7f0543aaf9d96b85a8532baf59283c077b9945e615367 0001-dts-add-dontbeevil-pinephone-devkit.patch
|
||||
1dc710f5abacdd5698169d5e985efeca8114986c774c3d65e89812d08ceb3db5ebdc6dd64dd76a262c761f3bfc3ffb6bc237fd5236bd1f89c5975d12e42eda04 0002-dts-add-pinetab-dev-old-display-panel.patch
|
||||
|
||||
@@ -7,9 +7,9 @@ CONFIG_CC_IS_GCC=y
|
||||
CONFIG_GCC_VERSION=120101
|
||||
CONFIG_CLANG_VERSION=0
|
||||
CONFIG_AS_IS_GNU=y
|
||||
CONFIG_AS_VERSION=23800
|
||||
CONFIG_AS_VERSION=23900
|
||||
CONFIG_LD_IS_BFD=y
|
||||
CONFIG_LD_VERSION=23800
|
||||
CONFIG_LD_VERSION=23900
|
||||
CONFIG_LLD_VERSION=0
|
||||
CONFIG_CC_HAS_ASM_GOTO=y
|
||||
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
|
||||
@@ -482,7 +482,9 @@ CONFIG_ARCH_NR_GPIO=0
|
||||
CONFIG_CMDLINE="console=ttyAMA0"
|
||||
CONFIG_CMDLINE_FROM_BOOTLOADER=y
|
||||
# CONFIG_CMDLINE_FORCE is not set
|
||||
# CONFIG_EFI is not set
|
||||
CONFIG_EFI_STUB=y
|
||||
CONFIG_EFI=y
|
||||
CONFIG_DMI=y
|
||||
# end of Boot options
|
||||
|
||||
#
|
||||
@@ -566,6 +568,8 @@ CONFIG_ARM_SCPI_CPUFREQ=y
|
||||
# end of CPU Frequency scaling
|
||||
# end of CPU Power Management
|
||||
|
||||
CONFIG_ARCH_SUPPORTS_ACPI=y
|
||||
# CONFIG_ACPI is not set
|
||||
CONFIG_HAVE_KVM=y
|
||||
# CONFIG_VIRTUALIZATION is not set
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
@@ -682,6 +686,7 @@ CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
|
||||
CONFIG_STRICT_MODULE_RWX=y
|
||||
CONFIG_HAVE_ARCH_COMPILER_H=y
|
||||
CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y
|
||||
CONFIG_ARCH_USE_MEMREMAP_PROT=y
|
||||
# CONFIG_LOCK_EVENT_COUNTS is not set
|
||||
CONFIG_ARCH_HAS_RELR=y
|
||||
CONFIG_HAVE_PREEMPT_DYNAMIC=y
|
||||
@@ -1516,8 +1521,31 @@ CONFIG_SUNXI_RSB=y
|
||||
|
||||
CONFIG_ARM_SCPI_PROTOCOL=y
|
||||
CONFIG_ARM_SCPI_POWER_DOMAIN=y
|
||||
CONFIG_DMIID=y
|
||||
# CONFIG_DMI_SYSFS is not set
|
||||
# CONFIG_SYSFB_SIMPLEFB is not set
|
||||
# CONFIG_ARM_FFA_TRANSPORT is not set
|
||||
# CONFIG_GOOGLE_FIRMWARE is not set
|
||||
|
||||
#
|
||||
# EFI (Extensible Firmware Interface) Support
|
||||
#
|
||||
CONFIG_EFI_ESRT=y
|
||||
CONFIG_EFI_PARAMS_FROM_FDT=y
|
||||
CONFIG_EFI_RUNTIME_WRAPPERS=y
|
||||
CONFIG_EFI_GENERIC_STUB=y
|
||||
CONFIG_EFI_ARMSTUB_DTB_LOADER=y
|
||||
# CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER is not set
|
||||
# CONFIG_EFI_BOOTLOADER_CONTROL is not set
|
||||
# CONFIG_EFI_CAPSULE_LOADER is not set
|
||||
# CONFIG_EFI_TEST is not set
|
||||
# CONFIG_RESET_ATTACK_MITIGATION is not set
|
||||
# CONFIG_EFI_DISABLE_PCI_DMA is not set
|
||||
CONFIG_EFI_EARLYCON=y
|
||||
# CONFIG_EFI_DISABLE_RUNTIME is not set
|
||||
# CONFIG_EFI_COCO_SECRET is not set
|
||||
# end of EFI (Extensible Firmware Interface) Support
|
||||
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
# CONFIG_ARM_PSCI_CHECKER is not set
|
||||
CONFIG_HAVE_ARM_SMCCC=y
|
||||
@@ -3557,6 +3585,7 @@ CONFIG_FB_MODE_HELPERS=y
|
||||
# Frame buffer hardware drivers
|
||||
#
|
||||
# CONFIG_FB_ARMCLCD is not set
|
||||
# CONFIG_FB_EFI is not set
|
||||
# CONFIG_FB_OPENCORES is not set
|
||||
# CONFIG_FB_S1D13XXX is not set
|
||||
# CONFIG_FB_SUN5I_EINK is not set
|
||||
@@ -4567,6 +4596,7 @@ CONFIG_RTC_DRV_DS3232_HWMON=y
|
||||
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
|
||||
# CONFIG_RTC_DRV_DS1742 is not set
|
||||
# CONFIG_RTC_DRV_DS2404 is not set
|
||||
# CONFIG_RTC_DRV_EFI is not set
|
||||
# CONFIG_RTC_DRV_STK17TA8 is not set
|
||||
# CONFIG_RTC_DRV_M48T86 is not set
|
||||
# CONFIG_RTC_DRV_M48T35 is not set
|
||||
@@ -5570,6 +5600,7 @@ CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_EFIVAR_FS=m
|
||||
# end of Pseudo filesystems
|
||||
|
||||
CONFIG_MISC_FILESYSTEMS=y
|
||||
@@ -5741,6 +5772,7 @@ CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
|
||||
CONFIG_INTEGRITY=y
|
||||
# CONFIG_INTEGRITY_SIGNATURE is not set
|
||||
# CONFIG_IMA is not set
|
||||
# CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT is not set
|
||||
# CONFIG_EVM is not set
|
||||
CONFIG_DEFAULT_SECURITY_DAC=y
|
||||
CONFIG_LSM="yama,loadpin,integrity,selinux,smack,tomoyo,apparmor"
|
||||
@@ -6086,6 +6118,7 @@ CONFIG_CLZ_TAB=y
|
||||
CONFIG_MPILIB=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_OID_REGISTRY=y
|
||||
CONFIG_UCS2_STRING=y
|
||||
CONFIG_HAVE_GENERIC_VDSO=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_VDSO_TIME_NS=y
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
From a568d5efe609fec974d44fec4cba31288ab0f621 Mon Sep 17 00:00:00 2001
|
||||
From: Bobby The Builder <bob@najdan.com>
|
||||
Date: Mon, 29 Mar 2021 16:42:07 -0400
|
||||
Subject: [PATCH 4/5] common: expose DRAM clock speed
|
||||
|
||||
add memory/ram_freq
|
||||
---
|
||||
common/board_f.c | 6 ++++--
|
||||
common/main.c | 7 +++++++
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/common/board_f.c b/common/board_f.c
|
||||
index 0cddf0359d..e481c70ef0 100644
|
||||
--- a/common/board_f.c
|
||||
+++ b/common/board_f.c
|
||||
@@ -227,12 +227,14 @@ static int show_dram_config(void)
|
||||
print_size(gd->bd->bi_dram[i].size, "\n");
|
||||
#endif
|
||||
}
|
||||
- debug("\nDRAM: ");
|
||||
+ debug("\nDRAM Size: ");
|
||||
|
||||
print_size(size, "");
|
||||
board_add_ram_info(0);
|
||||
putc('\n');
|
||||
-
|
||||
+#if defined(CONFIG_DRAM_CLK)
|
||||
+ printf("DRAM Clock: %d MHz\n", CONFIG_DRAM_CLK);
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/common/main.c b/common/main.c
|
||||
index ae5bcdb32f..85adcc6c13 100644
|
||||
--- a/common/main.c
|
||||
+++ b/common/main.c
|
||||
@@ -46,6 +46,13 @@ void main_loop(void)
|
||||
if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
|
||||
env_set("ver", version_string); /* set version variable */
|
||||
|
||||
+#if defined(CONFIG_DRAM_CLK)
|
||||
+ char ram_clk_string[11];
|
||||
+ sprintf(ram_clk_string, "%d", CONFIG_DRAM_CLK);
|
||||
+ env_set("ram_freq", ram_clk_string);
|
||||
+ printf("Set ram_freq : %s\n", ram_clk_string);
|
||||
+#endif
|
||||
+
|
||||
cli_init();
|
||||
|
||||
if (IS_ENABLED(CONFIG_USE_PREBOOT))
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From d42ad51a78b783c829b55254db445a691725462b Mon Sep 17 00:00:00 2001
|
||||
From: Marius Gripsgard <marius@ubports.com>
|
||||
Date: Mon, 4 May 2020 22:28:42 +0200
|
||||
Subject: [PATCH 09/10] disable bootdelay
|
||||
|
||||
---
|
||||
configs/pinephone_defconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig
|
||||
index 9d39204a43..1f0ce680f9 100644
|
||||
--- a/configs/pinephone_defconfig
|
||||
+++ b/configs/pinephone_defconfig
|
||||
@@ -11,6 +11,7 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
|
||||
CONFIG_PINEPHONE_DT_SELECTION=y
|
||||
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
|
||||
CONFIG_OF_LIST="sun50i-a64-pinephone-1.1 sun50i-a64-pinephone-1.2"
|
||||
+CONFIG_BOOTDELAY=0
|
||||
CONFIG_LED_STATUS=y
|
||||
CONFIG_LED_STATUS_GPIO=y
|
||||
CONFIG_LED_STATUS0=y
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
# Maintainer: Martijn Braam <martijn@brixit.nl>
|
||||
# Co-Maintainer: Luca Weiss <luca@z3ntu.xyz>
|
||||
# Co-Maintainer: Bart Ribbers <bribbers@disroot.org>
|
||||
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
|
||||
# Co-Maintainer: Dylan Van Assche <me@dylanvanassche.be>
|
||||
# U-boot with patches to make the PinePhone boot faster and have control over the ddr clock speed
|
||||
pkgname=u-boot-pinephone
|
||||
pkgver=2022.07
|
||||
pkgrel=0
|
||||
pkgdesc="U-Boot bootloader for the PINE64 PinePhone"
|
||||
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"
|
||||
depends="linux-postmarketos-allwinner>=5.12"
|
||||
makedepends="$depends_dev
|
||||
arm-trusted-firmware
|
||||
bc
|
||||
bison
|
||||
crust
|
||||
dtc
|
||||
flex
|
||||
openssl-dev
|
||||
py3-setuptools
|
||||
python3-dev
|
||||
swig
|
||||
"
|
||||
options="!check"
|
||||
source="https://source.denx.de/u-boot/u-boot/-/archive/v$pkgver/u-boot-v$pkgver.tar.gz
|
||||
update-u-boot
|
||||
0001-common-expose-DRAM-clock-speed.patch
|
||||
0002-disable-bootdelay.patch
|
||||
"
|
||||
builddir="$srcdir/u-boot-v$pkgver"
|
||||
install="$pkgname.post-upgrade"
|
||||
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
|
||||
LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h
|
||||
|
||||
export BL31="/usr/share/arm-trusted-firmware/sun50i_a64/bl31.bin"
|
||||
export SCP="/usr/share/crust/pinephone/scp.bin"
|
||||
export BUILD_DIR="$builddir"/build
|
||||
|
||||
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
|
||||
sha512sum -b "$BUILD_DIR-$freq/u-boot-sunxi-with-spl.bin" > "$BUILD_DIR-$freq/u-boot-sunxi-with-spl.bin.sha512"
|
||||
done
|
||||
}
|
||||
|
||||
package() {
|
||||
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"
|
||||
install -D -m644 "build-$freq/u-boot-sunxi-with-spl.bin.sha512" \
|
||||
"$pkgdir/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl-$freq.bin.sha512"
|
||||
done
|
||||
install -D -m 755 "$srcdir"/update-u-boot "$pkgdir"/usr/sbin/update-u-boot
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
7cd524d5c4b692c99d61fae4e7d99287ce4bca06884dc02b62bd69dfdf594cc9232c13c5b8dbb3aeac125bf7907591dbc6a40e2ea3e39f024bd5a5d42aeaa4cd u-boot-v2022.07.tar.gz
|
||||
d6e1ca6100fdc0ecd9559d556bb8f6699ff807a180d097808417cdacc07fc22b58f8bf33f1f104fcbb28201bd873e469f251176605bec123870ff49bde50024c update-u-boot
|
||||
86d9587cb2b0ca99fb4090bd0daacd47c0043858654f6f7114c8d0ed6c660eb2b8bc0b37de6723e738df9b1137d62482f00764c284f4aa0a6054db9efe754db9 0001-common-expose-DRAM-clock-speed.patch
|
||||
9b9a5bd2cb5c04715a5bb2d34bfc06e63817dba7ec40fa2b09000a0827590623e85ed5877d6b6bb39f2bb917e5e9d8e1379e3df9128e3304be06abc487c68df2 0002-disable-bootdelay.patch
|
||||
"
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
update-u-boot -s
|
||||
@@ -1,195 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
verbose=
|
||||
board=
|
||||
device=
|
||||
dryrun=
|
||||
imagedir=
|
||||
default_freq=528
|
||||
freq=
|
||||
skip_delay=
|
||||
|
||||
get_boot_blockdev() {
|
||||
# Find the blockdevice where /boot is mounted from
|
||||
mount | sed -n -E 's:.*(/dev/mmcblk[0-9])p[0-9] on /boot .*:\1:p'
|
||||
}
|
||||
|
||||
get_defaults() {
|
||||
if [ -z "$board" -a -e /sys/firmware/devicetree/base/compatible ]; then
|
||||
case "$(cat /sys/firmware/devicetree/base/compatible 2>/dev/null)" in
|
||||
pine64,pinephone*) board=pinephone ;;
|
||||
pine64,pinetab*) board=pinetab ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -z "$device" ]; then
|
||||
case "$board" in
|
||||
pinephone|pinetab) device=$(get_boot_blockdev) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -z "$imagedir" ]; then
|
||||
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
|
||||
proc_freq=$(cat /proc/device-tree/memory/ram_freq 2>/dev/null)
|
||||
if [ -n "$proc_freq" ]; then
|
||||
echo "Detected clock: $proc_freq MHz"
|
||||
default_freq="$proc_freq"
|
||||
else
|
||||
echo "WARNING: Failed to read clock from /proc/device-tree/memory/ram_freq"
|
||||
echo "Using default clock: $default_freq MHz"
|
||||
fi
|
||||
elif [ -z "$freq" ]; then
|
||||
echo Using default clock: $default_freq MHz
|
||||
else
|
||||
echo Changing clock: $freq MHz
|
||||
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>] [-r|--ram-freq <freq>] [-s|--skip-delay]
|
||||
|
||||
options:
|
||||
|
||||
-b,--board <board> Specify the board type: pinephone, pinetab
|
||||
(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
|
||||
|
||||
-r,--ram-freq RAM clock speed, one of:
|
||||
* 528 (default for new postmarketOS installations)
|
||||
* 552 (default before v21.03 / edge 2021-04-05)
|
||||
* 624
|
||||
|
||||
-s,--skip-delay Skip delay and flash the image immediately
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
validate_checksum() {
|
||||
file="$1"
|
||||
file_sha512="$file.sha512"
|
||||
file_size=$(stat -c%s $file)
|
||||
device="$2"
|
||||
bs="$3"
|
||||
seek="$4"
|
||||
|
||||
checksum0=$(cat $file_sha512 | awk {'print $1'})
|
||||
checksum1=$(dd if=$device bs=1 skip=$(($seek * $bs)) count=$file_size status=none | sha512sum | awk {'print $1'})
|
||||
if [ "$checksum0" != "$checksum1" ]; then
|
||||
echo "File: $checksum0"
|
||||
echo "Part: $checksum1"
|
||||
die "Checksum failed"
|
||||
fi
|
||||
echo "Successful U-Boot image checksum verification on $device :"
|
||||
echo -e "\t$checksum1"
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
opt="$1"
|
||||
shift
|
||||
case "$opt" in
|
||||
-b|--board)
|
||||
case "$1" in
|
||||
pinephone) board="pinephone" ;;
|
||||
pinetab) board="pinetab" ;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
;;
|
||||
-d|--device)
|
||||
device="$1"
|
||||
shift
|
||||
;;
|
||||
-i|--imagedir)
|
||||
imagedir="$1"
|
||||
shift
|
||||
;;
|
||||
-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
|
||||
;;
|
||||
-s|--skip-delay)
|
||||
skip_delay="yes"
|
||||
;;
|
||||
--)
|
||||
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
|
||||
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/n) [n]: " -n 1 -r
|
||||
echo
|
||||
case "$REPLY" in
|
||||
y|Y) ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
if [ -z "$skip_delay" ]; then
|
||||
echo "Updating $board u-boot in $device in 3 seconds..."
|
||||
sleep 3
|
||||
else
|
||||
echo "Updating $board u-boot in $device"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$freq" ]; then
|
||||
freq=$default_freq
|
||||
fi
|
||||
|
||||
(
|
||||
set -e
|
||||
case "$board" in
|
||||
pinephone|pinetab)
|
||||
[ -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-$freq.bin of=$device bs=1024 seek=8 oflag=direct status=none
|
||||
[ -z "$dryrun" ] && validate_checksum $imagedir/pine64-pinephone/u-boot-sunxi-with-spl-$freq.bin $device 1024 8
|
||||
;;
|
||||
esac
|
||||
$dryrun sync
|
||||
) || die "U-Boot installation in $device failed"
|
||||
|
||||
[ -z "$dryrun" ] && echo "Completed successfully."
|
||||
Reference in new issue
Block a user