Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131877016
D19814.id55788.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D19814.id55788.diff
View Options
Index: sys/arm/ti/cpsw/if_cpsw.c
===================================================================
--- sys/arm/ti/cpsw/if_cpsw.c
+++ sys/arm/ti/cpsw/if_cpsw.c
@@ -82,6 +82,8 @@
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
+
+#include <dev/fdt/fdt_common.h>
#ifdef CPSW_ETHERSWITCH
#include <dev/etherswitch/etherswitch.h>
@@ -742,9 +744,10 @@
phandle_t child;
unsigned long mdio_child_addr;
- /* Find any slave with phy_id */
+ /* Find any slave with phy-handle/phy_id */
phy = -1;
vlan = -1;
+
for (child = OF_child(sc->node); child != 0; child = OF_peer(child)) {
if (OF_getprop_alloc(child, "name", (void **)&name) < 0)
continue;
@@ -756,11 +759,15 @@
if (mdio_child_addr != slave_mdio_addr[port])
continue;
- len = OF_getproplen(child, "phy_id");
- if (len / sizeof(pcell_t) == 2) {
- /* Get phy address from fdt */
- if (OF_getencprop(child, "phy_id", phy_id, len) > 0)
- phy = phy_id[1];
+ if (fdt_get_phyaddr(child, NULL, &phy, NULL) != 0){
+ /* Users with old DTB will have phy_id instead */
+ phy = -1;
+ len = OF_getproplen(child, "phy_id");
+ if (len / sizeof(pcell_t) == 2) {
+ /* Get phy address from fdt */
+ if (OF_getencprop(child, "phy_id", phy_id, len) > 0)
+ phy = phy_id[1];
+ }
}
len = OF_getproplen(child, "dual_emac_res_vlan");
Index: sys/dev/fdt/fdt_common.c
===================================================================
--- sys/dev/fdt/fdt_common.c
+++ sys/dev/fdt/fdt_common.c
@@ -399,6 +399,9 @@
*phy_addr = phy_reg;
+ if (phy_sc == NULL)
+ return (0);
+
/*
* Search for softc used to communicate with phy.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 12, 9:53 PM (7 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23642604
Default Alt Text
D19814.id55788.diff (1 KB)
Attached To
Mode
D19814: Use 'phy-handle' in FDT to find PHY address
Attached
Detach File
Event Timeline
Log In to Comment