Changes between Version 7 and Version 8 of gpio

09/27/2018 11:21:29 PM (5 years ago)
Tim Harvey

added Newport GPIO information


  • gpio

    v7 v8  
    9696The various product hardware manuals will call out GPIO devices on the board and provide a table mapping the GPIO to a GPIO host controller, a function, and a connector pinout (if going off-board).
    98 This hardware mapping is defined in the Linux kernel device-tree for Ventana (ie [ arch/arm/boot/dts/imx6qdl-gw54xx.dtsi]) or in the kernel board-support file for other product families (file, ie [ arch/arm/mach-cns3xxx/laguna.c]).
    100 If debugfs is enabled in the kernel (as it is on Gateworks BSP's) you can see a nice table of GPIO mapping via {{{/sys/kernel/debug/gpio}}}. Some examples:
    101  * GW5400:
     98This hardware mapping is defined in the following files depending on board/family:
     99* Ventana: Linux kernel device-tree (ie [])
     100* Ventana: Linux kernel device-tree (ie [ arch/arm/boot/dts/imx6qdl-gw54xx.dtsi])
     101* Laguna: Linux kernel board-support files (ie [ arch/arm/mach-cns3xxx/laguna.c]).
     103If 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:
     104 * Newport GW6400:
     106# cat /sys/kernel/debug/gpio
     107gpiochip1: GPIOs 448-463, parent: i2c/0-0023, pca9555, can sleep:
     109gpiochip0: GPIOs 464-511, parent: pci/0000:00:06.0, gpio_thunderx:
     110 gpio-472 (                    |mmc_supply_3v3      ) out hi   
     111 gpio-478 (                    |user2               ) out lo   
     112 gpio-495 (                    |user1               ) out lo   
     114 * Ventana GW5400:
    103116# cat /sys/kernel/debug/gpio
    129142  * Note that this does not show GPIO's that are not used by Linux drivers such as USB HUB reset, Ethernet PHY reset, etc.
    130  * GW2388:
     143 * Laguna GW2388:
    132145# cat /sys/kernel/debug/gpio
    146159 gpio-115 (user1               ) out hi
    148  * GW2387:
     161 * Laguna GW2387:
    150163# cat /sys/kernel/debug/gpio
    168181Product Family specific notes:
     182 * Newport:
     183  - CN80XX GPIOs: The CN80XX has one 48bit GPIO controller
     184   - GPIO![0-48]: gpio-464 to gpio-511
    169185 * Ventana:
    170186  - IMX6 GPIOs: The IMX6 has 7 32bit GPIO controllers for a possible 224 fast ARM based GPIO's
    189205  - additional i2c based GPIO port-expanders present on some boards would begin at gpio116
     207Note that the Linux gpio mapping is not guaranteed to remain constant across kernel versions. Care should be taken to consult {{{/sys/kernel/debug/gpio}}} and {{{/sys/class/gpio}}} when changing kernel versions.
    192209When referring to [ Gateworks board user hardware manuals] you will need to translate the hardware pin name to a gpio using the information above. Some examples:
     210 * Newport GPIO8 would be the 8th IO on the CN80XX GPIO controller thus map to gpio-472.
    193211 * Laguna GPIOA8 would be the 9th IO on the GPIOA controller (the first is GPIOA0) thus map to gpio 0+8 = gpio-8
    194212 * Laguna GPIOB1 would be the 2nd IO on the GPIOB controller thus map to gpio 32+2 = gpio-34
    448466 * [wiki:OpenWrt/gpio GPIO in OpenWrt]
    449467 * [wiki:ventana/DigitalIO Ventana product family Digital I/O]
     468 * [wiki:newport/DigitalIO Newport product family Digital I/O]