UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
154 Views
Registered: ‎10-23-2018

ZynqMP GPIO via Character Device

Hi All,

I'm trying to access the gpio pins on a ZynqMP ZCU27DR through the linux character device for gpio (not sysfs).  I've added the names of the pins to the device tree as shown below in the device tree entry, but when I run lsgpio the names are not recognized.  Does the zynqmp_gpio driver support the gpio character device driver or is it only functional with sysfs?  Any ideas would be greatly appreciated.  Thanks in advance.

gpio@ff0a0000 {
			compatible = "xlnx,zynqmp-gpio-1.0";
			status = "okay";
			#gpio-cells = <0x2>;
			interrupt-parent = <0x4>;
			interrupts = <0x0 0x10 0x4>;
			interrupt-controller;
			#interrupt-cells = <0x2>;
			reg = <0x0 0xff0a0000 0x0 0x1000>;
			gpio-controller;
			power-domains = <0xc 0x2e>;
			clocks = <0x3 0x1f>;
			emio-gpio-width = <0x20>;
			gpio-mask-high = <0x0>;
			gpio-mask-low = <0x5600>;
			gpio-line-names = "STATUS_LED1_N", "STATUS_LED2_N", "STATUS_LED3_N";
		};

The console output from lsgpio looks like:

GPIO chip: gpiochip1, "zynqmp_gpio", 174 GPIO lines
	line  0: unnamed unused
	line  1: unnamed unused
	line  2: unnamed unused
	line  3: unnamed unused
	line  4: unnamed unused
	line  5: unnamed unused
	line  6: unnamed unused
	line  7: unnamed unused
	line  8: unnamed unused
	line  9: unnamed unused
	line 10: unnamed unused
	line 11: unnamed unused
	line 12: unnamed unused
	line 13: unnamed unused
	line 14: unnamed unused
	line 15: unnamed unused
	line 16: unnamed unused
	line 17: unnamed unused
	line 18: unnamed unused
	line 19: unnamed unused
	line 20: unnamed unused
	line 21: unnamed unused
	line 22: unnamed unused
	line 23: unnamed unused
	line 24: unnamed unused
	line 25: unnamed unused
	line 26: unnamed unused
	line 27: unnamed unused
	line 28: unnamed unused
	line 29: unnamed unused
	line 30: unnamed unused
	line 31: unnamed unused
	line 32: unnamed unused
	line 33: unnamed unused
	line 34: unnamed unused
	line 35: unnamed unused
	line 36: unnamed unused
	line 37: unnamed unused
	line 38: unnamed unused
	line 39: unnamed unused
	line 40: unnamed unused
	line 41: unnamed unused
	line 42: unnamed unused
	line 43: unnamed unused
	line 44: unnamed unused
	line 45: unnamed unused
	line 46: unnamed unused
	line 47: unnamed unused
	line 48: unnamed unused
	line 49: unnamed unused
	line 50: unnamed unused
	line 51: unnamed unused
	line 52: unnamed unused
	line 53: unnamed unused
	line 54: unnamed unused
	line 55: unnamed unused
	line 56: unnamed unused
	line 57: unnamed unused
	line 58: unnamed unused
	line 59: unnamed unused
	line 60: unnamed unused
	line 61: unnamed unused
	line 62: unnamed unused
	line 63: unnamed unused
	line 64: unnamed unused
	line 65: unnamed unused
	line 66: unnamed unused
	line 67: unnamed unused
	line 68: unnamed unused
	line 69: unnamed unused
	line 70: unnamed unused
	line 71: unnamed unused
	line 72: unnamed unused
	line 73: unnamed unused
	line 74: unnamed unused
	line 75: unnamed unused
	line 76: unnamed unused
	line 77: unnamed unused
	line 78: unnamed unused
	line 79: unnamed unused
	line 80: unnamed unused
	line 81: unnamed unused
	line 82: unnamed unused
	line 83: unnamed unused
	line 84: unnamed unused
	line 85: unnamed unused
	line 86: unnamed unused
	line 87: unnamed unused
	line 88: unnamed unused
	line 89: unnamed unused
	line 90: unnamed unused
	line 91: unnamed unused
	line 92: unnamed unused
	line 93: unnamed unused
	line 94: unnamed unused
	line 95: unnamed unused
	line 96: unnamed unused
	line 97: unnamed unused
	line 98: unnamed unused
	line 99: unnamed unused
	line 100: unnamed unused
	line 101: unnamed unused
	line 102: unnamed unused
	line 103: unnamed unused
	line 104: unnamed unused
	line 105: unnamed unused
	line 106: unnamed unused
	line 107: unnamed unused
	line 108: unnamed unused
	line 109: unnamed unused
	line 110: unnamed unused
	line 111: unnamed unused
	line 112: unnamed unused
	line 113: unnamed unused
	line 114: unnamed unused
	line 115: unnamed unused
	line 116: unnamed unused
	line 117: unnamed unused
	line 118: unnamed unused
	line 119: unnamed unused
	line 120: unnamed unused
	line 121: unnamed unused
	line 122: unnamed unused
	line 123: unnamed unused
	line 124: unnamed unused
	line 125: unnamed unused
	line 126: unnamed unused
	line 127: unnamed unused
	line 128: unnamed unused
	line 129: unnamed unused
	line 130: unnamed unused
	line 131: unnamed unused
	line 132: unnamed unused
	line 133: unnamed unused
	line 134: unnamed unused
	line 135: unnamed unused
	line 136: unnamed unused
	line 137: unnamed unused
	line 138: unnamed unused
	line 139: unnamed unused
	line 140: unnamed unused
	line 141: unnamed unused
	line 142: unnamed unused
	line 143: unnamed unused
	line 144: unnamed unused
	line 145: unnamed unused
	line 146: unnamed unused
	line 147: unnamed unused
	line 148: unnamed unused
	line 149: unnamed unused
	line 150: unnamed unused
	line 151: unnamed unused
	line 152: unnamed unused
	line 153: unnamed unused
	line 154: unnamed unused
	line 155: unnamed unused
	line 156: unnamed unused
	line 157: unnamed unused
	line 158: unnamed unused
	line 159: unnamed unused
	line 160: unnamed unused
	line 161: unnamed unused
	line 162: unnamed unused
	line 163: unnamed unused
	line 164: unnamed unused
	line 165: unnamed unused
	line 166: unnamed unused
	line 167: unnamed unused
	line 168: unnamed unused
	line 169: unnamed unused
	line 170: unnamed unused
	line 171: unnamed unused
	line 172: unnamed unused
	line 173: unnamed unused
GPIO chip: gpiochip0, "/amba_pl@0/gpio@a0100000", 1 GPIO lines
	line  0: unnamed unused

I've tried adding a ngpios field and limiting it to 3, but it did not change anything.  Any thoughts?

 

Thanks again.

 

0 Kudos
1 Reply
Contributor
Contributor
96 Views
Registered: ‎10-23-2018

Re: ZynqMP GPIO via Character Device

Any ideas/input? @longley @florentw  @stephenm any help would be much appreciated.

 

Thanks again!

0 Kudos