Hi All
I've been working on adding support for my ZyXel NBG6503, and I think I've been making good progress.
The device consists of a MT7620A + a MT7610E. It has 8MB Flash and 64MB RAM.
I currently am able to build an image for the device and upload the -initramfs version to the device over TFTP from the bootloader.
I have gotten the wired networking to work, as well as the 2.4GHz and 5GHz wireless networks (after adding the MT76x0E driver).
What doesn't work right now is LEDs and buttons.
I have the complete table over which gpio goes to which LEDs and buttons, but I need some help configuring OpenWRT to use them. I think it's my dts file that isn't correct, but I'm not sure, and I don't know how to fix it.
Also, I can control the 2.4GHz LED via GPIO, but not the 5GHz LED. Could it be connected to the MT7610E?
Any pointers would be appreciated
Thanks
Buttons/LEDs
=== LED ===
+-Name---|-Color-|-Pin-|-Polarity--+
| WPS | Green | 55 | ActiveLow |
| USB | Red | 58 | ActiveLow |
| Power | Green | 39 | ActiveLow |
| Wifi2G | Green | 72 | ActiveLow |
+--------+-------+-----+-----------+
=== Buttons ===
+-Name---|-Color-|-Pin-|-Polarity--+
| WPS | | 2 | ActiveLow |
| WLAN | | 57 | ActiveLow |
| Reset | | 1 | ActiveLow |
+--------+-------+-----+-----------+
DTS file
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "zyxel,nbg6503", "ralink,mt7620a-soc";
model = "ZyXel NBG6503";
leds {
compatible = "gpio-leds";
usb {
label = "nbg6503:green:usb";
gpios = <&gpio0 58 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
wifi {
label = "nbg6503:green:wifi";
gpios = <&gpio3 72 GPIO_ACTIVE_LOW>;
};
/* led_power_green: power {
label = "keenetic-viva:green:power";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};*/
/* power {
label = "nbg6503:green:power";
gpios = <&gpio0 39 GPIO_ACTIVE_LOW>;
}*/
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
/*usbpower {
gpio-export,name = "usbpower";
gpio-export,output = <1>;
gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
};*/
test {
gpio-export,name = "testname";
gpio-export,output = <1>;
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
};
};
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&gpio3 {
status = "okay";
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Bootloader";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "Config";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "Factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "Kernel";
reg = <0x50000 0x7b0000>;
};
};
};
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
ðernet {
mtd-mac-address = <&factory 0x28>;
mediatek,portmap = "llllw";
};
&gsw {
mediatek,port4 = "ephy";
};
&wmac {
pinctrl-names = "default";
pinctrl-0 = <&pa_pins>;
ralink,mtd-eeprom = <&factory 0x0>;
mtd-mac-address = <&factory 0x28>;
};
&pcie {
status = "okay";
};
&state_default {
gpio {
groups = "uartf", "nd_sd", "wled";
function = "gpio";
};
};
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};