Skip to content

Commit 1a0669f

Browse files
committed
qualcommax: ipq807x: add support for Sagemcom Fast 5866t
Signed-off-by: YiZhen Choo <yizhen.c02@gmail.com>
1 parent 1831966 commit 1a0669f

File tree

6 files changed

+368
-1
lines changed

6 files changed

+368
-1
lines changed

package/firmware/ipq-wifi/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ ALLWIFIBOARDS:= \
7070
qihoo_360v6 \
7171
qnap_301w \
7272
redmi_ax6 \
73+
sagemcom_fast-5866t \
7374
skspruce_wia3300-20 \
7475
spectrum_sax1v1k \
7576
tplink_deco-x80-5g \
@@ -236,6 +237,7 @@ $(eval $(call generate-ipq-wifi-package,qihoo_360v6,Qihoo 360V6))
236237
$(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
237238
$(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
238239
$(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
240+
$(eval $(call generate-ipq-wifi-package,sagemcom_fast-5866t,Sagemcom Fast 5866T))
239241
$(eval $(call generate-ipq-wifi-package,skspruce_wia3300-20,SKSpruce WIA3300-20))
240242
$(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K))
241243
$(eval $(call generate-ipq-wifi-package,tplink_deco-x80-5g,TP-Link Deco X80-5G))
Lines changed: 336 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,336 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
5+
#include "ipq8074.dtsi"
6+
#include "ipq8074-hk-cpu.dtsi"
7+
#include "ipq8074-ess.dtsi"
8+
#include <dt-bindings/gpio/gpio.h>
9+
#include <dt-bindings/input/input.h>
10+
#include <dt-bindings/leds/common.h>
11+
12+
/ {
13+
model = "Sagemcom Fast 5866T";
14+
compatible = "sagemcom,5866t", "qcom,ipq8074";
15+
16+
aliases {
17+
led-boot = &led_power_green;
18+
led-failsafe = &led_power_red;
19+
led-running = &led_power_green;
20+
led-upgrade = &led_power_red;
21+
serial0 = &blsp1_uart5;
22+
/*
23+
* Aliases as required by u-boot
24+
* to patch MAC addresses
25+
*/
26+
ethernet3 = &dp4;
27+
ethernet4 = &dp5;
28+
ethernet5 = &dp6;
29+
label-mac-device = &dp4;
30+
};
31+
32+
chosen {
33+
stdout-path = "serial0:115200n8";
34+
bootargs-append = " swiotlb=1 coherent_pool=2M";
35+
};
36+
37+
gpio-export {
38+
compatible = "gpio-export";
39+
40+
lte-power {
41+
gpio-export,name = "lte_power";
42+
gpio-export,output = <1>;
43+
gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
44+
};
45+
46+
lte-power-on {
47+
gpio-export,name = "lte_power_on";
48+
gpio-export,output = <1>;
49+
gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
50+
};
51+
52+
lte-reset {
53+
gpio-export,name = "lte_reset";
54+
gpio-export,output = <0>;
55+
gpios = <&tlmm 42 GPIO_ACTIVE_LOW>;
56+
};
57+
58+
ble-power {
59+
gpio-export,name = "ble_power";
60+
gpio-export,output = <1>;
61+
gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>;
62+
};
63+
};
64+
65+
keys {
66+
compatible = "gpio-keys";
67+
68+
wps {
69+
label = "wps";
70+
linux,code = <KEY_WPS_BUTTON>;
71+
gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
72+
};
73+
74+
reset {
75+
label = "reset";
76+
linux,code = <KEY_RESTART>;
77+
gpios = <&tlmm 50 GPIO_ACTIVE_LOW>;
78+
};
79+
};
80+
81+
leds {
82+
compatible = "gpio-leds";
83+
84+
led_power_green: power_green {
85+
function = LED_FUNCTION_POWER;
86+
color = <LED_COLOR_ID_GREEN>;
87+
gpios = <&tlmm 66 GPIO_ACTIVE_HIGH>;
88+
};
89+
90+
led_power_red: power_red {
91+
function = LED_FUNCTION_POWER;
92+
color = <LED_COLOR_ID_RED>;
93+
gpios = <&tlmm 62 GPIO_ACTIVE_HIGH>;
94+
};
95+
96+
led_wlan_green: wlan_green {
97+
function = LED_FUNCTION_WLAN;
98+
color = <LED_COLOR_ID_GREEN>;
99+
gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>;
100+
};
101+
102+
led_led1_red: led1_red {
103+
function = "status";
104+
color = <LED_COLOR_ID_RED>;
105+
gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>; // LED1_R
106+
};
107+
108+
led_led1_orange: led1_orange {
109+
function = "status";
110+
color = <LED_COLOR_ID_ORANGE>;
111+
gpios = <&tlmm 53 GPIO_ACTIVE_HIGH>; // LED1_O
112+
};
113+
114+
led_led2_yellow: led2_yellow {
115+
function = "status";
116+
color = <LED_COLOR_ID_YELLOW>;
117+
gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; // LED2_Y
118+
};
119+
120+
led_led2_green: led2_green {
121+
function = "status";
122+
color = <LED_COLOR_ID_GREEN>;
123+
gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; // LED2_G
124+
};
125+
126+
led_led3_green: led3_green {
127+
function = "status";
128+
color = <LED_COLOR_ID_GREEN>;
129+
gpios = <&tlmm 27 GPIO_ACTIVE_HIGH>; // LED3_G
130+
};
131+
132+
led_led3_yellow: led3_yellow {
133+
function = "status";
134+
color = <LED_COLOR_ID_YELLOW>;
135+
gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; // LED3_Y
136+
};
137+
138+
led_led4_green: led4_green {
139+
function = "status";
140+
color = <LED_COLOR_ID_GREEN>;
141+
gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; // LED4_G
142+
};
143+
144+
led_led4_yellow: led4_yellow {
145+
function = "status";
146+
color = <LED_COLOR_ID_YELLOW>;
147+
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; // LED4_Y
148+
};
149+
150+
led_led5_green: led5_green {
151+
function = "status";
152+
color = <LED_COLOR_ID_GREEN>;
153+
gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; // LED5_G
154+
};
155+
156+
led_led5_yellow: led5_yellow {
157+
function = "status";
158+
color = <LED_COLOR_ID_YELLOW>;
159+
gpios = <&tlmm 67 GPIO_ACTIVE_HIGH>; // LED5_Y
160+
};
161+
};
162+
163+
usb_vbus: regulator-usb-vbus {
164+
compatible = "regulator-fixed";
165+
regulator-name = "usb_vbus";
166+
regulator-min-microvolt = <5000000>;
167+
regulator-max-microvolt = <5000000>;
168+
gpio = <&tlmm 9 GPIO_ACTIVE_HIGH>;
169+
regulator-boot-on;
170+
};
171+
};
172+
173+
&tlmm {
174+
mdio_pins: mdio-pins {
175+
mdc {
176+
pins = "gpio68";
177+
function = "mdc";
178+
drive-strength = <8>;
179+
bias-pull-up;
180+
};
181+
182+
mdio {
183+
pins = "gpio69";
184+
function = "mdio";
185+
drive-strength = <8>;
186+
bias-pull-up;
187+
};
188+
};
189+
};
190+
191+
&blsp1_uart5 {
192+
status = "okay";
193+
};
194+
195+
&cryptobam {
196+
status = "okay";
197+
};
198+
199+
&crypto {
200+
status = "okay";
201+
};
202+
203+
&prng {
204+
status = "okay";
205+
};
206+
207+
&qpic_bam {
208+
status = "okay";
209+
};
210+
211+
&sdhc_1 {
212+
/* Following same rule as QNAP 301W
213+
* the emmc has a problem with the hs400 > hs200 speed switch.
214+
* Therefore remove the mmc-hs400-1_8v property
215+
*/
216+
/delete-property/ mmc-hs400-1_8v;
217+
mmc-hs200-1_8v;
218+
mmc-ddr-1_8v;
219+
vqmmc-supply = <&l11>;
220+
status = "okay";
221+
};
222+
223+
&qusb_phy_0 {
224+
status = "okay";
225+
226+
vdd-supply = <&usb_vbus>;
227+
};
228+
229+
&qusb_phy_1 {
230+
status = "okay";
231+
232+
vdd-supply = <&usb_vbus>;
233+
};
234+
235+
&ssphy_0 {
236+
status = "okay";
237+
};
238+
239+
&ssphy_1 {
240+
status = "okay";
241+
};
242+
243+
&usb_0 {
244+
status = "okay";
245+
};
246+
247+
&usb_1 {
248+
status = "okay";
249+
};
250+
251+
&mdio {
252+
status = "okay";
253+
254+
pinctrl-0 = <&mdio_pins>;
255+
pinctrl-names = "default";
256+
reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
257+
258+
ethernet-phy-package@0 {
259+
compatible = "qcom,qca8075-package";
260+
#address-cells = <1>;
261+
#size-cells = <0>;
262+
reg = <0>;
263+
264+
qcom,package-mode = "qsgmii";
265+
266+
qca8075_3: ethernet-phy@3 {
267+
compatible = "ethernet-phy-ieee802.3-c22";
268+
reg = <3>;
269+
};
270+
271+
qca8075_4: ethernet-phy@4 {
272+
compatible = "ethernet-phy-ieee802.3-c22";
273+
reg = <4>;
274+
};
275+
};
276+
277+
qca8081: ethernet-phy@24 {
278+
compatible = "ethernet-phy-id004d.d101";
279+
reg = <24>;
280+
reset-deassert-us = <10000>;
281+
};
282+
};
283+
284+
&switch {
285+
status = "okay";
286+
287+
switch_lan_bmp = <(ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */
288+
switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
289+
switch_mac_mode = <MAC_MODE_QSGMII>; /* mac mode for uniphy instance0*/
290+
291+
qcom,port_phyinfo {
292+
port@1 {
293+
port_id = <1>;
294+
phy_address = <3>;
295+
};
296+
port@2 {
297+
port_id = <2>;
298+
phy_address = <4>;
299+
};
300+
port@6 {
301+
port_id = <6>;
302+
phy_address = <24>;
303+
port_mac_sel = "QGMAC_PORT";
304+
};
305+
};
306+
};
307+
308+
&edma {
309+
status = "okay";
310+
};
311+
312+
&dp4 {
313+
status = "okay";
314+
phy-mode = "qsgmii";
315+
phy-handle = <&qca8075_3>;
316+
label = "lan1";
317+
};
318+
319+
&dp5 {
320+
status = "okay";
321+
phy-mode = "qsgmii";
322+
phy-handle = <&qca8075_4>;
323+
label = "wan";
324+
};
325+
326+
&dp6_syn {
327+
status = "okay";
328+
phy-handle = <&qca8081>;
329+
label = "lan2";
330+
};
331+
332+
&wifi {
333+
status = "okay";
334+
335+
qcom,ath11k-calibration-variant = "Sagemcom_5866T";
336+
};

target/linux/qualcommax/image/ipq807x.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,23 @@ define Device/redmi_ax6
380380
endef
381381
TARGET_DEVICES += redmi_ax6
382382

383+
define Device/sagemcom_5866t
384+
$(call Device/FitImage)
385+
$(call Device/EmmcImage)
386+
DEVICE_VENDOR := Sagemcom
387+
DEVICE_MODEL := 5866T
388+
DEVICE_DTS_CONFIG := config@hk01.c6
389+
SOC := ipq8072
390+
SOC := ipq8072
391+
KERNEL_SIZE := 12288k
392+
IMAGES := sysupgrade.bin factory.bin kernel.bin
393+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
394+
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | append-metadata
395+
IMAGE/kernel.bin := append-kernel
396+
DEVICE_PACKAGES := kmod-fs-f2fs f2fs-tools
397+
endef
398+
TARGET_DEVICES += sagemcom_5866t
399+
383400
define Device/spectrum_sax1v1k
384401
$(call Device/FitImage)
385402
$(call Device/EmmcImage)

target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ ipq807x_setup_interfaces()
3030
zbtlink,zbt-z800ax)
3131
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
3232
;;
33+
sagemcom,5866t)
34+
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
35+
;;
3336
cmcc,rm2-6)
3437
ucidef_set_interfaces_lan_wan "lan plc" "wan"
3538
;;
@@ -90,6 +93,12 @@ ipq807x_setup_macs()
9093
lan_mac=$(macaddr_add "$wan_mac" 1)
9194
label_mac="$wan_mac"
9295
;;
96+
sagemcom,5866t)
97+
env_part="/dev/mmcblk0p14"
98+
wan_mac=$(strings "$env_part" | grep -oE 'eth1addr=([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}' | cut -d= -f2)
99+
lan_mac=$(macaddr_add "$wan_mac" 1)
100+
label_mac="$wan_mac"
101+
;;
93102
linksys,mx4200v2|\
94103
linksys,mx4300)
95104
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)

0 commit comments

Comments
 (0)