Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpio: Add Phytium GPIO driver #155

Merged
merged 6 commits into from
Jun 19, 2024
Merged

Conversation

hhhui-L
Copy link
Contributor

@hhhui-L hhhui-L commented May 16, 2024

This patch introduces a driver for Phytium GPIO controller.

hhhui-L added 6 commits May 16, 2024 16:27
This patch documents the DT bindings for Phytium GPIO controller.

Signed-off-by: Li Guohui <liguohui2061@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Chen Zhenhua <chenzhenhua@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Phytium GPIO controller has two ports, while port A can accept external
signals and issues interrupts to upper-level interrupt controller.
This patch introduces a driver for Phytium GPIO controller.

Signed-off-by: Li Guohui <liguohui2061@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Lan Hengyu <lanhengyu1395@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
This patch fixed an error on px210 board that the interrupt cannot
be issued after enabling the MSI interrupt in the gpio-pci driver.

Signed-off-by: Li Guohui <liguohui2061@phytium.com.cn>
Signed-off-by: Lan Hengyu <lanhengyu1395@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
…ware

The recently patch for GPIO changed the description of gpio-ports index
in gpio-plat drivers, which may cause the driver cannot property read
old description in the old ACPI table.

Signed-off-by: Li Guohui <liguohui2061@phytium.com.cn>
Signed-off-by: Lan Hengyu <lanhengyu1395@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Because gpio->irq here is the pointer, We must use gpio->irq[0] instead of gpio->irq to judge GPIO no IRQ.

Signed-off-by: Li Guohui <liguohui2061@phytium.com.cn>
Signed-off-by: Zuo Qian <zuoqian2032@phytium.com.cn>
Signed-off-by: Li Mingzhe <limingzhe1839@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
If set max gpio irq number from gpio->ngpio[0], it will
get more IRQ than expected, So use platform_irq_count()
to get the real IRQ num from device tree.

Signed-off-by: Li Guohui <liguohui2061@phytium.com.cn>
Signed-off-by: Liu Tianyu <liutianyu1250@phytium.com.cn>
Signed-off-by: Li Mingzhe <limingzhe1839@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
@deepin-ci-robot
Copy link

Hi @hhhui-L. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@opsiff
Copy link
Member

opsiff commented May 24, 2024

/ok-to-test

Copy link
Member

@opsiff opsiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test
/lgtm

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: opsiff
Once this PR has been reviewed and has the lgtm label, please assign zccrs for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

deepin pr auto review

Phytium GPIO: Add support for Phytium GPIO platform

This patch adds support for Phytium GPIO platform. The GPIO
controller on Phytium platform has been designed with a simple
and flexible architecture, which allows for easy extension of
functionality. The GPIO driver for Phytium platform is designed
to work with this architecture.

The GPIO driver provides a set of functions to interact with
the GPIO controller, including reading and writing GPIO pins,
configuring the direction of GPIO pins, and handling GPIO interrupts.

To enable the GPIO driver for Phytium platform, the following steps
should be taken:

  1. Compile the GPIO driver as a module.

  2. Load the compiled driver using the 'modprobe' command or
    by adding the driver to '/etc/modules'.

  3. Configure the GPIO controller on the Phytium platform by setting
    the appropriate registers using the 'devmem' tool or by modifying
    the 'gpio-phytium-platform.c' file directly.

  4. Create a platform device node for the GPIO controller on the Phytium
    platform using the 'of_platform_init' function in the 'of' module.

  5. Register the platform driver with the Linux kernel by adding the
    driver to '/lib/modules/<kernel_version>/build/include/linux/module.h'
    and '/etc/modprobe.d/phytium_gpio.conf'.

  6. Enable the GPIO driver in the Linux kernel by adding the following
    line to '/etc/modules':

    gpio-phytium-platform
    
  7. Reboot the system for the changes to take effect.

This patch adds support for Phytium GPIO platform by providing the
necessary driver and platform device node. It also includes the
required configuration for the GPIO controller and platform driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants