Symbol: OF_REAL [=y]
debug by adding #define DEBUG 1 before includes brings no additional debug-messages
can i print the current dts in uboot somehow? just to be sure the property still exists? but phy node is probed, so it should also find the property
it looks like the property is searched in the wrong node
PHY = 3a2 - a411
EN8811H PHY ready!
EN8811H Mode 1 !
ofnode_has_property airoha,rx-pol-reverse (is_np? 1)
of_find_property np:00000000bfaa25e0 airoha,rx-pol-reverse
of_find_property compatible == airoha,rx-pol-reverse?
of_find_property reg == airoha,rx-pol-reverse?
of_find_property resets == airoha,rx-pol-reverse?
of_find_property reset-names == airoha,rx-pol-reverse?
of_find_property mediatek,ethsys == airoha,rx-pol-reverse?
of_find_property mediatek,sgmiisys == airoha,rx-pol-reverse?
of_find_property #address-cells == airoha,rx-pol-reverse?
of_find_property #size-cells == airoha,rx-pol-reverse?
of_find_property status == airoha,rx-pol-reverse?
of_find_property pinctrl-names == airoha,rx-pol-reverse?
of_find_property pinctrl-0 == airoha,rx-pol-reverse?
of_find_property mediatek,gmac-id == airoha,rx-pol-reverse?
of_find_property phy-mode == airoha,rx-pol-reverse?
of_find_property phy-handle == airoha,rx-pol-reverse?
of_find_property phandle == airoha,rx-pol-reverse?
readbool: airoha,rx-pol-reverse false
Rx Polarity set in dts: 0
it searches in the eth node not the phy node…
so possibly this is wrong:
static int en8811h_config(struct phy_device *phydev)
{
ofnode node = phy_get_ofnode(phydev);
or this conversion in ofnode_has_property:
of_find_property(ofnode_to_np(node),…
@1715173329 have you an idea whats going on here or how i can debug this? I wonder why it is working in your build…which uboot version do you use (maybe new bug in 2024.01) maybe additional patches for of-functions or different parser (external fdt)?
if i skip the dt-property and set rx-reverse manually, and then it works once
BPI-R3M> setenv ipaddr 192.168.90.2
BPI-R3M> ping 192.168.90.1
Using ethernet@15100000 device
host 192.168.90.1 is alive
BPI-R3M> ping 192.168.90.1
Using ethernet@15100000 device
Abort
ping failed; host 192.168.90.1 is not alive
BPI-R3M>
so same as in your tests…after first usage it is stalled…and the of-handling is strange
@hackpascal have you an idea about the hang (and maybe the wrong node)?
@ericwoud: i think the function you pointed should not be used as phydev have already an ofnode
And so this should be used:
But need to check it
i tried to print the related information, but it is crashing
if (phydev->dev)
printf("%s devname: %s\n", __func__,phydev->dev->name);
if (node.np)
printf("%s nodename: %s\n", __func__, node.np->name);
seems crash is caused by node.np->name
but it turnes out that phy-device is already the ethernet-node
en8811h_config devname: ethernet@15100000
basicly i can use phy-handle to go to the linked phy, but wonder why config gets the parent node and it works with the ethernet-node (yes i know that the phy is connected over the mdio-bus of ethernet-controller)
did this and it seems to work:
struct ofnode_phandle_args node_args;
if (ret) {
printf("can't parse phy-handle (%d)\n",
ret);
} else node = node_args.node;
int rx_reverse=ofnode_read_bool(node, "airoha,rx-pol-reverse");
printf("Rx Polarity set in dts: %d\n", rx_reverse);
results in:
en8811h_config devname: ethernet@15100000
PHY = 3a2 - a411
EN8811H PHY ready!
EN8811H Mode 1 !
readbool: airoha,rx-pol-reverse true
Rx Polarity set in dts: 1
readbool: airoha,tx-pol-reverse false
Tx, Rx Polarity(0xca0f8) to be written: 01a01503
Tx, Rx Polarity(0xca0f8): 01a01503
MD32 FW Version(0x3b3c) : 23051209
LED initialize OK !
EN8811H initialize OK ! (v1.0.4)