|
1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
2 | 2 | /* |
3 | | - * Copyright (c) 2016-2022 NVIDIA Corporation |
| 3 | + * Copyright (c) 2016-2025 NVIDIA Corporation |
4 | 4 | * |
5 | 5 | * Author: Thierry Reding <treding@nvidia.com> |
6 | 6 | * Dipen Patel <dpatel@nvidia.com> |
|
69 | 69 |
|
70 | 70 | #define TEGRA186_GPIO_INTERRUPT_STATUS(x) (0x100 + (x) * 4) |
71 | 71 |
|
| 72 | +/* Tegra410 GPIOs implemented by the COMPUTE GPIO controller */ |
| 73 | +#define TEGRA410_COMPUTE_GPIO_PORT_A 0 |
| 74 | +#define TEGRA410_COMPUTE_GPIO_PORT_B 1 |
| 75 | +#define TEGRA410_COMPUTE_GPIO_PORT_C 2 |
| 76 | +#define TEGRA410_COMPUTE_GPIO_PORT_D 3 |
| 77 | +#define TEGRA410_COMPUTE_GPIO_PORT_E 4 |
| 78 | + |
| 79 | +/* Tegra410 GPIOs implemented by the SYSTEM GPIO controller */ |
| 80 | +#define TEGRA410_SYSTEM_GPIO_PORT_A 0 |
| 81 | +#define TEGRA410_SYSTEM_GPIO_PORT_B 1 |
| 82 | +#define TEGRA410_SYSTEM_GPIO_PORT_C 2 |
| 83 | +#define TEGRA410_SYSTEM_GPIO_PORT_D 3 |
| 84 | +#define TEGRA410_SYSTEM_GPIO_PORT_E 4 |
| 85 | +#define TEGRA410_SYSTEM_GPIO_PORT_I 5 |
| 86 | +#define TEGRA410_SYSTEM_GPIO_PORT_J 6 |
| 87 | +#define TEGRA410_SYSTEM_GPIO_PORT_K 7 |
| 88 | +#define TEGRA410_SYSTEM_GPIO_PORT_L 8 |
| 89 | +#define TEGRA410_SYSTEM_GPIO_PORT_M 9 |
| 90 | +#define TEGRA410_SYSTEM_GPIO_PORT_N 10 |
| 91 | +#define TEGRA410_SYSTEM_GPIO_PORT_P 11 |
| 92 | +#define TEGRA410_SYSTEM_GPIO_PORT_Q 12 |
| 93 | +#define TEGRA410_SYSTEM_GPIO_PORT_R 13 |
| 94 | +#define TEGRA410_SYSTEM_GPIO_PORT_V 14 |
| 95 | + |
72 | 96 | struct tegra_gpio_port { |
73 | 97 | const char *name; |
74 | 98 | unsigned int bank; |
@@ -1267,6 +1291,54 @@ static const struct tegra_gpio_soc tegra256_main_soc = { |
1267 | 1291 | .has_vm_support = true, |
1268 | 1292 | }; |
1269 | 1293 |
|
| 1294 | +#define TEGRA410_COMPUTE_GPIO_PORT(_name, _bank, _port, _pins) \ |
| 1295 | + TEGRA_GPIO_PORT(TEGRA410_COMPUTE, _name, _bank, _port, _pins) |
| 1296 | + |
| 1297 | +static const struct tegra_gpio_port tegra410_compute_ports[] = { |
| 1298 | + TEGRA410_COMPUTE_GPIO_PORT(A, 0, 0, 3), |
| 1299 | + TEGRA410_COMPUTE_GPIO_PORT(B, 1, 0, 8), |
| 1300 | + TEGRA410_COMPUTE_GPIO_PORT(C, 1, 1, 3), |
| 1301 | + TEGRA410_COMPUTE_GPIO_PORT(D, 2, 0, 8), |
| 1302 | + TEGRA410_COMPUTE_GPIO_PORT(E, 2, 1, 8), |
| 1303 | +}; |
| 1304 | + |
| 1305 | +static const struct tegra_gpio_soc tegra410_compute_soc = { |
| 1306 | + .num_ports = ARRAY_SIZE(tegra410_compute_ports), |
| 1307 | + .ports = tegra410_compute_ports, |
| 1308 | + .name = "tegra410-gpio-compute", |
| 1309 | + .num_irqs_per_bank = 8, |
| 1310 | + .instance = 0, |
| 1311 | +}; |
| 1312 | + |
| 1313 | +#define TEGRA410_SYSTEM_GPIO_PORT(_name, _bank, _port, _pins) \ |
| 1314 | + TEGRA_GPIO_PORT(TEGRA410_SYSTEM, _name, _bank, _port, _pins) |
| 1315 | + |
| 1316 | +static const struct tegra_gpio_port tegra410_system_ports[] = { |
| 1317 | + TEGRA410_SYSTEM_GPIO_PORT(A, 0, 0, 7), |
| 1318 | + TEGRA410_SYSTEM_GPIO_PORT(B, 0, 1, 8), |
| 1319 | + TEGRA410_SYSTEM_GPIO_PORT(C, 0, 2, 8), |
| 1320 | + TEGRA410_SYSTEM_GPIO_PORT(D, 0, 3, 8), |
| 1321 | + TEGRA410_SYSTEM_GPIO_PORT(E, 0, 4, 6), |
| 1322 | + TEGRA410_SYSTEM_GPIO_PORT(I, 1, 0, 8), |
| 1323 | + TEGRA410_SYSTEM_GPIO_PORT(J, 1, 1, 7), |
| 1324 | + TEGRA410_SYSTEM_GPIO_PORT(K, 1, 2, 7), |
| 1325 | + TEGRA410_SYSTEM_GPIO_PORT(L, 1, 3, 7), |
| 1326 | + TEGRA410_SYSTEM_GPIO_PORT(M, 2, 0, 7), |
| 1327 | + TEGRA410_SYSTEM_GPIO_PORT(N, 2, 1, 6), |
| 1328 | + TEGRA410_SYSTEM_GPIO_PORT(P, 2, 2, 8), |
| 1329 | + TEGRA410_SYSTEM_GPIO_PORT(Q, 2, 3, 3), |
| 1330 | + TEGRA410_SYSTEM_GPIO_PORT(R, 2, 4, 2), |
| 1331 | + TEGRA410_SYSTEM_GPIO_PORT(V, 1, 4, 2), |
| 1332 | +}; |
| 1333 | + |
| 1334 | +static const struct tegra_gpio_soc tegra410_system_soc = { |
| 1335 | + .num_ports = ARRAY_SIZE(tegra410_system_ports), |
| 1336 | + .ports = tegra410_system_ports, |
| 1337 | + .name = "tegra410-gpio-system", |
| 1338 | + .num_irqs_per_bank = 8, |
| 1339 | + .instance = 0, |
| 1340 | +}; |
| 1341 | + |
1270 | 1342 | static const struct of_device_id tegra186_gpio_of_match[] = { |
1271 | 1343 | { |
1272 | 1344 | .compatible = "nvidia,tegra186-gpio", |
@@ -1302,6 +1374,8 @@ static const struct acpi_device_id tegra186_gpio_acpi_match[] = { |
1302 | 1374 | { .id = "NVDA0408", .driver_data = (kernel_ulong_t)&tegra194_aon_soc }, |
1303 | 1375 | { .id = "NVDA0508", .driver_data = (kernel_ulong_t)&tegra241_main_soc }, |
1304 | 1376 | { .id = "NVDA0608", .driver_data = (kernel_ulong_t)&tegra241_aon_soc }, |
| 1377 | + { .id = "NVDA0708", .driver_data = (kernel_ulong_t)&tegra410_compute_soc }, |
| 1378 | + { .id = "NVDA0808", .driver_data = (kernel_ulong_t)&tegra410_system_soc }, |
1305 | 1379 | {} |
1306 | 1380 | }; |
1307 | 1381 | MODULE_DEVICE_TABLE(acpi, tegra186_gpio_acpi_match); |
|
0 commit comments