Lines Matching defs:common

9 #include <common.h>
192 struct am65_cpsw_common *common = priv->cpsw_common;
193 struct am65_cpsw_port *port = &common->ports[priv->port_id];
325 struct am65_cpsw_common *common = priv->cpsw_common;
326 struct am65_cpsw_port *port = &common->ports[priv->port_id];
327 struct am65_cpsw_port *port0 = &common->ports[0];
331 ret = power_domain_on(&common->pwrdmn);
337 ret = clk_enable(&common->fclk);
343 common->rx_next = 0;
344 common->rx_pend = 0;
345 ret = dma_get_by_name(common->dev, "tx0", &common->dma_tx);
350 ret = dma_get_by_name(common->dev, "rx", &common->dma_rx);
357 ret = dma_prepare_rcv_buf(&common->dma_rx,
366 ret = dma_enable(&common->dma_tx);
371 ret = dma_enable(&common->dma_rx);
381 common->cpsw_base + AM65_CPSW_CTL_REG);
384 writel(0, common->cpsw_base + AM65_CPSW_PTYPE_REG);
388 common->cpsw_base + AM65_CPSW_STAT_PORT_EN_REG);
394 dma_get_cfg(&common->dma_rx, 0, (void **)&dma_rx_cfg_data);
403 common->ale_base + AM65_CPSW_ALE_CTL_REG);
407 common->ale_base + AM65_CPSW_ALE_PN_CTL_REG(0));
410 common->ale_base + AM65_CPSW_ALE_THREADMAPDEF_REG);
423 common->ale_base + AM65_CPSW_ALE_PN_CTL_REG(priv->port_id));
451 common->started = true;
459 writel(0, common->ale_base + AM65_CPSW_ALE_PN_CTL_REG(priv->port_id));
460 writel(0, common->ale_base + AM65_CPSW_ALE_PN_CTL_REG(0));
464 writel(0, common->ale_base + AM65_CPSW_ALE_CTL_REG);
465 writel(0, common->cpsw_base + AM65_CPSW_CTL_REG);
467 dma_disable(&common->dma_rx);
469 dma_disable(&common->dma_tx);
471 dma_free(&common->dma_rx);
473 dma_free(&common->dma_tx);
475 clk_disable(&common->fclk);
477 power_domain_off(&common->pwrdmn);
487 struct am65_cpsw_common *common = priv->cpsw_common;
493 ret = dma_send(&common->dma_tx, packet, length, &packet_data);
505 struct am65_cpsw_common *common = priv->cpsw_common;
508 return dma_receive(&common->dma_rx, (void **)packetp, NULL);
514 struct am65_cpsw_common *common = priv->cpsw_common;
518 u32 pkt = common->rx_next % UDMA_RX_DESC_NUM;
520 ret = dma_prepare_rcv_buf(&common->dma_rx,
525 common->rx_next++;
534 struct am65_cpsw_common *common = priv->cpsw_common;
535 struct am65_cpsw_port *port = &common->ports[priv->port_id];
537 if (!common->started)
542 writel(0, common->ale_base + AM65_CPSW_ALE_PN_CTL_REG(priv->port_id));
543 writel(0, common->ale_base + AM65_CPSW_ALE_PN_CTL_REG(0));
547 writel(0, common->ale_base + AM65_CPSW_ALE_CTL_REG);
548 writel(0, common->cpsw_base + AM65_CPSW_CTL_REG);
550 dma_disable(&common->dma_tx);
551 dma_free(&common->dma_tx);
553 dma_disable(&common->dma_rx);
554 dma_free(&common->dma_rx);
556 common->started = false;