[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df67baa5-0f3d-4a42-a327-00452787908a@lunn.ch>
Date: Sun, 19 Jan 2025 18:31:44 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Sky Huang <SkyLake.Huang@...iatek.com>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Daniel Golle <daniel@...rotopia.org>,
Qingfang Deng <dqfext@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Simon Horman <horms@...nel.org>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Steven Liu <Steven.Liu@...iatek.com>
Subject: Re: [PATCH net-next 3/3] net: phy: mediatek: add driver for built-in
2.5G ethernet PHY on MT7988
> + np = of_find_compatible_node(NULL, NULL, "mediatek,2p5gphy-fw");
> + if (!np)
> + return -ENOENT;
The device tree binding need documenting.
> + /* Write magic number to safely stall MCU */
> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x800e, 0x1100);
> + phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x800f, 0x00df);
0x1100 and 0x00df are magic numbers, bit 0x800e and 0x800f are
not. Please add #defines.
> +
> + for (i = 0; i < MT7988_2P5GE_PMB_FW_SIZE - 1; i += 4)
> + writel(*((uint32_t *)(fw->data + i)), pmb_addr + i);
> + dev_info(dev, "Firmware date code: %x/%x/%x, version: %x.%x\n",
> + be16_to_cpu(*((__be16 *)(fw->data +
> + MT7988_2P5GE_PMB_FW_SIZE - 8))),
> + *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 6),
> + *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 5),
> + *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 2),
> + *(fw->data + MT7988_2P5GE_PMB_FW_SIZE - 1));
> +
> + writew(reg & ~MD32_EN, mcu_csr_base + MD32_EN_CFG);
> + writew(reg | MD32_EN, mcu_csr_base + MD32_EN_CFG);
> + phy_set_bits(phydev, MII_BMCR, BMCR_RESET);
> + /* We need a delay here to stabilize initialization of MCU */
> + usleep_range(7000, 8000);
> + dev_info(dev, "Firmware loading/trigger ok.\n");
We generally don't spam the log for "Happy Days" conditions. Please
only log if firmware download fails.
> +static int mt798x_2p5ge_phy_get_features(struct phy_device *phydev)
> +{
> + int ret;
> +
> + ret = genphy_c45_pma_read_abilities(phydev);
> + if (ret)
> + return ret;
> +
> + /* This phy can't handle collision, and neither can (XFI)MAC it's
> + * connected to. Although it can do HDX handshake, it doesn't support
> + * CSMA/CD that HDX requires.
> + */
> + linkmode_clear_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT,
> + phydev->supported);
So it can do 10BaseT_Half? What about 1000BaseT_Half?
As you said somewhere, 10/100/1G are not in the C45 space. So does
genphy_c45_pma_read_abilities() report these features?
Andrew
Powered by blists - more mailing lists