[PATCH] spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

Stefan Roese
Octeon TX2 sets the TB100_EN bit in the config register. We need to use
a fixed 100MHz clock for this as well to work properly.

Signed-off-by: Stefan Roese <[hidden email]>
Cc: Aaron Williams <[hidden email]>
Cc: Suneel Garapati <[hidden email]>
Cc: Chandrakala Chavva <[hidden email]>
Cc: Jagan Teki <[hidden email]>
---
 drivers/spi/octeon_spi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/octeon_spi.c b/drivers/spi/octeon_spi.c
index 83fe6330a1..7e88e5580f 100644
--- a/drivers/spi/octeon_spi.c
+++ b/drivers/spi/octeon_spi.c
@@ -519,7 +519,10 @@ static int octeon_spi_set_speed(struct udevice *bus, uint max_hz)
  if (max_hz > OCTEON_SPI_MAX_CLOCK_HZ)
  max_hz = OCTEON_SPI_MAX_CLOCK_HZ;
 
- clk_rate = clk_get_rate(&priv->clk);
+ if (device_is_compatible(bus, "cavium,thunderx-spi"))
+ clk_rate = 100000000;
+ else
+ clk_rate = clk_get_rate(&priv->clk);
  if (IS_ERR_VALUE(clk_rate))
  return -EINVAL;
 
--
2.28.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

Stefan Roese
Hi Jagan,

On 05.08.20 15:07, Stefan Roese wrote:

> Octeon TX2 sets the TB100_EN bit in the config register. We need to use
> a fixed 100MHz clock for this as well to work properly.
>
> Signed-off-by: Stefan Roese <[hidden email]>
> Cc: Aaron Williams <[hidden email]>
> Cc: Suneel Garapati <[hidden email]>
> Cc: Chandrakala Chavva <[hidden email]>
> Cc: Jagan Teki <[hidden email]>
> ---
>   drivers/spi/octeon_spi.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/octeon_spi.c b/drivers/spi/octeon_spi.c
> index 83fe6330a1..7e88e5580f 100644
> --- a/drivers/spi/octeon_spi.c
> +++ b/drivers/spi/octeon_spi.c
> @@ -519,7 +519,10 @@ static int octeon_spi_set_speed(struct udevice *bus, uint max_hz)
>   if (max_hz > OCTEON_SPI_MAX_CLOCK_HZ)
>   max_hz = OCTEON_SPI_MAX_CLOCK_HZ;
>  
> - clk_rate = clk_get_rate(&priv->clk);
> + if (device_is_compatible(bus, "cavium,thunderx-spi"))
> + clk_rate = 100000000;
> + else
> + clk_rate = clk_get_rate(&priv->clk);
>   if (IS_ERR_VALUE(clk_rate))
>   return -EINVAL;
>  

Any updates on this? Are you okay with this patch and plan to push
it upstream soon? Or should I pull it with your Acked-by?

Thanks,
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

Stefan Roese
Hi Jagan,

On 26.08.20 12:03, Stefan Roese wrote:

> Hi Jagan,
>
> On 05.08.20 15:07, Stefan Roese wrote:
>> Octeon TX2 sets the TB100_EN bit in the config register. We need to use
>> a fixed 100MHz clock for this as well to work properly.
>>
>> Signed-off-by: Stefan Roese <[hidden email]>
>> Cc: Aaron Williams <[hidden email]>
>> Cc: Suneel Garapati <[hidden email]>
>> Cc: Chandrakala Chavva <[hidden email]>
>> Cc: Jagan Teki <[hidden email]>
>> ---
>>   drivers/spi/octeon_spi.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/octeon_spi.c b/drivers/spi/octeon_spi.c
>> index 83fe6330a1..7e88e5580f 100644
>> --- a/drivers/spi/octeon_spi.c
>> +++ b/drivers/spi/octeon_spi.c
>> @@ -519,7 +519,10 @@ static int octeon_spi_set_speed(struct udevice
>> *bus, uint max_hz)
>>       if (max_hz > OCTEON_SPI_MAX_CLOCK_HZ)
>>           max_hz = OCTEON_SPI_MAX_CLOCK_HZ;
>> -    clk_rate = clk_get_rate(&priv->clk);
>> +    if (device_is_compatible(bus, "cavium,thunderx-spi"))
>> +        clk_rate = 100000000;
>> +    else
>> +        clk_rate = clk_get_rate(&priv->clk);
>>       if (IS_ERR_VALUE(clk_rate))
>>           return -EINVAL;
>
> Any updates on this? Are you okay with this patch and plan to push
> it upstream soon? Or should I pull it with your Acked-by?

Ping!

Thanks,
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

Stefan Roese
In reply to this post by Stefan Roese
On 05.08.20 15:07, Stefan Roese wrote:
> Octeon TX2 sets the TB100_EN bit in the config register. We need to use
> a fixed 100MHz clock for this as well to work properly.
>
> Signed-off-by: Stefan Roese <[hidden email]>
> Cc: Aaron Williams <[hidden email]>
> Cc: Suneel Garapati <[hidden email]>
> Cc: Chandrakala Chavva <[hidden email]>
> Cc: Jagan Teki <[hidden email]>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   drivers/spi/octeon_spi.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/octeon_spi.c b/drivers/spi/octeon_spi.c
> index 83fe6330a1..7e88e5580f 100644
> --- a/drivers/spi/octeon_spi.c
> +++ b/drivers/spi/octeon_spi.c
> @@ -519,7 +519,10 @@ static int octeon_spi_set_speed(struct udevice *bus, uint max_hz)
>   if (max_hz > OCTEON_SPI_MAX_CLOCK_HZ)
>   max_hz = OCTEON_SPI_MAX_CLOCK_HZ;
>  
> - clk_rate = clk_get_rate(&priv->clk);
> + if (device_is_compatible(bus, "cavium,thunderx-spi"))
> + clk_rate = 100000000;
> + else
> + clk_rate = clk_get_rate(&priv->clk);
>   if (IS_ERR_VALUE(clk_rate))
>   return -EINVAL;
>  
>


Viele Grüße,
Stefan

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [hidden email]