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 support for DLINK DWR-921-C1 #793
Conversation
This PR requires the following commit to build properly: 0b767b8 |
The dwr-921 doesn't have a led suitable for the status led function. Is there an alternative solution to share some led function? |
Currently I plan to use the mt7620 capability to drive the wlan led. in /sys/class/leds/ I can see the following folder: but if I try to drive them (writing in brightness) nothing happens. If I configure the wlan led as gpio driven in the device-tree, it works as expected. |
ac3798d
to
6ed25e0
Compare
What about if I configure a potential shared led (like the sms as an example) acting as status led? |
d0cdcd8
to
c310138
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I marked some points. You could consider to make changes.
@@ -41,6 +41,12 @@ board=$(board_name) | |||
case "$FIRMWARE" in | |||
"soc_wmac.eeprom") | |||
case $board in | |||
dwr-921-c1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be like bellow?
dlink,dwr-116-a1|\
dlink,dwr-921-c1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set the board name "dwr-921-c1" in the target/linux/ramips/base-files/lib/ramips.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set the "dwr-921-c1" name in target/linux/ramips/base-files/lib/ramips.sh
@@ -169,6 +169,9 @@ ramips_board_detect() { | |||
*"DWR-512 B") | |||
name="dwr-512-b" | |||
;; | |||
*"DWR-921 C1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do You test generic board detection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to be coherent with the format used in the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fid0did0 You should really consider @CHKDSK88 input (which is much appreciated by the way - as it safes my time), as I've done a full review of his PR recently.
Drop this line to use the generic board detection. Which means, use dlink,dwr-921-c1
as userspace boardname. Instead of sticking to an outdated way of doing something, you should check the commit history to see how it was done for all recent ramips additions.
@@ -158,6 +158,7 @@ dir-615-h1) | |||
set_wifi_led "rt2800pci-phy0::radio" | |||
;; | |||
dir-620-d1|\ | |||
dwr-921-c1|\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dlink,dwr-921-c1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to be coherent with the format used in the file.
}; | ||
|
||
ðernet { | ||
mtd-mac-address = <&config 0xe2ac>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, You should use jboot-tools to set IP. It's possible, that some another C1 have different offset. Like in DWR-116.
}; | ||
}; | ||
|
||
&wmac { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use 10-rt2x00-eeprom. This should be droped.
d294293
to
432afb0
Compare
fixed the comments and the conflict. @mkresin Bye. |
The wifi LED setup look good to me. Do I miss something? We might can misuse the "Signal Strength" LED as status LED and set it to off after boot in 01_leds:
It might make sense to to use |
thanks for the advice mkresin. About the wifi led I would like to let it drive by the HW.
but when I set the value in I'm making something wrong? |
@@ -271,7 +271,8 @@ platform_check_image() { | |||
} | |||
return 0 | |||
;; | |||
dlink,dwr-116-a1) | |||
dlink,dwr-116-a1|\ | |||
dwr-921-c1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dlink,dwr-921-c1?
To my knowledge it doesn't work, hence the LED is set for all boards to GPIO. I never had a look at the code why it doesn't work or how it is supposed to work. |
You forgot about MAC setup in 02network. |
#include <dt-bindings/input/input.h> | ||
|
||
/ { | ||
compatible = "d-link,dwr-921-c1", "ralink,mt7620n-soc"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"d-link,dwr-921-c1" -> "dlink,dwr-921-c1"
Did You test it @fid0did0 ?
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; | ||
}; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
usb_power {
gpio-export,name = "usb";
gpio-export,output = <1>;
gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
};
};
I have C3 version and pcb is the same. Please try add this and check if modem is detected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LTE support is argument for a new PR.
Please see PR #812.
target/linux/ramips/image/mt7620.mk
Outdated
DTS := DWR-921-C1 | ||
IMAGE_SIZE := $(ralink_default_fw_size_16M) | ||
DEVICE_TITLE := D-Link DWR-921 C1 | ||
DLINK_ROM_ID := DLK6E2414001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed:
DEVICE_PACKAGES := jboot-tools
432afb0
to
1eb7f3b
Compare
All the open point are now fixed. |
@@ -162,6 +162,11 @@ dlink,dwr-116-a1|\ | |||
mzk-ex300np) | |||
set_wifi_led "$boardname:green:wifi" | |||
;; | |||
dlink,dwr-921-c1) | |||
set_wifi_led "$boardname:green:wifi" | |||
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "br-lan" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You really make it harder than it has to be...
Please don't do it this way. You most likely will not find any example in the tree using a not physical interface with the netdev trigger.
Please use ucidef_set_led_switch
as suggested. The hex value used for the trigger is a binary mask selecting the switch ports which should trigger the LED. It has to be read from right (port 0) to left (port 4). For your board the following should do the trick:
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
dlink,dwr-921-c1) | ||
set_wifi_led "$boardname:green:wifi" | ||
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "br-lan" | ||
ucidef_set_led_default "sigstrength" "Signal Strength" "$boardname:red:sigstrength" "0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I've ignored it, but as you have to touch the file anyway: Can we use the green sigstrength led for diag? red leds are usually used for warning/error. For sure a matter of taste and nothing really critical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer the red to keep the attention high during the sysupgrade operation.
But I changed in green.
Bye.
The DWR-921-C1 Wireless Routers with LTE embedded modem is based on the MT7620N SoC. Specification: * MediaTek MT7620N (580 Mhz) * 64 MB of RAM * 16 MB of FLASH * 802.11bgn radio * 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN) * 2x external, detachable (LTE) antennas * UART header on PCB (57600 8n1) * 6x LED (GPIO-controlled) * 1xbi-color Signal Strength LED (GPIO-controlled) * 2x button * JBOOT bootloader Known issues: * LTE Modem not yet working (subject for a new PR) * The status led has been assigned to the dwr-921-c1:green:sigstrength (lte signal strength led). At the end of the boot it is switched off and is available for lte operation. Work correctly also during sysupgrade operation. Installation: Apply factory image via d-link http web-gui. How to revert to OEM firmware: 1.) Push the reset button and turn on the power. Wait until LED start blinking (~10sec.) 2.) Upload original factory image via JBOOT http (IP: 192.168.123.254) 3.) If http doesn't work, it can be done with curl command: curl -F FN=@XXXXX.bin http://192.168.123.254/upg where XXXXX.bin is name of firmware file. Signed-off-by: Giuseppe Lippolis <giu.lippolis@gmail.com>
1eb7f3b
to
53c72c6
Compare
merged into my staging tree. |
The DWR-921-C1 Wireless Routers with LTE embedded modem is based on the MT7620N SoC.
Specification:
Known issues:
Installation:
Apply factory image via d-link http web-gui.
How to revert to OEM firmware:
1.) Push the reset button and turn on the power. Wait until LED start blinking (~10sec.)
2.) Upload original factory image via JBOOT http (IP: 192.168.123.254)
3.) If http doesn't work, it can be done with curl command:
curl -F FN=@XXXXX.bin http://192.168.123.254/upg
where XXXXX.bin is name of firmware file.
Signed-off-by: Giuseppe Lippolis giu.lippolis@gmail.com