OpenWrt Forum Archive

Topic: Edimax BR-6478AC V2 - MT7620A

The content of this topic has been archived between 10 Apr 2018 and 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Just to close off on this target, the two remaining (major) issues were the non-powered usb port and non-working mt76 driver for the mt7612e chip.

To fix the mt76 error I had to manually add it's MAC address, as the driver was failing to read from the EEPROM. So this command adds the MAC (from the sticker on bottom of case) and allows wlan0 to come up.

Shows wlan0 has no MAC addy:

root@OpenWrt:/# iw wlan0 info
Interface wlan0
        ifindex 5
        wdev 0x1
        addr fd:ff:ff:ff:ff:ff
        type managed
        wiphy 0
        txpower 0.00 dBm
root@OpenWrt:/# iw wlan1 info
Interface wlan1
        ifindex 7
        wdev 0x100000001
        addr xx:xx:xx:xx:xx:c6
        type managed
        wiphy 1
        txpower 20.00 dBm

Adds a valid MAC address:

root@OpenWrt:/# ip link set dev interface address XX:XX:XX:XX:XX:C7

This allows wlan0 (mt76/mt7612en) to scan and detect networks but once hostapd attempts to use as a master/ap the interface completely disappears. Trying to use the latest mt76 driver almost compiles but the openwrt kernel is missing some new headers and needs an upgraded mac80211 library. So for this reason I am switching over to the LEDE git source and starting from scratch to try and make use of the latest mt76 driver and hopefully 80211ac with the mt7612e chipset.

The final issue was the usb port, but simply using an externally powered device, or a powered usb hub with usb-powered devices fixes the problem (for now). But I think the custom gpio (pin19) has something to do with enabling power on the usb port. Otherwise I have tested the usb port with both 1.1 and 2.0 devices using an externally powered usb hub and it works fine.

The only other issue I noticed with the 2.4GHz radio (mt7620/rt2880) was it seemed to be only using one antenna for tx and both antenna for rx, and I could not find any configuration options for the dual antennas via luci or any mention of antenna configuration in the source or dmesg output etc. Also still produces kernel dump with "invalid EEPROM word 208" error so I hope LEDE can improve on that too. Apart from that error it works fine in both master/ap or client modes.

rmurch wrote:

Currently working with elektroman's do-work/Edimax branch. I think anonymous commits are disabled so I cant push this commit up, but here is the current patch.

As I said you can't push to other repositories unless you have rights.
You have to setup your own, or send me the
"git format-patch"
output.
I don't know if github uses gitolite for accessing the repositories, with this it's possible to "open" only a branch.

Now for the patches :
I pick all of your patches and the end of this week (maybe prior end) and test this with my on hardware which is hopefully arrived at this time.
I don't want act "as a proxy" without testing myself ...
And I need a (cheep) 802.11ac router with Gigabit NIC for testing
Maybe I find the missing MAC addresses.

For the missing tx radio/antenna on mt7620/rt2880.
This is normally read out via eeprom from the wireless NIC. There is no value inside UCI/LuCI. I know this from my work on 802.11ac USB drivers.

If you switch from OpenWRT to LEDE, this is (hopefully) simple
git format-patch
on OpenWRT
and import these patches with
git am

Is the wireless LED working with with the mt7612e driver ??

elektroman wrote:

As I said you can't push to other repositories unless you have rights.
You have to setup your own, or send me the "git format-patch" output.

The last two up-to-date patches on the openwrt source are included in this thread. Since moving to LEDE I have made a few more changes and will get that patch to you tonight or tomorrow morning (not on desktop atm sorry).


elektroman wrote:

I don't want act "as a proxy" without testing myself ...
And I need a (cheep) 802.11ac router with Gigabit NIC for testing

I think these br-6478ac v2's are great "bang for buck", probably the cheapest ac1200+gigabit router on the market and the hardware specs are excellent. Wait until you see how useless the stock firmware is!


elektroman wrote:

Maybe I find the missing MAC addresses.

