Lines Matching +full:valid +full:- +full:mask
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* Applied Micro X-Gene SoC Ethernet Classifier structures
27 if (pdata->enet_id == XGENE_ENET1) { in xgene_cle_idt_to_hw()
41 buf[0] = SET_VAL(CLE_DROP, dbptr->drop); in xgene_cle_dbptr_to_hw()
42 buf[4] = SET_VAL(CLE_FPSEL, dbptr->fpsel) | in xgene_cle_dbptr_to_hw()
43 SET_VAL(CLE_NFPSEL, dbptr->nxtfpsel) | in xgene_cle_dbptr_to_hw()
44 SET_VAL(CLE_DSTQIDL, dbptr->dstqid); in xgene_cle_dbptr_to_hw()
46 buf[5] = SET_VAL(CLE_DSTQIDH, (u32)dbptr->dstqid >> CLE_DSTQIDL_LEN) | in xgene_cle_dbptr_to_hw()
47 SET_VAL(CLE_PRIORITY, dbptr->cle_priority); in xgene_cle_dbptr_to_hw()
55 buf[j++] = SET_VAL(CLE_TYPE, kn->node_type); in xgene_cle_kn_to_hw()
56 for (i = 0; i < kn->num_keys; i++) { in xgene_cle_kn_to_hw()
57 struct xgene_cle_ptree_key *key = &kn->key[i]; in xgene_cle_kn_to_hw()
60 buf[j] = SET_VAL(CLE_KN_PRIO, key->priority) | in xgene_cle_kn_to_hw()
61 SET_VAL(CLE_KN_RPTR, key->result_pointer); in xgene_cle_kn_to_hw()
63 data = SET_VAL(CLE_KN_PRIO, key->priority) | in xgene_cle_kn_to_hw()
64 SET_VAL(CLE_KN_RPTR, key->result_pointer); in xgene_cle_kn_to_hw()
77 buf[j++] = SET_VAL(CLE_DN_TYPE, dn->node_type) | in xgene_cle_dn_to_hw()
78 SET_VAL(CLE_DN_LASTN, dn->last_node) | in xgene_cle_dn_to_hw()
79 SET_VAL(CLE_DN_HLS, dn->hdr_len_store) | in xgene_cle_dn_to_hw()
80 SET_VAL(CLE_DN_EXT, dn->hdr_extn) | in xgene_cle_dn_to_hw()
81 SET_VAL(CLE_DN_BSTOR, dn->byte_store) | in xgene_cle_dn_to_hw()
82 SET_VAL(CLE_DN_SBSTOR, dn->search_byte_store) | in xgene_cle_dn_to_hw()
83 SET_VAL(CLE_DN_RPTR, dn->result_pointer); in xgene_cle_dn_to_hw()
85 for (i = 0; i < dn->num_branches; i++) { in xgene_cle_dn_to_hw()
86 br = &dn->branch[i]; in xgene_cle_dn_to_hw()
87 npp = br->next_packet_pointer; in xgene_cle_dn_to_hw()
89 if ((br->jump_rel == JMP_ABS) && (npp < CLE_PKTRAM_SIZE)) in xgene_cle_dn_to_hw()
92 buf[j++] = SET_VAL(CLE_BR_VALID, br->valid) | in xgene_cle_dn_to_hw()
94 SET_VAL(CLE_BR_JB, br->jump_bw) | in xgene_cle_dn_to_hw()
95 SET_VAL(CLE_BR_JR, br->jump_rel) | in xgene_cle_dn_to_hw()
96 SET_VAL(CLE_BR_OP, br->operation) | in xgene_cle_dn_to_hw()
97 SET_VAL(CLE_BR_NNODE, br->next_node) | in xgene_cle_dn_to_hw()
98 SET_VAL(CLE_BR_NBR, br->next_branch); in xgene_cle_dn_to_hw()
100 buf[j++] = SET_VAL(CLE_BR_DATA, br->data) | in xgene_cle_dn_to_hw()
101 SET_VAL(CLE_BR_MASK, br->mask); in xgene_cle_dn_to_hw()
109 int ret = -EBUSY; in xgene_cle_poll_cmd_done()
111 while (loop--) { in xgene_cle_poll_cmd_done()
127 enum xgene_cle_parser parser = cle->active_parser; in xgene_cle_dram_wr()
128 void __iomem *base = cle->base; in xgene_cle_dram_wr()
134 nparsers = (type >= PTREE_RAM) ? 1 : cle->parsers; in xgene_cle_dram_wr()
158 struct xgene_cle_ptree *ptree = &cle->ptree; in xgene_cle_enable_ptree()
159 void __iomem *addr, *base = cle->base; in xgene_cle_enable_ptree()
164 ptree->start_pkt += cle->jump_bytes; in xgene_cle_enable_ptree()
165 for (i = 0; i < cle->parsers; i++) { in xgene_cle_enable_ptree()
166 if (cle->active_parser != PARSER_ALL) in xgene_cle_enable_ptree()
167 addr = base + cle->active_parser * offset; in xgene_cle_enable_ptree()
171 iowrite32(ptree->start_node & 0x3fff, addr + SNPTR0); in xgene_cle_enable_ptree()
172 iowrite32(ptree->start_pkt & 0x1ff, addr + SPPTR0); in xgene_cle_enable_ptree()
179 struct xgene_cle_ptree *ptree = &cle->ptree; in xgene_cle_setup_dbptr()
185 for (i = 0; i < ptree->num_dbptr; i++) { in xgene_cle_setup_dbptr()
186 xgene_cle_dbptr_to_hw(pdata, &ptree->dbptr[i], buf); in xgene_cle_setup_dbptr()
187 ret = xgene_cle_dram_wr(cle, buf, 6, i + ptree->start_dbptr, in xgene_cle_setup_dbptr()
210 .valid = 1,
218 .mask = 0x0
221 .valid = 0,
229 .mask = 0xffff
246 .valid = 1,
254 .mask = 0x00ff
258 .valid = 1,
266 .mask = 0x00ff
269 .valid = 0,
277 .mask = 0xffff
294 .valid = 0,
302 .mask = 0xffff
306 .valid = 0,
314 .mask = 0xffff
318 .valid = 0,
326 .mask = 0xffff
330 .valid = 0,
338 .mask = 0xffff
342 .valid = 0,
350 .mask = 0xffff
354 .valid = 0,
362 .mask = 0xffff
379 .valid = 0,
387 .mask = 0xffff
391 .valid = 0,
399 .mask = 0xffff
403 .valid = 0,
411 .mask = 0xffff
415 .valid = 0,
423 .mask = 0xffff
427 .valid = 0,
435 .mask = 0xffff
439 .valid = 0,
447 .mask = 0xffff
464 .valid = 0,
472 .mask = 0xffff
476 .valid = 0,
484 .mask = 0xffff
488 .valid = 0,
496 .mask = 0xffff
500 .valid = 0,
508 .mask = 0xffff
512 .valid = 0,
520 .mask = 0xffff
524 .valid = 0,
532 .mask = 0xffff
549 .valid = 0,
557 .mask = 0xffff
566 struct xgene_cle_ptree *ptree = &cle->ptree; in xgene_cle_setup_node()
569 struct xgene_cle_ptree_kn *kn = ptree->kn; in xgene_cle_setup_node()
575 xgene_cle_dn_to_hw(&dn[i], buf, cle->jump_bytes); in xgene_cle_setup_node()
576 ret = xgene_cle_dram_wr(cle, buf, 17, i + ptree->start_node, in xgene_cle_setup_node()
584 for (j = i; j < (ptree->num_kn + num_dn); j++) { in xgene_cle_setup_node()
585 xgene_cle_kn_to_hw(&kn[j - num_dn], buf); in xgene_cle_setup_node()
586 ret = xgene_cle_dram_wr(cle, buf, 17, j + ptree->start_node, in xgene_cle_setup_node()
618 void __iomem *base = enet_cle->base; in xgene_cle_setup_def_dbptr()
627 for (i = 0; i < enet_cle->parsers; i++) { in xgene_cle_setup_def_dbptr()
628 if (enet_cle->active_parser != PARSER_ALL) { in xgene_cle_setup_def_dbptr()
629 offset = enet_cle->active_parser * in xgene_cle_setup_def_dbptr()
704 idx = i % pdata->rxq_cnt; in xgene_cle_set_rss_idt()
705 pool_id = pdata->rx_ring[idx]->buf_pool->id; in xgene_cle_set_rss_idt()
707 dstqid = xgene_enet_dst_ring_num(pdata->rx_ring[idx]); in xgene_cle_set_rss_idt()
709 if (pdata->rx_ring[idx]->page_pool) { in xgene_cle_set_rss_idt()
710 pool_id = pdata->rx_ring[idx]->page_pool->id; in xgene_cle_set_rss_idt()
716 ret = xgene_cle_dram_wr(&pdata->cle, &idt_reg, 1, i, in xgene_cle_set_rss_idt()
722 ret = xgene_cle_set_rss_skeys(&pdata->cle); in xgene_cle_set_rss_idt()
731 struct xgene_enet_cle *cle = &pdata->cle; in xgene_cle_setup_rss()
732 void __iomem *base = cle->base; in xgene_cle_setup_rss()
737 for (i = 0; i < cle->parsers; i++) { in xgene_cle_setup_rss()
738 if (cle->active_parser != PARSER_ALL) in xgene_cle_setup_rss()
739 offset = cle->active_parser * CLE_PORT_OFFSET; in xgene_cle_setup_rss()
763 struct xgene_enet_cle *enet_cle = &pdata->cle; in xgene_enet_cle_init()
770 if (pdata->phy_mode != PHY_INTERFACE_MODE_XGMII) in xgene_enet_cle_init()
771 return -EINVAL; in xgene_enet_cle_init()
773 ptree = &enet_cle->ptree; in xgene_enet_cle_init()
774 ptree->start_pkt = 12; /* Ethertype */ in xgene_enet_cle_init()
778 netdev_err(pdata->ndev, "RSS initialization failed\n"); in xgene_enet_cle_init()
782 def_qid = xgene_enet_dst_ring_num(pdata->rx_ring[0]); in xgene_enet_cle_init()
783 pool_id = pdata->rx_ring[0]->buf_pool->id; in xgene_enet_cle_init()
786 if (pdata->rx_ring[0]->page_pool) { in xgene_enet_cle_init()
787 pool_id = pdata->rx_ring[0]->page_pool->id; in xgene_enet_cle_init()
812 ptree->kn = &kn; in xgene_enet_cle_init()
813 ptree->dbptr = dbptr; in xgene_enet_cle_init()
814 ptree->num_kn = 1; in xgene_enet_cle_init()
815 ptree->num_dbptr = DB_MAX_PTRS; in xgene_enet_cle_init()