public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] i2c_set_bus_num
@ 2007-03-27 23:48 Dongying_Xu at us.alphanetworks.com
  2007-03-28  1:00 ` Kim Phillips
  0 siblings, 1 reply; 6+ messages in thread
From: Dongying_Xu at us.alphanetworks.com @ 2007-03-27 23:48 UTC (permalink / raw)
  To: u-boot

Hi, 

Does anyone experienced following problem? In u-boot/drivers/fsl_i2c.c, 
there are functions to set and get i2c bus number,
When I set the default i2c_bus_num to 0, I can not use i2c_set_bus_num() 
set bus 1 properly.  For example, I called

>>i2c_set_bus_num(1);
>>printf(The bus number is %d\n", i2c_get_bus_num());

>>>>The bus number is 0.

I am using MPC8343.  Thanks. Any suggestion is appreciated.

dongy



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070327/0617366e/attachment.htm 

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

* [U-Boot-Users] i2c_set_bus_num
  2007-03-27 23:48 [U-Boot-Users] i2c_set_bus_num Dongying_Xu at us.alphanetworks.com
@ 2007-03-28  1:00 ` Kim Phillips
  2007-03-28  1:07   ` Timur Tabi
  2007-03-29 18:07   ` Dongying_Xu at us.alphanetworks.com
  0 siblings, 2 replies; 6+ messages in thread
From: Kim Phillips @ 2007-03-28  1:00 UTC (permalink / raw)
  To: u-boot

On Tue, 27 Mar 2007 16:48:29 -0700
Dongying_Xu at us.alphanetworks.com wrote:

