summaryrefslogtreecommitdiff
path: root/sys/arch/octeon/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/octeon/dev')
-rw-r--r--sys/arch/octeon/dev/cn30xxpipreg.h5
-rw-r--r--sys/arch/octeon/dev/if_cnmac.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/arch/octeon/dev/cn30xxpipreg.h b/sys/arch/octeon/dev/cn30xxpipreg.h
index 32ba5ba12ee..95b3268e91c 100644
--- a/sys/arch/octeon/dev/cn30xxpipreg.h
+++ b/sys/arch/octeon/dev/cn30xxpipreg.h
@@ -3,7 +3,7 @@
* DONT EDIT THIS FILE
*/
-/* $OpenBSD: cn30xxpipreg.h,v 1.2 2014/08/11 18:29:56 miod Exp $ */
+/* $OpenBSD: cn30xxpipreg.h,v 1.3 2015/10/28 14:00:34 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -272,7 +272,8 @@
#define PIP_GBL_CFG_15_11 0x000000000000f800ULL
#define PIP_GBL_CFG_RAW_SHF 0x0000000000000700ULL
#define PIP_GBL_CFG_7_3 0x00000000000000f8ULL
-#define PIP_GBL_CFG_NIP_SHF 0x0000000000000007ULL
+#define PIP_GBL_CFG_NIP_SHF_MASK 0x0000000000000007ULL
+#define PIP_GBL_CFG_NIP_SHF_SHIFT 0
/*
* PIP_SFT_RST
diff --git a/sys/arch/octeon/dev/if_cnmac.c b/sys/arch/octeon/dev/if_cnmac.c
index a94cddb28f4..661020056e9 100644
--- a/sys/arch/octeon/dev/if_cnmac.c
+++ b/sys/arch/octeon/dev/if_cnmac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cnmac.c,v 1.27 2015/10/25 13:22:09 mpi Exp $ */
+/* $OpenBSD: if_cnmac.c,v 1.28 2015/10/28 14:00:34 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -1201,6 +1201,8 @@ octeon_eth_configure_common(struct octeon_eth_softc *sc)
{
static int once;
+ uint64_t reg;
+
if (once == 1)
return 0;
once = 1;
@@ -1214,6 +1216,12 @@ octeon_eth_configure_common(struct octeon_eth_softc *sc)
cn30xxpow_config(sc->sc_pow, OCTEON_POW_GROUP_PIP);
+ /* Set padding for packets that Octeon does not recognize as IP. */
+ reg = octeon_xkphys_read_8(PIP_GBL_CFG);
+ reg &= ~PIP_GBL_CFG_NIP_SHF_MASK;
+ reg |= ETHER_ALIGN << PIP_GBL_CFG_NIP_SHF_SHIFT;
+ octeon_xkphys_write_8(PIP_GBL_CFG, reg);
+
return 0;
}