Apalis imx8 - kirikstone - linux kernel 5.15.x.x GPIOs not listing under gpiochip0

Hi

We are using apalis iMX8 SOM and yocto kirikstone branch. Earlier we were using the dunfell branch.

cat /sys/kernel/debug/gpio is not listing any GPIOs under gpiochip0
but the same command lists all the GPIOs in the dunfel branch (kernel 5.4.x). I am not sure why?
even dts file definitions are same in 5.4 and 5.15

Here is the output of cat /sys/kernel/debug/gpio in kirikstone and dunfell . you can see nothing listed under gpiochip0 for kirikstone

Kirikstone

root@apalis-imx8-07106339:~# cat /sys/kernel/debug/gpio
gpiochip9: GPIOs 192-223, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:

gpiochip8: GPIOs 224-255, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpio-224 ( )
gpio-225 ( )
gpio-226 ( )
gpio-227 ( )
gpio-228 ( )
gpio-229 ( )
gpio-230 ( )
gpio-231 ( )
gpio-232 ( )
gpio-233 ( )
gpio-234 (MXM3_261 )
gpio-235 (MXM3_263 )
gpio-236 (MXM3_259 )
gpio-237 (MXM3_257 )
gpio-238 (MXM3_255 )
gpio-239 (MXM3_128 )
gpio-240 (MXM3_130 )
gpio-241 (MXM3_265 )
gpio-242 (MXM3_249 )
gpio-243 (MXM3_247 )
gpio-244 (MXM3_245 )
gpio-245 (MXM3_243 )

gpiochip7: GPIOs 256-287, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-256 ( )
gpio-257 ( )
gpio-258 ( )
gpio-259 ( )
gpio-260 ( )
gpio-261 ( )
gpio-262 ( )
gpio-263 ( )
gpio-264 ( )
gpio-265 ( )
gpio-266 ( )
gpio-267 ( )
gpio-268 ( )
gpio-269 ( )
gpio-270 (MXM3_150 )
gpio-271 (MXM3_160 )
gpio-272 (MXM3_162 )
gpio-273 (MXM3_144 )
gpio-274 (MXM3_146 )
gpio-275 (MXM3_148 )
gpio-276 (MXM3_152 )
gpio-277 (MXM3_156 )
gpio-278 (MXM3_158 )
gpio-279 (MXM3_159 )
gpio-280 (MXM3_184 )
gpio-281 (MXM3_180 )
gpio-282 (MXM3_186 )
gpio-283 (MXM3_188 )
gpio-284 (MXM3_176 )
gpio-285 (MXM3_178 )

gpiochip6: GPIOs 288-319, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-288 (MXM3_18 )
gpio-289 (MXM3_11/GPIO5 )
gpio-290 (MXM3_13/GPIO6 )
gpio-291 (MXM3_274 )
gpio-292 (MXM3_84 |regulator-usb-host-v) out hi
gpio-293 (MXM3_262 )
gpio-294 (MXM3_96 )
gpio-295 ( )
gpio-296 ( )
gpio-297 ( )
gpio-298 ( )
gpio-299 ( |enable ) out hi
gpio-300 (MXM3_190 )
gpio-301 ( )
gpio-302 ( )
gpio-303 ( )
gpio-304 (MXM3_269 )
gpio-305 (MXM3_251 )
gpio-306 (MXM3_253 )
gpio-307 (MXM3_295 )
gpio-308 (MXM3_299 )
gpio-309 (MXM3_301 )
gpio-310 (MXM3_297 )
gpio-311 (MXM3_293 )
gpio-312 (MXM3_291 )
gpio-313 (MXM3_289 )
gpio-314 (MXM3_287 )
gpiochip5: GPIOs 320-351, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
gpio-320 (MXM3_191 )
gpio-321 ( )
gpio-322 (MXM3_221 )
gpio-323 (MXM3_225 )
gpio-324 (MXM3_223 )
gpio-325 (MXM3_227 |spi0 CS0 ) out hi ACTIVE LOW
gpio-326 (MXM3_200 )
gpio-327 (MXM3_235 )
gpio-328 (MXM3_231 )
gpio-329 (MXM3_229 )
gpio-330 (MXM3_233 |spi1 CS0 ) out hi ACTIVE LOW
gpio-331 (MXM3_204 )
gpio-332 (MXM3_196 )
gpio-333 ( )
gpio-334 (MXM3_202 )
gpio-335 ( )
gpio-336 ( )
gpio-337 ( )
gpio-338 (MXM3_305 )
gpio-339 (MXM3_307 )
gpio-340 (MXM3_309 )
gpio-341 (MXM3_311 )
gpio-342 (MXM3_315 )
gpio-343 (MXM3_317 )
gpio-344 (MXM3_319 )
gpio-345 (MXM3_321 )
gpio-346 (MXM3_15/GPIO7 |regulator-pcie-switc) out lo
gpio-347 (MXM3_63 )
gpio-348 (MXM3_17/GPIO8 |gpio-fan ) out hi
gpio-349 (MXM3_12 )
gpio-350 (MXM3_14 )
gpio-351 (MXM3_16 )