Done. Included in the LEDE patch I will post later. Basically took the pcie-bridge settings for wmac from the br6475n DTS and modified into the br6478acv2 DTS. I did not get to complete testing last night but it fixed the wlan0 mac address and also showed proper power output in db when previously it was always 0db. Both radio's still show 0 tx and 0 rx antennas available in "iw list".


elektroman wrote:

For the missing tx radio/antenna on mt7620/rt2880.
This is normally read out via eeprom from the wireless NIC. There is no value inside UCI/LuCI. I know this from my work on 802.11ac USB drivers.

I think both radios need some love as far as eeprom reading, but they are kinda half way there.

elektroman wrote:

Is the wireless LED working with with the mt7612e driver ??

The four LEDs on the board are all working via gpio toggles (/sys/class/gpio). I can also see 3 other nodes in /sys/class/gpio from the rt2800 for LEDs for the wlan1 (not mt7612e) but I dont think they are connected physically to any LEDs on the pcb. Unless they are used as gpio inputs and software was used to toggle the gpio outputs? Just a guess. The Edimax firmware did have some bash script in init to control the LEDs, I could dig through that some more.
I need to look into enabling debug output on the mt76, might give some more clues.

Just a quick update for now, and within 24 hours I will get the up-to-date LEDE patch posted here too.

rmurch wrote:

I think these br-6478ac v2's are great "bang for buck", probably the cheapest ac1200+gigabit router on the market and the hardware specs are excellent. Wait until you see how useless the stock firmware is!

I have the precursor, with RTL8812AE chipset and broken SoC CPU, because of saving some $$$ they do some commands in software. I don't know which money costs this IP, but this is a bad idea.

rmurch wrote:

Done. Included in the LEDE patch I will post later. Basically took the pcie-bridge settings for wmac from the br6475n DTS and modified into the br6478acv2 DTS. I did not get to complete testing last night but it fixed the wlan0 mac address and also showed proper power output in db when previously it was always 0db. Both radio's still show 0 tx and 0 rx antennas available in "iw list".

I think both radios need some love as far as eeprom reading, but they are kinda half way there.

for 802.11ac to my knowledge not possible. The Xioami mini (which I own for testing) uses the same WIFI NIC. And with this I can see *two* streams on my mt7612u device.

rmurch wrote:

The four LEDs on the board are all working via gpio toggles (/sys/class/gpio). I can also see 3 other nodes in /sys/class/gpio from the rt2800 for LEDs for the wlan1 (not mt7612e) but I dont think they are connected physically to any LEDs on the pcb.

For the mt7612e (whatever) WIFI NIC I saw on this board here with some board a regression regarding the missing LED. On mt7610u/mt7612u this is controlled via the MCU. But the code is only in the mt7610u driver.And the mt76 doesn't have this code last time I check this some months ago

Excuse the delay, please find below the 2x patches to bring the LEDE git source up to date. I stuffed up committing only the DTS file first (first patch) then commited all the other files (2nd patch).

0001-add-new-target-for-Edimax-BR-6478AC-V2.patch

From f09df373db93030fddfdc7ae8ec437adc3310ea2 Mon Sep 17 00:00:00 2001
From: "R.Murch" <rohan.murch@gmail.com>
Date: Wed, 28 Sep 2016 09:46:34 +1000
Subject: [PATCH] add new target for Edimax BR-6478AC V2

---
 target/linux/ramips/dts/BR-6478AC-V2.dts | 322 +++++++++++++++++++++++++++++++
 1 file changed, 322 insertions(+)
 create mode 100644 target/linux/ramips/dts/BR-6478AC-V2.dts

