From 5d11bdc65147dbdc5172b3be3fc6404a77b6b7e3 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Wed, 17 Jun 2009 03:09:13 +0000 Subject: [PATCH] correct data/instruction memory sizes for non-ixp425 parts (these are only used to bounds-check writes when loading firmware) --- sys/arm/xscale/ixp425/ixp425_npe.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arm/xscale/ixp425/ixp425_npe.c b/sys/arm/xscale/ixp425/ixp425_npe.c index 0aa162a95c00..fe102ebceed3 100644 --- a/sys/arm/xscale/ixp425/ixp425_npe.c +++ b/sys/arm/xscale/ixp425/ixp425_npe.c @@ -306,8 +306,14 @@ ixpnpe_attach(device_t dev, int npeid) sc->sc_nrefs = 1; sc->sc_size = config->size; - sc->insMemSize = config->ins_memsize; /* size of instruction memory */ - sc->dataMemSize = config->data_memsize; /* size of data memory */ + if (cpu_is_ixp42x()) { + /* NB: instruction/data memory sizes are NPE-dependent */ + sc->insMemSize = config->ins_memsize; + sc->dataMemSize = config->data_memsize; + } else { + sc->insMemSize = IXP46X_NPEDL_INS_MEMSIZE_WORDS; + sc->dataMemSize = IXP46X_NPEDL_DATA_MEMSIZE_WORDS; + } if (bus_space_map(sc->sc_iot, config->base, sc->sc_size, 0, &sc->sc_ioh)) panic("%s: Cannot map registers", device_get_name(dev));