gpiochip4: GPIOs 352-383, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
gpio-352 ( )
gpio-353 ( )
gpio-354 ( )
gpio-355 ( )
gpio-356 ( )
gpio-357 ( )
gpio-358 ( )
gpio-359 (MXM3_198 )
gpio-360 (MXM3_35 )
gpio-361 (MXM3_164 )
gpio-362 ( )
gpio-363 ( |enable ) out lo
gpio-364 ( )
gpio-365 ( )
gpio-366 (MXM3_217 )
gpio-367 (MXM3_215 )
gpio-368 ( )
gpio-369 ( )
gpio-370 (MXM3_193 )
gpio-371 (MXM3_194 )
gpio-372 (MXM3_37 )
gpio-373 ( )
gpio-374 (MXM3_271 )
gpio-375 (MXM3_273 )
gpio-376 (MXM3_195 )
gpio-377 (MXM3_197 )
gpio-378 (MXM3_177 )
gpio-379 (MXM3_179 )
gpio-380 (MXM3_181 )
gpio-381 (MXM3_183 )
gpio-382 (MXM3_185 )
gpio-383 (MXM3_187 )

gpiochip3: GPIOs 384-415, parent: platform/5d090000.gpio, 5d090000.gpio:
gpio-384 ( )
gpio-385 ( |usb3503 intn ) out lo
gpio-386 ( |usb3503 reset ) out hi ACTIVE LOW
gpio-387 ( )
gpio-388 (MXM3_286 )
gpio-389 ( )
gpio-390 (MXM3_87 )
gpio-391 (MXM3_99 )
gpio-392 (MXM3_138 )
gpio-393 (MXM3_140 )
gpio-394 (MXM3_239 )
gpio-395 ( |PHY reset ) out hi ACTIVE LOW
gpio-396 (MXM3_281 )
gpio-397 (MXM3_283 )
gpio-398 (MXM3_126 )
gpio-399 (MXM3_132 )
gpio-400 ( )
gpio-401 ( )
gpio-402 ( )
gpio-403 ( )
gpio-404 (MXM3_173 )
gpio-405 (MXM3_175 )
gpio-406 (MXM3_123 )
gpio-412 ( |regulator-module-wif) out hi
gpio-414 ( |CONNECTOR_IS_HDMI ) out hi
gpiochip2: GPIOs 416-447, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-416 (MXM3_279 )
gpio-417 (MXM3_277 )
gpio-418 (MXM3_135 )
gpio-419 (MXM3_203 )
gpio-420 (MXM3_201 )
gpio-421 (MXM3_275 )
gpio-422 (MXM3_110 )
gpio-423 (MXM3_120 )
gpio-424 (MXM3_1/GPIO1 )
gpio-425 (MXM3_3/GPIO2 )
gpio-426 (MXM3_124 )
gpio-427 (MXM3_122 )
gpio-428 (MXM3_5/GPIO3 )
gpio-429 (MXM3_7/GPIO4 )
gpio-430 ( )
gpio-431 ( )
gpio-432 (MXM3_4 )
gpio-433 (MXM3_211 )
gpio-434 (MXM3_209 )
gpio-435 (MXM3_2 )
gpio-436 (MXM3_136 )
gpio-437 (MXM3_134 )
gpio-438 (MXM3_6 )
gpio-439 (MXM3_8 )
gpio-440 (MXM3_112 )
gpio-441 (MXM3_118 )
gpio-442 (MXM3_114 )
gpio-443 (MXM3_116 )
gpio-447 ( |usb3503 connect ) out lo ACTIVE LOW