diff --git a/target/linux/ramips/dts/BR-6478AC-V2.dts b/target/linux/ramips/dts/BR-6478AC-V2.dts
new file mode 100644
index 0000000..db5cc42
--- /dev/null
+++ b/target/linux/ramips/dts/BR-6478AC-V2.dts
@@ -0,0 +1,322 @@
+/*
+ * Device Tree file for the Edimax BR-6478AC V2
+ * based on Linksys E1700
+ *
+ * Copyright (C) 2016 Hasn Ulli Kroll <ulli.kroll@googlemail.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+    compatible = "edimax,br-6478ac-v2", "ralink,mt7620a-soc";
+    model = "Edimax BR-6478ACV2";
+
+    chosen {
+        bootargs = "console=ttyS0,57600";
+    };
+
+    palmbus@10000000 {
+        gpio1: gpio@638 {
+            status = "okay";
+        };
+        gpio2: gpio@660 {
+            status = "okay";
+        };
+    //    enable-gpios = <&gpio0 19>;
+
+    //    i2c: i2c@900 {
+    //        status = "okay";
+    //    };
+
+        spi@b00 {
+            status = "okay";
+            m25p80@0 {
+                #address-cells = <1>;
+                #size-cells = <1>;
+                compatible = "jedec,spi-nor";
+                reg = <0 0>;
+                linux,modalias = "m25p80", "mx25l6405d";
+                spi-max-frequency = <10000000>;
+                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 {
+                    label = "cimage";
+                    reg = <0x50000 0x20000>;
+                    read-only;
+                };
+
+                partition@70000 {
+                    label = "kernel";
+                    reg = <0x70000 0x140000>;
+                };
+                partition@1B0000 {
+                    label = "rootfs";
+                    reg = <0x1B0000 0x650000>;
+                };
+                partition2@70000 {
+                                    label = "firmware";
+                                    reg = <0x70000 0x790000>;
+                };
+
+            };
+        };
+
+        uartlite@c00 {
+            status = "okay";
+            compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; // palmchip bk-3103
+            reg = <0xc00 0x100>;
+            resets = <&rstctrl 19>;
+            reset-names = "uartl";
+            interrupt-parent = <&intc>;
+            interrupts = <12>;
+            reg-shift = <2>;
+            pinctrl-names = "default";
+            pinctrl-0 = <&uartlite_pins>;
+        };
+
+    };
+
+
+    pinctrl {
+        state_default: pinctrl0 {
+        //    enable-gpios = <&gpio0 19>;
+            gpio {
+                ralink,group = "i2c", "uartf";
+            //    ralink,group = "i2c", "uartf", "gpio";
+            ///    ralink,group = "i2c", "uartf", "pa";
+            //    ralink,group = "uartf", "pa";
+                ralink,function = "gpio";
+            };
+        ///    i2c {
+        ///        ralink,group = "i2c";
+        ///        ralink,function = "i2c";
+        ///    };
+        //    pa {
+        //        ralink,group = "pa";
+        //        ralink,function = "pa";
+        //    };
+        };
+    };
+
+
+    usbphy: usbphy {
+        compatible = "mediatek,mt7620-usbphy";
+    //    compatible = "ralink,mt7620a-usbphy";
+        #phy-cells = <1>;
+        resets = <&rstctrl 22 &rstctrl 25>;
+    //    resets = <&rstctrl 22 &rstctrl 19>;
+        reset-names = "host", "device";
+    };
+
+
+    ethernet@10100000 {
+        status = "okay";
+        mtd-mac-address = <&factory 0x28>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+        mediatek,portmap = "wllll";
+
+        port@5 {
+            status = "okay";
+            mediatek,fixed-link = <1000 1 1 1>;
+            phy-mode = "rgmii";
+        };
+
+        mdio-bus {
+            status = "okay";
+            phy0: ethernet-phy@0 {
+                reg = <0>;
+                phy-mode = "rgmii";
+            };
+            phy1: ethernet-phy@1 {
+                reg = <1>;
+                phy-mode = "rgmii";
+            };
+            phy2: ethernet-phy@2 {
+                reg = <2>;
+                phy-mode = "rgmii";
+            };
+            phy3: ethernet-phy@3 {
+                reg = <3>;
+                phy-mode = "rgmii";
+            };
+            phy4: ethernet-phy@4 {
+                reg = <4>;
+                phy-mode = "rgmii";
+            };
+            phy1f: ethernet-phy@1f {
+                reg = <0x1f>;
+                phy-mode = "rgmii";
+            };
+        };
+    };
+
+    gsw@10110000 {
+        mediatek,port4 = "gmac";
+        mediatek,mt7530 = <1>;
+    };
+
+    wmac@10180000 {
+        ralink,mtd-eeprom = <&factory 0>;
+    ////    ralink,eeprom = "soc_wmac.eeprom";
+    //    ralink,eeprom = "rt2x00pci_1_0.eeprom";
+    };
+
+
+    gpio-keys-polled {
+        compatible = "gpio-keys-polled";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        poll-interval = <20>;
+
+        reset {
+            label = "reset";
+            gpios = <&gpio0 12 1>;
+        //    linux,code = <0x198>;
+            linux,code = <0x101>;
+        };
+    //    wps {
+    //        label = "wps";
+    //        gpios = <&gpio0 1 1>;
+    //    //    linux,code = <0x211>;
+    //        linux,code = <0x100>;
+    //    };
+
+    };
+
+
+    gpio-leds {
+        compatible = "gpio-leds";
+        power {
+            label = "br-6478ac-v2:white:power";
+            gpios = <&gpio0 11 1>; // edimax wps
+        };
+        wan {
+            label = "br-6478ac-v2:blue:wan";
+            gpios = <&gpio0 7 1>; // edimax power
+        };
+        wlan {
+            label = "br-6478ac-v2:blue:wlan";
+            gpios = <&gpio0 10 1>; // edimax wireless_aband
+        };
+        usb {
+            label = "br-6478ac-v2:blue:usb";
+            gpios = <&gpio0 14 1>; // edimax wireless_gband
+        };
+        //wifi { // unused smd led pad on pcb
+        //    label = "br-6478ac-v2:blue:wifi";
+        //    gpios = <&gpio1 1 1>; // edimax wireless, gpio25
+        //};
+
+    };
+
+
+    pcie@10140000 {
+        status = "okay";
+        pcie-bridge {
+        //    reg = <0x0000 0 0 0 0>;
+        //    #address-cells = <3>;
+        //    #size-cells = <2>;
+        //    device_type = "pci";
+            status = "okay";
+        //    wmac@0,0 { // strange mac: 9c:99:35:9b:b1:be not 74:da:38:68:45:c7
+        //        ralink,5ghz = <0>;
+        //        compatible = "ralink,rt2880-pci", "pciclass060400", "pciclass0604";
+        //        reg = < 0x10000 0 0 0 0 >;
+        //        ralink,eeprom = "rt2x00pci_1_0.eeprom";
+        //    };
+            mt76@0,0 {
+                reg = <0x0000 0 0 0 0>;
+                device_type = "pci";
+                mediatek,mtd-eeprom = <&factory 0x8000>;
+                mediatek,2ghz = <0>;
+            };
+        };
+    };
+
+    ehci@101c0000 {
+        status = "okay";
+        interrupt-parent = <&intc>;
+        interrupts = <18>;
+    };
+
+    ohci@101c1000 {
+        status = "okay";
+        interrupt-parent = <&intc>;
+        interrupts = <18>;
+    };
+
+    /* Unclear if this is the correct gpio setup; the USB ports are
+      unpopulated on a stock BR-6475nD, even though the hardware exists
+      and the headers are there. */
+    gpio_export {
+        compatible = "gpio-export";
+        #size-cells = <0>;
+        enable-gpios = <&gpio0 19>;
+/*
+        // pa_pe/pa pins 18,19,20,21
+        gpio18 {
+            gpio-export,name="gpio18";
+            gpio-export,output=<0>;
+            gpios = <&gpio0 18 0>;
+        };
+        usb {
+            gpio-export,name="usb";
+            gpio-export,output=<0>;
+            gpios = <&gpio0 19 0>;
+        };
+        gpio20 {
+            gpio-export,name="gpio20";
+            gpio-export,output=<0>;
+            gpios = <&gpio0 20 0>;
+        };
+        gpio21 {
+            gpio-export,name="gpio21";
+            gpio-export,output=<0>;
+            gpios = <&gpio0 21 0>;
+        };
+*/
+/*
+        gpio0 {
+            gpio-export,name="gpio0";
+            gpio-export,output=<0>;
+            gpios = <&gpio0 0 0>;
+        };
+        gpio1 {
+            gpio-export,name="gpio1";
+            gpio-export,output=<0>;
+            gpios = <&gpio0 1 0>;
+        };
+        gpio2 {
+            gpio-export,name="gpio2";
+            gpio-export,output=<0>;
+            gpios = <&gpio0 2 0>;
+        };
+*/
+
+    };
+
+};
+
-- 
1.8.3.1

