Remove (deprecated) DMA functions in jazz/dma.c which are no longer used.

jazz/dma.h now only contains DMAC register definitions.
This commit is contained in:
tsutsui 2003-05-04 10:07:50 +00:00
parent 0bcf529e7f
commit ff776a0f93
3 changed files with 3 additions and 293 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.arc,v 1.43 2003/05/04 10:01:20 tsutsui Exp $
# $NetBSD: files.arc,v 1.44 2003/05/04 10:07:50 tsutsui Exp $
# $OpenBSD: files.arc,v 1.21 1999/09/11 10:20:20 niklas Exp $
#
# maxpartitions must be first item in files.${ARCH}
@ -114,7 +114,6 @@ file arch/arc/arc/cpu.c cpu
device jazzio {}
attach jazzio at mainbus # optional
file arch/arc/jazz/jazzio.c jazzio
file arch/arc/jazz/dma.c # XXX jazzio
file arch/arc/jazz/jazzdmatlb.c # XXX jazzio
file arch/arc/jazz/bus_dma_jazz.c # XXX jazzio

View File

@ -1,235 +0,0 @@
/* $NetBSD: dma.c,v 1.10 2003/02/10 15:19:44 tsutsui Exp $ */
/* $OpenBSD: dma.c,v 1.5 1998/03/01 16:49:57 niklas Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* 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 University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* from: @(#)rz.c 8.1 (Berkeley) 7/29/93
*/
/*
* PICA system dma driver.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/syslog.h>
#include <sys/device.h>
#include <uvm/uvm_extern.h>
#include <mips/locore.h>
#include <machine/cpu.h>
#include <machine/autoconf.h>
#include <machine/bus.h>
#include <machine/pio.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
#include <arc/jazz/pica.h>
#include <arc/jazz/rd94.h>
#include <arc/jazz/jazziovar.h>
#include <arc/jazz/jazzdmatlbreg.h>
#include <arc/jazz/jazzdmatlbvar.h>
#include <arc/jazz/dma.h>
void picaDmaReset __P((dma_softc_t *sc));
void picaDmaEnd __P((dma_softc_t *sc));
void picaDmaNull __P((dma_softc_t *sc));
/*
* Allocate an array of 'size' dma pte entrys.
* Return address to first pte.
*/
void
picaDmaTLBAlloc(dma_softc_t *dma)
{
dma->pte_base = jazz_dmatlb_alloc(dma->pte_size, 0, BUS_DMA_WAITOK,
&dma->dma_va);
}
/*
* Free an array of dma pte entrys.
*/
void
picaDmaTLBFree(dma_softc_t *dma)
{
jazz_dmatlb_free(dma->dma_va, dma->pte_size);
/*XXX Wakeup waiting */
}
/*
* Start local dma channel.
*/
void
picaDmaStart(sc, addr, size, datain)
struct dma_softc *sc;
char *addr;
size_t size;
int datain;
{
pDmaReg regs = sc->dma_reg;
vaddr_t va;
jazz_dma_pte_t *dma_pte;
/* Halt DMA */
regs->dma_enab = 0;
regs->dma_mode = 0;
/* Remap request space va into dma space va */
/* Map up the request viritual dma space */
va = jazz_dma_page_offs(addr);
dma_pte = sc->pte_base + (va / JAZZ_DMA_PAGE_SIZE);
jazz_dmatlb_map_va(NULL, (vaddr_t)addr, size, dma_pte);
jazz_dmatlb_flush();
/* Load new transfer parameters */
regs->dma_addr = sc->dma_va + va;
regs->dma_count = size;
regs->dma_mode = sc->mode & R4030_DMA_MODE_MASK;
sc->sc_active = 1;
if (datain == DMA_FROM_DEV) {
sc->mode &= ~DMA_DIR_WRITE;
regs->dma_enab = R4030_DMA_ENAB_RUN | R4030_DMA_ENAB_READ;
}
else {
sc->mode |= DMA_DIR_WRITE;
regs->dma_enab = R4030_DMA_ENAB_RUN | R4030_DMA_ENAB_WRITE;
}
wbflush();
}
/*
* Set up DMA mapper for external dma.
* Used by ISA dma and SONIC
*/
void
picaDmaMap(sc, addr, size, offset)
struct dma_softc *sc;
char *addr;
size_t size;
int offset;
{
vaddr_t va;
jazz_dma_pte_t *dma_pte;
/* Remap request space va into dma space va */
/* Map up the request viritual dma space */
va = jazz_dma_page_offs(addr) + offset;
dma_pte = sc->pte_base + (va / JAZZ_DMA_PAGE_SIZE);
jazz_dmatlb_map_va(NULL, (vaddr_t)addr, size, dma_pte);
}
/*
* Prepare for new dma by flushing
*/
void
picaDmaFlush(sc, addr, size, datain)
struct dma_softc *sc;
char *addr;
size_t size;
int datain;
{
jazz_dmatlb_flush();
}
/*
* Stop/Reset a DMA channel
*/
void
picaDmaReset(dma_softc_t *sc)
{
pDmaReg regs = sc->dma_reg;
/* Halt DMA */
regs->dma_enab = 0;
regs->dma_mode = 0;
sc->sc_active = 0;
}
/*
* End dma operation, return byte count left.
*/
void
picaDmaEnd(dma_softc_t *sc)
{
pDmaReg regs = sc->dma_reg;
/* Halt DMA */
regs->dma_count = 0;
regs->dma_enab = 0;
regs->dma_mode = 0;
sc->sc_active = 0;
}
/*
* Null call rathole!
*/
void
picaDmaNull(dma_softc_t *sc)
{
printf("picaDmaNull called\n");
}
/*
* dma_init..
* Called from asc to set up dma
*/
void
asc_dma_init(sc)
dma_softc_t *sc;
{
sc->reset = picaDmaReset;
sc->enintr = picaDmaNull;
sc->start = picaDmaStart;
sc->map = picaDmaMap;
sc->isintr = (int(*)(struct dma_softc *))picaDmaNull;
sc->intr = (int(*)(struct dma_softc *))picaDmaNull;
sc->end = picaDmaEnd;
sc->dma_reg = (pDmaReg)R4030_SYS_DMA0_REGS;
sc->pte_size = (MAXPHYS / JAZZ_DMA_PAGE_SIZE) + 1;
sc->mode = R4030_DMA_MODE_160NS | R4030_DMA_MODE_16;
picaDmaTLBAlloc(sc);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dma.h,v 1.4 2003/02/10 15:19:44 tsutsui Exp $ */
/* $NetBSD: dma.h,v 1.5 2003/05/04 10:07:51 tsutsui Exp $ */
/* $OpenBSD: dma.h,v 1.3 1997/04/19 17:19:51 pefo Exp $ */
/*
@ -34,16 +34,6 @@
/*
* Hardware dma registers.
*/
typedef volatile struct {
int32_t dma_mode;
int32_t pad1;
int32_t dma_enab;
int32_t pad2;
int32_t dma_count;
int32_t pad3;
int32_t dma_addr;
int32_t pad4;
} DmaReg, *pDmaReg;
#define R4030_DMA_MODE 0x00
#define R4030_DMA_MODE_40NS 0x00 /* Device dma timing */
@ -60,9 +50,6 @@ typedef volatile struct {
#define R4030_DMA_MODE_INT 0x20 /* Interrupt when done */
#define R4030_DMA_MODE_BURST 0x40 /* Burst mode (Rev 2 only) */
#define R4030_DMA_MODE_FAST 0x80 /* Fast dma cycle (Rev 2 only) */
#define R4030_DMA_MODE_MASK 0xff /* Mode register bits */
#define DMA_DIR_WRITE 0x100 /* Software direction status */
#define DMA_DIR_READ 0x000 /* Software direction status */
#define R4030_DMA_ENAB 0x08
#define R4030_DMA_ENAB_RUN 0x0001 /* Enable dma */
@ -75,47 +62,6 @@ typedef volatile struct {
#define R4030_DMA_COUNT 0x10
#define R4030_DMA_COUNT_MASK 0x000fffff /* Byte count mask */
#define R4030_DMA_ADDR 0x18
#define R4030_DMA_ADDR 0x18
#define R4030_DMA_RANGE 0x20
/*
* Structure used to control dma.
*/
typedef struct dma_softc {
struct device sc_dev; /* use as a device */
struct esp_softc *sc_esp;
bus_addr_t dma_va; /* Viritual address for transfer */
int mode; /* Mode register value and direction */
jazz_dma_pte_t *pte_base; /* Pointer to dma tlb array */
int pte_size; /* Size of pte allocated pte array */
pDmaReg dma_reg; /* Pointer to dma registers */
int sc_active; /* Active flag */
void (*reset)(struct dma_softc *); /* Reset routine pointer */
void (*enintr)(struct dma_softc *); /* Int enab routine pointer */
void (*map)(struct dma_softc *, char *, size_t, int);
/* Map a dma viritual area */
void (*start)(struct dma_softc *, caddr_t, size_t, int);
/* Start routine pointer */
int (*isintr)(struct dma_softc *); /* Int check routine pointer */
int (*intr)(struct dma_softc *); /* Interrupt routine pointer */
void (*end)(struct dma_softc *); /* Interrupt routine pointer */
} dma_softc_t;
#define DMA_TO_DEV 0
#define DMA_FROM_DEV 1
#define DMA_RESET(r) ((r->reset)(r))
#define DMA_START(a, b, c, d) ((a->start)(a, b, c, d))
#define DMA_MAP(a, b, c, d) ((a->map)(a, b, c, d))
#define DMA_INTR(r) ((r->intr)(r))
#define DMA_DRAIN(r)
#define DMA_END(r) ((r->end)(r))
void picaDmaTLBAlloc __P((dma_softc_t *));
void picaDmaTLBFree __P((dma_softc_t *));
void picaDmaMap __P((struct dma_softc *, char *, size_t, int));
void picaDmaStart __P((struct dma_softc *, char *, size_t, int));
void picaDmaFlush __P((struct dma_softc *, char *, size_t, int));
void asc_dma_init __P((struct dma_softc *));