linux-postmarketos-qcom-sm8550: rebase onto mainline 7.2
The Dec-2024 sm8550 bring-up snapshot (6.13-rc3) black-screen bootloops on rtwo with no output. Switch to plain upstream 7.2 (kernel.org, same tarball as linux-postmarketos-mainline) which has ~18 months of SM8550 fixes (SPMI, watchdog node, USB, UFS, display, ...). - config base is now config-mainline.aarch64 (copied as config-motorola-rtwo.aarch64) + the rtwo.config fragment appended. - rtwo.config: disable RUST + DEBUG_INFO + non-Qualcomm ARCH_* to keep the build within disk; add SIMPLEDRM/SYSFB_SIMPLEFB alongside FB_SIMPLE. - drop the hand-added APSS watchdog node from the .dts (upstream sm8550.dtsi has it since 6.8). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QF5HebjUsRaxbW4cBX6HJP
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
# Reference: <https://postmarketos.org/vendorkernel>
|
||||
# Kernel config based on: arch/arm64/configs/defconfig (+ pmos.config, devices.config)
|
||||
# Mainline kernel + the (not-yet-upstream) Motorola rtwo device tree.
|
||||
# Config base: linux-postmarketos-mainline's config-mainline.aarch64.
|
||||
maintainer="snlavaise <snlavaise@gmail.com>"
|
||||
_flavor="postmarketos-qcom-sm8550"
|
||||
pkgname=linux-$_flavor
|
||||
pkgver=6.13_rc3
|
||||
pkgrel=1
|
||||
pkgdesc="Mainline kernel fork for Qualcomm SM8550 (Snapdragon 8 Gen 2) devices"
|
||||
pkgver=7.2
|
||||
pkgrel=0
|
||||
pkgdesc="Mainline kernel for Qualcomm SM8550 (Snapdragon 8 Gen 2) + Motorola rtwo"
|
||||
arch="aarch64"
|
||||
_carch="arm64"
|
||||
url="https://gitlab.postmarketos.org/soc/qcom-sm8550/linux"
|
||||
url="https://kernel.org"
|
||||
license="GPL-2.0-only"
|
||||
options="
|
||||
!check
|
||||
@@ -22,92 +23,77 @@ makedepends="
|
||||
bash
|
||||
bison
|
||||
clang
|
||||
diffutils
|
||||
elfutils-dev
|
||||
findutils
|
||||
flex
|
||||
gmp-dev
|
||||
kmod
|
||||
linux-headers
|
||||
lld
|
||||
llvm
|
||||
mpc1-dev
|
||||
mpfr-dev
|
||||
openssl-dev
|
||||
pahole
|
||||
perl
|
||||
postmarketos-installkernel
|
||||
python3
|
||||
xz
|
||||
zstd
|
||||
"
|
||||
|
||||
# Source: snapshot of the postmarketOS SM8550 bring-up tree (branch: bringup).
|
||||
# Bump _commit to move forward; then run 'pmbootstrap checksum linux-postmarketos-qcom-sm8550'.
|
||||
_commit="22591bbc21da5cc0c6e37503b77bd2d852fe241c"
|
||||
source="
|
||||
$pkgname-$_commit.tar.gz::https://gitlab.postmarketos.org/soc/qcom-sm8550/linux/-/archive/$_commit/linux-$_commit.tar.gz
|
||||
sm8550-motorola-rtwo.dts
|
||||
$pkgname-$pkgver.tar.gz::https://git.kernel.org/torvalds/t/linux-${pkgver/_/-}.tar.gz
|
||||
config-motorola-rtwo.aarch64
|
||||
rtwo.config
|
||||
sm8550-motorola-rtwo.dts
|
||||
"
|
||||
builddir="$srcdir/linux-$_commit"
|
||||
builddir="$srcdir/linux-${pkgver/_/-}"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
# The Motorola rtwo (Moto Edge 40 Pro) device tree is not upstream yet, so
|
||||
# drop it into the tree and register it in the Makefile before configuring.
|
||||
local _dtsdir="$builddir/arch/$_carch/boot/dts/qcom"
|
||||
# The Motorola rtwo (Moto Edge 40 Pro) device tree is not upstream yet.
|
||||
local _dtsdir="arch/$_carch/boot/dts/qcom"
|
||||
cp "$srcdir/sm8550-motorola-rtwo.dts" "$_dtsdir/sm8550-motorola-rtwo.dts"
|
||||
if ! grep -q "sm8550-motorola-rtwo.dtb" "$_dtsdir/Makefile"; then
|
||||
sed -i '/sm8550-mtp\.dtb/a dtb-$(CONFIG_ARCH_QCOM) += sm8550-motorola-rtwo.dtb' \
|
||||
"$_dtsdir/Makefile"
|
||||
fi
|
||||
|
||||
# Generate .config from the in-tree upstream defconfig plus the postmarketOS
|
||||
# and device config fragments shipped by the kernel repo, then merge the
|
||||
# rtwo bring-up fragment on top.
|
||||
# To "freeze" this config: build once, copy "$builddir"/.config to
|
||||
# config-$_flavor.$CARCH, add it to source= and switch prepare() to a plain
|
||||
# 'cp "$srcdir/config-$_flavor.$CARCH" .config' (like the other qcom kernels).
|
||||
cp "$srcdir/rtwo.config" arch/$_carch/configs/rtwo.config
|
||||
make ARCH="$_carch" LLVM=1 HOSTLDFLAGS="-fuse-ld=lld" \
|
||||
defconfig pmos.config devices.config rtwo.config
|
||||
# Base config (from linux-postmarketos-mainline) + rtwo bring-up fragment.
|
||||
cp "$srcdir/config-motorola-rtwo.aarch64" .config
|
||||
cat "$srcdir/rtwo.config" >> .config
|
||||
make ARCH="$_carch" LLVM=1 olddefconfig
|
||||
}
|
||||
|
||||
build() {
|
||||
unset LDFLAGS
|
||||
make ARCH="$_carch" LLVM=1 HOSTLDFLAGS="-fuse-ld=lld" \
|
||||
make ARCH="$_carch" LLVM=1 \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1))-$_flavor"
|
||||
}
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir"/boot
|
||||
|
||||
if [ -e "$builddir/arch/$_carch/boot/vmlinuz.efi" ]; then
|
||||
# ZBOOT EFI decompressor for EFI booting
|
||||
install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz.efi" \
|
||||
"$pkgdir/boot/linux.efi"
|
||||
# gzip'd image for Android boot.img compatibility
|
||||
install -Dm644 "$builddir/arch/$_carch/boot/vmlinuz" \
|
||||
"$pkgdir/boot/vmlinuz"
|
||||
else
|
||||
echo "WARNING: CONFIG_EFI_ZBOOT not enabled!"
|
||||
install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \
|
||||
"$pkgdir/boot/vmlinuz"
|
||||
fi
|
||||
|
||||
make modules_install dtbs_install \
|
||||
make modules_install zinstall dtbs_install \
|
||||
ARCH="$_carch" \
|
||||
LLVM=1 \
|
||||
INSTALL_PATH="$pkgdir"/boot \
|
||||
INSTALL_MOD_PATH="$pkgdir"/usr \
|
||||
INSTALL_MOD_STRIP=1 \
|
||||
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs
|
||||
|
||||
rm -f "$pkgdir"/usr/lib/modules/*/build "$pkgdir"/usr/lib/modules/*/source
|
||||
|
||||
install -D "$builddir"/include/config/kernel.release \
|
||||
install -Dm644 "$builddir"/include/config/kernel.release \
|
||||
"$pkgdir"/usr/share/kernel/"$_flavor"/kernel.release
|
||||
}
|
||||
|
||||
# The kernel tarball checksum is filled in by
|
||||
# 'pmbootstrap checksum linux-postmarketos-qcom-sm8550' (it downloads ~250 MB).
|
||||
# 'pmbootstrap checksum linux-postmarketos-qcom-sm8550' fills in the tarball hash
|
||||
# (same tarball as linux-postmarketos-mainline, ~150 MB download).
|
||||
sha512sums="
|
||||
19f6d0ee8481e34b0b8c27f07f3023182cda9e2a3d67e40989b1f300b7e82d7ea606fb112599dd9399e0d5f973d43b289d8932a4b578b6ffe4168af05e19f795 linux-postmarketos-qcom-sm8550-22591bbc21da5cc0c6e37503b77bd2d852fe241c.tar.gz
|
||||
02d8dc574f20027a4aace5238fa879bb2d305551f8583f2b5b37d5388ab9ba6c7337f6f2bb4e23ddb3d852a3195fb4cddfc9791e7c6a33e60bee552b028d101c sm8550-motorola-rtwo.dts
|
||||
eae6e9b61bfedc72d4b6c0fdcb1260a18b439d3407d35dc44ec43b526601ad21fc4cb8d6077b3b5723348e1bb002b968afdb770581ad2578abd554f0fc4d6070 rtwo.config
|
||||
52d5aa7f94f6aa6141debf4ceb4fc7a2e75505a7cd38b8854e501be83c2b57863020f463f2fdb2fc93667e6cfe13274d077e5207a611e4797bd9404ee0e64c58 linux-postmarketos-qcom-sm8550-7.2.tar.gz
|
||||
f9ae52489f6b9e6fef64952943cd09732a5bef90a0e8765db03c256483028368687d6d5a1d80dd813a513e7e80d91f8b47f49b91cff67266b76f1d6275a7fea0 config-motorola-rtwo.aarch64
|
||||
fdcd938d44aef233aa0dcd7ac3f45b00df7f380d9e8504f9f18e1484d67d8eece74396be7b90eb608c20333a4dddfcfc317e69e9e33bb2c28767af4d1d55cee0 rtwo.config
|
||||
71270b409e4fc5b6f5ddd164629c937e5ad783761c8a290d46d36a3ba21a96702c1861bfc20e0a1225b2af6d88d21333b5a9c82149f125ed42385c9c7dd207cf sm8550-motorola-rtwo.dts
|
||||
"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,8 @@
|
||||
# Extra kernel config for the Motorola rtwo bring-up.
|
||||
# Merged on top of defconfig + pmos.config + devices.config.
|
||||
# Motorola rtwo bring-up fragment, appended to config-motorola-rtwo.aarch64.
|
||||
|
||||
# --- pstore / ramoops -------------------------------------------------------
|
||||
# Capture the kernel console into the reserved ramoops region (0xae000000,
|
||||
# same address the stock firmware uses) so that after a failed boot the log
|
||||
# can be read back - from a later pmOS boot, or from stock Android
|
||||
# Capture the kernel console into the reserved ramoops region (0xae000000)
|
||||
# so a failed boot can be read back from a later pmOS boot
|
||||
# (/sys/fs/pstore/console-ramoops-0).
|
||||
CONFIG_PSTORE=y
|
||||
CONFIG_PSTORE_RAM=y
|
||||
@@ -12,26 +10,27 @@ CONFIG_PSTORE_CONSOLE=y
|
||||
CONFIG_PSTORE_PMSG=y
|
||||
CONFIG_PSTORE_COMPRESS=y
|
||||
|
||||
# --- watchdog -------------------------------------------------------------
|
||||
# The bootloader hands off with the APSS watchdog armed; build the driver in
|
||||
# so the kernel starts petting it early instead of getting reset.
|
||||
# --- watchdog ------------------------------------------------------------
|
||||
# sm8550.dtsi has the APSS watchdog node; build the driver in so the kernel
|
||||
# pets it early (the bootloader may hand off with it armed).
|
||||
CONFIG_QCOM_WDT=y
|
||||
|
||||
# --- framebuffer console -------------------------------------------------
|
||||
# Show the boot log on the panel by reusing the bootloader's framebuffer
|
||||
# (simple-framebuffer node in the .dts). No panel driver required.
|
||||
# --- framebuffer console ----------------------------------------------
|
||||
# Reuse the bootloader framebuffer as an early console (simple-framebuffer
|
||||
# node in the .dts). No panel driver needed.
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_DRM_SIMPLEDRM=y
|
||||
CONFIG_SYSFB_SIMPLEFB=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
|
||||
|
||||
# --- misc bring-up aids -------------------------------------------------
|
||||
# --- misc bring-up aids ---------------------------------------------
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_LOG_BUF_SHIFT=18
|
||||
|
||||
# --- build size: this is a device kernel, not the generic arm64 one -----
|
||||
# The upstream defconfig builds modules for every arm64 SoC family. Drop the
|
||||
# ones rtwo will never use - cuts the build tree and .apk by well over half.
|
||||
# --- build size / speed: device kernel, not the generic arm64 one ------
|
||||
# CONFIG_RUST is not set
|
||||
# CONFIG_DEBUG_INFO_REDUCED is not set
|
||||
CONFIG_DEBUG_INFO_NONE=y
|
||||
# CONFIG_ARCH_ACTIONS is not set
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
|
||||
|
||||
@@ -121,21 +120,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
/*
|
||||
* APSS watchdog - not described in sm8550.dtsi (6.13-rc3). The Motorola
|
||||
* bootloader hands off with it armed; without this node nothing pets it
|
||||
* and the device resets ~30 s after the kernel starts. Binds via the
|
||||
* "qcom,kpss-wdt" fallback + CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED.
|
||||
*/
|
||||
watchdog@17c10000 {
|
||||
compatible = "qcom,apss-wdt-sm8550", "qcom,kpss-wdt";
|
||||
reg = <0x0 0x17c10000 0x0 0x1000>;
|
||||
clocks = <&sleep_clk>;
|
||||
interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
};
|
||||
|
||||
&apps_rsc {
|
||||
/*
|
||||
* PM8550-family RPMh regulators. Rail voltage ranges are the SM8550
|
||||
|
||||
Reference in New Issue
Block a user