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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_70/] [or1ksim/] [peripheral/] [dma.h] - Blame information for rev 1765

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 1461 nogj
  /* Is peripheral enabled */
66
  int enabled;
67
 
68 235 erez
  /* Base address in memory */
69 1350 nogj
  oraddr_t baseaddr;
70 212 erez
 
71 235 erez
  /* Which interrupt number we generate */
72
  unsigned irq;
73 212 erez
 
74 1370 nogj
  /* VAPI id */
75
  int vapi_id;
76
 
77 235 erez
  /* Controller Registers */
78
  struct
79
  {
80
    unsigned long csr;
81
    unsigned long int_msk_a;
82
    unsigned long int_msk_b;
83
    unsigned long int_src_a;
84
    unsigned long int_src_b;
85
  } regs;
86
 
87
  /* Channels */
88
  struct dma_channel ch[DMA_NUM_CHANNELS];
89 1370 nogj
 
90
  struct dma_controller *next;
91 212 erez
};
92 1370 nogj
 
93
void set_dma_req_i( struct dma_channel *channel );
94
void clear_dma_req_i( struct dma_channel *channel );
95
void set_dma_nd_i( struct dma_channel *channel );
96
void clear_dma_nd_i( struct dma_channel *channel );
97
unsigned check_dma_ack_o( struct dma_channel *channel );
98
struct dma_channel *find_dma_controller_ch( unsigned controller,
99
                                            unsigned channel );

powered by: WebSVN 2.1.0

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