RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
arm
xilinx-zynq
include
dev
devcfg
zynq-devcfg.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
14
15
/*
16
* Copyright (c) 2016
17
* NSF Center for High-Performance Reconfigurable Computing (CHREC),
18
* University of Florida. All rights reserved.
19
* Copyright (c) 2017
20
* NSF Center for High-Performance Reconfigurable Computing (CHREC),
21
* University of Pittsburgh. All rights reserved.
22
*
23
* Redistribution and use in source and binary forms, with or without
24
* modification, are permitted provided that the following conditions are
25
* met:
26
* 1. Redistributions of source code must retain the above copyright
27
* notice, this list of conditions and the following disclaimer.
28
* 2. Redistributions in binary form must reproduce the above copyright
29
* notice, this list of conditions and the following disclaimer in the
30
* documentation and/or other materials provided with the distribution.
31
*
32
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
33
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
34
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
35
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
36
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
37
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
38
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
39
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
*
44
* The views and conclusions contained in the software and documentation
45
* are those of the authors and should not be interpreted as representing
46
* official policies, either expressed or implied, of CHREC.
47
*
48
* Author: Patrick Gauvin <gauvin@hcs.ufl.edu>
49
*/
50
56
57
#ifndef LIBBSP_ARM_XILINX_ZYNQ_DEVCFG_H
58
#define LIBBSP_ARM_XILINX_ZYNQ_DEVCFG_H
59
60
#include <
rtems/libio.h
>
61
62
#ifdef __cplusplus
63
extern
"C"
{
64
#endif
/* __cplusplus */
65
66
#define ZYNQ_DEVCFG_NAME "/dev/fpga"
67
/*
68
* Add to CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
69
*/
70
#define ZYNQ_DEVCFG_DRIVER_TABLE_ENTRY \
71
{ zynq_devcfg_init, zynq_devcfg_open, zynq_devcfg_close, zynq_devcfg_read, \
72
zynq_devcfg_write, zynq_devcfg_control }
73
74
/* PCAP DMA transfers must be 64-byte aligned.
75
Use this to read or write an aligned buffer avoiding the
76
use of the heap in the driver. */
77
#define ZYNQ_DEVCFG_PCAP_DMA_ALIGN 64
78
79
/* Configuration command words. */
80
#define ZYNQ_DEVCFG_CFG_DUMMY ( 0xffffffff )
81
#define ZYNQ_DEVCFG_CFG_BUS_WIDTH_SYNC ( 0x000000bb )
82
#define ZYNQ_DEVCFG_CFG_BUS_WIDTH_DETECT ( 0x11220044 )
83
#define ZYNQ_DEVCFG_CFG_SYNC ( 0xaa995566 )
84
86
#define ZYNQ_DEVCFG_CONFIG_FRAME_LEN ( 101 * 4 )
87
88
#define ZYNQ_DEVCFG_IOCTL_VERSION_MAX_LEN 16
89
90
enum
zynq_devcfg_ioctl
{
94
ZYNQ_DEVCFG_IOCTL_VERSION
,
96
ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_PRE
,
98
ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_POST
,
100
ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_WAIT_DONE
,
102
ZYNQ_DEVCFG_IOCTL_SET_SECURE
,
104
ZYNQ_DEVCFG_IOCTL_SET_WRITE_MODE_RESTRICTED
105
};
106
107
rtems_device_driver
zynq_devcfg_init(
108
rtems_device_major_number
major,
109
rtems_device_minor_number
minor,
110
void
*args
111
);
112
113
rtems_device_driver
zynq_devcfg_open(
114
rtems_device_major_number
major,
115
rtems_device_minor_number
minor,
116
void
*args
117
);
118
119
rtems_device_driver
zynq_devcfg_close(
120
rtems_device_major_number
major,
121
rtems_device_minor_number
minor,
122
void
*args
123
);
124
132
rtems_device_driver
zynq_devcfg_read(
133
rtems_device_major_number
major,
134
rtems_device_minor_number
minor,
135
void
*args
136
);
137
146
rtems_device_driver
zynq_devcfg_write(
147
rtems_device_major_number
major,
148
rtems_device_minor_number
minor,
149
void
*args
150
);
151
152
rtems_device_driver
zynq_devcfg_control(
153
rtems_device_major_number
major,
154
rtems_device_minor_number
minor,
155
void
*args
156
);
157
158
#ifdef __cplusplus
159
}
160
#endif
/* __cplusplus */
161
162
#endif
/* LIBBSP_ARM_XILINX_ZYNQ_DEVCFG_H */
rtems_device_driver
rtems_status_code rtems_device_driver
This type shall be used in device driver entry declarations and definitions.
Definition
io.h:90
rtems_device_major_number
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition
io.h:103
rtems_device_minor_number
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition
io.h:115
libio.h
Basic IO API.
zynq_devcfg_ioctl
zynq_devcfg_ioctl
Definition
zynq-devcfg.h:90
ZYNQ_DEVCFG_IOCTL_SET_WRITE_MODE_RESTRICTED
@ ZYNQ_DEVCFG_IOCTL_SET_WRITE_MODE_RESTRICTED
Argument: bool.
Definition
zynq-devcfg.h:104
ZYNQ_DEVCFG_IOCTL_VERSION
@ ZYNQ_DEVCFG_IOCTL_VERSION
Argument: Buffer for character string of at least ZYNQ_DEVCFG_IOCTL_VERSION_MAX_LEN bytes.
Definition
zynq-devcfg.h:94
ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_POST
@ ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_POST
Argument: None.
Definition
zynq-devcfg.h:98
ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_PRE
@ ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_PRE
Argument: None.
Definition
zynq-devcfg.h:96
ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_WAIT_DONE
@ ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_WAIT_DONE
Argument: None.
Definition
zynq-devcfg.h:100
ZYNQ_DEVCFG_IOCTL_SET_SECURE
@ ZYNQ_DEVCFG_IOCTL_SET_SECURE
Argument: bool.
Definition
zynq-devcfg.h:102
Generated by
1.18.0