From a7456a885ecaa3832cfc4576fa35288e62548e4e Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Mon, 6 Jan 2025 02:07:10 -0700 Subject: [PATCH] add devicetree overlay to append cmdline, use it to make gpio commands persist --- Makefile | 18 ++++++++++++++++++ debian/quantimotor.install | 2 ++ devicetree/Makefile | 9 +++++++++ devicetree/append_cmdline.dts | 16 ++++++++++++++++ devicetree/raspi-firmware-custom | 1 + 5 files changed, 46 insertions(+) create mode 100644 Makefile create mode 100644 devicetree/Makefile create mode 100644 devicetree/append_cmdline.dts create mode 100644 devicetree/raspi-firmware-custom diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..435bf46 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +# Top level Makefile for the QuantiMotor software Debian package +# Copyright 2025 Bdale Garbee , GPL-3+ + +SUBDIRS := devicetree +SUBDIRS-clean := $(addsuffix -clean,$(SUBDIRS)) + +all: $(SUBDIRS) + +clean: $(SUBDIRS-clean) + +$(SUBDIRS): + $(MAKE) -C $@ + +$(SUBDIRS-clean): + $(MAKE) -C $(subst -clean,,$@) clean + +.Suffixes: +.PHONY: all clean $(SUBDIRS) $(SUBDIRS-clean) diff --git a/debian/quantimotor.install b/debian/quantimotor.install index c1c1c8f..c541b3a 100644 --- a/debian/quantimotor.install +++ b/debian/quantimotor.install @@ -1,2 +1,4 @@ bcm2837-rpi-zero-2-w.dtb usr/share/quantimotor z99-quantimotor etc/kernel/postinst.d +devicetree/append_cmdline.dtbo boot/firmware/overlays +devicetree/raspi-firmware-custom etc/default diff --git a/devicetree/Makefile b/devicetree/Makefile new file mode 100644 index 0000000..4957e57 --- /dev/null +++ b/devicetree/Makefile @@ -0,0 +1,9 @@ +all: append_cmdline.dtbo + +append_cmdline.dtbo: append_cmdline.dts + dtc -I dts -O dtb -o $@ $< + +clean: + rm -f append_cmdline.dtbo + +.PHONY: clean diff --git a/devicetree/append_cmdline.dts b/devicetree/append_cmdline.dts new file mode 100644 index 0000000..3f9509f --- /dev/null +++ b/devicetree/append_cmdline.dts @@ -0,0 +1,16 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&chosen>; + frag0: __overlay__ { + }; + }; + + __overrides__ { + append = <&frag0>, "bootargs"; + }; +}; diff --git a/devicetree/raspi-firmware-custom b/devicetree/raspi-firmware-custom new file mode 100644 index 0000000..3bb3f67 --- /dev/null +++ b/devicetree/raspi-firmware-custom @@ -0,0 +1 @@ +dtoverlay=append_cmdline,append=pinctrl_bcm2835.persist_gpio_outputs=y -- 2.47.2