Line 1... |
Line 1... |
/* dma.h -- Definition of types and structures for DMA
|
/* dma.h -- Definition of types and structures for DMA
|
Copyright (C) 2001 by Erez Volk, erez@mailandnews.com
|
Copyright (C) 2001 by Erez Volk, erez@opencores.org
|
|
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
|
|
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
Line 19... |
Line 19... |
*/
|
*/
|
|
|
/* Exported function prototypes */
|
/* Exported function prototypes */
|
void dma_reset( void );
|
void dma_reset( void );
|
void dma_clock( void );
|
void dma_clock( void );
|
void dma_write( unsigned long addr, unsigned long value );
|
|
unsigned long dma_read( unsigned long addr );
|
|
|
|
void set_dma_req_i( unsigned dma_controller, unsigned channel );
|
void set_dma_req_i( unsigned dma_controller, unsigned channel );
|
void clear_dma_req_i( unsigned dma_controller, unsigned channel );
|
void clear_dma_req_i( unsigned dma_controller, unsigned channel );
|
void set_dma_nd_i( unsigned dma_controller, unsigned channel );
|
void set_dma_nd_i( unsigned dma_controller, unsigned channel );
|
void clear_dma_nd_i( unsigned dma_controller, unsigned channel );
|
void clear_dma_nd_i( unsigned dma_controller, unsigned channel );
|
unsigned check_dma_acq_o( unsigned dma_controller, unsigned channel );
|
unsigned check_dma_ack_o( unsigned dma_controller, unsigned channel );
|
|
|
/* Number of channel per DMA controller */
|
/* Number of channel per DMA controller */
|
#define DMA_NUM_CHANNELS 31
|
#define DMA_NUM_CHANNELS 31
|
|
|
|
|
Line 166... |
Line 164... |
unsigned long swptr;
|
unsigned long swptr;
|
} regs;
|
} regs;
|
|
|
/* Some control signals */
|
/* Some control signals */
|
unsigned dma_req_i;
|
unsigned dma_req_i;
|
unsigned dma_acq_o;
|
unsigned dma_ack_o;
|
unsigned dma_nd_i;
|
unsigned dma_nd_i;
|
};
|
};
|
|
|
|
|
/* Implementation of DMA Controller Registers and State */
|
/* Implementation of DMA Controller Registers and State */
|
struct dma_controller
|
struct dma_controller
|
{
|
{
|
/* Base address in memory */
|
/* Base address in memory */
|
unsigned long baseaddr;
|
unsigned long baseaddr;
|
|
|
|
/* Which interrupt number we generate */
|
|
unsigned irq;
|
|
|
/* Controller Registers */
|
/* Controller Registers */
|
struct
|
struct
|
{
|
{
|
unsigned long csr;
|
unsigned long csr;
|
unsigned long int_msk_a;
|
unsigned long int_msk_a;
|