Skip to content

Port Rockchip FIQ debugger driver to kernel 6.18 APIs for ttyFIQ0 console on NanoPC-T6 - #1

Draft
edtubbs with Copilot wants to merge 8 commits into
mainfrom
copilot/fix-ttyfioq0-console-access
Draft

Port Rockchip FIQ debugger driver to kernel 6.18 APIs for ttyFIQ0 console on NanoPC-T6#1
edtubbs with Copilot wants to merge 8 commits into
mainfrom
copilot/fix-ttyfioq0-console-access

Conversation

Copilot AI commented Feb 9, 2026

Copy link
Copy Markdown

The backported Rockchip FIQ debugger driver (from vendor kernel 6.1) fails to compile against mainline 6.18 due to removed/changed kernel APIs. The DT patch also had malformed hunk headers causing patch: **** malformed patch at line 40.

DT patch fix

  • First hunk declared 6 original lines (-224,6) but body contained 7 → fixed to -224,7
  • Second hunk offset +801 was off-by-one → corrected to +800

Kernel API compat fixes in fiq_debugger.c

6.1 API 6.18 replacement
do_each_thread / while_each_thread for_each_process_thread
strlcpy strscpy
from_timer(state, t, sleep_timer) container_of(t, struct fiq_debugger_state, sleep_timer)
wakeup_source_add / wakeup_source_remove wakeup_source_register / wakeup_source_unregister (pointer-based)
struct wakeup_source embedded struct wakeup_source * (register returns pointer)

TTY write callback signature updated to match 6.18:

// before
static int fiq_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
// after
static ssize_t fiq_tty_write(struct tty_struct *tty, const u8 *buf, size_t count)

Warning fixes in fiq_debugger_arm64.c

  • Added static to fiq_debugger_dump_regs_aarch32 / fiq_debugger_dump_regs_aarch64 (only called within the file via the fiq_debugger_dump_regs dispatcher)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix console access for ttyFIQ0 in mainline kernel Enable serial console on NanoPC-T6 via ttyS2 Feb 9, 2026
Copilot AI requested a review from edtubbs February 9, 2026 21:07
edtubbs and others added 3 commits February 9, 2026 16:11
Added nix flake update command before building Dogebox OS T6.
…access

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
@edtubbs
edtubbs force-pushed the copilot/fix-ttyfioq0-console-access branch from 74aa808 to b3e5566 Compare February 9, 2026 21:11
Backport the FIQ debugger driver from the Rockchip vendor kernel
(armbian/linux-rockchip rk-6.1-rkr5.1) to enable ttyFIQ0 serial
console. The driver is compiled without CONFIG_FIQ_DEBUGGER_TRUST_ZONE
to avoid Rockchip SIP dependencies, using standard IRQ mode instead.

Changes:
- Add rockchip-fiq-debugger.patch: FIQ debugger driver source files
- Update DT patch: add fiq-debugger node, disable uart2
- Update base.nix: kernel config, earlycon + ttyFIQ0 console params

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Enable serial console on NanoPC-T6 via ttyS2 Backport Rockchip FIQ debugger driver to enable ttyFIQ0 console on NanoPC-T6 Feb 10, 2026
The first hunk declared 6 original lines (-224,6) but contained 7
context lines (3 pre + 4 post), causing: patch: **** malformed patch
at line 40: &av1d_mmu {

Fix the first hunk count (-224,6 → -224,7) and correct the second
hunk offset (+801 → +800) to reflect 30 net additions.

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Backport Rockchip FIQ debugger driver to enable ttyFIQ0 console on NanoPC-T6 Backport Rockchip FIQ debugger driver for ttyFIQ0 console on NanoPC-T6 Feb 10, 2026
The backported Rockchip FIQ debugger driver (from vendor kernel 6.1) fails
to compile against mainline kernel 6.18.2 due to removed/changed APIs:

- do_each_thread/while_each_thread -> for_each_process_thread
- strlcpy -> strscpy (3 occurrences)
- from_timer() -> container_of() (macro removed)
- fiq_tty_write: int -> ssize_t return, int -> size_t count (TTY API)
- wakeup_source embedded struct -> pointer with register/unregister API
- Add static to dump_regs_aarch32/aarch64 (missing prototype warnings)

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Backport Rockchip FIQ debugger driver for ttyFIQ0 console on NanoPC-T6 Port Rockchip FIQ debugger driver to kernel 6.18 APIs for ttyFIQ0 console on NanoPC-T6 Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants