motorola-rtwo: add framebuffer console + pstore for bring-up debugging

The device resets right after 'fastboot boot' with no output. Add tools
to see why:

- rtwo.config kernel fragment: PSTORE_RAM=y + PSTORE_CONSOLE=y (capture the
  kernel log in ramoops at 0xae000000, readable afterwards from stock
  Android or a later pmOS boot), QCOM_WDT=y (pet the APSS watchdog early
  in case the bootloader armed it), FB_SIMPLE/FRAMEBUFFER_CONSOLE on.
- .dts: simple-framebuffer at 0xb8000000 reworked (x8r8g8b8, 1080x2400) -
  reuses the bootloader framebuffer, no panel driver needed.
- deviceinfo cmdline: console=tty0 (framebuffer console), ignore_loglevel,
  clk_ignore_unused + pd_ignore_unused (keep the bootloader display path
  powered so the framebuffer does not freeze).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QF5HebjUsRaxbW4cBX6HJP
This commit is contained in:
2026-09-08 15:05:50 -03:00
co-authored by Claude Sonnet 5
parent 2cebfd11fb
commit 2b3bae0a49
5 changed files with 52 additions and 12 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
maintainer="snlavaise <snlavaise@gmail.com>"
pkgname=device-motorola-rtwo
pkgver=1
pkgrel=1
pkgrel=2
pkgdesc="Motorola Moto Edge 40 Pro"
url="https://postmarketos.org"
arch="aarch64"
@@ -36,6 +36,6 @@ package() {
}
sha512sums="
32c5054a403dc98169061e7aae2bab06b014089f7563ab65515923b1b07ead8832476107f87ecbd94575c69c92ea91eef6db9effe788b0b71e893cfb62e8963b deviceinfo
90b9cef36ae91c1c640cc32f878ad8ea2e66fa22ae472fdaafa8c3a34bc77c59612daabf9688a7d2bb7b0051d48cb298fe6c8388a1de3434a387ed48c7fd4f65 deviceinfo
c572e21cb0624b554a22a218b0c4faab9b6412654bed6bfef530f3068d076b21c573bd7f4b3ca65f510f8756f636a861191cce925ef49587db7d68d09558826c modules-initfs
"
@@ -27,7 +27,7 @@ deviceinfo_no_framebuffer="false"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyMSM0,115200n8 earlycon"
deviceinfo_kernel_cmdline="console=tty0 console=ttyMSM0,115200n8 earlycon clk_ignore_unused pd_ignore_unused ignore_loglevel"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_header_version="4"
@@ -4,7 +4,7 @@ maintainer="snlavaise <snlavaise@gmail.com>"
_flavor="postmarketos-qcom-sm8550"
pkgname=linux-$_flavor
pkgver=6.13_rc3
pkgrel=0
pkgrel=1
pkgdesc="Mainline kernel fork for Qualcomm SM8550 (Snapdragon 8 Gen 2) devices"
arch="aarch64"
_carch="arm64"
@@ -42,6 +42,7 @@ _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
rtwo.config
"
builddir="$srcdir/linux-$_commit"
@@ -58,12 +59,14 @@ prepare() {
fi
# Generate .config from the in-tree upstream defconfig plus the postmarketOS
# and device config fragments shipped by the kernel repo.
# 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
defconfig pmos.config devices.config rtwo.config
}
build() {
@@ -105,5 +108,6 @@ package() {
# 'pmbootstrap checksum linux-postmarketos-qcom-sm8550' (it downloads ~250 MB).
sha512sums="
19f6d0ee8481e34b0b8c27f07f3023182cda9e2a3d67e40989b1f300b7e82d7ea606fb112599dd9399e0d5f973d43b289d8932a4b578b6ffe4168af05e19f795 linux-postmarketos-qcom-sm8550-22591bbc21da5cc0c6e37503b77bd2d852fe241c.tar.gz
11210b15854d92754b7bc801c1e807497b3336585498770d62d5aec6f81bc5b0b0ad6f775421e3af34edaece04f2b81e9bbc01381b78d1030d97598902d6fb11 sm8550-motorola-rtwo.dts
71270b409e4fc5b6f5ddd164629c937e5ad783761c8a290d46d36a3ba21a96702c1861bfc20e0a1225b2af6d88d21333b5a9c82149f125ed42385c9c7dd207cf sm8550-motorola-rtwo.dts
91cebe340d9e1a3f308725ced37d2f6c4695869100e198d693317f476b1123128b1b24a0604f4aa132d6269de68a87017485149df7d2924cf3a09241b999ffcf rtwo.config
"
@@ -0,0 +1,31 @@
# Extra kernel config for the Motorola rtwo bring-up.
# Merged on top of defconfig + pmos.config + devices.config.
# Purpose: get diagnostic output on a device with no working display/UART yet.
# --- 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
# (/sys/fs/pstore/console-ramoops-0).
CONFIG_PSTORE=y
CONFIG_PSTORE_RAM=y
CONFIG_PSTORE_CONSOLE=y
CONFIG_PSTORE_PMSG=y
CONFIG_PSTORE_COMPRESS=y
# --- watchdog -------------------------------------------------------------
# The bootloader may hand off with the APSS watchdog armed; build the driver
# in so the kernel starts petting it early instead of getting reset.
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.
CONFIG_FB=y
CONFIG_FB_SIMPLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# --- misc bring-up aids -------------------------------------------------
CONFIG_MAGIC_SYSRQ=y
CONFIG_LOG_BUF_SHIFT=18
@@ -57,10 +57,15 @@
stdout-path = "serial0:115200n8";
/*
* Bootloader continuous-splash framebuffer. Geometry is a best
* guess (1080x2400, 32bpp) from the stock cont_splash /
* disp_rdump region. If the display stays black or garbled,
* adjust format/stride or drop this node.
* Bootloader continuous-splash framebuffer, reused as an early
* console (CONFIG_FB_SIMPLE). Needs no panel driver.
*
* Panel is 1080x2400 (NT37705). Format/base are a best guess
* from the stock cont_splash / disp_rdump regions. If the screen
* is garbled: try format "x8r8g8b8" -> "r5g6b5" (and stride
* 1080*2) -> drop the node. If it is offset/torn, the stride is
* wrong. If it shows briefly then freezes, the display clocks
* got gated - add "clk_ignore_unused" to the kernel cmdline.
*/
framebuffer0: framebuffer@b8000000 {
compatible = "simple-framebuffer";
@@ -68,7 +73,7 @@
width = <1080>;
height = <2400>;
stride = <(1080 * 4)>;
format = "a8r8g8b8";
format = "x8r8g8b8";
};
};