Skip to content

Commit

Permalink
ipq806x: Ethernet interface fixes for AP3935
Browse files Browse the repository at this point in the history
Some fixes to Ethernet interfaces on top of openwrt#13030.

* Fix LAN1 fixed-link issue by wiring up pins in DTS, setting rgmii-id
mode. Without this, rgmii mode alone doesn't work bidirectionally.
With this commit applied, the LAN1 interface autonegotiates properly
and works great.

Signed-off-by: Bryan Berg <[email protected]>
  • Loading branch information
berg committed May 14, 2024
1 parent eb1b022 commit daaaa14
Showing 1 changed file with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
aliases {
serial0 = &gsbi7_serial;
serial1 = &gsbi2_serial;
mdio-gpio0 = &mdio0;
ethernet0 = &gmac0;
ethernet1 = &gmac2;

Expand Down Expand Up @@ -125,8 +124,7 @@

led_pins: led_pins {
mux {
pins = "gpio22", "gpio23", "gpio24", "gpio25",
"gpio26", "gpio27", "gpio28", "gpio29";
pins = "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29";
function = "gpio";
drive-strength = <10>;
bias-pull-up;
Expand All @@ -140,6 +138,21 @@
bias-pull-up;
};
};

rgmii0_pins: rgmii0_pins {
mux {
pins = "gpio2", "gpio66";
drive-strength = <8>;
bias-disable;
};

tx {
pins = "gpio53", "gpio64";
drive-strength = <2>;
bias-pull-down;
input-enable;
};
};
};

&gsbi2 {
Expand Down Expand Up @@ -290,7 +303,7 @@
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

ubi@0 {
label = "ubi";
reg = <0x0000000 0x20000000>;
Expand All @@ -299,52 +312,39 @@
};
};

&soc {
mdio1: mdio {
compatible = "virtual,mdio-gpio";
#address-cells = <1>;
#size-cells = <0>;

status = "okay";

pinctrl-0 = <&mdio0_pins>;
pinctrl-names = "default";

gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
&mdio0 {
status = "okay";

phy1: ethernet-phy@1 {
reg = <1>;
};
phy1: ethernet-phy@1 {
reg = <1>;
};

phy2: ethernet-phy@2 {
reg = <2>;
};
phy2: ethernet-phy@2 {
reg = <2>;
};
};

&gmac0 {
status = "okay";

qcom,id = <0>;
mdiobus = <&mdio1>;
mdiobus = <&mdio0>;

pinctrl-0 = <&rgmii0_pins>;
pinctrl-names = "default";

phy-mode = "rgmii";
phy-mode = "rgmii-id";
phy-handle = <&phy1>;

nvmem-cells = <&ethaddr 0>;
nvmem-cell-names = "mac-address";

fixed-link {
speed = <1000>;
full-duplex;
};
};

&gmac2 {
status = "okay";

qcom,id = <2>;
mdiobus = <&mdio1>;
mdiobus = <&mdio0>;

phy-mode = "sgmii";
phy-handle = <&phy2>;
Expand Down

0 comments on commit daaaa14

Please sign in to comment.