Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] Support for Versatile Express A15



Hi,

This set of patches adds support for the Versatile Express A15 board, or at 
least, the one simulated by QEMU (I don't have access to the real hardware).

This board is interesting for two reasons: is a well supported ARMv7 platform 
within QEMU, and it's a first step towards running NetBSD/evbarm as a guest on 
KVM/ARM.

 - 01_vexpress_support.patch: Add support and configuration files for the 
Versatile Express A15 board.

 - 02_lan9118_configure_polarity.patch: Configure interrupt polarity before 
enabling phy, to avoid a interrupt storm when running inside QEMU.

 - 03_add_qemu_vfp_id.patch: Add QEMU VFP IDs for emulated Cortex-A15.

KVM support is not included here. I'll send another set of patches when this 
one gets approved and commited.

Sergio.
diff --git a/sys/arch/evbarm/conf/VEXPRESS_A15 b/sys/arch/evbarm/conf/VEXPRESS_A15
new file mode 100644
index 0000000..cdfe183
--- /dev/null
+++ b/sys/arch/evbarm/conf/VEXPRESS_A15
@@ -0,0 +1,216 @@
+#
+#	$NetBSD$
+#
+#	VEXPRESS_A15 -- Versatile Express A15 kernel
+#
+
+include	"arch/evbarm/conf/std.vexpress"
+
+# estimated number of users
+
+maxusers	32
+
+# Standard system options
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	NTP		# NTP phase/frequency locked loop
+
+# CPU options
+options 	CPU_CORTEX
+options 	CPU_CORTEXA7
+options 	CPU_CORTEXA15
+#options 	MULTIPROCESSOR
+
+options 	PMAPCOUNTERS
+options 	BUSDMA_COUNTERS
+#options 	UVMHIST
+#options 	USBHIST
+#options 	USBHIST_SIZE=100000
+#options 	UVMHIST_PRINT,KERNHIST_DELAY=0
+options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
+options 	PMAP_NEED_ALLOC_POOLPAGE
+
+# Specify the memory size in megabytes (optional).
+#options 	MEMSIZE=512
+
+# File systems
+file-system	FFS		# UFS
+#file-system	LFS		# log-structured file system
+file-system	MFS		# memory file system
+file-system	NFS		# Network file system
+#file-system 	ADOSFS		# AmigaDOS-compatible file system
+#file-system 	EXT2FS		# second extended file system (linux)
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	MSDOSFS		# MS-DOS file system
+#file-system	FDESC		# /dev/fd
+file-system	KERNFS		# /kern
+#file-system	NULLFS		# loopback file system
+file-system	PROCFS		# /proc
+#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+#file-system	UNION		# union file system
+file-system	TMPFS		# memory file system
+file-system	PTYFS		# /dev/pts/N support
+
+# File system options
+#options 	QUOTA		# legacy UFS quotas
+#options 	QUOTA2		# new, in-filesystem UFS quotas
+#options 	FFS_EI		# FFS Endian Independent support
+#options 	NFSSERVER
+options 	WAPBL		# File system journaling support
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+
+# Networking options
+
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPV6
+#options 	IPSEC		# IP security
+#options 	IPSEC_DEBUG	# debug for IP security
+#options 	MROUTING	# IP multicast routing
+#options 	PIM		# Protocol Independent Multicast
+#options 	NETATALK	# AppleTalk networking
+#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+#options 	PPP_DEFLATE	# Deflate compression support for PPP
+#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
+#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
+
+options 	NFS_BOOT_BOOTP
+options 	NFS_BOOT_DHCP
+#options 	NFS_BOOT_BOOTSTATIC
+#options 	NFS_BOOTSTATIC_MYIP="\"192.168.1.4\""
+#options 	NFS_BOOTSTATIC_GWIP="\"192.168.1.1\""
+#options 	NFS_BOOTSTATIC_MASK="\"255.255.255.0\""
+#options 	NFS_BOOTSTATIC_SERVADDR="\"192.168.1.1\""
+#options 	NFS_BOOTSTATIC_SERVER="\"192.168.1.1:/nfs/sdp2430\""
+
+options 	NFS_BOOT_RWSIZE=1024
+
+# Compatibility options
+
+options 	COMPAT_NETBSD32	# allow running arm (e.g. non-earm) binaries
+#options 	COMPAT_43	# 4.3BSD compatibility.
+#options 	COMPAT_09	# NetBSD 0.9,
+#options 	COMPAT_10	# NetBSD 1.0,
+#options 	COMPAT_11	# NetBSD 1.1,
+#options 	COMPAT_12	# NetBSD 1.2,
+#options 	COMPAT_13	# NetBSD 1.3,
+#options 	COMPAT_14	# NetBSD 1.4,
+#options 	COMPAT_15	# NetBSD 1.5,
+#options 	COMPAT_16	# NetBSD 1.6,
+#options 	COMPAT_20	# NetBSD 2.0,
+options 	COMPAT_30	# NetBSD 3.0,
+options 	COMPAT_40	# NetBSD 4.0,
+options 	COMPAT_50	# NetBSD 5.0,
+options 	COMPAT_60	# NetBSD 6.0, and
+options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+#options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+# Shared memory options
+
+options 	SYSVMSG		# System V-like message queues
+options 	SYSVSEM		# System V-like semaphores
+options 	SYSVSHM		# System V-like memory sharing
+
+# Device options
+
+#options 	MEMORY_DISK_HOOKS	# boottime setup of ramdisk
+#options 	MEMORY_DISK_ROOT_SIZE=8192	# Size in blocks
+#options 	MEMORY_DISK_DYNAMIC
+#options 	MINIROOTSIZE=1000	# Size in blocks
+#options 	MEMORY_DISK_IS_ROOT	# use memory disk as root
+
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+
+# Miscellaneous kernel options
+options 	KTRACE		# system call tracing, a la ktrace(1)
+#options 	KMEMSTATS	# kernel memory statistics
+#options 	SCSIVERBOSE	# Verbose SCSI errors
+options 	MIIVERBOSE	# Verbose MII autoconfuration messages
+#options 	DDB_KEYCODE=0x40
+#options 	USERCONF	# userconf(4) support
+#options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
+
+# Development and Debugging options
+
+#options 	PERFCTRS	# performance counters
+options 	DIAGNOSTIC	# internal consistency checks
+options 	DEBUG
+options 	LOCKDEBUG
+#options 	PMAP_DEBUG	# Enable pmap_debug_level code
+#options 	IPKDB		# remote kernel debugging
+options 	VERBOSE_INIT_ARM # verbose bootstraping messages
+options 	DDB		# in-kernel debugger
+options 	DDB_ONPANIC=1
+options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
+#options 	KGDB
+makeoptions	DEBUG="-g"	# compile full symbol table
+makeoptions	COPY_SYMTAB=1
+options 	PLCONSOLE
+
+# Valid options for BOOT_ARGS:
+#  single		Boot to single user only
+#  kdb			Give control to kernel debugger
+#  ask			Ask for file name to reboot from
+#  memorydisk=<n>	Set memorydisk size to <n> KB
+#  quiet		Show aprint_naive output
+#  verbose		Show aprint_normal and aprint_verbose output
+#options		BOOT_ARGS="\"\""
+options		BOOT_ARGS="\"verbose\""
+
+config		netbsd		root on ? type ?
+
+# The main bus device
+mainbus0	at root
+
+# The boot cpu and secondary CPUs
+cpu0		at mainbus?
+#cpu?		at mainbus?			# Multiprocessor
+
+# A9 core devices
+armperiph0	at mainbus?
+armgic0 	at armperiph?			# Interrupt Controller
+armgtmr0	at armperiph?			# Generic Timer
+
+# VEXPRESS AXI0
+axi0		at mainbus?
+
+# PL011 uart
+plcom0          at axi? addr 0x1c090000 irq 37
+
+# PL181 MMCI host controller
+plmmc0  	at axi? addr 0x1c050000 irq 41
+sdmmc*  	at plmmc0
+ld* 		at sdmmc?
+#options 	SDMMC_DEBUG
+#options 	SDMMCCISDEBUG
+
+# LAN 9118
+smsh0 		at axi? addr 0x1a000000 irq 47
+
+# MII/PHY support
+ukphy*  	at mii? phy ?		# smsh(4) internal PHY
+
+# Pseudo-Devices
+
+# disk/mass storage pseudo-devices
+#pseudo-device	md			# memory disk device (ramdisk)
+#pseudo-device	vnd			# disk-like interface to files
+#pseudo-device	fss			# file system snapshot device
+#pseudo-device	putter			# for puffs and pud
+pseudo-device	drvctl			# driver control
+
+# network pseudo-devices
+pseudo-device	bpfilter		# Berkeley packet filter
+pseudo-device	loop			# network loopback
+#pseudo-device	kttcp			# network loopback
+
+# miscellaneous pseudo-devices
+pseudo-device	pty			# pseudo-terminals
+#options	RND_COM
+#pseudo-device	clockctl		# user control of clock subsystem
+pseudo-device	ksyms			# /dev/ksyms
+#pseudo-device	lockstat		# lock profiling
diff --git a/sys/arch/evbarm/conf/files.vexpress b/sys/arch/evbarm/conf/files.vexpress
new file mode 100644
index 0000000..4511149
--- /dev/null
+++ b/sys/arch/evbarm/conf/files.vexpress
@@ -0,0 +1,34 @@
+#	$NetBSD$
+#
+# Versatile Express board configuration info
+#
+
+file	arch/evbarm/vexpress/vexpress_machdep.c
+
+include "arch/arm/pic/files.pic"
+include "arch/arm/cortex/files.cortex"
+
+file    arch/arm/arm32/arm32_boot.c
+file    arch/arm/arm32/arm32_kvminit.c
+file    arch/arm/arm32/arm32_reboot.c
+file    arch/arm/arm32/irq_dispatch.S
+
+file	arch/evbarm/vexpress/vexpress_space.c
+
+# VEXPRESS AXI/AHB bus interface and SoC domains
+device  axi { [addr=-1], [size=0], [irq=-1], [irqbase=-1]} : bus_space_generic
+attach  axi at mainbus
+file    arch/evbarm/vexpress/vexpress_axi.c	axi
+
+# UART Interface
+attach  plcom at axi with vexpressplcom
+file    arch/evbarm/vexpress/vexpress_plcom.c	vexpressplcom
+
+# MMCI host controller
+attach	plmmc at axi with vexpressplmmc
+file	arch/evbarm/vexpress/vexpress_plmmc.c	vexpressplmmc
+
+# SMSC LAN9118
+attach  smsh at axi with smsh_axi
+file    arch/evbarm/vexpress/if_smsh_axi.c	smsh_axi
+
diff --git a/sys/arch/evbarm/conf/mk.vexpress b/sys/arch/evbarm/conf/mk.vexpress
new file mode 100644
index 0000000..cfc3fe0
--- /dev/null
+++ b/sys/arch/evbarm/conf/mk.vexpress
@@ -0,0 +1,35 @@
+#	$NetBSD$
+
+.if !empty(MACHINE_ARCH:M*eb)
+EXTRA_LINKFLAGS+=	--be8
+.endif
+
+SYSTEM_FIRST_OBJ=	vexpress_start.o
+SYSTEM_FIRST_SFILE=	${THISARM}/vexpress/vexpress_start.S
+
+_OSRELEASE!=		${HOST_SH} $S/conf/osrelease.sh
+
+KERNEL_BASE_PHYS?=$(LOADADDRESS)
+KERNEL_BASE_VIRT?=$(LOADADDRESS)
+
+MKUBOOTIMAGEARGS=	-A arm -T kernel
+MKUBOOTIMAGEARGS+=	-a $(KERNEL_BASE_PHYS) -e $(KERNEL_BASE_PHYS)
+MKUBOOTIMAGEARGS+=	-n "NetBSD/$(BOARDTYPE) ${_OSRELEASE}"
+MKUBOOTIMAGEARGS_NONE=	${MKUBOOTIMAGEARGS} -C none
+MKUBOOTIMAGEARGS_GZ=	${MKUBOOTIMAGEARGS} -C gz
+
+SYSTEM_LD_TAIL_EXTRA+=; \
+	echo ${OBJCOPY} -S -O binary $@ $@.bin; \
+	${OBJCOPY} -S -O binary $@ $@.bin; \
+	echo ${TOOL_GZIP} -9c $@.bin > $@.bin.gz; \
+	${TOOL_GZIP} -9c $@.bin > $@.bin.gz; \
+	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_GZ} $@.bin.gz $@.gz.ub; \
+	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_GZ} $@.bin.gz $@.gz.ub; \
+	echo ${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
+	${TOOL_MKUBOOTIMAGE} ${MKUBOOTIMAGEARGS_NONE} $@.bin $@.ub; \
+	echo
+
+EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin@}
+EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.ub@}
+EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin.gz@}
+EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gz.ub@}
diff --git a/sys/arch/evbarm/conf/std.vexpress b/sys/arch/evbarm/conf/std.vexpress
new file mode 100644
index 0000000..56fbf20
--- /dev/null
+++ b/sys/arch/evbarm/conf/std.vexpress
@@ -0,0 +1,32 @@
+#       $NetBSD$
+#
+# standard NetBSD/evbarm for VEXPRESS options
+
+machine evbarm arm
+include 	"arch/evbarm/conf/std.evbarm"
+
+# Pull in VEXPRESS config definitions
+include 	"arch/evbarm/conf/files.vexpress"
+
+makeoptions	CPUFLAGS="-march=armv7-a -mfpu=neon"
+
+# To support easy transit to ../arch/arm/arm32
+options 	MODULAR
+options 	MODULAR_DEFAULT_AUTOLOAD
+options 	ARM_HAS_VBAR
+options 	CORTEX_PMC
+options 	__HAVE_CPU_COUNTER
+options 	__HAVE_FAST_SOFTINTS            # should be in types.h
+#options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
+options 	TPIDRPRW_IS_CURCPU
+options 	KERNEL_BASE_EXT=0x80000000
+options 	FPU_VFP
+
+makeoptions     KERNEL_BASE_PHYS="0x80000000"
+makeoptions     KERNEL_BASE_VIRT="0x80000000"
+makeoptions     BOARDTYPE="vexpress"
+makeoptions     BOARDMKFRAG="${THISARM}/conf/mk.vexpress"
+
+options         ARM_INTR_IMPL="<arch/evbarm/vexpress/vexpress_intr.h>"
+options         ARM_GENERIC_TODR
+
diff --git a/sys/arch/evbarm/vexpress/if_smsh_axi.c b/sys/arch/evbarm/vexpress/if_smsh_axi.c
new file mode 100644
index 0000000..18278b5
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/if_smsh_axi.c
@@ -0,0 +1,117 @@
+/*	$NetBSD$	*/
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include "locators.h"
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/errno.h>
+#include <sys/bus.h>
+#include <sys/systm.h>
+
+#include <net/if.h>
+#include <net/if_ether.h>
+#include <net/if_media.h>
+
+#include <dev/mii/miivar.h>
+
+#include <dev/ic/lan9118var.h>
+#include <dev/ic/lan9118reg.h>
+
+#include <evbarm/vexpress/vexpress_var.h>
+
+
+static int smsh_axi_match(device_t, struct cfdata *, void *);
+static void smsh_axi_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(smsh_axi, sizeof(struct lan9118_softc),
+    smsh_axi_match, smsh_axi_attach, NULL, NULL);
+
+
+/* ARGSUSED */
+static int
+smsh_axi_match(device_t parent, struct cfdata * match, void *aux)
+{
+	struct axi_attach_args *aa = aux;
+
+	/* Disallow wildcarded values. */
+	if (aa->aa_addr == 0)
+		return 0;
+	if (aa->aa_irq == 0)
+		return 0;
+
+	return 1;
+}
+
+/* ARGSUSED */
+static void
+smsh_axi_attach(device_t parent, device_t self, void *aux)
+{
+	struct lan9118_softc *sc = device_private(self);
+	struct axi_attach_args *aa = aux;
+	prop_dictionary_t dict = device_properties(self);
+	void *ih;
+
+	sc->sc_dev = self;
+
+	/*
+	 * Prefer the Ethernet address in device properties.
+	 */
+	prop_data_t ea = prop_dictionary_get(dict, "mac-address");
+	if (ea != NULL) {
+		KASSERT(prop_object_type(ea) == PROP_TYPE_DATA);
+		KASSERT(prop_data_size(ea) == ETHER_ADDR_LEN);
+		memcpy(sc->sc_enaddr, prop_data_data_nocopy(ea),
+		    ETHER_ADDR_LEN);
+		sc->sc_flags |= LAN9118_FLAGS_NO_EEPROM;
+	}
+	/* Map i/o space. */
+	if (bus_space_map(aa->aa_iot, aa->aa_addr, LAN9118_IOSIZE, 0,
+		&sc->sc_ioh))
+		panic("smsh_axi_attach: can't map i/o space");
+	sc->sc_iot = aa->aa_iot;
+
+	if (lan9118_attach(sc) != 0) {
+		bus_space_unmap(sc->sc_iot, sc->sc_ioh, LAN9118_IOSIZE);
+		return;
+	}
+	/* Establish the interrupt handler. */
+	ih = intr_establish(aa->aa_irq, IPL_NET, IST_LEVEL,
+	    lan9118_intr, sc);
+	if (ih == NULL) {
+		aprint_error_dev(self,
+		    "couldn't establish interrupt handler\n");
+		bus_space_unmap(sc->sc_iot, sc->sc_ioh, LAN9118_IOSIZE);
+		return;
+	}
+}
diff --git a/sys/arch/evbarm/vexpress/platform.h b/sys/arch/evbarm/vexpress/platform.h
new file mode 100644
index 0000000..1643387
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/platform.h
@@ -0,0 +1,51 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _ARM_VEXPRESS_PLATFORM_H
+#define _ARM_VEXPRESS_PLATFORM_H
+
+/*
+ * IO space
+ */
+
+#define VEXPRESS_CORE_VBASE	0xf0000000
+#define VEXPRESS_CORE_PBASE	0x10000000
+#define VEXPRESS_CORE_SIZE	0x10000000
+
+/*
+ * Kernel VM space 16Mb behind KERNEL_BASE upto 0xeff00000
+ */
+#define KERNEL_VM_BASE          0xc0000000
+#define KERNEL_VM_SIZE          (VEXPRESS_CORE_VBASE - KERNEL_VM_BASE)
+
+#define VEXPRESS_REF_FREQ	(24*1000*1000)	/* 24MHz */
+
+#endif				/* _ARM_VEXPRESS_PLATFORM_H */
diff --git a/sys/arch/evbarm/vexpress/vexpress_axi.c b/sys/arch/evbarm/vexpress/vexpress_axi.c
new file mode 100644
index 0000000..25bac6e
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_axi.c
@@ -0,0 +1,156 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/device.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <evbarm/vexpress/vexpress_var.h>
+
+#include "locators.h"
+
+struct axi_softc {
+	device_t sc_dev;
+	bus_space_tag_t sc_iot;
+	bus_dma_tag_t sc_dmat;
+};
+
+static int axi_match(device_t, struct cfdata *, void *);
+static void axi_attach(device_t, device_t, void *);
+static int axi_search(device_t, struct cfdata *, const int *, void *);
+static int axi_critical_search(device_t, struct cfdata *, const int *, void *);
+static int axi_search(device_t, struct cfdata *, const int *, void *);
+static int axi_print(void *, const char *);
+
+CFATTACH_DECL_NEW(axi, sizeof(struct axi_softc),
+    axi_match, axi_attach, NULL, NULL);
+
+/* ARGSUSED */
+static int
+axi_match(device_t parent __unused, struct cfdata * match __unused,
+    void *aux __unused)
+{
+	return 1;
+}
+
+/* ARGSUSED */
+static void
+axi_attach(device_t parent __unused, device_t self, void *aux __unused)
+{
+	struct axi_softc *sc;
+	struct axi_attach_args aa;
+
+	aprint_normal(": Advanced eXtensible Interface\n");
+	aprint_naive("\n");
+
+	sc = device_private(self);
+	sc->sc_iot = &vexpress_bs_tag;
+#if NBUS_DMA_GENERIC > 0
+	sc->sc_dmat = &vexpress_bus_dma_tag;
+#else
+	sc->sc_dmat = 0;
+#endif
+
+	aa.aa_name = "axi";
+	aa.aa_iot = sc->sc_iot;
+	aa.aa_dmat = sc->sc_dmat;
+	config_search_ia(axi_critical_search, self, "axi", &aa);
+	config_search_ia(axi_search, self, "axi", &aa);
+}
+
+/* ARGSUSED */
+static int
+axi_critical_search(device_t parent, struct cfdata * cf,
+    const int *ldesc __unused, void *aux)
+{
+	struct axi_attach_args *aa;
+
+	aa = aux;
+
+	if (strcmp(cf->cf_name, "plcom") != 0)
+		return 0;
+
+	aa->aa_name = cf->cf_name;
+	aa->aa_addr = cf->cf_loc[AXICF_ADDR];
+	aa->aa_size = cf->cf_loc[AXICF_SIZE];
+	aa->aa_irq = cf->cf_loc[AXICF_IRQ];
+	aa->aa_irqbase = cf->cf_loc[AXICF_IRQBASE];
+
+	if (config_match(parent, cf, aux) > 0)
+		config_attach(parent, cf, aux, axi_print);
+
+	return 0;
+}
+
+/* ARGSUSED */
+static int
+axi_search(device_t parent, struct cfdata * cf, const int *ldesc __unused,
+    void *aux)
+{
+	struct axi_attach_args *aa;
+
+	aa = aux;
+
+	aa->aa_addr = cf->cf_loc[AXICF_ADDR];
+	aa->aa_size = cf->cf_loc[AXICF_SIZE];
+	aa->aa_irq = cf->cf_loc[AXICF_IRQ];
+	aa->aa_irqbase = cf->cf_loc[AXICF_IRQBASE];
+
+	if (config_match(parent, cf, aux) > 0)
+		config_attach(parent, cf, aux, axi_print);
+
+	return 0;
+}
+
+/* ARGSUSED */
+static int
+axi_print(void *aux, const char *name __unused)
+{
+	struct axi_attach_args *aa = (struct axi_attach_args *) aux;
+
+	if (aa->aa_addr != AXICF_ADDR_DEFAULT) {
+		aprint_normal(" addr 0x%lx", aa->aa_addr);
+		if (aa->aa_size > AXICF_SIZE_DEFAULT)
+			aprint_normal("-0x%lx",
+			    aa->aa_addr + aa->aa_size - 1);
+	}
+	if (aa->aa_irq != AXICF_IRQ_DEFAULT)
+		aprint_normal(" intr %d", aa->aa_irq);
+	if (aa->aa_irqbase != AXICF_IRQBASE_DEFAULT)
+		aprint_normal(" irqbase %d", aa->aa_irqbase);
+
+	return (UNCONF);
+}
diff --git a/sys/arch/evbarm/vexpress/vexpress_intr.h b/sys/arch/evbarm/vexpress/vexpress_intr.h
new file mode 100644
index 0000000..da35e0a
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_intr.h
@@ -0,0 +1,54 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _ARM_VEXPRESS_INTR_H_
+#define _ARM_VEXPRESS_INTR_H_
+
+#define	PIC_MAXSOURCES			GIC_MAXSOURCES(224)
+#define	PIC_MAXMAXSOURCES		(PIC_MAXSOURCES + 32)	/* XXX */
+
+/*
+ * The Versatile Express uses a generic interrupt controller
+ */
+#include <arm/cortex/gic_intr.h>
+
+/*
+ * The GIC supports
+ *   - 16 Software Generated Interrupts (SGIs)
+ *   - 16 Private Peripheral Interrupts (PPIs)
+ *   - 127 Shared Peripheral Interrupts (SPIs)
+ */
+
+#define	IRQ_MCT_LTIMER		IRQ_PPI(12)
+
+#include <arm/cortex/gtmr_intr.h>
+
+#endif				/* _ARM_VEXPRESS_INTR_H_ */
diff --git a/sys/arch/evbarm/vexpress/vexpress_machdep.c b/sys/arch/evbarm/vexpress/vexpress_machdep.c
new file mode 100644
index 0000000..9bda989
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_machdep.c
@@ -0,0 +1,284 @@
+/*	$NetBSD$	*/
+
+/*
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include "opt_machdep.h"
+#include "opt_ddb.h"
+#include "opt_kgdb.h"
+#include "opt_ipkdb.h"
+#include "opt_md.h"
+#include "opt_arm_debug.h"
+
+#include "ukbd.h"
+#include "arml2cc.h"	// RPZ why is it not called opt_l2cc.h?
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/device.h>
+#include <sys/exec.h>
+#include <sys/kernel.h>
+#include <sys/ksyms.h>
+#include <sys/msgbuf.h>
+#include <sys/proc.h>
+#include <sys/reboot.h>
+#include <sys/termios.h>
+#include <sys/gpio.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <sys/conf.h>
+#include <dev/cons.h>
+#include <dev/md.h>
+
+#include <machine/db_machdep.h>
+#include <ddb/db_sym.h>
+#include <ddb/db_extern.h>
+#ifdef KGDB
+#include <sys/kgdb.h>
+#endif
+
+#include <machine/bootconfig.h>
+#include <arm/armreg.h>
+#include <arm/undefined.h>
+#include <arm/cortex/pl310_var.h>
+
+#include <arm/arm32/machdep.h>
+#include <arm/mainbus/mainbus.h>
+
+#include <evbarm/vexpress/vexpress_var.h>
+
+#include <evbarm/include/autoconf.h>
+#include <evbarm/vexpress/platform.h>
+
+#include <dev/i2c/i2cvar.h>
+#include <dev/i2c/ddcreg.h>
+
+#include <dev/usb/ukbdvar.h>
+#include <net/if_ether.h>
+
+#include "plcom.h"
+
+#if NPLCOM > 0
+#include <evbarm/dev/plcomreg.h>
+#include <evbarm/dev/plcomvar.h>
+#endif
+
+#define PLCONADDR 0x1c090000
+
+#ifndef CONSDEVNAME
+#define CONSDEVNAME "plcom"
+#endif
+
+#ifndef PLCONSPEED
+#define PLCONSPEED B115200
+#endif
+#ifndef PLCONMODE
+#define PLCONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8)	/* 8N1 */
+#endif
+#ifndef PLCOMCNUNIT
+#define PLCOMCNUNIT -1
+#endif
+
+#if (NPLCOM > 0)
+static const bus_addr_t consaddr = (bus_addr_t) PLCONADDR;
+
+int plcomcnspeed = PLCONSPEED;
+int plcomcnmode = PLCONMODE;
+#endif
+
+#if (NPLCOM > 0 && (defined(PLCONSOLE) || defined(KGDB)))
+static struct plcom_instance vexpress_pi = {
+	.pi_type = PLCOM_TYPE_PL011,
+	.pi_flags = PLC_FLAG_32BIT_ACCESS,
+	.pi_iot = &vexpress_bs_tag,
+	.pi_size = PL011COM_UART_SIZE
+};
+#endif
+
+/*
+ * kernel start and end from the linker
+ */
+extern char KERNEL_BASE_phys[];	/* physical start of kernel */
+extern char KERNEL_BASE_virt[];	/* virtual start of kernel */
+extern char _end[];		/* physical end of kernel */
+#define KERNEL_BASE_PHYS	((paddr_t)KERNEL_BASE_phys)
+
+#define KERN_VTOPDIFF	((vaddr_t)KERNEL_BASE_phys - (vaddr_t)KERNEL_BASE_virt)
+#define KERN_VTOPHYS(va)	((paddr_t)((vaddr_t)va + (vaddr_t)KERN_VTOPDIFF))
+#define KERN_PHYSTOV(pa)	((vaddr_t)((paddr_t)pa - (vaddr_t)KERN_VTOPDIFF))
+
+BootConfig bootconfig;		/* Boot config storage */
+char *boot_args = NULL;
+
+/* prototypes */
+void consinit(void);
+#ifdef KGDB
+static void kgdb_port_init(void);
+#endif
+static void vexpress_device_register(device_t, void *);
+
+/*
+ * Our static device mappings at fixed virtual addresses so we can use them
+ * while booting the kernel.
+ *
+ * Map the extents segment-aligned and segment-rounded in size to avoid L2
+ * page tables
+ */
+
+#define _A(a)   ((a) & ~L1_S_OFFSET)
+#define _S(s)   (((s) + L1_S_SIZE - 1) & (~(L1_S_SIZE-1)))
+
+static const struct pmap_devmap vexpress_devmap[] = {
+	{
+		/* map in core IO space */
+		.pd_va = _A(VEXPRESS_CORE_VBASE),
+		.pd_pa = _A(VEXPRESS_CORE_PBASE),
+		.pd_size = _S(VEXPRESS_CORE_SIZE),
+		.pd_prot = VM_PROT_READ | VM_PROT_WRITE,
+		.pd_cache = PTE_NOCACHE
+	},
+	{0}
+};
+#undef _A
+#undef _S
+
+/*
+ * u_int initarm(...)
+ *
+ * Our entry point from the assembly before main() is called.
+ * - take a copy of the config we got from uboot
+ * - init the physical console
+ * - setting up page tables for the kernel
+ */
+
+u_int
+initarm(void *arg)
+{
+#ifdef MEMSIZE
+	psize_t memsize = (unsigned) MEMSIZE * 1024 * 1024;
+#else
+	/* If MEMSIZE is not defined, use QEMU's default value (128 MB) */
+	psize_t memsize = (unsigned) 128 * 1024 * 1024;
+#endif
+
+	pmap_devmap_register(vexpress_devmap);
+
+	set_cpufuncs();
+
+	consinit();
+
+	/* Talk to the user */
+#define BDSTR(s)        _BDSTR(s)
+#define _BDSTR(s)       #s
+	printf("\nNetBSD/evbarm (" BDSTR(EVBARM_BOARDTYPE) ") booting ...\n");
+
+#ifdef VERBOSE_INIT_ARM
+	printf("initarm: cbar=%#x\n", armreg_cbar_read());
+#endif
+
+	bootconfig.dramblocks = 1;
+	bootconfig.dram[0].address = KERN_VTOPHYS(KERNEL_BASE);
+	bootconfig.dram[0].pages = memsize / PAGE_SIZE;
+
+	arm32_bootmem_init(bootconfig.dram[0].address, memsize,
+	    (uintptr_t) KERNEL_BASE_phys);
+
+	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, vexpress_devmap,
+	    true);
+
+#ifdef VERBOSE_INIT_ARM
+	printf("initarm: Configuring system ...\n");
+#endif
+
+	cortex_pmc_ccnt_init();
+
+	/* We've a specific device_register routine */
+	evbarm_device_register = vexpress_device_register;
+
+	return initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, NULL, 0);
+}
+
+void
+consinit(void)
+{
+	static int consinit_called = 0;
+
+	if (consinit_called != 0)
+		return;
+
+	consinit_called = 1;
+
+#if (NPLCOM > 0 && defined(PLCONSOLE))
+	/*
+	 * Initialise the diagnostic serial console
+	 * This allows a means of generating output during initarm().
+	 */
+	vexpress_pi.pi_iobase = consaddr;
+
+	plcomcnattach(&vexpress_pi, plcomcnspeed, 3000000,
+	    plcomcnmode, PLCOMCNUNIT);
+
+#endif
+}
+
+void
+vexpress_device_register(device_t self, void *aux)
+{
+	prop_dictionary_t dict = device_properties(self);
+
+	if (device_is_a(self, "armperiph")
+	    && device_is_a(device_parent(self), "mainbus")) {
+		/*
+		 * XXX KLUDGE ALERT XXX
+		 * The iot mainbus supplies is completely wrong since it scales
+		 * addresses by 2.  The simpliest remedy is to replace with our
+		 * bus space used for the armcore regisers (which armperiph uses).
+		 */
+		struct mainbus_attach_args *const mb = aux;
+		mb->mb_iot = &vexpress_bs_tag;
+		return;
+	}
+#if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA15)
+	if (device_is_a(self, "armgtmr")) {
+		/*
+		 * The frequency of the generic timer is the reference
+		 * frequency.
+		 */
+		prop_dictionary_set_uint32(dict, "frequency", VEXPRESS_REF_FREQ);
+		return;
+	}
+#endif
+}
diff --git a/sys/arch/evbarm/vexpress/vexpress_plcom.c b/sys/arch/evbarm/vexpress/vexpress_plcom.c
new file mode 100644
index 0000000..45c6cf1
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_plcom.c
@@ -0,0 +1,97 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Interface to plcom (PL011) serial driver. */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include <sys/types.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+#include <sys/param.h>
+#include <sys/termios.h>
+#include <sys/bus.h>
+
+#include <evbarm/vexpress/platform.h>
+#include <evbarm/vexpress/vexpress_var.h>
+
+#include <evbarm/dev/plcomreg.h>
+#include <evbarm/dev/plcomvar.h>
+
+static int vexpress_plcom_match(device_t, cfdata_t, void *);
+static void vexpress_plcom_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(vexpressplcom, sizeof(struct plcom_softc),
+    vexpress_plcom_match, vexpress_plcom_attach, NULL, NULL);
+
+static int
+vexpress_plcom_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct axi_attach_args *aa = aux;
+
+	if (strcmp(aa->aa_name, "plcom") != 0)
+		return 0;
+
+	return 1;
+}
+
+static void
+vexpress_plcom_attach(device_t parent, device_t self, void *aux)
+{
+	struct plcom_softc *sc = device_private(self);
+	struct axi_attach_args *aa = aux;
+	void *ih;
+
+	sc->sc_dev = self;
+	sc->sc_frequency = VEXPRESS_REF_FREQ;
+	sc->sc_hwflags = PLCOM_HW_TXFIFO_DISABLE;
+	sc->sc_swflags = 0;
+	sc->sc_set_mcr = NULL;
+	sc->sc_set_mcr_arg = NULL;
+
+	sc->sc_pi.pi_type = PLCOM_TYPE_PL011;
+	sc->sc_pi.pi_flags = PLC_FLAG_32BIT_ACCESS;
+	sc->sc_pi.pi_iot = aa->aa_iot;
+	sc->sc_pi.pi_iobase = aa->aa_addr;
+
+	if (bus_space_map(aa->aa_iot, aa->aa_addr, PL011COM_UART_SIZE, 0,
+		&sc->sc_pi.pi_ioh)) {
+		aprint_error_dev(sc->sc_dev, "unable to map device\n");
+		return;
+	}
+	plcom_attach_subr(sc);
+
+	ih = intr_establish(aa->aa_irq, IPL_SERIAL, IST_LEVEL_LOW, plcomintr, sc);
+	if (ih == NULL)
+		panic("%s: cannot install interrupt handler",
+		    device_xname(sc->sc_dev));
+}
diff --git a/sys/arch/evbarm/vexpress/vexpress_plmmc.c b/sys/arch/evbarm/vexpress/vexpress_plmmc.c
new file mode 100644
index 0000000..3a2846f
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_plmmc.c
@@ -0,0 +1,91 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Interface to plmmc (PL181) MMC driver. */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include <sys/types.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+#include <sys/param.h>
+#include <sys/malloc.h>
+
+#include <sys/termios.h>
+
+#include <machine/intr.h>
+#include <sys/bus.h>
+
+#include <dev/ic/pl181reg.h>
+#include <dev/ic/pl181var.h>
+
+#include <evbarm/vexpress/platform.h>
+#include <evbarm/vexpress/vexpress_var.h>
+
+static int  plmmc_vexpress_match(device_t, cfdata_t, void *);
+static void plmmc_vexpress_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(vexpressplmmc, sizeof(struct plmmc_softc),
+    plmmc_vexpress_match, plmmc_vexpress_attach, NULL, NULL);
+
+static int
+plmmc_vexpress_match(device_t parent, cfdata_t cf, void *aux)
+{
+	return 1;
+}
+
+static void
+plmmc_vexpress_attach(device_t parent, device_t self, void *aux)
+{
+	struct plmmc_softc *sc = device_private(self);
+	struct axi_attach_args *aa = aux;
+	void *ih;
+
+	sc->sc_dev = self;
+	sc->sc_clock_freq = VEXPRESS_REF_FREQ;
+	sc->sc_bst = aa->aa_iot;
+	if (bus_space_map(aa->aa_iot, aa->aa_addr, 0x1000, 0,
+	    &sc->sc_bsh)) {
+		printf("%s: unable to map device\n", device_xname(sc->sc_dev));
+		return;
+	}
+
+	aprint_naive("\n");
+	aprint_normal("\n");
+
+        ih = intr_establish(aa->aa_irq, IPL_BIO, IST_LEVEL_LOW, plmmc_intr, sc);
+        if (ih == NULL)
+                panic("%s: cannot install interrupt handler",
+                    device_xname(sc->sc_dev));
+	plmmc_init(sc);
+}
+
diff --git a/sys/arch/evbarm/vexpress/vexpress_space.c b/sys/arch/evbarm/vexpress/vexpress_space.c
new file mode 100644
index 0000000..5c79822
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_space.c
@@ -0,0 +1,253 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * bus_space(9) support for Versatile Express AXI
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <uvm/uvm_extern.h>
+#include <sys/bus.h>
+
+bs_protos(vexpress);
+bs_protos(generic);
+bs_protos(generic_armv4);
+bs_protos(bs_notimpl);
+
+struct bus_space vexpress_bs_tag = {
+	/* cookie */
+	(void *) 0,
+
+	/* mapping/unmapping */
+	vexpress_bs_map,
+	vexpress_bs_unmap,
+	vexpress_bs_subregion,
+
+	/* allocation/deallocation */
+	vexpress_bs_alloc,	/* not implemented */
+	vexpress_bs_free,	/* not implemented */
+
+	/* get kernel virtual address */
+	vexpress_bs_vaddr,
+
+	/* mmap */
+	bs_notimpl_bs_mmap,
+
+	/* barrier */
+	vexpress_bs_barrier,
+
+	/* read (single) */
+	generic_bs_r_1,
+	generic_armv4_bs_r_2,
+	generic_bs_r_4,
+	bs_notimpl_bs_r_8,
+
+	/* read multiple */
+	generic_bs_rm_1,
+	generic_armv4_bs_rm_2,
+	generic_bs_rm_4,
+	bs_notimpl_bs_rm_8,
+
+	/* read region */
+	generic_bs_rr_1,
+	generic_armv4_bs_rr_2,
+	generic_bs_rr_4,
+	bs_notimpl_bs_rr_8,
+
+	/* write (single) */
+	generic_bs_w_1,
+	generic_armv4_bs_w_2,
+	generic_bs_w_4,
+	bs_notimpl_bs_w_8,
+
+	/* write multiple */
+	generic_bs_wm_1,
+	generic_armv4_bs_wm_2,
+	generic_bs_wm_4,
+	bs_notimpl_bs_wm_8,
+
+	/* write region */
+	generic_bs_wr_1,
+	generic_armv4_bs_wr_2,
+	generic_bs_wr_4,
+	bs_notimpl_bs_wr_8,
+
+	/* set multiple */
+	bs_notimpl_bs_sm_1,
+	bs_notimpl_bs_sm_2,
+	bs_notimpl_bs_sm_4,
+	bs_notimpl_bs_sm_8,
+
+	/* set region */
+	generic_bs_sr_1,
+	generic_armv4_bs_sr_2,
+	bs_notimpl_bs_sr_4,
+	bs_notimpl_bs_sr_8,
+
+	/* copy */
+	bs_notimpl_bs_c_1,
+	generic_armv4_bs_c_2,
+	bs_notimpl_bs_c_4,
+	bs_notimpl_bs_c_8,
+
+#ifdef __BUS_SPACE_HAS_STREAM_METHODS
+	/* read (single) */
+	generic_bs_r_1,
+	generic_armv4_bs_r_2,
+	generic_bs_r_4,
+	bs_notimpl_bs_r_8,
+
+	/* read multiple */
+	generic_bs_rm_1,
+	generic_armv4_bs_rm_2,
+	generic_bs_rm_4,
+	bs_notimpl_bs_rm_8,
+
+	/* read region */
+	generic_bs_rr_1,
+	generic_armv4_bs_rr_2,
+	generic_bs_rr_4,
+	bs_notimpl_bs_rr_8,
+
+	/* write (single) */
+	generic_bs_w_1,
+	generic_armv4_bs_w_2,
+	generic_bs_w_4,
+	bs_notimpl_bs_w_8,
+
+	/* write multiple */
+	generic_bs_wm_1,
+	generic_armv4_bs_wm_2,
+	generic_bs_wm_4,
+	bs_notimpl_bs_wm_8,
+
+	/* write region */
+	generic_bs_wr_1,
+	generic_armv4_bs_wr_2,
+	generic_bs_wr_4,
+	bs_notimpl_bs_wr_8,
+#endif
+};
+
+int
+vexpress_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
+    int flag, bus_space_handle_t * bshp)
+{
+	const struct pmap_devmap *pd;
+	paddr_t startpa, endpa, pa;
+	vaddr_t va;
+
+	if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) {
+		/* Device was statically mapped. */
+		*bshp = pd->pd_va + (bpa - pd->pd_pa);
+		return 0;
+	}
+	startpa = trunc_page(bpa);
+	endpa = round_page(bpa + size);
+
+	/* XXX use extent manager to check duplicate mapping */
+
+	va = uvm_km_alloc(kernel_map, endpa - startpa, 0,
+	    UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
+	if (!va)
+		return (ENOMEM);
+
+	*bshp = (bus_space_handle_t) (va + (bpa - startpa));
+
+	for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) {
+		pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE,
+		    (flag & BUS_SPACE_MAP_CACHEABLE) ? 0 : PMAP_NOCACHE);
+	}
+	pmap_update(pmap_kernel());
+
+	return (0);
+}
+
+void
+vexpress_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size)
+{
+	vaddr_t va;
+	vsize_t sz;
+
+	if (pmap_devmap_find_va(bsh, size) != NULL) {
+		/* Device was statically mapped; nothing to do. */
+		return;
+	}
+	va = trunc_page(bsh);
+	sz = round_page(bsh + size) - va;
+
+	pmap_kremove(va, sz);
+	pmap_update(pmap_kernel());
+	uvm_km_free(kernel_map, va, sz, UVM_KMF_VAONLY);
+}
+
+
+int
+vexpress_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset,
+    bus_size_t size, bus_space_handle_t * nbshp)
+{
+
+	*nbshp = bsh + offset;
+	return (0);
+}
+
+void
+vexpress_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset,
+    bus_size_t len, int flags)
+{
+
+	/* Nothing to do. */
+}
+
+void *
+vexpress_bs_vaddr(void *t, bus_space_handle_t bsh)
+{
+
+	return ((void *) bsh);
+}
+
+
+int
+vexpress_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend,
+    bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags,
+    bus_addr_t * bpap, bus_space_handle_t * bshp)
+{
+
+	panic("vexpress_io_bs_alloc(): not implemented\n");
+}
+
+void
+vexpress_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size)
+{
+
+	panic("vexpress_io_bs_free(): not implemented\n");
+}
diff --git a/sys/arch/evbarm/vexpress/vexpress_start.S b/sys/arch/evbarm/vexpress/vexpress_start.S
new file mode 100644
index 0000000..583daa8
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_start.S
@@ -0,0 +1,137 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "opt_cpuoptions.h"
+#include "opt_cputypes.h"
+#include "opt_multiprocessor.h"
+#include "opt_arm_debug.h"
+
+#include <arm/asm.h>
+#include <arm/armreg.h>
+#include "assym.h"
+#include "platform.h"
+
+RCSID("$NetBSD$")
+
+#define	XPUTC(n)	mov r0, n; bl xputc
+#define	XPUTC2(n)	mov r0, n; blx r11
+
+#define	INIT_MEMSIZE	128
+#define	TEMP_L1_TABLE	(KERNEL_BASE - KERNEL_BASE_VOFFSET + INIT_MEMSIZE * 0x100000 - L1_TABLE_SIZE)
+
+/*
+ * Kernel start routine for ODROID boards running on uboot firmware
+ * At this point, this code has been loaded into SDRAM
+ * and the MMU is off
+ */
+	.section .start,"ax",%progbits
+
+	.global	_C_LABEL(vexpress_start)
+_C_LABEL(vexpress_start):
+#ifdef __ARMEB__
+	setend	be			/* force big endian */
+#endif
+	/* Move into supervisor mode and disable IRQs/FIQs. */
+	cpsid	if, #PSR_SVC32_MODE
+
+	XPUTC('a')
+
+	bl	cortex_init
+
+	XPUTC('b')
+
+	/*
+	 * Set up a preliminary mapping in the MMU to allow us to run
+	 * at KERNEL_BASE with caches on.
+	 */
+	adr     r1, .Lmmu_init_table
+	movw    r0, #:lower16:TEMP_L1_TABLE
+	movt    r0, #:upper16:TEMP_L1_TABLE
+	bl      arm_boot_l1pt_init
+
+	XPUTC('c')
+
+	adr	r11, xputc
+	movw	lr, #:lower16:1f
+	movt	lr, #:upper16:1f
+	movw	r0, #:lower16:TEMP_L1_TABLE
+	movt	r0, #:upper16:TEMP_L1_TABLE
+	b	arm_cpuinit
+
+	.pushsection .text, "ax", %progbits
+	.align	0
+
+1:
+	XPUTC2('d')
+
+	b	start
+
+	.popsection
+
+	.align 0
+	.global xputc
+	.type	xputc,%function
+xputc:
+	movw	r2, #0x0000
+	movt	r2, #0x1c09
+	str	r0, [r2]
+	bx	lr
+
+#include <arm/cortex/a9_mpsubr.S>
+
+	.align  0
+.Lmmu_init_table:
+	/* Map KERNEL_BASE VA to SDRAM PA, write-back cacheable, shareable */
+	MMU_INIT(KERNEL_BASE, KERNEL_BASE - KERNEL_BASE_VOFFSET, INIT_MEMSIZE,
+		L1_S_PROTO_armv7 | L1_S_APv7_KRW | L1_S_CACHEABLE)
+
+#if KERNEL_BASE_VOFFSET
+	/* Map physical addresses of kernel 1:1 PA:VA write-back cacheable, shareable */
+	MMU_INIT(KERNEL_BASE - KERNEL_BASE_VOFFSET,
+		KERNEL_BASE - KERNEL_BASE_VOFFSET, INIT_MEMSIZE,
+		L1_S_PROTO_armv7 | L1_S_APv7_KRW | L1_S_CACHEABLE)
+#endif
+
+	/* Map VEXPRESS CORE (so console will work) */
+	MMU_INIT(VEXPRESS_CORE_VBASE, VEXPRESS_CORE_PBASE,
+		VEXPRESS_CORE_SIZE / L1_S_SIZE,
+		L1_S_PROTO_armv7 | L1_S_APv7_KRW | L1_S_V6_XN)
+
+	/* Map VEXPRESS CORE (so console will work) */
+	MMU_INIT(VEXPRESS_CORE_PBASE, VEXPRESS_CORE_PBASE,
+		VEXPRESS_CORE_SIZE / L1_S_SIZE,
+		L1_S_PROTO_armv7 | L1_S_APv7_KRW | L1_S_V6_XN)
+
+        /* end of table */
+        MMU_INIT(0, 0, 0, 0)
+
+
+END(vexpress_start)
diff --git a/sys/arch/evbarm/vexpress/vexpress_var.h b/sys/arch/evbarm/vexpress/vexpress_var.h
new file mode 100644
index 0000000..f90cb6c
--- /dev/null
+++ b/sys/arch/evbarm/vexpress/vexpress_var.h
@@ -0,0 +1,48 @@
+/*	$NetBSD$	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Sergio L. Pascual.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include <sys/bus.h>
+
+struct axi_attach_args {
+	const char *aa_name;
+	bus_space_tag_t aa_iot;
+	bus_dma_tag_t aa_dmat;
+	bus_addr_t aa_addr;
+	bus_size_t aa_size;
+	int aa_irq;
+	int aa_irqbase;
+};
+
+extern struct bus_space vexpress_bs_tag;
+extern struct arm32_bus_dma_tag vexpress_bus_dma_tag;
+extern bus_space_tag_t vexpress_armcore_bst;
+extern bus_space_handle_t vexpress_armcore_bsh;
diff --git a/sys/dev/ic/lan9118.c b/sys/dev/ic/lan9118.c
index e5fe6d6..a85f998 100644
--- a/sys/dev/ic/lan9118.c
+++ b/sys/dev/ic/lan9118.c
@@ -169,6 +169,10 @@ lan9118_attach(struct lan9118_softc *sc)
 		return EINVAL;
 	}
 
+	/* Configure interrupt polarity */
+	bus_space_write_4(sc->sc_iot, sc->sc_ioh, LAN9118_IRQ_CFG,
+	    LAN9118_IRQ_CFG_IRQ_TYPE | LAN9118_IRQ_CFG_IRQ_POL);
+
 	val = bus_space_read_4(sc->sc_iot, sc->sc_ioh, LAN9118_ID_REV);
 	sc->sc_id = LAN9118_ID_REV_ID(val);
 	sc->sc_rev = LAN9118_ID_REV_REV(val);
