int
ark_ddm_verify(struct ark_ddm_t *ddm)
{
+ uint32_t hw_const;
if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
PMD_DRV_LOG(ERR, "ARK: DDM structure looks incorrect %d vs %zd\n",
ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
return -1;
}
- if (ddm->cfg.const0 != ARK_DDM_CONST) {
- PMD_DRV_LOG(ERR, "ARK: DDM module not found as expected 0x%08x\n",
+ hw_const = ddm->cfg.const0;
+ if (hw_const == ARK_DDM_CONST1) {
+ PMD_DRV_LOG(ERR,
+ "ARK: DDM module is version 1, "
+ "PMD expects version 2\n");
+ return -1;
+ } else if (hw_const != ARK_DDM_CONST2) {
+ PMD_DRV_LOG(ERR,
+ "ARK: DDM module not found as expected 0x%08x\n",
ddm->cfg.const0);
return -1;
}
/* struct defining Tx meta data -- fixed in FPGA -- 16 bytes */
struct ark_tx_meta {
uint64_t physaddr;
- uint32_t delta_ns;
+ uint32_t user1;
uint16_t data_len; /* of this MBUF */
#define ARK_DDM_EOP 0x01
#define ARK_DDM_SOP 0x02
* structs will never be instantiated in ram memory
*/
#define ARK_DDM_CFG 0x0000
-#define ARK_DDM_CONST 0xfacecafe
+/* Set unique HW ID for hardware version */
+#define ARK_DDM_CONST2 (0x324d4444)
+#define ARK_DDM_CONST1 (0xfacecafe)
+
struct ark_ddm_cfg_t {
uint32_t r0;
volatile uint32_t tlp_stats_clear;
/* We are a single function multi-port device. */
ret = ark_config_device(dev);
+ if (ret)
+ return -1;
+
dev->dev_ops = &ark_eth_dev_ops;
dev->data->mac_addrs = rte_zmalloc("ark", ETHER_ADDR_LEN, 0);