summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2015-11-07 20:02:07 +0000
committerWarner Losh <imp@FreeBSD.org>2015-11-07 20:02:07 +0000
commit56ea9c7b08fb18cf631f68586b0a784f1215f198 (patch)
treedc16307029d15faec6bccf6aa5895613de6bc55e
parent5d21db0905b00871753ff80051b837559d092708 (diff)
Notes
-rw-r--r--sys/arm/at91/if_macb.c9
-rw-r--r--sys/arm/at91/if_macbreg.h3
-rw-r--r--sys/arm/at91/if_macbvar.h4
-rw-r--r--sys/arm/conf/HL2014
-rw-r--r--sys/arm/conf/SAM9G20EK14
-rw-r--r--sys/conf/options.arm1
6 files changed, 27 insertions, 8 deletions
diff --git a/sys/arm/at91/if_macb.c b/sys/arm/at91/if_macb.c
index 6ad167ccb6804..7e411f57af4a2 100644
--- a/sys/arm/at91/if_macb.c
+++ b/sys/arm/at91/if_macb.c
@@ -25,6 +25,7 @@
*/
#include "opt_platform.h"
+#include "opt_at91.h"
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -1359,8 +1360,14 @@ macb_attach(device_t dev)
sc->clock = sc->clock << 10;
+#ifdef AT91_MACB_USE_RMII
+ sc->use_rmii = USRIO_RMII;
+#else
+ sc->use_rmii = read_4(sc, EMAC_USRIO) & USRIO_RMII;
+#endif
+
write_4(sc, EMAC_NCFGR, sc->clock);
- write_4(sc, EMAC_USRIO, USRIO_CLOCK); //enable clock
+ write_4(sc, EMAC_USRIO, USRIO_CLOCK | sc->use_rmii); //enable clock
write_4(sc, EMAC_NCR, MPE_ENABLE); //enable MPE
diff --git a/sys/arm/at91/if_macbreg.h b/sys/arm/at91/if_macbreg.h
index 163d79d61dacb..59cf17c4ab285 100644
--- a/sys/arm/at91/if_macbreg.h
+++ b/sys/arm/at91/if_macbreg.h
@@ -99,7 +99,8 @@
#define CFG_DRFCS (1 << 17)
-#define USRIO_CLOCK (1 << 1)
+#define USRIO_RMII (1 << 0) /* RMII vs MII pins */
+#define USRIO_CLOCK (1 << 1) /* Enable the clock! */
diff --git a/sys/arm/at91/if_macbvar.h b/sys/arm/at91/if_macbvar.h
index 4469b03cc48e2..662c71c3ff104 100644
--- a/sys/arm/at91/if_macbvar.h
+++ b/sys/arm/at91/if_macbvar.h
@@ -131,8 +131,8 @@ struct macb_softc
struct macb_chain_data macb_cdata;
int clock;
-};
-
+ uint32_t use_rmii; /* 0 or USRIO_RMII */
+};
#endif
diff --git a/sys/arm/conf/HL201 b/sys/arm/conf/HL201
index f10723570a1e0..d65766a66aa92 100644
--- a/sys/arm/conf/HL201
+++ b/sys/arm/conf/HL201
@@ -70,7 +70,7 @@ options DDB # Enable the kernel debugger
#options BOOTP_NFSROOT
#options BOOTP_COMPAT
#options BOOTP_NFSV3
-#options BOOTP_WIRED_TO=ate0
+#options BOOTP_WIRED_TO=macb0
options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\"
@@ -87,7 +87,7 @@ device bpf # Berkeley packet filter
# Ethernet
device mii # Minimal MII support
-device ate # Atmel AT91 Ethernet driver
+device macb # Atmel AT91 Ethernet driver
device lxtphy
# I2C
diff --git a/sys/arm/conf/SAM9G20EK b/sys/arm/conf/SAM9G20EK
index a6816ec7b1b7e..bd33e6bea0590 100644
--- a/sys/arm/conf/SAM9G20EK
+++ b/sys/arm/conf/SAM9G20EK
@@ -23,6 +23,14 @@ ident SAM9G20EK
include "std.arm"
include "../at91/std.sam9g20ek"
+#options FDT
+#options FDT_DTB_STATIC
+#makeoptions FDT_DTS_FILE=at91sam9g20ek.dts
+
+options EARLY_PRINTF
+options SOCDEV_PA=0xfc000000
+options SOCDEV_VA=0xdc000000
+
#To statically compile in device wiring instead of /boot/device.hints
hints "SAM9G20EK.hints"
makeoptions MODULES_OVERRIDE=""
@@ -92,8 +100,10 @@ device bpf # Berkeley packet filter
# Ethernet
device mii # Minimal MII support
-device ate # Atmel AT91 Ethernet driver
-options AT91_ATE_USE_RMII
+#device ate # Atmel AT91 Ethernet driver
+#options AT91_ATE_USE_RMII
+device macb # Atmel AT91 Ethernet driver
+options AT91_MACB_USE_RMII
# I2C
device at91_twi # Atmel AT91 Two-wire Interface
diff --git a/sys/conf/options.arm b/sys/conf/options.arm
index aee546a038636..ada11746f48d9 100644
--- a/sys/conf/options.arm
+++ b/sys/conf/options.arm
@@ -62,6 +62,7 @@ XSACLE_DISABLE_CCNT opt_timer.h
VERBOSE_INIT_ARM opt_global.h
VM_MAXUSER_ADDRESS opt_global.h
AT91_ATE_USE_RMII opt_at91.h
+AT91_MACB_USE_RMII opt_at91.h
AT91_MCI_ALLOW_OVERCLOCK opt_at91.h
AT91_MCI_HAS_4WIRE opt_at91.h
AT91_MCI_SLOT_B opt_at91.h