Functional GPIO
The following code blocks show an example of a functional GPIO device tree configuration.
pcie0_perst_default: pcie0_perst_default {
perst-pins {
sf,pins = <PAD_GPIO26>;
sf,pinmux = <PAD_GPIO26_FUNC_SEL 0>;
sf,pin-ioconfig = <IO(GPIO_IE(1))>;
sf,pin-gpio-dout = <GPO_HIGH>;
sf,pin-gpio-doen = <OEN_LOW>;
};
};
pcie0_perst_active: pcie0_perst_active {
perst-pins {
sf,pins = <PAD_GPIO26>;
sf,pinmux = <PAD_GPIO26_FUNC_SEL 0>;
sf,pin-ioconfig = <IO(GPIO_IE(1))>;
sf,pin-gpio-dout = <GPO_LOW>;
sf,pin-gpio-doen = <OEN_LOW>;
};
};
pcie0_power_active: pcie0_power_active {
power-pins {
sf,pins = <PAD_GPIO32>;
sf,pinmux = <PAD_GPIO32_FUNC_SEL 0>;
sf,pin-ioconfig = <IO(GPIO_IE(1))>;
sf,pin-gpio-dout = <GPO_HIGH>;
sf,pin-gpio-doen = <OEN_LOW>;
};
};
&pcie0 {
pinctrl-names = "perst-default", "perst-active", "power-active";
pinctrl-0 = <&pcie0_perst_default>;
pinctrl-1 = <&pcie0_perst_active>;
pinctrl-2 = <&pcie0_power_active>;
status = "okay";
};
In the above example, make sure you understand the use of the following values:
- The parameter value of “perst-default” in pinctrl-0 is the pin configuration for normal work mode.
- The parameter value of “perst-active” in pinctrl-1 is the pin configuration for active mode.
