public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Fix: nommu I2C adapter relocation error
@ 2013-10-14  8:27 Jens Scharsig
  2013-10-17  6:22 ` Heiko Schocher
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Scharsig @ 2013-10-14  8:27 UTC (permalink / raw)
  To: u-boot

From: "Jens Scharsig (BuS Elektronik)" <esw@bus-elektronik.de>

NoMMU systems have a access violation problem with i2c_reloc_fixup.
Blame for it is a double relocation of the adapter itself. The
i2c_adap_p is already relocated, if i2c_reloc_fixup is called.
This patch removes the relocation of i2c_adap_p from i2c_reloc_fixup
to fix this.

Signed-off-by: Jens Scharsig (BuS Elektronik) <esw@bus-elektronik.de>
---
 drivers/i2c/i2c_core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/i2c/i2c_core.c b/drivers/i2c/i2c_core.c
index d1072e8..bb5d4db 100644
--- a/drivers/i2c/i2c_core.c
+++ b/drivers/i2c/i2c_core.c
@@ -53,10 +53,6 @@ void i2c_reloc_fixup(void)
 		return;
 
 	for (i = 0; i < max; i++) {
-		/* adapter itself */
-		addr = (unsigned long)i2c_adap_p;
-		addr += gd->reloc_off;
-		i2c_adap_p = (struct i2c_adapter *)addr;
 		/* i2c_init() */
 		addr = (unsigned long)i2c_adap_p->init;
 		addr += gd->reloc_off;
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] Fix: nommu I2C adapter relocation error
  2013-10-14  8:27 [U-Boot] [PATCH] Fix: nommu I2C adapter relocation error Jens Scharsig
@ 2013-10-17  6:22 ` Heiko Schocher
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Schocher @ 2013-10-17  6:22 UTC (permalink / raw)
  To: u-boot

Hello Jens,

Am 14.10.2013 10:27, schrieb Jens Scharsig (BuS Elektronik):
> From: "Jens Scharsig (BuS Elektronik)"<esw@bus-elektronik.de>
>
> NoMMU systems have a access violation problem with i2c_reloc_fixup.
> Blame for it is a double relocation of the adapter itself. The
> i2c_adap_p is already relocated, if i2c_reloc_fixup is called.
> This patch removes the relocation of i2c_adap_p from i2c_reloc_fixup
> to fix this.
>
> Signed-off-by: Jens Scharsig (BuS Elektronik)<esw@bus-elektronik.de>
> ---
>   drivers/i2c/i2c_core.c | 4 ----
>   1 file changed, 4 deletions(-)

Applied to u-boot-i2c.git

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-17  6:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-14  8:27 [U-Boot] [PATCH] Fix: nommu I2C adapter relocation error Jens Scharsig
2013-10-17  6:22 ` Heiko Schocher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox