Skip to contentSkip to conversation

ARM: at91: sama5d3: reduce TWI internal clock frequency

PATCH New ludovic.desroches at atmel.com 4 participants 10 messages Nov 22, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

---
 arch/arm/mach-at91/sama5d3.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-at91/sama5d3.c +3 -3
index 4012797..4ee0de5 100644
@@ -95,19 +95,19 @@ static struct clk twi0_clk = {
 	.name		= "twi0_clk",
 	.pid		= SAMA5D3_ID_TWI0,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi1_clk = {
 	.name		= "twi1_clk",
 	.pid		= SAMA5D3_ID_TWI1,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi2_clk = {
 	.name		= "twi2_clk",
 	.pid		= SAMA5D3_ID_TWI2,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk mmc0_clk = {
 	.name		= "mci0_clk",
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

Quoted 7 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

I think the commit message needs more details. Is this a true bugfix because the real bus frequency was too high because of the wrong divider? Is this a workaround which makes things work but will make the bus frequency slower than it should be?

Quoted 38 lines
---
 arch/arm/mach-at91/sama5d3.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-at91/sama5d3.c +3 -3
index 4012797..4ee0de5 100644
@@ -95,19 +95,19 @@ static struct clk twi0_clk = {
 	.name		= "twi0_clk",
 	.pid		= SAMA5D3_ID_TWI0,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi1_clk = {
 	.name		= "twi1_clk",
 	.pid		= SAMA5D3_ID_TWI1,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi2_clk = {
 	.name		= "twi2_clk",
 	.pid		= SAMA5D3_ID_TWI2,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk mmc0_clk = {
 	.name		= "mci0_clk",
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131122/6a9cebe4/attachment.sig>

#2 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 5 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

Quoted 7 lines
Quoted 2 lines

I think the commit message needs more details. Is this a true bugfix because the real bus frequency was too high because of the wrong divider? Is this a workaround which makes things work but will make the bus frequency slower than it should be?

This fix doesn't concern the i2c bus frequency, only the internal IP frequency.

TWI has been validated at 66MHz. With some devices, transfer hangs during i2c frame transmission. This issue disappears when reducing the internal frequency of the IP. Maybe there is some oversampling on i2c signals. Unfortunately, I have no clear status about the root cause that's why the commit message was imprecise.

Regards

Ludovic

Quoted 39 lines
Quoted 39 lines
---
 arch/arm/mach-at91/sama5d3.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-at91/sama5d3.c +3 -3
index 4012797..4ee0de5 100644
@@ -95,19 +95,19 @@ static struct clk twi0_clk = {
 	.name		= "twi0_clk",
 	.pid		= SAMA5D3_ID_TWI0,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi1_clk = {
 	.name		= "twi1_clk",
 	.pid		= SAMA5D3_ID_TWI1,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi2_clk = {
 	.name		= "twi2_clk",
 	.pid		= SAMA5D3_ID_TWI2,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk mmc0_clk = {
 	.name		= "mci0_clk",
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

Quoted 17 lines · Ludovic Desroches

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 5 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

Quoted 7 lines
Quoted 2 lines

I think the commit message needs more details. Is this a true bugfix because the real bus frequency was too high because of the wrong divider? Is this a workaround which makes things work but will make the bus frequency slower than it should be?

Quoted 7 lines

This fix doesn't concern the i2c bus frequency, only the internal IP frequency.

TWI has been validated at 66MHz. With some devices, transfer hangs during i2c frame transmission. This issue disappears when reducing the internal frequency of the IP. Maybe there is some oversampling on i2c signals. Unfortunately, I have no clear status about the root cause that's why the commit message was imprecise.

This paragraph is a way better commit message IMO :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131122/7a20bd79/attachment.sig>

#4 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

Quoted 20 lines · Wolfram Sang
Quoted 19 lines · Ludovic Desroches

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 5 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

Quoted 7 lines
Quoted 2 lines

I think the commit message needs more details. Is this a true bugfix because the real bus frequency was too high because of the wrong divider? Is this a workaround which makes things work but will make the bus frequency slower than it should be?

This fix doesn't concern the i2c bus frequency, only the internal IP frequency.

Quoted 8 lines
Quoted 5 lines

TWI has been validated at 66MHz. With some devices, transfer hangs during i2c frame transmission. This issue disappears when reducing the internal frequency of the IP. Maybe there is some oversampling on i2c signals. Unfortunately, I have no clear status about the root cause that's why the commit message was imprecise.

This paragraph is a way better commit message IMO :)

Ok I'll update it.

Thanks for the review Wolfram.

Regards

Ludovic

#5 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

On 22/11/2013 16:07, Ludovic Desroches :

Quoted 27 lines · Wolfram Sang
Quoted 26 lines · Ludovic Desroches
Quoted 24 lines

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 5 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

Quoted 7 lines
Quoted 2 lines

I think the commit message needs more details. Is this a true bugfix because the real bus frequency was too high because of the wrong divider? Is this a workaround which makes things work but will make the bus frequency slower than it should be?

This fix doesn't concern the i2c bus frequency, only the internal IP frequency.

TWI has been validated at 66MHz. With some devices, transfer hangs during i2c frame transmission. This issue disappears when reducing the internal frequency of the IP. Maybe there is some oversampling on i2c signals. Unfortunately, I have no clear status about the root cause that's why the commit message was imprecise.

Quoted 4 lines
Quoted 2 lines

This paragraph is a way better commit message IMO :)

Ok I'll update it.

Ludo, you can also add my:

Bye,

Quoted 7 lines

Thanks for the review Wolfram.

Regards

Ludovic

Signature · 1 line
Nicolas Ferre
#6 lore raw
In reply to Wolfram Sang
Quoted 20 lines · Wolfram Sang
Quoted 19 lines · Ludovic Desroches

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 5 lines · On Fri, Nov 22, 2013 at 03:07:08PM +0100, [email protected] wrote:

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

Quoted 7 lines
Quoted 2 lines

I think the commit message needs more details. Is this a true bugfix because the real bus frequency was too high because of the wrong divider? Is this a workaround which makes things work but will make the bus frequency slower than it should be?

This fix doesn't concern the i2c bus frequency, only the internal IP frequency.

Quoted 8 lines
Quoted 5 lines

TWI has been validated at 66MHz. With some devices, transfer hangs during i2c frame transmission. This issue disappears when reducing the internal frequency of the IP. Maybe there is some oversampling on i2c signals. Unfortunately, I have no clear status about the root cause that's why the commit message was imprecise.

This paragraph is a way better commit message IMO :)

Ok I'll update it.

Thanks for the review Wolfram.

Regards

Ludovic

#7 lore raw
In reply to Wolfram Sang

Hi Wolfram,

Quoted 6 lines · Wolfram Sang
Quoted 5 lines · On Fri, Nov 22, 2013 at 03:07:08PM +0100, [email protected] wrote:

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

Quoted 7 lines
Quoted 2 lines

I think the commit message needs more details. Is this a true bugfix because the real bus frequency was too high because of the wrong divider? Is this a workaround which makes things work but will make the bus frequency slower than it should be?

This fix doesn't concern the i2c bus frequency, only the internal IP frequency.

TWI has been validated at 66MHz. With some devices, transfer hangs during i2c frame transmission. This issue disappears when reducing the internal frequency of the IP. Maybe there is some oversampling on i2c signals. Unfortunately, I have no clear status about the root cause that's why the commit message was imprecise.

Regards

Ludovic

Quoted 39 lines
Quoted 39 lines
---
 arch/arm/mach-at91/sama5d3.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-at91/sama5d3.c +3 -3
index 4012797..4ee0de5 100644
@@ -95,19 +95,19 @@ static struct clk twi0_clk = {
 	.name		= "twi0_clk",
 	.pid		= SAMA5D3_ID_TWI0,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi1_clk = {
 	.name		= "twi1_clk",
 	.pid		= SAMA5D3_ID_TWI1,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk twi2_clk = {
 	.name		= "twi2_clk",
 	.pid		= SAMA5D3_ID_TWI2,
 	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
 };
 static struct clk mmc0_clk = {
 	.name		= "mci0_clk",
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

In reply to ludovic.desroches at atmel.com

Hi Ludovic,

Quoted 4 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

I guess I should do the same for the dt version of sama5 clks. Nicolas, what do you think ?

Best Regards,

Boris

Quoted 35 lines
---
  arch/arm/mach-at91/sama5d3.c |    6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-at91/sama5d3.c +3 -3
index 4012797..4ee0de5 100644
@@ -95,19 +95,19 @@ static struct clk twi0_clk = {
  	.name		= "twi0_clk",
  	.pid		= SAMA5D3_ID_TWI0,
  	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
  };
  static struct clk twi1_clk = {
  	.name		= "twi1_clk",
  	.pid		= SAMA5D3_ID_TWI1,
  	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
  };
  static struct clk twi2_clk = {
  	.name		= "twi2_clk",
  	.pid		= SAMA5D3_ID_TWI2,
  	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
  };
  static struct clk mmc0_clk = {
  	.name		= "mci0_clk",
#9 lore raw

PATCH 1/1 ARM: at91: sama5d3: reduce TWI internal clock frequency

On 22/11/2013 16:01, boris brezillon :

Quoted 10 lines

Hi Ludovic,

Quoted 4 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

There are still I2C unexpected behaviors which are solved by reducing TWI internal frequency.

I guess I should do the same for the dt version of sama5 clks. Nicolas, what do you think ?

Yes, you can queue these modification on top of your "CCF related fixes" branch.

Bye,

Quoted 37 lines
Quoted 34 lines
---
   arch/arm/mach-at91/sama5d3.c |    6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-at91/sama5d3.c +3 -3
index 4012797..4ee0de5 100644
@@ -95,19 +95,19 @@ static struct clk twi0_clk = {
   	.name		= "twi0_clk",
   	.pid		= SAMA5D3_ID_TWI0,
   	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
   };
   static struct clk twi1_clk = {
   	.name		= "twi1_clk",
   	.pid		= SAMA5D3_ID_TWI1,
   	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
   };
   static struct clk twi2_clk = {
   	.name		= "twi2_clk",
   	.pid		= SAMA5D3_ID_TWI2,
   	.type		= CLK_TYPE_PERIPHERAL,
-	.div		= AT91_PMC_PCR_DIV2,
+	.div		= AT91_PMC_PCR_DIV8,
   };
   static struct clk mmc0_clk = {
   	.name		= "mci0_clk",
Signature · 1 line
Nicolas Ferre