mpc870: hctosys.c unable to open rtc device rtc0

Scott Wood scottwood at freescale.com
Tue Aug 10 03:29:33 EST 2010


On Sun, 8 Aug 2010 23:37:00 -0700
Shawn Jin <shawnxjin at gmail.com> wrote:

> Reading the fsl i2c bindings in the documentation, I found an example
> as follows.
>   27      i2c at 860 {
>   28                compatible = "fsl,mpc823-i2c",
>   29                             "fsl,cpm1-i2c";
>   30                reg = <0x860 0x20 0x3c80 0x30>;
>   31                interrupts = <16>;
>   32                interrupt-parent = <&CPM_PIC>;
>   33                fsl,cpm-command = <0x10>;
>   34                #address-cells = <1>;
>   35                #size-cells = <0>;
>   36
>   37                rtc at 68 {
>   38                        compatible = "dallas,ds1307";
>   39                        reg = <0x68>;
>   40                };
>   41        };
>   42
> 
> In the above example the rtc was explicitly declared as a subnode of
> the i2c node. Is this the way to connect (or bind) a RTC to the I2C
> driver?

Yes.

> What is the reg (0x68) under rtc node?

It's the 7-bit I2C address (without the low-order direction bit).

> I set breakpoint at ds1037_probe() and was hoping that it might be hit
> during the driver registration. But it didn't. Would the
> ds1037_probe() be called during when the ds1037_driver was registered
> as an I2C driver?

The probe function is called only if the device is declared.  There is
no autodetection.

-Scott



More information about the Linuxppc-dev mailing list