Skip to content

Instantly share code, notes, and snippets.

@matwey
Last active March 14, 2026 13:17
Show Gist options
  • Select an option

  • Save matwey/629be97641f02c6ecb48308c0b63da79 to your computer and use it in GitHub Desktop.

Select an option

Save matwey/629be97641f02c6ecb48308c0b63da79 to your computer and use it in GitHub Desktop.
u-boot overlay.dtbo
# mkimage -A arm -T script -C none -n "Boot script" -d boot.cmd boot.scr
load ${devtype} ${devnum}:${distro_bootpart} ${fdtoverlay_addr_r} ${prefix}overlay.dtbo
fdt addr ${fdtcontroladdr}
fdt resize 16384
fdt apply ${fdtoverlay_addr_r}
CPP=cpp
DTC=dtc
MKIMAGE=mkimage
LINUX=/home/matwey/lab/linux
all: boot.scr overlay.dtbo
clean:
rm -rf boot.scr overlay.dtbo overlay.i
boot.scr: boot.cmd
${MKIMAGE} -A arm -T script -C none -n "Boot script" -d $< $@
overlay.i: overlay.dtso
${CPP} -x assembler-with-cpp -I ${LINUX}/include $< $@
overlay.dtbo: overlay.i
${DTC} -@ -O dtb -o $@ $<
/* cpp -x assembler-with-cpp -I /home/matwey/lab/linux/include overlay.dtso overlay.i */
/* dtc -O dtb -o overlay.dtbo overlay.dtso */
/dts-v1/;
/plugin/;
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/gpio/gpio.h>
&i2c0 {
status = "okay";
};
&i2c1 {
status = "okay";
};
&{/soc} {
test-node {
compatible = "test";
status = "okay";
};
/*
i2c-gpio {
compatible = "i2c-gpio";
sda-gpios = <&pio 8 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; // PI0 (29)
scl-gpios = <&pio 8 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; // PI15 (31)
i2c-gpio,delay-us = <2>; /* ~100 kHz */
/* #address-cells = <1>;
#size-cells = <0>;
status = "okay";
testunit@30 {
compatible = "slave-testunit";
reg = <(0x30 | I2C_OWN_SLAVE_ADDRESS)>;
};
};*/
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment