tail head cat sleep
QR code linking to this page

Manual Pages  — FDT_PINCTRL


fdt_pinctrl – FDT I/O pin multiplexing support



device fdt_pinctrl


Pin multiplexing is a technology used to re-purpose a single physical connection (depending on chip packaging it may be pin, ball, or pad) to pull signal from one of SoC internal controllers to peripheral devices. For example, based on the actual device design, a single SoC chip pin can perform any of these roles: SPI clock, I2C data, GPIO pin, or PWM signal. Function selection is performed by the pinmux controller, a SoC hardware block, usually controlled a set of registers. Pinmux controller capabilities and register format depend on the actual hardware implementation.

On fdt(4) based systems, the pinmux controller is represented by a node in the device tree. It may have any number of child nodes representing pin configuration groups. Properties of such nodes are hardware-specific and handled by individual pinctrl drivers.

Example 1

Pinmux controller device tree node
pinctrl@7e220000 {
    compatible = "vndr,soc1715-pinctrl";
    reg = <0x7e220000 0x100>

spi0_pins: spi0 { vndr,pins = <11 12> vndr,functions = <ALT0 ALT5> }

i2c0_pins: i2c0 { ... } }

Client devices are hardware devices that require certain pin configurations to function properly. Depending on the state the device is in (active, idle) it might require different pin configurations. Each configuration is described by setting the pinctrl-N property to the list of phandles pointing to specific child nodes of the pinmux controller node. N is an integer value starting with 0 and incremented by 1 for every new set of pin configurations. pinctrl-0 is a default configuration that is applied in the fdt_pinctrl_configure_tree(9) call. In addition to referring to pin configurations by index, they can be referred to by name if the pinctrl-names property is set. The value of pinctrl-names is a list of strings with names for each pinctrl-N property. Client devices can request specific configuration using fdt_pinctrl_configure(9) and fdt_pinctrl_configure_by_name(9).

Example 2

backlight@7f000000 {
    compatible = "vndr,vndr-bl"
    reg = <0x7f000000 0x20>
    pinctrl-name = "active", "idle"
    pinctrl-0 = <&backlight_active_pins>
    pinctrl-1 = <&backlight_idle_pins>

The pinctrl driver should implement FDT_PINCTRL_CONFIGURE method, register itself as pin configuration handler by calling fdt_pinctrl_register function, and call fdt_pinctrl_configure_tree(9) to configure pins for all enabled devices (device where the "status" property is not set to "disabled").




The fdt_pinctrl driver first appeared in FreeBSD 10.2 .


The fdt_pinctrl device driver was developed by Ian Lepore <Mt ian@FreeBSD.org>. This manual page was written by Oleksandr Tymoshenko <Mt gonzo@FreeBSD.org>.

FDT_PINCTRL (4) March 2, 2018

tail head cat sleep
QR code linking to this page

Please direct any comments about this manual page service to Ben Bullock.

This philosophy, in the hands of amateurs, leads to inexplicably mind-numbing botches like the existence of two programs, “head” and “tail,” which print the first part or the last part of a file, depending. Even though their operations are duals of one another, “head” and “tail” are different programs, written by different authors, and take different options!
— The Unix Haters' handbook