08f3b9720b
summary of E530 platfrom: - CPU: CTC5236, arm64 - LAN switch chip set: CENTEC CTC7132 (TsingMa). TsingMa is a purpose built device to address the challenge in the recent network evolution such as Cloud computing. CTC7132 provides 440Gbps I/O bandwidth and 400Gcore bandwidth, the CTC7132 family combines a feature-rich switch core and an embedded ARM A53 CPU Core running at 800MHz/1.2GHz. CTC7132 supports a variety of port configurations, such as QSGMII and USXGMII-M, providing full-rate port capability from 100M to 100G. - device E530-48T4X: 48 * 10/100/1000 Base-T Ports, 4 * 10GE SFP+ Ports. - device E530-24X2C: 24 * 10 GE SFP+ Ports, 2 * 100GE QSFP28 Ports. add new files in three directories: device/centec/arm64-centec_e530_24x2c-r0 device/centec/arm64-centec_e530_48t4x_p-r0 platform/centec-arm64 Co-authored-by: taocy <taocy2@centecnetworks.com> Co-authored-by: Gu Xianghong <gxh2001757@163.com> Co-authored-by: shil <shil@centecnetworks.com>
120 lines
2.7 KiB
C
120 lines
2.7 KiB
C
/**
|
|
@file dal.h
|
|
|
|
@author Copyright (C) 2012 Centec Networks Inc. All rights reserved.
|
|
|
|
@date 2012-4-9
|
|
|
|
@version v2.0
|
|
|
|
*/
|
|
#ifndef _DAL_COMMON_H_
|
|
#define _DAL_COMMON_H_
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define DAL_MAX_CHIP_NUM 8 /* DAL support max chip num is 8 */
|
|
#define DAL_MAX_INTR_NUM 8
|
|
|
|
#define DAL_NETIF_T_PORT 0
|
|
#define DAL_NETIF_T_VLAN 1
|
|
|
|
#define DAL_MAX_KNET_NETIF 64
|
|
#define DAL_MAX_KNET_NAME_LEN 32
|
|
|
|
enum dal_operate_code_e
|
|
{
|
|
DAL_OP_CREATE,
|
|
DAL_OP_DESTORY,
|
|
DAL_OP_GET,
|
|
DAL_OP_MAX,
|
|
};
|
|
typedef enum dal_operate_code_e dal_operate_code_t;
|
|
|
|
struct dal_dma_info_s
|
|
{
|
|
unsigned int lchip;
|
|
unsigned int phy_base;
|
|
unsigned int phy_base_hi;
|
|
unsigned int size;
|
|
unsigned int knet_tx_offset;
|
|
unsigned int knet_tx_size;
|
|
unsigned int* virt_base;
|
|
};
|
|
typedef struct dal_dma_info_s dal_dma_info_t;
|
|
|
|
struct dal_dma_chan_s
|
|
{
|
|
unsigned char lchip;
|
|
unsigned char channel_id;
|
|
unsigned char dmasel;
|
|
unsigned char active;
|
|
unsigned short current_index;
|
|
unsigned short desc_num;
|
|
unsigned short desc_depth;
|
|
unsigned short data_size;
|
|
unsigned long long mem_base;
|
|
void* virt_base; /**< don't use when register chan*/
|
|
unsigned char* p_desc_used; /**< don't use when register chan*/
|
|
};
|
|
typedef struct dal_dma_chan_s dal_dma_chan_t;
|
|
|
|
struct dal_netif_s
|
|
{
|
|
unsigned char op_type;
|
|
unsigned char netif_id;
|
|
unsigned char type;
|
|
unsigned char lchip;
|
|
unsigned short vlan;
|
|
unsigned int gport;
|
|
unsigned char mac[6];
|
|
char name[DAL_MAX_KNET_NAME_LEN];
|
|
};
|
|
typedef struct dal_netif_s dal_netif_t;
|
|
|
|
/**
|
|
@brief define dal error type
|
|
*/
|
|
enum dal_err_e
|
|
{
|
|
DAL_E_NONE = 0, /**< NO error */
|
|
DAL_E_INVALID_PTR = -1000, /**< invalid pointer */
|
|
DAL_E_INVALID_FD = -999, /**< invalid FD */
|
|
DAL_E_TIME_OUT = -998, /**< time out */
|
|
DAL_E_INVALID_ACCESS = -997, /**< invalid access type*/
|
|
DAL_E_MPOOL_NOT_CREATE = -996, /**< mpool not create*/
|
|
DAL_E_INVALID_IRQ = -995,
|
|
DAL_E_DEV_NOT_FOUND = -994,
|
|
DAL_E_EXCEED_MAX = -993,
|
|
DAL_E_NOT_INIT = -992,
|
|
DAL_E_ENVALID_MSI_PARA = -991,
|
|
|
|
DAL_E_ERROR_CODE_END
|
|
};
|
|
|
|
enum dal_access_type_e
|
|
{
|
|
DAL_PCI_IO, /* [HB]humber is access as pci device, using ioctrl */
|
|
DAL_SUPER_IF, /* [HB]humber is controled by fpga device */
|
|
DAL_PCIE_MM, /* [GB]Gb is access as pcie device, using mmap */
|
|
DAL_SPECIAL_EMU, /* [GB]special for emulation */
|
|
DAL_MAX_ACCESS_TYPE
|
|
};
|
|
typedef enum dal_access_type_e dal_access_type_t;
|
|
|
|
struct dal_pci_dev_s
|
|
{
|
|
unsigned int busNo;
|
|
unsigned int devNo;
|
|
unsigned int funNo;
|
|
};
|
|
typedef struct dal_pci_dev_s dal_pci_dev_t;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|