DTS:卸下节点以释放引脚

时间:2019-05-16 14:34:14

标签: linux linux-kernel hardware device-tree

我需要使用两个引脚,它们被标记为fec2的节点占用。我尝试使用/delete-node/ &fec2删除它,但这给了我一个编译错误,说没有这样的节点或标签。

我想删除fec2并将其mdio移至fec1,以便我的以太网连接仍然起作用。但是,当我尝试这样做时(请参见下面的示例),eth0将无法获得IP地址。

imx6ul.dtsi包含以下内容:

/ {
    soc {
        /* Some soc configs */

        aips1: aips-bus@02000000 {
            /* aips configs */

            fec2: ethernet@020b4000 {
                compatible = "fsl,imx6ul-fec", "fsl,imx6q-fec";
                reg = <0x020b4000 0x4000>;
                interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&clks IMX6UL_CLK_ENET>,
                     <&clks IMX6UL_CLK_ENET_AHB>,
                     <&clks IMX6UL_CLK_ENET_PTP>,
                     <&clks IMX6UL_CLK_ENET2_REF_125M>,
                     <&clks IMX6UL_CLK_ENET2_REF_125M>;
                clock-names = "ipg", "ahb", "ptp",
                          "enet_clk_ref", "enet_out";
                stop-mode = <&gpr 0x10 4>;
                fsl,num-tx-queues=<1>;
                fsl,num-rx-queues=<1>;
                fsl,magic-packet;
                fsl,wakeup_irq = <0>;
                status = "disabled";
            };
        };

        aips2: aips-bus@02100000 {
            /* aips configs */

            fec1: ethernet@02188000 {
                compatible = "fsl,imx6ul-fec", "fsl,imx6q-fec";
                reg = <0x02188000 0x4000>;
                interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&clks IMX6UL_CLK_ENET>,
                     <&clks IMX6UL_CLK_ENET_AHB>,
                     <&clks IMX6UL_CLK_ENET_PTP>,
                     <&clks IMX6UL_CLK_ENET_REF>,
                     <&clks IMX6UL_CLK_ENET_REF>;
                clock-names = "ipg", "ahb", "ptp",
                          "enet_clk_ref", "enet_out";
                stop-mode = <&gpr 0x10 3>;
                fsl,num-tx-queues=<1>;
                fsl,num-rx-queues=<1>;
                fsl,magic-packet;
                fsl,wakeup_irq = <0>;
                status = "disabled";
            };
        };
    };
};

imx6ul-imx6ull-common.dtsi包含以下覆盖:

&fec1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet1>;
    phy-mode = "rmii";
    phy-reset-gpios=<&gpio5 0 1>;
    phy-reset-duration=<100>;
    phy-reset-on-resume;
    phy-handle = <&ethphy0>;
    status = "okay";
};

&fec2 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet2>;
    phy-mode = "rmii";
    phy-handle = <&ethphy1>;
    phy-reset-gpios=<&gpio1 10 1>;
    phy-reset-duration=<100>;
    phy-reset-on-resume;
    status = "okay";
    mdio {
        #address-cells = <1>;
        #size-cells = <0>;

        ethphy0: ethernet-phy@1 {
            compatible = "ethernet-phy-ieee802.3-c22";
            micrel,rmii-reference-clock-select-25-mhz;
            clocks = <&rmii_ref_clk>;
            clock-names = "rmii-ref";
            reg = <1>;
        };

        ethphy1: ethernet-phy@3 {
            compatible = "ethernet-phy-ieee802.3-c22";
            micrel,rmii-reference-clock-select-25-mhz;
            clocks = <&rmii_ref_clk>;
            clock-names = "rmii-ref";
            reg = <3>;
        };
    };
};

我的device.dts包含以下内容:

#include "imx6ul.dtsi"
#include "imx6ul-imx6ull-var-dart-common.dtsi"

/* Disable the second ethernet port and remove the mdio for use in fec1 */
&fec2 {
    status = "disabled";
    /delete-node/ mdio;
};

/* Add the mdio to the fec1 interface */
&fec1 {
    mdio {
        #address-cells = <1>;
        #size-cells = <0>;

        ethphy0: ethernet-phy@1 {
            compatible = "ethernet-phy-ieee802.3-c22";
            micrel,rmii-reference-clock-select-25-mhz;
            clocks = <&rmii_ref_clk>;
            clock-names = "rmii-ref";
            reg = <1>;
        };

        ethphy1: ethernet-phy@3 {
            compatible = "ethernet-phy-ieee802.3-c22";
            micrel,rmii-reference-clock-select-25-mhz;
            clocks = <&rmii_ref_clk>;
            clock-names = "rmii-ref";
            reg = <3>;
        };
    };
};

我希望我的以太网连接仍然有效,并且fec2将被删除。

0 个答案:

没有答案