According to "board-ipq806x-gpiomux.c" GPL Tp-Link file, also GPIO2 and 66 should be involved to have the internal ethernet working:
#ifdef CONFIG_TP_IMAGE
static struct msm_gpiomux_config ipq806x_tp_gpiomux[] = {
ipq_mux( 0, mdio_n, mdio_n),
ipq_mux( 1, mdio_n, mdio_n),
ipq_mux( 2, nss_gmac0_rgmii_set1, nss_gmac0_rgmii_set1),
....
ipq_mux(66, nss_gmac0_rgmii_set2, nss_gmac0_rgmii_set2),
};
#endif
static struct gpiomux_setting nss_gmac0_rgmii_set1 = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_16MA,
.pull = GPIOMUX_PULL_NONE,
};
#ifdef CONFIG_TP_IMAGE
static struct gpiomux_setting nss_gmac0_rgmii_set2 = {
.func = GPIOMUX_FUNC_GPIO,
.drv = GPIOMUX_DRV_16MA,
.pull = GPIOMUX_PULL_UP,
};
#endif
So I edited my dts like this:
Before rgmii2_pins: rgmii2_pins {
rgmii1_pins: rgmii1_pins {
set_1 {
pins = "gpio2" ;
function = "gpio";
drive-strength = <16>;
bias-disable;
};
set_2 {
pins = "gpio66";
function = "gpio";
drive-strength = <16>;
bias-pull-up;
};
};
And before "gmac1: ethernet@37200000": {
gmac0: ethernet@37000000 {
status = "ok";
phy-mode = "rgmii";
qcom,id = <0>;
pinctrl-0 = <&rgmii1_pins>;
pinctrl-names = "default";
mtd-mac-address = <&defaultmac 0>;
mtd-mac-address-increment = <2>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
However I got always the same error:
[ 25.202588] ipq806x-gmac-dwmac 37000000.ethernet: Failed to reset the dma
[ 25.204544] ipq806x-gmac-dwmac 37000000.ethernet eth0: stmmac_hw_setup: DMA e
ngine initialization failed
[ 25.211226] ipq806x-gmac-dwmac 37000000.ethernet eth0: stmmac_open: Hw setup
failed
BUT my VR2600 has the Broadcom part not working (the stock firmware hangs during the boot), so these changes could work using a fully functional unit!