Skip to content

Commit 79d83b3

Browse files
mwalleclaudiubeznea
authored andcommitted
ARM: dts: lan966x: add basic Kontron KSwitch D10 support
Add basic support for the Kontron KSwitch D10 MMT. It comes in two variants: "6G-2GS" which features 6 Gigabit copper ports and two SFP cages and "8G" which features 6 Gigbabit copper ports (where two are 2.5G capable). For now the following is supported and working: - Kernel console - SFP cages - SPI - SGPIO - Watchdog Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com> [claudiu.beznea: fixed conflict on Makefile] Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220502224127.2604333-8-michael@walle.cc Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
1 parent 66fc5fe commit 79d83b3

4 files changed

Lines changed: 187 additions & 1 deletion

File tree

arch/arm/boot/dts/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,9 @@ dtb-$(CONFIG_SOC_IMX7ULP) += \
742742
imx7ulp-com.dtb \
743743
imx7ulp-evk.dtb
744744
dtb-$(CONFIG_SOC_LAN966) += \
745-
lan966x-pcb8291.dtb
745+
lan966x-pcb8291.dtb \
746+
lan966x-kontron-kswitch-d10-mmt-6g-2gs.dtb \
747+
lan966x-kontron-kswitch-d10-mmt-8g.dtb
746748
dtb-$(CONFIG_SOC_LS1021A) += \
747749
ls1021a-moxa-uc-8410a.dtb \
748750
ls1021a-qds.dtb \
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
/*
3+
* Device Tree file for the Kontron KSwitch D10 MMT 6G-2GS
4+
*/
5+
6+
/dts-v1/;
7+
#include "lan966x-kontron-kswitch-d10-mmt.dtsi"
8+
9+
/ {
10+
model = "Kontron KSwitch D10 MMT 6G-2GS";
11+
compatible = "kontron,kswitch-d10-mmt-6g-2gs", "kontron,s1921",
12+
"microchip,lan9668", "microchip,lan966";
13+
14+
aliases {
15+
i2c0 = &i2c4;
16+
i2c1 = &i2c1;
17+
};
18+
19+
sfp0: sfp0 {
20+
compatible = "sff,sfp";
21+
i2c-bus = <&i2c4>;
22+
los-gpios = <&sgpio_in 1 0 GPIO_ACTIVE_HIGH>;
23+
mod-def0-gpios = <&sgpio_in 1 1 GPIO_ACTIVE_LOW>;
24+
maximum-power-milliwatt = <2500>;
25+
tx-disable-gpios = <&sgpio_out 3 0 GPIO_ACTIVE_LOW>;
26+
tx-fault-gpios = <&sgpio_in 0 2 GPIO_ACTIVE_HIGH>;
27+
rate-select0-gpios = <&sgpio_out 2 0 GPIO_ACTIVE_HIGH>;
28+
rate-select1-gpios = <&sgpio_out 2 1 GPIO_ACTIVE_HIGH>;
29+
};
30+
31+
sfp1: sfp1 {
32+
compatible = "sff,sfp";
33+
i2c-bus = <&i2c1>;
34+
los-gpios = <&sgpio_in 1 2 GPIO_ACTIVE_HIGH>;
35+
mod-def0-gpios = <&sgpio_in 1 3 GPIO_ACTIVE_LOW>;
36+
maximum-power-milliwatt = <2500>;
37+
tx-disable-gpios = <&sgpio_out 3 1 GPIO_ACTIVE_LOW>;
38+
tx-fault-gpios = <&sgpio_in 0 3 GPIO_ACTIVE_HIGH>;
39+
rate-select0-gpios = <&sgpio_out 2 2 GPIO_ACTIVE_HIGH>;
40+
rate-select1-gpios = <&sgpio_out 2 3 GPIO_ACTIVE_HIGH>;
41+
};
42+
};
43+
44+
&flx1 {
45+
atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
46+
status = "okay";
47+
48+
i2c1: i2c@600 {
49+
pinctrl-0 = <&fc1_c_pins>;
50+
pinctrl-names = "default";
51+
status = "okay";
52+
};
53+
};
54+
55+
&flx4 {
56+
atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
57+
status = "okay";
58+
59+
i2c4: i2c@600 {
60+
pinctrl-0 = <&fc4_b_pins>;
61+
pinctrl-names = "default";
62+
status = "okay";
63+
};
64+
};
65+
66+
&gpio {
67+
fc1_c_pins: fc1-c-i2c-pins {
68+
/* SCL, SDA */
69+
pins = "GPIO_47", "GPIO_48";
70+
function = "fc1_c";
71+
};
72+
73+
fc4_b_pins: fc4-b-i2c-pins {
74+
/* SCL, SDA */
75+
pins = "GPIO_57", "GPIO_58";
76+
function = "fc4_b";
77+
};
78+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
/*
3+
* Device Tree file for the Kontron KSwitch D10 MMT 8G
4+
*/
5+
6+
/dts-v1/;
7+
#include "lan966x-kontron-kswitch-d10-mmt.dtsi"
8+
9+
/ {
10+
model = "Kontron KSwitch D10 MMT 8G";
11+
compatible = "kontron,kswitch-d10-mmt-8g", "kontron,s1921",
12+
"microchip,lan9668", "microchip,lan966";
13+
};
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
/*
3+
* Common part of the device tree for the Kontron KSwitch D10 MMT
4+
*/
5+
6+
/dts-v1/;
7+
#include "lan966x.dtsi"
8+
9+
/ {
10+
aliases {
11+
serial0 = &usart0;
12+
};
13+
14+
chosen {
15+
stdout-path = "serial0:115200n8";
16+
};
17+
18+
gpio-restart {
19+
compatible = "gpio-restart";
20+
gpios = <&gpio 56 GPIO_ACTIVE_LOW>;
21+
priority = <200>;
22+
};
23+
};
24+
25+
&flx0 {
26+
atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
27+
status = "okay";
28+
29+
usart0: serial@200 {
30+
pinctrl-0 = <&usart0_pins>;
31+
pinctrl-names = "default";
32+
status = "okay";
33+
};
34+
};
35+
36+
&flx3 {
37+
atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
38+
status = "okay";
39+
40+
spi3: spi@400 {
41+
pinctrl-0 = <&fc3_b_pins>;
42+
pinctrl-names = "default";
43+
status = "okay";
44+
cs-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
45+
};
46+
};
47+
48+
&gpio {
49+
fc3_b_pins: fc3-b-pins {
50+
/* SCK, MISO, MOSI */
51+
pins = "GPIO_51", "GPIO_52", "GPIO_53";
52+
function = "fc3_b";
53+
};
54+
55+
sgpio_a_pins: sgpio-a-pins {
56+
/* SCK, D0, D1 */
57+
pins = "GPIO_32", "GPIO_33", "GPIO_34";
58+
function = "sgpio_a";
59+
};
60+
61+
sgpio_b_pins: sgpio-b-pins {
62+
/* LD */
63+
pins = "GPIO_64";
64+
function = "sgpio_b";
65+
};
66+
67+
usart0_pins: usart0-pins {
68+
/* RXD, TXD */
69+
pins = "GPIO_25", "GPIO_26";
70+
function = "fc0_b";
71+
};
72+
};
73+
74+
&sgpio {
75+
pinctrl-0 = <&sgpio_a_pins>, <&sgpio_b_pins>;
76+
pinctrl-names = "default";
77+
bus-frequency = <8000000>;
78+
/* arbitrary range because all GPIOs are in software mode */
79+
microchip,sgpio-port-ranges = <0 11>;
80+
status = "okay";
81+
82+
sgpio_in: gpio@0 {
83+
ngpios = <128>;
84+
};
85+
86+
sgpio_out: gpio@1 {
87+
ngpios = <128>;
88+
};
89+
};
90+
91+
&watchdog {
92+
status = "okay";
93+
};

0 commit comments

Comments
 (0)