For an iMX91 processor I fail to initialize the FEC ethernet.
1st in the .dtsi
&lpi2c3 {
bootph-pre-ram;
bootph-some-ram;
pca95x: gpio@38 {
compatible = "nxp,pca9554";
reg = <0x38>;
pinctrl-names = "default";
gpio-controller;
};
};
&fec {
compatible = "fsl,imx91-fec", "fsl,imx93-fec", "fsl,imx8mq-fec";
phy-reset-gpios = <&pca95x 1 GPIO_ACTIVE_LOW>;
phy-reset-duration = <15>;
phy-reset-post-delay = <100>;
};
Then in the .dts
/* Ethernet device */
&fec {
phy-handle = <ðphy1>;
phy-mode = "rgmii";
pinctrl-0 = <&pinctrl_fec>;
pinctrl-1 = <&pinctrl_fec_sleep>;
pinctrl-names = "default", "sleep";
status = "okay";
compatible = "qca,qca8337";
reset-gpios = <&pca9554 1 GPIO_ACTIVE_LOW>; // pin number 1 on mux PCA9554
reg = <0x10>;
ports {
#address-cells = <1>;
#size-cells = <0>;
ethphy1: ethernet-phy@2 {
reg = <0>;
label = "cpu";
// ethernet = <&gmac0>; // to do
phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
};
};
};
};
In have the uboot debug enable for gpio-uclass.c and see in the console
gpio_request_tail: Node 'ethernet@42890000', property 'phy-reset-gpios', failed to request GPIO index 0: -16
FEC MXC: Timeout resetting chip
So it look like configuration for the 'phy-reset-gpios' is not correct
And the Timeout from the reset...
Later uin uboot I get
Warning: ethernet@42890000 (eth0) using random MAC address - 6a:f5:a4:67:87:8d
eth0: ethernet@42890000
but trying a dhcp result in a coredump.
Any hints are welcome.
I also tried the dts example code like this, but that gives even more errors like `Could not get PHY for FEC0: addr 16`
&fec {
phy-mode = "rgmii";
pinctrl-0 = <&pinctrl_fec>;
pinctrl-1 = <&pinctrl_fec_sleep>;
pinctrl-names = "default", "sleep";
fsl,magic-packet;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <2500000>;
switch@10 {
compatible = "qca,qca8337";
reg = <0x10>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "cpu";
ethernet = <&fec>;
phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
};
};
};
};
};
};