Files
bfe-core1106-sdk/luckfox-sdk-patches/uboot/dts
NoahandClaude Opus 5 d266e0774f Add luckfox-sdk-patches: the vendor-SDK delta moved from flare-edge
flare-edge's sdk-patches/ patched the legacy vendor Luckfox SDK (U-Boot
2017.09, optionally the vendor 5.10.160 kernel, the aic8800 wifi driver,
board build glue, and buildroot deltas) directly in that repo, even though
the workspace rule already says kernel/U-Boot/driver work belongs in this
SDK repo. Move the whole tree here as luckfox-sdk-patches/, named to stay
unambiguous next to this repo's own patches/ (the unrelated 6.18.46
forward-port series).

Every patch, config fragment, include and the embedded control DTB is
byte-identical to the flare-edge originals (verified: diff -rq against a
snapshot taken before the move). Only the two README files were rewritten
for the new location, cross-repo pointers, and a license note; also updated
build/vendor.manifest's stale flare-edge cross-reference and this repo's own
top-level README layout table.

Source: flare-edge@86d4633:sdk-patches/ (blueflare/flare-edge, worktree
sdk-patches-in-sdk). flare-edge's own consumers (tools/build-firmware.sh,
verify-sdk-patches.sh, sync-sdk-patches.sh, check-invariants.sh,
auto-version.sh, tests, docs) are updated in a companion commit on the
flare-edge side of this same branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMRwnkPp1upR6QFWCZouE7
2026-09-24 11:51:02 -06:00
..

rv1106-warden-kernel.dtb -- provenance and regeneration

This binary is U-Boot's embedded control DTB (CONFIG_EMBED_KERNEL_DTB_PATH, set in ../configs/flare-display.config). With CONFIG_EMBED_KERNEL_DTB_ALWAYS U-Boot adopts it in board_init() instead of reading the booted slot's DTB out of resource, so the display bring-up (boot logo included) is identical on every slot regardless of the slot kernel's own device tree.

Where this exact blob came from

Extracted 2026-09-01 from the vendor-built 5.10 firmware image sdk/output/image/boot.img (build of 2026-08-24, WardenOS 0.3.x line): the rk-kernel.dtb entry of its resource sub-image, 73379 bytes, dtb magic d00dfeed. That is byte-for-byte the DTB U-Boot's display stack was proven against when it adopted the slot DTB directly.

Regenerating after a kernel DTS change

Run this from a blueflare/flare-edge worktree with this SDK checked out at vendor/warden-sdk (the normal layout). The 5.10 board DTS is the source of truth (sdk/sysdrv/source/kernel/arch/arm/boot/dts/rv1106g-luckfox-pico-86panel.dts plus its ipc dtsi, where sdk/ is flare-edge's own vendor-SDK checkout, not this repo). After any display-relevant change there, rebuild the firmware once and re-extract:

import struct, subprocess, re
fit = open('sdk/output/image/boot.img','rb').read()
open('/tmp/fitmeta.dtb','wb').write(fit[:4096])
def fdtget(node, prop):
    r = subprocess.run(['fdtget','-ti','/tmp/fitmeta.dtb',node,prop],
                       capture_output=True, text=True)
    return int(r.stdout.split()[0])
pos, size = fdtget('/images/resource','data-position'), fdtget('/images/resource','data-size')
res = fit[pos:pos+size]
for m in re.finditer(b'ENTR', res):
    e = res[m.start():m.start()+272]
    name = e[4:260].split(b'\0')[0].decode()
    blk_off, sz = struct.unpack('<II', e[260:268])
    if name == 'rk-kernel.dtb':
        open('vendor/warden-sdk/luckfox-sdk-patches/uboot/dts/rv1106-warden-kernel.dtb','wb').write(
            res[blk_off*512: blk_off*512+sz])

Then rebuild U-Boot and confirm the boot log prints DTB: dts/rv1106-warden-kernel.dtb. A stale blob here silently diverges from the kernel-side display timings; this file must be regenerated in the same change that edits them. flare-edge's tools/build-firmware.sh hard-fails if the file is missing while EMBED_KERNEL_DTB_ALWAYS is configured.