Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Raspberry Pi zero 2 dtb and devices



dtyson%anduin.org.uk@localhost (Dave Tyson) writes:

>If the user wants to change the function of an i/o pin then they are free to 
>use the gpio device to alter the cross bar register as they desire, but this 
>should not be necessary for normal operation of the interfaces in the 
>published board description.

There are various methods.

The GPIO device allows to configure the pins, but only for RPI. It's not
implemented for other SOCs, it is ignored by the device tree code and
(being older) doesn't know about device trees either. It also has a hard
coded list of GPIO pins that it wants to manage, so there can be a
conflict about the various "firmware uses" of specific GPIO pins.

Linux uses the device tree, it also has most devices not configured
(so pins are just input and no driver is attached), but you can augment
the device tree with overlays to configure functionality and to give
the driver Linux-specific parameters. Biggest problem here is that
DTBs and overlays aren't compatible between systems.

For RPI there are also at least two device tree flavours, the one
from RPI foundation in RPI OS, and the one in mainline Linux
(I think Ubuntu uses it). Ours is based on mainline Linux, but
with modifications.

Some dormant device-tree configuration can also be influenced by
the 'dtparam' command in the RPI config.txt. The firmware then
generates tiny DTB overlays on the fly for Linux.

RPI also knows "HATs". These hardware add-ons have an EEPROM with
configuration data and the firmware merges this into the device
tree provided to the kernel. This usually configures the GPIO pins
as necessary for this particular HAT and merges the configuration
into the device tree.



Home | Main Index | Thread Index | Old Index