All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
@ 2010-03-29 13:35 Stefan Roese
  2010-03-29 13:43 ` Heiko Schocher
  2010-03-30 11:05 ` Stefan Roese
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Roese @ 2010-03-29 13:35 UTC (permalink / raw)
  To: u-boot

This patch fixes a problem introduced with patch eb5eb2b0
[ppc4xx: Cleanup PPC4xx I2C infrastructure]. We need to assign the I2C
base address to the "i2c" pointer inside of the controller loop.
Otherwise controller 0 is initialized multiple times instead of
initializing each I2C controller sequentially.

Tested on Katmai.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
---
Heiko, I just noticed that this PPC4xx I2C driver is still in the
cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
after the next release. Is this ok for you? I can provide a patch
for this soon.

Please let me know if you see any problems with this patch. I would
really like to push it into this release, since it really is a bug
fix.

Thanks.

 cpu/ppc4xx/i2c.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cpu/ppc4xx/i2c.c b/cpu/ppc4xx/i2c.c
index 7976e75..9b86187 100644
--- a/cpu/ppc4xx/i2c.c
+++ b/cpu/ppc4xx/i2c.c
@@ -93,7 +93,7 @@ static void _i2c_bus_reset(void)
 
 void i2c_init(int speed, int slaveaddr)
 {
-	struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+	struct ppc4xx_i2c *i2c;
 	int val, divisor;
 	int bus;
 
@@ -109,6 +109,9 @@ void i2c_init(int speed, int slaveaddr)
 	for (bus = 0; bus < CONFIG_SYS_MAX_I2C_BUS; bus++) {
 		I2C_SET_BUS(bus);
 
+		/* Set i2c pointer after calling I2C_SET_BUS() */
+		i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+
 		/* Handle possible failed I2C state */
 		/* FIXME: put this into i2c_init_board()? */
 		_i2c_bus_reset();
-- 
1.7.0.3

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

* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
  2010-03-29 13:35 [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization Stefan Roese
@ 2010-03-29 13:43 ` Heiko Schocher
  2010-03-29 13:49   ` Stefan Roese
  2010-03-30 11:05 ` Stefan Roese
  1 sibling, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2010-03-29 13:43 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Stefan Roese wrote:
> This patch fixes a problem introduced with patch eb5eb2b0
> [ppc4xx: Cleanup PPC4xx I2C infrastructure]. We need to assign the I2C
> base address to the "i2c" pointer inside of the controller loop.
> Otherwise controller 0 is initialized multiple times instead of
> initializing each I2C controller sequentially.
> 
> Tested on Katmai.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> ---
> Heiko, I just noticed that this PPC4xx I2C driver is still in the
> cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
> after the next release. Is this ok for you? I can provide a patch
> for this soon.

Yep, that would be the better place for it.
(Did this already in the multibus_v2 branch in
 git://git.denx.de/u-boot-i2c.git)

> Please let me know if you see any problems with this patch. I would
> really like to push it into this release, since it really is a bug
> fix.

It looks Ok for me.

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] 8+ messages in thread

* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
  2010-03-29 13:43 ` Heiko Schocher
@ 2010-03-29 13:49   ` Stefan Roese
  2010-03-29 13:57     ` Heiko Schocher
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2010-03-29 13:49 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

On Monday 29 March 2010 15:43:50 Heiko Schocher wrote:
> > Heiko, I just noticed that this PPC4xx I2C driver is still in the
> > cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
> > after the next release. Is this ok for you? I can provide a patch
> > for this soon.
> 
> Yep, that would be the better place for it.
> (Did this already in the multibus_v2 branch in
>  git://git.denx.de/u-boot-i2c.git)

OK, I'll send a moving patch for "next" soon.
 
> > Please let me know if you see any problems with this patch. I would
> > really like to push it into this release, since it really is a bug
> > fix.
> 
> It looks Ok for me.

Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow and 
send a pull request to Wolfgang.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
  2010-03-29 13:49   ` Stefan Roese
@ 2010-03-29 13:57     ` Heiko Schocher
  2010-03-29 14:31       ` Stefan Roese
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2010-03-29 13:57 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Stefan Roese wrote:
> On Monday 29 March 2010 15:43:50 Heiko Schocher wrote:
>>> Heiko, I just noticed that this PPC4xx I2C driver is still in the
>>> cpu/ppc4xx directory. I suggest that we move it into drivers/i2c
>>> after the next release. Is this ok for you? I can provide a patch
>>> for this soon.
>> Yep, that would be the better place for it.
>> (Did this already in the multibus_v2 branch in
>>  git://git.denx.de/u-boot-i2c.git)
> 
> OK, I'll send a moving patch for "next" soon.

Great.

>>> Please let me know if you see any problems with this patch. I would
>>> really like to push it into this release, since it really is a bug
>>> fix.
>> It looks Ok for me.
> 
> Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow and 
> send a pull request to Wolfgang.

Ah, I just wanted to send a pull request to Wolfgang, because I added
it to i2c next ... is this Ok for you?

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] 8+ messages in thread

* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
  2010-03-29 13:57     ` Heiko Schocher
@ 2010-03-29 14:31       ` Stefan Roese
  2010-03-29 14:56         ` Heiko Schocher
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2010-03-29 14:31 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

On Monday 29 March 2010 15:57:22 Heiko Schocher wrote:
> >>> Please let me know if you see any problems with this patch. I would
> >>> really like to push it into this release, since it really is a bug
> >>> fix.
> >> 
> >> It looks Ok for me.
> > 
> > Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow
> > and send a pull request to Wolfgang.
> 
> Ah, I just wanted to send a pull request to Wolfgang, because I added
> it to i2c next ... is this Ok for you?

It's supposed to go into "master" (bug fix). So if you plan to push it via 
your master branch, then it's fine with me.

Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
  2010-03-29 14:31       ` Stefan Roese
@ 2010-03-29 14:56         ` Heiko Schocher
  2010-03-29 15:29           ` Stefan Roese
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2010-03-29 14:56 UTC (permalink / raw)
  To: u-boot

Hello Stefan,

Stefan Roese wrote:
> On Monday 29 March 2010 15:57:22 Heiko Schocher wrote:
>>>>> Please let me know if you see any problems with this patch. I would
>>>>> really like to push it into this release, since it really is a bug
>>>>> fix.
>>>> It looks Ok for me.
>>> Good. If nobody else objects, I'll push it into ppc4xx/master tomorrow
>>> and send a pull request to Wolfgang.
>> Ah, I just wanted to send a pull request to Wolfgang, because I added
>> it to i2c next ... is this Ok for you?
> 
> It's supposed to go into "master" (bug fix). So if you plan to push it via 
> your master branch, then it's fine with me.

Of course ... Hmm.. I am fine with it, if you want to push this through
ppc4xx/master, so you can add my:

Acked-by: Heiko Schocher <hs@denx.de>

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] 8+ messages in thread

* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
  2010-03-29 14:56         ` Heiko Schocher
@ 2010-03-29 15:29           ` Stefan Roese
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2010-03-29 15:29 UTC (permalink / raw)
  To: u-boot

On Monday 29 March 2010 16:56:32 Heiko Schocher wrote:
> >> Ah, I just wanted to send a pull request to Wolfgang, because I added
> >> it to i2c next ... is this Ok for you?
> > 
> > It's supposed to go into "master" (bug fix). So if you plan to push it
> > via your master branch, then it's fine with me.
> 
> Of course ... Hmm.. I am fine with it, if you want to push this through
> ppc4xx/master, so you can add my:
> 
> Acked-by: Heiko Schocher <hs@denx.de>

Thanks. I'll push it via ppc4xx/master tomorrow (if nobody objects).

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

* [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization
  2010-03-29 13:35 [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization Stefan Roese
  2010-03-29 13:43 ` Heiko Schocher
@ 2010-03-30 11:05 ` Stefan Roese
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2010-03-30 11:05 UTC (permalink / raw)
  To: u-boot

On Monday 29 March 2010 15:35:43 Stefan Roese wrote:
> This patch fixes a problem introduced with patch eb5eb2b0
> [ppc4xx: Cleanup PPC4xx I2C infrastructure]. We need to assign the I2C
> base address to the "i2c" pointer inside of the controller loop.
> Otherwise controller 0 is initialized multiple times instead of
> initializing each I2C controller sequentially.
> 
> Tested on Katmai.

Applied to u-boot-ppc4xx/master. Thanks.
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

end of thread, other threads:[~2010-03-30 11:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29 13:35 [U-Boot] [PATCH] ppc4xx: Fix problem with I2C bus >= 1 initialization Stefan Roese
2010-03-29 13:43 ` Heiko Schocher
2010-03-29 13:49   ` Stefan Roese
2010-03-29 13:57     ` Heiko Schocher
2010-03-29 14:31       ` Stefan Roese
2010-03-29 14:56         ` Heiko Schocher
2010-03-29 15:29           ` Stefan Roese
2010-03-30 11:05 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.