Skip to contentSkip to conversation

net: execute "miiphy_init" if CONFIG_PHYLIB defined

PATCH In review Alexey Brodkin 3 participants 3 messages Jan 10, 2014 – Feb 7, 2014 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: execute "miiphy_init" if CONFIG_PHYLIB defined

In "common/Makefile" "miiphyutil.o" gets built if any of the following items enabled:
* CONFIG_PHYLIB
* CONFIG_MII
* CONFIG_CMD_MII

So it's possible to not define CONFIG_MII or CONFIG_CMD_MII and still use functions like "miiphy_get_dev_by_name".

In its turn "miiphy_get_dev_by_name" traverses "mii_devs" list which is not initialized because "miiphy_init" never got called.

Cc Joe Hershberger <[email protected]>
Cc Rob Herring <[email protected]>
Cc Simon Glass <[email protected]>
Cc Wolfgang Denk <[email protected]>
---
 net/eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/eth.c +1 -1
index c96e767..32bd10c 100644
@@ -279,7 +279,7 @@ int eth_initialize(bd_t *bis)
 	eth_current = NULL;
 
 	bootstage_mark(BOOTSTAGE_ID_NET_ETH_START);
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
 	miiphy_init();
 #endif
 
Signature · 1 line
1.8.4.2
#1 lore raw

PATCH 1/1 net: execute "miiphy_init" if CONFIG_PHYLIB defined

Quoted 12 lines · Alexey Brodkin

In "common/Makefile" "miiphyutil.o" gets built if any of the following items enabled:
* CONFIG_PHYLIB
* CONFIG_MII
* CONFIG_CMD_MII

So it's possible to not define CONFIG_MII or CONFIG_CMD_MII and still use functions like "miiphy_get_dev_by_name".

In its turn "miiphy_get_dev_by_name" traverses "mii_devs" list which is not initialized because "miiphy_init" never got called.

Quoted 7 lines
Cc Joe Hershberger <[email protected]>
Cc Rob Herring <[email protected]>
Cc Simon Glass <[email protected]>
Cc Wolfgang Denk <[email protected]>

---

#2 lore raw
In reply to Alexey Brodkin
Quoted 12 lines · Alexey Brodkin

In "common/Makefile" "miiphyutil.o" gets built if any of the following items enabled:
* CONFIG_PHYLIB
* CONFIG_MII
* CONFIG_CMD_MII

So it's possible to not define CONFIG_MII or CONFIG_CMD_MII and still use functions like "miiphy_get_dev_by_name".

In its turn "miiphy_get_dev_by_name" traverses "mii_devs" list which is not initialized because "miiphy_init" never got called.

Quoted 7 lines
Cc Joe Hershberger <[email protected]>
Cc Rob Herring <[email protected]>
Cc Simon Glass <[email protected]>
Cc Wolfgang Denk <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140207/886cad46/attachment.pgp>