Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/cortex Allow l2cc base to gotten from device pr...



details:   https://anonhg.NetBSD.org/src/rev/cac68fd81dac
branches:  trunk
changeset: 795515:cac68fd81dac
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Apr 16 22:40:00 2014 +0000

description:
Allow l2cc base to gotten from device properties.

diffstat:

 sys/arch/arm/cortex/pl310.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r cdfb26cbc68f -r cac68fd81dac sys/arch/arm/cortex/pl310.c
--- a/sys/arch/arm/cortex/pl310.c       Wed Apr 16 22:34:02 2014 +0000
+++ b/sys/arch/arm/cortex/pl310.c       Wed Apr 16 22:40:00 2014 +0000
@@ -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 @@
        { 4, " r2p0" },
        { 5, " r3p0" },
        { 6, " r3p1" },
+       { 7, " r3p1a" },
        { 8, " r3p2" },
        { 9, " r3p3" },
 };
@@ -134,6 +135,12 @@
         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 @@
        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);



Home | Main Index | Thread Index | Old Index