xref: /freebsd/sys/contrib/device-tree/src/arm64/hisilicon/poplar-pinctrl.dtsi (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Pinctrl dts file for HiSilicon Poplar board
4 *
5 * Copyright (c) 2016-2018 HiSilicon Technologies Co., Ltd.
6 */
7
8#include <dt-bindings/pinctrl/hisi.h>
9
10/* value, enable bits, disable bits, mask */
11#define PINCTRL_PULLDOWN(value, enable, disable, mask) \
12	(value << 13) (enable << 13) (disable << 13) (mask << 13)
13#define PINCTRL_PULLUP(value, enable, disable, mask) \
14	(value << 12) (enable << 12) (disable << 12) (mask << 12)
15#define PINCTRL_SLEW_RATE(value, mask)	  (value << 8) (mask << 8)
16#define PINCTRL_DRV_STRENGTH(value, mask) (value << 4) (mask << 4)
17
18&pmx0 {
19	emmc_pins_1: emmc-pins-1 {
20		pinctrl-single,pins = <
21			0x000 MUX_M2
22			0x004 MUX_M2
23			0x008 MUX_M2
24			0x00c MUX_M2
25			0x010 MUX_M2
26			0x014 MUX_M2
27			0x018 MUX_M2
28			0x01c MUX_M2
29			0x024 MUX_M2
30		>;
31		pinctrl-single,bias-pulldown = <
32			PINCTRL_PULLDOWN(0, 1, 0, 1)
33		>;
34		pinctrl-single,bias-pullup = <
35			PINCTRL_PULLUP(0, 1, 0, 1)
36		>;
37		pinctrl-single,slew-rate = <
38			PINCTRL_SLEW_RATE(1, 1)
39		>;
40		pinctrl-single,drive-strength = <
41			PINCTRL_DRV_STRENGTH(0xb, 0xf)
42		>;
43	};
44
45	emmc_pins_2: emmc-pins-2 {
46		pinctrl-single,pins = <
47			0x028 MUX_M2
48		>;
49		pinctrl-single,bias-pulldown = <
50			PINCTRL_PULLDOWN(0, 1, 0, 1)
51		>;
52		pinctrl-single,bias-pullup = <
53			PINCTRL_PULLUP(0, 1, 0, 1)
54		>;
55		pinctrl-single,slew-rate = <
56			PINCTRL_SLEW_RATE(1, 1)
57		>;
58		pinctrl-single,drive-strength = <
59			PINCTRL_DRV_STRENGTH(0x9, 0xf)
60		>;
61	};
62
63	emmc_pins_3: emmc-pins-3 {
64		pinctrl-single,pins = <
65			0x02c MUX_M2
66		>;
67		pinctrl-single,bias-pulldown = <
68			PINCTRL_PULLDOWN(0, 1, 0, 1)
69		>;
70		pinctrl-single,bias-pullup = <
71			PINCTRL_PULLUP(0, 1, 0, 1)
72		>;
73		pinctrl-single,slew-rate = <
74			PINCTRL_SLEW_RATE(1, 1)
75		>;
76		pinctrl-single,drive-strength = <
77			PINCTRL_DRV_STRENGTH(3, 3)
78		>;
79	};
80
81	emmc_pins_4: emmc-pins-4 {
82		pinctrl-single,pins = <
83			0x030 MUX_M2
84		>;
85		pinctrl-single,bias-pulldown = <
86			PINCTRL_PULLDOWN(1, 1, 0, 1)
87		>;
88		pinctrl-single,bias-pullup = <
89			PINCTRL_PULLUP(0, 1, 0, 1)
90		>;
91		pinctrl-single,slew-rate = <
92			PINCTRL_SLEW_RATE(1, 1)
93		>;
94		pinctrl-single,drive-strength = <
95			PINCTRL_DRV_STRENGTH(3, 3)
96		>;
97	};
98};
99