Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions host_applications/linux/apps/dtmerge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ add_executable(dtmerge dtmerge.c)
target_link_libraries(dtmerge dtovl)

install(TARGETS dtmerge RUNTIME DESTINATION bin)
install(FILES dtmerge.1 DESTINATION man/man1)
72 changes: 72 additions & 0 deletions host_applications/linux/apps/dtmerge/dtmerge.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.TH DTMERGE 1
.
.SH NAME
dtmerge \- merge an overlay or parameters into a base device-tree
.
.
.SH SYNOPSIS
.SY dtmerge
.OP \-d
.I base-dtb
.I merged-dtb
.I overlay-dtb
.RI [ param=val \|.\|.\|.]
.YS
.
.SY dtmerge
.B \-h
.YS
.
.
.SH DESCRIPTION
.B dtmerge
is a command line utility for merging overlays and/or device-tree parameters
with a base device-tree.
See
.B [DTREE]
for more information.
.
.PP
The base device-tree (in dtb format) is always specified as the first
(non-option) argument.
The second argument is the output filename, which will also be in dtb format.
The third argument provides the name of the overlay to merge into the base
tree.
If this is "-" then no overlay is used and the utility will simply customize
the base tree with any parameters given.
.
.
.SH OPTIONS
.
.TP
.BR \-d
Show debug output during operation.
.
.TP
.BR \-h
Displays help on the application.
.
.
.SH EXAMPLES
.
.TP
.B dtmerge /boot/bcm2711-rpi-4-b.dtb out.dtb - spi=on i2c=on
Produce a device-tree for the Raspberry Pi 4 in "out.dtb" which has the SPI and
I2C interfaces activated.
.
.TP
.B dtmerge /boot/bcm2710-rpi-3-b-plus.dtb out.dtb /boot/overlays/gpio-shutdown.dtbo
Produce a device-tree for the Raspberry Pi 3+ in "out.dtb" which includes the
GPIO shutdown overlay (with all parameters set to their default).
.
.
.SH SEE ALSO
.BR dtoverlay (1),
.BR dtparam (1),
.B [DTREE]
.
.
.SH REFERENCES
.TP
.B [DTREE]
https://www.raspberrypi.org/documentation/configuration/device-tree.md
2 changes: 2 additions & 0 deletions host_applications/linux/apps/dtoverlay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ include_directories (
add_executable(dtoverlay dtoverlay_main.c utils.c)
target_link_libraries(dtoverlay dtovl)
install(TARGETS dtoverlay RUNTIME DESTINATION bin)
install(FILES dtoverlay.1 DESTINATION man/man1)

add_custom_command(TARGET dtoverlay POST_BUILD COMMAND ln;-sf;dtoverlay;dtparam)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dtparam DESTINATION bin)
install(FILES dtparam.1 DESTINATION man/man1)