> Hi, 
> 
> Does anyone experienced following problem? In u-boot/drivers/fsl_i2c.c, 
> there are functions to set and get i2c bus number,
> When I set the default i2c_bus_num to 0, I can not use i2c_set_bus_num() 
> set bus 1 properly.  For example, I called
> 
> >>i2c_set_bus_num(1);
> >>printf(The bus number is %d\n", i2c_get_bus_num());
> 
> >>>>The bus number is 0.
> 
> I am using MPC8343.  Thanks. Any suggestion is appreciated.
> 
See "Initial Stack, Global Data" in the u-boot README.

If your memory controller, or whatever you want to access while unable to write global vars, is hanging off of the 2nd bus, do something equivalent to what the 8349ITX does (look for CFG_SPD_BUS_NUM).

Kim

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

* [U-Boot-Users] i2c_set_bus_num
  2007-03-28  1:00 ` Kim Phillips
@ 2007-03-28  1:07   ` Timur Tabi
  2007-03-29 18:07   ` Dongying_Xu at us.alphanetworks.com
  1 sibling, 0 replies; 6+ messages in thread
From: Timur Tabi @ 2007-03-28  1:07 UTC (permalink / raw)
  To: u-boot

Kim Phillips wrote:

> See "Initial Stack, Global Data" in the u-boot README.
> 
> If your memory controller, or whatever you want to access while unable to write global 
vars, is hanging off of the 2nd bus, do something equivalent to what the 
8349ITX does (look for CFG_SPD_BUS_NUM).

I have plans to fix this problem, by enhancing the i2c functions to take 
a bus number.  This will eliminate the global variable that causes this 
problem.

I plan on working on this patch once all the other patches that I 
submitted have been applied.

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

* [U-Boot-Users] i2c_set_bus_num
  2007-03-28  1:00 ` Kim Phillips
  2007-03-28  1:07   ` Timur Tabi
@ 2007-03-29 18:07   ` Dongying_Xu at us.alphanetworks.com
  2007-03-29 18:11     ` Timur Tabi
  1 sibling, 1 reply; 6+ messages in thread
From: Dongying_Xu at us.alphanetworks.com @ 2007-03-29 18:07 UTC (permalink / raw)
  To: u-boot

Kim,

Thanks. When I defined CFG_SPD_BUS_NUM 1 in my header file, things are 
much better.  Though I don't understand why this definition will help.  I 
read the  "Initial Stack, Global Data" part in Readme, It looks that 
Initialized global data is read-only, if this is the case, then It should 
fail when I try to set I2c bus num to 0, but it worked.  Could you please 
explain a little bit?   Thanks 

dongy





Kim Phillips <kim.phillips@freescale.com>
03/27/2007 06:00 PM
 
        To:     Dongying_Xu at us.alphanetworks.com
        cc:     u-boot-users at lists.sourceforge.net
        Subject:        Re: [U-Boot-Users] i2c_set_bus_num


On Tue, 27 Mar 2007 16:48:29 -0700
Dongying_Xu at us.alphanetworks.com wrote:

> Hi, 
> 
> Does anyone experienced following problem? In u-boot/drivers/fsl_i2c.c, 
> there are functions to set and get i2c bus number,
> When I set the default i2c_bus_num to 0, I can not use i2c_set_bus_num() 

> set bus 1 properly.  For example, I called
> 
> >>i2c_set_bus_num(1);
> >>printf(The bus number is %d\n", i2c_get_bus_num());
> 
> >>>>The bus number is 0.
> 
> I am using MPC8343.  Thanks. Any suggestion is appreciated.
> 
See "Initial Stack, Global Data" in the u-boot README.

If your memory controller, or whatever you want to access while unable to 
write global vars, is hanging off of the 2nd bus, do something equivalent 
to what the 8349ITX does (look for CFG_SPD_BUS_NUM).

Kim


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070329/54ee7789/attachment.htm 

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

* [U-Boot-Users] i2c_set_bus_num
  2007-03-29 18:07   ` Dongying_Xu at us.alphanetworks.com
@ 2007-03-29 18:11     ` Timur Tabi
  2007-03-29 18:51       ` Dongying_Xu at us.alphanetworks.com
  0 siblings, 1 reply; 6+ messages in thread
From: Timur Tabi @ 2007-03-29 18:11 UTC (permalink / raw)
  To: u-boot

Dongying_Xu at us.alphanetworks.com wrote:
> 
> Kim,
> 
> Thanks. When I defined CFG_SPD_BUS_NUM 1 in my header file, things are 
> much better.  Though I don't understand why this definition will help. 
>  I read the  "Initial Stack, Global Data" part in Readme, It looks that 
> Initialized global data is read-only, if this is the case, then It 
> should fail when I try to set I2c bus num to 0, but it worked.  Could 
> you please explain a little bit?   Thanks

If you call i2c_set_bus_num() before DDR is initialized, it will fail.

If you call i2c_set_bus_num() after DDR is initialized, it will succeed.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

* [U-Boot-Users] i2c_set_bus_num
  2007-03-29 18:11     ` Timur Tabi
@ 2007-03-29 18:51       ` Dongying_Xu at us.alphanetworks.com
  0 siblings, 0 replies; 6+ messages in thread
From: Dongying_Xu at us.alphanetworks.com @ 2007-03-29 18:51 UTC (permalink / raw)
  To: u-boot

Timur,

Thanks.  It looks just a matter of time. 

dongy




Timur Tabi <timur@freescale.com>
03/29/2007 11:11 AM
 
        To:     Dongying_Xu at us.alphanetworks.com
        cc:     Kim Phillips <kim.phillips@freescale.com>, 
u-boot-users at lists.sourceforge.net
        Subject:        Re: [U-Boot-Users] i2c_set_bus_num


Dongying_Xu at us.alphanetworks.com wrote:
> 
> Kim,
> 
> Thanks. When I defined CFG_SPD_BUS_NUM 1 in my header file, things are 
> much better.  Though I don't understand why this definition will help. 
>  I read the  "Initial Stack, Global Data" part in Readme, It looks that 
> Initialized global data is read-only, if this is the case, then It 
> should fail when I try to set I2c bus num to 0, but it worked.  Could 
> you please explain a little bit?   Thanks

If you call i2c_set_bus_num() before DDR is initialized, it will fail.

If you call i2c_set_bus_num() after DDR is initialized, it will succeed.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070329/215595a3/attachment.htm 

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

end of thread, other threads:[~2007-03-29 18:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-27 23:48 [U-Boot-Users] i2c_set_bus_num Dongying_Xu at us.alphanetworks.com
2007-03-28  1:00 ` Kim Phillips
2007-03-28  1:07   ` Timur Tabi
2007-03-29 18:07   ` Dongying_Xu at us.alphanetworks.com
2007-03-29 18:11     ` Timur Tabi
2007-03-29 18:51       ` Dongying_Xu at us.alphanetworks.com

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