Index: head/sys/mips/conf/RT3883_FDT
===================================================================
--- head/sys/mips/conf/RT3883_FDT	(revision 300658)
+++ head/sys/mips/conf/RT3883_FDT	(revision 300659)
@@ -1,78 +1,82 @@
 #
 # RT3883_FDT -- Kernel configuration file for FreeBSD/MIPS RT3662 and RT3883
 # SoCs
 #
 # This includes all the configurable parts of the kernel.
 #
 # $FreeBSD$
 #
 
 #NO_UNIVERSE
 
 #
 # FDT_DTS_FILE should be modified to suit the target board type.
 #
 #makeoptions 	FDT_DTS_FILE=DIR-645.dts
 
 # Start with a base configuration
 include 	"../mediatek/std.mediatek"
 
 ident 		RT3883
 cpu 		CPU_MIPS74K
 
 # Don't build any modules by default
 makeoptions 	MODULES_OVERRIDE=""
 
 # Default rootfs device configuration, should be changed to suit target board
 options 	ROOTDEVNAME=\"ufs:md0.uzip\"
 
 # Support geom_uzip(4) compressed disk images
 device 		geom_uzip
 options 	GEOM_UZIP
 
 # Support md(4) and md-based rootfs
 device 		md
 options 	MD_ROOT
 
 # Interrupt controller support
 device 		mtk_intr_v1
 
 # UART device support
 nodevice 	uart_ns8250
 device 		uart_dev_mtk
 
 # SPI and SPI flash support
 device 		mtk_spi_v1
 device 		spibus
 device 		mx25l
 
 # CFI support
 #device 		cfi
 #device 		cfid
 
 # GPIO and gpioled support
 device 		mtk_gpio_v1
 device 		gpio
 device 		gpioled
 
 # USB (dwcotg) support
 device 		usb
 device 		mtk_usb_phy
 device 		dwcotg
 
 # USB umass(4) storage and da(4) support
 device 		umass
 device 		da
 
 # CAM support, required if umass(4) is enabled above
 device 		pass
 device 		scbus
 
 # Ethernet, BPF and bridge support
 device 		rt
 device 		bpf
 device 		if_bridge
 
 # Extres
 device 		ext_resources
 device 		clk
+
+# For now there's no etherswitch support for RT3662/RT3883
+nodevice 	etherswitch
+nodevice 	mtkswitch
Index: head/sys/mips/mediatek/files.mediatek
===================================================================
--- head/sys/mips/mediatek/files.mediatek	(revision 300658)
+++ head/sys/mips/mediatek/files.mediatek	(revision 300659)
@@ -1,42 +1,47 @@
 # $FreeBSD$
 
 mips/mediatek/mtk_machdep.c 		standard
 mips/mediatek/mtk_sysctl.c 		standard
 mips/mediatek/mtk_soc.c 		standard
 mips/mediatek/mtk_reset.c 		standard
 mips/mediatek/mtk_clock.c 		standard
 mips/mediatek/mtk_pinctrl.c 		standard
 mips/mediatek/palmbus.c			standard
 mips/mediatek/mtk_intr_v1.c 		optional mtk_intr_v1
 mips/mediatek/mtk_intr_v2.c 		optional mtk_intr_v2
 mips/mediatek/mtk_intr_gic.c 		optional mtk_intr_gic
 mips/mediatek/uart_dev_mtk.c 		optional uart uart_dev_mtk
 mips/mediatek/mtk_spi_v1.c 		optional spibus mtk_spi_v1
 mips/mediatek/mtk_spi_v2.c 		optional spibus mtk_spi_v2
 mips/mediatek/mtk_usb_phy.c 		optional usb mtk_usb_phy
 mips/mediatek/mtk_xhci.c 		optional usb xhci
 mips/mediatek/mtk_ohci.c 		optional usb ohci
 mips/mediatek/mtk_ehci.c 		optional usb ehci
 mips/mediatek/mtk_dotg.c 		optional usb dwcotg
 mips/mediatek/mtk_pcie.c 		optional pci
 mips/mediatek/mtk_gpio_v1.c 		optional gpio mtk_gpio_v1
 mips/mediatek/mtk_gpio_v2.c 		optional gpio mtk_gpio_v2
 #mips/mediatek/mtk_mmc.c 		optional mmc
 
 # Ralink/Mediatek Ethernet driver
 dev/rt/if_rt.c 				optional rt
 
 # Hack to reuse ARM intrng code
 kern/subr_intr.c 			standard
 kern/msi_if.m 				standard
 kern/pic_if.m 				standard
 
 # Intrng compatible MIPS32 interrupt controller
 mips/mips/mips_pic.c 			standard
 
 # Standard MIPS ticker
 mips/mips/tick.c 			standard
 
 # Temporary Reset if
 mips/mediatek/fdt_reset.c 		standard
 mips/mediatek/fdt_reset_if.m 		standard
