xref: /openbmc/linux/include/dt-bindings/pinctrl/am43xx.h (revision 130c28daf01c8aad5224abfb39f59d892a436222)
1e54686e4SMugunthan V N /*
2e54686e4SMugunthan V N  * This header provides constants specific to AM43XX pinctrl bindings.
3e54686e4SMugunthan V N  */
4e54686e4SMugunthan V N 
5e54686e4SMugunthan V N #ifndef _DT_BINDINGS_PINCTRL_AM43XX_H
6e54686e4SMugunthan V N #define _DT_BINDINGS_PINCTRL_AM43XX_H
7e54686e4SMugunthan V N 
8e54686e4SMugunthan V N #define MUX_MODE0	0
9e54686e4SMugunthan V N #define MUX_MODE1	1
10e54686e4SMugunthan V N #define MUX_MODE2	2
11e54686e4SMugunthan V N #define MUX_MODE3	3
12e54686e4SMugunthan V N #define MUX_MODE4	4
13e54686e4SMugunthan V N #define MUX_MODE5	5
14e54686e4SMugunthan V N #define MUX_MODE6	6
15e54686e4SMugunthan V N #define MUX_MODE7	7
16dfc9d3f1SDarren Etheridge #define MUX_MODE8	8
1792814c4aSDave Gerlach #define MUX_MODE9	9
18e54686e4SMugunthan V N 
19e54686e4SMugunthan V N #define PULL_DISABLE		(1 << 16)
20e54686e4SMugunthan V N #define PULL_UP			(1 << 17)
21e54686e4SMugunthan V N #define INPUT_EN		(1 << 18)
2210b21855SDave Gerlach #define SLEWCTRL_SLOW		(1 << 19)
2310b21855SDave Gerlach #define SLEWCTRL_FAST		0
24*130c28daSAndrew F. Davis #define DS0_FORCE_OFF_MODE	(1 << 24)
25*130c28daSAndrew F. Davis #define DS0_INPUT		(1 << 25)
26*130c28daSAndrew F. Davis #define DS0_FORCE_OUT_HIGH	(1 << 26)
27e54686e4SMugunthan V N #define DS0_PULL_UP_DOWN_EN	(1 << 27)
28*130c28daSAndrew F. Davis #define DS0_PULL_UP_SEL		(1 << 28)
29b6bbf598SEyal Reizer #define WAKEUP_ENABLE		(1 << 29)
30e54686e4SMugunthan V N 
31*130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT		(DS0_FORCE_OFF_MODE)
32*130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT_HIGH	(DS0_FORCE_OFF_MODE | DS0_FORCE_OUT_HIGH)
33*130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT_PULLUP	(DS0_FORCE_OFF_MODE | DS0_PULL_UP_DOWN_EN | DS0_PULL_UP_SEL)
34*130c28daSAndrew F. Davis #define DS0_PIN_OUTPUT_PULLDOWN	(DS0_FORCE_OFF_MODE | DS0_PULL_UP_DOWN_EN)
35*130c28daSAndrew F. Davis #define DS0_PIN_INPUT		(DS0_FORCE_OFF_MODE | DS0_INPUT)
36*130c28daSAndrew F. Davis #define DS0_PIN_INPUT_PULLUP	(DS0_FORCE_OFF_MODE | DS0_INPUT | DS0_PULL_UP_DOWN_EN | DS0_PULL_UP_SEL)
37*130c28daSAndrew F. Davis #define DS0_PIN_INPUT_PULLDOWN	(DS0_FORCE_OFF_MODE | DS0_INPUT | DS0_PULL_UP_DOWN_EN)
38*130c28daSAndrew F. Davis 
39e54686e4SMugunthan V N #define PIN_OUTPUT		(PULL_DISABLE)
40e54686e4SMugunthan V N #define PIN_OUTPUT_PULLUP	(PULL_UP)
41e54686e4SMugunthan V N #define PIN_OUTPUT_PULLDOWN	0
42e54686e4SMugunthan V N #define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
43e54686e4SMugunthan V N #define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
44e54686e4SMugunthan V N #define PIN_INPUT_PULLDOWN	(INPUT_EN)
45e54686e4SMugunthan V N 
46fc63efdfSJavier Martinez Canillas /*
47fc63efdfSJavier Martinez Canillas  * Macro to allow using the absolute physical address instead of the
48fc63efdfSJavier Martinez Canillas  * padconf registers instead of the offset from padconf base.
49fc63efdfSJavier Martinez Canillas  */
50fc63efdfSJavier Martinez Canillas #define AM4372_IOPAD(pa, val)	(((pa) & 0xffff) - 0x0800) (val)
51fc63efdfSJavier Martinez Canillas 
52e54686e4SMugunthan V N #endif
53e54686e4SMugunthan V N 
54