Tue Oct 4 15:23:40 2016 UTC ()
Support locator "cs".


(kiyohara)
diff -r1.33 -r1.34 src/sys/arch/arm/omap/files.omap2
diff -r1.9 -r1.10 src/sys/arch/arm/omap/omap2_gpmc.c

cvs diff -r1.33 -r1.34 src/sys/arch/arm/omap/Attic/files.omap2 (expand / switch to unified diff)

--- src/sys/arch/arm/omap/Attic/files.omap2 2016/07/04 15:35:55 1.33
+++ src/sys/arch/arm/omap/Attic/files.omap2 2016/10/04 15:23:40 1.34
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: files.omap2,v 1.33 2016/07/04 15:35:55 kiyohara Exp $ 1# $NetBSD: files.omap2,v 1.34 2016/10/04 15:23:40 kiyohara Exp $
2# 2#
3# Configuration info for Texas Instruments OMAP2/OMAP3 CPU support 3# Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
4# Based on xscale/files.pxa2x0 4# Based on xscale/files.pxa2x0
5# 5#
6 6
7include "arch/arm/pic/files.pic" 7include "arch/arm/pic/files.pic"
8include "arch/arm/cortex/files.cortex" 8include "arch/arm/cortex/files.cortex"
9 9
10file arch/arm/arm32/irq_dispatch.S 10file arch/arm/arm32/irq_dispatch.S
11file arch/arm/omap/omap_dma.c 11file arch/arm/omap/omap_dma.c
12 12
13# Memory size in megabytes 13# Memory size in megabytes
14defparam opt_omap.h MEMSIZE 14defparam opt_omap.h MEMSIZE
@@ -107,27 +107,27 @@ file arch/arm/omap/omap_wdt.c omapwdt32 @@ -107,27 +107,27 @@ file arch/arm/omap/omap_wdt.c omapwdt32
107 107
108attach omapwdt32k at obio with obiowdt32k 108attach omapwdt32k at obio with obiowdt32k
109file arch/arm/omap/obio_wdt.c obiowdt32k 109file arch/arm/omap/obio_wdt.c obiowdt32k
110 110
111# L3 Interconnect 111# L3 Interconnect
112device L3i { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0] 112device L3i { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0]
113 } : bus_space_generic 113 } : bus_space_generic
114attach L3i at mainbus 114attach L3i at mainbus
115file arch/arm/omap/omap2_l3i.c omap2 | omap3 115file arch/arm/omap/omap2_l3i.c omap2 | omap3
116 116
117# General Purpose Memory Controller 117# General Purpose Memory Controller
118# XXX some addl. chip select config parms may be desired here (e.g. timing) 118# XXX some addl. chip select config parms may be desired here (e.g. timing)
119# XXX so far we just use the setup established by boot firmware 119# XXX so far we just use the setup established by boot firmware
120device gpmc { [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0] 120device gpmc { [cs=-1], [addr=-1], [size=0], [intr=-1], [mult=1], [nobyteacc=0]
121 } : bus_space_generic 121 } : bus_space_generic
122attach gpmc at mainbus 122attach gpmc at mainbus
123file arch/arm/omap/omap2_gpmc.c gpmc 123file arch/arm/omap/omap2_gpmc.c gpmc
124 124
125device edma 125device edma
126attach edma at mainbus 126attach edma at mainbus
127file arch/arm/omap/omap_edma.c edma needs-flag 127file arch/arm/omap/omap_edma.c edma needs-flag
128 128
129# TI OTG controller 129# TI OTG controller
130define tiotg_port {[port = -1], [mode = -1]} 130define tiotg_port {[port = -1], [mode = -1]}
131device tiotg: tiotg_port 131device tiotg: tiotg_port
132attach tiotg at mainbus 132attach tiotg at mainbus
133file arch/arm/omap/tiotg.c tiotg 133file arch/arm/omap/tiotg.c tiotg

cvs diff -r1.9 -r1.10 src/sys/arch/arm/omap/Attic/omap2_gpmc.c (expand / switch to unified diff)

