Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ramips: add Hooolink HL-MF908v3, also known as CHANEVE MF909 #4070

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions target/linux/ramips/dts/mt7628an_hooolink_hl-mf908-v3.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
#include "mt7628an.dtsi"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing SPDX license identifier


#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
compatible = "hooolink,hl-mf908-v3", "mediatek,mt7628an-soc";
model = "HL-MF908v3";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to Hooolink?
Please a space before "v3"


chosen {
bootargs = "console=ttyS0,57600n8";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC this is default (set in the dtsi).


aliases {
led-boot = &led_status;
led-failsafe = &led_status;
led-running = &led_status;
led-upgrade = &led_status;
};

leds {
compatible = "gpio-leds";

lan {
gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
label = "green:lan";
linux,default-trigger = "phy0tpt";
};

wlan {
gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
label = "green:wlan";
};

4g {
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
label = "green:4g";
};

led_status: status {
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
label = "green:status";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort these nodes by something ...

};

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};

gpio_export {
compatible = "gpio-export";
#size-cells = <0>;

minipcie {
gpio-export,name = "minipcie";
gpio-export,output = <0>;
gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
};
};
};

&spi0 {
status = "okay";

flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably go faster.


partitions: partitions {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label is not required in a DTS file.

compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};

partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};

factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};

partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xfb0000>;
};
};
};
};

&uart1 {
status = "okay";
};

&i2c {
status = "okay";
};

&ethernet {
status = "okay";
mtd-mac-address = <&factory 0x2e>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? What's the vendor MAC address assignment for this device?

https://openwrt.org/docs/guide-developer/device-support-policies#mac_addresses

};

&esw {
status = "okay";
};

&wmac {
status = "okay";
ralink,mtd-eeprom = <&factory 0x04>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be set in the DTSI ...

};

&state_default {
gpio {
groups = "i2c", "gpio", "uart1", "refclk", "wdt", "pwm0";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to be set correctly.

function = "gpio";
};
};
11 changes: 11 additions & 0 deletions target/linux/ramips/image/mt76x8.mk
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@ define Device/hiwifi_hc5861b
endef
TARGET_DEVICES += hiwifi_hc5861b

define Device/hooolink_hl-mf908-v3
IMAGE_SIZE := 16064k
DEVICE_VENDOR := Hooolink
DEVICE_MODEL := HL-MF908
DEVICE_VARIANT := v3
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \
kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi
SUPPORTED_DEVICES += hl-mf908-v3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be dropped (or is this needed for vendor firmware?)

endef
TARGET_DEVICES += hooolink_hl-mf908-v3

define Device/iptime_a3
IMAGE_SIZE := 7936k
UIMAGE_NAME := a3
Expand Down
1 change: 1 addition & 0 deletions target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ glinet,gl-mt300n-v2)
ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x1"
;;
hilink,hlk-7628n|\
hooolink,hl-mf908-v3|\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be dropped since you have the trigger in DTS.

skylab,skw92a)
ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan" "wlan0"
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ramips_setup_interfaces()
glinet,microuter-n300|\
glinet,vixmini|\
hak5,wifi-pineapple-mk7|\
hooolink,hl-mf908-v3|\
mediatek,linkit-smart-7688|\
onion,omega2p|\
onion,omega2|\
Expand Down