108 | | If debugfs is enabled in the kernel and mounted (as it is on Gateworks BSP's) you can see a nice table of GPIO mapping via {{{/sys/kernel/debug/gpio}}}. Some examples: |
109 | | * Newport GW6400: |
110 | | {{{#!bash |
111 | | # cat /sys/kernel/debug/gpio |
112 | | gpiochip1: GPIOs 448-463, parent: i2c/0-0023, pca9555, can sleep: |
113 | | |
114 | | gpiochip0: GPIOs 464-511, parent: pci/0000:00:06.0, gpio_thunderx: |
115 | | gpio-472 ( |mmc_supply_3v3 ) out hi |
116 | | gpio-478 ( |user2 ) out lo |
117 | | gpio-495 ( |user1 ) out lo |
118 | | }}} |
119 | | * Ventana GW5400: |
120 | | {{{#!bash |
121 | | # cat /sys/kernel/debug/gpio |
122 | | GPIOs 0-31, platform/209c000.gpio, 209c000.gpio: |
123 | | gpio-26 (pps-gpio ) in lo |
124 | | gpio-29 (PCIe reset ) out lo |
125 | | gpio-30 (phy-reset ) out hi |
126 | | |
127 | | GPIOs 32-63, platform/20a0000.gpio, 20a0000.gpio: |
128 | | |
129 | | GPIOs 64-95, platform/20a4000.gpio, 20a4000.gpio: |
130 | | gpio-86 (usb_otg_vbus ) out lo |
131 | | |
132 | | GPIOs 96-127, platform/20a8000.gpio, 20a8000.gpio: |
133 | | gpio-102 (user1 ) out lo |
134 | | gpio-103 (user2 ) out lo |
135 | | gpio-111 (user3 ) out lo |
136 | | |
137 | | GPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio: |
138 | | |
139 | | GPIOs 160-191, platform/20b0000.gpio, 20b0000.gpio: |
140 | | |
141 | | GPIOs 192-223, platform/20b4000.gpio, 20b4000.gpio: |
142 | | gpio-192 (2198000.usdhc cd ) in hi |
143 | | |
144 | | GPIOs 240-255, i2c/0-0023, pca9555, can sleep: |
145 | | gpio-240 (user_pb ) in hi |
146 | | }}} |
147 | | * Note that this does not show GPIO's that are not used by Linux drivers such as USB HUB reset, Ethernet PHY reset, etc. |
148 | | * Laguna GW2388: |
149 | | {{{#!bash |
150 | | # cat /sys/kernel/debug/gpio |
151 | | GPIOs 0-31, cns3xxx_gpio0: |
152 | | gpio-0 (GPS_PPS ) in hi |
153 | | gpio-3 (USB_FAULT# ) in hi |
154 | | gpio-6 (USB_VBUS_EN ) out hi |
155 | | gpio-7 (GSM_SEL0 ) out lo |
156 | | gpio-8 (GSM_SEL1 ) out lo |
157 | | gpio-9 (FP_SER_EN ) out lo |
158 | | |
159 | | GPIOs 32-63, cns3xxx_gpio1: |
160 | | |
161 | | GPIOs 100-115, i2c/0-0023, pca9555, can sleep: |
162 | | gpio-100 (USER_PB# ) in hi |
163 | | gpio-114 (user2 ) out hi |
164 | | gpio-115 (user1 ) out hi |
165 | | }}} |
166 | | * Laguna GW2387: |
167 | | {{{#!bash |
168 | | # cat /sys/kernel/debug/gpio |
169 | | GPIOs 0-31, cns3xxx_gpio0: |
170 | | gpio-0 (GPS_PPS ) in hi |
171 | | gpio-2 (USB_FAULT# ) in hi |
172 | | gpio-5 (USB_PCI_SEL ) out lo |
173 | | gpio-6 (USB_VBUS_EN ) out hi |
174 | | gpio-7 (GSM_SEL0 ) out lo |
175 | | gpio-8 (GSM_SEL1 ) out lo |
176 | | gpio-9 (FP_SER_EN ) out lo |
177 | | |
178 | | GPIOs 32-63, cns3xxx_gpio1: |
179 | | |
180 | | GPIOs 100-115, i2c/0-0023, pca9555, can sleep: |
181 | | gpio-100 (USER_PB# ) in hi |
182 | | gpio-114 (user2 ) out hi |
183 | | gpio-115 (user1 ) out hi |
184 | | }}} |
185 | | |
186 | | Product Family specific notes: |
| 108 | ** Product Family specific notes: |
| 147 | |
| 148 | === Examples === |
| 149 | |
| 150 | If debugfs is enabled in the kernel and mounted (as it is on Gateworks BSP's) you can see a nice table of GPIO mapping via {{{/sys/kernel/debug/gpio}}}. Some examples: |
| 151 | * Newport GW6400: |
| 152 | {{{#!bash |
| 153 | # cat /sys/kernel/debug/gpio |
| 154 | gpiochip1: GPIOs 448-463, parent: i2c/0-0023, pca9555, can sleep: |
| 155 | |
| 156 | gpiochip0: GPIOs 464-511, parent: pci/0000:00:06.0, gpio_thunderx: |
| 157 | gpio-472 ( |mmc_supply_3v3 ) out hi |
| 158 | gpio-478 ( |user2 ) out lo |
| 159 | gpio-495 ( |user1 ) out lo |
| 160 | }}} |
| 161 | * Ventana GW5400: |
| 162 | {{{#!bash |
| 163 | # cat /sys/kernel/debug/gpio |
| 164 | GPIOs 0-31, platform/209c000.gpio, 209c000.gpio: |
| 165 | gpio-26 (pps-gpio ) in lo |
| 166 | gpio-29 (PCIe reset ) out lo |
| 167 | gpio-30 (phy-reset ) out hi |
| 168 | |
| 169 | GPIOs 32-63, platform/20a0000.gpio, 20a0000.gpio: |
| 170 | |
| 171 | GPIOs 64-95, platform/20a4000.gpio, 20a4000.gpio: |
| 172 | gpio-86 (usb_otg_vbus ) out lo |
| 173 | |
| 174 | GPIOs 96-127, platform/20a8000.gpio, 20a8000.gpio: |
| 175 | gpio-102 (user1 ) out lo |
| 176 | gpio-103 (user2 ) out lo |
| 177 | gpio-111 (user3 ) out lo |
| 178 | |
| 179 | GPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio: |
| 180 | |
| 181 | GPIOs 160-191, platform/20b0000.gpio, 20b0000.gpio: |
| 182 | |
| 183 | GPIOs 192-223, platform/20b4000.gpio, 20b4000.gpio: |
| 184 | gpio-192 (2198000.usdhc cd ) in hi |
| 185 | |
| 186 | GPIOs 240-255, i2c/0-0023, pca9555, can sleep: |
| 187 | gpio-240 (user_pb ) in hi |
| 188 | }}} |
| 189 | * Note that this does not show GPIO's that are not used by Linux drivers such as USB HUB reset, Ethernet PHY reset, etc. |
| 190 | * Laguna GW2388: |
| 191 | {{{#!bash |
| 192 | # cat /sys/kernel/debug/gpio |
| 193 | GPIOs 0-31, cns3xxx_gpio0: |
| 194 | gpio-0 (GPS_PPS ) in hi |
| 195 | gpio-3 (USB_FAULT# ) in hi |
| 196 | gpio-6 (USB_VBUS_EN ) out hi |
| 197 | gpio-7 (GSM_SEL0 ) out lo |
| 198 | gpio-8 (GSM_SEL1 ) out lo |
| 199 | gpio-9 (FP_SER_EN ) out lo |
| 200 | |
| 201 | GPIOs 32-63, cns3xxx_gpio1: |
| 202 | |
| 203 | GPIOs 100-115, i2c/0-0023, pca9555, can sleep: |
| 204 | gpio-100 (USER_PB# ) in hi |
| 205 | gpio-114 (user2 ) out hi |
| 206 | gpio-115 (user1 ) out hi |
| 207 | }}} |
| 208 | * Laguna GW2387: |
| 209 | {{{#!bash |
| 210 | # cat /sys/kernel/debug/gpio |
| 211 | GPIOs 0-31, cns3xxx_gpio0: |
| 212 | gpio-0 (GPS_PPS ) in hi |
| 213 | gpio-2 (USB_FAULT# ) in hi |
| 214 | gpio-5 (USB_PCI_SEL ) out lo |
| 215 | gpio-6 (USB_VBUS_EN ) out hi |
| 216 | gpio-7 (GSM_SEL0 ) out lo |
| 217 | gpio-8 (GSM_SEL1 ) out lo |
| 218 | gpio-9 (FP_SER_EN ) out lo |
| 219 | |
| 220 | GPIOs 32-63, cns3xxx_gpio1: |
| 221 | |
| 222 | GPIOs 100-115, i2c/0-0023, pca9555, can sleep: |
| 223 | gpio-100 (USER_PB# ) in hi |
| 224 | gpio-114 (user2 ) out hi |
| 225 | gpio-115 (user1 ) out hi |
| 226 | }}} |
| 227 | |
| 228 | |