Could not get PHY on uboot BBB like

Hello,

I have a custom Beagle Bone Black and I want to upgrade the old uboot from 2015.
I modified the dts.
I can read the 2 EEPROM but I’m stuck on ethernet now.
I add some logs to understand the problem. My phy addr is 1852793389, I tried to force it to 0 but it doesn’t work.
Here are the logs:

Net: _cpsw_register nb of slaves 1 host port 0
cpsw_slave_setup slave num 0 addr 1852793389
_cpsw_register priv slave dev_name ethernet@4a100000
cpsw_phy_init slave phy_addr : if 0 addr 0X6E6F622D phy speed 0
get_phy_device_by_mask :bus name ethernet@4a100000: phy_mask 0X0, interface 0
get_phy_device_by_mask: phydev null. devad_cnt 6
get_phy_device_by_mask: create_phy_by_mask
get_phy_device_by_mask: create_phy_by_mask
gev_phy_devise_by_mask: create_phy_by_mask
get_phy_device_by_mask: create_phy_by_mask
get_phy_device_by_mask: create_phy_by_mask
get_phy_device_by_mask: create_phy_by_mask

ethernet@4a100000 PHY: not found
phy_connect :Could not get PHY for ethernet@4a100000: addr 1852793389
eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
syntax error

In addition I remark that in the dtb file , the pins are not well defined, there are 3 values for one pin instead of 2:

cpsw_default {

pinctrl-single,pins = <0x110 0x30 0x00 0x114 0x00 0x00 0x118 0x30 0x00 0x11c 0x00 0x00 0x120 0x00 0x00 0x124 0x00 0x00 0x128 0x00 0x00 0x12c 0x30 0x00 0x130 0x30 0x00 0x134 0x30 0x00 0x138 0x30 0x00 0x13c 0x30 0x00 0x140 0x30 0x00>;
phandle = <0x56>;
};

instead of this on beagle bone:

cpsw_default {
pinctrl-single,pins = <0x110 0x30 0x114 0x00 0x118 0x30 0x11c 0x00 0x120 0x00 0x124 0x00 0x128 0x00 0x12c 0x30 0x130 0x30 0x134 0x30 0x138 0x30 0x13c 0x30 0x140 0x30>;
phandle = <0x46>;
};

I use this in my dts:

cpsw_default: cpsw_default {
pinctrl-single,pins = <
/* Slave 1 */
AM33XX_PADCONF(AM335X_PIN_MII1_RX_ER, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_TX_EN, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_RX_DV, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_TXD3, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_TXD2, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_TXD1, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_TXD0, PIN_OUTPUT_PULLDOWN, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_TX_CLK, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_RX_CLK, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_RXD3, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_RXD2, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_RXD1, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_MII1_RXD0, PIN_INPUT_PULLUP, MUX_MODE0)
>;
};

It seems that PADCONF doesn’t do the same thing with beagle bone and with my board.

Thanks for the help.

Regards.

I found that the syntax is not the same for dts for u-boot and dts for the kernel:
It has been changed
AM3352: Why does kernel’s am335x-evmsk.dts use AM33XX_PADCONF() instead of AM33XX_IOPAD() ? - Processors forum - Processors - TI E2E support forums

In addition do you know which dts file is used for beagle bone black?
am335x-bone-black.dts is the one for the kernel.
I use U-Boot 2022.04

In build-am335x.sh we have:
config=“am335x_evm_defconfig”
in am335x_evm_defconfig:
CONFIG_DEFAULT_DEVICE_TREE=“am335x-boneblack”

So it seems that am335x-boneblack.dts is used for u-boot but am335x-evm.dts seems to fit with u-boot.
So what is the answer?

In addition, the problem comes from the addr which is not 0 but 4144542D and when
cpsw_mdio_get_alive is called, the return value is 0 instead of 1.

I have configured the dts like that excatly like the one of BBB.
&cpsw_emac0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = “mii”;
};
&mac {
slaves = <1>;
pinctrl-names = “default”, “sleep”;
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
status = “okay”;
};

&davinci_mdio {
pinctrl-names = “default”, “sleep”;
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
status = “okay”;

ethphy0: ethernet-phy@0 {
	reg = <0>;
};

};
Address is always set to 0. I can’t find where phy_addr of the first slave is initialised.

Thanks for the help.