/* * krane payload entry shim — runs at 0x40000040 right after the * depthcharge handoff (MMU off, caches off; position-independent: * immediate-encoded addresses only). * * depthcharge's display_cleanup() stops the overlay engines and drops * the backlight before jumping to the payload; this shim undoes those * writes so the screen stays alive until U-Boot's scanout driver * probes (the driver repeats the revival itself). The shim cannot be * removed: depthcharge jumps to payload+0x40, while U-Boot's PIE * fixup needs its runtime _start 4K-aligned — so U-Boot sits at image * offset 0x1000 and this shim branches there (branch imm26 patched at * build time by build-uboot-payload.sh). * * Register sources (all verified on device, RESEARCH.md rounds 4/10): * OVL0 base 0x14008000: OVL_EN @ +0x000c, OVL0_2L_EN @ +0x100c * (device-era depthcharge mtk_ddp.c offsets). * GPIO controller 0x10005000, dout block +0x100, 16 B per 32-pin * group, set @ +4 (mt8183.h GpioRegs): * DISP_PWM = pin 43 (bit 11, set 0x10005114), * EN_LCD_BL = pin 176 (bit 16, set 0x10005154). */ .text .globl _start _start: /* OVL_EN = 1 */ mov w2, #1 mov w3, #0x800c movk w3, #0x1400, lsl #16 str w2, [x3] /* OVL0_2L_EN = 1 */ mov w3, #0x900c movk w3, #0x1400, lsl #16 str w2, [x3] /* backlight on: pin 43 (DISP_PWM), dout set 0x10005114, bit 11 */ mov w2, #0x800 mov w3, #0x5114 movk w3, #0x1000, lsl #16 str w2, [x3] /* backlight on: pin 176 (EN_LCD_BL), dout set 0x10005154, bit 16 */ mov w2, #0x10000 mov w3, #0x5154 movk w3, #0x1000, lsl #16 str w2, [x3] 1: b . /* PATCHED: branch to U-Boot entry */