Skip to content

Commit 9c26d14

Browse files
cepawielhauke
authored andcommitted
realtek: add support for Vimin VM-S100-0800MS
Vimin VM-S100-0800MS is an 8 port Multi-Gig switch, based on RTL9303. Ported from XikeStor SKS8300-8X with changes to support different u-boot build. Specification: - SoC : Realtek RTL9303 - RAM : DDR3 512 MiB - Flash : SPI-NOR 16 MiB (Winbond W25Q128JVSQ) - Ethernet : 8x 1/2.5/10 Gbps (SFP+) - LEDs/Keys (GPIO): 0x/1x - UART : "Console" port on the front panel - type : RS-232C - connector : RJ-45 - settings : 115200n8 - Power : AC100-240V 50/60Hz Flash instruction using initramfs image: 1. Prepare TFTP server with an IP address "192.168.1.111" 2. Connect your PC to Port1 on VM-S100-0800MS 3. Power on VM-S100-0800MS and interrupt boot by pressing Esc 4. Enable Port1 with the following commands rtk 10g 0 fiber1g (or fiber10g if 10GBase-*R, dac300cm for DAC cable) rtk ext-devInit 0 rtk ext-pinSet 2 0 Note: the last command sets tx-disable to low 7. Download initramfs image from TFTP server tftpboot 0x82000000 <image name> 8. Boot with the downloaded image bootm 9. On the initramfs image, backup the stock firmware if needed 10. Upload (or download) sysupgrade image to the device 11. Erase "firmware" partition to cleanup JFFS2 of stock FW mtd erase firmware 12. Perform sysupgrade with the sysupgrade image 13. Wait ~120 sec to complete flashing Reverting to stock firmware: 1. Prepare by downloading the stock firmware. Vimin doesn't have the firmware on their website, tested using firmware for shared hardware Nicgiga S100-0800S-M. Filename: vmlinux-nicgiga-S100-0800S-M-241126EN.bix 2. Prepare TFTP server with an IP address "192.168.1.111" 3. Connect your PC to Port1 on VM-S100-0800MS 4. Power on VM-S100-0800MS and interrupt boot by pressing Esc 5. Enable Port1 with the following commands rtk 10g 0 fiber1g (or fiber10g if 10GBase-*R, dac300cm for DAC cable) rtk ext-devInit 0 rtk ext-pinSet 2 0 Note: the last command sets tx-disable to low 6. Download initramfs image from TFTP server tftpboot 0x82000000 <image name> 7. Boot with the downloaded image bootm 8. Under Management -> Firmware -> Upgrade/Backup, upload bix file. 9. Reboot device Signed-off-by: Colton Pawielski <cepawiel@mtu.edu> Link: openwrt#19477 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 6b981c5 commit 9c26d14

3 files changed

Lines changed: 411 additions & 0 deletions

File tree

