Commit Graph

6 Commits

Author SHA1 Message Date
Kornel Duleba
463b6ba05a Introduce qoriq_gpio_pic driver
It adds the PIC functionality on top of qoriq_gpio driver.
We need a separate module since the powerpc PIC API is completely
different than on other architectures.

Two types of intr_map_data are supported:
INTR_MAP_DATA_GPIO and INTR_MAP_DATA_FDT.

This way interrupts can be allocated using the userspace gpio
interrupt allocation method, as well as directly from simplebus.
The latter can be used by devices that have its irq routed to a GPIO pin.

Obtained from: Semihalf
Sponsored by: Alstom Group
2021-11-06 09:08:45 +01:00
Kornel Duleba
b8b7c0dda9 qoriq_gpio: Add support for driver inheritance
Expose softc and other necessary things in a separate header.
This is needed for an armv8 specific driver, that will inherit from this
one. Driver mutex was converted to a spin lock, so that it can be later
used in interrupt filter context.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32587
2021-11-06 09:08:45 +01:00
Wojciech Macek
680920237b Revert "qoriq_gpio: Implement interrupt controller functionality"
This reverts commit 027a58aab2.
2021-10-29 12:05:55 +02:00
Kornel Duleba
027a58aab2 qoriq_gpio: Implement interrupt controller functionality
The pic_* interface was used.
Only edge interrupts are supported by this controller.
Driver mutex had to be converted to a spin lock so that it can
be used in the interrupt filter context.
Two types of intr_map_data are supported - INTR_MAP_DATA_GPIO and
INTR_MAP_DATA_FDT. This way interrupts can be allocated using the
userspace gpio interrupt allocation method, as well as directly from
simplebus. The latter can be used by devices that have its irq routed
to a GPIO pin.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D32587
2021-10-29 10:08:26 +02:00
Justin Hibbits
b2ee069e8c Fix locking in qoriq_gpio
qoriq_gpio_pin_setflags() locks the device mutex, as does
qoriq_gpio_map_gpios(), causing a recursion on non-recursive lock.  This
was missed during testing for 16e549ebe.
2021-05-17 08:46:45 -05:00
Justin Hibbits
16e549ebe2 Merge the QorIQ GPIO drivers between arm and powerpc
Summary:
They're nearly identical, so don't use two copies.  Merge the newer
driver into the older one, and move it to a common location.

Add the Semihalf and associated copyrights in addition to mine, since
it's a non-trivial amount of code merged.

Reviewed By: mw
Differential Revision: https://reviews.freebsd.org/D29520
2021-04-05 10:35:15 -05:00