0001-add-new-target-for-Edimax-Br-6478ac_v2-2-2.patch

From 0bbb7e59f245e6d88cf7c5a06758374ed82a7e4a Mon Sep 17 00:00:00 2001
From: "R.Murch" <rohan.murch@gmail.com>
Date: Wed, 28 Sep 2016 09:50:01 +1000
Subject: [PATCH] add new target for Edimax Br-6478ac_v2 2/2

---
 target/linux/ramips/base-files/etc/board.d/01_leds    |  6 ++++++
 target/linux/ramips/base-files/etc/board.d/02_network | 15 +++++++++++++++
 target/linux/ramips/base-files/etc/diag.sh            |  3 +++
 target/linux/ramips/base-files/lib/ramips.sh          |  3 +++
 target/linux/ramips/image/mt7620.mk                   |  8 ++++++++
 5 files changed, 35 insertions(+)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 97c405d..0e693a1 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -74,6 +74,12 @@ bc2)
 br-6425)
     set_wifi_led "$board:orange:wlan"
     ;;
+br-6478ac-v2)
+    ucidef_set_led_default "power" "POWER" "$board:white:power" "1"
+    ucidef_set_led_default "wan" "WAN LED" "$board:blue:wan" "1"
+    set_wifi_led "$board:blue:wlan"
+    set_usb_led "$board:blue:usb"
+    ;;
 broadway)
     set_usb_led "$board:red:diskmounted"
     set_wifi_led "$board:red:wps_active"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 675dcc9..137644d 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -157,10 +157,18 @@ ramips_setup_interfaces()
     wr6202)
         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
         ;;
