Skip to contentSkip to conversation

arm: socfpga: stratix10: add sgmii in phymode setup

PATCH New Ooi 2 participants 2 messages Sep 25, 2018 – Sep 26, 2018

Subsystems (3)
lore
Share & tools
lore

Ooi

#0 lore raw

PATCH 1/1 arm: socfpga: stratix10: add sgmii in phymode setup

Additional sgmii phymode is added in socfpga_phymode_setup() along with a minor fix for maximum number of GMACs.

---
 arch/arm/mach-socfpga/misc_s10.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/misc_s10.c +3 -2
index 918baac..e599362 100644
@@ -36,7 +36,8 @@ static u32 socfpga_phymode_setup(u32 gmac_index, const char *phymode)
 	if (!phymode)
 		return -EINVAL;
 
-	if (!strcmp(phymode, "mii") || !strcmp(phymode, "gmii"))
+	if (!strcmp(phymode, "mii") || !strcmp(phymode, "gmii") ||
+	    !strcmp(phymode, "sgmii"))
 		modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII;
 	else if (!strcmp(phymode, "rgmii"))
 		modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII;
@@ -58,7 +59,7 @@ static int socfpga_set_phymode(void)
 	struct fdtdec_phandle_args args;
 	const char *phy_mode;
 	u32 gmac_index;
-	int nodes[2];	/* Max. 3 GMACs */
+	int nodes[3];	/* Max. 3 GMACs */
 	int ret, count;
 	int i, node;
 
Signature · 1 line
1.7.1
Applied
#1 lore raw

PATCH 1/1 arm: socfpga: stratix10: add sgmii in phymode setup

Quoted 4 lines · Joyce

Additional sgmii phymode is added in socfpga_phymode_setup() along with a minor fix for maximum number of GMACs.

CCing Ley and Dinh.

Applied, thanks.

Quoted 28 lines
---
 arch/arm/mach-socfpga/misc_s10.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/misc_s10.c +3 -2
index 918baac..e599362 100644
@@ -36,7 +36,8 @@ static u32 socfpga_phymode_setup(u32 gmac_index, const char *phymode)
 	if (!phymode)
 		return -EINVAL;
 
-	if (!strcmp(phymode, "mii") || !strcmp(phymode, "gmii"))
+	if (!strcmp(phymode, "mii") || !strcmp(phymode, "gmii") ||
+	    !strcmp(phymode, "sgmii"))
 		modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII;
 	else if (!strcmp(phymode, "rgmii"))
 		modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII;
@@ -58,7 +59,7 @@ static int socfpga_set_phymode(void)
 	struct fdtdec_phandle_args args;
 	const char *phy_mode;
 	u32 gmac_index;
-	int nodes[2];	/* Max. 3 GMACs */
+	int nodes[3];	/* Max. 3 GMACs */
 	int ret, count;
 	int i, node;
 
Signature · 2 lines
Best regards,
Marek Vasut