OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_1_0/] [or1ksim/] [peripheral/] [dma.h] - Blame information for rev 1780

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 212 erez
/* dma.h -- Definition of types and structures for DMA
2 235 erez
   Copyright (C) 2001 by Erez Volk, erez@opencores.org
3 212 erez
 
4
   This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 2 of the License, or
9
   (at your option) any later version.
10
 
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
15
 
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software
18
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 235 erez
*/
20 212 erez
 
21 1355 nogj
#include "dma_defs.h"
22
 
23 212 erez
/* Exported function prototypes */
24
void dma_reset( void );
25
void dma_clock( void );
26 1308 phoenix
void dma_status( void );
27 212 erez
 
28
void set_dma_req_i( unsigned dma_controller, unsigned channel );
29
void clear_dma_req_i( unsigned dma_controller, unsigned channel );
30
void set_dma_nd_i( unsigned dma_controller, unsigned channel );
31
void clear_dma_nd_i( unsigned dma_controller, unsigned channel );
32 235 erez
unsigned check_dma_ack_o( unsigned dma_controller, unsigned channel );
33 212 erez
 
34
/* Implementation of DMA Channel Registers and State */
35
struct dma_channel
36
{
37 235 erez
  /* The controller we belong to */
38
  struct dma_controller *controller;
39 212 erez
 
40 235 erez
  /* Our channel number and bit mask */
41
  unsigned channel_number;
42
  unsigned long channel_mask;
43 212 erez
 
44 235 erez
  /* Used for dump, to save dumping all 32 channels */
45
  unsigned referenced;
46 212 erez
 
47 235 erez
  /* Inner state of transfer etc. */
48
  unsigned load_next_descriptor_when_done;
49
  unsigned long current_descriptor;
50
  unsigned long source, destination, source_mask, destination_mask;
51
  unsigned long chunk_size, total_size, words_transferred;
52 212 erez
 
53 235 erez
  /* The interface registers */
54
  struct
55
  {
56
    unsigned long csr;
57
    unsigned long sz;
58
    unsigned long a0;
59
    unsigned long am0;
60
    unsigned long a1;
61
    unsigned long am1;
62
    unsigned long desc;
63
    unsigned long swptr;
64
  } regs;
65 212 erez
 
66 235 erez
  /* Some control signals */
67
  unsigned dma_req_i;
68
  unsigned dma_ack_o;
69
  unsigned dma_nd_i;
70 212 erez
};
71
 
72
 
73
/* Implementation of DMA Controller Registers and State */
74
struct dma_controller
75
{
76 235 erez
  /* Base address in memory */
77 1350 nogj
  oraddr_t baseaddr;
78 212 erez
 
79 235 erez
  /* Which interrupt number we generate */
80
  unsigned irq;
81 212 erez
 
82 235 erez
  /* Controller Registers */
83
  struct
84
  {
85
    unsigned long csr;
86
    unsigned long int_msk_a;
87
    unsigned long int_msk_b;
88
    unsigned long int_src_a;
89
    unsigned long int_src_b;
90
  } regs;
91
 
92
  /* Channels */
93
  struct dma_channel ch[DMA_NUM_CHANNELS];
94 212 erez
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.