OpenWrt Forum Archive

Topic: Belkin F5D8635-4V1 / Lantiq Danube GPIO mapping

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Following on from this:

https://forum.openwrt.org/viewtopic.php?id=53882

posted in 'Developers Only', I am now convinced that the SoC partnum is being correctly reported, and so can be fixed in the kernel at some stage. I did some poking about in the Belkin GPLed factory source to double check.

I have barrier breaker compiling and running (over TFTP), with just a couple of tweaks - my partnum hack as above, and removing 'softdog_vpe.o' from the lantiq Makefile, as it was breaking the build:

linux-lantiq_xway/linux-3.10.49/arch/mips/lantiq/Makefile

However, I only have a few things correctly working in my hacked DTS, namely:

Built-in Ethernet:

                /* SoC Ethernet device */
                etop@E180000 {
                        compatible = "lantiq,etop-xway";
                        reg = <0xE180000 0x40000>;
                        interrupt-parent = <&icu0>;
                        interrupts = <73 78>;
                        phy-mode = "mii";
                        mac-address = [ 00 11 22 33 44 55 ];
                };

PCI (and hence wireless Ethernet):

                /* Enable PCI bus */
                pci0: pci@E105400 {
                        status = "okay";
                        gpio-reset = <&gpio 21 0>;
                        req-mask = <0x1>;
                };

ADSL probably works too, but I can't check here.

I think USB is working, but the port is not being powered on, as I don't know which GPIO line controls this. I have no control over the switch IC, and although the stp@e100bb0 support appears to be working, I don't really understand how it works. I can turn the main power LED on and off through the /sys interface, but nothing else.

The Belkin source tarball has code for an interface in /proc/driver/danube_port, which on the running firmware returns:

Danube Port Settings
         3         2         1         0
        10987654321098765432109876543210
----------------------------------------

P0-OUT:                 XXXXXX  XXX XX
P1-OUT:                  XX XXX X XXXX
P0-IN:                  XXXXXX  XXX XX
P1-IN:                  XXXXXXXXXXXXXX X
P0-DIR:                 XXXXXXXXXXXXXX X
P1-DIR:                  XX XXXXXXXXXXX
P0-STO:
P1-STO:
P0-PUDE:                           X
P1-PUDE:                X    X XX      X
P0-OD:                  XXXXXXXXXXXXXX X
P1-OD:                  XXXXXXXXXXXXXXX
P0-PUDS:                           X
P1-PUDS:                X    X X       X
P0_ALT0:                           X
P0_ALT1:
P1_ALT0:                         X    XX
P1_ALT1:                       X

This looks helpful, but again, I'm not sure that I understand what to do with it.

Any pointers?

Turns out that the STP isn't used at all, which I should have guessed, since there are no extra latch ICs on the board.

I used the factory firmware '/proc/driver/danube_port' interface and '/usr/sbin/ledctrl', which has 'on' 'off' and 'blink' options for each GPIO - e.g. 'ledctrl 0 off' will toggle the power LED on GPIO 0, 'ledctrl 9 off' will toggle USB power on GPIO 9.

I tried to code the pinmux mappings into the DTS, based on the factory firmware GPIO port settings:

state_default: pinmux {
                pci_rst {
                    lantiq,pins = "io21";
                    lantiq,open-drain = <1>;
                    lantiq,output = <1>;
                };
                reset_btn {
                    lantiq,pins = "io31";
                    lantiq,pull = <2>;
                    lantiq,open-drain = <1>;
                    lantiq,output = <0>;
                };
                wps_btn {
                    lantiq,pins = "io28";
                    lantiq,pull = <0>;
                    lantiq,open-drain = <1>;
                    lantiq,output = <0>;
                };

                leds {
                    lantiq,pins = "io0", "io19", "io5",
                    "io6", "io8", "io20", "io10", "io10",
                    "io7", "io26", "io29", "io2", "io15",
                    "io18", "io11", "io12", "io25", "io13",
                    "io27", "io30";
                    lantiq,pull = <0>;
                    lantiq,output = <1>;
                    lantiq,open-drain = <1>;
                };
                usb_pwr {
                    lantiq,pins = "io9";
                    lantiq,pull = <0>;
                    lantiq,open-drain = <1>;
                    lantiq,output = <1>;
                };
            };

