Skip to content

Dynamic loading of UART overlays does not create /dev/ttyAMA #7019

Closed

Description

@webmeister

Describe the bug

If I set dtoverlay=uart3 in /boot/config.txt on a Raspberry Pi 4 and reboot, /dev/ttyAMA3 exists. If I don't set dtoverlay=uart3 in /boot/config.txt and instead run dtoverlay uart3, no /dev/ttyAMA3 appears.

This is different from how other overlays work. For example, running dtoverlay spi0-1cs causes /dev/spidev0.0 to appear immediately, similar to how it exists after a reboot when instead setting dtoverlay=spi0-1cs in /boot/config.txt.

A similar issue has been mentioned in https://raspberrypi.stackexchange.com/questions/143151/pi4-enable-uart4-without-using-boot-config-txt, but I was unable to find a solution.

Steps to reproduce the behaviour

  1. Ensure there are no dtoverlay=uart* entries in /boot/config.txt
  2. Run dtoverlay uart3
  3. Check whether a corresponding /dev/ttyAMA3 exists

Device (s)

Raspberry Pi 4 Mod. B

System

Arch Linux ARM

$ vcgencmd version
May 14 2025 12:23:36
Copyright (c) 2012 Broadcom
version 17084b403fb60475b8ee2641c26049a7d54bf153 (clean) (release) (start)
$ uname -a
Linux rpi 6.12.43-1-rpi #1 SMP PREEMPT Tue Aug 26 13:22:07 MDT 2025 aarch64 GNU/Linux

Logs

No response

Additional context

No response

Activity

  1. pelwell commented on Aug 29, 2025

    @pelwell
    Contributor

    Dynamic changes to Device Tree are not universally supported in Linux. They often rely on a parent node or bus registering to be notified of changes, and that doesn't happen for all devices. The GPIO, SPI and I2C subsystems do register for notifications, as does the "platform" bus type.

    The Device Trees for Raspberry Pis (along with almost all other devices), declare the UART as an AMBA bus device ("arm,pl011") because that's what the driver expects. (There is a platform bus variant, but with tweaks for one specific manufacturer). Well, that's what the upstream driver expects - for Pi 5 support we added an AXI variant (compatible string "arm,pl011-axi") in the downstream kernel tree that registers as a normal platform bus device.

    Q. What happens if we change the compatible string for all the Pi PL011 UARTs to "arm,pl011-axi"?
    A. When we load the overlay for, say, UART3, the notifier for the platform bus picks up the change, identifies the UART as a platform device, creates the device, and /dev/ttyAMA3 appears.

    I've created a PR (#7023) that changes to downstream DT files to use "arm,pl011-axi". If you wait for the autobuilds to complete (usually about 40 minutes) you should be able to install a trial kernel using sudo rpi-update pulls/7023. Note that this might cause problems if you are relying on an initramfs file for e.g. a non-standard root filing system. It might be wise to do a trial boot with autoinitramfs=0 in config.txt to confirm that it still boots OK, before applying the update.

  2. webmeister commented on Sep 25, 2025

    @webmeister
    ContributorAuthor

    Thanks for your help (and sorry it took so long to respond), this works as expected for me :) Using the code from #7023, when I run dtoverlay uart3 the corresponding /dev/ttyAMA3 appears automatically.

  3. pelwell commented on Sep 25, 2025

    @pelwell
    Contributor

    #7023 has been merged, so this issue will be fixed in future releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions