Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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