linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices
@ 2019-06-29 12:24 René van Dorst
  2019-07-01 12:57 ` René van Dorst
  2019-07-02 21:06 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: René van Dorst @ 2019-06-29 12:24 UTC (permalink / raw)
  To: sean.wang, f.fainelli, linux, davem, matthias.bgg, andrew,
	vivien.didelot
  Cc: frank-w, netdev, linux-mediatek, linux-mips, René van Dorst

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.

Signed-off-by: René van Dorst <opensource@vdorst.com>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 066712f2e985..b20b3a5a1ebb 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices
  2019-06-29 12:24 [PATCH] net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices René van Dorst
@ 2019-07-01 12:57 ` René van Dorst
  2019-07-02 21:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: René van Dorst @ 2019-07-01 12:57 UTC (permalink / raw)
  To: sean.wang, f.fainelli, linux, davem, matthias.bgg, andrew,
	vivien.didelot
  Cc: frank-w, netdev, linux-mediatek, linux-mips

Quoting René van Dorst <opensource@vdorst.com>:

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

Greats,

René

> 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.
>
> Signed-off-by: René van Dorst <opensource@vdorst.com>
> ---
>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c  
> b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 066712f2e985..b20b3a5a1ebb 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices
  2019-06-29 12:24 [PATCH] net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices René van Dorst
  2019-07-01 12:57 ` René van Dorst
@ 2019-07-02 21:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-07-02 21:06 UTC (permalink / raw)
  To: opensource
  Cc: sean.wang, f.fainelli, linux, matthias.bgg, andrew,
	vivien.didelot, frank-w, netdev, linux-mediatek, linux-mips

From: René van Dorst <opensource@vdorst.com>
Date: Sat, 29 Jun 2019 14:24:51 +0200

> 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.
> 
> Signed-off-by: René van Dorst <opensource@vdorst.com>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-03  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-29 12:24 [PATCH] net: ethernet: mediatek: Allow non TRGMII mode with MT7621 DDR2 devices René van Dorst
2019-07-01 12:57 ` René van Dorst
2019-07-02 21:06 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).