ramips: fix Bolt BL201 support (#12361)

Changes:
1. Update device baud rate.
2. Modify LED and button GPIO values and names.
3. Adjust partition layout to match the stock configuration.
4. Add missing package dependencies for USB.
5. Include device UIMAGE Magic value.
6. Revise switch layout.
7. Assign different MAC addresses.
This commit is contained in:
Yogi Hermawan 2024-07-27 17:01:35 +07:00 committed by GitHub
parent 1faba8061d
commit 3bbf603357
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 75 additions and 45 deletions

View File

@ -2,89 +2,113 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
#include <dt-bindings/mtd/partitions/uimage.h>
/ { / {
compatible = "bolt,bl201", "ralink,mt7620a-soc"; compatible = "bolt,bl201", "ralink,mt7620a-soc";
model = "Bolt BL201"; model = "Bolt BL201";
aliases { aliases {
led-boot = &power_red; led-boot = &led_reset;
led-failsafe = &power_red; led-failsafe = &led_reset;
led-running = &power_blue; led-running = &led_power;
led-upgrade = &power_red; led-upgrade = &led_reset;
label-mac-device = &ethernet; label-mac-device = &ethernet;
}; };
chosen { chosen {
bootargs = "console=ttyS0,115200"; bootargs = "console=ttyS0,57600";
}; };
leds { leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
wan { led_reset: led-reset {
label = "blue:wan"; label = "red:reset";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
};
power_red: power_red {
label = "red:power";
gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
}; };
power_blue: power_blue { led_power: led-power {
label = "blue:power"; label = "blue:power";
gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
}; };
lte_s1_blue { led-lte1 {
label = "blue:lte_s1"; label = "blue:lte1";
gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
}; };
lte_s2_blue { led-lte2 {
label = "blue:lte_s2"; label = "blue:lte2";
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
}; };
lte_s3_blue { led-lte3 {
label = "blue:lte_s3"; label = "blue:lte3";
gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
}; };
lte_s4_blue { led-lte4 {
label = "blue:lte_s4"; label = "blue:lte4";
gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
}; };
wps_blue { led-lte5 {
label = "red:lte5";
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
};
led-lte6 {
label = "red:lte6";
gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
};
led-wps {
label = "blue:wps"; label = "blue:wps";
gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
}; };
lte_s1s2_red { led-voip {
label = "red:lte_s1s2"; label = "blue:voip";
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>; gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
}; };
lte_s3s4_red { led-wlan2 {
label = "red:lte_s3s4"; label = "blue:wlan2";
gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
};
wlan_blue {
label = "blue:wlan";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
led-wlan5 {
label = "blue:wlan5";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
led-lan {
label = "green:lan";
gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
};
led-wan {
label = "green:wan";
gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
}; };
}; };
keys { keys {
compatible = "gpio-keys"; compatible = "gpio-keys";
wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
};
reset { reset {
label = "reset"; label = "reset";
gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>; linux,code = <KEY_RESTART>;
gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
}; };
}; };
}; };
@ -111,8 +135,7 @@
flash@0 { flash@0 {
compatible = "jedec,spi-nor"; compatible = "jedec,spi-nor";
reg = <0>; reg = <0>;
spi-max-frequency = <10000000>; spi-max-frequency = <50000000>;
// m25p,fast-read;
partitions { partitions {
compatible = "fixed-partitions"; compatible = "fixed-partitions";
@ -137,9 +160,10 @@
}; };
partition@50000 { partition@50000 {
compatible = "denx,uimage";
label = "firmware"; label = "firmware";
reg = <0x50000 0xf80000>; reg = <0x50000 0xf80000>;
compatible = "openwrt,uimage", "denx,uimage";
openwrt,ih-magic = <0x26112015>;
}; };
partition@fd0000 { partition@fd0000 {
@ -161,11 +185,16 @@
}; };
}; };
&ethernet { &ehci {
pinctrl-names = "default"; status = "okay";
pinctrl-0 = <&ephy_pins>; };
mtd-mac-address = <&factory 0x4>; &ohci {
status = "okay";
};
&ethernet {
mtd-mac-address = <&factory 0x28>;
mediatek,portmap = "llllw"; mediatek,portmap = "llllw";
}; };

View File

@ -135,7 +135,8 @@ define Device/bolt_bl201
IMAGE_SIZE := 15872k IMAGE_SIZE := 15872k
DEVICE_VENDOR := Bolt DEVICE_VENDOR := Bolt
DEVICE_MODEL := BL201 DEVICE_MODEL := BL201
DEVICE_PACKAGES := kmod-mt76x2 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci
UIMAGE_MAGIC := 0x26112015
endef endef
TARGET_DEVICES += bolt_bl201 TARGET_DEVICES += bolt_bl201

View File

@ -41,9 +41,8 @@ bdcom,wap2100-sk)
ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan2g" "wlan0" ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan2g" "wlan0"
;; ;;
bolt,bl201) bolt,bl201)
ucidef_set_led_netdev "phy0-ap0" "phy0-ap0" "blue:wlan" "phy0-ap0" ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0.1"
ucidef_set_led_netdev "wan" "eth0.2" "blue:wan" "eth0.2" ucidef_set_led_netdev "wan" "wan" "green:wan" "eth0.2"
ucidef_set_led_netdev "lan" "eth0.1" "blue:wps" "eth0.1"
;; ;;
comfast,cf-wr800n) comfast,cf-wr800n)
ucidef_set_led_netdev "lan" "lan" "white:ethernet" eth0.1 ucidef_set_led_netdev "lan" "lan" "white:ethernet" eth0.1

View File

@ -11,7 +11,6 @@ ramips_setup_interfaces()
aigale,ai-br100|\ aigale,ai-br100|\
alfa-network,ac1200rm|\ alfa-network,ac1200rm|\
asus,rt-n12p|\ asus,rt-n12p|\
bolt,bl201|\
dlink,dwr-116-a1|\ dlink,dwr-116-a1|\
dlink,dwr-921-c1|\ dlink,dwr-921-c1|\
dlink,dwr-922-e2|\ dlink,dwr-922-e2|\
@ -34,6 +33,7 @@ ramips_setup_interfaces()
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
;; ;;
alfa-network,r36m-e4g|\ alfa-network,r36m-e4g|\
bolt,bl201|\
zbtlink,zbt-we1026-h-32m) zbtlink,zbt-we1026-h-32m)
ucidef_add_switch "switch0" \ ucidef_add_switch "switch0" \
"3:lan" "4:wan" "6@eth0" "3:lan" "4:wan" "6@eth0"
@ -296,6 +296,7 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1)
;; ;;
alfa-network,r36m-e4g|\ alfa-network,r36m-e4g|\
bolt,bl201|\
zbtlink,zbt-we1026-h-32m) zbtlink,zbt-we1026-h-32m)
wan_mac=$(mtd_get_mac_binary factory 0x2e) wan_mac=$(mtd_get_mac_binary factory 0x2e)
label_mac=$(mtd_get_mac_binary factory 0x4) label_mac=$(mtd_get_mac_binary factory 0x4)