diff --git a/sys/arch/arm/include/vfpreg.h b/sys/arch/arm/include/vfpreg.h
index 7c25b49..cc294f9 100644
--- a/sys/arch/arm/include/vfpreg.h
+++ b/sys/arch/arm/include/vfpreg.h
@@ -64,6 +64,7 @@
 #define FPU_VFP_CORTEXA8	0x410330c0
 #define FPU_VFP_CORTEXA9	0x41033090
 #define FPU_VFP_CORTEXA15	0x410330f0
+#define FPU_VFP_CORTEXA15_QEMU	0x410430f0
 #define FPU_VFP_MV88SV58XX	0x56022090
 
 #define VFP_FPEXC_EX		0x80000000	/* EXception status bit */
diff --git a/sys/arch/arm/vfp/vfp_init.c b/sys/arch/arm/vfp/vfp_init.c
index c5ee1f7..322a0be 100644
--- a/sys/arch/arm/vfp/vfp_init.c
+++ b/sys/arch/arm/vfp/vfp_init.c
@@ -94,6 +94,7 @@ load_vfpregs(const struct vfpreg *fregs)
 	case FPU_VFP_CORTEXA8:
 	case FPU_VFP_CORTEXA9:
 	case FPU_VFP_CORTEXA15:
+	case FPU_VFP_CORTEXA15_QEMU:
 #endif
 		load_vfpregs_hi(fregs->vfp_regs);
 #ifdef CPU_ARM11
@@ -115,6 +116,7 @@ save_vfpregs(struct vfpreg *fregs)
 	case FPU_VFP_CORTEXA8:
 	case FPU_VFP_CORTEXA9:
 	case FPU_VFP_CORTEXA15:
+	case FPU_VFP_CORTEXA15_QEMU:
 #endif
 		save_vfpregs_hi(fregs->vfp_regs);
 #ifdef CPU_ARM11
@@ -312,6 +314,7 @@ vfp_attach(struct cpu_info *ci)
 	case FPU_VFP_CORTEXA8:
 	case FPU_VFP_CORTEXA9:
 	case FPU_VFP_CORTEXA15:
+	case FPU_VFP_CORTEXA15_QEMU:
 		if (armreg_cpacr_read() & CPACR_V7_ASEDIS) {
 			model = "VFP 4.0+";
 		} else {


Home | Main Index | Thread Index | Old Index