summaryrefslogtreecommitdiffstats
path: root/sys/dev/etherswitch/arswitch/arswitch_7240.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-05-12 21:08:07 +0000
committeradrian <adrian@FreeBSD.org>2012-05-12 21:08:07 +0000
commit75fa27bcfce0da47ad015b3aca358721443edce1 (patch)
tree4bbe52910af9fc72f5317c4608ad5a5b502740a5 /sys/dev/etherswitch/arswitch/arswitch_7240.c
parent567e856364e9a6c28ce5aa474be3a80885480ce5 (diff)
downloadFreeBSD-src-75fa27bcfce0da47ad015b3aca358721443edce1.zip
FreeBSD-src-75fa27bcfce0da47ad015b3aca358721443edce1.tar.gz
Setup the CPU port and broadcast map on the AR7240, rather than
depending upon the bootloader initialising it. The aim is to eventually support a full switch set and reinitialisation rather than relying on a consistent bootloader setup. Remove the port flood config from arswitch.c, it's not yet used and it's totally incorrect. Whilst I'm here, also add in a comment describing why the full switch reset is disabled. Obtained from: Linux (OpenWRT) - Values
Diffstat (limited to 'sys/dev/etherswitch/arswitch/arswitch_7240.c')
-rw-r--r--sys/dev/etherswitch/arswitch/arswitch_7240.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/etherswitch/arswitch/arswitch_7240.c b/sys/dev/etherswitch/arswitch/arswitch_7240.c
index 8809e07..c8f6426 100644
--- a/sys/dev/etherswitch/arswitch/arswitch_7240.c
+++ b/sys/dev/etherswitch/arswitch/arswitch_7240.c
@@ -64,10 +64,6 @@
#include "miibus_if.h"
#include "etherswitch_if.h"
-/* XXX belongs in arswitch_7240_reg.h */
-
-#define AR7240_REG_TAG_PRIORITY 0x70
-
/*
* AR7240 specific functions
*/
@@ -96,14 +92,20 @@ ar7240_hw_global_setup(struct arswitch_softc *sc)
{
/* Setup TAG priority mapping */
- arswitch_writereg(sc->sc_dev, AR7240_REG_TAG_PRIORITY, 0xfa50);
+ arswitch_writereg(sc->sc_dev, AR8X16_REG_TAG_PRIO, 0xfa50);
+
+ /* Enable broadcast frames transmitted to the CPU */
+ arswitch_writereg(sc->sc_dev, AR8X16_REG_FLOOD_MASK,
+ AR8X16_FLOOD_MASK_BCAST_TO_CPU | 0x003f003f);
- /* MTU */
+ /* Setup MTU */
arswitch_modifyreg(sc->sc_dev, AR8X16_REG_GLOBAL_CTRL,
AR7240_GLOBAL_CTRL_MTU_MASK,
SM(1536, AR7240_GLOBAL_CTRL_MTU_MASK));
- /* XXX Service Tag */
+ /* Service Tag */
+ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG,
+ AR8X16_SERVICE_TAG_MASK, 0);
return (0);
}
OpenPOWER on IntegriCloud