Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
Nishanth Menon | 4698bb8 | 2021-08-31 13:12:24 -0500 | [diff] [blame] | 3 | * This header provides constants for pinctrl bindings for TI's K3 SoC |
| 4 | * family. |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 5 | * |
Nishanth Menon | 4698bb8 | 2021-08-31 13:12:24 -0500 | [diff] [blame] | 6 | * Copyright (C) 2018-2021 Texas Instruments Incorporated - https://www.ti.com/ |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 7 | */ |
Nishanth Menon | 4698bb8 | 2021-08-31 13:12:24 -0500 | [diff] [blame] | 8 | #ifndef _DT_BINDINGS_PINCTRL_TI_K3_H |
| 9 | #define _DT_BINDINGS_PINCTRL_TI_K3_H |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 10 | |
Nishanth Menon | 4698bb8 | 2021-08-31 13:12:24 -0500 | [diff] [blame] | 11 | #define PULLUDEN_SHIFT (16) |
| 12 | #define PULLTYPESEL_SHIFT (17) |
| 13 | #define RXACTIVE_SHIFT (18) |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 14 | |
Nishanth Menon | 4698bb8 | 2021-08-31 13:12:24 -0500 | [diff] [blame] | 15 | #define PULL_DISABLE (1 << PULLUDEN_SHIFT) |
| 16 | #define PULL_ENABLE (0 << PULLUDEN_SHIFT) |
| 17 | |
| 18 | #define PULL_UP (1 << PULLTYPESEL_SHIFT | PULL_ENABLE) |
| 19 | #define PULL_DOWN (0 << PULLTYPESEL_SHIFT | PULL_ENABLE) |
| 20 | |
| 21 | #define INPUT_EN (1 << RXACTIVE_SHIFT) |
| 22 | #define INPUT_DISABLE (0 << RXACTIVE_SHIFT) |
| 23 | |
| 24 | /* Only these macros are expected be used directly in device tree files */ |
| 25 | #define PIN_OUTPUT (INPUT_DISABLE | PULL_DISABLE) |
| 26 | #define PIN_OUTPUT_PULLUP (INPUT_DISABLE | PULL_UP) |
| 27 | #define PIN_OUTPUT_PULLDOWN (INPUT_DISABLE | PULL_DOWN) |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 28 | #define PIN_INPUT (INPUT_EN | PULL_DISABLE) |
| 29 | #define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP) |
Nishanth Menon | 4698bb8 | 2021-08-31 13:12:24 -0500 | [diff] [blame] | 30 | #define PIN_INPUT_PULLDOWN (INPUT_EN | PULL_DOWN) |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 31 | |
Andreas Dannenberg | 7202af9 | 2019-04-29 12:56:44 -0500 | [diff] [blame] | 32 | #define AM65X_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
| 33 | #define AM65X_WKUP_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 34 | |
Lokesh Vutla | 382f1dd | 2019-06-13 10:29:52 +0530 | [diff] [blame] | 35 | #define J721E_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
| 36 | #define J721E_WKUP_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
| 37 | |
Dave Gerlach | dd41886 | 2021-04-23 11:27:43 -0500 | [diff] [blame] | 38 | #define AM64X_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
| 39 | #define AM64X_MCU_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
| 40 | |
Aswath Govindraju | 55e1d74 | 2022-01-25 20:56:39 +0530 | [diff] [blame^] | 41 | #define J721S2_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
| 42 | #define J721S2_WKUP_IOPAD(pa, val, muxmode) (((pa) & 0x1fff)) ((val) | (muxmode)) |
| 43 | |
Lokesh Vutla | 853f7f5 | 2018-08-27 15:59:09 +0530 | [diff] [blame] | 44 | #endif |