sonic-buildimage/platform/pddf/i2c/modules/include/pddf_i2c_algo.h
FuzailBrcm 0704ff5e6c
[pddf]: Adding support for FPGAPCIe in PDDF (#13476)
Why I did it
Some of the platform vendors use FPGA in the HW design. This FPGA is connected to the CPU via PCIe interface. This FPGA also works as an I2C controller having other devices attached to the I2C channels emanating from it. Adding a common module, a driver and a platform specific algorithm module to be used for such FPGA in PDDF.

How I did it
Added 'pddf_fpgapci_module', 'pddf_fpgapci_driver' and a sample algorithm module for Xilinx device 7021. Kernel modules which takes the platform dependent data from PDDF JSON files and initialises the PCIe FPGA. The sample algorithm module can be used by the ODMs in case the communication algorithms are same for their device. Else, they need to come up with similar algo module.

How to verify it
Any platform having such an FPGA and brought up using PDDF would use these kernel modules. The detail representation of such a device in PDDF JSON file is covered in the HLD.
2023-02-06 13:48:31 -08:00

37 lines
723 B
C

/*
*
* Description:
* This is the required header file for customed i2c algorithms
*/
#ifndef __PDDF_I2C_ALGO_H__
#define __PDDF_I2C_ALGO_H__
#include "pddf_client_defs.h"
/* max number of adapters */
#define I2C_PCI_MAX_BUS 16
/**
* struct fpgapci_devdata - PCI device data structure
* support one device per PCIe
*/
struct fpgapci_devdata {
struct pci_dev *pci_dev;
/* kernels virtual addr for fpga_data_base_addr */
void * __iomem fpga_data_base_addr;
/* kernels virtual addr. for the i2c_ch_base_addr */
void * __iomem fpga_i2c_ch_base_addr;
/* size per i2c_ch */
int fpga_i2c_ch_size;
/* number of supported virtual i2c buses */
int max_fpga_i2c_ch;
size_t bar_length;
};
#endif