net: fec_imx: ensure constant timeout in fec_halt
Subsystems (2)
PATCH 1/2 net: fec_imx: ensure constant timeout in fec_halt
Signed-off-by Hubert Feurstein <[email protected]>
--- drivers/net/fec_imx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/fec_imx.c +8 -3
@@ -425,15 +425,20 @@ static int fec_open(struct eth_device *edev)static void fec_halt (struct eth_device *dev) {struct fec_priv *fec = (struct fec_priv *)dev->priv; -int counter =0xffff ; +uint64_t tmo;/* issue graceful stop command to the FEC transmitter if necessary */ writel (readl (fec->regs +FEC_X_CNTRL ) |FEC_ECNTRL_RESET , fec->regs +FEC_X_CNTRL );/* wait for graceful stop to register */ -while ((counter--) && (!(readl (fec->regs +FEC_IEVENT ) &FEC_IEVENT_GRA ))) - ;/* FIXME ensure time */ + tmo =get_time_ns (); +while (!(readl (fec->regs +FEC_IEVENT ) &FEC_IEVENT_GRA )) { +if (is_timeout (tmo,1 *SECOND )) { +printf ("graceful stop timeout\n" ); +break ; + } + }/* Disable SmartDMA tasks */ fec_tx_task_disable (fec);
Signature · 7 lines
1.8.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/2 net: imx_fec: fix RMII support for i.MX6
Signed-off-by Hubert Feurstein <[email protected]>
--- drivers/net/fec_imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/fec_imx.c +1 -1
@@ -309,7 +309,7 @@ static int fec_init(struct eth_device *dev) }if (fec->xcv_type ==RMII ) { -if (fec_is_imx28 (fec)) { +if (fec_is_imx28 (fec) ||fec_is_imx6 (fec)) { rcntl |=FEC_R_CNTRL_RMII_MODE |FEC_R_CNTRL_FCE |FEC_R_CNTRL_NO_LGTH_CHECK ; }else {
Signature · 7 lines
1.8.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerQuoted 17 lines · Hubert Feurstein
Signed-off-by Hubert Feurstein <[email protected]>--- drivers/net/fec_imx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)drivers/net/fec_imx.c +1
-1@@ -425,15 +425,20 @@ static int fec_open(struct eth_device *edev)static void fec_halt (struct eth_device *dev) {struct fec_priv *fec = (struct fec_priv *)dev->priv; -int counter =0xffff ; +uint64_t tmo;/* issue graceful stop command to the FEC transmitter if necessary */
drivers/net/fec_imx.c static int fec_open(struct eth_device *edev) · line 438
Quoted 10 lines
drivers/net/fec_imx.c +4
-2writel (readl (fec->regs +FEC_X_CNTRL ) |FEC_ECNTRL_RESET , fec->regs +FEC_X_CNTRL );/* wait for graceful stop to register */ -while ((counter--) && (!(readl (fec->regs +FEC_IEVENT ) &FEC_IEVENT_GRA ))) - ;/* FIXME ensure time */ + tmo =get_time_ns (); +while (!(readl (fec->regs +FEC_IEVENT ) &FEC_IEVENT_GRA )) { +if (is_timeout (tmo,1 *SECOND )) { +printf ("graceful stop timeout\n" );
dev_err please.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 2/2] net: imx_fec: fix RMII support for i.MX6
In reply to Hubert FeursteinQuoted 1 line · Hubert Feurstein
Signed-off-by Hubert Feurstein <[email protected]>
Applied (only this one)
Sascha
Quoted 26 lines
--- drivers/net/fec_imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/fec_imx.c +1
-1@@ -309,7 +309,7 @@ static int fec_init(struct eth_device *dev) }if (fec->xcv_type ==RMII ) { -if (fec_is_imx28 (fec)) { +if (fec_is_imx28 (fec) ||fec_is_imx6 (fec)) { rcntl |=FEC_R_CNTRL_RMII_MODE |FEC_R_CNTRL_FCE |FEC_R_CNTRL_NO_LGTH_CHECK ; }else {Signature · 7 lines
1.8.1.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox