uzbek-plus/b9/b9a/dt-extract.py
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

22 lines
718 B
Python

#!/usr/bin/env python3
"""B9A read-only: print complete DT node blocks (brace-matched) whose header line matches any regex.
usage: dt-extract.py file.dts 'regex' ['regex' ...]"""
import re, sys
lines = open(sys.argv[1]).read().splitlines()
pats = [re.compile(p) for p in sys.argv[2:]]
i = 0
while i < len(lines):
l = lines[i]
if l.rstrip().endswith('{') and any(p.search(l) for p in pats):
depth = 0; j = i
while True:
depth += lines[j].count('{') - lines[j].count('}')
if depth == 0:
break
j += 1
print(f'# {sys.argv[1]}:{i + 1}-{j + 1}')
print('\n'.join(lines[i:j + 1])); print()
i = j + 1
else:
i += 1