Skip to contentSkip to conversation

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

PATCH New Stefan Roese 1 participant 4 messages Aug 5, 2020 – Oct 16, 2020 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

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.

Cc Aaron Williams <[email protected]>
Cc Suneel Garapati <[email protected]>
Cc Chandrakala Chavva <[email protected]>
Cc Jagan Teki <[email protected]>
---
 drivers/spi/octeon_spi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/octeon_spi.c +4 -1
index 83fe6330a1..7e88e5580f 100644
@@ -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;
 
Signature · 1 line
2.28.0
#1 lore raw

PATCH 1/1 spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

Hi Jagan,

Quoted 18 lines · 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.

Cc Aaron Williams <[email protected]>
Cc Suneel Garapati <[email protected]>
Cc Chandrakala Chavva <[email protected]>
Cc Jagan Teki <[email protected]>
---
  drivers/spi/octeon_spi.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/octeon_spi.c +0 -0
index 83fe6330a1..7e88e5580f 100644
@@ -519,7 +519,10 @@ static int octeon_spi_set_speed(struct udevice *bus, uint max_hz)
  	if (max_hz > OCTEON_SPI_MAX_CLOCK_HZ)

drivers/spi/octeon_spi.c static int octeon_spi_set_speed(struct udevice *bus, uint max_hz) · line 528

Quoted 10 lines
drivers/spi/octeon_spi.c +4 -1
  		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

#2 lore raw

PATCH 1/1 spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

Hi Jagan,

Quoted 25 lines · Stefan Roese

Hi Jagan,

Quoted 22 lines · 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.

Cc Aaron Williams <[email protected]>
Cc Suneel Garapati <[email protected]>
Cc Chandrakala Chavva <[email protected]>
Cc Jagan Teki <[email protected]>

---
? drivers/spi/octeon_spi.c | 5 ++++-
? 1 file changed, 4 insertions(+), 1 deletion(-)

drivers/spi/octeon_spi.c +1 -1
index 83fe6330a1..7e88e5580f 100644
@@ -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"))
Quoted 8 lines

drivers/spi/octeon_spi.c static int octeon_spi_set_speed(struct udevice · line 527

Quoted 5 lines
drivers/spi/octeon_spi.c +3 -0
+??????? 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

#3 lore raw

PATCH 1/1 spi: octeon_spi: Use a fixed 100MHz input clock on Octeon TX2

In reply to Stefan Roese
Quoted 8 lines · 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.

Cc Aaron Williams <[email protected]>
Cc Suneel Garapati <[email protected]>
Cc Chandrakala Chavva <[email protected]>
Cc Jagan Teki <[email protected]>

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 11 lines
---
  drivers/spi/octeon_spi.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/octeon_spi.c +0 -0
index 83fe6330a1..7e88e5580f 100644
@@ -519,7 +519,10 @@ static int octeon_spi_set_speed(struct udevice *bus, uint max_hz)
  	if (max_hz > OCTEON_SPI_MAX_CLOCK_HZ)

drivers/spi/octeon_spi.c static int octeon_spi_set_speed(struct udevice *bus, uint max_hz) · line 528

Quoted 10 lines
drivers/spi/octeon_spi.c +4 -1
  		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

Signature · 3 lines
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: sr at denx.de