Lines changed: 388 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,388 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
#include "rtl930x.dtsi"
4+
5+
#include <dt-bindings/input/input.h>
6+
#include <dt-bindings/gpio/gpio.h>
7+
#include <dt-bindings/leds/common.h>
8+
9+
/ {
10+
compatible = "vimin,vm-s100-0800ms", "realtek,rtl930x-soc";
11+
model = "Vimin VM-S100-0800MS";
12+
13+
memory@0 {
14+
device_type = "memory";
15+
reg = <0x00000000 0x10000000>, /* first 256 MiB */
16+
<0x20000000 0x10000000>; /* remaining 256 MiB */
17+
};
18+
19+
chosen {
20+
stdout-path = "serial0:115200n8";
21+
};
22+
23+
i2c_master: i2c@1b00036c {
24+
compatible = "realtek,rtl9300-i2c";
25+
reg = <0x1b00036c 0x3c>;
26+
#address-cells = <1>;
27+
#size-cells = <0>;
28+
scl-pin = <8>;
29+
sda-pin = <9>;
30+
clock-frequency = <100000>;
31+
};
32+
33+
i2c-mux {
34+
compatible = "realtek,i2c-mux-rtl9300";
35+
i2c-parent = <&i2c_master>;
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
39+
i2c0: i2c@0 {
40+
reg = <0>;
41+
scl-pin = <8>;
42+
sda-pin = <9>;
43+
};
44+
45+
i2c1: i2c@1 {
46+
reg = <1>;
47+
scl-pin = <8>;
48+
sda-pin = <10>;
49+
};
50+
51+
i2c2: i2c@2 {
52+
reg = <2>;
53+
scl-pin = <8>;
54+
sda-pin = <11>;
55+
};
56+
57+
i2c3: i2c@3 {
58+
reg = <3>;
59+
scl-pin = <8>;
60+
sda-pin = <12>;
61+
};
62+
63+
i2c4: i2c@4 {
64+
reg = <4>;
65+
scl-pin = <8>;
66+
sda-pin = <13>;
67+
};
68+
69+
i2c5: i2c@5 {
70+
reg = <5>;
71+
scl-pin = <8>;
72+
sda-pin = <14>;
73+
};
74+
75+
i2c6: i2c@6 {
76+
reg = <6>;
77+
scl-pin = <8>;
78+
sda-pin = <15>;
79+
};
80+
81+
i2c7: i2c@7 {
82+
reg = <7>;
83+
scl-pin = <8>;
84+
sda-pin = <16>;
85+
};
86+
};
87+
88+
keys {
89+
compatible = "gpio-keys";
90+
91+
button-reset {
92+
label = "reset";
93+
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
94+
linux,code = <KEY_RESTART>;
95+
};
96+
};
97+
98+
led_set {
99+
compatible = "realtek,rtl9300-leds";
100+
active-low;
101+
102+
/*
103+
* LED set 0
104+
*
105+
* - LED[0](Green): 10M/100M/1G/2.5G/5G/10G/LINK/ACT
106+
*/
107+
led_set0 = <0x0bab>;
108+
};
109+
110+
sfp0: sfp-p1 {
111+
compatible = "sff,sfp";
112+
i2c-bus = <&i2c0>;
113+
los-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
114+
mod-def0-gpio = <&gpio1 1 GPIO_ACTIVE_LOW>;
115+
tx-disable-gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
116+
maximum-power-milliwatt = <2900>;
117+
#thermal-sensor-cells = <0>;
118+
};
119+
120+
sfp1: sfp-p2 {
121+
compatible = "sff,sfp";
122+
i2c-bus = <&i2c1>;
123+
los-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
124+
mod-def0-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>;
125+
tx-disable-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
126+
maximum-power-milliwatt = <1500>;
127+
#thermal-sensor-cells = <0>;
128+
};
129+
130+
sfp2: sfp-p3 {
131+
compatible = "sff,sfp";
132+
i2c-bus = <&i2c2>;
133+
los-gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>;
134+
mod-def0-gpio = <&gpio1 7 GPIO_ACTIVE_LOW>;
135+
tx-disable-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
136+
maximum-power-milliwatt = <1500>;
137+
#thermal-sensor-cells = <0>;
138+
};
139+
140+
sfp3: sfp-p4 {
141+
compatible = "sff,sfp";
142+
i2c-bus = <&i2c3>;
143+
los-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
144+
mod-def0-gpio = <&gpio1 10 GPIO_ACTIVE_LOW>;
145+
tx-disable-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
146+
maximum-power-milliwatt = <2000>;
147+
#thermal-sensor-cells = <0>;
148+
};
149+
150+
sfp4: sfp-p5 {
151+
compatible = "sff,sfp";
152+
i2c-bus = <&i2c4>;
153+
los-gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
154+
mod-def0-gpio = <&gpio1 13 GPIO_ACTIVE_LOW>;
155+
tx-disable-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
156+
maximum-power-milliwatt = <2000>;
157+
#thermal-sensor-cells = <0>;
158+
};
159+
160+
sfp5: sfp-p6 {
161+
compatible = "sff,sfp";
162+
i2c-bus = <&i2c5>;
163+
los-gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>;
164+
mod-def0-gpio = <&gpio1 22 GPIO_ACTIVE_LOW>;
165+
tx-disable-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>;
166+
maximum-power-milliwatt = <1500>;
167+
#thermal-sensor-cells = <0>;
168+
};
169+
170+
sfp6: sfp-p7 {
171+
compatible = "sff,sfp";
172+
i2c-bus = <&i2c6>;
173+
los-gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>;
174+
mod-def0-gpio = <&gpio1 25 GPIO_ACTIVE_LOW>;
175+
tx-disable-gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>;
176+
maximum-power-milliwatt = <1500>;
177+
#thermal-sensor-cells = <0>;
178+
};
179+
180+
sfp7: sfp-p8 {
181+
compatible = "sff,sfp";
182+
i2c-bus = <&i2c7>;
183+
los-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>;
184+
mod-def0-gpio = <&gpio1 28 GPIO_ACTIVE_LOW>;
185+
tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>;
186+
maximum-power-milliwatt = <2900>;
187+
#thermal-sensor-cells = <0>;
188+
};
189+
};
190+
191+
&mdio_aux {
192+
status = "okay";
193+
194+
gpio1: gpio@0 {
195+
compatible = "realtek,rtl8231";
196+
reg = <0>;
197+
198+
gpio-controller;
199+
#gpio-cells = <2>;
200+
gpio-ranges = <&gpio1 0 0 37>;
201+
202+
led-controller {
203+
compatible = "realtek,rtl8231-leds";
204+
status = "disabled";
205+
};
206+
};
207+
};
208+
209+
&spi0 {
210+
status = "okay";
211+
212+
flash@0 {
213+
compatible = "jedec,spi-nor";
214+
reg = <0>;
215+
spi-max-frequency = <10000000>;
216+
217+
partitions {
218+
compatible = "fixed-partitions";
219+
#address-cells = <1>;
220+
#size-cells = <1>;
221+
222+
partition@0 {
223+
label = "u-boot";
224+
reg = <0x0 0xe0000>;
225+
read-only;
226+
};
227+
228+
partition@e0000 {
229+
label = "u-boot-env";
230+
reg = <0xe0000 0x10000>;
231+
};
232+
233+
partition@f0000 {
234+
label = "u-boot-env2";
235+
reg = <0xf0000 0x10000>;
236+
read-only;
237+
};
238+
239+
partition@100000 {
240+
label = "jffs";
241+
reg = <0x100000 0x100000>;
242+
};
243+
244+
partition@200000 {
245+
label = "jffs2";
246+
reg = <0x200000 0x100000>;
247+
};
248+
249+
partition@300000 {
250+
label = "firmware";
251+
reg = <0x300000 0xd00000>;
252+
compatible = "openwrt,uimage", "denx,uimage";
253+
openwrt,ih-magic = <0x93000000>;
254+
};
255+
};
256+
};
257+
};
258+
259+
&ethernet0 {
260+
mdio: mdio-bus {
261+
compatible = "realtek,rtl838x-mdio";
262+
regmap = <&ethernet0>;
263+
#address-cells = <1>;
264+
#size-cells = <0>;
265+
266+
INTERNAL_PHY_SDS(0, 2)
267+
INTERNAL_PHY_SDS(8, 3)
268+
INTERNAL_PHY_SDS(16, 4)
269+
INTERNAL_PHY_SDS(20, 5)
270+
INTERNAL_PHY_SDS(24, 6)
271+
INTERNAL_PHY_SDS(25, 7)
272+
INTERNAL_PHY_SDS(26, 8)
273+
INTERNAL_PHY_SDS(27, 9)
274+
};
275+
};
276+
277+
&switch0 {
278+
ports {
279+
#address-cells = <1>;
280+
#size-cells = <0>;
281+
282+
port@0 {
283+
reg = <0>;
284+
label = "lan1";
285+
pseudo-phy-handle = <&phy0>;
286+
phy-mode = "10gbase-r";
287+
sfp = <&sfp0>;
288+
managed = "in-band-status";
289+
led-set = <0>;
290+
};
291+
292+
port@8 {
293+
reg = <8>;
294+
label = "lan2";
295+
pseudo-phy-handle = <&phy8>;
296+
phy-mode = "10gbase-r";
297+
sfp = <&sfp1>;
298+
managed = "in-band-status";
299+
led-set = <0>;
300+
};
301+
302+
port@10 {
303+
reg = <16>;
304+
label = "lan3";
305+
pseudo-phy-handle = <&phy16>;
306+
phy-mode = "10gbase-r";
307+
sfp = <&sfp2>;
308+
managed = "in-band-status";
309+
led-set = <0>;
310+
};
311+
312+
port@14 {
313+
reg = <20>;
314+
label = "lan4";
315+
pseudo-phy-handle = <&phy20>;
316+
phy-mode = "10gbase-r";
317+
sfp = <&sfp3>;
318+
managed = "in-band-status";
319+
led-set = <0>;
320+
};
321+
322+
port@18 {
323+
reg = <24>;
324+
label = "lan5";
325+
pseudo-phy-handle = <&phy24>;
326+
phy-mode = "10gbase-r";
327+
sfp = <&sfp4>;
328+
managed = "in-band-status";
329+
led-set = <0>;
330+
};
331+
332+
port@19 {
333+
reg = <25>;
334+
label = "lan6";
335+
pseudo-phy-handle = <&phy25>;
336+
phy-mode = "10gbase-r";
337+
sfp = <&sfp5>;
338+
managed = "in-band-status";
339+
led-set = <0>;
340+
};
341+
342+
port@1a {
343+
reg = <26>;
344+
label = "lan7";
345+
pseudo-phy-handle = <&phy26>;
346+
phy-mode = "10gbase-r";
347+
sfp = <&sfp6>;
348+
managed = "in-band-status";
349+
led-set = <0>;
350+
};
351+
352+
port@1b {
353+
reg = <27>;
354+
label = "lan8";
355+
pseudo-phy-handle = <&phy27>;
356+
phy-mode = "10gbase-r";
357+
sfp = <&sfp7>;
358+
managed = "in-band-status";
359+
led-set = <0>;
360+
};
361+
362+
port@1c {
363+
ethernet = <&ethernet0>;
364+
reg = <28>;
365+
phy-mode = "internal";
366+
367+
fixed-link {
368+
speed = <10000>;
369+
full-duplex;
370+
};
371+
};
372+
};
373+
};
374+
375+
&thermal_zones {
376+
sfp-thermal {
377+
polling-delay-passive = <10000>;
378+
polling-delay = <10000>;
379+
thermal-sensors = <&sfp0>, <&sfp1>, <&sfp2>, <&sfp3>, <&sfp4>, <&sfp5>, <&sfp6>, <&sfp7>;
380+
trips {
381+
sfp-crit {
382+
temperature = <110000>;
383+
hysteresis = <1000>;
384+
type = "critical";
385+
};
386+
};
387+
};
388+
};

0 commit comments

Comments
 (0)