GPIO use

Pierre PAKPierre PAK Posts: 1New Member
I have some difficulties to reach GPIO pin through Panasonic 100-Pin connectors with an Linux OS.
The main problem concern is that the mapping provided does not contain the port numbers GPIO side OS (Ubilinux). After some tests, it turns out that the GPIO ports on the Linux side start at 318 and then dispatch "randomly" (it's over 500). It is therefore difficult to connect the pin 46 (GPIO25 / PWM0) with the corresponding port on the Linux side. It is necessary for us to interface with a driver.

Could you help us to use GPIO port with linux?

Comments

  • AlingAling Posts: 504Administrator, AAEON, UP reseller admin
    Hi ,

    UP Core is still not in officially released yet. We will come back to support once we finish all the verification and start mass production.
  • stez_mindstez_mind Posts: 11New Member

    Hi @Aling , any news on this?

    UpCore has been long released but still, I can't find any documentation regarding GPIO mapping on Linux.

    It would be very helpful to have a page for UpCore similar to this one for UpBoard.

    Thanks,
    Stefano

  • stez_mindstez_mind Posts: 11New Member

    FYI,
    it's possible to retrieve the information from the relevant Intel pinctrl driver that handles the mapping:

    https://github.com/emutex/ubilinux-kernel/blob/upboard-4.9/drivers/pinctrl/intel/pinctrl-cherryview.c

    GPIOs are divided into 4 groups, and you can find the base number for each group with:

    cat /sys/kernel/debug/gpio

    which on my setup gives:

    gpiochip3: GPIOs 318-372, parent: platform/INT33FF:03, INT33FF:03:
    
    gpiochip2: GPIOs 373-396, parent: platform/INT33FF:02, INT33FF:02:
    
    gpiochip1: GPIOs 397-455, parent: platform/INT33FF:01, INT33FF:01:
     gpio-404 (                    |ACPI:OpRegion       ) out hi
    
    gpiochip0: GPIOs 456-511, parent: platform/INT33FF:00, INT33FF:00:
    

    Then, you need to lookup the index of the GPIO you need (in my case Pin32 of the 100-pin connector, ISH_GPIO0 on the UpCore datasheet, which correspondes to "MF_ISH_GPIO_0" in the driver) and sum it to the relevant base GPIO number (in my case 373, so the Linux GPIO for that pin is 373+18=391).

    It still would be nice if someone has time to prepare a ready available table as there is one for the UpBoard.

  • ccaldeccalde Posts: 199New Member, Emutex mod

    Hi @stez_mind ,

    Thanks a lot for that information. It will be useful!

    And yes, it will be very nice to get a GPIO table for UP core.

    Cheers!

  • toinastoinas Posts: 4New Member

    are there any forums with examples about compatible expansion boards and how to connect to the GPIO ports physically

  • nukularnukular Posts: 68New Member ✭✭✭

    @toinas some are listed ion this wiki page: https://wiki.up-community.org/Verified_HATs

  • ccaldeccalde Posts: 199New Member, Emutex mod

    Hi @nukular ,

    Thanks for sharing the link!

Sign In or Register to comment.