Skip to contentSkip to conversation

net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices

PATCH Applied René van Dorst 2 participants 3 messages Jun 29, 2019 – Jul 2, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices

No reason to error out on a MT7621 device with DDR2 memory when non TRGMII mode is selected.
Only MT7621 DDR2 clock setup is not supported for TRGMII mode. But non TRGMII mode doesn't need any special clock setup.

---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +5 -2
index 066712f2e985..b20b3a5a1ebb 100644
@@ -139,9 +139,12 @@ static int mt7621_gmac0_rgmii_adjust(struct mtk_eth *eth,
 {
 	u32 val;
 
-	/* Check DDR memory type. Currently DDR2 is not supported. */
+	/* Check DDR memory type.
+	 * Currently TRGMII mode with DDR2 memory is not supported.
+	 */
 	regmap_read(eth->ethsys, ETHSYS_SYSCFG, &val);
-	if (val & SYSCFG_DRAM_TYPE_DDR2) {
+	if (interface == PHY_INTERFACE_MODE_TRGMII &&
+	    val & SYSCFG_DRAM_TYPE_DDR2) {
 		dev_err(eth->dev,
 			"TRGMII mode with DDR2 memory is not supported!\n");
 		return -EOPNOTSUPP;
Signature · 1 line
2.20.1
#1 lore raw

Quoting René van Dorst <[email protected]>:

I see that I also forgot to tag this patch for net-next.

Greats,

René

Quoted 32 lines

No reason to error out on a MT7621 device with DDR2 memory when non TRGMII mode is selected.
Only MT7621 DDR2 clock setup is not supported for TRGMII mode. But non TRGMII mode doesn't need any special clock setup.

---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +5 -2
index 066712f2e985..b20b3a5a1ebb 100644
@@ -139,9 +139,12 @@ static int mt7621_gmac0_rgmii_adjust(struct  
 mtk_eth *eth,
 {
 	u32 val;
 
-	/* Check DDR memory type. Currently DDR2 is not supported. */
+	/* Check DDR memory type.
+	 * Currently TRGMII mode with DDR2 memory is not supported.
+	 */
 	regmap_read(eth->ethsys, ETHSYS_SYSCFG, &val);
-	if (val & SYSCFG_DRAM_TYPE_DDR2) {
+	if (interface == PHY_INTERFACE_MODE_TRGMII &&
+	    val & SYSCFG_DRAM_TYPE_DDR2) {
 		dev_err(eth->dev,
 			"TRGMII mode with DDR2 memory is not supported!\n");

return -EOPNOTSUPP;
--
2.20.1