+
+# Switch
+dev/etherswitch/mtkswitch/mtkswitch.c 	optional mtkswitch
+dev/etherswitch/mtkswitch/mtkswitch_rt3050.c 	optional mtkswitch
+dev/etherswitch/mtkswitch/mtkswitch_mt7620.c 	optional mtkswitch
Index: head/sys/mips/mediatek/std.mediatek
===================================================================
--- head/sys/mips/mediatek/std.mediatek	(revision 300658)
+++ head/sys/mips/mediatek/std.mediatek	(revision 300659)
@@ -1,84 +1,90 @@
 #
 # std.mtk -- Base kernel configuration file for FreeBSD/MIPS Mediatek/Ralink
 # SoCs.
 #
 # This includes all the required drivers for the SoCs.
 #
 # $FreeBSD$
 #
 
 # Include the standard file list for Mediatek SoCs.
 files 		"../mediatek/files.mediatek"
 
 # Building a mips/mipsel kernel
 machine 	mips mipsel
 
 # Little-endian machine
 makeoptions 	MIPS_LITTLE_ENDIAN=defined
 
 # Default kernel load address
 makeoptions 	KERNLOADADDR=0x80001000
 
 # Mediatek/Ralink SoC support depends on FDT (with static DTB for the moment)
 options 	FDT
 options 	FDT_DTB_STATIC
 
 # We rely on INTRNG code
 options 	INTRNG
 options 	MIPS_NIRQ=256
 
 # We rely on NEW_PCIB code
 options 	NEW_PCIB
 
 # Build kernel with gdb(1) debug symbols
 makeoptions 	DEBUG=-g
 
 # Support for DDB and KDB
 options 	DDB
 options 	KDB
 
 # Debugging for use in -current
 options 	INVARIANTS
 options 	INVARIANT_SUPPORT
 options 	WITNESS
 options 	WITNESS_SKIPSPIN
 options 	DEBUG_REDZONE
 options 	DEBUG_MEMGUARD
 
 # For small memory footprints
 options 	VM_KMEM_SIZE_SCALE=1
 
 # General options, including scheduler, etc.
 options 	SCHED_ULE	# ULE scheduler
 options 	INET		# InterNETworking
 #options 	INET6		# IPv6
 options 	PSEUDOFS	# Pseude-filesystem framework
 options 	FFS		# Berkeley Fast Filesystem
 #options 	SOFTUPDATES	# Enable FFS soft updates support
 #options 	UFS_ACL		# Support for access control lists
 #options 	UFS_DIRHASH	# Improve big directory performance
 #options 	MSDOSFS		# Enable support for MSDOS filesystems
 options 	_KPOSIX_PRIORITY_SCHEDULING	# Posix P1003_1B real-time ext.
 
 #
 # Standard drivers section
 #
 # The drivers in the following section are required in order to successfully
 # compile the kernel.
 #
 
 # FDT clock and pinctrl framework
 device 		fdt_clock
 device 		fdt_pinctrl
 
 # UART support
 device 		uart
 
 # random support
 device 		random
 
 # loop device support
 device 		loop
 
 # ether device support
 device 		ether
+
+# ether switch support
+device 		etherswitch
+device 		miibus
+device 		mtkswitch
+device 		mdio