linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Initialization order
@ 2008-09-02 21:28 Gary Thomas
  2008-09-02 21:33 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Thomas @ 2008-09-02 21:28 UTC (permalink / raw)
  To: linuxppc-dev

I'm working with a couple FreeScale platforms and having
trouble getting the RTC which is connected via I2C to work.
I had this working fine in the old arch/ppc tree, but it's
failing in the arch/powerpc world.

Here's the problem - the RTC driver gets initialized *before*
the I2C bus and as far as I can tell, the RTC 'probe' function
never gets executed.  I've peppered the device/bus/driver init
code with some extra prints to see the flow:

*** ds1307_init.548
*** i2c_register_driver.662
*** i2c_register_driver.674
*** i2c_register_driver.682
*** driver_register.228 (rtc-ds1307) - called from c01963cc
*** bus_add_driver.657 - bus: 'i2c', driver: 'rtc-ds1307'
*** i2c_register_driver.689
i2c /dev entries driver
*** i2c_register_driver.662
*** i2c_register_driver.674
*** i2c_register_driver.682
*** driver_register.228 (dev_driver) - called from c01963cc
*** bus_add_driver.657 - bus: 'i2c', driver: 'dev_driver'
*** i2c_register_driver.689
*** platform_driver_register.456 (fsl-i2c) - called from c02bbc54
*** driver_register.228 (fsl-i2c) - called from c0162f88
*** bus_add_driver.657 - bus: 'platform', driver: 'fsl-i2c'
*** fsl_i2c_probe.361
*** fsl_i2c_probe.361

There is a similar print in the 'ds1307_probe()' function,
but as you can see, it's never called :-(

Can someone explain what drives the order of these init functions?
I can see that it's based on the __XXXinit sections, but I don't
see why the RTC functions happen before the FSL-I2C ones.  From
my system map:

c02bb738 t rtc_hctosys
c02bb87c t rtc_init
c02bb918 T rtc_dev_init
c02bb97c T rtc_sysfs_init
c02bb98c t ds1307_init
c02bb9d0 T i2c_register_board_info
c02bbaf4 t i2c_init
c02bbb80 t i2c_dev_init
c02bbc3c t fsl_i2c_init

Any ideas how I can affect this ordering?  or should it matter
and there's something else going on?

Thanks for any pointers

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: Initialization order
  2008-09-02 21:28 Initialization order Gary Thomas
@ 2008-09-02 21:33 ` Scott Wood
  2008-09-02 21:39   ` Gary Thomas
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2008-09-02 21:33 UTC (permalink / raw)
  To: Gary Thomas; +Cc: linuxppc-dev

On Tue, Sep 02, 2008 at 03:28:19PM -0600, Gary Thomas wrote:
> I'm working with a couple FreeScale platforms and having
> trouble getting the RTC which is connected via I2C to work.
> I had this working fine in the old arch/ppc tree, but it's
> failing in the arch/powerpc world.

Make sure the rtc chip is described in the device tree (search existing
trees for rtc@ for examples).

> Here's the problem - the RTC driver gets initialized *before*
> the I2C bus

That's OK.

-Scott

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

* Re: Initialization order
  2008-09-02 21:33 ` Scott Wood
@ 2008-09-02 21:39   ` Gary Thomas
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Thomas @ 2008-09-02 21:39 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev

Scott Wood wrote:
> On Tue, Sep 02, 2008 at 03:28:19PM -0600, Gary Thomas wrote:
>> I'm working with a couple FreeScale platforms and having
>> trouble getting the RTC which is connected via I2C to work.
>> I had this working fine in the old arch/ppc tree, but it's
>> failing in the arch/powerpc world.
> 
> Make sure the rtc chip is described in the device tree (search existing
> trees for rtc@ for examples).

That did it, thanks :-)

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

end of thread, other threads:[~2008-09-02 21:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-02 21:28 Initialization order Gary Thomas
2008-09-02 21:33 ` Scott Wood
2008-09-02 21:39   ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).