1 |
145 |
lanttu |
/**
|
2 |
|
|
* @file hpd_config.h
|
3 |
|
|
* @author Lasse Lehtonen
|
4 |
|
|
* @date 2012-02-16
|
5 |
|
|
*
|
6 |
|
|
* @brief HIBI_PE_DMA configuration file.
|
7 |
|
|
*
|
8 |
|
|
* @detail This file along with its .c file is used to configure
|
9 |
|
|
* HIBI_PE_DMA components for the functions to know where they
|
10 |
|
|
* are. This file should be unique for each processor using
|
11 |
|
|
* HIBI_PE_DMA components.
|
12 |
|
|
*
|
13 |
|
|
* @par Copyright
|
14 |
|
|
* Funbase IP library Copyright (C) 2012 TUT Department of
|
15 |
|
|
* Computer Systems
|
16 |
|
|
* @par
|
17 |
|
|
* This file is part of HIBI_PE_DMA
|
18 |
|
|
* @par
|
19 |
|
|
* This source file may be used and distributed without
|
20 |
|
|
* restriction provided that this copyright statement is not
|
21 |
|
|
* removed from the file and that any derivative work contains
|
22 |
|
|
* the original copyright notice and the associated disclaimer.
|
23 |
|
|
* This source file is free software; you can redistribute it
|
24 |
|
|
* and/or modify it under the terms of the GNU Lesser General
|
25 |
|
|
* Public License as published by the Free Software Foundation;
|
26 |
|
|
* either version 2.1 of the License, or (at your option) any
|
27 |
|
|
* later version.
|
28 |
|
|
* @par
|
29 |
|
|
* This source is distributed in the hope that it will be
|
30 |
|
|
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
31 |
|
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
32 |
|
|
* PURPOSE. See the GNU Lesser General Public License for more
|
33 |
|
|
* details.
|
34 |
|
|
* @par
|
35 |
|
|
* You should have received a copy of the GNU Lesser General
|
36 |
|
|
* Public License along with this source; if not, download it
|
37 |
|
|
* from http://www.opencores.org/lgpl.shtml
|
38 |
|
|
*
|
39 |
|
|
*/
|
40 |
|
|
|
41 |
|
|
#ifndef HPD_CONFIG_HH
|
42 |
|
|
#define HPD_CONFIG_HH
|
43 |
|
|
|
44 |
|
|
/**
|
45 |
|
|
* @def NUM_OF_HIBI_PE_DMAS
|
46 |
|
|
*
|
47 |
|
|
* @brief Total number HIBI_PE_DMA components this processor uses and
|
48 |
|
|
* sees on its memory mapped bus.
|
49 |
|
|
*
|
50 |
|
|
* @hideinitializer
|
51 |
|
|
*/
|
52 |
|
|
#define NUM_OF_HIBI_PE_DMAS 1
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
/**
|
56 |
|
|
* @struct HPD_rx_stream
|
57 |
|
|
* @brief Holds configuration information of one RX stream channel.
|
58 |
|
|
*/
|
59 |
|
|
typedef struct {
|
60 |
|
|
int rx_base_address; /**< Address of this channnel's RX buffer.*/
|
61 |
|
|
int rx_buffer_bytes; /**< Size of the RX buffer in bytes. */
|
62 |
|
|
int rx_hibi_address; /**< HIBI address for receiving data. */
|
63 |
|
|
int rx_read_words; /**< Current read pointer. */
|
64 |
|
|
} HPD_rx_stream;
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
/**
|
68 |
|
|
* @struct HPD_rx_packet
|
69 |
|
|
* @brief Holds configuration information of one RX packet channel.
|
70 |
|
|
*/
|
71 |
|
|
typedef struct {
|
72 |
|
|
int rx_base_address; /**< Address of this channnel's RX buffer.*/
|
73 |
|
|
int rx_buffer_bytes; /**< Size of the RX buffer in bytes. */
|
74 |
|
|
int rx_hibi_address; /**< HIBI address for receiving data. */
|
75 |
|
|
} HPD_rx_packet;
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
/**
|
79 |
|
|
* @struct HPD_iface
|
80 |
|
|
* @brief Struct holding information about HIBI_PE_DMA components.
|
81 |
|
|
*/
|
82 |
|
|
typedef struct {
|
83 |
|
|
int base_address; /**< Base address for this HIBI_PE_DMA. */
|
84 |
|
|
int tx_base_address; /**< TX buffer's start on shared mem. */
|
85 |
|
|
int tx_buffer_bytes; /**< Size of the TX buffer in bytes. */
|
86 |
|
|
int tx_hibi_address; /**< Target HIBI address for sending. */
|
87 |
|
|
int tx_hibi_command; /**< HIBI command for sending. */
|
88 |
|
|
int n_stream_channels; /**< Number of stream channels available. */
|
89 |
|
|
int n_packet_channels; /**< Number of packet channels available. */
|
90 |
|
|
HPD_rx_stream* rx_streams; /**< Table of rx stream channels. */
|
91 |
|
|
HPD_rx_packet* rx_packets; /**< Table of rx packet channels. */
|
92 |
|
|
} HPD_iface;
|
93 |
|
|
|
94 |
|
|
/**
|
95 |
|
|
* Actual interface information is located in the c file.
|
96 |
|
|
*/
|
97 |
|
|
extern HPD_iface hpd_ifaces[NUM_OF_HIBI_PE_DMAS];
|
98 |
|
|
|
99 |
|
|
#endif
|