--- src/sys/arch/arm/omap/Attic/omap2_gpmc.c 2011/07/01 20:30:21 1.9
+++ src/sys/arch/arm/omap/Attic/omap2_gpmc.c 2016/10/04 15:23:40 1.10
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1/* $Id: omap2_gpmc.c,v 1.9 2011/07/01 20:30:21 dyoung Exp $ */ 1/* $Id: omap2_gpmc.c,v 1.10 2016/10/04 15:23:40 kiyohara Exp $ */
2 2
3/* adapted from: */ 3/* adapted from: */
4/* $NetBSD: omap2_gpmc.c,v 1.9 2011/07/01 20:30:21 dyoung Exp $ */ 4/* $NetBSD: omap2_gpmc.c,v 1.10 2016/10/04 15:23:40 kiyohara Exp $ */
5 5
6 6
7/* 7/*
8 * Autoconfiguration support for the Texas Instruments OMAP GPMC bus. 8 * Autoconfiguration support for the Texas Instruments OMAP GPMC bus.
9 * Based on arm/omap/omap_emifs.c which in turn was derived 9 * Based on arm/omap/omap_emifs.c which in turn was derived
10 * Based on arm/xscale/pxa2x0.c which in turn was derived 10 * Based on arm/xscale/pxa2x0.c which in turn was derived
11 * from arm/sa11x0/sa11x0.c 11 * from arm/sa11x0/sa11x0.c
12 * 12 *
13 * Copyright (c) 2002, 2005 Genetec Corporation. All rights reserved. 13 * Copyright (c) 2002, 2005 Genetec Corporation. All rights reserved.
14 * Written by Hiroyuki Bessho for Genetec Corporation. 14 * Written by Hiroyuki Bessho for Genetec Corporation.
15 * 15 *
16 * Redistribution and use in source and binary forms, with or without 16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions 17 * modification, are permitted provided that the following conditions
@@ -92,27 +92,27 @@ @@ -92,27 +92,27 @@
92 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 92 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
93 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 93 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
94 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 94 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
95 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 95 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
96 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 96 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
97 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 97 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
98 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 98 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
99 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 99 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
100 * SUCH DAMAGE. 100 * SUCH DAMAGE.
101 */ 101 */
102 102
103#include "opt_omap.h" 103#include "opt_omap.h"
104#include <sys/cdefs.h> 104#include <sys/cdefs.h>
105__KERNEL_RCSID(0, "$NetBSD: omap2_gpmc.c,v 1.9 2011/07/01 20:30:21 dyoung Exp $"); 105__KERNEL_RCSID(0, "$NetBSD: omap2_gpmc.c,v 1.10 2016/10/04 15:23:40 kiyohara Exp $");
106 106
107#include "locators.h" 107#include "locators.h"
108 108
109#include <sys/param.h> 109#include <sys/param.h>
110#include <sys/systm.h> 110#include <sys/systm.h>
111#include <sys/device.h> 111#include <sys/device.h>
112#include <sys/kernel.h> 112#include <sys/kernel.h>
113#include <sys/reboot.h> 113#include <sys/reboot.h>
114 114
115#include <machine/cpu.h> 115#include <machine/cpu.h>
116#include <sys/bus.h> 116#include <sys/bus.h>
117 117
118#include <arm/cpufunc.h> 118#include <arm/cpufunc.h>
@@ -268,27 +268,42 @@ gpmc_search(device_t parent, cfdata_t cf @@ -268,27 +268,42 @@ gpmc_search(device_t parent, cfdata_t cf
268 break; 268 break;
269 default: 269 default:
270 panic("Unsupported EMIFS multiplier."); 270 panic("Unsupported EMIFS multiplier.");
271 break; 271 break;
272 } 272 }
273 } 273 }
274 274
275 aa.gpmc_dmac = sc->sc_dmac; 275 aa.gpmc_dmac = sc->sc_dmac;
276 aa.gpmc_addr = cf->cf_loc[GPMCCF_ADDR]; 276 aa.gpmc_addr = cf->cf_loc[GPMCCF_ADDR];
277 aa.gpmc_size = cf->cf_loc[GPMCCF_SIZE]; 277 aa.gpmc_size = cf->cf_loc[GPMCCF_SIZE];
278 aa.gpmc_intr = cf->cf_loc[GPMCCF_INTR]; 278 aa.gpmc_intr = cf->cf_loc[GPMCCF_INTR];
279 279
280 cs = &sc->sc_csconfig[0]; 280 cs = &sc->sc_csconfig[0];
281 for (i=0; i < GPMC_NCS; i++) { 281 for (i = 0; i < GPMC_NCS; i++) {
 282 if (cf->cf_loc[GPMCCF_CS] != GPMCCF_CS_DEFAULT) {
 283 if (i != cf->cf_loc[GPMCCF_CS]) {
 284 cs++;
 285 continue;
 286 }
 287
 288 if (aa.gpmc_addr != GPMCCF_ADDR_DEFAULT
 289 && aa.gpmc_addr != cs->cs_addr)
 290 panic("cs:addr missmatch:"
 291 " cs %d(0x%08lx), addr 0x%08lx\n",
 292 cf->cf_loc[GPMCCF_CS], cs->cs_addr,
 293 aa.gpmc_addr);
 294 aa.gpmc_addr = cs->cs_addr;
 295 }
 296
282 if ((aa.gpmc_addr >= cs->cs_addr) 297 if ((aa.gpmc_addr >= cs->cs_addr)
283 && (aa.gpmc_addr < (cs->cs_addr + cs->cs_size))) { 298 && (aa.gpmc_addr < (cs->cs_addr + cs->cs_size))) {
284 /* XXX 299 /* XXX
285 * if size was specified, then check it too 300 * if size was specified, then check it too
286 * otherwise just assume it is OK 301 * otherwise just assume it is OK
287 */ 302 */
288 if ((aa.gpmc_size != GPMCCF_SIZE_DEFAULT) 303 if ((aa.gpmc_size != GPMCCF_SIZE_DEFAULT)
289 && ((aa.gpmc_addr + aa.gpmc_size) 304 && ((aa.gpmc_addr + aa.gpmc_size)
290 >= (cs->cs_addr + cs->cs_size))) 305 >= (cs->cs_addr + cs->cs_size)))
291 continue; /* NG */ 306 continue; /* NG */
292 aa.gpmc_cs = i; 307 aa.gpmc_cs = i;
293 if (config_match(parent, cf, &aa)) { 308 if (config_match(parent, cf, &aa)) {
294 config_attach(parent, cf, &aa, gpmc_print); 309 config_attach(parent, cf, &aa, gpmc_print);