Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys/arch/algor/algor Check in work-in-progress of P-603...



details:   https://anonhg.NetBSD.org/src/rev/b905a052894b
branches:  nathanw_sa
changeset: 504801:b905a052894b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jun 22 06:02:55 2001 +0000

description:
Check in work-in-progress of P-6032 support.  This is not tested,
but is meant for back-up purposes.

diffstat:

 sys/arch/algor/algor/algor_p6032_bus_io.c  |   67 ++++++++++++++++++
 sys/arch/algor/algor/algor_p6032_bus_mem.c |   82 ++++++++++++++++++++++
 sys/arch/algor/algor/algor_p6032_dma.c     |  104 +++++++++++++++++++++++++++++
 sys/arch/algor/algor/algor_p6032reg.h      |   60 ++++++++++++++++
 sys/arch/algor/algor/algor_p6032var.h      |   91 +++++++++++++++++++++++++
 sys/arch/algor/algor/led.c                 |   93 +++++++++++++++++++++++++
 6 files changed, 497 insertions(+), 0 deletions(-)

diffs (truncated from 521 to 300 lines):

diff -r 3b18b24c5d82 -r b905a052894b sys/arch/algor/algor/algor_p6032_bus_io.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/algor/algor/algor_p6032_bus_io.c Fri Jun 22 06:02:55 2001 +0000
@@ -0,0 +1,67 @@
+/*     $NetBSD: algor_p6032_bus_io.c,v 1.1.8.2 2001/06/22 06:02:55 thorpej Exp $       */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Platform-specific PCI bus I/O support for the Algorithmics P-6032.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/syslog.h>
+#include <sys/device.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <machine/locore.h>
+
+#include <algor/algor/algor_p6032reg.h>
+#include <algor/algor/algor_p6032var.h>
+
+#define        CHIP            algor_p6032
+
+#define        CHIP_EX_MALLOC_SAFE(v)  (((struct p6032_config *)(v))->ac_mallocsafe)
+#define        CHIP_IO_EXTENT(v)       (((struct p6032_config *)(v))->ac_io_ex)
+
+/* IO region 1 */
+#define        CHIP_IO_W1_BUS_START(v) 0x00000000UL
+#define        CHIP_IO_W1_BUS_END(v)   0x000fffffUL
+#define        CHIP_IO_W1_SYS_START(v) ((u_long)BONITO_PCIIO_BASE)
+#define        CHIP_IO_W1_SYS_END(v)   ((u_long)BONITO_PCIIO_BASE + 0x000fffffUL)
+
+#include <algor/pci/pci_alignstride_bus_io_chipdep.c>
diff -r 3b18b24c5d82 -r b905a052894b sys/arch/algor/algor/algor_p6032_bus_mem.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/algor/algor/algor_p6032_bus_mem.c        Fri Jun 22 06:02:55 2001 +0000
@@ -0,0 +1,82 @@
+/*     $NetBSD: algor_p6032_bus_mem.c,v 1.1.8.2 2001/06/22 06:02:55 thorpej Exp $      */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Platform-specific PCI bus memory support for the Algorithmics P-6032.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/syslog.h>
+#include <sys/device.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <machine/locore.h>
+
+#include <algor/algor/algor_p6032reg.h>
+#include <algor/algor/algor_p6032var.h>
+
+#define        CHIP            algor_p6032
+
+#define        CHIP_EX_MALLOC_SAFE(v)  (((struct p6032_config *)(v))->ac_mallocsafe)
+#define        CHIP_MEM_EXTENT(v)      (((struct p6032_config *)(v))->ac_mem_ex)
+
+/*
+ * There are actually 3 PCILO memory windows, but PMON configures them
+ * so that they map PCI memory space contiguously.
+ */
+
+/* MEM region 1 */
+#define        CHIP_MEM_W1_BUS_START(v)        0x00000000UL
+#define        CHIP_MEM_W1_BUS_END(v)          0x0bffffffUL
+#define        CHIP_MEM_W1_SYS_START(v)        ((u_long)BONITO_PCILO_BASE)
+#define        CHIP_MEM_W1_SYS_END(v)          ((u_long)BONITO_PCILO_BASE + \
+                                        0x0bffffffUL)
+
+#if 0 /* XXX Should implement access to this via TLB or 64-bit KSEG */
+/* MEM region 2 */
+#define        CHIP_MEM_W2_BUS_START(v)        0x20000000UL
+#define        CHIP_MEM_W2_BUS_END(v)          0xffffffffUL
+#define        CHIP_MEM_W2_SYS_START(v)        ((u_long)BONITO_PCIHI_BASE)
+#define        CHIP_MEM_W2_SYS_END(v)          ((u_long)BONITO_PCIHI_BASE + \
+                                        0xe0000000UL)
+#endif
+
+#include <algor/pci/pci_alignstride_bus_mem_chipdep.c>
diff -r 3b18b24c5d82 -r b905a052894b sys/arch/algor/algor/algor_p6032_dma.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/algor/algor/algor_p6032_dma.c    Fri Jun 22 06:02:55 2001 +0000
@@ -0,0 +1,104 @@
+/*     $NetBSD: algor_p6032_dma.c,v 1.1.8.2 2001/06/22 06:02:55 thorpej Exp $  */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Platform-specific DMA support for the Algorithmics P-6032.
+ */
+
+#include <sys/param.h>
+
+#define        _ALGOR_BUS_DMA_PRIVATE
+#include <machine/bus.h>
+
+#include <algor/algor/algor_p6032reg.h>
+#include <algor/algor/algor_p6032var.h>
+
+#include <dev/isa/isavar.h>
+
+void
+algor_p6032_dma_init(struct p6032_config *acp)
+{
+       bus_dma_tag_t t;
+
+       /*
+        * Initialize the DMA tag used for PCI DMA.
+        */
+       t = &acp->ac_pci_dmat;
+       t->_cookie = acp;
+       t->_wbase = P6032_DMA_PCI_PCIBASE;
+       t->_physbase = P6032_DMA_PCI_PHYSBASE;
+       t->_wsize = P6032_DMA_PCI_SIZE;
+       t->_dmamap_create = _bus_dmamap_create;
+       t->_dmamap_destroy = _bus_dmamap_destroy;
+       t->_dmamap_load = _bus_dmamap_load;
+       t->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
+       t->_dmamap_load_uio = _bus_dmamap_load_uio;
+       t->_dmamap_load_raw = _bus_dmamap_load_raw;
+       t->_dmamap_unload = _bus_dmamap_unload;
+       t->_dmamap_sync = _bus_dmamap_sync;
+
+       t->_dmamem_alloc = _bus_dmamem_alloc;
+       t->_dmamem_free = _bus_dmamem_free;
+       t->_dmamem_map = _bus_dmamem_map;
+       t->_dmamem_unmap = _bus_dmamem_unmap;
+       t->_dmamem_mmap = _bus_dmamem_mmap;
+
+       /*
+        * Initialize the DMA tag usd for ISA DMA.
+        */
+       t = &acp->ac_isa_dmat;
+       t->_cookie = acp;
+       t->_wbase = P6032_DMA_ISA_PCIBASE;
+       t->_physbase = P6032_DMA_ISA_PHYSBASE;
+       t->_wsize = P6032_DMA_ISA_SIZE;
+
+       t->_dmamap_create = isadma_bounce_dmamap_create;
+       t->_dmamap_destroy = isadma_bounce_dmamap_destroy;
+       t->_dmamap_load = isadma_bounce_dmamap_load;
+       t->_dmamap_load_mbuf = isadma_bounce_dmamap_load_mbuf;
+       t->_dmamap_load_uio = isadma_bounce_dmamap_load_uio;
+       t->_dmamap_load_raw = isadma_bounce_dmamap_load_raw;
+       t->_dmamap_unload = isadma_bounce_dmamap_unload;
+       t->_dmamap_sync = isadma_bounce_dmamap_sync;
+
+       t->_dmamem_alloc = isadma_bounce_dmamem_alloc;
+       t->_dmamem_free = _bus_dmamem_free;
+       t->_dmamem_map = _bus_dmamem_map;
+       t->_dmamem_unmap = _bus_dmamem_unmap;
+       t->_dmamem_mmap = _bus_dmamem_mmap;
+}
diff -r 3b18b24c5d82 -r b905a052894b sys/arch/algor/algor/algor_p6032reg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/algor/algor/algor_p6032reg.h     Fri Jun 22 06:02:55 2001 +0000
@@ -0,0 +1,60 @@
+/*     $NetBSD: algor_p6032reg.h,v 1.1.8.2 2001/06/22 06:02:55 thorpej Exp $   */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF



Home | Main Index | Thread Index | Old Index