DTOVERLAY(1)

NAME
dtoverlay - load a device-tree overlay

SYNOPSIS
dtoverlay [-d dir] [-p string] [-v] [-D] [-r] [-R] [-l] [-a] [overlay [param=val...]]
dtoverlay -h [overlay [param]]

DESCRIPTION
dtoverlay is a command line utility for manipulating the system's runtime device-tree by adding or removing overlays. It can also customize the base device-tree or overlays by setting parameters within them. See [DTREE] for more information.

By default, without the -r or -R options, the application adds the specified overlay. Manipulation of active device-tree overlays usually requires root privileges.

OPTIONS

-a  Lists all defined device-tree overlays, placing a "*" next to those that are currently loaded.

-d dir
    Specifies an alternate location path from which to load overlays. The utility defaults to "/boot/overlays" or "/flash/overlays".

-D  Dry-run; prepares the specified overlay but doesn't apply it. The resulting prepared overlay is saved as "dry-run.dtbo".

-h[overlay][param]
    If given without overlay or param displays help on the application overall. If overlay is specified, prints help on that overlay. Finally, if param is also specified, prints help on that parameter of the overlay. To query parameters on the base overlay, specify "dtparam" as the overlay.

-l  Lists all currently loaded device-tree overlays, in the order they were loaded. This also specifies the index of each overlay.

-p string
    Override the platform's "compatible" string, normally read from "/proc/device-tree/compatible". This is used with the overlay map to determine which platform-specific overlay to read (if necessary).

-r  Remove overlay. With this option, the utility will remove the specified overlay. If no overlay is given, the last overlay loaded will be removed. Overlays can be specified by name or by index.

-R  Remove the specified overlay, and all subsequent overlays that were loaded after it. If no overlay is given, all overlays will be removed. Overlays can be specified by name or by index.

-v  Verbose operation; the utility will produce more output.

EXAMPLES

sudo dtoverlay w1-gpio
    Load the w1-gpio overlay (to enable Dallas 1-Wire on GPIO4). Note that root privileges are usually required for manipulating the device-tree overlays (hence, sudo in the example).

dtoverlay -l
    Show the loaded overlays.

sudo dtoverlay -r
    Remove the last loaded overlay.

sudo dtoverlay gpio-shutdown gpio_pin=7 active_low=0 gpio_pull=down
    Load the gpio-shutdown overlay specifying that it should pull GPIO7 down and monitor it for a rising edge to initiate shutdown.

dtoverlay -h gpio-shutdown
    Display help for the gpio-shutdown overlay

sudo dtoverlay -r gpio-shutdown
    Remove the gpio-shutdown overlay, wherever it is in the load order.

HOOKS
dtoverlay attempts to call two executables (shell scripts by default) during its operation: dtoverlay-pre prior to making device-tree modifications, and dtoverlay-post afterwards. Each executable is optional and will be ignored if not present.

SEE ALSO
dtparam(1), dtmerge(1), [DTREE]

REFERENCES

[DTREE]
    https://www.raspberrypi.org/documentation/configuration/device-tree.md