+    br-6478ac-v2|\
     br-6475nd)
         ucidef_add_switch "switch0" \
             "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
         ;;
+//    br-6478ac-v2)
+//    //    ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+//    //    ucidef_set_interface_lan "eth0.1"
+//        ucidef_add_switch "switch1" \
+//            "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
+//        ;;
+
     cf-wr800n|\
     ex2700)
         ucidef_add_switch "switch0" \
@@ -284,6 +292,13 @@ ramips_setup_macs()
         lan_mac=$(cat /sys/class/net/eth0/address)
         wan_mac=$(mtd_get_mac_binary devdata 7)
         ;;
+
+    br-6478ac-v2)
+        lan_mac=$(cat /sys/class/net/eth0/address)
+        wan_mac=$(cat /sys/class/net/eth0.2/address)
+        //wan_mac=$(mtd_get_mac_binary devdata 7)
+        ;;
+
     cy-swr1100|\
     dch-m225)
         lan_mac=$(mtd_get_mac_ascii factory lanmac)
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 969594d..419775a 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -35,6 +35,9 @@ get_status_led() {
     xdxrn502j)
         status_led="$board:green:power"
         ;;
+    br-6478ac-v2)
+        status_led="$board:white:power"
+        ;;
     a5-v11|\
     cs-qr10|\
     d105|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 98bc68c..b2ab445 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -76,6 +76,9 @@ ramips_board_detect() {
     *"BR-6475nD")
         name="br-6475nd"
         ;;
+    *"BR-6478AC-v2")
+        name="br-6478ac-v2"
+        ;;
     *"Broadway")
         name="broadway"
         ;;
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 003fc70..6cab316 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -404,3 +404,11 @@ define Device/dch-m225
   DEVICE_PACKAGES := kmod-mt76
 endef
 TARGET_DEVICES += dch-m225
