uzbek-plus/b9/b9a/b9a-live.sh
q 4a7224c41f B9: built-in display (ST7735S SPI) in Linux and persistent B9C cache
- B9A: read-only audit of stock LK/DT: the panel is an ST7735S 128x128 on SPI (BLSP1 QUP4,
  16 MHz, mode 3, D/C GPIO116, RESET GPIO118), backlight = PM8916 MPP4 current sink 40 mA.
- B9B: upstream panel-mipi-dbi with the stock init sequence as firmware; MPP4 sink via pinctrl
  + gpio-backlight; first light with correct colours/orientation/offsets.
- B9C: fbcon (6x8, 21x16) on tty1 + getty, UART console kept, aurora-display service;
  cache B9C b9ce13c9 written and verified, cold boots with LTE + Wi-Fi + display.
- B9L (RAM only): lk2nd second stage with an msm8916 SPI panel port shows a picture before Linux.
- Sanitizer: whitelist for b8/ and b9/.
2026-10-03 01:45:02 +03:00

40 lines
3.2 KiB
Bash

#!/bin/sh
# B9A (board side, READ-ONLY): snapshot of the display-related state of the running Aurora Linux.
# No writes to GPIO/regulators/PMIC/SPI, no sysfs writes. Only side effect: mounts debugfs if absent (no HW access).
# PMIC registers are read through the regmap debugfs "registers" file (positioned dd reads = SPMI reads only).
echo B9A-LIVE-BEGIN; cat /proc/uptime; cat /proc/device-tree/model; echo; uname -a; cat /proc/cmdline
grep -q " /sys/kernel/debug " /proc/mounts || mount -t debugfs debugfs /sys/kernel/debug
for d in /sys/class/drm /sys/class/graphics /sys/class/backlight /sys/class/leds /sys/class/spi_master /sys/bus/spi/devices /dev/dri; do
echo "--- ls $d"; ls -la $d 2>&1
done
echo "--- /dev/fb*"; ls -la /dev/fb* 2>&1
echo "--- dmesg display/spi/backlight"
dmesg | grep -iE 'display|mdss|mdp|dsi|panel|drm|framebuffer|fbcon|fb[0-9]|backlight|lcd|spi|mipi|dbi|st77|mpp|simple' || echo "(no matches)"
echo "--- DT nodes (status)"
for n in soc@0/display-subsystem@1a00000 soc@0/display-subsystem@1a00000/display-controller@1a01000 \
soc@0/display-subsystem@1a00000/dsi@1a98000 soc@0/display-subsystem@1a00000/phy@1a98300 soc@0/spi@78b8000; do
p=/proc/device-tree/$n; if [ -d $p/ ]; then printf '%s status=' $n; cat $p/status 2>/dev/null || printf '(none=okay)'; echo; else echo "$n ABSENT"; fi
done
echo "--- DT search panel/backlight/framebuffer nodes"
find /proc/device-tree/ -iname '*panel*' -o -iname '*backlight*' -o -iname '*framebuffer*' -o -iname '*lcd*' 2>/dev/null
echo "--- DT reserved-memory"; ls /proc/device-tree/reserved-memory/
echo "--- debugfs gpio (TLMM 12-15 SPI, 116 D/C, 118 RESET; PMIC MPP4)"
grep -E 'gpio(12|13|14|15|116|118) |mpp4|gpiochip' /sys/kernel/debug/gpio
echo "--- pinmux-pins TLMM 12-15,116,118"
for f in /sys/kernel/debug/pinctrl/*/pinmux-pins; do echo "# $f"; grep -E '^pin (12|13|14|15|116|118) ' $f; done
echo "--- pinctrl MPP"; for f in /sys/kernel/debug/pinctrl/*mpp*/pinconf-pins; do echo "# $f"; cat $f; done
echo "--- regulators"
for r in /sys/class/regulator/regulator.*; do printf '%s %s state=%s uV=%s users=%s\n' ${r##*/} "$(cat $r/name)" "$(cat $r/state 2>/dev/null)" "$(cat $r/microvolts 2>/dev/null)" "$(cat $r/num_users 2>/dev/null)"; done
echo "--- regulator_summary (l6/l17)"; grep -iE 'l6|l17|regulator ' /sys/kernel/debug/regulator/regulator_summary 2>/dev/null | head -20
echo "--- regmaps"; ls /sys/kernel/debug/regmap/
# rd SID ADDR N: SID0 = 0-00 (MPP, PON), SID1 = 0-01 (LDOs, LPG/PWM) in upstream pm8916.dtsi
rd() { R=/sys/kernel/debug/regmap/0-0$1/registers; echo "# PMIC sid$1 $2 +$3"; [ -r $R ] && dd if=$R bs=9 skip=$(($2)) count=$(($3)) 2>/dev/null; }
echo "--- PM8916 MPP4 block (0xa300: 04=subtype,08=status,40=MODE_CTL,41=DIG_VIN,42=PULL,46=EN_CTL,4c=SINK_CTL)"
rd 0 0xa304 2; rd 0 0xa308 1; rd 0 0xa340 8; rd 0 0xa34c 1
echo "--- PM8916 LDO6 (0x4500) / LDO17 (0x5000): 08=STATUS 40/41=VSET 45=MODE 46=EN_CTL"
rd 1 0x4504 2; rd 1 0x4508 1; rd 1 0x4540 2; rd 1 0x4545 2
rd 1 0x5004 2; rd 1 0x5008 1; rd 1 0x5040 2; rd 1 0x5045 2
echo "--- PM8916 PWM/LPG 0xbc00 (46=EN_CTL)"; rd 1 0xbc04 2; rd 1 0xbc46 1
echo "--- clocks (mdss/blsp1_qup4)"; grep -E 'mdss|qup4_spi|blsp1_ahb' /sys/kernel/debug/clk/clk_summary 2>/dev/null | head -20
echo "--- eMMC"; cat /sys/block/mmcblk0/stat
echo B9A-LIVE-END