Skip to content

nixos/linux_rpi4: Broken device trees cause UART failure on Raspberry Pi 4 #465278

@hicklin

Description

@hicklin

Nixpkgs version

  • Beta (25.11)

Describe the bug

Raspberry Pi 4 UARTs fails to initialise when using pkgs.linuxKernel.packages.linux_rpi4 (version 6.12.47-stable_20250916). The UARTs initialise correctly when switching to vanilla linux (version 6.12.58). See kernel logs in the relevant section below.

Additionally, this fix requires changing the console kernel parameter from ttyS0 to ttyS1.

This is likely due to a misconfigured DT overlay.

Steps to reproduce

  1. Follow the instruction on the Installing NixOS on a Raspberry Pi page until and including the Installing and configuring NixOS section. Note If you want to use UART at this stage, you will have to manually modify the consol parameter as described above in boot/extlinux/extlinux.conf before the "Booting NixOS live image" section.
  2. Inspect the kernel logs after reboot. This should be similar to the linux_rpi4-6.12.47 logs shared below.

To get a working UART, you can replace the kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; in the configuration.nix with

    kernelPackages = pkgs.linuxPackages;
    kernelParams = lib.mkForce [
        "console=ttyS1,115200n8"
        "console=ttyAMA0,115200n8"
        "console=tty0"
        "nohibernate"
        "loglevel=7"
    	"lsm=landlock,yama,bpf"
    ];

This will use the vanilla kernel and set console=ttyS1.

Expected behaviour

The UART should be correctly initialised as shown in the linux-6.12.58 kernel logs.

Screenshots

No response

Relevant log output

## `linux-6.12.58`

Here is the kernel output, greped for "serial", when UART is working. I.e. vanilla kernel and `ttyS0` changed to `ttyS1`.


[    0.444666] fe215040.serial: ttyS1 at MMIO 0xfe215040 (irq = 25, base_baud = 62499999) is a 16550
[    1.543468] msm_serial: driver initialized
[    1.681578] usbcore: registered new interface driver usbserial_generic
[    1.688245] usbserial: USB Serial support registered for generic
[    1.874998] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 32, base_baud = 0) is a PL011 rev3
[    3.246818] serial serial0: tty port ttyAMA0 registered
[    8.628158] systemd[1]: Created slice Slice /system/serial-getty.


## `linux_rpi4-6.12.47`

Here is the kernel output when using `kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;` only. Console is set to `ttyS0`.


[    0.715853] usbcore: registered new interface driver usbserial_generic
[    0.715869] usbserial: USB Serial support registered for generic
[    0.754910] uart-pl011 fe201000.serial: there is not valid maps for state default
[    0.755161] uart-pl011 fe201000.serial: cts_event_workaround enabled
[    0.755472] fe201000.serial: ttyAMA1 at MMIO 0xfe201000 (irq = 38, base_baud = 0) is a PL011 rev3
[    0.755612] serial serial0: tty port ttyAMA1 registered
[    0.756540] bcm2835-aux-uart fe215040.serial: there is not valid maps for state default
[    0.756965] bcm2835-aux-uart fe215040.serial: error -EINVAL: unable to register 8250 port
[    0.756991] bcm2835-aux-uart fe215040.serial: probe with driver bcm2835-aux-uart failed with error -22
[    8.376127] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[    8.376315] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator

Additional context

Hardware: Raspberry Pi 4B

System metadata

  • system: "aarch64-linux"
  • host os: Linux 6.12.47, NixOS, 25.11 (Xantusia), 25.11pre901419.5ae3b07d8d65
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.31.2
  • channels(root): "nixos-25.11pre901419.5ae3b07d8d65"
  • nixpkgs: /nix/store/75iiz86idhy5nam496h5rx9asi6mi5qf-nixos-25.11pre901419.5ae3b07d8d65/nixos

Notify maintainers

@thoughtpolice @TredwellGit @K900 @Ma27 @NeQuissimus @alyssais


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions