#define pr_fmt(fmt) …
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/delay.h>
#include <linux/libfdt_env.h>
#include "fman.h"
#include "fman_port.h"
#include "fman_sp.h"
#include "fman_keygen.h"
#define DFLT_FQ_ID …
#define PORT_BMI_FIFO_UNITS …
#define MAX_PORT_FIFO_SIZE(bmi_max_fifo_size) …
#define PORT_CG_MAP_NUM …
#define PORT_PRS_RESULT_WORDS_NUM …
#define PORT_IC_OFFSET_UNITS …
#define MIN_EXT_BUF_SIZE …
#define BMI_PORT_REGS_OFFSET …
#define QMI_PORT_REGS_OFFSET …
#define HWP_PORT_REGS_OFFSET …
#define DFLT_PORT_BUFFER_PREFIX_CONTEXT_DATA_ALIGN …
#define DFLT_PORT_CUT_BYTES_FROM_END …
#define DFLT_PORT_ERRORS_TO_DISCARD …
#define DFLT_PORT_MAX_FRAME_LENGTH …
#define DFLT_PORT_RX_FIFO_PRI_ELEVATION_LEV(bmi_max_fifo_size) …
#define DFLT_PORT_RX_FIFO_THRESHOLD(major, bmi_max_fifo_size) … \
#define DFLT_PORT_EXTRA_NUM_OF_FIFO_BUFS …
#define QMI_DEQ_CFG_SUBPORTAL_MASK …
#define QMI_PORT_CFG_EN …
#define QMI_PORT_STATUS_DEQ_FD_BSY …
#define QMI_DEQ_CFG_PRI …
#define QMI_DEQ_CFG_TYPE1 …
#define QMI_DEQ_CFG_TYPE2 …
#define QMI_DEQ_CFG_TYPE3 …
#define QMI_DEQ_CFG_PREFETCH_PARTIAL …
#define QMI_DEQ_CFG_PREFETCH_FULL …
#define QMI_DEQ_CFG_SP_MASK …
#define QMI_DEQ_CFG_SP_SHIFT …
#define QMI_BYTE_COUNT_LEVEL_CONTROL(_type) …
#define BMI_EBD_EN …
#define BMI_PORT_CFG_EN …
#define BMI_PORT_STATUS_BSY …
#define BMI_DMA_ATTR_SWP_SHIFT …
#define BMI_DMA_ATTR_WRITE_OPTIMIZE …
#define BMI_RX_FIFO_PRI_ELEVATION_SHIFT …
#define BMI_RX_FIFO_THRESHOLD_ETHE …
#define BMI_FRAME_END_CS_IGNORE_SHIFT …
#define BMI_FRAME_END_CS_IGNORE_MASK …
#define BMI_RX_FRAME_END_CUT_SHIFT …
#define BMI_RX_FRAME_END_CUT_MASK …
#define BMI_IC_TO_EXT_SHIFT …
#define BMI_IC_TO_EXT_MASK …
#define BMI_IC_FROM_INT_SHIFT …
#define BMI_IC_FROM_INT_MASK …
#define BMI_IC_SIZE_MASK …
#define BMI_INT_BUF_MARG_SHIFT …
#define BMI_INT_BUF_MARG_MASK …
#define BMI_EXT_BUF_MARG_START_SHIFT …
#define BMI_EXT_BUF_MARG_START_MASK …
#define BMI_EXT_BUF_MARG_END_MASK …
#define BMI_CMD_MR_LEAC …
#define BMI_CMD_MR_SLEAC …
#define BMI_CMD_MR_MA …
#define BMI_CMD_MR_DEAS …
#define BMI_CMD_RX_MR_DEF …
#define BMI_CMD_TX_MR_DEF …
#define BMI_CMD_ATTR_ORDER …
#define BMI_CMD_ATTR_SYNC …
#define BMI_CMD_ATTR_COLOR_SHIFT …
#define BMI_FIFO_PIPELINE_DEPTH_SHIFT …
#define BMI_FIFO_PIPELINE_DEPTH_MASK …
#define BMI_NEXT_ENG_FD_BITS_SHIFT …
#define BMI_EXT_BUF_POOL_VALID …
#define BMI_EXT_BUF_POOL_EN_COUNTER …
#define BMI_EXT_BUF_POOL_BACKUP …
#define BMI_EXT_BUF_POOL_ID_SHIFT …
#define BMI_EXT_BUF_POOL_ID_MASK …
#define BMI_POOL_DEP_NUM_OF_POOLS_SHIFT …
#define BMI_TX_FIFO_MIN_FILL_SHIFT …
#define BMI_PRIORITY_ELEVATION_LEVEL …
#define BMI_FIFO_THRESHOLD …
#define BMI_DEQUEUE_PIPELINE_DEPTH(_type, _speed) …
#define RX_ERRS_TO_ENQ …
#define NIA_ORDER_RESTOR …
#define NIA_ENG_BMI …
#define NIA_ENG_QMI_ENQ …
#define NIA_ENG_QMI_DEQ …
#define NIA_ENG_HWP …
#define NIA_ENG_HWK …
#define NIA_BMI_AC_ENQ_FRAME …
#define NIA_BMI_AC_TX_RELEASE …
#define NIA_BMI_AC_RELEASE …
#define NIA_BMI_AC_TX …
#define NIA_BMI_AC_FETCH_ALL_FRAME …
#define TX_10G_PORT_BASE …
#define RX_10G_PORT_BASE …
struct fman_port_rx_bmi_regs { … };
struct fman_port_tx_bmi_regs { … };
fman_port_bmi_regs;
struct fman_port_qmi_regs { … };
#define HWP_HXS_COUNT …
#define HWP_HXS_PHE_REPORT …
#define HWP_HXS_PCAC_PSTAT …
#define HWP_HXS_PCAC_PSTOP …
#define HWP_HXS_TCP_OFFSET …
#define HWP_HXS_UDP_OFFSET …
#define HWP_HXS_SH_PAD_REM …
struct fman_port_hwp_regs { … };
enum fman_port_deq_prefetch { … };
struct fman_port_rsrc { … };
enum fman_port_dma_swap { … };
enum fman_port_color { … };
enum fman_port_deq_type { … };
struct fman_port_bpools { … };
struct fman_port_cfg { … };
struct fman_port_rx_pools_params { … };
struct fman_port_dts_params { … };
struct fman_port { … };
static int init_bmi_rx(struct fman_port *port)
{ … }
static int init_bmi_tx(struct fman_port *port)
{ … }
static int init_qmi(struct fman_port *port)
{ … }
static void stop_port_hwp(struct fman_port *port)
{ … }
static void start_port_hwp(struct fman_port *port)
{ … }
static void init_hwp(struct fman_port *port)
{ … }
static int init(struct fman_port *port)
{ … }
static int set_bpools(const struct fman_port *port,
const struct fman_port_bpools *bp)
{ … }
static bool is_init_done(struct fman_port_cfg *cfg)
{ … }
static int verify_size_of_fifo(struct fman_port *port)
{ … }
static int set_ext_buffer_pools(struct fman_port *port)
{ … }
static int init_low_level_driver(struct fman_port *port)
{ … }
static int fill_soc_specific_params(struct fman_port *port)
{ … }
static int get_dflt_fifo_deq_pipeline_depth(u8 major, enum fman_port_type type,
u16 speed)
{ … }
static int get_dflt_num_of_tasks(u8 major, enum fman_port_type type,
u16 speed)
{ … }
static int get_dflt_extra_num_of_tasks(u8 major, enum fman_port_type type,
u16 speed)
{ … }
static int get_dflt_num_of_open_dmas(u8 major, enum fman_port_type type,
u16 speed)
{ … }
static int get_dflt_extra_num_of_open_dmas(u8 major, enum fman_port_type type,
u16 speed)
{ … }
static int get_dflt_num_of_fifo_bufs(u8 major, enum fman_port_type type,
u16 speed)
{ … }
static void set_dflt_cfg(struct fman_port *port,
struct fman_port_params *port_params)
{ … }
static void set_rx_dflt_cfg(struct fman_port *port,
struct fman_port_params *port_params)
{ … }
static void set_tx_dflt_cfg(struct fman_port *port,
struct fman_port_params *port_params,
struct fman_port_dts_params *dts_params)
{ … }
int fman_port_config(struct fman_port *port, struct fman_port_params *params)
{ … }
EXPORT_SYMBOL(…);
void fman_port_use_kg_hash(struct fman_port *port, bool enable)
{ … }
EXPORT_SYMBOL(…);
int fman_port_init(struct fman_port *port)
{ … }
EXPORT_SYMBOL(…);
int fman_port_cfg_buf_prefix_content(struct fman_port *port,
struct fman_buffer_prefix_content *
buffer_prefix_content)
{ … }
EXPORT_SYMBOL(…);
int fman_port_disable(struct fman_port *port)
{ … }
EXPORT_SYMBOL(…);
int fman_port_enable(struct fman_port *port)
{ … }
EXPORT_SYMBOL(…);
struct fman_port *fman_port_bind(struct device *dev)
{ … }
EXPORT_SYMBOL(…);
u32 fman_port_get_qman_channel_id(struct fman_port *port)
{ … }
EXPORT_SYMBOL(…);
struct device *fman_port_get_device(struct fman_port *port)
{ … }
EXPORT_SYMBOL(…);
int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset)
{ … }
EXPORT_SYMBOL(…);
int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp)
{ … }
EXPORT_SYMBOL(…);
static int fman_port_probe(struct platform_device *of_dev)
{ … }
static const struct of_device_id fman_port_match[] = …;
MODULE_DEVICE_TABLE(of, fman_port_match);
static struct platform_driver fman_port_driver = …;
static int __init fman_port_load(void)
{ … }
module_init(…) …;
static void __exit fman_port_unload(void)
{ … }
module_exit(fman_port_unload);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;