diff mbox series

[v5,05/12] arm: mvebu: clearfog: Add option for 2.5 Gbps SFP

Message ID 20200127200156.15173-6-mrjoel@lixil.net
State Superseded
Headers show
Series ClearFog Base static variant support | expand

Commit Message

Joel Johnson Jan. 27, 2020, 8:01 p.m. UTC
While newer Linux kernels provide autoconfiguration of SFP, provide
an option for setting in U-Boot Kconfig for use prior to booting.

Signed-off-by: Joel Johnson <mrjoel at lixil.net>

---

v2 changes:
  - fixed help indentation
v3 changes:
  - none
v4 changes:
  - adjust static SerDes configuration at runtime instead of #ifdef
v5 changes:
  - make independent of runtime detection

---
 board/solidrun/clearfog/Kconfig    | 7 +++++++
 board/solidrun/clearfog/clearfog.c | 5 +++++
 2 files changed, 12 insertions(+)

Comments

Stefan Roese March 23, 2020, 9:14 a.m. UTC | #1
On 27.01.20 21:01, Joel Johnson wrote:
> While newer Linux kernels provide autoconfiguration of SFP, provide
> an option for setting in U-Boot Kconfig for use prior to booting.
> 
> Signed-off-by: Joel Johnson <mrjoel at lixil.net>
> 
> ---
> 
> v2 changes:
>    - fixed help indentation
> v3 changes:
>    - none
> v4 changes:
>    - adjust static SerDes configuration at runtime instead of #ifdef
> v5 changes:
>    - make independent of runtime detection
> 
> ---
>   board/solidrun/clearfog/Kconfig    | 7 +++++++
>   board/solidrun/clearfog/clearfog.c | 5 +++++
>   2 files changed, 12 insertions(+)
> 
> diff --git a/board/solidrun/clearfog/Kconfig b/board/solidrun/clearfog/Kconfig
> index 936d5918f8..c910e17093 100644
> --- a/board/solidrun/clearfog/Kconfig
> +++ b/board/solidrun/clearfog/Kconfig
> @@ -15,4 +15,11 @@ config TARGET_CLEARFOG_BASE
>   	  detection via additional EEPROM hardware. This option enables selecting
>   	  the Base variant for older hardware revisions.
>   
> +config CLEARFOG_SFP_25GB
> +	bool "Enable 2.5 Gbps mode for SFP"
> +	help
> +	  Set the SFP module connection to support 2.5 Gbps transfer speed for the
> +	  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.
> +
>   endmenu
> diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
> index c873d00905..064ce4e520 100644
> --- a/board/solidrun/clearfog/clearfog.c
> +++ b/board/solidrun/clearfog/clearfog.c
> @@ -63,6 +63,11 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
>   {
>   	cf_read_tlv_data();
>   
> +	/* Apply build configuration options before runtime configuration */
> +	if (IS_ENABLED(CONFIG_CLEARFOG_SFP_25GB))
> +		board_serdes_map[5].serdes_speed = SERDES_SPEED_3_125_GBPS;

Just checking: Your option is for 2.5 gbps and you configure here to
3.125 gpbs. Is this intended?

Thanks,
Stefan
Baruch Siach March 23, 2020, 9:33 a.m. UTC | #2
Hi Stefan,

On Mon, Mar 23 2020, Stefan Roese wrote:

> On 27.01.20 21:01, Joel Johnson wrote:
>> While newer Linux kernels provide autoconfiguration of SFP, provide
>> an option for setting in U-Boot Kconfig for use prior to booting.
>>
>> Signed-off-by: Joel Johnson <mrjoel at lixil.net>
>>
>> ---
>>
>> v2 changes:
>>    - fixed help indentation
>> v3 changes:
>>    - none
>> v4 changes:
>>    - adjust static SerDes configuration at runtime instead of #ifdef
>> v5 changes:
>>    - make independent of runtime detection
>>
>> ---
>>   board/solidrun/clearfog/Kconfig    | 7 +++++++
>>   board/solidrun/clearfog/clearfog.c | 5 +++++
>>   2 files changed, 12 insertions(+)
>>
>> diff --git a/board/solidrun/clearfog/Kconfig b/board/solidrun/clearfog/Kconfig
>> index 936d5918f8..c910e17093 100644
>> --- a/board/solidrun/clearfog/Kconfig
>> +++ b/board/solidrun/clearfog/Kconfig
>> @@ -15,4 +15,11 @@ config TARGET_CLEARFOG_BASE
>>   	  detection via additional EEPROM hardware. This option enables selecting
>>   	  the Base variant for older hardware revisions.
>>   +config CLEARFOG_SFP_25GB
>> +	bool "Enable 2.5 Gbps mode for SFP"
>> +	help
>> +	  Set the SFP module connection to support 2.5 Gbps transfer speed for the
>> +	  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.
>> +
>>   endmenu
>> diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
>> index c873d00905..064ce4e520 100644
>> --- a/board/solidrun/clearfog/clearfog.c
>> +++ b/board/solidrun/clearfog/clearfog.c
>> @@ -63,6 +63,11 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
>>   {
>>   	cf_read_tlv_data();
>>   +	/* Apply build configuration options before runtime configuration */
>> +	if (IS_ENABLED(CONFIG_CLEARFOG_SFP_25GB))
>> +		board_serdes_map[5].serdes_speed = SERDES_SPEED_3_125_GBPS;
>
> Just checking: Your option is for 2.5 gbps and you configure here to
> 3.125 gpbs. Is this intended?

This is intended. Serdes encoding is 8b/10b. So for 2.5Gbps you need
serdes rate of 3.125Gbps. For 1Gbps we already set 1.25Gpbs serdes rate
(SERDES_SPEED_1_25_GBPS) in board_serdes_map[].

baruch

--
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
Stefan Roese March 23, 2020, 9:46 a.m. UTC | #3
On 23.03.20 10:33, Baruch Siach wrote:
> Hi Stefan,
> 
> On Mon, Mar 23 2020, Stefan Roese wrote:
> 
>> On 27.01.20 21:01, Joel Johnson wrote:
>>> While newer Linux kernels provide autoconfiguration of SFP, provide
>>> an option for setting in U-Boot Kconfig for use prior to booting.
>>>
>>> Signed-off-by: Joel Johnson <mrjoel at lixil.net>
>>>
>>> ---
>>>
>>> v2 changes:
>>>     - fixed help indentation
>>> v3 changes:
>>>     - none
>>> v4 changes:
>>>     - adjust static SerDes configuration at runtime instead of #ifdef
>>> v5 changes:
>>>     - make independent of runtime detection
>>>
>>> ---
>>>    board/solidrun/clearfog/Kconfig    | 7 +++++++
>>>    board/solidrun/clearfog/clearfog.c | 5 +++++
>>>    2 files changed, 12 insertions(+)
>>>
>>> diff --git a/board/solidrun/clearfog/Kconfig b/board/solidrun/clearfog/Kconfig
>>> index 936d5918f8..c910e17093 100644
>>> --- a/board/solidrun/clearfog/Kconfig
>>> +++ b/board/solidrun/clearfog/Kconfig
>>> @@ -15,4 +15,11 @@ config TARGET_CLEARFOG_BASE
>>>    	  detection via additional EEPROM hardware. This option enables selecting
>>>    	  the Base variant for older hardware revisions.
>>>    +config CLEARFOG_SFP_25GB
>>> +	bool "Enable 2.5 Gbps mode for SFP"
>>> +	help
>>> +	  Set the SFP module connection to support 2.5 Gbps transfer speed for the
>>> +	  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.
>>> +
>>>    endmenu
>>> diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
>>> index c873d00905..064ce4e520 100644
>>> --- a/board/solidrun/clearfog/clearfog.c
>>> +++ b/board/solidrun/clearfog/clearfog.c
>>> @@ -63,6 +63,11 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
>>>    {
>>>    	cf_read_tlv_data();
>>>    +	/* Apply build configuration options before runtime configuration */
>>> +	if (IS_ENABLED(CONFIG_CLEARFOG_SFP_25GB))
>>> +		board_serdes_map[5].serdes_speed = SERDES_SPEED_3_125_GBPS;
>>
>> Just checking: Your option is for 2.5 gbps and you configure here to
>> 3.125 gpbs. Is this intended?
> 
> This is intended. Serdes encoding is 8b/10b. So for 2.5Gbps you need
> serdes rate of 3.125Gbps. For 1Gbps we already set 1.25Gpbs serdes rate
> (SERDES_SPEED_1_25_GBPS) in board_serdes_map[].

Makes sense. Thanks.

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan
diff mbox series

Patch

diff --git a/board/solidrun/clearfog/Kconfig b/board/solidrun/clearfog/Kconfig
index 936d5918f8..c910e17093 100644
--- a/board/solidrun/clearfog/Kconfig
+++ b/board/solidrun/clearfog/Kconfig
@@ -15,4 +15,11 @@  config TARGET_CLEARFOG_BASE
 	  detection via additional EEPROM hardware. This option enables selecting
 	  the Base variant for older hardware revisions.
 
+config CLEARFOG_SFP_25GB
+	bool "Enable 2.5 Gbps mode for SFP"
+	help
+	  Set the SFP module connection to support 2.5 Gbps transfer speed for the
+	  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.
+
 endmenu
diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
index c873d00905..064ce4e520 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -63,6 +63,11 @@  int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count)
 {
 	cf_read_tlv_data();
 
+	/* Apply build configuration options before runtime configuration */
+	if (IS_ENABLED(CONFIG_CLEARFOG_SFP_25GB))
+		board_serdes_map[5].serdes_speed = SERDES_SPEED_3_125_GBPS;
+
+	/* 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;