summaryrefslogtreecommitdiff
path: root/arch/arm/dts/poplar-pinctrl.dtsi
blob: 7bb19e4b084a6077018297c68dcf904af0ebd43a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// SPDX-License-Identifier: GPL-2.0
/*
 * Pinctrl dts file for HiSilicon Poplar board
 *
 * Copyright (c) 2016-2018 HiSilicon Technologies Co., Ltd.
 */

#include <dt-bindings/pinctrl/hisi.h>

/* value, enable bits, disable bits, mask */
#define PINCTRL_PULLDOWN(value, enable, disable, mask) \
	(value << 13) (enable << 13) (disable << 13) (mask << 13)
#define PINCTRL_PULLUP(value, enable, disable, mask) \
	(value << 12) (enable << 12) (disable << 12) (mask << 12)
#define PINCTRL_SLEW_RATE(value, mask)	  (value << 8) (mask << 8)
#define PINCTRL_DRV_STRENGTH(value, mask) (value << 4) (mask << 4)

&pmx0 {
	emmc_pins_1: emmc-pins-1 {
		pinctrl-single,pins = <
			0x000 MUX_M2
			0x004 MUX_M2
			0x008 MUX_M2
			0x00c MUX_M2
			0x010 MUX_M2
			0x014 MUX_M2
			0x018 MUX_M2
			0x01c MUX_M2
			0x024 MUX_M2
		>;
		pinctrl-single,bias-pulldown = <
			PINCTRL_PULLDOWN(0, 1, 0, 1)
		>;
		pinctrl-single,bias-pullup = <
			PINCTRL_PULLUP(0, 1, 0, 1)
		>;
		pinctrl-single,slew-rate = <
			PINCTRL_SLEW_RATE(1, 1)
		>;
		pinctrl-single,drive-strength = <
			PINCTRL_DRV_STRENGTH(0xb, 0xf)
		>;
	};

	emmc_pins_2: emmc-pins-2 {
		pinctrl-single,pins = <
			0x028 MUX_M2
		>;
		pinctrl-single,bias-pulldown = <
			PINCTRL_PULLDOWN(0, 1, 0, 1)
		>;
		pinctrl-single,bias-pullup = <
			PINCTRL_PULLUP(0, 1, 0, 1)
		>;
		pinctrl-single,slew-rate = <
			PINCTRL_SLEW_RATE(1, 1)
		>;
		pinctrl-single,drive-strength = <
			PINCTRL_DRV_STRENGTH(0x9, 0xf)
		>;
	};

	emmc_pins_3: emmc-pins-3 {
		pinctrl-single,pins = <
			0x02c MUX_M2
		>;
		pinctrl-single,bias-pulldown = <
			PINCTRL_PULLDOWN(0, 1, 0, 1)
		>;
		pinctrl-single,bias-pullup = <
			PINCTRL_PULLUP(0, 1, 0, 1)
		>;
		pinctrl-single,slew-rate = <
			PINCTRL_SLEW_RATE(1, 1)
		>;
		pinctrl-single,drive-strength = <
			PINCTRL_DRV_STRENGTH(3, 3)
		>;
	};

	emmc_pins_4: emmc-pins-4 {
		pinctrl-single,pins = <
			0x030 MUX_M2
		>;
		pinctrl-single,bias-pulldown = <
			PINCTRL_PULLDOWN(1, 1, 0, 1)
		>;
		pinctrl-single,bias-pullup = <
			PINCTRL_PULLUP(0, 1, 0, 1)
		>;
		pinctrl-single,slew-rate = <
			PINCTRL_SLEW_RATE(1, 1)
		>;
		pinctrl-single,drive-strength = <
			PINCTRL_DRV_STRENGTH(3, 3)
		>;
	};
};