Skip to content

Commit

Permalink
Merge data_dev_top and data_gpu_top
Browse files Browse the repository at this point in the history
Moved data_dev_top to common/driver and used the same symlink
pattern that the other files use.
  • Loading branch information
JJL772 committed Dec 17, 2024
1 parent 8efc165 commit 2c517de
Show file tree
Hide file tree
Showing 8 changed files with 539 additions and 1,032 deletions.
507 changes: 507 additions & 0 deletions common/driver/data_dev_top.c

Large diffs are not rendered by default.

56 changes: 27 additions & 29 deletions data_gpu/driver/src/data_gpu_top.h → common/driver/data_dev_top.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Company : SLAC National Accelerator Laboratory
*-----------------------------------------------------------------------------
* Description:
* Defines the top-level module types and functions for the Data GPU Device driver.
* Defines the top-level module types and functions for the Data Device driver.
* This driver is part of the aes_stream_drivers package.
* ----------------------------------------------------------------------------
* This file is part of the aes_stream_drivers package. It is subject to
Expand All @@ -16,42 +16,40 @@
* ----------------------------------------------------------------------------
**/

#ifndef __DATA_GPU_TOP_H__
#define __DATA_GPU_TOP_H__
#ifndef __DATA_DEV_TOP_H__
#define __DATA_DEV_TOP_H__

#include <linux/types.h>
#include <linux/device.h>
#include <linux/pci.h>
#include <dma_common.h>

/* Maximum number of DMA devices */
/** Maximum number of DMA devices supported. */
#define MAX_DMA_DEVICES 32

/* PCI IDs */
/** PCI vendor and device identifiers. */
#define PCI_VENDOR_ID_SLAC 0x1a4a
#define PCI_DEVICE_ID_DDEV 0x2030

/* Memory mapping offsets and sizes */
#define AGEN2_OFF 0x00000000
#define AGEN2_SIZE 0x00010000
#define PHY_OFF 0x00010000
#define PHY_SIZE 0x00010000
#define AVER_OFF 0x00020000
#define AVER_SIZE 0x00010000
#define PROM_OFF 0x00030000
#define PROM_SIZE 0x00050000
#define USER_OFF 0x00800000
#define USER_SIZE 0x00800000

/* Function prototypes */
int32_t DataGpu_Init(void);
void DataGpu_Exit(void);
int DataGpu_Probe(struct pci_dev *pcidev, const struct pci_device_id *dev_id);
void DataGpu_Remove(struct pci_dev *pcidev);
int32_t DataGpu_Command(struct DmaDevice *dev, uint32_t cmd, uint64_t arg);
void DataGpu_SeqShow(struct seq_file *s, struct DmaDevice *dev);

/* Hardware function operations */
extern struct hardware_functions DataGpu_functions;

#endif /* __DATA_GPU_TOP_H__ */
/** Address map for device registers. */
#define AGEN2_OFF 0x00000000 /**< DMAv2 Engine Offset */
#define AGEN2_SIZE 0x00010000 /**< DMAv2 Engine Size */
#define PHY_OFF 0x00010000 /**< PCIe PHY Offset */
#define PHY_SIZE 0x00010000 /**< PCIe PHY Size */
#define AVER_OFF 0x00020000 /**< AxiVersion Offset */
#define AVER_SIZE 0x00010000 /**< AxiVersion Size */
#define PROM_OFF 0x00030000 /**< PROM Offset */
#define PROM_SIZE 0x00050000 /**< PROM Size */
#define USER_OFF 0x00800000 /**< User Space Offset */
#define USER_SIZE 0x00800000 /**< User Space Size */

// Function prototypes
int32_t DataDev_Init(void);
void DataDev_Exit(void);
int DataDev_Probe(struct pci_dev *pcidev, const struct pci_device_id *dev_id);
void DataDev_Remove(struct pci_dev *pcidev);
int32_t DataDev_Command(struct DmaDevice *dev, uint32_t cmd, uint64_t arg);
void DataDev_SeqShow(struct seq_file *s, struct DmaDevice *dev);
extern struct hardware_functions DataDev_functions;

#endif // __DATA_DEV_TOP_H__
Loading

0 comments on commit 2c517de

Please sign in to comment.