Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom Don't hard code the frequency used for...



details:   https://anonhg.NetBSD.org/src/rev/1d6598143c50
branches:  trunk
changeset: 783865:1d6598143c50
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jan 10 22:07:19 2013 +0000

description:
Don't hard code the frequency used for INTRCVLAZY but grab the correct
frequency from the cpu_softc.

diffstat:

 sys/arch/arm/broadcom/bcm53xx_eth.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r 9b7f86e4f74b -r 1d6598143c50 sys/arch/arm/broadcom/bcm53xx_eth.c
--- a/sys/arch/arm/broadcom/bcm53xx_eth.c       Thu Jan 10 22:06:59 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_eth.c       Thu Jan 10 22:07:19 2013 +0000
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.21 2013/01/09 18:19:09 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.22 2013/01/10 22:07:19 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -551,8 +551,9 @@
        bcmeth_write_4(sc, GMAC_DEVCONTROL, devctl);
 
        /* Setup lazy receive (at most 1ms). */
+       const struct cpu_softc * const cpu = curcpu()->ci_softc;
        sc->sc_rcvlazy =  __SHIFTIN(4, INTRCVLAZY_FRAMECOUNT)
-            | __SHIFTIN(125000000 / 1000, INTRCVLAZY_TIMEOUT);
+            | __SHIFTIN(cpu->cpu_clk.clk_apb / 1000, INTRCVLAZY_TIMEOUT);
        bcmeth_write_4(sc, GMAC_INTRCVLAZY, sc->sc_rcvlazy);
 
        /* 11. Enable transmit queues in TQUEUE, and ensure that the transmit scheduling mode is correctly set in TCTRL. */



Home | Main Index | Thread Index | Old Index