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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc3/] [or1ksim/] [peripheral/] [dma.h] - Diff between revs 1355 and 1370

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1355 Rev 1370
Line 1... Line 1...
/* dma.h -- Definition of types and structures for DMA
/* dma.h -- Definition of DMA<->peripheral interface
   Copyright (C) 2001 by Erez Volk, erez@opencores.org
   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
Line 18... Line 18...
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
*/
 
 
#include "dma_defs.h"
#include "dma_defs.h"
 
 
/* Exported function prototypes */
 
void dma_reset( void );
 
void dma_clock( void );
 
void dma_status( void );
 
 
 
void set_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 clear_dma_nd_i( unsigned dma_controller, unsigned channel );
 
unsigned check_dma_ack_o( unsigned dma_controller, unsigned channel );
 
 
 
/* Implementation of DMA Channel Registers and State */
/* Implementation of DMA Channel Registers and State */
struct dma_channel
struct dma_channel
{
{
  /* The controller we belong to */
  /* The controller we belong to */
  struct dma_controller *controller;
  struct dma_controller *controller;
Line 45... Line 34...
  unsigned referenced;
  unsigned referenced;
 
 
  /* Inner state of transfer etc. */
  /* Inner state of transfer etc. */
  unsigned load_next_descriptor_when_done;
  unsigned load_next_descriptor_when_done;
  unsigned long current_descriptor;
  unsigned long current_descriptor;
  unsigned long source, destination, source_mask, destination_mask;
  oraddr_t source, destination, source_mask, destination_mask;
  unsigned long chunk_size, total_size, words_transferred;
  unsigned long chunk_size, total_size, words_transferred;
 
 
  /* The interface registers */
  /* The interface registers */
  struct
  struct
  {
  {
Line 77... Line 66...
  oraddr_t baseaddr;
  oraddr_t baseaddr;
 
 
  /* Which interrupt number we generate */
  /* Which interrupt number we generate */
  unsigned irq;
  unsigned irq;
 
 
 
  /* VAPI id */
 
  int vapi_id;
 
 
  /* Controller Registers */
  /* Controller Registers */
  struct
  struct
  {
  {
    unsigned long csr;
    unsigned long csr;
    unsigned long int_msk_a;
    unsigned long int_msk_a;
Line 89... Line 81...
    unsigned long int_src_b;
    unsigned long int_src_b;
  } regs;
  } regs;
 
 
  /* Channels */
  /* Channels */
  struct dma_channel ch[DMA_NUM_CHANNELS];
  struct dma_channel ch[DMA_NUM_CHANNELS];
 
 
 
  struct dma_controller *next;
};
};
 
 
 No newline at end of file
 No newline at end of file
 
void set_dma_req_i( struct dma_channel *channel );
 
void clear_dma_req_i( struct dma_channel *channel );
 
void set_dma_nd_i( struct dma_channel *channel );
 
void clear_dma_nd_i( struct dma_channel *channel );
 
unsigned check_dma_ack_o( struct dma_channel *channel );
 
struct dma_channel *find_dma_controller_ch( unsigned controller,
 
                                            unsigned channel );
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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