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

drivers: gpio: Add PSoC-6 GPIO driver #29489

Merged
merged 6 commits into from
Jan 20, 2021

Conversation

nandojve
Copy link
Member

@nandojve nandojve commented Oct 23, 2020

Add GPIO driver with external interrupt capabilities. This allows m0 to enable ext-int on port-x, m4 to enable ext-int on port-x and/or both m0/4 enabling at same time ext-int on port-x. The use is application defined, for instance, allows sync external events.

The cy8ckit_062_ble board receives m0 binds for LED and switch. This allows evaluate GPIO and Ext-Int using <samples/basic/button>

This PR have two three commits from #29459 and should be merged after #29459.

drivers/gpio/gpio_psoc6.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Show resolved Hide resolved
drivers/gpio/gpio_psoc6.c Outdated Show resolved Hide resolved
dts/arm/cypress/psoc6.dtsi Outdated Show resolved Hide resolved
@nandojve nandojve requested a review from mnkp November 30, 2020 16:06
Update <soc.h> include files.  This removes the unnecessary
<kernel_includes.h> file.  In addition, add <sys/util.h> to
expose macros and <devicetree.h> following general standards.

Signed-off-by: Gerson Fernando Budke <[email protected]>
The psoc6.dtsi file declare a reference to nvic.  Since it was proper
defined at psoc6_cm0/4.dtsi files this entry is redundant.  Drop the
useless entry.

Signed-off-by: Gerson Fernando Budke <[email protected]>
PSoC-6 SoC needs that user define the nvic interrupt number to bind
with the peripheral interrupt line for the Cortex-M0+ CPU.  It uses
a multiplex before any NVIC interrupt line.  The interrupt vector is
selected using interrupt-parent property with the intmux_chN number
reference.

Note: The PSoC-6 SoC allows that both CPUs receive the same interrupt.
A tipical use is GPIO interrupt handle and user is responsable to
define interrupt line, priority and take care of enable same peripheral
instance on both CPUs only when appropriated.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Introduce PSoC-6 GPIO support.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Add LED and switch DTS information.  Port P0 received the NVIC line 20
on Cortex-M0+ cpu.  This way, SW_0 switch can be connected as external
interrupt source for both m0 and m4 cpus.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Add LED and switch DTS information.  Port P0 received the NVIC line 20
on Cortex-M0+ cpu.  This way, SW_0 switch can be connected as external
interrupt source for both m0 and m4 cpus.

Signed-off-by: Gerson Fernando Budke <[email protected]>
Copy link
Contributor

@mbolivar-nordic mbolivar-nordic left a comment

Choose a reason for hiding this comment

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

DT bits seem fine

@galak galak merged commit fdb8a1d into zephyrproject-rtos:master Jan 20, 2021
@galak
Copy link
Collaborator

galak commented Jan 20, 2021

Will need to re-open/create a new PR as incorrectly merged this PR. I've fixed the master tree and this will need to get re-submitted.

@pabigot
Copy link
Collaborator

pabigot commented Jan 21, 2021

@galak @nandojve can you summarize what went wrong? From what I can tell this was passing all tests and had the necessary reviews.

@nandojve
Copy link
Member Author

@pabigot
PR was merged without a rebase with small fixes and improvements from #29459. I believe @galak was look both at same time to give suggestions. When #29459 was ready, by mistake, he merged this PR instead #29459. The new PR #31466 was adjusted to use the changes and improvements from his suggestions.

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.

6 participants