All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-boot,V2,0/2] Enable mt7531 switch support for MT7629
@ 2020-06-19 11:17 MarkLee
  2020-06-19 11:17 ` [U-boot, V2, 1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver MarkLee
  2020-06-19 11:17 ` [U-boot, V2, 2/2] arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629 MarkLee
  0 siblings, 2 replies; 5+ messages in thread
From: MarkLee @ 2020-06-19 11:17 UTC (permalink / raw)
  To: u-boot

This patch series enable MT7629 sgmii mode with mt7531 switch support,
	1. enable mt7629 sgmii mode support in mediatek eth driver
	2. enable mt7629 ethernet dts node with sgmii mode and mt7531
	   switch support

Change since V1:
- use driver private data from dts to decide the register offset
  (SGMSYS_GEN2_SPEED) instead of check #ifdefs in drivers.

MarkLee (2):
  eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver
  arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629

 arch/arm/dts/mt7629-rfb.dts | 12 +++++++-----
 drivers/net/mtk_eth.c       |  3 ++-
 drivers/net/mtk_eth.h       |  1 +
 3 files changed, 10 insertions(+), 6 deletions(-)

-- 
2.17.1

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

* [U-boot, V2, 1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver
  2020-06-19 11:17 [U-boot,V2,0/2] Enable mt7531 switch support for MT7629 MarkLee
@ 2020-06-19 11:17 ` MarkLee
  2020-07-29 13:43   ` Tom Rini
  2020-06-19 11:17 ` [U-boot, V2, 2/2] arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629 MarkLee
  1 sibling, 1 reply; 5+ messages in thread
From: MarkLee @ 2020-06-19 11:17 UTC (permalink / raw)
  To: u-boot

The sgmii mode init flow is almost the same for all mediatek SoC, the
only difference is the register offset(SGMSYS_GEN2_SPEED) is 0x2028
in the old chip(mt7622) but changed to 0x128 for the newer chip(mt7629 
and the following chips).

Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
---
V2: use driver private data from dts to decide the register offset
  (SGMSYS_GEN2_SPEED) instead of check #ifdefs in drivers.
---
 drivers/net/mtk_eth.c | 3 ++-
 drivers/net/mtk_eth.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
index 5ffcc5313d..f73db4ff12 100644
--- a/drivers/net/mtk_eth.c
+++ b/drivers/net/mtk_eth.c
@@ -1090,7 +1090,8 @@ static int mtk_phy_probe(struct udevice *dev)
 static void mtk_sgmii_init(struct mtk_eth_priv *priv)
 {
 	/* Set SGMII GEN2 speed(2.5G) */
-	clrsetbits_le32(priv->sgmii_base + SGMSYS_GEN2_SPEED,
+	clrsetbits_le32(priv->sgmii_base + ((priv->soc == SOC_MT7622) ?
+			SGMSYS_GEN2_SPEED : SGMSYS_GEN2_SPEED_V2),
 			SGMSYS_SPEED_2500, SGMSYS_SPEED_2500);
 
 	/* Disable SGMII AN */
diff --git a/drivers/net/mtk_eth.h b/drivers/net/mtk_eth.h
index f2940c9996..6149fec07e 100644
--- a/drivers/net/mtk_eth.h
+++ b/drivers/net/mtk_eth.h
@@ -45,6 +45,7 @@
 #define SGMII_PHYA_PWD			BIT(4)
 
 #define SGMSYS_GEN2_SPEED		0x2028
+#define SGMSYS_GEN2_SPEED_V2		0x128
 #define SGMSYS_SPEED_2500		BIT(2)
 
 /* Frame Engine Registers */
-- 
2.17.1

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

* [U-boot, V2, 2/2] arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629
  2020-06-19 11:17 [U-boot,V2,0/2] Enable mt7531 switch support for MT7629 MarkLee
  2020-06-19 11:17 ` [U-boot, V2, 1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver MarkLee
@ 2020-06-19 11:17 ` MarkLee
  2020-07-29 13:43   ` Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: MarkLee @ 2020-06-19 11:17 UTC (permalink / raw)
  To: u-boot

This patch enable sgmii mode and mt7531 switch support in mt7629 
ethernet dts node

Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
---
V2: no changes
---
 arch/arm/dts/mt7629-rfb.dts | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/dts/mt7629-rfb.dts b/arch/arm/dts/mt7629-rfb.dts
index 687fe1c029..5864f5551b 100644
--- a/arch/arm/dts/mt7629-rfb.dts
+++ b/arch/arm/dts/mt7629-rfb.dts
@@ -24,12 +24,14 @@
 
 &eth {
 	status = "okay";
-	mediatek,gmac-id = <1>;
-	phy-mode = "gmii";
-	phy-handle = <&phy0>;
+	mediatek,gmac-id = <0>;
+	phy-mode = "sgmii";
+	mediatek,switch = "mt7531";
+	reset-gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
 
-	phy0: ethernet-phy at 0 {
-		reg = <0>;
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
 	};
 };
 
-- 
2.17.1

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

* [U-boot, V2, 1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver
  2020-06-19 11:17 ` [U-boot, V2, 1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver MarkLee
@ 2020-07-29 13:43   ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2020-07-29 13:43 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 19, 2020 at 07:17:16PM +0800, MarkLee wrote:

> The sgmii mode init flow is almost the same for all mediatek SoC, the
> only difference is the register offset(SGMSYS_GEN2_SPEED) is 0x2028
> in the old chip(mt7622) but changed to 0x128 for the newer chip(mt7629 
> and the following chips).
> 
> Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/21ed2a67/attachment.sig>

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

* [U-boot, V2, 2/2] arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629
  2020-06-19 11:17 ` [U-boot, V2, 2/2] arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629 MarkLee
@ 2020-07-29 13:43   ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2020-07-29 13:43 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 19, 2020 at 07:17:17PM +0800, MarkLee wrote:

> This patch enable sgmii mode and mt7531 switch support in mt7629 
> ethernet dts node
> 
> Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/1b797306/attachment.sig>

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

end of thread, other threads:[~2020-07-29 13:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 11:17 [U-boot,V2,0/2] Enable mt7531 switch support for MT7629 MarkLee
2020-06-19 11:17 ` [U-boot, V2, 1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver MarkLee
2020-07-29 13:43   ` Tom Rini
2020-06-19 11:17 ` [U-boot, V2, 2/2] arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629 MarkLee
2020-07-29 13:43   ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.