/** * dwmac_pcs_isr - TBI, RTBI, or SGMII PHY ISR * @ioaddr: IO registers pointer * @reg: Base address of the AN Control Register. * @intr_status: GMAC core interrupt status * @x: pointer to log these events as stats * Description: it is the ISR for PCS events: Auto-Negotiation Completed and * Link status.
*/ staticinlinevoid dwmac_pcs_isr(void __iomem *ioaddr, u32 reg, unsignedint intr_status, struct stmmac_extra_stats *x)
{
u32 val = readl(ioaddr + GMAC_AN_STATUS(reg));
if (intr_status & PCS_ANE_IRQ) {
x->irq_pcs_ane_n++; if (val & GMAC_AN_STATUS_ANC)
pr_info("stmmac_pcs: ANE process completed\n");
}
if (intr_status & PCS_LINK_IRQ) {
x->irq_pcs_link_n++; if (val & GMAC_AN_STATUS_LS)
pr_info("stmmac_pcs: Link Up\n"); else
pr_info("stmmac_pcs: Link Down\n");
}
}
/** * dwmac_ctrl_ane - To program the AN Control Register. * @ioaddr: IO registers pointer * @reg: Base address of the AN Control Register. * @ane: to enable the auto-negotiation * @srgmi_ral: to manage MAC-2-MAC SGMII connections. * @loopback: to cause the PHY to loopback tx data into rx path. * Description: this is the main function to configure the AN control register * and init the ANE, select loopback (usually for debugging purpose) and * configure SGMII RAL.
*/ staticinlinevoid dwmac_ctrl_ane(void __iomem *ioaddr, u32 reg, bool ane, bool srgmi_ral, bool loopback)
{
u32 value = readl(ioaddr + GMAC_AN_CTRL(reg));
/* Enable and restart the Auto-Negotiation */ if (ane)
value |= GMAC_AN_CTRL_ANE | GMAC_AN_CTRL_RAN; else
value &= ~GMAC_AN_CTRL_ANE;
/* In case of MAC-2-MAC connection, block is configured to operate * according to MAC conf register.
*/ if (srgmi_ral)
value |= GMAC_AN_CTRL_SGMRAL;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.