Skip to contentSkip to conversation

board: solidrun: clearfog gtr: add serdes configuration

PATCH Superseded Josua Mayer 2 participants 5 messages Jan 6, 2024 – Jan 12, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover board: solidrun: clearfog gtr: add serdes configuration

Add missing configuration options for clearog gtr serdes:

1. select between sata and pci-e for serdes 0
2. configure serdes 2 for 2.5Gbps link with managed switch

---
Josua Mayer (2):
arm: mvebu: clearfog gtr: add config option to select serdes0 interface
board: solidrun: clearfog: fix serdes 1 / eth2 speed for clearfog gtr

 board/solidrun/clearfog/Kconfig    | 19 +++++++++++++++++++
 board/solidrun/clearfog/clearfog.c | 19 ++++++++++++++++---
 2 files changed, 35 insertions(+), 3 deletions(-)

---
base-commit: 82750ce44226e5f2b3bbcd79cf7b3ba3dfd3de4d
change-id: 20240106-clearfog-gtr-serdes-8a927f496bda

Sincerely,

Signature · 1 line
Josua Mayer <[email protected]>
#1 lore raw

PATCH 1/2 arm: mvebu: clearfog gtr: add config option to select serdes0 interface

Clearfog GTR has an assembly option for a SATA connector, CON18. It shares the serdes with mini-pcie connector CON3.

Add new kconfig option to select betweenata and pci, defaulting to pci as it was previously configured in board-file.

Clearfog GTR connects eth2 / serdes 1 to a 2.5Gbps capable ethernet switch port. Linux already configures a fixed-link at speed 2500 from device-tree.
Upgrade serdes 1 rate to 3.125Gbps to support a 2.5Gbps network link on Clearfog GTR.

---
 board/solidrun/clearfog/Kconfig    | 19 +++++++++++++++++++
 board/solidrun/clearfog/clearfog.c | 11 ++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
board/solidrun/clearfog/Kconfig +19 -0
index 60d3921307..765d8a6355 100644
@@ -39,6 +39,25 @@ config CLEARFOG_SFP_25GB
 	  SGMII connection (requires a supporting SFP). By default, transfer speed
 	  of 1.25 Gbps is used, suitable for a more common 1 Gbps SFP module.
 
+choice CLEARFOG_GTR_SERDES0
+	prompt "Select Clearfog GTR SerDes 0 Function"
+	help
+	  Select function for SerDes 0 which is shared between CON3 and CON18
+	  for either pci-e or sata.
+
+config CLEARFOG_GTR_SERDES0_PCIE
+	bool "PCI-E on CON3"
+	default y
+	help
+	  Configure SerDes 0 for PCI-E to enable CON3 mini-PCI-E connector.
+
+config CLEARFOG_GTR_SERDES0_SATA
+	bool "SATA on CON18"
+	help
+	  Configure SerDes 0 for SATA to enable CON18 SATA connector.
+
+endchoice
+
 config ENV_SIZE
 	hex "Environment Size"
 	default 0x10000
