Hi,
I'm working on an OpenWrt port for a device that is running a vendor firmware. It is based on MediaTek MT7620A. Here is the /etc/openwrt_release
:
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r19989-24eee4b244'
DISTRIB_TARGET='ramips/mt7620'
DISTRIB_ARCH='mipsel_24kc'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r19989-24eee4b244'
DISTRIB_TAINTS='no-all'
I don't know why these two GPIOs, 40 and 45, don't work under OpenWrt when it works normally in the vendor firmware. GPIO40 is for controlling the LAN LED, while GPIO45 is for resetting the LTE module sitting on the mPCIe of the unit. I have gotten all other GPIOs working good in this port, except for these two, so I hope someone could help me understand, as these things are a little out of depth for me at the moment.
Here's an excerpt of the device tree file I created:
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "evoluzn,fx-id3", "ralink,mt7620a-soc";
model = "Evoluzn FX-ID3";
<snip>
gpio-export {
compatible = "gpio-export";
#size-cells = <0>;
reset_cp {
gpio-export,name = "reset_cp";
gpio-export,output = <1>;
gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
lan {
label = "green:lan";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
<snip>
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio2 29 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
And here's the relevant /sys/kernel/debug/gpio
output:
gpiochip1: GPIOs 40-71, parent: platform/10000660.gpio, 10000660.gpio:
gpio-40 ( |green:lan ) out lo ACTIVE LOW
gpio-45 ( |reset_cp ) out hi ACTIVE LOW
gpio-69 ( |reset ) in hi ACTIVE LOW
So if I do echo 255 > /sys/class/leds/green:lan/brightness
it should have turned on the LAN LED, but it doesn't turn on. Also, if I echo 1 > /sys/class/gpio/reset_cp/value
it should power cycle/turn on the LTE module on the mPCIe, but this also doesn't do anything. Inverting the values also doesn't give responses from these two GPIOs.
Can anybody tell me what's going on here?
-ianp