cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mdematos
Visitor
Visitor
220 Views
Registered: ‎10-19-2016

MPSOC/RFSOC GPIO configuration in device tree for U-boot

HI all,

I'm working on a custom board using a RFSOC.

I need to configure GPIOs and having them in a defined state for U-Boot. Particularly, I want to set MIO27 as an output and its state at '1'

I have configured a custom device tree (project_root_dir/project-spec/meta-user/recipes-bsp/device-tree/files/pl-custom.dtsi, cf. attached file)

I'm not sure which file between pl-custom.dtsi and system-user.dtsi should be modify first.

I tried to build the simplest possible device-tree file, nevertheless, when I do a 'gpio status -a' command in U-boot, the GPIOs don't seem to be impacted by my device-tree.

 

gpio@ff0a000021: input: 0 [ ]
gpio@ff0a000022: input: 1 [ ]
gpio@ff0a000023: input: 1 [ ]
gpio@ff0a000024: input: 1 [ ]
gpio@ff0a000025: input: 1 [ ]
gpio@ff0a000026: output: 1 [ ]
gpio@ff0a000027: input: 0 [ ]
gpio@ff0a000028: input: 1 [ ]

 

Did I make a mistake in my file or did I modified the wrong file?

thank you for your help.


regards,

Manuel

Tags (3)
0 Kudos
1 Reply
mdematos
Visitor
Visitor
218 Views
Registered: ‎10-19-2016

The file was remove when I posted, it seems I have a format problem.

So, I copy/paste the content of my pl-custom.dtsi file here

#include "zynqmp.dtsi"
#include "zynqmp-clk-ccf.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/pinctrl-zynqmp.h>
#include <dt-bindings/phy/phy.h>

/ {
	model = "ZynqMP my-board RevA";
	compatible = "xlnx,zynqmp";

	aliases {
		gpio0 = &gpio;
	};

	chosen {
		bootargs = "earlycon";
		stdout-path = "serial0:115200n8";
	};

	memory@0 {
		device_type = "memory";
		reg = <0x00000000 0x00000000 0x00000000 0x80000000>;
		
	};
 
	leds {
		compatible = "gpio-leds";
		phy-reset-led {
			label = "phy-reset";
			gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
			default-state= "off";
		};
		pmint3-led {
			label = "pmint3";
			gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
			default-state= "on";
		};
		si5340-insel0-led {
			label = "si5340-insel0";
			gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
			default-state= "on";
		};
		pci-reset-led {
			label = "pci-reset";
			gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
			default-state= "on";
		};
	};

};


&gpio {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gpio_default>;
	gpio-line-names = "QSPI_LWR_CLK",        "QSPI_LWR_DQ1",        "QSPI_LWR_DQ2",    "QSPI_LWR_DQ3", 
					  "QSPI_LWR_DQ0",        "QSPI_LWR_CS_L",       "",                "QSPI_UPR_CLK", 
					  "QSPI_UPR_DQ1",        "QSPI_UPR_DQ2",        "QSPI_UPR_DQ3",    "QSPI_UPR_DQ0",
			  		  "QSPI_UPR_CS_L",       "",                    "UART_RX",         "UART_TX",
					  "UC_TO_PS_UART_RX_18", "UC_TO_PS_UART_TX_18", "PS_I2C_SCL",      "PS_I2C_SDA",
					  "PMINT3_18",           "SI5340_INSEL0",       "",                "", 
					  "",                    "",                    "PCIE_RESET_L_18", "GBE_RST_L",
					  "GBE_INT",             "USB_RST_L",           "GDISCRET1_18",    "MASKABLERESET_L_18",
					  "",	                 "",                    "",                "",
					  "",                    "",                    "GBE_TXCK",        "GBE_TXD0",
					  "GBE_TXD1", 		     "GBE_TXD2",            "GBE_TXD3",        "GBE_TXCTL",
                      "GBE_RXCK",            "GBE_RXD0",            "GBE_RXD1",        "GBE_RXD2",
                      "GBE_RXD3",            "GBE_RXCTL",           "GBE_MDC",         "GBE_MDIO",
					  "USB0_CLK",            "USB0_DIR",            "USB0_DATA2",      "USB0_NXT",
					  "USB0_DATA0",          "USB0_DATA1",          "USB0_STP",        "USB0_DATA3",
					  "USB0_DATA4",          "USB0_DATA5",          "USB0_DATA6",      "USB0_DATA7",
					  "","", "", "", "", "",
			  		  "", "", "", "", "",
			  		  "", "", "", /* MIO end and EMIO start */
			  "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "", "", "", "", "", "", "",
			  "", "", "", "";
};

&pinctrl0 {
	status = "okay";

    pinctrl_gpio_default: gpio-default {
		mux {
			function = "gpio0";
			groups = "gpio0_20_grp", 
			         "gpio0_26_grp", "gpio0_27_grp","gpio0_30_grp",
					 "gpio0_31_grp";
		};

		conf {
			groups = "gpio0_20_grp", 
			         "gpio0_26_grp", "gpio0_27_grp","gpio0_30_grp",
					 "gpio0_31_grp";
			slew-rate = <SLEW_RATE_SLOW>;
			io-standard = <IO_STANDARD_LVCMOS18>;
		};

		mux-clk {
			function = "gpio0";
			groups = "gpio0_21_grp";
		};

		conf-clk {
			groups = "gpio0_21_grp";
			slew-rate = <SLEW_RATE_SLOW>;
			io-standard = <IO_STANDARD_LVCMOS18>;
		};

		conf-pull-up {
			pins = "MIO27";
			bias-pull-up;
		};

		conf-pull-none {
			pins = "MIO20", "MIO21", "MIO26",
			       "MIO30", "MIO31";
			bias-disable;
		};
	};
 	
};
0 Kudos