1 1.1 jmcneill /* $NetBSD: am43xx.h,v 1.1.1.3 2018/04/28 18:25:53 jmcneill Exp $ */ 2 1.1 jmcneill 3 1.1.1.2 jmcneill /* SPDX-License-Identifier: GPL-2.0 */ 4 1.1 jmcneill /* 5 1.1 jmcneill * This header provides constants specific to AM43XX pinctrl bindings. 6 1.1 jmcneill */ 7 1.1 jmcneill 8 1.1 jmcneill #ifndef _DT_BINDINGS_PINCTRL_AM43XX_H 9 1.1 jmcneill #define _DT_BINDINGS_PINCTRL_AM43XX_H 10 1.1 jmcneill 11 1.1 jmcneill #define MUX_MODE0 0 12 1.1 jmcneill #define MUX_MODE1 1 13 1.1 jmcneill #define MUX_MODE2 2 14 1.1 jmcneill #define MUX_MODE3 3 15 1.1 jmcneill #define MUX_MODE4 4 16 1.1 jmcneill #define MUX_MODE5 5 17 1.1 jmcneill #define MUX_MODE6 6 18 1.1 jmcneill #define MUX_MODE7 7 19 1.1 jmcneill #define MUX_MODE8 8 20 1.1 jmcneill #define MUX_MODE9 9 21 1.1 jmcneill 22 1.1 jmcneill #define PULL_DISABLE (1 << 16) 23 1.1 jmcneill #define PULL_UP (1 << 17) 24 1.1 jmcneill #define INPUT_EN (1 << 18) 25 1.1 jmcneill #define SLEWCTRL_SLOW (1 << 19) 26 1.1 jmcneill #define SLEWCTRL_FAST 0 27 1.1.1.2 jmcneill #define DS0_FORCE_OFF_MODE (1 << 24) 28 1.1.1.2 jmcneill #define DS0_INPUT (1 << 25) 29 1.1.1.2 jmcneill #define DS0_FORCE_OUT_HIGH (1 << 26) 30 1.1.1.3 jmcneill #define DS0_PULL_UP_DOWN_EN (0 << 27) 31 1.1.1.3 jmcneill #define DS0_PULL_UP_DOWN_DIS (1 << 27) 32 1.1.1.2 jmcneill #define DS0_PULL_UP_SEL (1 << 28) 33 1.1 jmcneill #define WAKEUP_ENABLE (1 << 29) 34 1.1 jmcneill 35 1.1.1.2 jmcneill #define DS0_PIN_OUTPUT (DS0_FORCE_OFF_MODE) 36 1.1.1.2 jmcneill #define DS0_PIN_OUTPUT_HIGH (DS0_FORCE_OFF_MODE | DS0_FORCE_OUT_HIGH) 37 1.1.1.2 jmcneill #define DS0_PIN_OUTPUT_PULLUP (DS0_FORCE_OFF_MODE | DS0_PULL_UP_DOWN_EN | DS0_PULL_UP_SEL) 38 1.1.1.2 jmcneill #define DS0_PIN_OUTPUT_PULLDOWN (DS0_FORCE_OFF_MODE | DS0_PULL_UP_DOWN_EN) 39 1.1.1.2 jmcneill #define DS0_PIN_INPUT (DS0_FORCE_OFF_MODE | DS0_INPUT) 40 1.1.1.2 jmcneill #define DS0_PIN_INPUT_PULLUP (DS0_FORCE_OFF_MODE | DS0_INPUT | DS0_PULL_UP_DOWN_EN | DS0_PULL_UP_SEL) 41 1.1.1.2 jmcneill #define DS0_PIN_INPUT_PULLDOWN (DS0_FORCE_OFF_MODE | DS0_INPUT | DS0_PULL_UP_DOWN_EN) 42 1.1.1.2 jmcneill 43 1.1 jmcneill #define PIN_OUTPUT (PULL_DISABLE) 44 1.1 jmcneill #define PIN_OUTPUT_PULLUP (PULL_UP) 45 1.1 jmcneill #define PIN_OUTPUT_PULLDOWN 0 46 1.1 jmcneill #define PIN_INPUT (INPUT_EN | PULL_DISABLE) 47 1.1 jmcneill #define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP) 48 1.1 jmcneill #define PIN_INPUT_PULLDOWN (INPUT_EN) 49 1.1 jmcneill 50 1.1 jmcneill /* 51 1.1 jmcneill * Macro to allow using the absolute physical address instead of the 52 1.1 jmcneill * padconf registers instead of the offset from padconf base. 53 1.1 jmcneill */ 54 1.1 jmcneill #define AM4372_IOPAD(pa, val) (((pa) & 0xffff) - 0x0800) (val) 55 1.1 jmcneill 56 1.1 jmcneill #endif 57 1.1 jmcneill 58