[PATCH rtems-libbsd] freebsd/cgem: Use SGMII when necessary

Kinsey Moore kinsey.moore at oarcorp.com
Tue Nov 1 18:51:47 UTC 2022


Certain hardware configurations will always use SGMII instead of RGMII.
Apply the appropriate flags for the relevant BSPs.
---
 freebsd/sys/dev/cadence/if_cgem.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/freebsd/sys/dev/cadence/if_cgem.c b/freebsd/sys/dev/cadence/if_cgem.c
index 3eaaf6b2..9b4cf693 100644
--- a/freebsd/sys/dev/cadence/if_cgem.c
+++ b/freebsd/sys/dev/cadence/if_cgem.c
@@ -1296,6 +1296,16 @@ cgem_config(struct cgem_softc *sc)
 		CGEM_NET_CFG_FULL_DUPLEX |
 		CGEM_NET_CFG_SPEED100;
 
+#ifdef __rtems__
+#define STRINGIFY(to_str) #to_str
+#define BSP_STR(to_str) STRINGIFY(to_str)
+	/* Configure the PHYs to use SGMII for particular BSPs */
+	if ( 0 == strcmp( BSP_STR(RTEMS_BSP), "xilinx_zynqmp_lp64_cfc400x" ) ) {
+		net_cfg |= CGEM_NET_CFG_SGMII_EN;
+		net_cfg |= CGEM_NET_CFG_PCS_SEL;
+	}
+#endif
+
 	/* Enable receive checksum offloading? */
 	if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0)
 		net_cfg |=  CGEM_NET_CFG_RX_CHKSUM_OFFLD_EN;
-- 
2.30.2



More information about the devel mailing list