Skip to contentSkip to conversation

i2c: ast_i2c: Remove SCL direct drive mode

PATCH In review Eddie James 4 participants 5 messages May 11, 2022 – Jul 19, 2022 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: ast_i2c: Remove SCL direct drive mode

SCL direct drive mode prevents communication with devices that do clock stretching, so disable. The Linux driver doesn't use this mode, and the engine can handle clock stretching.

---
 drivers/i2c/ast_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/ast_i2c.c +1 -1
index 2d3fecaa14..8b24a260c0 100644
@@ -76,7 +76,7 @@ static void ast_i2c_init_bus(struct udevice *dev)
 	/* Enable Master Mode. Assuming single-master */
 	writel(I2CD_MASTER_EN
 	       | I2CD_M_SDA_LOCK_EN
-	       | I2CD_MULTI_MASTER_DIS | I2CD_M_SCL_DRIVE_EN,
+	       | I2CD_MULTI_MASTER_DIS,
 	       &priv->regs->fcr);
 	/* Enable Interrupts */
 	writel(I2CD_INTR_TX_ACK
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw

Hello Eddie,

Quoted 3 lines · Eddie James

SCL direct drive mode prevents communication with devices that do clock stretching, so disable. The Linux driver doesn't use this mode, and the engine can handle clock stretching.

My first thought was why not make this option configurable, as I do not know if there is any user of this mode configuration.

But as linux does not use this option, we may can disable it.

Quoted 4 lines
---
 drivers/i2c/ast_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

It would be good to have here more comments from users of this driver.

bye,
Heiko

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-52   Fax: +49-8142-66989-80   Email: [email protected]
Reviewed-by on v1 1/1
#2 lore raw
In reply to Eddie James
Quoted 6 lines · Eddie James

SCL direct drive mode prevents communication with devices that do clock stretching, so disable. The Linux driver doesn't use this mode, and the engine can handle clock stretching.

I have added the aspeed team to cc for their review.

Ryan, we discovered this fix when testing the tpm i2c driver on the ast2600.

Quoted 20 lines
---
 drivers/i2c/ast_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/ast_i2c.c +1 -2
index 2d3fecaa14..8b24a260c0 100644
@@ -76,7 +76,7 @@ static void ast_i2c_init_bus(struct udevice *dev)
        /* Enable Master Mode. Assuming single-master */
        writel(I2CD_MASTER_EN
               | I2CD_M_SDA_LOCK_EN
-              | I2CD_MULTI_MASTER_DIS | I2CD_M_SCL_DRIVE_EN,
+              | I2CD_MULTI_MASTER_DIS,
               &priv->regs->fcr);
        /* Enable Interrupts */
        writel(I2CD_INTR_TX_ACK
--

2.27.0

Reviewed-by
#3 lore raw
Quoted 11 lines

-----Original Message-----
From: Joel Stanley <[email protected]>
Sent: Thursday, May 19, 2022 8:28 AM
To: Eddie James <[email protected]>; Ryan Chen <[email protected]>; BMC-SW <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; [email protected]
Subject: Re: [PATCH] i2c: ast_i2c: Remove SCL direct drive mode

Quoted 1 line · Eddie James
Quoted 8 lines
Quoted 5 lines

SCL direct drive mode prevents communication with devices that do clock stretching, so disable. The Linux driver doesn't use this mode, and the engine can handle clock stretching.

Quoted 4 lines

I have added the aspeed team to cc for their review.

Ryan, we discovered this fix when testing the tpm i2c driver on the ast2600.

Yes, it should remove. Thank for inform.

Quoted 20 lines
Quoted 20 lines
---
 drivers/i2c/ast_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/ast_i2c.c index renamed from drivers/i2c/ast_i2c.c +0 -0

2d3fecaa14..8b24a260c0 100644

drivers/i2c/ast_i2c.c +1 -2
@@ -76,7 +76,7 @@ static void ast_i2c_init_bus(struct udevice *dev)
        /* Enable Master Mode. Assuming single-master */
        writel(I2CD_MASTER_EN
               | I2CD_M_SDA_LOCK_EN
-              | I2CD_MULTI_MASTER_DIS | I2CD_M_SCL_DRIVE_EN,
+              | I2CD_MULTI_MASTER_DIS,
               &priv->regs->fcr);
        /* Enable Interrupts */
        writel(I2CD_INTR_TX_ACK
--

2.27.0

#4 lore raw
In reply to Eddie James

Hello Eddie,

Quoted 8 lines · Eddie James

SCL direct drive mode prevents communication with devices that do clock stretching, so disable. The Linux driver doesn't use this mode, and the engine can handle clock stretching.

---
 drivers/i2c/ast_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-i2c master

Thanks!

bye,
Heiko

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-52   Fax: +49-8142-66989-80   Email: [email protected]