Device Tree overlays for sunxi devices
📙 End user documentation
💬 Forum thread for issues and suggestions
Technical info
Requirements
- mainline u-boot 2017.03 or newer with
CONFIG_OF_LIBFDT_OVERLAYenabled - latest version of appropriate boot script
- existing armbianEnv.txt with correct
overlay_prefixvalue - Device Tree compiler with overlays support for compiling the overlays
Notes:
- Older u-boot versions require this patch to fix endiannes of values obtained with
fdt get valuecommand
Implementation details
Boot script reads /boot/armbianEnv.txt which may contain following environment variables:
overlay_prefixoverlaysuser_overlays- overlay specific parameters
Overlay files referenced by overlays and user_overlays variables are loaded and applied using fdt apply command. After applying all overlays a SoC specific fixup script is executed to process overlay specific parameters.
Limitations
- U-boot
fdtcommand does not support "list of cells" values which limits implementing things like GPIO SPI chip selects with variable GPIO pins that require this type of values:
cs-gpios = <0>, <&pio 0 1 0>, <&pio 7 7 0>; /* Native, PA1, PH7 */
-
U-boot does not support overlay parameters, so changing values is implemented via executing a "fixup" script after all overlays were applied. This script uses environment variables loaded from
/boot/armbianEnv.txtto change the live tree usingfdtcommand. -
Since SoCs have multiple controllers of the same type (I2C, SPI) that can be exposed in different combinations on different boards, adding slave I2C and SPI devices is solved by adding a slave node with
status = "disabled";to each controller and then enabling one of the nodes (with respective controller) in the fixup script based on provided bus number for the specified device type. -
Since some slave devices require additional resources (oscillators, interrupt pins), for the simplicity and consistence only one slave device of each type can be activated by the provided overlays.