Hi,
I am adding ath79 support for the MikroTik RB750r2 (hEX lite), which was already supported by ar71xx. So far almost everything is working, only the network activity LEDs are missing and I got stuck there.
The patch is available at https://github.com/rogerpueyo/openwrt/tree/ath79-mikrotik-rb750-r2-hex-lite.
The 5 network activity LEDs are connected to an HC595 SPI serial shift register. In the DTS I declared it as:
&spi {
status = "okay";
// cs-gpios = <&gpio 0 0>; //Nope
// cs-gpios = <0>, <&gpio 11 GPIO_ACTIVE_LOW>; //Nope
// cs-gpios = <0>, <&gpio 11 GPIO_ACTIVE_HIGH; //Nope
// cs-gpios = <&gpio 8 GPIO_ACTIVE_LOW>, <&gpio 11 GPIO_ACTIVE_HIGH>; //Nope
ssr: ssr@1 {
compatible = "fairchild,74hc595";
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
reg = <1>;
spi-max-frequency = <50000000>;
};
};
and also added the 5 LEDs:
led1 {
label = "green:led1";
gpios = <&ssr 0 GPIO_ACTIVE_LOW>;
};
[...]
led5 {
label = "green:led5";
gpios = <&ssr 4 GPIO_ACTIVE_LOW>;
};
I configure the LEDs to be triggered by hearbeat
:
cd /sys/class/leds
for i in gre*led?; do echo heartbeat > $i/trigger; done
but nothing happens until I do this trick to toggle the CS pin of the HC595 SSR (GPIO11 was already used in ar71xx):
cd /sys/class/gpio
echo 11 > export
cd gpio11
echo out > direction
while true; do echo 0 > value; echo 1 > value; done
Then, the 5 LEDs go ON/OFF with the heartbeat trigger.
I tried several cs-gpios
configurations, as shown above, but I didn't find the correct one.
Can anyone please give me a hint on how to configure the cs-gpios
parameter?
Thanks!