RTEMS 6.1-rc4
Loading...
Searching...
No Matches
zynq-devcfg.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
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
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
63extern "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
106
107rtems_device_driver zynq_devcfg_init(
110 void *args
111);
112
113rtems_device_driver zynq_devcfg_open(
116 void *args
117);
118
119rtems_device_driver zynq_devcfg_close(
122 void *args
123);
124
135 void *args
136);
137
149 void *args
150);
151
152rtems_device_driver zynq_devcfg_control(
155 void *args
156);
157
158#ifdef __cplusplus
159}
160#endif /* __cplusplus */
161
162#endif /* LIBBSP_ARM_XILINX_ZYNQ_DEVCFG_H */
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition: io.h:103
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition: io.h:115
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
Basic IO API.
rtems_device_driver zynq_devcfg_write(rtems_device_major_number major, rtems_device_minor_number minor, void *args)
Write to the PCAP controller.
Definition: zynq-devcfg.c:661
rtems_device_driver zynq_devcfg_read(rtems_device_major_number major, rtems_device_minor_number minor, void *args)
Read from the PCAP controller.
Definition: zynq-devcfg.c:570
zynq_devcfg_ioctl
Definition: zynq-devcfg.h:90
@ ZYNQ_DEVCFG_IOCTL_SET_WRITE_MODE_RESTRICTED
Argument: bool.
Definition: zynq-devcfg.h:104
@ 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
Argument: None.
Definition: zynq-devcfg.h:98
@ ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_PRE
Argument: None.
Definition: zynq-devcfg.h:96
@ ZYNQ_DEVCFG_IOCTL_FPGA_PROGRAM_WAIT_DONE
Argument: None.
Definition: zynq-devcfg.h:100
@ ZYNQ_DEVCFG_IOCTL_SET_SECURE
Argument: bool.
Definition: zynq-devcfg.h:102