diff --git a/sys/arch/arm/gemini/files.gemini b/sys/arch/arm/gemini/files.gemini index a390d75f16ff..a023f51e937d 100644 --- a/sys/arch/arm/gemini/files.gemini +++ b/sys/arch/arm/gemini/files.gemini @@ -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 diff --git a/sys/arch/arm/gemini/gemini_obio.c b/sys/arch/arm/gemini/gemini_obio.c index 5c817c84775d..38420ccd2109 100644 --- a/sys/arch/arm/gemini/gemini_obio.c +++ b/sys/arch/arm/gemini/gemini_obio.c @@ -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 -__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; diff --git a/sys/arch/arm/gemini/gemini_pci.c b/sys/arch/arm/gemini/gemini_pci.c index ed2cfe23f565..9381175be9b5 100644 --- a/sys/arch/arm/gemini/gemini_pci.c +++ b/sys/arch/arm/gemini/gemini_pci.c @@ -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 -__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 @@ -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); diff --git a/sys/arch/evbarm/conf/GEMINI b/sys/arch/evbarm/conf/GEMINI index 4b8ee68ca098..4caff70f5cb4 100644 --- a/sys/arch/evbarm/conf/GEMINI +++ b/sys/arch/evbarm/conf/GEMINI @@ -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? diff --git a/sys/arch/evbarm/conf/GEMINI_MASTER b/sys/arch/evbarm/conf/GEMINI_MASTER index 1318614ed388..7cb5d3b625f6 100644 --- a/sys/arch/evbarm/conf/GEMINI_MASTER +++ b/sys/arch/evbarm/conf/GEMINI_MASTER @@ -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? diff --git a/sys/arch/evbarm/conf/GEMINI_SLAVE b/sys/arch/evbarm/conf/GEMINI_SLAVE index 86a376a1835f..7456bf8ca0b3 100644 --- a/sys/arch/evbarm/conf/GEMINI_SLAVE +++ b/sys/arch/evbarm/conf/GEMINI_SLAVE @@ -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?