* The wr, rr functions cannot be used since this hidden register
* is outside of the normal ag71xx register block.
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
+ void __iomem *dam = ioremap(0xb90001bc, 0x4);
+#else
void __iomem *dam = ioremap_nocache(0xb90001bc, 0x4);
+#endif
if (dam) {
__raw_writel(__raw_readl(dam) & ~BIT(27), dam);
(void)__raw_readl(dam);
napi_schedule(&ag->napi);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static void ag71xx_tx_timeout(struct net_device *dev, unsigned int txqueue)
+#else
static void ag71xx_tx_timeout(struct net_device *dev)
+#endif
{
struct ag71xx *ag = netdev_priv(dev);
ag->pllregmap = NULL;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
+ ag->mac_base = devm_ioremap(&pdev->dev, res->start,
+ res->end - res->start + 1);
+#else
ag->mac_base = devm_ioremap_nocache(&pdev->dev, res->start,
res->end - res->start + 1);
+#endif
if (!ag->mac_base)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (res) {
- ag->mii_base = devm_ioremap_nocache(&pdev->dev, res->start,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
+ ag->mii_base = devm_ioremap(&pdev->dev, res->start,
res->end - res->start + 1);
+#else
+ ag->mii_base = devm_ioremap_nocache(&pdev->dev, res->start,
+ res->end - res->start + 1);
+#endif
if (!ag->mii_base)
return -ENOMEM;
}
memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)
+ of_get_phy_mode(np, &ag->phy_if_mode);
+#else
ag->phy_if_mode = of_get_phy_mode(np);
+#endif
+
if (ag->phy_if_mode < 0) {
dev_err(&pdev->dev, "missing phy-mode property in DT\n");
return ag->phy_if_mode;