Gagandeep Singh 67fc3ff97c net/pfe: introduce basic functions
pfe (packet forwarding engine) is a network
poll mode driver for NXP SoC ls1012a.

This patch introduces the framework of pfe
driver with basic functions of initialisation
and teardown.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
2019-10-23 16:43:08 +02:00

74 lines
1.5 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2019 NXP
*/
#ifndef _PFE_ETH_H_
#define _PFE_ETH_H_
#include <compat.h>
#include <rte_ethdev.h>
#include <rte_ethdev_vdev.h>
#define ETH_ALEN 6
#define GEMAC_NO_PHY BIT(0)
#define PFE_SOC_ID_FILE "/sys/devices/soc0/soc_id"
extern unsigned int pfe_svr;
#define SVR_LS1012A_REV2 0x87040020
#define SVR_LS1012A_REV1 0x87040010
struct ls1012a_eth_platform_data {
/* device specific information */
u32 device_flags;
char name[16];
/* board specific information */
u32 mii_config;
u32 phy_flags;
u32 gem_id;
u32 bus_id;
u32 phy_id;
u32 mdio_muxval;
u8 mac_addr[ETH_ALEN];
};
struct ls1012a_mdio_platform_data {
int enabled;
int irq[32];
u32 phy_mask;
int mdc_div;
};
struct ls1012a_pfe_platform_data {
struct ls1012a_eth_platform_data ls1012a_eth_pdata[3];
struct ls1012a_mdio_platform_data ls1012a_mdio_pdata[3];
};
#define EMAC_TXQ_CNT 16
#define EMAC_TXQ_DEPTH (HIF_TX_DESC_NT)
#define JUMBO_FRAME_SIZE 10258
#define EMAC_RXQ_CNT 1
#define EMAC_RXQ_DEPTH HIF_RX_DESC_NT
struct pfe_eth_priv_s {
struct pfe *pfe;
int low_tmu_q;
int high_tmu_q;
struct rte_eth_dev *ndev;
struct rte_eth_stats stats;
int id;
int promisc;
int link_fd;
spinlock_t lock; /* protect member variables */
void *EMAC_baseaddr;
/* This points to the EMAC base from where we access PHY */
void *PHY_baseaddr;
void *GPI_baseaddr;
struct ls1012a_eth_platform_data *einfo;
};
#endif /* _PFE_ETH_H_ */