-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstepper-pins.dtsi
94 lines (89 loc) · 2.79 KB
/
stepper-pins.dtsi
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
#include "bone/black.h"
#include "gpio.h"
// Since we're creating a virtual device, there's not really a better place to
// put it than root of the device tree.
/ {
// Node name "gpios" is arbitrary but should not conflict with other
// nodes or properties in the root of the device tree.
// To list all of these on a running system: ls /proc/device-tree/
gpios {
// configure the driver for this device node, which must be "gpio-of-helper"
compatible = "gpio-of-helper";
// Attach pinmux node to this device node. In rare cases devices may have
// multiple pinmux states, but usually you only have a "default" state.
pinctrl-names = "default";
pinctrl-0 = <&gpio_pins>; //<--- references the "gpio_pins:" label below
// For each gpio to be setup {
// The node name "gpio-label" becomes the gpio label and may be arbitrary but
// must be unique for each gpio (globally, not merely those exported by this
// gpio-of-helper device).
MS1 {
gpio = <
&gpio2
4
ACTIVE_HIGH
>;
output; // initial direction: input or output (optional for outputs)
init-low; // if output, whether it's initially low or initially high
};
MS2 {
gpio = <
&gpio1
13
ACTIVE_HIGH
>;
output; // initial direction: input or output (optional for outputs)
init-low; // if output, whether it's initially low or initially high
};
enable {
gpio = <
&gpio1
12
ACTIVE_LOW
>;
output; // initial direction: input or output (optional for outputs)
init-low; // if output, whether it's initially low or initially high
};
direction {
gpio = <
&gpio0
23
ACTIVE_HIGH
>;
output; // initial direction: input or output (optional for outputs)
init-low; // if output, whether it's initially low or initially high
};
step {
gpio = <
&gpio0
26
ACTIVE_HIGH
>;
output; // initial direction: input or output (optional for outputs)
init-low; // if output, whether it's initially low or initially high
};
// }
};
};
// Pinmux nodes must be created inside the pinmux controller, which is &am33xx_pinmux
&am33xx_pinmux {
// Label "gpio_pins" is arbitrary but must be _globally_ unique among all labels
// in the device tree (base + overlays), hence it's a good idea to make a bit more
// verbose than the node name needs to be. Also, unlike the node name, the label
// needs to be a valid C identifier (so only alphanumeric and underscores).
//
// Node name "gpios" only needs to be unique inside &am33xx_pinmux, so usually
// it's fine to just use the same name as the device it's for.
//
gpio_pins: stepper-gpios {
pinctrl-single,pins = <
// {
PIN_PULLDN( P8_10, 7 )
PIN_PULLDN( P8_11, 7 )
PIN_PULLDN( P8_12, 7 )
PIN_PULLDN( P8_13, 7 )
PIN_PULLDN( P8_14, 7 )
// }
>;
};
};