Commit 2e5f44213fd55ca53c3751061e19b0c54857900b
Committed by
Albert ARIBAUD
1 parent
9e27e9dca1
Exists in
master
and in
54 other branches
FEC: Allow registering MII postconfiguration callback
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Ben Warren <biggerbadderben@gmail.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Detlev Zundel <dzu@denx.de>
Showing 3 changed files with 19 additions and 1 deletions Side-by-side Diff
drivers/net/fec_mxc.c
... | ... | @@ -153,6 +153,7 @@ |
153 | 153 | static int miiphy_restart_aneg(struct eth_device *dev) |
154 | 154 | { |
155 | 155 | struct fec_priv *fec = (struct fec_priv *)dev->priv; |
156 | + int ret = 0; | |
156 | 157 | |
157 | 158 | /* |
158 | 159 | * Wake up from sleep if necessary |
... | ... | @@ -173,7 +174,11 @@ |
173 | 174 | LPA_10HALF | PHY_ANLPAR_PSB_802_3); |
174 | 175 | miiphy_write(dev->name, fec->phy_id, MII_BMCR, |
175 | 176 | BMCR_ANENABLE | BMCR_ANRESTART); |
176 | - return 0; | |
177 | + | |
178 | + if (fec->mii_postcall) | |
179 | + ret = fec->mii_postcall(fec->phy_id); | |
180 | + | |
181 | + return ret; | |
177 | 182 | } |
178 | 183 | |
179 | 184 | static int miiphy_wait_aneg(struct eth_device *dev) |
... | ... | @@ -785,5 +790,12 @@ |
785 | 790 | lout = fec_probe(bd, dev_id, phy_id, addr); |
786 | 791 | |
787 | 792 | return lout; |
793 | +} | |
794 | + | |
795 | +int fecmxc_register_mii_postcall(struct eth_device *dev, int (*cb)(int)) | |
796 | +{ | |
797 | + struct fec_priv *fec = (struct fec_priv *)dev->priv; | |
798 | + fec->mii_postcall = cb; | |
799 | + return 0; | |
788 | 800 | } |
drivers/net/fec_mxc.h
include/netdev.h
... | ... | @@ -186,5 +186,10 @@ |
186 | 186 | int mv88e61xx_switch_initialize(struct mv88e61xx_config *swconfig); |
187 | 187 | #endif /* CONFIG_MV88E61XX_SWITCH */ |
188 | 188 | |
189 | +/* | |
190 | + * Allow FEC to fine-tune MII configuration on boards which require this. | |
191 | + */ | |
192 | +int fecmxc_register_mii_postcall(struct eth_device *dev, int (*cb)(int)); | |
193 | + | |
189 | 194 | #endif /* _NETDEV_H_ */ |