gpiochip1: GPIOs 448-479, parent: platform/58242000.gpio, 58242000.gpio:

gpiochip0: GPIOs 480-511, parent: platform/58222000.gpio, 58222000.gpio:

dunfell
root@apalis-imx8-07106339:/sys/class/gpio/gpio502# cat /sys/kernel/debug/gpio
gpiochip9: GPIOs 192-223, parent: platform/58242000.gpio, 58242000.gpio:

gpiochip8: GPIOs 224-255, parent: platform/58222000.gpio, 58222000.gpio:

gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:

gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:
gpio-288 ( )
gpio-289 ( )
gpio-290 ( )
gpio-291 ( )
gpio-292 ( )
gpio-293 ( )
gpio-294 ( )
gpio-295 ( )
gpio-296 ( )
gpio-297 ( )
gpio-298 (MXM3_261 )
gpio-299 (MXM3_263 )
gpio-300 (MXM3_259 )
gpio-301 (MXM3_257 )
gpio-302 (MXM3_255 )
gpio-303 (MXM3_128 )
gpio-304 (MXM3_130 )
gpio-305 (MXM3_265 )
gpio-306 (MXM3_249 )
gpio-307 (MXM3_247 )
gpio-308 (MXM3_245 )
gpio-309 (MXM3_243 )

gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
gpio-320 ( )
gpio-321 ( )
gpio-322 ( )
gpio-323 ( )
gpio-324 ( )
gpio-325 ( )
gpio-326 ( )
gpio-327 ( )
gpio-328 ( )
gpio-329 ( )
gpio-330 ( )
gpio-331 ( )
gpio-332 ( )
gpio-333 ( )
gpio-334 (MXM3_150 )
gpio-335 (MXM3_160 )
gpio-336 (MXM3_162 )
gpio-337 (MXM3_144 )
gpio-338 (MXM3_146 )
gpio-339 (MXM3_148 )
gpio-340 (MXM3_152 )
gpio-341 (MXM3_156 )
gpio-342 (MXM3_158 )
gpio-343 (MXM3_159 )
gpio-344 (MXM3_184 )
gpio-345 (MXM3_180 )
gpio-346 (MXM3_186 )
gpio-347 (MXM3_188 )
gpio-348 (MXM3_176 )
gpio-349 (MXM3_178 )

gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
gpio-352 (MXM3_18 )
gpio-353 (MXM3_11/GPIO5 )
gpio-354 (MXM3_13/GPIO6 )
gpio-355 (MXM3_274 )
gpio-356 (MXM3_84 |regulator-usb-host-v) out hi
gpio-357 (MXM3_262 )
gpio-358 (MXM3_96 )
gpio-359 ( )
gpio-360 ( )
gpio-361 ( )
gpio-362 ( )
gpio-363 ( |enable ) out hi
gpio-364 (MXM3_190 |cd ) in hi IRQ ACTIVE LOW
gpio-365 ( )
gpio-366 ( )
gpio-367 ( )
gpio-368 (MXM3_269 )
gpio-369 (MXM3_251 )
gpio-370 (MXM3_253 )
gpio-371 (MXM3_295 )
gpio-372 (MXM3_299 )
gpio-373 (MXM3_301 )
gpio-374 (MXM3_297 )
gpio-375 (MXM3_293 )
gpio-376 (MXM3_291 )
gpio-377 (MXM3_289 )
gpio-378 (MXM3_287 )
gpiochip3: GPIOs 384-415, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
gpio-384 (MXM3_191 )
gpio-385 ( )
gpio-386 (MXM3_221 )
gpio-387 (MXM3_225 )
gpio-388 (MXM3_223 )
gpio-389 (MXM3_227 |fsl_lpspi ) in lo
gpio-390 (MXM3_200 )
gpio-391 (MXM3_235 )
gpio-392 (MXM3_231 )
gpio-393 (MXM3_229 )
gpio-394 (MXM3_233 |fsl_lpspi ) in lo
gpio-395 (MXM3_204 )
gpio-396 (MXM3_196 )
gpio-397 ( )
gpio-398 (MXM3_202 )
gpio-399 ( )
gpio-400 ( )
gpio-401 ( )
gpio-402 (MXM3_305 )
gpio-403 (MXM3_307 )
gpio-404 (MXM3_309 )
gpio-405 (MXM3_311 )
gpio-406 (MXM3_315 )
gpio-407 (MXM3_317 )
gpio-408 (MXM3_319 )
gpio-409 (MXM3_321 )
gpio-410 (MXM3_15/GPIO7 |regulators:regulator) out lo
gpio-411 (MXM3_63 )
gpio-412 (MXM3_17/GPIO8 |gpio-fan ) out hi
gpio-413 (MXM3_12 )
gpio-414 (MXM3_14 )
gpio-415 (MXM3_16 )

gpiochip2: GPIOs 416-447, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
gpio-416 ( )
gpio-417 ( )
gpio-418 ( )
gpio-419 ( )
gpio-420 ( )
gpio-421 ( )
gpio-422 ( )
gpio-423 (MXM3_198 )
gpio-424 (MXM3_35 )
gpio-425 (MXM3_164 |cd ) in hi IRQ ACTIVE LOW
gpio-426 ( )
gpio-427 ( |enable ) out hi
gpio-428 ( )
gpio-429 ( )
gpio-430 (MXM3_217 )
gpio-431 (MXM3_215 )
gpio-432 ( )
gpio-433 ( )
gpio-434 (MXM3_193 )
gpio-435 (MXM3_194 )
gpio-436 (MXM3_37 )
gpio-437 ( )
gpio-438 (MXM3_271 )
gpio-439 (MXM3_273 )
gpio-440 (MXM3_195 )
gpio-441 (MXM3_197 )
gpio-442 (MXM3_177 )
gpio-443 (MXM3_179 )
gpio-444 (MXM3_181 )
gpio-445 (MXM3_183 )
gpio-446 (MXM3_185 )
gpio-447 (MXM3_187 )

gpiochip1: GPIOs 448-479, parent: platform/5d090000.gpio, 5d090000.gpio:
gpio-448 ( )
gpio-449 ( |usb3503 intn ) out lo
gpio-450 ( |usb3503 reset ) out hi
gpio-451 ( )
gpio-452 (MXM3_286 |enable ) out hi
gpio-453 ( )
gpio-454 (MXM3_87 )
gpio-455 (MXM3_99 )
gpio-456 (MXM3_138 )
gpio-457 (MXM3_140 )
gpio-458 (MXM3_239 )
gpio-459 ( |PHY reset ) out hi ACTIVE LOW
gpio-460 (MXM3_281 )
gpio-461 (MXM3_283 )
gpio-462 (MXM3_126 )
gpio-463 (MXM3_132 )
gpio-464 ( )
gpio-465 ( )
gpio-466 ( )
gpio-467 ( )
gpio-468 (MXM3_173 )
gpio-469 (MXM3_175 )
gpio-470 (MXM3_123 )
gpio-476 ( |regulators:regulator) out lo
gpio-478 ( |HDMI_CTRL ) out hi
gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
gpio-480 (MXM3_279 )
gpio-481 (MXM3_277 )
gpio-482 (MXM3_135 )
gpio-483 (MXM3_203 )
gpio-484 (MXM3_201 )
gpio-485 (MXM3_275 )
gpio-486 (MXM3_110 )
gpio-487 (MXM3_120 )
gpio-488 (MXM3_1/GPIO1 )
gpio-489 (MXM3_3/GPIO2 )
gpio-490 (MXM3_124 )
gpio-491 (MXM3_122 )
gpio-492 (MXM3_5/GPIO3 )
gpio-493 (MXM3_7/GPIO4 )
gpio-494 ( )
gpio-495 ( )
gpio-496 (MXM3_4 )
gpio-497 (MXM3_211 )
gpio-498 (MXM3_209 )
gpio-499 (MXM3_2 )
gpio-500 (MXM3_136 )
gpio-501 (MXM3_134 )
gpio-502 (MXM3_6 |sysfs ) out hi
gpio-503 (MXM3_8 )
gpio-504 (MXM3_112 )
gpio-505 (MXM3_118 )
gpio-506 (MXM3_114 )
gpio-507 (MXM3_116 )
gpio-511 ( |usb3503 connect ) out hi
root@apalis-imx8-07106339:/sys/class/gpio/gpio502#

Regards
Dhanya

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Handshake,

The difference in GPIO listings under /sys/kernel/debug/gpio between the Yocto Project’s Dunfell and Kirkstone branches for the Apalis iMX8 SOM, particularly with kernel versions 5.4.x and 5.15.x respectively, could be attributed to several factors, including changes in the Linux kernel’s handling of GPIOs, device tree configurations, or the GPIO driver itself.

In the Linux kernel, GPIOs are managed through GPIO chip instances, and each GPIO chip can handle a block of GPIOs. The visibility of GPIOs under /sys/kernel/debug/gpio can depend on whether the GPIOs are requested by any driver or if they are marked as used in the device tree. The absence of GPIOs under gpiochip0 in the Kirkstone branch could indicate that the GPIOs managed by this chip are not being used or are not correctly configured in the device tree or that there has been a change in the way the kernel or the GPIO subsystem reports or manages these GPIOs.

Given that the device tree definitions are the same between the two kernel versions as you mentioned, it’s possible that changes in the kernel’s GPIO subsystem or the specific GPIO driver used by the Apalis iMX8 could be affecting the visibility of these GPIOs. Kernel version 5.15.x includes many changes and improvements over 5.4.x, including changes to the GPIO subsystem that might affect how GPIOs are registered, initialized, or displayed.

To troubleshoot this issue, consider the following steps:

  1. Review the Kernel Changelog: Look for any changes in the GPIO subsystem between kernel versions 5.4.x and 5.15.x that might affect GPIO registration or visibility.
  2. Check Device Tree Overlays: Ensure that the device tree overlays (if used) are correctly applied and that the GPIOs are correctly configured to be used by the system or any specific drivers.
  3. Inspect GPIO Driver Changes: If a custom GPIO driver is used, or if there have been changes to the GPIO driver in the kernel, review these changes for compatibility issues with kernel 5.15.x.
  4. Kernel Configuration: Compare the kernel configurations (config) between the two versions to ensure that any relevant GPIO drivers or subsystem options are enabled in the 5.15.x kernel.
  5. Debugging Tools: Use kernel debugging tools and facilities (e.g., dynamic debug) to trace GPIO requests and registrations during boot time to see if the GPIOs are being correctly initialized but not displayed or

Please, also check if these links can help you solve your problem:

GPIO (Linux) | Toradex Developer Center.

Found issue.

GPIO chip mapping is different from dunfell and kirikstone.

platform/5d080000 is mapped to gpiochip0 in dunfell, in kirikstone its mapped to platform/5d080000

gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio
gpiochip2: GPIOs 416-447, parent: platform/5d080000.gpio, 5d080000.gpio:

Because of this change, MXM3_6 also got changed from 502 to 438.

I am not sure why? but this impacts application layers.

regards
Dhanya

Hi @Dhanyakumar ,
Nice to see that your issue has been solved.
We request you not to open multiple threads for the same issue.