- 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/.
16 lines
1,005 B
Python
16 lines
1,005 B
Python
#!/usr/bin/env python3
|
|
"""B9A read-only: render the 128x128 RGB565 (little-endian u16) default splash embedded in stock LK
|
|
(imageBuffer @0x8f64b004, used by display_image_on_screen() when the splash partition has no 'SPLASH!!' header)
|
|
to a 2x-scaled PNG. usage: render-lk-logo.py lk.bin out.png"""
|
|
import struct, sys, zlib
|
|
d = open(sys.argv[1], 'rb').read(); o = 0x8f64b004 - 0x8f600000; W = H = 128
|
|
rows = []
|
|
for y in range(H):
|
|
r = bytearray()
|
|
for x in range(W):
|
|
v = struct.unpack_from('<H', d, o + (y * W + x) * 2)[0]
|
|
r += bytes(((v >> 11 & 31) * 255 // 31, (v >> 5 & 63) * 255 // 63, (v & 31) * 255 // 31)) * 2
|
|
rows += [bytes(r)] * 2
|
|
def ch(t, b): return struct.pack('>I', len(b)) + t + b + struct.pack('>I', zlib.crc32(t + b) & 0xffffffff)
|
|
open(sys.argv[2], 'wb').write(b'\x89PNG\r\n\x1a\n' + ch(b'IHDR', struct.pack('>IIBBBBB', W * 2, H * 2, 8, 2, 0, 0, 0))
|
|
+ ch(b'IDAT', zlib.compress(b''.join(b'\0' + r for r in rows))) + ch(b'IEND', b''))
|