Together with:

    gpio-keys-polled {
        compatible = "gpio-keys-polled";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <100>;

        wps {
            label = "wps";
            gpios = <&gpio 28 1>;
            linux,code = <0x211>;
        };
        reset {
            label = "reset";
            gpios = <&gpio 31 1>;
            linux,code = <0x198>;
        };

        };

    /* LEDs as silkscreened on PCB */
    gpio-leds {
        compatible = "gpio-leds";

        rot1 {
            label = "power";
            gpios = <&gpio 0 0>;
        };
        ws1 {
            label = "wireless_on";
            gpios = <&gpio 19 0>;
        };
        usb1 {
            label = "storage1";
            gpios = <&gpio 5 0>;
        };
        usb2 {
            label = "storage2";
            gpios = <&gpio 6 0>;
        };
        wir1 {
            label = "wired1";
            gpios = <&gpio 8 0>;
        };
        wir2 {
            label = "wired2";
            gpios = <&gpio 20 0>;
        };
        wnb1 {
            label = "wireless1";
            gpios = <&gpio 10 0>;
        };
        wnb2 {
            label = "wireless2";
            gpios = <&gpio 7 0>;
        };
        sec1 {
            label = "wps1";
            gpios = <&gpio 26 0>;
        };
        sec2 {
            label = "wps2";
            gpios = <&gpio 29 0>;
        };
        ds1 {
            label = "dataspeed1";
            gpios = <&gpio 2 0>;
        };
        ds2 {
            label = "dataspeed2";
            gpios = <&gpio 15 0>;
        };
        ds3 {
            label = "dataspeed3";
            gpios = <&gpio 18 0>;
        };
        ds4 {
            label = "dataspeed4";
            gpios = <&gpio 11 0>;
        };
        ds5 {
            label = "dataspeed5";
            gpios = <&gpio 12 0>;
        };
        mod1 {
            label = "modem1";
            gpios = <&gpio 25 0>;
        };
        mod2 {
            label = "modem2";
            gpios = <&gpio 13 0>;
        };
        int1 {
            label = "internet1";
            gpios = <&gpio 27 0>;
        };
        int2 {
            label = "internet2";
            gpios = <&gpio 30 0>;
        };
    };

Note that the only pullup (or pulldown) related to these pins, which was configured in the factory firmware is the 'reset' button. All of the LEDs light up, but are active low, so in openwrt they are inverted. My understanding of the OF bindings for GPIO, is that it is the responsibility of the pinmux controller to indicate active high or low, but I can't work out how it works.

Hi, did you make progress with this. I would like to make an OpenWRT image for my Belkin F5D8635-V4 also, but am unsure how to proceed. Can you provide me any pointers ?

Thanks,
JJ

I haven't given up on it, but I started looking at more recent Lantiq Xway routers (BT HomeHub 3A and 5A). The Belkin router is still sat under my desk with a serial console wired up.

I should still have the build tree on my laptop, I just haven't looked at it for a few months. IIRC I had the GPIOs/LEDs mapped out in full and everything sorta working except the switch IC, but that would only affect VLAN support.

I never tried the ADSL support, but I have no reason to suspect it wouldn't work.

I had planned to wire a MMC/SD card slot into the (rather useless) download speed LEDs, as they have dedicated GPIOs.

I just got the switch working by adding CONFIG_IP17XX_PHY=y to

target/linux/lantiq/xway/config-default

and ensuring kernel module support (CONFIG_PACKAGE_kmod-switch-ip17xx) is disabled in .config.

The switch PHY driver needs to be compiled into the kernel, as otherwise it isn't loaded in time, and the Generic PHY driver never lets go of the device.

The discussion might have continued from here.