diff mbox series

[U-Boot,4/6] net: macb: add support for SGMII phy interface

Message ID 20190611151930.15852-4-rfried.dev@gmail.com
State Superseded
Delegated to: Joe Hershberger
Headers show
Series [U-Boot,1/6] net: macb: sync header definitions as taken from Linux | expand

Commit Message

Ramon Fried June 11, 2019, 3:19 p.m. UTC
This patch adds support for the sgmii phy interface,
available only to DM users, dictated by current driver
design.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
---

 drivers/net/macb.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Anup Patel July 3, 2019, 3:35 a.m. UTC | #1
> -----Original Message-----
> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Ramon Fried
> Sent: Tuesday, June 11, 2019 8:49 PM
> To: u-boot@lists.denx.de
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Subject: [U-Boot] [PATCH 4/6] net: macb: add support for SGMII phy
> interface
> 
> This patch adds support for the sgmii phy interface, available only to DM
> users, dictated by current driver design.
> 
> Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
> ---
> 
>  drivers/net/macb.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c index
> d957afe21a..ae8937bbb1 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -757,6 +757,13 @@ static int _macb_init(struct macb_device *macb,
> const char *name)
>  			gem_writel(macb, USRIO, GEM_BIT(RGMII));
>  		else
>  			gem_writel(macb, USRIO, 0);
> +
> +		if (macb->phy_interface == PHY_INTERFACE_MODE_SGMII)
> {
> +			unsigned int ncfgr = macb_readl(macb, NCFGR);
> +
> +			ncfgr |= GEM_BIT(SGMIIEN) | GEM_BIT(PCSSEL);
> +			macb_writel(macb, NCFGR, ncfgr);
> +		}
>  #else
>  #if defined(CONFIG_RGMII) || defined(CONFIG_RMII)
>  		gem_writel(macb, UR, GEM_BIT(RGMII));
> --
> 2.21.0
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot

Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>

Regards,
Anup
Joe Hershberger July 8, 2019, 11:12 p.m. UTC | #2
On Tue, Jun 11, 2019 at 10:50 AM Ramon Fried <rfried.dev@gmail.com> wrote:
>
> This patch adds support for the sgmii phy interface,
> available only to DM users, dictated by current driver
> design.
>
> Signed-off-by: Ramon Fried <rfried.dev@gmail.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox series

Patch

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index d957afe21a..ae8937bbb1 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -757,6 +757,13 @@  static int _macb_init(struct macb_device *macb, const char *name)
 			gem_writel(macb, USRIO, GEM_BIT(RGMII));
 		else
 			gem_writel(macb, USRIO, 0);
+
+		if (macb->phy_interface == PHY_INTERFACE_MODE_SGMII) {
+			unsigned int ncfgr = macb_readl(macb, NCFGR);
+
+			ncfgr |= GEM_BIT(SGMIIEN) | GEM_BIT(PCSSEL);
+			macb_writel(macb, NCFGR, ncfgr);
+		}
 #else
 #if defined(CONFIG_RGMII) || defined(CONFIG_RMII)
 		gem_writel(macb, UR, GEM_BIT(RGMII));