Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dma_ip_drivers
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
dma_ip_drivers
Commits
1abe739a
Commit
1abe739a
authored
Oct 23, 2020
by
Sujatha Banoth
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Xilinx/dma_ip_drivers
parents
0eb756ff
a1d510f4
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
126 additions
and
79 deletions
+126
-79
XDMA/linux-kernel/libxdma/libxdma.c
XDMA/linux-kernel/libxdma/libxdma.c
+83
-68
XDMA/linux-kernel/libxdma/libxdma.h
XDMA/linux-kernel/libxdma/libxdma.h
+29
-5
XDMA/linux-kernel/xdma/Makefile
XDMA/linux-kernel/xdma/Makefile
+1
-0
XDMA/linux-kernel/xdma/cdev_bypass.c
XDMA/linux-kernel/xdma/cdev_bypass.c
+1
-0
XDMA/linux-kernel/xdma/cdev_ctrl.c
XDMA/linux-kernel/xdma/cdev_ctrl.c
+1
-1
XDMA/linux-kernel/xdma/cdev_sgdma.c
XDMA/linux-kernel/xdma/cdev_sgdma.c
+1
-1
XDMA/linux-kernel/xdma/cdev_xvc.c
XDMA/linux-kernel/xdma/cdev_xvc.c
+1
-1
XDMA/linux-kernel/xdma/cdev_xvc.h
XDMA/linux-kernel/xdma/cdev_xvc.h
+1
-2
XDMA/linux-kernel/xdma/xdma_cdev.c
XDMA/linux-kernel/xdma/xdma_cdev.c
+0
-1
XDMA/linux-kernel/xdma/xdma_mod.c
XDMA/linux-kernel/xdma/xdma_mod.c
+8
-0
No files found.
XDMA/linux-kernel/libxdma/libxdma.c
View file @
1abe739a
This diff is collapsed.
Click to expand it.
XDMA/linux-kernel/libxdma/libxdma.h
View file @
1abe739a
...
...
@@ -31,9 +31,32 @@
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/workqueue.h>
#if KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
/* Add compatibility checking for RHEL versions */
#if defined(RHEL_RELEASE_CODE)
# define ACCESS_OK_2_ARGS (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 0))
#else
# define ACCESS_OK_2_ARGS (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0))
#endif
#if defined(RHEL_RELEASE_CODE)
# define HAS_MMIOWB (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(8, 0))
#else
# define HAS_MMIOWB (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 1, 0))
#endif
#if defined(RHEL_RELEASE_CODE)
# define HAS_SWAKE_UP_ONE (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 0))
# define HAS_SWAKE_UP (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 0))
#else
# define HAS_SWAKE_UP_ONE (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
# define HAS_SWAKE_UP (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
#endif
#if HAS_SWAKE_UP
#include <linux/swait.h>
#endif
/*
* if the config bar is fixed, the driver does not neeed to search through
* all of the bars
...
...
@@ -58,7 +81,8 @@
* .REG_IRQ_OUT (reg_irq_from_ch[(channel*2) +: 2]),
*/
#define XDMA_ENG_IRQ_NUM (1)
#define MAX_EXTRA_ADJ (0x3F)
#define XDMA_MAX_ADJ_BLOCK_SIZE 0x40
#define XDMA_PAGE_SIZE 0x1000
#define RX_STATUS_EOP (1)
/* Target internal components on XDMA control BAR */
...
...
@@ -417,7 +441,7 @@ struct xdma_transfer {
int
desc_num
;
/* number of descriptors in transfer */
int
desc_index
;
/* index for 1st desc. in transfer */
enum
dma_data_direction
dir
;
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
struct
swait_queue_head
wq
;
#else
wait_queue_head_t
wq
;
/* wait queue for transfer completion */
...
...
@@ -503,7 +527,7 @@ struct xdma_engine {
dma_addr_t
poll_mode_bus
;
/* bus addr for descriptor writeback */
/* Members associated with interrupt mode support */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
struct
swait_queue_head
shutdown_wq
;
#else
wait_queue_head_t
shutdown_wq
;
/* wait queue for shutdown sync */
...
...
@@ -522,7 +546,7 @@ struct xdma_engine {
/* for performance test support */
struct
xdma_performance_ioctl
*
xdma_perf
;
/* perf test control */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
struct
swait_queue_head
xdma_perf_wq
;
#else
wait_queue_head_t
xdma_perf_wq
;
/* Perf test sync */
...
...
XDMA/linux-kernel/xdma/Makefile
View file @
1abe739a
...
...
@@ -28,6 +28,7 @@ all :
clean
:
$(MAKE)
-C
$(BUILDSYSTEM_DIR)
M
=
$(PWD)
clean
@
/bin/rm
-f
*
.o.ur-safe
install
:
all
$(MAKE)
-C
$(BUILDSYSTEM_DIR)
M
=
$(PWD)
modules_install
...
...
XDMA/linux-kernel/xdma/cdev_bypass.c
View file @
1abe739a
...
...
@@ -16,6 +16,7 @@
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*/
#define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
#include "libxdma_api.h"
#include "xdma_cdev.h"
...
...
XDMA/linux-kernel/xdma/cdev_ctrl.c
View file @
1abe739a
...
...
@@ -24,7 +24,7 @@
#include "xdma_cdev.h"
#include "cdev_ctrl.h"
#if
KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE
#if
ACCESS_OK_2_ARGS
#define xlx_access_ok(X, Y, Z) access_ok(Y, Z)
#else
#define xlx_access_ok(X, Y, Z) access_ok(X, Y, Z)
...
...
XDMA/linux-kernel/xdma/cdev_sgdma.c
View file @
1abe739a
...
...
@@ -611,7 +611,7 @@ static int ioctl_do_perf_start(struct xdma_engine *engine, unsigned long arg)
enable_perf
(
engine
);
dbg_perf
(
"transfer_size = %d
\n
"
,
engine
->
xdma_perf
->
transfer_size
);
/* initialize wait queue */
#if
KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
#if
HAS_SWAKE_UP
init_swait_queue_head
(
&
engine
->
xdma_perf_wq
);
#else
init_waitqueue_head
(
&
engine
->
xdma_perf_wq
);
...
...
XDMA/linux-kernel/xdma/cdev_xvc.c
View file @
1abe739a
...
...
@@ -213,7 +213,7 @@ static long xvc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
pr_info
(
"copy back tdo_buf failed: %d/%u.
\n
"
,
rv
,
total_bytes
);
unlock:
#if
KERNEL_VERSION(5, 1, 0) >= LINUX_VERSION_CODE
#if
HAS_MMIOWB
mmiowb
();
#endif
spin_unlock
(
&
xcdev
->
lock
);
...
...
XDMA/linux-kernel/xdma/cdev_xvc.h
View file @
1abe739a
...
...
@@ -23,8 +23,7 @@
#include <linux/ioctl.h>
/*
* !!! TODO !!!
* need a better way set the bar offset dynamicly
* the bar offset can be changed at compile time
*/
#define XVC_BAR_OFFSET_DFLT 0x40000
/* DSA 4.0 */
...
...
XDMA/linux-kernel/xdma/xdma_cdev.c
View file @
1abe739a
...
...
@@ -522,7 +522,6 @@ int xpdev_create_interfaces(struct xdma_pci_dev *xpdev)
}
xpdev_flag_set
(
xpdev
,
XDF_CDEV_SG
);
/* ??? Bypass */
/* Initialize Bypass Character Device */
if
(
xdev
->
bypass_bar_idx
>
0
)
{
for
(
i
=
0
;
i
<
xpdev
->
h2c_channel_max
;
i
++
)
{
...
...
XDMA/linux-kernel/xdma/xdma_mod.c
View file @
1abe739a
...
...
@@ -108,6 +108,10 @@ static const struct pci_device_id pci_ids[] = {
#ifdef INTERNAL_TESTING
{
PCI_DEVICE
(
0x1d0f
,
0x1042
),
0
},
#endif
/* aws */
{
PCI_DEVICE
(
0x1d0f
,
0xf000
),
},
{
PCI_DEVICE
(
0x1d0f
,
0xf001
),
},
{
0
,}
};
MODULE_DEVICE_TABLE
(
pci
,
pci_ids
);
...
...
@@ -289,7 +293,11 @@ static void xdma_error_resume(struct pci_dev *pdev)
struct
xdma_pci_dev
*
xpdev
=
dev_get_drvdata
(
&
pdev
->
dev
);
pr_info
(
"dev 0x%p,0x%p.
\n
"
,
pdev
,
xpdev
);
#if KERNEL_VERSION(5, 7, 0) <= LINUX_VERSION_CODE
pci_aer_clear_nonfatal_status
(
pdev
);
#else
pci_cleanup_aer_uncorrect_error_status
(
pdev
);
#endif
}
#if KERNEL_VERSION(4, 13, 0) <= LINUX_VERSION_CODE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment