Skip to contentSkip to conversation

i2c: mvtwsi: fix hang on SPL bind

PATCH New Baruch Siach 4 participants 8 messages Apr 7, 2019 – Apr 11, 2019 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

---
 drivers/i2c/mvtwsi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/i2c/mvtwsi.c +4 -0
index 74ac0a4aa789..05560e112729 100644
@@ -801,6 +801,10 @@ static int mvtwsi_i2c_ofdata_to_platdata(struct udevice *bus)
 
 static void twsi_disable_i2c_slave(struct mvtwsi_registers *twsi)
 {
+	/* The debug register is not accessible in early boot */
+	if (IS_ENABLED(CONFIG_SPL_BUILD))
+		return;
+
 	clrbits_le32(&twsi->debug, BIT(18));
 }
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

Hi Baruch,

Quoted 2 lines · Baruch Siach

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

The other I2C registers can be accessed but only the debug register not? Do you know, why this is the case?

Thanks,
Stefan

Quoted 21 lines
---
  drivers/i2c/mvtwsi.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/i2c/mvtwsi.c +4 -0
index 74ac0a4aa789..05560e112729 100644
@@ -801,6 +801,10 @@ static int mvtwsi_i2c_ofdata_to_platdata(struct udevice *bus)
 
  static void twsi_disable_i2c_slave(struct mvtwsi_registers *twsi)
  {
+	/* The debug register is not accessible in early boot */
+	if (IS_ENABLED(CONFIG_SPL_BUILD))
+		return;
+
  	clrbits_le32(&twsi->debug, BIT(18));
  }
 
#2 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

Hi Stefan,

Quoted 6 lines · Stefan Roese
Quoted 2 lines · Baruch Siach

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

The other I2C registers can be accessed but only the debug register not? Do you know, why this is the case?

Access to other registers might hang as well, I have not tested. The debug register is the only one that the .bind callback touches. .bind callbacks are called before board_early_init_f() that configures the MPP.

baruch

Quoted 5 lines
Quoted 5 lines
---
  drivers/i2c/mvtwsi.c | 4 ++++
  1 file changed, 4 insertions(+)
Quoted 13 lines

drivers/i2c/mvtwsi.c static int mvtwsi_i2c_ofdata_to_platdata(struct udevice *bus) · line 808

Quoted 13 lines
drivers/i2c/mvtwsi.c +4 -0
index 74ac0a4aa789..05560e112729 100644
@@ -801,6 +801,10 @@ static int mvtwsi_i2c_ofdata_to_platdata(struct udevice *bus)
    static void twsi_disable_i2c_slave(struct mvtwsi_registers *twsi)
  {
+	/* The debug register is not accessible in early boot */
+	if (IS_ENABLED(CONFIG_SPL_BUILD))
+		return;
+
  	clrbits_le32(&twsi->debug, BIT(18));
  }

--
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 -

#3 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

In reply to Baruch Siach

Hello Baruch,

Am 07.04.2019 um 11:30 schrieb Baruch Siach:

Quoted 7 lines

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

---
  drivers/i2c/mvtwsi.c | 4 ++++
  1 file changed, 4 insertions(+)

Applied to u-boot-i2c.git 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: hs at denx.de
#4 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

Hi Heiko,

Quoted 6 lines · Heiko Schocher

Hello Baruch,

Am 07.04.2019 um 11:30 schrieb Baruch Siach:

Quoted 3 lines

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

Quoted 6 lines
Quoted 4 lines
---
   drivers/i2c/mvtwsi.c | 4 ++++
   1 file changed, 4 insertions(+)

Applied to u-boot-i2c.git master

Could you please hold this patch a bit longer. I'm not 100% sure, if this is the correct fix. Please see this thread for more details.

https://lists.denx.de/pipermail/u-boot/2019-April/364818.html

Thanks,
Stefan

#5 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

Hello Stefan,

Am 11.04.2019 um 11:31 schrieb Stefan Roese:

Quoted 14 lines

Hi Heiko,

Quoted 11 lines · Heiko Schocher

Hello Baruch,

Am 07.04.2019 um 11:30 schrieb Baruch Siach:

Quoted 7 lines

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

---
   drivers/i2c/mvtwsi.c | 4 ++++

   1 file changed, 4 insertions(+)
Quoted 6 lines
Quoted 1 line

Applied to u-boot-i2c.git master

Could you please hold this patch a bit longer. I'm not 100% sure, if this is the correct fix. Please see this thread for more details.

https://lists.denx.de/pipermail/u-boot/2019-April/364818.html

Oh, wasn;t aware of this ... Hmm.. pull request is already send to Tom ... but Tom hasn;t merged it ...

@Tom: Should I remove this patch from u-boot-i2c.git and send a new
pull request or should we revert this commit, if a better solution is found?

Tom
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: hs at denx.de
#6 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

Quoted 22 lines · Heiko Schocher

Hello Stefan,

Am 11.04.2019 um 11:31 schrieb Stefan Roese:

Quoted 19 lines

Hi Heiko,

Quoted 6 lines · Heiko Schocher

Hello Baruch,

Am 07.04.2019 um 11:30 schrieb Baruch Siach:

Quoted 3 lines

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

Quoted 6 lines
Quoted 4 lines

---
   drivers/i2c/mvtwsi.c | 4 ++++

   1 file changed, 4 insertions(+)

Applied to u-boot-i2c.git master

Could you please hold this patch a bit longer. I'm not 100% sure, if this is the correct fix. Please see this thread for more details.

Quoted 8 lines
Quoted 1 line

https://lists.denx.de/pipermail/u-boot/2019-April/364818.html

Oh, wasn;t aware of this ... Hmm.. pull request is already send to Tom ... but Tom hasn;t merged it ...

@Tom: Should I remove this patch from u-boot-i2c.git and send a new
pull request or should we revert this commit, if a better solution is found?

Please re-send your PR, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190411/84f17b71/attachment.sig>
#7 lore raw

PATCH 1/1 i2c: mvtwsi: fix hang on SPL bind

In reply to Heiko Schocher

Hello Baruch

Am 11.04.2019 um 11:49 schrieb Heiko Schocher:

Quoted 22 lines

Hello Stefan,

Am 11.04.2019 um 11:31 schrieb Stefan Roese:

Quoted 19 lines

Hi Heiko,

Quoted 6 lines · Heiko Schocher

Hello Baruch,

Am 07.04.2019 um 11:30 schrieb Baruch Siach:

Quoted 3 lines

The mvebu specific debug register is not accessible when the bind code runs in SPL. Skip it.

Quoted 6 lines
Quoted 4 lines

---
   drivers/i2c/mvtwsi.c | 4 ++++

   1 file changed, 4 insertions(+)

Applied to u-boot-i2c.git master

Could you please hold this patch a bit longer. I'm not 100% sure, if this is the correct fix. Please see this thread for more details.

Quoted 8 lines
Quoted 1 line

https://lists.denx.de/pipermail/u-boot/2019-April/364818.html

Oh, wasn;t aware of this ... Hmm.. pull request is already send to Tom ... but Tom hasn;t merged it ...

@Tom: Should I remove this patch from u-boot-i2c.git and send a new
  pull request or should we revert this commit, if a better solution is found?

Removed from u-boot-i2c. I send a new PR to Tom if travis build works.

We should wait of the result of discussion in thread:

https://lists.denx.de/pipermail/u-boot/2019-April/364818.html

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: hs at denx.de