+
+define Device/br-6478ac-v2
+  DTS := BR-6478AC-V2
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  DEVICE_TITLE := Edimax BR-6478-AC V2
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76
+endef
+TARGET_DEVICES += br-6478ac-v2
-- 
1.8.3.1

Please excuse some commented out sections in the DTS, I have recently discovered the "PA" group of gpio (18,19,20,21) which seem to control the antenna selection and rf power amplifiers. Still testing that and GPIO's to find something to power up the usb port. i2c port does not seem to be used, so am also testing gpio1 and gpio2 to see if connnected to anything on the pcb.

Can confirm the mt7612e is now working in AP/Master mode ok, although at 40mhz bandwidth not 80mhz.

rmurch wrote:

Can confirm the mt7612e is now working in AP/Master mode ok, although at 40mhz bandwidth not 80mhz.

First for the "excuses" I don't care.

The normal round trip on linux kernel is two/three days, if you are lucky you get an answer in one day, sometimes this is more. The rule of thumb is one week.
The most important thing is quality/accurate of code.
So why bother

I will take these patches and test this on my hardware, which is currently on the way.
But you have to wait until weekend.
Work you know ;-)

So serial cable on hardware is soldered, no modifications needed. Opening the router is bad.
Repositories updated.
Now I can start develop.

elektroman wrote:

So serial cable on hardware is soldered, no modifications needed.

Did your router come with the 4x serial jumper pins already soldered? Mine had empty solder pads, and the capacitor to bottom right of pins makes it a bit tricky, I had to solder the jumpers on a 45' angle to pcb.

elektroman wrote:

Opening the router is bad.

Yes I agree. Removing the front LED panel is even worse, I snapped some plastic locking tabs. Also trying to remove the antennas by squeezing the circlip-style lock on the inside of the case is hard without damaging the antennas. On the second one I just cut them off and added RP-SMA sockets instead.

Testing the 5g radio with a intel7620 on my laptop, I am getting (reported) speeds between 195.1mbps and 866mbps. The bandwidth dynamically jumps between 20mhz and 80mhz for each up/down stream. Can confirm the 2.4g is also operating in 2T2R mode. So even though the eeprom(s) reports 0 antennas they both are using 2.

This weekend I am going to attempt to cut the 2x solder tracks carrying the antennas from the mt7620 over to the mt7612e where they merge (diplexer) into one antenna each (4 into 2). So will have 2x RP-SMA sockets for the 2.4g, and 2x RP-SMA sockets for the 5g. **fingers crossed**

No serial jumper.
It did my soldering after work (at work) so I don't need to buy any soldering station.
Some people at work arguing about a broken device ...
And I do the soldering direct on PCB,
I have enough "empty" jumpers and USB to serial cables ready.
I usually buy them in 10 pieces a pack

/me thinking about a t-shirt "I void warranties"

So today my first boot via initramfs build. (*).

I want to remain the old firmware until LEDE is ready can flashed via webinterface to prove the build is right and a rando user can flash the device.

