arm64: dts: qcom: sa8155p-adp: Enable ethernet node
authorVinod Koul <vkoul@kernel.org>
Fri, 25 Mar 2022 16:35:37 +0000 (22:05 +0530)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 12 Apr 2022 14:21:16 +0000 (09:21 -0500)
Enable the ethernet node, add the phy node and pinctrl for ethernet.

[bhsharma: Correct ethernet/rgmii related pinmuxs, specify multi-queues and
 plug in the PHY interrupt for WOL]

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220325163537.1579969-3-bhupesh.sharma@linaro.org
arch/arm64/boot/dts/qcom/sa8155p-adp.dts

index 8e78112..8034d0d 100644 (file)
 
                vin-supply = <&vreg_3p3>;
        };
+
+       mtl_rx_setup: rx-queues-config {
+               snps,rx-queues-to-use = <4>;
+               snps,rx-sched-sp;
+
+               queue0 {
+                       snps,dcb-algorithm;
+                       snps,map-to-dma-channel = <0x0>;
+                       snps,route-up;
+                       snps,priority = <0x1>;
+               };
+
+               queue1 {
+                       snps,dcb-algorithm;
+                       snps,map-to-dma-channel = <0x1>;
+                       snps,route-ptp;
+               };
+
+               queue2 {
+                       snps,avb-algorithm;
+                       snps,map-to-dma-channel = <0x2>;
+                       snps,route-avcp;
+               };
+
+               queue3 {
+                       snps,avb-algorithm;
+                       snps,map-to-dma-channel = <0x3>;
+                       snps,priority = <0xC>;
+               };
+       };
+
+       mtl_tx_setup: tx-queues-config {
+               snps,tx-queues-to-use = <4>;
+               snps,tx-sched-wrr;
+
+               queue0 {
+                       snps,weight = <0x10>;
+                       snps,dcb-algorithm;
+                       snps,priority = <0x0>;
+               };
+
+               queue1 {
+                       snps,weight = <0x11>;
+                       snps,dcb-algorithm;
+                       snps,priority = <0x1>;
+               };
+
+               queue2 {
+                       snps,weight = <0x12>;
+                       snps,dcb-algorithm;
+                       snps,priority = <0x2>;
+               };
+
+               queue3 {
+                       snps,weight = <0x13>;
+                       snps,dcb-algorithm;
+                       snps,priority = <0x3>;
+               };
+       };
 };
 
 &apps_rsc {
        };
 };
 
+&ethernet {
+       status = "okay";
+
+       snps,reset-gpio = <&tlmm 79 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 11000 70000>;
+
+       snps,ptp-ref-clk-rate = <250000000>;
+       snps,ptp-req-clk-rate = <96000000>;
+
+       snps,mtl-rx-config = <&mtl_rx_setup>;
+       snps,mtl-tx-config = <&mtl_tx_setup>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&ethernet_defaults>;
+
+       phy-handle = <&rgmii_phy>;
+       phy-mode = "rgmii";
+       max-speed = <1000>;
+
+       mdio {
+               #address-cells = <0x1>;
+               #size-cells = <0x0>;
+
+               compatible = "snps,dwmac-mdio";
+
+               /* Micrel KSZ9031RNZ PHY */
+               rgmii_phy: phy@7 {
+                       reg = <0x7>;
+
+                       interrupt-parent = <&tlmm>;
+                       interrupts-extended = <&tlmm 124 IRQ_TYPE_EDGE_FALLING>; /* phy intr */
+                       device_type = "ethernet-phy";
+                       compatible = "ethernet-phy-ieee802.3-c22";
+               };
+       };
+};
+
 &qupv3_id_1 {
        status = "okay";
 };
                        drive-strength = <2>;
                };
        };
+
+       ethernet_defaults: ethernet-defaults {
+               mdc {
+                       pins = "gpio7";
+                       function = "rgmii";
+                       bias-pull-up;
+               };
+
+               mdio {
+                       pins = "gpio59";
+                       function = "rgmii";
+                       bias-pull-up;
+               };
+
+               rgmii-rx {
+                       pins = "gpio117", "gpio118", "gpio119", "gpio120", "gpio115", "gpio116";
+                       function = "rgmii";
+                       bias-disable;
+                       drive-strength = <2>;
+               };
+
+               rgmii-tx {
+                       pins = "gpio122", "gpio4", "gpio5", "gpio6", "gpio114", "gpio121";
+                       function = "rgmii";
+                       bias-pull-up;
+                       drive-strength = <16>;
+               };
+
+               phy-intr {
+                       pins = "gpio124";
+                       function = "emac_phy";
+                       bias-disable;
+                       drive-strength = <8>;
+               };
+
+               pps {
+                       pins = "gpio81";
+                       function = "emac_pps";
+                       bias-disable;
+                       drive-strength = <8>;
+               };
+
+               phy-reset {
+                       pins = "gpio79";
+                       function = "gpio";
+                       bias-pull-up;
+                       drive-strength = <16>;
+               };
+       };
 };