diff --git a/sys/arm/at91/if_macb.c b/sys/arm/at91/if_macb.c index 6ad167ccb680..7e411f57af4a 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 __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 163d79d61dac..59cf17c4ab28 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 4469b03cc48e..662c71c3ff10 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 f10723570a1e..d65766a66aa9 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 a6816ec7b1b7..bd33e6bea059 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 aee546a03863..ada11746f48d 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