Skip to content

Commit 6c83c1c

Browse files
committed
extra-dts: Move i2c clock frequency dts to package
Rather than commiting the compiled device tree overlays to source control, this puts the dts files in a custom package and builds them. The device tree files are currently bit for bit identical. The only change that I made was to rename them to the standard Linux conventions: `.dts` for a terminal device tree file (i.e., not an include) and `.dtbo` for a compiled device tree overlay.
1 parent b893d2d commit 6c83c1c

10 files changed

+39
-2
lines changed

Config.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Add project-specific packages for Buildroot here
2+
3+
source "$NERVES_DEFCONFIG_DIR/package/extra-dts/Config.in"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ to. The device tree blob can be found in `/lib/firmware`.
308308
Choose one of the following:
309309

310310
```text
311-
uboot_setenv(uboot-env, "uboot_overlay_addr4", "/lib/firmware/i2c1-clock-frequency-100khz.dtb")
312-
uboot_setenv(uboot-env, "uboot_overlay_addr5", "/lib/firmware/i2c2-clock-frequency-100khz.dtb")
311+
uboot_setenv(uboot-env, "uboot_overlay_addr4", "/lib/firmware/i2c1-clock-frequency-100khz.dtbo")
312+
uboot_setenv(uboot-env, "uboot_overlay_addr5", "/lib/firmware/i2c2-clock-frequency-100khz.dtbo")
313313
```
314314

315315
You can configure your project to enable these device tree overlays by copying the

external.mk

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Include system-specific packages
2+
include $(sort $(wildcard $(NERVES_DEFCONFIG_DIR)/package/*/*.mk))

nerves_defconfig

+1
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,4 @@ BR2_NERVES_SYSTEM_NAME="nerves_system_bbb"
6767
BR2_PACKAGE_BBORG_OVERLAYS=y
6868
BR2_PACKAGE_NBTTY=y
6969
BR2_PACKAGE_NERVES_CONFIG=y
70+
BR2_PACKAGE_EXTRA_DTS=y

package/extra-dts/Config.in

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
menuconfig BR2_PACKAGE_EXTRA_DTS
2+
bool "extra-dts"
3+
select BR2_PACKAGE_HOST_DTC
4+
help
5+
Extra DTS files that may be useful on Nerves systems.

package/extra-dts/extra-dts.mk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#############################################################
2+
#
3+
# extra-dts
4+
#
5+
#############################################################
6+
7+
# Remember to bump the version when anything changes in this
8+
# directory.
9+
EXTRA_DTS_SOURCE =
10+
EXTRA_DTS_VERSION = 0.0.1
11+
EXTRA_DTS_DEPENDENCIES = host-dtc
12+
13+
define EXTRA_DTS_BUILD_CMDS
14+
cp $(NERVES_DEFCONFIG_DIR)/package/extra-dts/*.dts* $(@D)
15+
for filename in $(@D)/*.dts; do \
16+
$(CPP) -I$(@D) -nostdinc -undef -D__DTS__ -x assembler-with-cpp $$filename | \
17+
$(HOST_DIR)/usr/bin/dtc -Wno-unit_address_vs_reg -@ -I dts -O dtb -b 0 -o $${filename%.dts}.dtbo || exit 1; \
18+
done
19+
endef
20+
21+
define EXTRA_DTS_INSTALL_TARGET_CMDS
22+
cp $(@D)/*.dtbo $(TARGET_DIR)/lib/firmware
23+
endef
24+
25+
26+
$(eval $(generic-package))
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)