GPIO Enablement with ACPI
Status
Added ACPI support for I.MX GPIO controller.
[Linux] https://gitlab.com/LinaroLtd/clientpc/linux/-/merge_requests/4
[EDK2] https://gitlab.com/LinaroLtd/clientpc/edk2-platforms/-/merge_requests/2
Depend on the ACPI pinctrl subsystem - ACPI Pinctrl
AML Code Snippet
Device (GPI1)
{
Name (_HID, "NXP0103")
Name (_UID, 0x0)
...
Method (_CRS, 0x0, NotSerialized) {
Name (RBUF, ResourceTemplate () {
MEMORY32FIXED(ReadWrite, 0x30200000, 0x50000, ) // GPIO1
MEMORY32FIXED(ReadWrite, 0x30330000, 0x10000, ) // IOMUXC
Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 96, 97 }
})
Return(RBUF)
}
Name (_DSD, Package () {
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package () {
Package (2) {"gpio-base", 0},
Package (2) {"num-maps", 1},
Package (2) {"pin-controller-0", "\\_SB.PINC"},
Package (2) {"gpio-range-0", Package() { 0, 5, 30 } }
}
})
}
I.MX GPIO driver requires a few extra data like GPIO to PIN number mapping and the pin-controller device node etc. they are provided through _DSD methods.
Note: Later discussion with a kernel maintainer suggested we should use the DT properties for GPIO to PIN number mapping in _DSD. We haven’t investigated this yet.