1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2024 Carl Zeiss Meditec AG
3 * SPDX-License-Identifier: Apache-2.0
4 */
5/****************************************
6 * PLEASE KEEP REG ADDRESSES SEQUENTIAL *
7 ***************************************/
8
9adi_tmc50xx: adi_tmc50xx@0 {
10	compatible = "adi,tmc50xx";
11	status = "okay";
12	reg = <0x0>;
13	spi-max-frequency = <8000000>;
14	label = "tmc5041_0";
15
16	#address-cells = <1>;
17	#size-cells = <0>;
18
19	poscmp-enable; test-mode; lock-gconf; /* ADI TMC Global configuration flags */
20	clock-frequency = <16000000>; /* Internal/External Clock frequency */
21
22	tmc50xx_0: tmc50xx_0@0 {
23		status = "okay";
24		reg = <0>;
25
26		/* common stepper controller settings */
27		invert-direction;
28		micro-step-res = <256>;
29
30		/* ADI TMC stallguard settings specific to TMC50XX */
31		activate-stallguard2;
32		stallguard-velocity-check-interval-ms=<100>;
33		stallguard2-threshold=<9>;
34		stallguard-threshold-velocity=<500000>;
35
36		/* ADI TMC ramp generator as well as current settings */
37		vstart = <10>;
38		a1 = <20>;
39		v1 = <30>;
40		d1 = <40>;
41		vmax = <50>;
42		amax = <60>;
43		dmax = <70>;
44		tzerowait = <80>;
45		vhigh = <90>;
46		vcoolthrs = <100>;
47		ihold = <1>;
48		irun = <2>;
49		iholddelay = <3>;
50	};
51
52	tmc50xx_1: tmc50xx_1@1 {
53		status = "okay";
54		reg = <1>;
55
56		/* common stepper controller settings */
57		invert-direction;
58		micro-step-res = <256>;
59
60		/* ADI TMC stallguard settings specific to TMC50XX */
61		activate-stallguard2;
62		stallguard-velocity-check-interval-ms=<100>;
63		stallguard2-threshold=<9>;
64		stallguard-threshold-velocity=<500000>;
65
66		/* ADI TMC ramp generator as well as current settings */
67		vstart = <10>;
68		a1 = <20>;
69		v1 = <30>;
70		d1 = <40>;
71		vmax = <50>;
72		amax = <60>;
73		dmax = <70>;
74		tzerowait = <80>;
75		vhigh = <90>;
76		vcoolthrs = <100>;
77		ihold = <1>;
78		irun = <2>;
79		iholddelay = <3>;
80	};
81};
82
83adi_tmc51xx_1: adi_tmc51xx@1 {
84	compatible = "adi,tmc51xx";
85	status = "okay";
86	reg = <0x01>;
87	spi-max-frequency = <8000000>;
88	label = "tmc5160_1";
89
90	#address-cells = <1>;
91	#size-cells = <0>;
92
93	en-pwm-mode; test-mode; /* ADI TMC Global configuration flags */
94	clock-frequency = <16000000>; /* Internal/External Clock frequency */
95
96	/* common stepper controller settings */
97	invert-direction;
98	micro-step-res = <256>;
99
100	/* ADI TMC stallguard settings specific to TMC5160 */
101	activate-stallguard2;
102	stallguard-velocity-check-interval-ms = <100>;
103	stallguard2-threshold = <9>;
104	stallguard-threshold-velocity = <50000>;
105
106	/* ADI TMC ramp generator as well as current settings */
107	vstart = <10>;
108	a1 = <20>;
109	v1 = <30>;
110	d1 = <40>;
111	vmax = <50>;
112	amax = <60>;
113	dmax = <70>;
114	tzerowait = <80>;
115	thigh = <90>;
116	tcoolthrs = <100>;
117	tpwmthrs = <110>;
118	tpowerdown = <120>;
119	ihold = <1>;
120	irun = <2>;
121	iholddelay = <3>;
122};
123
124adi_tmc51xx_2: adi_tmc51xx@2 {
125	compatible = "adi,tmc51xx";
126	status = "okay";
127	reg = <0x02>;
128	spi-max-frequency = <8000000>;
129	label = "tmc5160_2";
130
131	#address-cells = <1>;
132	#size-cells = <0>;
133	diag0-gpios = <&test_gpio 0x01 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* DIAG pin @0x01 */
134
135	en-pwm-mode; test-mode; /* ADI TMC Global configuration flags */
136	clock-frequency = <16000000>; /* Internal/External Clock frequency */
137
138	/* common stepper controller settings */
139	invert-direction;
140	micro-step-res = <256>;
141
142	/* ADI TMC stallguard settings specific to TMC5160 */
143	activate-stallguard2;
144	stallguard-velocity-check-interval-ms = <100>;
145	stallguard2-threshold = <9>;
146	stallguard-threshold-velocity = <50000>;
147
148	/* ADI TMC ramp generator as well as current settings */
149	vstart = <10>;
150	a1 = <20>;
151	v1 = <30>;
152	d1 = <40>;
153	vmax = <50>;
154	amax = <60>;
155	dmax = <70>;
156	tzerowait = <80>;
157	thigh = <90>;
158	tcoolthrs = <100>;
159	tpwmthrs = <110>;
160	tpowerdown = <120>;
161	ihold = <1>;
162	irun = <2>;
163	iholddelay = <3>;
164};
165