From b3d26f3cf0963f404ed56a32078fbd1ae5708e7f Mon Sep 17 00:00:00 2001 From: Alexander Voronov Date: Fri, 28 Apr 2023 20:28:19 +0300 Subject: [PATCH] feat(TegraGpio): Add GPIO AON for T194 Internal note: Received via github: https://github.com/NVIDIA/edk2-nvidia/pull/45 Change-Id: Ia2fc12f02e55c24cc80f134e9688b078a67d393f Signed-off-by: Alexander Voronov Reviewed-on: https://git-master.nvidia.com/r/c/tegra/bootloader/uefi/edk2-nvidia/+/2896656 Tested-by: mobile promotions Reviewed-by: mobile promotions --- Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.c | 12 ++++++++++++ Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.inf | 1 + Silicon/NVIDIA/NVIDIA.dec | 1 + 3 files changed, 14 insertions(+) diff --git a/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.c b/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.c index 9e353f537a..0fb096c8f2 100644 --- a/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.c +++ b/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.c @@ -54,6 +54,14 @@ STATIC CONST GPIO_CONTROLLER Tegra194GpioControllers[] = { TEGRA_GPIO_ENTRY (27, 0, 0, 2) }; +STATIC CONST GPIO_CONTROLLER Tegra194GpioAonControllers[] = { + TEGRA_GPIO_ENTRY (0, 0, 3, 8), + TEGRA_GPIO_ENTRY (1, 0, 4, 4), + TEGRA_GPIO_ENTRY (2, 0, 1, 8), + TEGRA_GPIO_ENTRY (3, 0, 2, 3), + TEGRA_GPIO_ENTRY (4, 0, 0, 7) +}; + STATIC CONST GPIO_CONTROLLER Tegra234GpioControllers[] = { TEGRA_GPIO_ENTRY (0, 0, 0, 8), TEGRA_GPIO_ENTRY (1, 0, 3, 1), @@ -137,6 +145,7 @@ STATIC CONST GPIO_CONTROLLER Th500GpioAonControllers[] = { NVIDIA_COMPATIBILITY_MAPPING gDeviceCompatibilityMap[] = { { "nvidia,tegra194-gpio", &gNVIDIANonDiscoverableT194GpioDeviceGuid }, + { "nvidia,tegra194-gpio-aon", &gNVIDIANonDiscoverableT194GpioAonDeviceGuid }, { "nvidia,tegra234-gpio", &gNVIDIANonDiscoverableT234GpioDeviceGuid }, { "nvidia,tegra234-gpio-aon", &gNVIDIANonDiscoverableT234GpioAonDeviceGuid }, { "nvidia,tegra23x-gpio", &gNVIDIANonDiscoverableT23xGpioDeviceGuid }, @@ -532,6 +541,9 @@ DeviceDiscoveryNotify ( if (CompareGuid (Device->Type, &gNVIDIANonDiscoverableT194GpioDeviceGuid)) { mControllerArray[mControllerCount].ControllerCount = ARRAY_SIZE (Tegra194GpioControllers); mControllerArray[mControllerCount].ControllerDefault = Tegra194GpioControllers; + } else if (CompareGuid (Device->Type, &gNVIDIANonDiscoverableT194GpioAonDeviceGuid)) { + mControllerArray[mControllerCount].ControllerCount = ARRAY_SIZE (Tegra194GpioAonControllers); + mControllerArray[mControllerCount].ControllerDefault = Tegra194GpioAonControllers; } else if (CompareGuid (Device->Type, &gNVIDIANonDiscoverableT234GpioDeviceGuid)) { mControllerArray[mControllerCount].ControllerCount = ARRAY_SIZE (Tegra234GpioControllers); mControllerArray[mControllerCount].ControllerDefault = Tegra234GpioControllers; diff --git a/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.inf b/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.inf index 0c129e4a0e..9791397ea1 100644 --- a/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.inf +++ b/Silicon/NVIDIA/Drivers/TegraGpio/TegraGpioDxe.inf @@ -48,6 +48,7 @@ [Guids] gNVIDIANonDiscoverableT194GpioDeviceGuid + gNVIDIANonDiscoverableT194GpioAonDeviceGuid gNVIDIANonDiscoverableT234GpioDeviceGuid gNVIDIANonDiscoverableT234GpioAonDeviceGuid gNVIDIANonDiscoverableT23xGpioDeviceGuid diff --git a/Silicon/NVIDIA/NVIDIA.dec b/Silicon/NVIDIA/NVIDIA.dec index 94a72d402e..1ff24eb2a1 100644 --- a/Silicon/NVIDIA/NVIDIA.dec +++ b/Silicon/NVIDIA/NVIDIA.dec @@ -41,6 +41,7 @@ #GPIO devices gNVIDIANonDiscoverableT194GpioDeviceGuid = { 0x294a3144, 0x5e39, 0x4088, { 0xbd, 0x40, 0x8e, 0x49, 0xe0, 0x9e, 0x9c, 0x3d } } + gNVIDIANonDiscoverableT194GpioAonDeviceGuid = { 0x05da980e, 0x7855, 0x4275, { 0xb5, 0x31, 0x27, 0xdd, 0x4f, 0x41, 0xe9, 0xc7 } } gNVIDIANonDiscoverableT234GpioDeviceGuid = { 0x1d0e1fbb, 0x708b, 0x4539, { 0x89, 0xe5, 0xa3, 0x4a, 0xea, 0xe6, 0xed, 0xfd } } gNVIDIANonDiscoverableT234GpioAonDeviceGuid = { 0x4a23a729, 0x3534, 0x45f6, { 0x91, 0xc5, 0x1a, 0xe2, 0xbd, 0x44, 0xeb, 0x44 } } gNVIDIANonDiscoverableT23xGpioDeviceGuid = { 0xf0e65003, 0x57ad, 0x4610, { 0xae, 0xf7, 0x9f, 0x85, 0x52, 0x2a, 0xa2, 0xae } }