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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [peripheral/] [dma.h] - Blame information for rev 1370

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

Line No. Rev Author Line
1 1370 nogj
/* dma.h -- Definition of DMA<->peripheral interface
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
/* Implementation of DMA Channel Registers and State */
24
struct dma_channel
25
{
26 235 erez
  /* The controller we belong to */
27
  struct dma_controller *controller;
28 212 erez
 
29 235 erez
  /* Our channel number and bit mask */
30
  unsigned channel_number;
31
  unsigned long channel_mask;
32 212 erez
 
33 235 erez
  /* Used for dump, to save dumping all 32 channels */
34
  unsigned referenced;
35 212 erez
 
36 235 erez
  /* Inner state of transfer etc. */
37
  unsigned load_next_descriptor_when_done;
38
  unsigned long current_descriptor;
39 1370 nogj
  oraddr_t source, destination, source_mask, destination_mask;
40 235 erez
  unsigned long chunk_size, total_size, words_transferred;
41 212 erez
 
42 235 erez
  /* The interface registers */
43
  struct
44
  {
45
    unsigned long csr;
46
    unsigned long sz;
47
    unsigned long a0;
48
    unsigned long am0;
49
    unsigned long a1;
50
    unsigned long am1;
51
    unsigned long desc;
52
    unsigned long swptr;
53
  } regs;
54 212 erez
 
55 235 erez
  /* Some control signals */
56
  unsigned dma_req_i;
57
  unsigned dma_ack_o;
58
  unsigned dma_nd_i;
59 212 erez
};
60
 
61
 
62
/* Implementation of DMA Controller Registers and State */
63
struct dma_controller
64
{
65 235 erez
  /* Base address in memory */
66 1350 nogj
  oraddr_t baseaddr;
67 212 erez
 
68 235 erez
  /* Which interrupt number we generate */
69
  unsigned irq;
70 212 erez
 
71 1370 nogj
  /* VAPI id */
72
  int vapi_id;
73
 
74 235 erez
  /* Controller Registers */
75
  struct
76
  {
77
    unsigned long csr;
78
    unsigned long int_msk_a;
79
    unsigned long int_msk_b;
80
    unsigned long int_src_a;
81
    unsigned long int_src_b;
82
  } regs;
83
 
84
  /* Channels */
85
  struct dma_channel ch[DMA_NUM_CHANNELS];
86 1370 nogj
 
87
  struct dma_controller *next;
88 212 erez
};
89 1370 nogj
 
90
void set_dma_req_i( struct dma_channel *channel );
91
void clear_dma_req_i( struct dma_channel *channel );
92
void set_dma_nd_i( struct dma_channel *channel );
93
void clear_dma_nd_i( struct dma_channel *channel );
94
unsigned check_dma_ack_o( struct dma_channel *channel );
95
struct dma_channel *find_dma_controller_ch( unsigned controller,
96
                                            unsigned channel );

powered by: WebSVN 2.1.0

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