24Lines Posted March 16, 2018 Posted March 16, 2018 I'm using Armbian 5.38 stable Debian stretch 4.14.14-sunxi on A20 Lime2. I try to use PGxx pins (connector GPIO-1 on board), without any luck. I know i must use formula (position of letter in alphabet - 1) * 32 + pin number, so i have tried (for PG11): echo 203 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio203/direction echo 1 > /sys/class/gpio/203/value but nothing happened. I tried from 192 to 203 (PG00 to PG11), but nothing happened. On the same connector (GPIO-1), PC23, PC18 and PB23 work perfectly. What am i doing wrong?
OpenglMan Posted March 17, 2018 Posted March 17, 2018 Check this: sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins 1c20800.pinctrl maybe different in your system. Please check: sudo ls /sys/kernel/debug/pinctrl/ A good book about GPIO in Linux: GNU-Linux-Rapid-Embedded-Programming
24Lines Posted March 19, 2018 Author Posted March 19, 2018 Thanks for the answer. Inside the spoiler my pinmux-pins file: Spoiler homatron@lime2:~$ sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pinsPinmux settings per pin Format: pin (name): mux_owner gpio_owner hog? pin 0 (PA0): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA0 pin 1 (PA1): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA1 pin 2 (PA2): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA2 pin 3 (PA3): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA3 pin 4 (PA4): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA4 pin 5 (PA5): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA5 pin 6 (PA6): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA6 pin 7 (PA7): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA7 pin 8 (PA8): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA8 pin 9 (PA9): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 10 (PA10): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA10 pin 11 (PA11): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA11 pin 12 (PA12): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA12 pin 13 (PA13): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA13 pin 14 (PA14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 15 (PA15): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA15 pin 16 (PA16): 1c50000.ethernet (GPIO UNCLAIMED) function gmac group PA16 pin 17 (PA17): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 32 (PB0): 1c2ac00.i2c (GPIO UNCLAIMED) function i2c0 group PB0 pin 33 (PB1): 1c2ac00.i2c (GPIO UNCLAIMED) function i2c0 group PB1 pin 34 (PB2): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 35 (PB3): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 36 (PB4): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 37 (PB5): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 38 (PB6): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 39 (PB7): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 40 (PB8): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 41 (PB9): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 42 (PB10): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 43 (PB11): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 44 (PB12): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 45 (PB13): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 46 (PB14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 47 (PB15): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 48 (PB16): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 49 (PB17): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 50 (PB18): 1c2b000.i2c (GPIO UNCLAIMED) function i2c1 group PB18 pin 51 (PB19): 1c2b000.i2c (GPIO UNCLAIMED) function i2c1 group PB19 pin 52 (PB20): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 53 (PB21): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 54 (PB22): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PB22 pin 55 (PB23): 1c28000.serial (GPIO UNCLAIMED) function uart0 group PB23 pin 64 (PC0): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 65 (PC1): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 66 (PC2): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 67 (PC3): (MUX UNCLAIMED) 1c20800.pinctrl:67 pin 68 (PC4): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 69 (PC5): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 70 (PC6): 1c11000.mmc (GPIO UNCLAIMED) function mmc2 group PC6 pin 71 (PC7): 1c11000.mmc (GPIO UNCLAIMED) function mmc2 group PC7 pin 72 (PC8): 1c11000.mmc (GPIO UNCLAIMED) function mmc2 group PC8 pin 73 (PC9): 1c11000.mmc (GPIO UNCLAIMED) function mmc2 group PC9 pin 74 (PC10): 1c11000.mmc (GPIO UNCLAIMED) function mmc2 group PC10 pin 75 (PC11): 1c11000.mmc (GPIO UNCLAIMED) function mmc2 group PC11 pin 76 (PC12): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 77 (PC13): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 78 (PC14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 79 (PC15): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 80 (PC16): pwrseq 1c20800.pinctrl:80 function gpio_out group PC16 pin 81 (PC17): (MUX UNCLAIMED) 1c20800.pinctrl:81 pin 82 (PC18): (MUX UNCLAIMED) 1c20800.pinctrl:82 pin 83 (PC19): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 84 (PC20): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 85 (PC21): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 86 (PC22): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 87 (PC23): (MUX UNCLAIMED) 1c20800.pinctrl:87 pin 88 (PC24): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 96 (PD0): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 97 (PD1): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 98 (PD2): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 99 (PD3): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 100 (PD4): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 101 (PD5): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 102 (PD6): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 103 (PD7): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 104 (PD8): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 105 (PD9): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 106 (PD10): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 107 (PD11): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 108 (PD12): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 109 (PD13): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 110 (PD14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 111 (PD15): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 112 (PD16): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 113 (PD17): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 114 (PD18): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 115 (PD19): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 116 (PD20): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 117 (PD21): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 118 (PD22): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 119 (PD23): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 120 (PD24): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 121 (PD25): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 122 (PD26): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 123 (PD27): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 128 (PE0): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 129 (PE1): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 130 (PE2): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 131 (PE3): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 132 (PE4): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 133 (PE5): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 134 (PE6): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 135 (PE7): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 136 (PE8): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 137 (PE9): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 138 (PE10): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 139 (PE11): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 160 (PF0): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF0 pin 161 (PF1): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF1 pin 162 (PF2): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF2 pin 163 (PF3): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF3 pin 164 (PF4): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF4 pin 165 (PF5): 1c0f000.mmc (GPIO UNCLAIMED) function mmc0 group PF5 pin 192 (PG0): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 193 (PG1): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 194 (PG2): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 195 (PG3): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 196 (PG4): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 197 (PG5): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 198 (PG6): 1c28c00.serial (GPIO UNCLAIMED) function uart3 group PG6 pin 199 (PG7): 1c28c00.serial (GPIO UNCLAIMED) function uart3 group PG7 pin 200 (PG8): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 201 (PG9): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 202 (PG10): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 203 (PG11): (MUX UNCLAIMED) 1c20800.pinctrl:203 pin 224 (PH0): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 225 (PH1): (MUX UNCLAIMED) 1c20800.pinctrl:225 pin 226 (PH2): leds 1c20800.pinctrl:226 function gpio_out group PH2 pin 227 (PH3): (MUX UNCLAIMED) 1c20800.pinctrl:227 pin 228 (PH4): 1c13400.phy 1c20800.pinctrl:228 function gpio_in group PH4 pin 229 (PH5): 1c13400.phy 1c20800.pinctrl:229 function gpio_in group PH5 pin 230 (PH6): (MUX UNCLAIMED) 1c20800.pinctrl:230 pin 231 (PH7): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 232 (PH8): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 233 (PH9): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 234 (PH10): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 235 (PH11): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 236 (PH12): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 237 (PH13): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 238 (PH14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 239 (PH15): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 240 (PH16): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 241 (PH17): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 242 (PH18): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 243 (PH19): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 244 (PH20): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 245 (PH21): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 246 (PH22): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 247 (PH23): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 248 (PH24): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 249 (PH25): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 250 (PH26): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 251 (PH27): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 256 (PI0): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 257 (PI1): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 258 (PI2): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 259 (PI3): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 260 (PI4): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 261 (PI5): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 262 (PI6): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 263 (PI7): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 264 (PI8): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 265 (PI9): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 266 (PI10): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 267 (PI11): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 268 (PI12): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 269 (PI13): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 270 (PI14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 271 (PI15): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 272 (PI16): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 273 (PI17): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 274 (PI18): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 275 (PI19): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 276 (PI20): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 277 (PI21): (MUX UNCLAIMED) (GPIO UNCLAIMED) I have tested PC18, PC23 and PG11. PC18 and PC23 works when i echo > value 0 or 1 (0.02 Volt for 0 and 3.302 Volt for 1). PG11 do not. But in pinmux-pins file seem there are no differences between the pins: pin 82 (PC18): (MUX UNCLAIMED) 1c20800.pinctrl:82 pin 87 (PC23): (MUX UNCLAIMED) 1c20800.pinctrl:87 pin 203 (PG11): (MUX UNCLAIMED) 1c20800.pinctrl:203 Some idea?
zador.blood.stained Posted March 19, 2018 Posted March 19, 2018 On A20 several pin banks (PE, PG, PF) have dedicated power inputs. On Lime2 boards PE and PG power inputs are wired to different PMIC regulators that are not enabled by default for various reasons (Edit: references: 1, 2).
24Lines Posted March 20, 2018 Author Posted March 20, 2018 Ok. I Understand. Thanks for the help. I'll let you know if I find a workaround.
martinayotte Posted March 20, 2018 Posted March 20, 2018 There is maybe a way to turn on the PG regulator by telling the PMIC to enable it using a script ... I didn't do any search on the subject ...
zador.blood.stained Posted March 20, 2018 Posted March 20, 2018 It can be turned on via I2C commands (i2cset), FEX/DT modifications (i.e. DT overlays) or u-boot patches, but enabling this regulator without adjusting the starting voltage or ramp delay is known to cause problems in some conditions.
Recommended Posts