summaryrefslogtreecommitdiff
path: root/arch/arm64/boot/dts/marvell/cn9130-cf-base.dts
blob: 788a5c302b17f97396a68e62a371a4121d2f0a8b (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2024 Josua Mayer <josua@solid-run.com>
 *
 * DTS for SolidRun CN9130 Clearfog Base.
 *
 */

/dts-v1/;

#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

#include "cn9130.dtsi"
#include "cn9130-sr-som.dtsi"
#include "cn9130-cf.dtsi"

/ {
	model = "SolidRun CN9130 Clearfog Base";
	compatible = "solidrun,cn9130-clearfog-base",
		     "solidrun,cn9130-sr-som", "marvell,cn9130";

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-0 = <&rear_button_pins>;
		pinctrl-names = "default";

		button-0 {
			/* The rear SW3 button */
			label = "Rear Button";
			gpios = <&cp0_gpio1 31 GPIO_ACTIVE_LOW>;
			linux,can-disable;
			linux,code = <BTN_0>;
		};
	};

	rfkill-m2-gnss {
		compatible = "rfkill-gpio";
		label = "m.2 GNSS";
		radio-type = "gps";
		/* rfkill-gpio inverts internally */
		shutdown-gpios = <&expander0 9 GPIO_ACTIVE_HIGH>;
	};

	/* M.2 is B-keyed, so w-disable is for WWAN */
	rfkill-m2-wwan {
		compatible = "rfkill-gpio";
		label = "m.2 WWAN";
		radio-type = "wwan";
		/* rfkill-gpio inverts internally */
		shutdown-gpios = <&expander0 8 GPIO_ACTIVE_HIGH>;
	};
};

/* SRDS #3 - SGMII 1GE */
&cp0_eth1 {
	phy = <&phy1>;
	phys = <&cp0_comphy3 1>;
	phy-mode = "sgmii";
	status = "okay";
};

&cp0_eth2_phy {
	/*
	 * Configure LEDs default behaviour:
	 * - LED[0]: link/activity: On/blink (green)
	 * - LED[1]: link is 100/1000Mbps: On (yellow)
	 * - LED[2]: high impedance (floating)
	 */
	marvell,reg-init = <3 16 0xf000 0x0a61>;

	leds {
		#address-cells = <1>;
		#size-cells = <0>;

		led@0 {
			reg = <0>;
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_WAN;
			default-state = "keep";
		};

		led@1 {
			reg = <1>;
			color = <LED_COLOR_ID_YELLOW>;
			function = LED_FUNCTION_WAN;
			default-state = "keep";
		};
	};
};

&cp0_gpio1 {
	sim-select-hog {
		gpio-hog;
		gpios = <27 GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "sim-select";
	};
};

&cp0_mdio {
	phy1: ethernet-phy@1 {
		reg = <1>;
		/*
		 * Configure LEDs default behaviour:
		 * - LED[0]: link/activity: On/blink (green)
		 * - LED[1]: link is 100/1000Mbps: On (yellow)
		 * - LED[2]: high impedance (floating)
		 *
		 * Configure LEDs electrical polarity
		 * - on-state: low
		 * - off-state: high (not hi-z, to avoid residual glow)
		 */
		marvell,reg-init = <3 16 0xf000 0x0a61>,
				   <3 17 0x003f 0x000a>;

		leds {
			#address-cells = <1>;
			#size-cells = <0>;

			led@0 {
				reg = <0>;
				color = <LED_COLOR_ID_GREEN>;
				function = LED_FUNCTION_LAN;
				default-state = "keep";
			};

			led@1 {
				reg = <1>;
				color = <LED_COLOR_ID_YELLOW>;
				function = LED_FUNCTION_LAN;
				default-state = "keep";
			};
		};
	};
};

&cp0_pinctrl {
	pinctrl-0 = <&sim_select_pins>;
	pintrl-names = "default";

	rear_button_pins: cp0-rear-button-pins {
		marvell,pins = "mpp31";
		marvell,function = "gpio";
	};

	sim_select_pins: cp0-sim-select-pins {
		marvell,pins = "mpp27";
		marvell,function = "gpio";
	};
};

/*
 * SRDS #4 - USB 3.0 host on M.2 connector
 * USB-2.0 Host on Type-A connector
 */
&cp0_usb3_1 {
	phys = <&cp0_comphy4 1>, <&cp0_utmi1>;
	phy-names = "comphy", "utmi";
	dr_mode = "host";
	status = "okay";
};

&expander0 {
	m2-full-card-power-off-hog {
		gpio-hog;
		gpios = <2 GPIO_ACTIVE_LOW>;
		output-low;
		line-name = "m2-full-card-power-off";
	};

	m2-reset-hog {
		gpio-hog;
		gpios = <10 GPIO_ACTIVE_LOW>;
		output-low;
		line-name = "m2-reset";
	};
};