Skip to content

WIP: clockworkpi: add uConsole CM4 support#1734

Open
pinpox wants to merge 1 commit intoNixOS:masterfrom
pinpox:clockworkpi-uconsole
Open

WIP: clockworkpi: add uConsole CM4 support#1734
pinpox wants to merge 1 commit intoNixOS:masterfrom
pinpox:clockworkpi-uconsole

Conversation

@pinpox
Copy link
Member

@pinpox pinpox commented Jan 15, 2026

Summary

Add hardware support for the ClockworkPi uConsole with CM4 module:

  • CWU50 5" DSI display panel driver (720x1280)
  • AXP228 power management IC
  • OCP8178 backlight controller
  • Device tree overlays for uConsole hardware
  • Optional 4G modem support with GPIO control

Hardware

The uConsole is a portable handheld device based on Raspberry Pi CM4 with custom hardware requiring kernel patches for display, power management, and audio routing.

Patches

Patches are extracted from ClockworkPi-linux, the official ClockworkPi kernel fork.

Usage

{ inputs, ... }:
{
  imports = [
    inputs.nixos-hardware.nixosModules.clockworkpi-uconsole-cm4
  ];

  # Optional: enable 4G modem
  hardware.clockworkpi-uconsole-cm4.modem-4g.enable = true;
}

Credits go to @zyriab for figuring most of this stuff out.

Add hardware support for the ClockworkPi uConsole with CM4 module:
- Display panel driver (CWU50 5" DSI 720x1280)
- AXP228 power management IC
- OCP8178 backlight controller
- Optional 4G modem support with GPIO control

Kernel patches are applied to enable the custom hardware drivers
and device tree overlays required for the uConsole.
@zyriab
Copy link

zyriab commented Jan 15, 2026

Hey thanks for opening this PR!

Credits to @robertjakub for laying out most of the work 😎

@robertjakub
Copy link

Hey thanks for opening this PR!

the patches were build upon the vendor kernel package(s) and still WIP. Need to be confirmed if they can be applied to the mainstream kernel. also the required overlays should be loaded to enable the hardware. For default upstream nixos requires overlays to be merged with the base dtb.

I suggest to work on merging the @nvmd nixos-raspberry ((-;

(just my 2 agorots...)

-j.

@pinpox
Copy link
Member Author

pinpox commented Jan 15, 2026

@robertjakub I'm building the changes as we speak to figure out if everything works. Do you think there is a better way of sourcing these patches instead of putting them here?

also the required overlays should be loaded to enable the hardware.

Can you expand on how to do this? I'm not sure I fully understand.

I suggest to work on merging the @nvmd nixos-raspberry ((-;

Do you mean merging nixos-raspberry into this repository or moving this PR to the nixos-raspberry repo?

Also thanks for the work on this! I would like to find the best way to have this platform supported in a central place all nixos users can find it and use it easily along their other machine configurations.

@robertjakub
Copy link

@robertjakub I'm building the changes as we speak to figure out if everything works. Do you think there is a better way of sourcing these patches instead of putting them here?

also the required overlays should be loaded to enable the hardware.

Can you expand on how to do this? I'm not sure I fully understand.

uConsole need to load an clockworkpi-uconsole device-tree overlay to enable specific hardware (i.e. display).

on Raspberry, adding a line (dtoverlay=....) to /boot/config.txt allows to tell the firmware to load the overlay, dynamically configuring pins, buses, and other settings for that specific hardware.

unfortunately mainstream nixos do not expose the custom DTOs to /boot or we need to specifically add it to hardware.deviceTree.overlays.

I suggest to work on merging the @nvmd nixos-raspberry ((-;

Do you mean merging nixos-raspberry into this repository or moving this PR to the nixos-raspberry repo?

Both ways ((-; let's say - uConsole is just a great machine build on Raspberry PI Compute Module (3/4/5). Unfortunately support for RPi in nixos-hardware is weak. Nixos-Raspberry is a flake build to specifically support RPi (including Raspberry Pi 4 and 5) with all the possibilities RPi offer.

it will be great to incorporate nixos-raspebery into this repo... but maybe it is a good idea to move this PR to the nixos-rPI repo...

Also thanks for the work on this! I would like to find the best way to have this platform supported in a central place all nixos users can find it and use it easily along their other machine configurations.

-j.

@pinpox
Copy link
Member Author

pinpox commented Feb 4, 2026

For future reference, I'm using this now on my own uConsole here and here. Getting LUKS full disk encryption to work was a bit tricky, but how the screen comes on soon enough in the boot process to be able to type the LUKS passphrase. I'm currently waiting for the NVME extension board and will continue testing when it arrives.

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.

3 participants