Home | History | Annotate | Line # | Download | only in pinctrl
      1 /*	$NetBSD: k3.h,v 1.1.1.3 2021/11/07 16:49:56 jmcneill Exp $	*/
      2 
      3 /* SPDX-License-Identifier: GPL-2.0 */
      4 /*
      5  * This header provides constants for pinctrl bindings for TI's K3 SoC
      6  * family.
      7  *
      8  * Copyright (C) 2018-2021 Texas Instruments Incorporated - https://www.ti.com/
      9  */
     10 #ifndef _DT_BINDINGS_PINCTRL_TI_K3_H
     11 #define _DT_BINDINGS_PINCTRL_TI_K3_H
     12 
     13 #define PULLUDEN_SHIFT		(16)
     14 #define PULLTYPESEL_SHIFT	(17)
     15 #define RXACTIVE_SHIFT		(18)
     16 
     17 #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
     18 #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
     19 
     20 #define PULL_UP			(1 << PULLTYPESEL_SHIFT | PULL_ENABLE)
     21 #define PULL_DOWN		(0 << PULLTYPESEL_SHIFT | PULL_ENABLE)
     22 
     23 #define INPUT_EN		(1 << RXACTIVE_SHIFT)
     24 #define INPUT_DISABLE		(0 << RXACTIVE_SHIFT)
     25 
     26 /* Only these macros are expected be used directly in device tree files */
     27 #define PIN_OUTPUT		(INPUT_DISABLE | PULL_DISABLE)
     28 #define PIN_OUTPUT_PULLUP	(INPUT_DISABLE | PULL_UP)
     29 #define PIN_OUTPUT_PULLDOWN	(INPUT_DISABLE | PULL_DOWN)
     30 #define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
     31 #define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
     32 #define PIN_INPUT_PULLDOWN	(INPUT_EN | PULL_DOWN)
     33 
     34 #define AM65X_IOPAD(pa, val, muxmode)		(((pa) & 0x1fff)) ((val) | (muxmode))
     35 #define AM65X_WKUP_IOPAD(pa, val, muxmode)	(((pa) & 0x1fff)) ((val) | (muxmode))
     36 
     37 #define J721E_IOPAD(pa, val, muxmode)		(((pa) & 0x1fff)) ((val) | (muxmode))
     38 #define J721E_WKUP_IOPAD(pa, val, muxmode)	(((pa) & 0x1fff)) ((val) | (muxmode))
     39 
     40 #define AM64X_IOPAD(pa, val, muxmode)		(((pa) & 0x1fff)) ((val) | (muxmode))
     41 #define AM64X_MCU_IOPAD(pa, val, muxmode)	(((pa) & 0x1fff)) ((val) | (muxmode))
     42 
     43 #endif
     44