Skip to contentSkip to conversation

Fix: nommu I2C adapter relocation error

PATCH New Jens Scharsig (BuS Elektronik) 2 participants 2 messages Oct 14, 2013 – Oct 17, 2013 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix: nommu I2C adapter relocation error

From: "Jens Scharsig (BuS Elektronik)" <[email protected]>

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.

---
 drivers/i2c/i2c_core.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/i2c/i2c_core.c +0 -4
index d1072e8..bb5d4db 100644
@@ -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;
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 Fix: nommu I2C adapter relocation error

Hello Jens,

Am 14.10.2013 10:27, schrieb Jens Scharsig (BuS Elektronik):

Quoted 8 lines

From: "Jens Scharsig (BuS Elektronik)"<[email protected]>

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.

Quoted 4 lines
---
  drivers/i2c/i2c_core.c | 4 ----
  1 file changed, 4 deletions(-)

Applied to u-boot-i2c.git

Thanks!

bye,
Heiko

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