Skip to content

Fix NanoPC-T6 reset button: merge kernel config and apply patches directly in kernel override - #2

Draft
edtubbs with Copilot wants to merge 9 commits into
copilot/fix-nanopc-t6-reset-button-againfrom
copilot/fix-reset-button-functionality
Draft

Fix NanoPC-T6 reset button: merge kernel config and apply patches directly in kernel override#2
edtubbs with Copilot wants to merge 9 commits into
copilot/fix-nanopc-t6-reset-button-againfrom
copilot/fix-reset-button-functionality

Conversation

Copilot AI commented Feb 11, 2026

Copy link
Copy Markdown

Reset button works in U-Boot but stops working once the Linux kernel starts. After extensive iteration (7+ attempts), two Nix-level issues were identified that prevented kernel patches from taking effect reliably.

NanoPC-T6 button hardware (from schematic)

Button Connection Mechanism
Power RK806 PMIC PWRON Software — KEY_POWER via rk805-pwrkey driver
Reset RK806 PMIC RESETB Hardware — PMIC register-configured, no kernel event
Mask ROM SARADC ch0 Software — adc-keys driver

Changes

  • structuredExtraConfig was replaced, not merged — set-form override { structuredExtraConfig = ... } silently dropped nabam's base rockchip config (REGULATOR_RK808, GPIO_ROCKCHIP, SPI_ROCKCHIP, etc.). Switched to function-form override:
customKernel = baseKernel.kernel.override (prev: {
  structuredExtraConfig = (prev.structuredExtraConfig or {}) // (with lib.kernel; {
    MFD_RK8XX_SPI = yes;
    PINCTRL_RK805 = yes;
    INPUT_RK805_PWRKEY = yes;
  });
  kernelPatches = (prev.kernelPatches or []) ++ [ ... ];
});
  • Patches moved from boot.kernelPatches into kernel overrideboot.kernelPatches relies on the NixOS module apply function to propagate via .extend. Including patches directly in kernelPatches arg is more direct and survives lib.mkForce on boot.kernelPackages.

  • DTS patch adds rockchip,reset-mode = <2> to configure PMIC reset behavior when RESETB is asserted.

  • Kernel driver patch disables SLAVE_RESTART_FUN in rk8xx-core.c pre-init — this multi-PMIC feature repurposes RESETB input on the single-PMIC NanoPC-T6.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 11, 2026 20:13
… DT node, clean up kernel config

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix reset button functionality in current branch Fix reset button: configure logind to reboot on power key, remove vendor-only DT node Feb 11, 2026
Copilot AI requested a review from edtubbs February 11, 2026 20:16
…3 buttons correctly

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Fix reset button: configure logind to reboot on power key, remove vendor-only DT node Fix reset button: add rockchip,reset-mode to RK806 PMIC, correct 3-button hardware model Feb 11, 2026
…l PMU restart)

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Fix reset button: add rockchip,reset-mode to RK806 PMIC, correct 3-button hardware model fix: rockchip,reset-mode=0 for actual PMU restart on reset button press Feb 12, 2026
…nanopc-t6.dtsi.patch

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title fix: rockchip,reset-mode=0 for actual PMU restart on reset button press Fix malformed patch hunk header in rk3588-nanopc-t6.dtsi.patch Feb 12, 2026
Copilot AI changed the title Fix malformed patch hunk header in rk3588-nanopc-t6.dtsi.patch Fix NanoPC-T6 reset button: add MFD_RK8XX_SPI + PMIC reset-mode config Feb 12, 2026
…king PMIC config

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Fix NanoPC-T6 reset button: add MFD_RK8XX_SPI + PMIC reset-mode config Fix reset button: stop overriding U-Boot's working PMIC reset config Feb 12, 2026
…eset-mode 2

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Fix reset button: stop overriding U-Boot's working PMIC reset config Fix NanoPC-T6 reset button: disable SLAVE_RESTART_FUN + use reset-mode 2 Feb 13, 2026
…ches directly in kernel override

Co-authored-by: edtubbs <84785904+edtubbs@users.noreply.github.com>
Copilot AI changed the title Fix NanoPC-T6 reset button: disable SLAVE_RESTART_FUN + use reset-mode 2 Fix NanoPC-T6 reset button: merge kernel config and apply patches directly in kernel override Feb 13, 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