Files
bfe-core1106-sdk/luckfox-sdk-patches/uboot/include/flare_trace.h
T
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

31 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* flare-edge boot instrumentation.
*
* Emits "FLARE-T <microseconds-since-power-on> <label>" on the console at
* interesting points in the boot, so tools/boot-trace.py can build a single
* timeline spanning BootROM -> SPL -> U-Boot -> kernel -> userspace.
*
* The time expression is deliberately the same one Rockchip's own
* "Total: x/y ms" line uses (arch/arm/lib/bootm.c, common/spl/spl.c): the
* secure timer is started in TPL/SPL and free-runs from power-on, so
* get_ticks() is ticks-since-power-on and COUNTER_FREQUENCY is 24 MHz.
* That makes these values directly comparable to that existing line, and
* immune to UART transmit latency (unlike host-side timestamps, which lag
* by ~5 ms per line at 115200 and much more when the port is flooded).
*
* Cost is a handful of printf calls. Note the uboot partition has only
* ~12.8 KB spare (see wiki 30-uboot.md), so do not add these liberally.
*/
#ifndef _FLARE_TRACE_H_
#define _FLARE_TRACE_H_
#define FLARE_USEC() \
((ulong)(get_ticks() / (COUNTER_FREQUENCY / 1000000)))
#define FLARE_TRACE(label) \
printf("FLARE-T %lu %s\n", \
FLARE_USEC(), label)
#endif /* _FLARE_TRACE_H_ */