add option GEMINI_BUSBASE to define kernel offset between
kernel physical addr and (DMA master) bus addr
This commit is contained in:
parent
b0aa811639
commit
0fbe2f865b
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.gemini,v 1.4 2008/11/11 19:54:38 cliff Exp $
|
||||
# $NetBSD: files.gemini,v 1.5 2008/11/13 07:21:59 cliff Exp $
|
||||
#
|
||||
# Configuration info for GEMINI CPU support
|
||||
# Based on omap/files.omap2
|
||||
@ -11,6 +11,7 @@ file arch/arm/arm32/irq_dispatch.S
|
||||
# Memory size in megabytes
|
||||
defparam opt_gemini.h MEMSIZE
|
||||
defflag opt_gemini.h GEMINI
|
||||
defparam opt_gemini.h GEMINI_BUSBASE: GEMINI
|
||||
defflag opt_gemini.h SL3516: GEMINI
|
||||
defflag opt_gemini.h GEMINI_MASTER: GEMINI
|
||||
defflag opt_gemini.h GEMINI_SLAVE: GEMINI
|
||||
|
@ -1,12 +1,13 @@
|
||||
/* $NetBSD: gemini_obio.c,v 1.5 2008/11/13 05:03:05 cliff Exp $ */
|
||||
/* $NetBSD: gemini_obio.c,v 1.6 2008/11/13 07:21:59 cliff Exp $ */
|
||||
|
||||
/* adapted from:
|
||||
* $Id: gemini_obio.c,v 1.5 2008/11/13 05:03:05 cliff Exp $
|
||||
* NetBSD: omap2_obio.c,v 1.5 2008/10/21 18:50:25 matt Exp
|
||||
*/
|
||||
|
||||
/*
|
||||
* Autoconfiguration support for the Texas Instruments OMAP "On Board" I/O.
|
||||
* Autoconfiguration support for the Gemini "On Board" I/O.
|
||||
*
|
||||
* Based on arm/omap/omap2_obio.c which in turn was derived
|
||||
* Based on arm/omap/omap_emifs.c which in turn was derived
|
||||
* Based on arm/xscale/pxa2x0.c which in turn was derived
|
||||
* from arm/sa11x0/sa11x0.c
|
||||
@ -103,7 +104,7 @@
|
||||
|
||||
#include "opt_gemini.h"
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_obio.c,v 1.5 2008/11/13 05:03:05 cliff Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_obio.c,v 1.6 2008/11/13 07:21:59 cliff Exp $");
|
||||
|
||||
#include "locators.h"
|
||||
#include "obio.h"
|
||||
@ -164,9 +165,9 @@ obio_attach(device_t parent, device_t self, void *aux)
|
||||
|
||||
aprint_normal(": On-Board IO\n");
|
||||
|
||||
#ifdef GEMINI_SLAVE
|
||||
#if (GEMINI_BUSBASE != 0)
|
||||
sc->sc_dmarange.dr_sysbase = 0;
|
||||
sc->sc_dmarange.dr_busbase = (128 - MEMSIZE) * 1024 * 1024;
|
||||
sc->sc_dmarange.dr_busbase = (GEMINI_BUSBASE * 1024 * 1024);
|
||||
sc->sc_dmarange.dr_len = MEMSIZE * 1024 * 1024;
|
||||
gemini_bus_dma_tag._ranges = &sc->sc_dmarange;
|
||||
gemini_bus_dma_tag._nranges = 1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gemini_pci.c,v 1.4 2008/11/13 05:03:05 cliff Exp $ */
|
||||
/* $NetBSD: gemini_pci.c,v 1.5 2008/11/13 07:21:59 cliff Exp $ */
|
||||
|
||||
/* adapted from:
|
||||
* NetBSD: i80312_pci.c,v 1.9 2005/12/11 12:16:51 christos Exp
|
||||
@ -44,7 +44,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_pci.c,v 1.4 2008/11/13 05:03:05 cliff Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_pci.c,v 1.5 2008/11/13 07:21:59 cliff Exp $");
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
@ -225,16 +225,9 @@ gemini_pci_init(pci_chipset_tag_t pc, void *cookie)
|
||||
|
||||
pci_configure_bus(pc, ioext, memext, NULL, 0, arm_dcache_align);
|
||||
|
||||
#if defined(GEMINI_SLAVE)
|
||||
gemini_pci_conf_write(sc, 0, GEMINI_PCI_CFG_REG_MEM1,
|
||||
PCI_CFG_REG_MEM_BASE(
|
||||
GEMINI_DRAM_BASE + ((128 - MEMSIZE) * 1024 * 1024))
|
||||
| gemini_pci_cfg_reg_mem_size(MEMSIZE * 1024 * 1024));
|
||||
#else
|
||||
gemini_pci_conf_write(sc, 0, GEMINI_PCI_CFG_REG_MEM1,
|
||||
PCI_CFG_REG_MEM_BASE(GEMINI_DRAM_BASE)
|
||||
| gemini_pci_cfg_reg_mem_size(MEMSIZE * 1024 * 1024));
|
||||
#endif
|
||||
PCI_CFG_REG_MEM_BASE((GEMINI_DRAM_BASE + (GEMINI_BUSBASE * 1024 * 1024)))
|
||||
| gemini_pci_cfg_reg_mem_size(MEMSIZE * 1024 * 1024));
|
||||
|
||||
extent_destroy(ioext);
|
||||
extent_destroy(memext);
|
||||
|
@ -157,6 +157,9 @@ cpu0 at mainbus?
|
||||
# Specify the memory size in megabytes.
|
||||
options MEMSIZE=128
|
||||
|
||||
# Specify the (DMA) Bus Address base in megabytes
|
||||
options GEMINI_BUSBASE=0
|
||||
|
||||
# On-board IO
|
||||
obio0 at mainbus?
|
||||
|
||||
|
@ -156,6 +156,9 @@ cpu0 at mainbus?
|
||||
# Specify the memory size in megabytes.
|
||||
options MEMSIZE=64
|
||||
|
||||
# Specify the (DMA) Bus Address base in megabytes
|
||||
options GEMINI_BUSBASE=0
|
||||
|
||||
# On-board IO
|
||||
obio0 at mainbus?
|
||||
|
||||
|
@ -156,6 +156,9 @@ cpu0 at mainbus?
|
||||
# Specify the memory size in megabytes.
|
||||
options MEMSIZE=64
|
||||
|
||||
# Specify the (DMA) Bus Address base in megabytes
|
||||
options GEMINI_BUSBASE=64
|
||||
|
||||
# On-board IO
|
||||
obio0 at mainbus?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user