Currently wifi in not running, some drivers are not loading correctly, but this is a build issue.
BUT I can test without flashing, boot via TFTP only works with menu option not with cmdline (don't ask we why)
Stay tuned.

(*)
The last couple of days I was working on mt7610u driver ...

elektroman wrote:

/me thinking about a t-shirt "I void warranties"

haha Thinkgeek have you covered my friend: http://www.thinkgeek.com/product/8f52/


Ive been playing with the two br6478ac's here, one as a normal AP, the other in client mode routing a second subnet, all seems well and stable so far.

I have been discovering GPIO's, and found that there is only 9x led gpio's along the front, they are just double and triple tracked for different locations, so we have only 5x free gpios along the front leds.

Looking at rear left of pcb, there is space for a second push button, that is GPIO1. The two jumper pads alone in the front left corner behind the leds are gpio9 (left) and gpio13 (right).

Finally to power up the USB port, its GPIO45, and i presume the rest of that gpio bus (46,47,etc) are the 5x leds (i think, unconfirmed).

These are the free/unused gpios:

        pinctrl {
                state_default: pinctrl0 {
                        gpio {
                                ralink,group = "i2c", "uartf", "wdt", "pa", "ephy", "nd_sd", "wled";
                                ralink,function = "gpio";
                        };
                ///     i2c {
                ///             ralink,group = "i2c";
                ///             ralink,function = "i2c";
                ///     };
                //    pa {
                //              ralink,group = "pa";
                //              ralink,function = "pa";
                //    };
                };
        };

and exported the usb power gpio like this:

        gpio_export {
                compatible = "gpio-export";
                #size-cells = <0>;
                usb-power {
                        gpio-export,name="usb-power";
                        gpio-export,output=<0>;
                        gpios = <&gpio2 5 0>;  // pin45
                };

and can now power up the usb port with "echo 1 > /sys/class/gpio/usb-power/value", very handy to put an arduino into 'power off' mode, or shut down a 2.5" usb hard drive.

Also noticed with the LEDE build i do not have to run the mkimage command over the whole image, I can just pad the kernel, cat it with the rootfs and flash it that way.

Otherwise I have not made much more development progress, just happily using them smile but next step is definitely sorting out antenna arrays in eeprom so we can control antennas, as I am 99% sure the 5ghz radio is only rx'ing on one antennas (testing with panel antennas), and I think the 2.4ghz also, or they are dynamically changing their array automatically.

rmurch wrote:
        gpio_export {
                compatible = "gpio-export";
                #size-cells = <0>;
                usb-power {
                        gpio-export,name="usb-power";
                        gpio-export,output=<0>;
                        gpios = <&gpio2 5 0>;  // pin45
                };

There in a better solution for this ...
I must check this with my NAS code.

For LEDE check here
github.com:ulli-kroll/lede.git
branch

do-work/Edimax-v2

Currently wifi will not load with initramfs
fixed now.

missed MAC address. boots like a charm.

(Last edited by elektroman on 10 Oct 2016, 19:09)

@rmurch
is your local LAN running a GBit/s  with some device connected at the switch ports ??

elektroman wrote:

@rmurch
is your local LAN running a GBit/s  with some device connected at the switch ports ??

Sincere apologises for the late reply.

I can confirm this issue effects my routers too. I have not applied the new code to test, but using gigabit NICs I am only able to connect at 10/100 speeds, not gigabit speeds. I never noticed that before, opps.

Both br-6478ac-v2 routers I have are up and running in production, so I have not been able to pull them down to reflash (been too busy using them haha).

This weekend I plan to re-compile firmware with gigabit switch fix, and will attempt to flash via web gui interface not via tftp, so hopefully all goes well.

Will report back and let you know how it goes.

this is also one of the most idiotic things i've seen lately - devices apparently support 1 or 2 Gbit ports inside chip but the manufacturers wire it up so they end up 100Mbit to the switch while driver indicates fake 1000Mbps in kernel log. even more stupid it looks on numerous devices that actually have only one or two LAN ports, those could have been fully utilised.

better check before buying if it's real Gbit device.

anarchy99 wrote:

this is also one of the most idiotic things i've seen lately - devices apparently support 1 or 2 Gbit ports inside chip but the manufacturers wire it up so they end up 100Mbit to the switch while driver indicates fake 1000Mbps in kernel log. even more stupid it looks on numerous devices that actually have only one or two LAN ports, those could have been fully utilised.

better check before buying if it's real Gbit device.

You are WRONG

The switch chip can support Gbit Lan, with original firmware all ports are working with Gbit.

In the Edimax SDK are the sources for the  RTL8367 chip.

While booting LEDE, I can check the port with swconfig tool.
The port to the NIC works with Gbit
But the other ports don't

oh, your device works with stock fw at Gbit speed? then your compiled code is WRONG!"

As the name implies, Total Newbie here.  Don't know anything about coding--just a little bit about networking.  I'm wanting to flash a BR-6478 V2 with an open source firmware in the hopes that it will help me to fix an issue I'm having with an HDHomeRun tuner (it has to do with the Gbit ports that don't appear to actually be Gbit as far as I can tell).  Anyway, I've flashed DD-WRT onto some different routers before, but I can't find a working build to port any open source firmware onto the BR-6478 V2.  So, my question is, @rmurch, did you get a working build?  I understand the bricking risks, etc., I'm just trying to get my hands on a file if there's one out there.  Thanks for putting up with a bit of ignorance!

I accidentally bought one of these and was annoyed that even though it lists as supported in the ToH it isn't. I took Hans Ulli Kroll's patches and fixed the remaining issues. I found the mt72 driver in openwrt was fine, so rebased everything on openwrt rather than Lede. The things I fixed relative to his last commit at github.com/ulli-kroll/lede.git are:

leds now configure correctly
sysupgrade works
binary image can be installed using the original firmware's update page (so no need to open the case)
correct antenna configuration and mac address for the 802.11a radio
correct mtdsplit (support for csys images appeared broken)
switch correctly working at gbe

I also added support for a jffs2 only configuration which may be of interest.

(patches against openwrt trunk 187ad058 from 27/12/2016)

Hans Ulli Kroll's patches rolled up and ported to openwrt:
git.panaceas.org/cgit.cgi/openwrt/em-br6478acv2/master-187ad058-pq/tree/master/Hans_Ulli_Kroll.patch

My patches:
git.panaceas.org/cgit.cgi/openwrt/em-br6478acv2/master-187ad058-pq/tree/master/jmm.patch

My patches to enable jffs2 only: (disables the 4M targets)
git.panaceas.org/cgit.cgi/openwrt/em-br6478acv2/master-187ad058-pq/tree/master/jmm-jffs2.patch

--
James.

(Last edited by fishsoupisgood on 19 Jan 2017, 17:24)

HI

how about the gigabit switch issues ??
I have some idea solving this, maybe some bitbang mdio will do this trick. But first the phy/mdio pins must be change to normal gpio.

Currently can't test by my self, device is at work.
... this is hack device during lunch breaks ...

with my fix to the DTS (it had the wrong switch type) I'm getting gigabit on all the ports, I think some of the port numbers are still wrong.

James.

(Last edited by fishsoupisgood on 19 Jan 2017, 23:33)

fishsoupisgood wrote:

with my fix to the DTS (it had the wrong switch type) I'm getting gigabit on all the ports, I think some of the number is still wrong.

James.

The git ID is not in my repository ...
Did you apply these patches by "hand" aka git am ??
In this case -> wrong workflow.

The normal usecase is to a

git remote add

checkout the desired branch locally a work on.
After this you can "drop" the remote git repository.

elektroman wrote:
fishsoupisgood wrote:

with my fix to the DTS (it had the wrong switch type) I'm getting gigabit on all the ports, I think some of the number is still wrong.

James.

The git ID is not in my repository ...
Did you apply these patches by "hand" aka git am ??
In this case -> wrong workflow.

I have no idea what you mean. Why would my patch be in your repository? If you are asking how to apply the patches use guilt. guilt, if you've not encountered it, is good for maintaining a set of patches against an upstream repository in a way that git alone can't. (it allows you to version control a patch containing a feature against some other repository)

but there's no need to do that, you can just apply the patch I linked with git apply or whatever you like.

If you care about the guilt workflow it looks something like this:

git clone git://github.com/openwrt/openwrt master-187ad058
(cd master-187ad058 && git reset --hard 187ad058)
git clone git://git.panaceas.org/openwrt/em-br6478acv2/master-187ad058-pq
ln -s ../../master-187ad058-pq master-187ad058/.git/patches
cd master-187ad058
guilt push -a


J.

specificially the switch was unhappy because the code in soc_mt7620 only probes for an external mt7530 switch on the mdio bus (rather than one integrated on the chip accessible via mmio) if it doesn't find the mediatek,mt7530 property in the DTS. The particular unit I have here seems to be unhappy using port 1 (marked 4 on the outside) at gigabit speeds - I'll check on different hardware tomorrow.

J.

The discussion might have continued from here.