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

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel-0-3-0-rc1/] [or1ksim/] [peripheral/] [dma.h] - Blame information for rev 1778

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 1748 jeremybenn
 
3 235 erez
   Copyright (C) 2001 by Erez Volk, erez@opencores.org
4 1748 jeremybenn
   Copyright (C) 2008 Embecosm Limited
5 212 erez
 
6 1748 jeremybenn
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7 212 erez
 
8 1748 jeremybenn
   This file is part of Or1ksim, the OpenRISC 1000 Architectural Simulator.
9 212 erez
 
10 1748 jeremybenn
   This program is free software; you can redistribute it and/or modify it
11
   under the terms of the GNU General Public License as published by the Free
12
   Software Foundation; either version 3 of the License, or (at your option)
13
   any later version.
14 1355 nogj
 
15 1748 jeremybenn
   This program is distributed in the hope that it will be useful, but WITHOUT
16
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18
   more details.
19
 
20
   You should have received a copy of the GNU General Public License along
21
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
22
 
23
/* This program is commented throughout in a fashion suitable for processing
24
   with Doxygen. */
25
 
26
#ifndef DMA__H
27
#define DMA__H
28
 
29
/* Package includes */
30
#include "dma-defs.h"
31
#include "sim-config.h"
32
 
33 212 erez
/* Implementation of DMA Channel Registers and State */
34
struct dma_channel
35
{
36 235 erez
  /* The controller we belong to */
37
  struct dma_controller *controller;
38 212 erez
 
39 235 erez
  /* Our channel number and bit mask */
40
  unsigned channel_number;
41
  unsigned long channel_mask;
42 212 erez
 
43 235 erez
  /* Used for dump, to save dumping all 32 channels */
44
  unsigned referenced;
45 212 erez
 
46 235 erez
  /* Inner state of transfer etc. */
47
  unsigned load_next_descriptor_when_done;
48
  unsigned long current_descriptor;
49 1370 nogj
  oraddr_t source, destination, source_mask, destination_mask;
50 235 erez
  unsigned long chunk_size, total_size, words_transferred;
51 212 erez
 
52 235 erez
  /* The interface registers */
53 1748 jeremybenn
  struct
54 235 erez
  {
55
    unsigned long csr;
56
    unsigned long sz;
57
    unsigned long a0;
58
    unsigned long am0;
59
    unsigned long a1;
60
    unsigned long am1;
61
    unsigned long desc;
62
    unsigned long swptr;
63
  } regs;
64 212 erez
 
65 235 erez
  /* Some control signals */
66
  unsigned dma_req_i;
67
  unsigned dma_ack_o;
68
  unsigned dma_nd_i;
69 212 erez
};
70
 
71
 
72
/* Implementation of DMA Controller Registers and State */
73
struct dma_controller
74
{
75 1461 nogj
  /* Is peripheral enabled */
76
  int enabled;
77 1748 jeremybenn
 
78 235 erez
  /* Base address in memory */
79 1350 nogj
  oraddr_t baseaddr;
80 212 erez
 
81 235 erez
  /* Which interrupt number we generate */
82
  unsigned irq;
83 212 erez
 
84 1370 nogj
  /* VAPI id */
85
  int vapi_id;
86
 
87 235 erez
  /* Controller Registers */
88 1748 jeremybenn
  struct
89 235 erez
  {
90
    unsigned long csr;
91
    unsigned long int_msk_a;
92
    unsigned long int_msk_b;
93
    unsigned long int_src_a;
94
    unsigned long int_src_b;
95
  } regs;
96
 
97
  /* Channels */
98
  struct dma_channel ch[DMA_NUM_CHANNELS];
99 1370 nogj
 
100
  struct dma_controller *next;
101 212 erez
};
102 1370 nogj
 
103 1748 jeremybenn
void set_dma_req_i (struct dma_channel *channel);
104
void clear_dma_req_i (struct dma_channel *channel);
105
void set_dma_nd_i (struct dma_channel *channel);
106
void clear_dma_nd_i (struct dma_channel *channel);
107
unsigned check_dma_ack_o (struct dma_channel *channel);
108
struct dma_channel *find_dma_controller_ch (unsigned controller,
109
                                            unsigned channel);
110
 
111
/* Prototype for external use */
112
extern void  reg_dma_sec ();
113
 
114
#endif  /* DMA__H */

powered by: WebSVN 2.1.0

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