board/solidrun/clearfog/clearfog.c +8 -3
index 6fa2fe5fe3..51c5be518a 100644
@@ -90,9 +90,14 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
 
 	/* Apply runtime detection changes */
 	if (sr_product_is(&cf_tlv_data, "Clearfog GTR")) {
-		board_serdes_map[0].serdes_type = PEX0;
-		board_serdes_map[0].serdes_speed = SERDES_SPEED_5_GBPS;
-		board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
+		if (IS_ENABLED(CONFIG_CLEARFOG_GTR_SERDES0_SATA)) {
+			/* serdes 0 is sata (like clearfog pro) */
+		} else if (IS_ENABLED(CONFIG_CLEARFOG_GTR_SERDES0_PCIE)) {
+			/* serdes 0 is pci */
+			board_serdes_map[0].serdes_type = PEX0;
+			board_serdes_map[0].serdes_speed = SERDES_SPEED_5_GBPS;
+			board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
+		}
 	} else if (sr_product_is(&cf_tlv_data, "Clearfog Pro")) {
 		/* handle recognized product as noop, no adjustment required */
 	} else if (sr_product_is(&cf_tlv_data, "Clearfog Base")) {
Signature · 1 line
2.35.3
#2 lore raw

Re: [PATCH 1/2] arm: mvebu: clearfog gtr: add config option to select serdes0 interface

Quoted 25 lines · Josua Mayer

Clearfog GTR has an assembly option for a SATA connector, CON18. It shares the serdes with mini-pcie connector CON3.

Add new kconfig option to select betweenata and pci, defaulting to pci as it was previously configured in board-file.

Clearfog GTR connects eth2 / serdes 1 to a 2.5Gbps capable ethernet switch port. Linux already configures a fixed-link at speed 2500 from device-tree.
Upgrade serdes 1 rate to 3.125Gbps to support a 2.5Gbps network link on Clearfog GTR.

---
  board/solidrun/clearfog/Kconfig    | 19 +++++++++++++++++++
  board/solidrun/clearfog/clearfog.c | 11 ++++++++---
  2 files changed, 27 insertions(+), 3 deletions(-)
board/solidrun/clearfog/Kconfig +0 -0
index 60d3921307..765d8a6355 100644
@@ -39,6 +39,25 @@ config CLEARFOG_SFP_25GB
  	  SGMII connection (requires a supporting SFP). By default, transfer speed
  	  of 1.25 Gbps is used, suitable for a more common 1 Gbps SFP module.

board/solidrun/clearfog/Kconfig config CLEARFOG_SFP_25GB · line 50

Quoted 10 lines
board/solidrun/clearfog/Kconfig +9 -0
 
+choice CLEARFOG_GTR_SERDES0
+	prompt "Select Clearfog GTR SerDes 0 Function"
+	help
+	  Select function for SerDes 0 which is shared between CON3 and CON18
+	  for either pci-e or sata.
+
+config CLEARFOG_GTR_SERDES0_PCIE
+	bool "PCI-E on CON3"
+	default y

After applying this patch I get this warning:

board/solidrun/clearfog/Kconfig:50:warning: defaults for choice values not supported

Could you please take a look?

Thanks,
Stefan

Quoted 26 lines
board/solidrun/clearfog/Kconfig +10 -0
+	help
+	  Configure SerDes 0 for PCI-E to enable CON3 mini-PCI-E connector.
+
+config CLEARFOG_GTR_SERDES0_SATA
+	bool "SATA on CON18"
+	help
+	  Configure SerDes 0 for SATA to enable CON18 SATA connector.
+
+endchoice
+
  config ENV_SIZE
  	hex "Environment Size"
  	default 0x10000
board/solidrun/clearfog/clearfog.c +1 -3
index 6fa2fe5fe3..51c5be518a 100644
@@ -90,9 +90,14 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
 
  	/* Apply runtime detection changes */
  	if (sr_product_is(&cf_tlv_data, "Clearfog GTR")) {
-		board_serdes_map[0].serdes_type = PEX0;
-		board_serdes_map[0].serdes_speed = SERDES_SPEED_5_GBPS;
-		board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
+		if (IS_ENABLED(CONFIG_CLEARFOG_GTR_SERDES0_SATA)) {

board/solidrun/clearfog/clearfog.c int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) · line 103

Quoted 10 lines
board/solidrun/clearfog/clearfog.c +7 -0
+			/* serdes 0 is sata (like clearfog pro) */
+		} else if (IS_ENABLED(CONFIG_CLEARFOG_GTR_SERDES0_PCIE)) {
+			/* serdes 0 is pci */
+			board_serdes_map[0].serdes_type = PEX0;
+			board_serdes_map[0].serdes_speed = SERDES_SPEED_5_GBPS;
+			board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
+		}
  	} else if (sr_product_is(&cf_tlv_data, "Clearfog Pro")) {
  		/* handle recognized product as noop, no adjustment required */
  	} else if (sr_product_is(&cf_tlv_data, "Clearfog Base")) {

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#3 lore raw

Re: [PATCH 1/2] arm: mvebu: clearfog gtr: add config option to select serdes0 interface

Hi Stefan,

Am 09.01.24 um 12:45 schrieb Stefan Roese:

Quoted 12 lines

board/solidrun/clearfog/Kconfig config CLEARFOG_SFP_25GB · line 50

Quoted 9 lines

  +choice CLEARFOG_GTR_SERDES0
+    prompt "Select Clearfog GTR SerDes 0 Function"
+    help
+      Select function for SerDes 0 which is shared between CON3 and CON18 +      for either pci-e or sata.

board/solidrun/clearfog/Kconfig +4 -0
+
+config CLEARFOG_GTR_SERDES0_PCIE
+    bool "PCI-E on CON3"
+    default y

After applying this patch I get this warning:

Quoted 3 lines

board/solidrun/clearfog/Kconfig:50:warning: defaults for choice values not supported

Could you please take a look?

Thank you, I was mistaken about where the default setting belongs,  apparently it belongs to the "choice" - not its elements. Will send v2 soon.

#4 lore raw

PATCH 2/2 board: solidrun: clearfog: fix serdes 1 / eth2 speed for clearfog gtr

In reply to Josua Mayer

Clearfog GTR connects eth2 / serdes 1 to a 2.5Gbps capable ethernet switch port. Linux already configures a fixed-link at speed 2500 from device-tree.

Upgrade serdes 1 rate to 3.125Gbps to support a 2.5Gbps link.

Additionally add comments documenting each serdes' function of clearfog gtr, which are shared with clearfog pro.

---
 board/solidrun/clearfog/clearfog.c | 8 ++++++++
 1 file changed, 8 insertions(+)
board/solidrun/clearfog/clearfog.c +8 -0
index 51c5be518a..6977db0a9e 100644
@@ -98,6 +98,14 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
 			board_serdes_map[0].serdes_speed = SERDES_SPEED_5_GBPS;
 			board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
 		}
+		/* serdes 1 is 2.5Gbps fixed link to ethernet switch */
+		board_serdes_map[1].serdes_type = SGMII1;
+		board_serdes_map[1].serdes_speed = SERDES_SPEED_3_125_GBPS;
+		board_serdes_map[1].serdes_mode = SERDES_DEFAULT_MODE;
+		/* serdes 2 is pci (like clearfog pro) */
+		/* serdes 3 is usb-3 (like clearfog pro) */
+		/* serdes 4 is pci (like clearfog pro) */
+		/* serdes 5 is sfp connector (like clearfog pro) */
 	} else if (sr_product_is(&cf_tlv_data, "Clearfog Pro")) {
 		/* handle recognized product as noop, no adjustment required */
 	} else if (sr_product_is(&cf_tlv_data, "Clearfog Base")) {
Signature · 1 line
2.35.3