Instantly share code, notes, and snippets.

Embed
What would you like to do?
boot-time device tree overlays with U-Boot
part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
fdt addr ${fdt_addr_r}
fdt resize
setexpr fdtovaddr ${fdt_addr_r} + F000
if load ${devtype} ${devnum}:${bootpart} ${fdtovaddr} /boot/dtbs/overlay.txt && env import -t ${fdtovaddr} ${filesize} && test -n ${overlay}; then
echo loaded overlay.txt: ${overlay}
for ov in ${overlay}; do
echo overlaying ${ov}...
load ${devtype} ${devnum}:${bootpart} ${fdtovaddr} /boot/dtbs/${ov}.dtb && fdt apply ${fdtovaddr}
done
fi
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
bootz ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun7i-a20";
fragment@0 {
target = <&i2c2>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
ina219@40 {
status = "okay";
compatible = "ti,ina219";
reg = <0x40>;
shunt-resistor = <100000>; // R100
};
};
};
};
overlay=abc ina219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment