Changes between Version 7 and Version 8 of gpio


Ignore:
Timestamp:
09/27/2018 11:21:29 PM (6 years ago)
Author:
Tim Harvey
Comment:

added Newport GPIO information

Legend:

Unmodified
Added
Removed
Modified
  • 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).
    9797
    98 This hardware mapping is defined in the Linux kernel device-tree for Ventana (ie [http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi arch/arm/boot/dts/imx6qdl-gw54xx.dtsi]) or in the kernel board-support file for other product families (file, ie [https://dev.openwrt.org/browser/trunk/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c arch/arm/mach-cns3xxx/laguna.c]).
    99 
    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 [http://github.com/Gateworks/dts-newport])
     100* Ventana: Linux kernel device-tree (ie [http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi arch/arm/boot/dts/imx6qdl-gw54xx.dtsi])
     101* Laguna: Linux kernel board-support files (ie [https://github.com/Gateworks/openwrt/blob/16.02/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/laguna.c arch/arm/mach-cns3xxx/laguna.c]).
     102
     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:
     105{{{#!bash
     106# cat /sys/kernel/debug/gpio
     107gpiochip1: GPIOs 448-463, parent: i2c/0-0023, pca9555, can sleep:
     108
     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   
     113}}}
     114 * Ventana GW5400:
    102115{{{#!bash
    103116# cat /sys/kernel/debug/gpio
     
    128141}}}
    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:
    131144{{{#!bash
    132145# cat /sys/kernel/debug/gpio
     
    146159 gpio-115 (user1               ) out hi
    147160}}}
    148  * GW2387:
     161 * Laguna GW2387:
    149162{{{#!bash
    150163# cat /sys/kernel/debug/gpio
     
    167180
    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
    190206
     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.
    191208
    192209When referring to [http://www.gateworks.com/usermanuals 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]