set(DTOVERLAY_SCRIPTS dtoverlay-pre dtoverlay-post)
install(PROGRAMS ${DTOVERLAY_SCRIPTS} DESTINATION bin)
153 changes: 153 additions & 0 deletions host_applications/linux/apps/dtoverlay/dtoverlay.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
.TH DTOVERLAY 1
.
.SH NAME
dtoverlay \- load a device-tree overlay
.
.
.SH SYNOPSIS
.SY dtoverlay
.OP \-d dir
.OP \-p string
.OP \-v
.OP \-D
.OP \-r
.OP \-R
.OP \-l
.OP \-a
.RI [ overlay " [" param=val \|.\|.\|.]]
.YS
.
.SY dtoverlay
.B \-h
.RI [ overlay " [" param ]]
.YS
.
.
.SH DESCRIPTION
.B 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
.B [DTREE]
for more information.
.
.PP
By default, without the
.B -r
or
.B -R
options, the application adds the specified overlay. Manipulation of
active device-tree overlays usually requires root privileges.
.
.
.SH OPTIONS
.
.TP
.BR \-a
Lists all defined device-tree overlays, placing a "*" next to those that are
currently loaded.
.
.TP
.BR \-d " \fIdir\fR"
Specifies an alternate location path from which to load overlays. The utility
defaults to "/boot/overlays" or "/flash/overlays".
.
.TP
.BR \-D
Dry-run; prepares the specified overlay but doesn't apply it. The resulting
prepared overlay is saved as "dry-run.dtbo".
.
.TP
.BR \-h [\fIoverlay\fR] [\fIparam\fR]
If given without
.I overlay
or
.I param
displays help on the application overall. If
.I overlay
is specified, prints help on that overlay. Finally, if
.I param
is also specified, prints help on that parameter of the overlay. To query
parameters on the base overlay, specify "dtparam" as the
.IR overlay .
.
.TP
.BR \-l
Lists all currently loaded device-tree overlays, in the order they were loaded.
This also specifies the index of each overlay.
.
.TP
.BR \-p " \fIstring\fR"
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).
.
.TP
.BR \-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.
.
.TP
.BR \-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.
.
.TP
.BR \-v
Verbose operation; the utility will produce more output.
.
.
.SH EXAMPLES
.
.TP
.B 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).
.
.TP
.B dtoverlay -l
Show the loaded overlays.
.
.TP
.B sudo dtoverlay -r
Remove the last loaded overlay.
.
.TP
.B 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.
.
.TP
.B dtoverlay -h gpio-shutdown
Display help for the gpio-shutdown overlay
.
.TP
.B sudo dtoverlay -r gpio-shutdown
Remove the gpio-shutdown overlay, wherever it is in the load order.
.
.
.SH HOOKS
.B dtoverlay
attempts to call two executables (shell scripts by default) during its
operation:
.B dtoverlay-pre
prior to making device-tree modifications, and
.B dtoverlay-post
afterwards. Each executable is optional and will be ignored if not present.
.
.
.SH SEE ALSO
.BR dtparam (1),
.BR dtmerge (1),
.B [DTREE]
.
.
.SH REFERENCES
.TP
.B [DTREE]
https://www.raspberrypi.org/documentation/configuration/device-tree.md
66 changes: 66 additions & 0 deletions host_applications/linux/apps/dtoverlay/dtparam.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.TH DTPARAM 1
.
.SH NAME
dtparam \- mainpulate parameters of the base device-tree
.
.
.SH SYNOPSIS
.SY dtparam
.RI [ param=val \|.\|.\|.]
.YS
.
.SY dtparam
.B \-h
.RI [ param ]
.YS
.
.
.SH DESCRIPTION
.B dtparam
is a command line utility for manipulating the base device-tree's parameters.
For example, it can be used to enable the SPI or I2C interfaces at runtime
without rebooting.
If
.B dtparam
is run without any argument, it prints the names of all base device-tree
parameters and their description.
.
.
.SH OPTIONS
.
.TP
.BR \-h " [\fIparam\fR]"
If given without
.I param
displays help on the application overall. If
.I param
is specified, prints help about that parameter in the base device-tree.
.
.
.SH EXAMPLES
.
.TP
.B sudo dtparam spi=on
Enable the SPI interface on the GPIO header. Note that root privileges are
usually required for manipulating the base device-tree (hence, sudo in the
example).
.
.TP
.B dtparam -h spi
Print help about the "spi" parameter.
.
.TP
.B sudo dtparam audio=off
Disable the audio output.
.
.
.SH SEE ALSO
.BR dtoverlay (1),
.BR dtmerge (1),
.B [DTREE]
.
.
.SH REFERENCES
.TP
.B [DTREE]
https://www.raspberrypi.org/documentation/configuration/device-tree.md
2 changes: 1 addition & 1 deletion host_applications/linux/apps/gencmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ include_directories( ../../../..
add_executable(vcgencmd gencmd.c)
target_link_libraries(vcgencmd vcos vchiq_arm vchostif)
install(TARGETS vcgencmd RUNTIME DESTINATION bin)

install(FILES vcgencmd.1 DESTINATION man/man1)
Loading