mcam 54 drivers/media/platform/marvell-ccic/cafe-driver.c struct mcam_camera mcam; mcam 149 drivers/media/platform/marvell-ccic/cafe-driver.c return container_of(m, struct cafe_camera, mcam); mcam 153 drivers/media/platform/marvell-ccic/cafe-driver.c static int cafe_smbus_write_done(struct mcam_camera *mcam) mcam 164 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 165 drivers/media/platform/marvell-ccic/cafe-driver.c c1 = mcam_reg_read(mcam, REG_TWSIC1); mcam 166 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 175 drivers/media/platform/marvell-ccic/cafe-driver.c struct mcam_camera *mcam = &cam->mcam; mcam 177 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 184 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_TWSIC0, rval); mcam 185 drivers/media/platform/marvell-ccic/cafe-driver.c (void) mcam_reg_read(mcam, REG_TWSIC1); /* force write */ mcam 187 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_TWSIC1, rval); mcam 188 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 208 drivers/media/platform/marvell-ccic/cafe-driver.c wait_event_timeout(cam->smbus_wait, cafe_smbus_write_done(mcam), mcam 211 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 212 drivers/media/platform/marvell-ccic/cafe-driver.c rval = mcam_reg_read(mcam, REG_TWSIC1); mcam 213 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 230 drivers/media/platform/marvell-ccic/cafe-driver.c static int cafe_smbus_read_done(struct mcam_camera *mcam) mcam 241 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 242 drivers/media/platform/marvell-ccic/cafe-driver.c c1 = mcam_reg_read(mcam, REG_TWSIC1); mcam 243 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 254 drivers/media/platform/marvell-ccic/cafe-driver.c struct mcam_camera *mcam = &cam->mcam; mcam 256 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 263 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_TWSIC0, rval); mcam 264 drivers/media/platform/marvell-ccic/cafe-driver.c (void) mcam_reg_read(mcam, REG_TWSIC1); /* force write */ mcam 266 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_TWSIC1, rval); mcam 267 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 270 drivers/media/platform/marvell-ccic/cafe-driver.c cafe_smbus_read_done(mcam), CAFE_SMBUS_TIMEOUT); mcam 271 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 272 drivers/media/platform/marvell-ccic/cafe-driver.c rval = mcam_reg_read(mcam, REG_TWSIC1); mcam 273 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 320 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&cam->mcam.dev_lock, flags); mcam 321 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_set_bit(&cam->mcam, REG_IRQMASK, TWSIIRQS); mcam 322 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&cam->mcam.dev_lock, flags); mcam 372 drivers/media/platform/marvell-ccic/cafe-driver.c static void cafe_ctlr_init(struct mcam_camera *mcam) mcam 376 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 380 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, 0x3038, 0x8); mcam 381 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, 0x315c, 0x80008); mcam 388 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_CSR, GCSR_SRS|GCSR_MRS); /* Needed? */ mcam 389 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_CSR, GCSR_SRC|GCSR_MRC); mcam 390 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_CSR, GCSR_SRC|GCSR_MRS); mcam 394 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 396 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_irqsave(&mcam->dev_lock, flags); mcam 398 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_CSR, GCSR_CCIC_EN|GCSR_SRC|GCSR_MRC); mcam 399 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_set_bit(mcam, REG_GL_IMASK, GIMSK_CCIC_EN); mcam 403 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_IRQMASK, 0); mcam 404 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock_irqrestore(&mcam->dev_lock, flags); mcam 408 drivers/media/platform/marvell-ccic/cafe-driver.c static int cafe_ctlr_power_up(struct mcam_camera *mcam) mcam 414 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_FCR, GFCR_GPIO_ON); mcam 415 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_GPIOR, GGPIO_OUT|GGPIO_VAL); mcam 421 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GPR, GPR_C1EN|GPR_C0EN); /* pwr up, reset */ mcam 422 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C0); mcam 427 drivers/media/platform/marvell-ccic/cafe-driver.c static void cafe_ctlr_power_down(struct mcam_camera *mcam) mcam 429 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GPR, GPR_C1EN|GPR_C0EN|GPR_C1); mcam 430 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_FCR, GFCR_GPIO_ON); mcam 431 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_GL_GPIOR, GGPIO_OUT); mcam 442 drivers/media/platform/marvell-ccic/cafe-driver.c struct mcam_camera *mcam = &cam->mcam; mcam 445 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock(&mcam->dev_lock); mcam 446 drivers/media/platform/marvell-ccic/cafe-driver.c irqs = mcam_reg_read(mcam, REG_IRQSTAT); mcam 447 drivers/media/platform/marvell-ccic/cafe-driver.c handled = cam->registered && mccic_irq(mcam, irqs); mcam 449 drivers/media/platform/marvell-ccic/cafe-driver.c mcam_reg_write(mcam, REG_IRQSTAT, TWSIIRQS); mcam 453 drivers/media/platform/marvell-ccic/cafe-driver.c spin_unlock(&mcam->dev_lock); mcam 491 drivers/media/platform/marvell-ccic/cafe-driver.c struct mcam_camera *mcam; mcam 501 drivers/media/platform/marvell-ccic/cafe-driver.c mcam = &cam->mcam; mcam 502 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->chip_id = MCAM_CAFE; mcam 503 drivers/media/platform/marvell-ccic/cafe-driver.c spin_lock_init(&mcam->dev_lock); mcam 505 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->plat_power_up = cafe_ctlr_power_up; mcam 506 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->plat_power_down = cafe_ctlr_power_down; mcam 507 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->dev = &pdev->dev; mcam 508 drivers/media/platform/marvell-ccic/cafe-driver.c snprintf(mcam->bus_info, sizeof(mcam->bus_info), "PCI:%s", pci_name(pdev)); mcam 514 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->buffer_mode = B_vmalloc; mcam 524 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->regs = pci_iomap(pdev, 0, 0); mcam 525 drivers/media/platform/marvell-ccic/cafe-driver.c if (!mcam->regs) { mcam 529 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->regs_size = pci_resource_len(pdev, 0); mcam 537 drivers/media/platform/marvell-ccic/cafe-driver.c cafe_ctlr_init(mcam); mcam 548 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->asd.match_type = V4L2_ASYNC_MATCH_I2C; mcam 549 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->asd.match.i2c.adapter_id = i2c_adapter_id(cam->i2c_adapter); mcam 550 drivers/media/platform/marvell-ccic/cafe-driver.c mcam->asd.match.i2c.address = ov7670_info.addr; mcam 552 drivers/media/platform/marvell-ccic/cafe-driver.c ret = mccic_register(mcam); mcam 556 drivers/media/platform/marvell-ccic/cafe-driver.c clkdev_create(mcam->mclk, "xclk", "%d-%04x", mcam 564 drivers/media/platform/marvell-ccic/cafe-driver.c mccic_shutdown(mcam); mcam 568 drivers/media/platform/marvell-ccic/cafe-driver.c cafe_ctlr_power_down(mcam); mcam 571 drivers/media/platform/marvell-ccic/cafe-driver.c pci_iounmap(pdev, mcam->regs); mcam 586 drivers/media/platform/marvell-ccic/cafe-driver.c mccic_shutdown(&cam->mcam); mcam 589 drivers/media/platform/marvell-ccic/cafe-driver.c pci_iounmap(cam->pdev, cam->mcam.regs); mcam 620 drivers/media/platform/marvell-ccic/cafe-driver.c mccic_suspend(&cam->mcam); mcam 639 drivers/media/platform/marvell-ccic/cafe-driver.c cafe_ctlr_init(&cam->mcam); mcam 640 drivers/media/platform/marvell-ccic/cafe-driver.c return mccic_resume(&cam->mcam); mcam 277 drivers/media/platform/marvell-ccic/mcam-core.c static void mcam_enable_mipi(struct mcam_camera *mcam) mcam 280 drivers/media/platform/marvell-ccic/mcam-core.c if (mcam->calc_dphy) mcam 281 drivers/media/platform/marvell-ccic/mcam-core.c mcam->calc_dphy(mcam); mcam 282 drivers/media/platform/marvell-ccic/mcam-core.c cam_dbg(mcam, "camera: DPHY3=0x%x, DPHY5=0x%x, DPHY6=0x%x\n", mcam 283 drivers/media/platform/marvell-ccic/mcam-core.c mcam->dphy[0], mcam->dphy[1], mcam->dphy[2]); mcam 284 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_DPHY3, mcam->dphy[0]); mcam 285 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_DPHY5, mcam->dphy[1]); mcam 286 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_DPHY6, mcam->dphy[2]); mcam 288 drivers/media/platform/marvell-ccic/mcam-core.c if (!mcam->mipi_enabled) { mcam 289 drivers/media/platform/marvell-ccic/mcam-core.c if (mcam->lane > 4 || mcam->lane <= 0) { mcam 290 drivers/media/platform/marvell-ccic/mcam-core.c cam_warn(mcam, "lane number error\n"); mcam 291 drivers/media/platform/marvell-ccic/mcam-core.c mcam->lane = 1; /* set the default value */ mcam 299 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_CTRL0, mcam 300 drivers/media/platform/marvell-ccic/mcam-core.c CSI2_C0_MIPI_EN | CSI2_C0_ACT_LANE(mcam->lane)); mcam 301 drivers/media/platform/marvell-ccic/mcam-core.c mcam->mipi_enabled = true; mcam 305 drivers/media/platform/marvell-ccic/mcam-core.c static void mcam_disable_mipi(struct mcam_camera *mcam) mcam 308 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_CTRL0, 0x0); mcam 309 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_DPHY3, 0x0); mcam 310 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_DPHY5, 0x0); mcam 311 drivers/media/platform/marvell-ccic/mcam-core.c mcam_reg_write(mcam, REG_CSI2_DPHY6, 0x0); mcam 312 drivers/media/platform/marvell-ccic/mcam-core.c mcam->mipi_enabled = false; mcam 900 drivers/media/platform/marvell-ccic/mcam-core.c static void mcam_clk_enable(struct mcam_camera *mcam) mcam 905 drivers/media/platform/marvell-ccic/mcam-core.c if (!IS_ERR(mcam->clk[i])) mcam 906 drivers/media/platform/marvell-ccic/mcam-core.c clk_prepare_enable(mcam->clk[i]); mcam 910 drivers/media/platform/marvell-ccic/mcam-core.c static void mcam_clk_disable(struct mcam_camera *mcam) mcam 915 drivers/media/platform/marvell-ccic/mcam-core.c if (!IS_ERR(mcam->clk[i])) mcam 916 drivers/media/platform/marvell-ccic/mcam-core.c clk_disable_unprepare(mcam->clk[i]); mcam 38 drivers/media/platform/marvell-ccic/mmp-driver.c struct mcam_camera mcam; mcam 44 drivers/media/platform/marvell-ccic/mmp-driver.c static inline struct mmp_camera *mcam_to_cam(struct mcam_camera *mcam) mcam 46 drivers/media/platform/marvell-ccic/mmp-driver.c return container_of(mcam, struct mmp_camera, mcam); mcam 101 drivers/media/platform/marvell-ccic/mmp-driver.c static void mmpcam_calc_dphy(struct mcam_camera *mcam) mcam 103 drivers/media/platform/marvell-ccic/mmp-driver.c struct mmp_camera *cam = mcam_to_cam(mcam); mcam 191 drivers/media/platform/marvell-ccic/mmp-driver.c struct mcam_camera *mcam = data; mcam 194 drivers/media/platform/marvell-ccic/mmp-driver.c spin_lock(&mcam->dev_lock); mcam 195 drivers/media/platform/marvell-ccic/mmp-driver.c irqs = mcam_reg_read(mcam, REG_IRQSTAT); mcam 196 drivers/media/platform/marvell-ccic/mmp-driver.c handled = mccic_irq(mcam, irqs); mcam 197 drivers/media/platform/marvell-ccic/mmp-driver.c spin_unlock(&mcam->dev_lock); mcam 201 drivers/media/platform/marvell-ccic/mmp-driver.c static void mcam_init_clk(struct mcam_camera *mcam) mcam 210 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->clk[i] = devm_clk_get(mcam->dev, mcam_clks[i]); mcam 211 drivers/media/platform/marvell-ccic/mmp-driver.c if (IS_ERR(mcam->clk[i])) mcam 212 drivers/media/platform/marvell-ccic/mmp-driver.c dev_warn(mcam->dev, "Could not get clk: %s\n", mcam 221 drivers/media/platform/marvell-ccic/mmp-driver.c struct mcam_camera *mcam; mcam 233 drivers/media/platform/marvell-ccic/mmp-driver.c mcam = &cam->mcam; mcam 234 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->calc_dphy = mmpcam_calc_dphy; mcam 235 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->dev = &pdev->dev; mcam 238 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->mclk_src = pdata->mclk_src; mcam 239 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->mclk_div = pdata->mclk_div; mcam 240 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->bus_type = pdata->bus_type; mcam 241 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->dphy = pdata->dphy; mcam 242 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->lane = pdata->lane; mcam 250 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->mclk_src = 3; mcam 251 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->mclk_div = 2; mcam 253 drivers/media/platform/marvell-ccic/mmp-driver.c if (mcam->bus_type == V4L2_MBUS_CSI2_DPHY) { mcam 254 drivers/media/platform/marvell-ccic/mmp-driver.c cam->mipi_clk = devm_clk_get(mcam->dev, "mipi"); mcam 255 drivers/media/platform/marvell-ccic/mmp-driver.c if ((IS_ERR(cam->mipi_clk) && mcam->dphy[2] == 0)) mcam 258 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->mipi_enabled = false; mcam 259 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->chip_id = MCAM_ARMADA610; mcam 260 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->buffer_mode = B_DMA_sg; mcam 261 drivers/media/platform/marvell-ccic/mmp-driver.c strscpy(mcam->bus_info, "platform:mmp-camera", sizeof(mcam->bus_info)); mcam 262 drivers/media/platform/marvell-ccic/mmp-driver.c spin_lock_init(&mcam->dev_lock); mcam 267 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->regs = devm_ioremap_resource(&pdev->dev, res); mcam 268 drivers/media/platform/marvell-ccic/mmp-driver.c if (IS_ERR(mcam->regs)) mcam 269 drivers/media/platform/marvell-ccic/mmp-driver.c return PTR_ERR(mcam->regs); mcam 270 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->regs_size = resource_size(res); mcam 272 drivers/media/platform/marvell-ccic/mmp-driver.c mcam_init_clk(mcam); mcam 282 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->asd.match_type = V4L2_ASYNC_MATCH_FWNODE; mcam 283 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->asd.match.fwnode = fwnode_graph_get_remote_port_parent(ep); mcam 290 drivers/media/platform/marvell-ccic/mmp-driver.c ret = mccic_register(mcam); mcam 298 drivers/media/platform/marvell-ccic/mmp-driver.c mcam->mclk); mcam 315 drivers/media/platform/marvell-ccic/mmp-driver.c "mmp-camera", mcam); mcam 322 drivers/media/platform/marvell-ccic/mmp-driver.c fwnode_handle_put(mcam->asd.match.fwnode); mcam 323 drivers/media/platform/marvell-ccic/mmp-driver.c mccic_shutdown(mcam); mcam 331 drivers/media/platform/marvell-ccic/mmp-driver.c struct mcam_camera *mcam = &cam->mcam; mcam 334 drivers/media/platform/marvell-ccic/mmp-driver.c mccic_shutdown(mcam); mcam 358 drivers/media/platform/marvell-ccic/mmp-driver.c mccic_suspend(&cam->mcam); mcam 366 drivers/media/platform/marvell-ccic/mmp-driver.c return mccic_resume(&cam->mcam); mcam 211 drivers/net/ethernet/marvell/octeontx2/af/rvu.h struct npc_mcam mcam; mcam 31 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_mcam_free_all_entries(struct rvu *rvu, struct npc_mcam *mcam, mcam 33 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_mcam_free_all_counters(struct rvu *rvu, struct npc_mcam *mcam, mcam 64 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static int npc_get_nixlf_mcam_index(struct npc_mcam *mcam, mcam 74 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = mcam->pf_offset + (pf * RSVD_MCAM_ENTRIES_PER_PF); mcam 84 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c return (mcam->nixlf_offset + (nixlf * RSVD_MCAM_ENTRIES_PER_NIXLF)); mcam 87 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static int npc_get_bank(struct npc_mcam *mcam, int index) mcam 89 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c int bank = index / mcam->banksize; mcam 92 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->keysize == NPC_MCAM_KEY_X2) mcam 98 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static bool is_mcam_entry_enabled(struct rvu *rvu, struct npc_mcam *mcam, mcam 101 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c int bank = npc_get_bank(mcam, index); mcam 104 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index &= (mcam->banksize - 1); mcam 109 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_enable_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, mcam 112 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c int bank = npc_get_bank(mcam, index); mcam 115 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index &= (mcam->banksize - 1); mcam 116 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c for (; bank < (actbank + mcam->banks_per_entry); bank++) { mcam 202 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_config_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, mcam 206 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c int bank = npc_get_bank(mcam, index); mcam 212 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index &= (mcam->banksize - 1); mcam 220 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c for (; bank < (actbank + mcam->banks_per_entry); bank++, kw = kw + 2) { mcam 253 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, actindex, true); mcam 255 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, actindex, false); mcam 258 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_copy_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, mcam 261 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c int dbank = npc_get_bank(mcam, dest); mcam 262 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c int sbank = npc_get_bank(mcam, src); mcam 266 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c src &= (mcam->banksize - 1); mcam 267 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c dest &= (mcam->banksize - 1); mcam 270 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c for (bank = 0; bank < mcam->banks_per_entry; bank++) { mcam 298 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static u64 npc_get_mcam_action(struct rvu *rvu, struct npc_mcam *mcam, mcam 301 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c int bank = npc_get_bank(mcam, index); mcam 303 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index &= (mcam->banksize - 1); mcam 312 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 329 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 343 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (is_mcam_entry_enabled(rvu, mcam, blkaddr, index)) { mcam 344 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c *(u64 *)&action = npc_get_mcam_action(rvu, mcam, mcam 353 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_config_mcam_entry(rvu, mcam, blkaddr, index, mcam 371 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 384 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 396 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c ucast_idx = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 402 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (is_mcam_entry_enabled(rvu, mcam, blkaddr, ucast_idx)) mcam 403 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c *(u64 *)&action = npc_get_mcam_action(rvu, mcam, mcam 413 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_config_mcam_entry(rvu, mcam, blkaddr, index, mcam 420 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 431 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 433 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, index, enable); mcam 449 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 468 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 509 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_config_mcam_entry(rvu, mcam, blkaddr, index, mcam 516 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 528 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 535 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (index >= mcam->total_entries) mcam 538 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c bank = npc_get_bank(mcam, index); mcam 539 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index &= (mcam->banksize - 1); mcam 555 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 561 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (is_mcam_entry_enabled(rvu, mcam, blkaddr, index)) { mcam 562 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c bank = npc_get_bank(mcam, index); mcam 563 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index &= (mcam->banksize - 1); mcam 576 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 585 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 587 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, index, enable); mcam 598 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, mcam 600 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c bank = npc_get_bank(mcam, index); mcam 602 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c NPC_AF_MCAMEX_BANKX_ACTION(index & (mcam->banksize - 1), bank)); mcam 604 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, mcam 626 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 633 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 636 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_free_all_entries(rvu, mcam, blkaddr, pcifunc); mcam 639 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_free_all_counters(rvu, mcam, pcifunc); mcam 641 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 660 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 685 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->keysize != NPC_MCAM_KEY_X2) mcam 991 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 997 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->banks = (cfg >> 44) & 0xF; mcam 998 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->banksize = (cfg >> 28) & 0xFFFF; mcam 999 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->counters.max = (cfg >> 48) & 0xFFFF; mcam 1004 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->total_entries = (mcam->banks / BIT_ULL(cfg)) * mcam->banksize; mcam 1005 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->keysize = cfg; mcam 1009 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->banks_per_entry = 4; mcam 1011 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->banks_per_entry = 2; mcam 1013 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->banks_per_entry = 1; mcam 1024 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->total_entries <= rsvd) { mcam 1027 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->total_entries); mcam 1031 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->bmap_entries = mcam->total_entries - rsvd; mcam 1032 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->nixlf_offset = mcam->bmap_entries; mcam 1033 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->pf_offset = mcam->nixlf_offset + nixlf_count; mcam 1036 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->bmap = devm_kcalloc(rvu->dev, BITS_TO_LONGS(mcam->bmap_entries), mcam 1038 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->bmap) mcam 1041 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->bmap_reverse = devm_kcalloc(rvu->dev, mcam 1042 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c BITS_TO_LONGS(mcam->bmap_entries), mcam 1044 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->bmap_reverse) mcam 1047 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->bmap_fcnt = mcam->bmap_entries; mcam 1050 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2pfvf_map = devm_kcalloc(rvu->dev, mcam->bmap_entries, mcam 1052 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->entry2pfvf_map) mcam 1059 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->lprio_count = mcam->bmap_entries / 8; mcam 1060 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->lprio_count > BITS_PER_LONG) mcam 1061 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->lprio_count = round_down(mcam->lprio_count, mcam 1063 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->lprio_start = mcam->bmap_entries - mcam->lprio_count; mcam 1064 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->hprio_count = mcam->lprio_count; mcam 1065 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->hprio_end = mcam->hprio_count; mcam 1070 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c err = rvu_alloc_bitmap(&mcam->counters); mcam 1074 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr2pfvf_map = devm_kcalloc(rvu->dev, mcam->counters.max, mcam 1076 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->cntr2pfvf_map) mcam 1082 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2cntr_map = devm_kcalloc(rvu->dev, mcam->bmap_entries, mcam 1084 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->entry2cntr_map) mcam 1087 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr_refcnt = devm_kcalloc(rvu->dev, mcam->counters.max, mcam 1089 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->cntr_refcnt) mcam 1092 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_init(&mcam->lock); mcam 1097 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c kfree(mcam->counters.bmap); mcam 1196 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1199 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c kfree(mcam->counters.bmap); mcam 1200 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_destroy(&mcam->lock); mcam 1203 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static int npc_mcam_verify_entry(struct npc_mcam *mcam, mcam 1209 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (entry >= mcam->bmap_entries) mcam 1212 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (pcifunc != mcam->entry2pfvf_map[entry]) mcam 1218 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static int npc_mcam_verify_counter(struct npc_mcam *mcam, mcam 1224 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (cntr >= mcam->counters.max) mcam 1227 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (pcifunc != mcam->cntr2pfvf_map[cntr]) mcam 1233 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_map_mcam_entry_and_cntr(struct rvu *rvu, struct npc_mcam *mcam, mcam 1236 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c u16 index = entry & (mcam->banksize - 1); mcam 1237 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c u16 bank = npc_get_bank(mcam, entry); mcam 1240 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2cntr_map[entry] = cntr; mcam 1241 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr_refcnt[cntr]++; mcam 1249 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam, mcam 1252 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c u16 index = entry & (mcam->banksize - 1); mcam 1253 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c u16 bank = npc_get_bank(mcam, entry); mcam 1256 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2cntr_map[entry] = NPC_MCAM_INVALID_MAP; mcam 1257 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr_refcnt[cntr]--; mcam 1267 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_mcam_set_bit(struct npc_mcam *mcam, u16 index) mcam 1272 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rentry = mcam->bmap_entries - index - 1; mcam 1274 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c __set_bit(entry, mcam->bmap); mcam 1275 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c __set_bit(rentry, mcam->bmap_reverse); mcam 1276 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->bmap_fcnt--; mcam 1283 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_mcam_clear_bit(struct npc_mcam *mcam, u16 index) mcam 1288 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rentry = mcam->bmap_entries - index - 1; mcam 1290 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c __clear_bit(entry, mcam->bmap); mcam 1291 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c __clear_bit(rentry, mcam->bmap_reverse); mcam 1292 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->bmap_fcnt++; mcam 1295 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_mcam_free_all_entries(struct rvu *rvu, struct npc_mcam *mcam, mcam 1301 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c for (index = 0; index < mcam->bmap_entries; index++) { mcam 1302 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->entry2pfvf_map[index] == pcifunc) { mcam 1303 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2pfvf_map[index] = NPC_MCAM_INVALID_MAP; mcam 1305 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_clear_bit(mcam, index); mcam 1307 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, index, false); mcam 1310 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c cntr = mcam->entry2cntr_map[index]; mcam 1312 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_unmap_mcam_entry_and_cntr(rvu, mcam, mcam 1319 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_mcam_free_all_counters(struct rvu *rvu, struct npc_mcam *mcam, mcam 1325 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c for (cntr = 0; cntr < mcam->counters.max; cntr++) { mcam 1326 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->cntr2pfvf_map[cntr] == pcifunc) { mcam 1327 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr2pfvf_map[cntr] = NPC_MCAM_INVALID_MAP; mcam 1328 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr_refcnt[cntr] = 0; mcam 1329 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rvu_free_rsrc(&mcam->counters, cntr); mcam 1398 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_get_mcam_search_range_priority(struct npc_mcam *mcam, mcam 1419 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c *end = mcam->bmap_entries; mcam 1421 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (req->ref_entry >= mcam->hprio_end) mcam 1424 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c fcnt = npc_mcam_get_free_count(mcam->bmap, mcam 1425 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->hprio_end, mcam->bmap_entries); mcam 1427 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c *start = mcam->hprio_end; mcam 1446 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (req->ref_entry <= mcam->lprio_start) mcam 1449 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c fcnt = npc_mcam_get_free_count(mcam->bmap, mcam 1450 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->hprio_end, mcam->lprio_start); mcam 1453 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c *start = mcam->hprio_end; mcam 1454 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c *end = mcam->lprio_start; mcam 1457 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static int npc_mcam_alloc_entries(struct npc_mcam *mcam, u16 pcifunc, mcam 1469 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1472 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->bmap_fcnt) { mcam 1473 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1495 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_get_mcam_search_range_priority(mcam, req, mcam 1504 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c lp_fcnt = npc_mcam_get_free_count(mcam->bmap, mcam 1505 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->lprio_start, mcam 1506 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->bmap_entries); mcam 1507 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c hp_fcnt = npc_mcam_get_free_count(mcam->bmap, 0, mcam->hprio_end); mcam 1508 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c fcnt = mcam->bmap_fcnt - lp_fcnt - hp_fcnt; mcam 1512 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c start = mcam->hprio_end; mcam 1513 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c end = mcam->lprio_start; mcam 1518 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c start = mcam->hprio_end / 2; mcam 1519 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c end = mcam->bmap_entries - (mcam->lprio_count / 2); mcam 1527 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c end = mcam->bmap_entries; mcam 1532 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c bmap = mcam->bmap_reverse; mcam 1533 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c start = mcam->bmap_entries - start; mcam 1534 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c end = mcam->bmap_entries - end; mcam 1539 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c bmap = mcam->bmap; mcam 1550 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rsp->entry = mcam->bmap_entries - index - max_contig; mcam 1568 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = mcam->bmap_entries - index - 1; mcam 1578 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c ((end - start) != mcam->bmap_entries)) { mcam 1581 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c end = mcam->bmap_entries; mcam 1592 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c end = mcam->bmap_entries; mcam 1622 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_set_bit(mcam, index); mcam 1623 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2pfvf_map[index] = pcifunc; mcam 1624 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2cntr_map[index] = NPC_MCAM_INVALID_MAP; mcam 1628 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rsp->free_count = mcam->bmap_fcnt; mcam 1630 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1638 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1650 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (req->priority && req->ref_entry >= mcam->bmap_entries) mcam 1657 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c ((req->ref_entry == (mcam->bmap_entries - 1)) && mcam 1671 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c return npc_mcam_alloc_entries(mcam, pcifunc, req, rsp); mcam 1678 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1691 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1696 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); mcam 1700 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2pfvf_map[req->entry] = 0; mcam 1701 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_clear_bit(mcam, req->entry); mcam 1702 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, req->entry, false); mcam 1705 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c cntr = mcam->entry2cntr_map[req->entry]; mcam 1707 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, mcam 1714 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_free_all_entries(rvu, mcam, blkaddr, pcifunc); mcam 1716 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1724 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1732 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1733 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); mcam 1738 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_verify_counter(mcam, pcifunc, req->cntr)) { mcam 1748 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_config_mcam_entry(rvu, mcam, blkaddr, req->entry, req->intf, mcam 1752 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_map_mcam_entry_and_cntr(rvu, mcam, blkaddr, mcam 1757 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1765 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1773 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1774 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); mcam 1775 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1779 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, req->entry, true); mcam 1788 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1796 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1797 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_entry(mcam, pcifunc, req->entry); mcam 1798 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1802 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, req->entry, false); mcam 1811 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1824 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1832 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_entry(mcam, pcifunc, old_entry); mcam 1836 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_entry(mcam, pcifunc, new_entry); mcam 1841 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->entry2cntr_map[new_entry] != NPC_MCAM_INVALID_MAP) { mcam 1847 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, new_entry, false); mcam 1850 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_copy_mcam_entry(rvu, mcam, blkaddr, old_entry, new_entry); mcam 1853 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c cntr = mcam->entry2cntr_map[old_entry]; mcam 1855 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, mcam 1857 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_map_mcam_entry_and_cntr(rvu, mcam, blkaddr, mcam 1862 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, new_entry, true); mcam 1863 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_enable_mcam_entry(rvu, mcam, blkaddr, old_entry, false); mcam 1872 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1880 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1899 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1902 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!rvu_rsrc_free_count(&mcam->counters)) { mcam 1903 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1913 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_mcam_find_zero_area(mcam->counters.bmap, mcam 1914 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->counters.max, 0, mcam 1919 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c __set_bit(cntr, mcam->counters.bmap); mcam 1920 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr2pfvf_map[cntr] = pcifunc; mcam 1927 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = rvu_alloc_rsrc(&mcam->counters); mcam 1932 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr2pfvf_map[index] = pcifunc; mcam 1936 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1943 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1951 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1952 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c err = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); mcam 1954 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1959 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->cntr2pfvf_map[req->cntr] = NPC_MCAM_INVALID_MAP; mcam 1960 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rvu_free_rsrc(&mcam->counters, req->cntr); mcam 1963 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c while (entry < mcam->bmap_entries) { mcam 1964 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->cntr_refcnt[req->cntr]) mcam 1967 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry); mcam 1968 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (index >= mcam->bmap_entries) mcam 1970 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->entry2cntr_map[index] != req->cntr) mcam 1974 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, mcam 1978 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 1985 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 1993 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 1994 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); mcam 2000 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c rc = npc_mcam_verify_entry(mcam, req->hdr.pcifunc, req->entry); mcam 2003 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, mcam 2009 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c while (entry < mcam->bmap_entries) { mcam 2010 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (!mcam->cntr_refcnt[req->cntr]) mcam 2013 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry); mcam 2014 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (index >= mcam->bmap_entries) mcam 2016 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c if (mcam->entry2cntr_map[index] != req->cntr) mcam 2020 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, mcam 2024 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 2031 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 2038 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 2039 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c err = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); mcam 2040 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 2053 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 2060 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 2061 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c err = npc_mcam_verify_counter(mcam, req->hdr.pcifunc, req->cntr); mcam 2062 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 2080 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 2120 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 2121 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mcam->entry2pfvf_map[entry] = 0; mcam 2122 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_mcam_clear_bit(mcam, entry); mcam 2123 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 2130 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_lock(&mcam->lock); mcam 2131 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_config_mcam_entry(rvu, mcam, blkaddr, entry, req->intf, mcam 2135 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_map_mcam_entry_and_cntr(rvu, mcam, blkaddr, entry, cntr); mcam 2136 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c mutex_unlock(&mcam->lock); mcam 2193 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c struct npc_mcam *mcam = &rvu->hw->mcam; mcam 2204 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index = npc_get_nixlf_mcam_index(mcam, pcifunc, nixlf, mcam 2206 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c pfvf->entry.action = npc_get_mcam_action(rvu, mcam, blkaddr, index); mcam 2207 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c enable = is_mcam_entry_enabled(rvu, mcam, blkaddr, index); mcam 2208 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c npc_config_mcam_entry(rvu, mcam, blkaddr, pfvf->rxvlan_index, mcam 136 drivers/net/ethernet/mellanox/mlx5/core/fw.c return mlx5_query_mcam_reg(dev, dev->caps.mcam, mcam 86 drivers/net/ethernet/mellanox/mlx5/core/port.c int mlx5_query_mcam_reg(struct mlx5_core_dev *dev, u32 *mcam, u8 feature_group, mcam 95 drivers/net/ethernet/mellanox/mlx5/core/port.c return mlx5_core_access_reg(dev, in, sz, mcam, sz, MLX5_REG_MCAM, 0, 0); mcam 1271 include/linux/mlx5/device.h MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_access_reg_cap_mask.access_regs.reg) mcam 1274 include/linux/mlx5/device.h MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld) mcam 689 include/linux/mlx5/driver.h u32 mcam[MLX5_ST_SZ_DW(mcam_reg)];