Skip to content
Permalink
Browse files
gpio: Support interrupts in gpio-mlxbf2.c
There are 3 possible GPIO interrupts which can be
supported on BlueField-2 boards. Some BlueField boards support:
1) PHY interrupt only
2) PHY interrupt and Reset interrupt
3) Low power interrupt only

There is one hardware line shared among all GPIOs, I2C and
MDIO. So the interrupt controller checks whether the
hardware interrupt is from a GPIO first. Then it checks which
GPIO block it is for. And within the GPIO block, it checks
which GPIO pin it is for.

The "reset interrupt" and "low power interrupt" trigger a
user space program.
The PHY interrupt is mapped to a linux IRQ and the latter is
passed down to a PHY driver, because the PHY driver interrupt
should not be triggered based on the shared HW interrupt.

The GPIO pin responsible for these interrupts changes across
different boards. These GPIO interrupts are not supported
on all boards.
So the ACPI table contains a property which is assigned a valid
GPIO pin number if the interrupt is supported on a particular
BlueField-2 board. The bootloader will change that property
based on the board id.

These interrupts are enforced based on the board and should
not be configurable by the user.

This patch also fixes the logic to set the GPIO direction
as output. There are couple of registers that allow software
to change the direction of the GPIO. Otherwise, hardware
controls that by default.

Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
  • Loading branch information
Asmaa Mnebhi authored and intel-lab-lkp committed Mar 10, 2021
1 parent 7ac5548 commit 8495cb2b31bda48cb427278a04332bc2d57a1614
Showing 1 changed file with 367 additions and 8 deletions.

0 comments on commit 8495cb2

Please sign in to comment.