Skip to content

Commit 2b9cb66

Browse files
authored
Merge branch 'raspberrypi:master' into patch-1
2 parents f807527 + 9f61b87 commit 2b9cb66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+16099
-3286
lines changed

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
cmake_minimum_required(VERSION 3.1)
1+
cmake_minimum_required(VERSION 3.1...3.27)
22

33
project(utils)
44

55
# List of subsidiary CMakeLists
66
add_subdirectory(dtmerge)
7+
add_subdirectory(eeptools)
8+
add_subdirectory(kdtc)
79
add_subdirectory(otpset)
810
add_subdirectory(overlaycheck)
911
add_subdirectory(ovmerge)
1012
add_subdirectory(pinctrl)
13+
add_subdirectory(piolib)
1114
add_subdirectory(raspinfo)
15+
add_subdirectory(vcgencmd)
1216
add_subdirectory(vclog)
1317
add_subdirectory(vcmailbox)
14-
add_subdirectory(vcgencmd)
18+
19+
# Only build rpifwcrypto if GnuTLS is available
20+
include(CheckIncludeFile)
21+
check_include_file(gnutls/crypto.h HAVE_GNUTLS_CRYPTO_H)
22+
if(HAVE_GNUTLS_CRYPTO_H)
23+
add_subdirectory(rpifwcrypto)
24+
else()
25+
message(STATUS "gnutls/crypto.h not found - skipping rpifwcrypto")
26+
endif()

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ A collection of scripts and simple applications
33

44
* [dtmerge](dtmerge/) - A tool for applying compiled DT overlays (`*.dtbo`) to base Device
55
Tree files (`*.dtb`). Also includes the `dtoverlay` and `dtparam` utilities.
6+
* [eeptools](eeptools/) - Tools for creating and managing EEPROMs for HAT+ and HAT board.
7+
* [kdtc](kdtc/) - A tool for compiling overlays with #includes, etc., as used in the kernel tree.
68
* [otpset](otpset/) - A short script to help with reading and setting the customer OTP
79
bits.
810
* [overlaycheck](overlaycheck/) - A tool for validating the overlay files and README in a
@@ -13,16 +15,21 @@ A collection of scripts and simple applications
1315
* [pinctrl](pinctrl/) - A more powerful replacement for raspi-gpio, a tool for
1416
displaying and modifying the GPIO and pin muxing state of a system, bypassing
1517
the kernel.
18+
* [piolib](piolib/) - A library for accessing the Pi 5's PIO hardware.
1619
* [raspinfo](raspinfo/) - A short script to dump information about the Pi. Intended for
1720
the submission of bug reports.
21+
* [rpifwcrypto](rpifwcrypto/) - A command line application and shared library for the
22+
firmware cryptography service. Intended for use with Raspberry Pi Connect and
23+
secure-boot provisioner.
1824
* [vclog](vclog/) - A tool to get VideoCore 'assert' or 'msg' logs
1925
with optional -f to wait for new logs to arrive.
2026

2127

2228
**Build Instructions**
2329

24-
Install the prerequisites with "sudo apt install cmake device-tree-compiler libfdt-dev" - you need at least version 3.10 of cmake. Run the following commands to build and install everything, or see the README files in the subdirectories to just build utilities individually:
30+
Install the prerequisites with "sudo apt install cmake device-tree-compiler libfdt-dev libgnutls28-dev" - you need at least version 3.10 of cmake. Run the following commands to build and install everything, or see the README files in the subdirectories to just build utilities individually:
2531

2632
- *cmake .*
33+
N.B. Use *cmake -DBUILD_SHARED_LIBS=1 .* to build the libraries in the subprojects (libdtovl, gpiolib and piolib) as shared (as opposed to static) libraries.
2734
- *make*
2835
- *sudo make install*

dtmerge/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.10)
1+
cmake_minimum_required(VERSION 3.10...3.27)
22

33
include(GNUInstallDirs)
44

@@ -11,8 +11,13 @@ if (CMAKE_COMPILER_IS_GNUCC)
1111
add_definitions (-ffunction-sections)
1212
endif ()
1313

14-
add_library (dtovl ${STATIC} dtoverlay.c)
14+
add_library (dtovl dtoverlay.c)
1515
target_link_libraries(dtovl fdt)
16+
set_target_properties(dtovl PROPERTIES PUBLIC_HEADER dtoverlay.h)
17+
set_target_properties(dtovl PROPERTIES SOVERSION 0)
18+
install(TARGETS dtovl
19+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
20+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
1621

1722
add_executable(dtmerge dtmerge.c)
1823
target_link_libraries(dtmerge dtovl)
@@ -21,12 +26,9 @@ install(FILES dtmerge.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
2126

2227
add_executable(dtoverlay dtoverlay_main.c utils.c)
2328
target_link_libraries(dtoverlay dtovl)
24-
install(TARGETS dtoverlay RUNTIME DESTINATION bin)
25-
install(FILES dtoverlay.1 DESTINATION man/man1)
29+
install(TARGETS dtoverlay RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
30+
install(FILES dtoverlay.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
2631

2732
add_custom_command(TARGET dtoverlay POST_BUILD COMMAND ln;-sf;dtoverlay;dtparam)
28-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dtparam DESTINATION bin)
29-
install(FILES dtparam.1 DESTINATION man/man1)
30-
31-
set(DTOVERLAY_SCRIPTS dtoverlay-pre dtoverlay-post)
32-
install(PROGRAMS ${DTOVERLAY_SCRIPTS} DESTINATION bin)
33+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dtparam DESTINATION ${CMAKE_INSTALL_BINDIR})
34+
install(FILES dtparam.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)

dtmerge/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dtparam is a tool for applying paramaters of the base Device Tree of a live syst
1212
Install the prerequisites with "sudo apt install cmake libfdt-dev" - you need at least version 3.10 of cmake. Run the following commands here, or in the top-level directory to build and install all the utilities:
1313

1414
- *cmake .*
15+
N.B. Use *cmake -DBUILD_SHARED_LIBS=1 .* to build libdtovl as a shared (as opposed to static) library.
1516
- *make*
1617
- *sudo make install*
1718

@@ -20,9 +21,9 @@ Install the prerequisites with "sudo apt install cmake libfdt-dev" - you need at
2021
```
2122
Usage:
2223
dtmerge [<options] <base dtb> <merged dtb> - [param=value] ...
23-
to apply a parameter to the base dtb (like dtparam)
24+
to apply a parameter to the base dtb, without an overlay (like dtparam)
2425
dtmerge [<options] <base dtb> <merged dtb> <overlay dtb> [param=value] ...
25-
to apply an overlay with parameters (like dtoverlay)
26+
to apply an overlay, optionally with parameters (like dtoverlay)
2627
where <options> is any of:
2728
-d Enable debug output
2829
-h Show this help message

dtmerge/dtmerge.1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,21 @@ Displays help on the application.
5252
.TP
5353
.B dtmerge /boot/bcm2711-rpi-4-b.dtb out.dtb - spi=on i2c=on
5454
Produce a device-tree for the Raspberry Pi 4 in "out.dtb" which has the SPI and
55-
I2C interfaces activated.
55+
I2C interfaces activated. No additional device-tree overlay is applied.
5656
.
5757
.TP
5858
.B dtmerge /boot/bcm2710-rpi-3-b-plus.dtb out.dtb /boot/overlays/gpio-shutdown.dtbo
5959
Produce a device-tree for the Raspberry Pi 3+ in "out.dtb" which includes the
6060
GPIO shutdown overlay (with all parameters set to their default).
6161
.
62+
.TP
63+
.B dtmerge /boot/bcm2712-rpi-5-b.dtb out.dtb /boot/overlays/mcp2515-can0.dtbo oscillator=12000000 interrupt=25 spimaxfrequency=2000000
64+
Produce a device-tree for the Raspberry Pi 5 in "out.dtb" which includes the
65+
MCP2515 CAN bus module overlay. The overlay is configured with the following
66+
settings: the oscillator frequency is set to 12 MHz (depending on the quartz
67+
crystal used), the interrupt GPIO pin is set to 25, and the SPI frequency is
68+
limited to 2 MHz.
69+
.
6270
.
6371
.SH SEE ALSO
6472
.BR dtoverlay (1),
@@ -69,4 +77,4 @@ GPIO shutdown overlay (with all parameters set to their default).
6977
.SH REFERENCES
7078
.TP
7179
.B [DTREE]
72-
https://www.raspberrypi.org/documentation/configuration/device-tree.md
80+
https://www.raspberrypi.com/documentation/computers/configuration.html#part5.2

0 commit comments

Comments
 (0)