Module Name: src
Committed By: matt
Date: Wed Apr 16 22:40:00 UTC 2014
Modified Files:
src/sys/arch/arm/cortex: pl310.c
Log Message:
Allow l2cc base to gotten from device properties.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/cortex/pl310.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/cortex/pl310.c
diff -u src/sys/arch/arm/cortex/pl310.c:1.14 src/sys/arch/arm/cortex/pl310.c:1.15
--- src/sys/arch/arm/cortex/pl310.c:1.14 Thu Mar 20 22:28:37 2014
+++ src/sys/arch/arm/cortex/pl310.c Wed Apr 16 22:40:00 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: pl310.c,v 1.14 2014/03/20 22:28:37 matt Exp $ */
+/* $NetBSD: pl310.c,v 1.15 2014/04/16 22:40:00 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pl310.c,v 1.14 2014/03/20 22:28:37 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl310.c,v 1.15 2014/04/16 22:40:00 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -124,6 +124,7 @@ static const struct {
{ 4, " r2p0" },
{ 5, " r3p0" },
{ 6, " r3p1" },
+ { 7, " r3p1a" },
{ 8, " r3p2" },
{ 9, " r3p3" },
};
@@ -134,6 +135,12 @@ arml2cc_attach(device_t parent, device_t
struct arml2cc_softc * const sc = device_private(self);
struct mpcore_attach_args * const mpcaa = aux;
const char * const xname = device_xname(self);
+ prop_dictionary_t dict = device_properties(self);
+ uint32_t off;
+
+ if (!prop_dictionary_get_uint32(dict, "offset", &off)) {
+ off = L2CC_BASE;
+ }
arml2cc_sc = sc;
sc->sc_dev = self;
@@ -150,7 +157,7 @@ arml2cc_attach(device_t parent, device_t
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH);
bus_space_subregion(sc->sc_memt, mpcaa->mpcaa_memh,
- L2CC_BASE, L2CC_SIZE, &sc->sc_memh);
+ off, L2CC_SIZE, &sc->sc_memh);
uint32_t id = arml2cc_read_4(sc, L2C_CACHE_ID);
u_int rev = __SHIFTOUT(id, CACHE_ID_REV);