* OF devices and non OF devices
@ 2007-07-03 14:54 Kári Davíðsson
2007-07-03 16:31 ` John Rigby
0 siblings, 1 reply; 11+ messages in thread
From: Kári Davíðsson @ 2007-07-03 14:54 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I am attempting to get some non OF devices working for an mpc 5200 =
board, in particular=20
PCF8563 RTC.
This device has an non OF device interface which I believe is correct. =
After all it should work
on non OF platforms.
I have managed to get the board to run the i2c initialization (and =
probe) for the fsl-mpc i2c driver by
converting the fsl-mpc i2c driver to OF driver (I found some patch here =
that I based this work on).
Since the PCF8563 driver is not OF driver only its initaliziation code =
is run but the .probe function
of the driver is never run. Basically (as far as I can understand) the =
.probe is never run because the
driver is not an OF driver.
I could convert the PCF8563 driver to OF driver and make it work for our =
puposes but I feel this is
1) Wrong
2) therefore wasted work.
What seems to elude me is some glue that glues together the OF part of =
the driver space to the non OF part
of the driver space.
Any hints or pointers on where to find this glue?
Regards,
kd
P.S. Kernel is post 2.6.20.
--=20
K=E1ri Dav=ED=F0sson | kari.davidsson@marel.is
Hugb=FAna=F0arger=F0 | www.marel.com
Tel: 563-8156 Fax: +354 563 8001
Iceland
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OF devices and non OF devices
2007-07-03 14:54 OF devices and non OF devices Kári Davíðsson
@ 2007-07-03 16:31 ` John Rigby
2007-07-04 4:24 ` about FCC of MPC8270 li.chunlin
2007-07-04 12:00 ` OF devices and non OF devices Kári Davíðsson
0 siblings, 2 replies; 11+ messages in thread
From: John Rigby @ 2007-07-03 16:31 UTC (permalink / raw)
To: Kári Davíðsson; +Cc: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 2357 bytes --]
One place to find binding between OF devices and non OF devices is in
arch/powerpc/sysdev/fsl_soc.c
The typical pattern is:
if of_find_compatible_node "of-device-name"
platform_device_register_simple ""platform-device-name"
platform_device_add_data ...
On 7/3/07, Kári Davíðsson <kari.davidsson@marel.is> wrote:
>
> Hi,
>
> I am attempting to get some non OF devices working for an mpc 5200 board,
> in particular
> PCF8563 RTC.
>
> This device has an non OF device interface which I believe is correct.
> After all it should work
> on non OF platforms.
>
> I have managed to get the board to run the i2c initialization (and probe)
> for the fsl-mpc i2c driver by
> converting the fsl-mpc i2c driver to OF driver (I found some patch here
> that I based this work on).
fsl-i2c is one of the devices handled by fsl_soc.c so you shouldn't need to
change anything to
make it work in the latest kernel. CONFIG_FSL_SOC was only added to
lite5200_defconfig recently so
that may explain why it's not on in your kernel.
Since the PCF8563 driver is not OF driver only its initaliziation code is
> run but the .probe function
> of the driver is never run. Basically (as far as I can understand) the
> .probe is never run because the
> driver is not an OF driver.
>
> I could convert the PCF8563 driver to OF driver and make it work for our
> puposes but I feel this is
> 1) Wrong
> 2) therefore wasted work.
Since the driver must run on non OF platforms then it should not be
converted. You just need to add a platform_device_register somewhere.
I don't think fsl_soc.c is the right place since it is not part of an
freescale SOC.
You could probably put it in a board specific startup routine.
What seems to elude me is some glue that glues together the OF part of the
> driver space to the non OF part
> of the driver space.
>
> Any hints or pointers on where to find this glue?
>
> Regards,
> kd
>
> P.S. Kernel is post 2.6.20.
>
> --
> Kári Davíðsson | kari.davidsson@marel.is
> Hugbúnaðargerð | www.marel.com
> Tel: 563-8156 Fax: +354 563 8001
> Iceland
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
[-- Attachment #2: Type: text/html, Size: 3482 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* about FCC of MPC8270
2007-07-03 16:31 ` John Rigby
@ 2007-07-04 4:24 ` li.chunlin
2007-07-04 5:42 ` Matvejchikov Ilya
2007-07-04 12:00 ` OF devices and non OF devices Kári Davíðsson
1 sibling, 1 reply; 11+ messages in thread
From: li.chunlin @ 2007-07-04 4:24 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
hello, every one
I have a board with mpc8270. And there are two ethernet interface by
fcc1 and fcc2. Now in linux kernel 2.6.14 fcc1 is ok, but fcc2 is some
wrong. I set loopback of fcc2 or rmii. that's ok. But i set loopback in
phy, it is wrong. But fcc2 is ok in u-boot.
I take a look with oscillograph. i find that there is signal from fcc2 to
phy and there is signal from phy to fcc2 in data pins. But fcc2 cannot
receive data and fcc2 can send data.
who know the reason? Can you tell me?
thanks.
lichunlin
--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. Any views expressed in this message are those of the individual sender.
This message has been scanned for viruses and Spam by ZTE Anti-Spam system.
[-- Attachment #2: Type: text/html, Size: 2088 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: about FCC of MPC8270
2007-07-04 4:24 ` about FCC of MPC8270 li.chunlin
@ 2007-07-04 5:42 ` Matvejchikov Ilya
2007-07-04 6:55 ` li.chunlin
0 siblings, 1 reply; 11+ messages in thread
From: Matvejchikov Ilya @ 2007-07-04 5:42 UTC (permalink / raw)
To: li.chunlin@zte.com.cn; +Cc: linuxppc-embedded
Hi!
Do you use CPM_FCC_SPECIAL_BASE constant? (include/asm-ppc/cpm2.h)
In my case (8250, 8260) FCCs only works when it is set to 0x3000...
2007/7/4, li.chunlin@zte.com.cn <li.chunlin@zte.com.cn>:
>
> hello, every one
>
> I have a board with mpc8270. And there are two ethernet interface by fcc1
> and fcc2. Now in linux kernel 2.6.14 fcc1 is ok, but fcc2 is some wrong. I
> set loopback of fcc2 or rmii. that's ok. But i set loopback in phy, it is
> wrong. But fcc2 is ok in u-boot.
>
> I take a look with oscillograph. i find that there is signal from fcc2 to
> phy and there is signal from phy to fcc2 in data pins. But fcc2 cannot
> receive data and fcc2 can send data.
>
> who know the reason? Can you tell me?
>
> thanks.
> lichunlin
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: about FCC of MPC8270
2007-07-04 5:42 ` Matvejchikov Ilya
@ 2007-07-04 6:55 ` li.chunlin
2007-07-04 7:02 ` Matvejchikov Ilya
0 siblings, 1 reply; 11+ messages in thread
From: li.chunlin @ 2007-07-04 6:55 UTC (permalink / raw)
To: matvejchikov; +Cc: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]
I use it. And it is: #define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
Hi!
Do you use CPM_FCC_SPECIAL_BASE constant? (include/asm-ppc/cpm2.h)
In my case (8250, 8260) FCCs only works when it is set to 0x3000...
2007/7/4, li.chunlin@zte.com.cn <li.chunlin@zte.com.cn>:
>
> hello, every one
>
> I have a board with mpc8270. And there are two ethernet interface by
fcc1
> and fcc2. Now in linux kernel 2.6.14 fcc1 is ok, but fcc2 is some wrong.
I
> set loopback of fcc2 or rmii. that's ok. But i set loopback in phy, it
is
> wrong. But fcc2 is ok in u-boot.
>
> I take a look with oscillograph. i find that there is signal from fcc2
to
> phy and there is signal from phy to fcc2 in data pins. But fcc2 cannot
> receive data and fcc2 can send data.
>
> who know the reason? Can you tell me?
>
> thanks.
> lichunlin
>
--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. Any views expressed in this message are those of the individual sender.
This message has been scanned for viruses and Spam by ZTE Anti-Spam system.
[-- Attachment #2: Type: text/html, Size: 2393 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: about FCC of MPC8270
2007-07-04 6:55 ` li.chunlin
@ 2007-07-04 7:02 ` Matvejchikov Ilya
2007-07-04 7:50 ` li.chunlin
0 siblings, 1 reply; 11+ messages in thread
From: Matvejchikov Ilya @ 2007-07-04 7:02 UTC (permalink / raw)
To: li.chunlin@zte.com.cn; +Cc: linuxppc-embedded
Try 0x3000
2007/7/4, li.chunlin@zte.com.cn <li.chunlin@zte.com.cn>:
>
> I use it. And it is: #define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
>
>
>
>
> Hi!
>
> Do you use CPM_FCC_SPECIAL_BASE constant? (include/asm-ppc/cpm2.h)
> In my case (8250, 8260) FCCs only works when it is set to 0x3000...
>
>
> 2007/7/4, li.chunlin@zte.com.cn <li.chunlin@zte.com.cn>:
> >
> > hello, every one
> >
> > I have a board with mpc8270. And there are two ethernet interface by
> fcc1
> > and fcc2. Now in linux kernel 2.6.14 fcc1 is ok, but fcc2 is some wrong.
> I
> > set loopback of fcc2 or rmii. that's ok. But i set loopback in phy, it is
> > wrong. But fcc2 is ok in u-boot.
> >
> > I take a look with oscillograph. i find that there is signal from fcc2 to
> > phy and there is signal from phy to fcc2 in data pins. But fcc2 cannot
> > receive data and fcc2 can send data.
> >
> > who know the reason? Can you tell me?
> >
> > thanks.
> > lichunlin
> >
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: about FCC of MPC8270
2007-07-04 7:02 ` Matvejchikov Ilya
@ 2007-07-04 7:50 ` li.chunlin
0 siblings, 0 replies; 11+ messages in thread
From: li.chunlin @ 2007-07-04 7:50 UTC (permalink / raw)
To: matvejchikov; +Cc: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]
Not ok with 0x3000
"Matvejchikov Ilya" <matvejchikov@gmail.com>
收件人: "li.chunlin@zte.com.cn" <li.chunlin@zte.com.cn>
抄送: linuxppc-embedded@ozlabs.org
主题: Re: about FCC of MPC8270
Try 0x3000
2007/7/4, li.chunlin@zte.com.cn <li.chunlin@zte.com.cn>:
>
> I use it. And it is: #define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
>
>
>
>
> Hi!
>
> Do you use CPM_FCC_SPECIAL_BASE constant? (include/asm-ppc/cpm2.h)
> In my case (8250, 8260) FCCs only works when it is set to 0x3000...
>
>
> 2007/7/4, li.chunlin@zte.com.cn <li.chunlin@zte.com.cn>:
> >
> > hello, every one
> >
> > I have a board with mpc8270. And there are two ethernet interface
by
> fcc1
> > and fcc2. Now in linux kernel 2.6.14 fcc1 is ok, but fcc2 is some
wrong.
> I
> > set loopback of fcc2 or rmii. that's ok. But i set loopback in phy,
it is
> > wrong. But fcc2 is ok in u-boot.
> >
> > I take a look with oscillograph. i find that there is signal from
fcc2 to
> > phy and there is signal from phy to fcc2 in data pins. But fcc2
cannot
> > receive data and fcc2 can send data.
> >
> > who know the reason? Can you tell me?
> >
> > thanks.
> > lichunlin
> >
--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. Any views expressed in this message are those of the individual sender.
This message has been scanned for viruses and Spam by ZTE Anti-Spam system.
[-- Attachment #2: Type: text/html, Size: 3572 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: OF devices and non OF devices
2007-07-03 16:31 ` John Rigby
2007-07-04 4:24 ` about FCC of MPC8270 li.chunlin
@ 2007-07-04 12:00 ` Kári Davíðsson
2007-07-05 13:28 ` John Rigby
1 sibling, 1 reply; 11+ messages in thread
From: Kári Davíðsson @ 2007-07-04 12:00 UTC (permalink / raw)
To: linuxppc-embedded
John, thank you for your answare.
Enabling CONFIG_FSL_SOC only enabled the execution of the init function =
(fsl_i2c_init())
of the fsl-i2c driver (i2c-mpc.c). The .probe function of the driver was =
never called
until I converted the driver to the OF model and added the .match_table =
to the driver structure.
Then I get the .probe function (fsl_i2c_probe()) called and the i2c bus =
set up.
Similar thing happens for the i2c device PCF8563 i.e., the init functin =
of the driver (pcf8563_init())
is called the driver is registered with the kernel, but the .probe =
(pcf8563_probe()) is never called.
The driver pcf8563 has _NO_ exported structures or functions so I =
basically have no handle on it
that I can utilize in board specific setup.
The way I suspect this is supposed to work is that from the board settup =
files I would do
rtc_dev =3D platform_device_register_simple("pcf8563", -1, NULL, 0);
which should later trigger the calling of the pcf8563_probe() function.
This is doing things in the same way as the fsl i2c code, i.e.
i2c_dev =3D platform_device_register_simple("i2c", i, r, 2);
which by the way does not work untill I have converted the fsl_i2c =
(i2c-mpc.c) driver to the OF structure.
So still the method of gluing together the OF drivers and non OF drivers =
eludes me.
rg
kd
P.S. I did check the 2.6.21-RC7-git3 and found that the i2c-mpc.c and =
the rtc-pcf85763.c are basically the same
as what I am working with in 2.6.20+=20
________________________________
From: John Rigby [mailto:jcrigby@gmail.com]=20
Sent: 3. j=FAl=ED 2007 16:31
To: K=E1ri Dav=ED=F0sson
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: OF devices and non OF devices
One place to find binding between OF devices and non OF devices is in =
arch/powerpc/sysdev/fsl_soc.c
The typical pattern is:
if of_find_compatible_node "of-device-name"
platform_device_register_simple ""platform-device-name"=20
platform_device_add_data ...
=20
On 7/3/07, K=E1ri Dav=ED=F0sson <kari.davidsson@marel.is> wrote:=20
Hi,
=09
I am attempting to get some non OF devices working for an mpc 5200 =
board, in particular=20
PCF8563 RTC.
=09
This device has an non OF device interface which I believe is correct. =
After all it should work
on non OF platforms.
=09
I have managed to get the board to run the i2c initialization (and =
probe) for the fsl-mpc i2c driver by=20
converting the fsl-mpc i2c driver to OF driver (I found some patch here =
that I based this work on).
fsl-i2c is one of the devices handled by fsl_soc.c so you shouldn't need =
to change anything to=20
make it work in the latest kernel. CONFIG_FSL_SOC was only added to =
lite5200_defconfig recently so=20
that may explain why it's not on in your kernel.
Since the PCF8563 driver is not OF driver only its initaliziation code =
is run but the .probe function
of the driver is never run. Basically (as far as I can understand) the =
.probe is never run because the
driver is not an OF driver.=20
=09
I could convert the PCF8563 driver to OF driver and make it work for =
our puposes but I feel this is
1) Wrong
2) therefore wasted work.
Since the driver must run on non OF platforms then it should not be =
converted. You just need to add a platform_device_register somewhere.=20
I don't think fsl_soc.c is the right place since it is not part of an =
freescale SOC.
You could probably put it in a board specific startup routine.
What seems to elude me is some glue that glues together the OF part of =
the driver space to the non OF part
of the driver space.
=09
Any hints or pointers on where to find this glue?
=09
Regards,
kd
=09
P.S. Kernel is post 2.6.20.
=09
--
K=E1ri Dav=ED=F0sson | kari.davidsson@marel.is
Hugb=FAna=F0arger=F0 | www.marel.com
Tel: 563-8156 Fax: +354 563 8001=20
Iceland
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
=09
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OF devices and non OF devices
2007-07-04 12:00 ` OF devices and non OF devices Kári Davíðsson
@ 2007-07-05 13:28 ` John Rigby
2007-07-05 17:20 ` John Rigby
0 siblings, 1 reply; 11+ messages in thread
From: John Rigby @ 2007-07-05 13:28 UTC (permalink / raw)
To: Kári Davíðsson; +Cc: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 4788 bytes --]
kd,
Ok, obviously It doesn't work the way I thought. Hopefully someone who does
understand this will comment.
John
On 7/4/07, Kári Davíðsson <kari.davidsson@marel.is> wrote:
>
> John, thank you for your answare.
>
> Enabling CONFIG_FSL_SOC only enabled the execution of the init function
> (fsl_i2c_init())
> of the fsl-i2c driver (i2c-mpc.c). The .probe function of the driver was
> never called
> until I converted the driver to the OF model and added the .match_table to
> the driver structure.
>
> Then I get the .probe function (fsl_i2c_probe()) called and the i2c bus
> set up.
>
> Similar thing happens for the i2c device PCF8563 i.e., the init functin of
> the driver (pcf8563_init())
> is called the driver is registered with the kernel, but the .probe
> (pcf8563_probe()) is never called.
>
> The driver pcf8563 has _NO_ exported structures or functions so I
> basically have no handle on it
> that I can utilize in board specific setup.
>
> The way I suspect this is supposed to work is that from the board settup
> files I would do
> rtc_dev = platform_device_register_simple("pcf8563", -1, NULL, 0);
> which should later trigger the calling of the pcf8563_probe() function.
>
> This is doing things in the same way as the fsl i2c code, i.e.
> i2c_dev = platform_device_register_simple("i2c", i, r, 2);
> which by the way does not work untill I have converted the fsl_i2c (
> i2c-mpc.c) driver to the OF structure.
>
> So still the method of gluing together the OF drivers and non OF drivers
> eludes me.
>
> rg
> kd
>
> P.S. I did check the 2.6.21-RC7-git3 and found that the i2c-mpc.c and the
> rtc-pcf85763.c are basically the same
> as what I am working with in 2.6.20+
> ________________________________
>
> From: John Rigby [mailto:jcrigby@gmail.com]
> Sent: 3. júlí 2007 16:31
> To: Kári Davíðsson
> Cc: linuxppc-embedded@ozlabs.org
> Subject: Re: OF devices and non OF devices
>
>
> One place to find binding between OF devices and non OF devices is in
> arch/powerpc/sysdev/fsl_soc.c
> The typical pattern is:
> if of_find_compatible_node "of-device-name"
> platform_device_register_simple ""platform-device-name"
> platform_device_add_data ...
>
>
>
> On 7/3/07, Kári Davíðsson <kari.davidsson@marel.is> wrote:
>
> Hi,
>
> I am attempting to get some non OF devices working for an mpc 5200
> board, in particular
> PCF8563 RTC.
>
> This device has an non OF device interface which I believe is
> correct. After all it should work
> on non OF platforms.
>
> I have managed to get the board to run the i2c initialization (and
> probe) for the fsl-mpc i2c driver by
> converting the fsl-mpc i2c driver to OF driver (I found some patch
> here that I based this work on).
>
>
> fsl-i2c is one of the devices handled by fsl_soc.c so you shouldn't need
> to change anything to
> make it work in the latest kernel. CONFIG_FSL_SOC was only added to
> lite5200_defconfig recently so
> that may explain why it's not on in your kernel.
>
>
>
> Since the PCF8563 driver is not OF driver only its initaliziation
> code is run but the .probe function
> of the driver is never run. Basically (as far as I can understand)
> the .probe is never run because the
> driver is not an OF driver.
>
> I could convert the PCF8563 driver to OF driver and make it work
> for our puposes but I feel this is
> 1) Wrong
> 2) therefore wasted work.
>
>
> Since the driver must run on non OF platforms then it should not be
> converted. You just need to add a platform_device_register somewhere.
> I don't think fsl_soc.c is the right place since it is not part of an
> freescale SOC.
> You could probably put it in a board specific startup routine.
>
>
>
> What seems to elude me is some glue that glues together the OF
> part of the driver space to the non OF part
> of the driver space.
>
> Any hints or pointers on where to find this glue?
>
> Regards,
> kd
>
> P.S. Kernel is post 2.6.20.
>
> --
> Kári Davíðsson | kari.davidsson@marel.is
> Hugbúnaðargerð | www.marel.com
> Tel: 563-8156 Fax: +354 563 8001
> Iceland
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
[-- Attachment #2: Type: text/html, Size: 7029 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: OF devices and non OF devices
2007-07-05 13:28 ` John Rigby
@ 2007-07-05 17:20 ` John Rigby
2007-07-18 11:13 ` Kári Davíðsson
0 siblings, 1 reply; 11+ messages in thread
From: John Rigby @ 2007-07-05 17:20 UTC (permalink / raw)
To: Kári Davíðsson; +Cc: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 6725 bytes --]
There must be something else wrong with your configuration.
On my Lite5200B fsl_i2c_probe gets called with no changes to the driver.
The kernel version is 2.6.22-rc7
The relevant part of my device tree is:
i2c@3d00 {
device_type = "i2c";
compatible = "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c";
cell-index = <0>;
reg = <3d00 40>;
interrupts = <2 f 0>;
interrupt-parent = <&mpc5200_pic>;
fsl5200-clocking;
};
i2c@3d40 {
device_type = "i2c";
compatible = "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c";
cell-index = <1>;
reg = <3d40 40>;
interrupts = <2 10 0>;
interrupt-parent = <&mpc5200_pic>;
fsl5200-clocking;
};
I turned on DEBUG in drivers/base/dd.c and a call to pr_debug in the probe
routine
and here are the relevant log messages:
[ 27.258245] platform: Matched Device fsl-i2c.0 with Driver fsl-i2c
[ 27.258269] platform: Probing driver fsl-i2c with device fsl-i2c.0
[ 27.258299] I2C: here in fsl_i2c_probe
[ 27.258732] bound device 'fsl-i2c.0' to driver 'fsl-i2c'
[ 27.258756] platform: Bound Device fsl-i2c.0 to Driver fsl-i2c
[ 27.258776] platform: Matched Device fsl-i2c.1 with Driver fsl-i2c
[ 27.258789] platform: Probing driver fsl-i2c with device fsl-i2c.1
[ 27.258821] I2C: here in fsl_i2c_probe
[ 27.259269] bound device 'fsl-i2c.1' to driver 'fsl-i2c'
[ 27.259293] platform: Bound Device fsl-i2c.1 to Driver fsl-i2c
John
On 7/5/07, John Rigby <jcrigby@gmail.com> wrote:
>
> kd,
>
> Ok, obviously It doesn't work the way I thought. Hopefully someone who
> does
> understand this will comment.
>
> John
>
> On 7/4/07, Kári Davíðsson <kari.davidsson@marel.is> wrote:
> >
> > John, thank you for your answare.
> >
> > Enabling CONFIG_FSL_SOC only enabled the execution of the init function
> > (fsl_i2c_init())
> > of the fsl-i2c driver (i2c-mpc.c). The .probe function of the driver was
> > never called
> > until I converted the driver to the OF model and added the .match_table
> > to the driver structure.
> >
> > Then I get the .probe function (fsl_i2c_probe()) called and the i2c bus
> > set up.
> >
> > Similar thing happens for the i2c device PCF8563 i.e., the init functin
> > of the driver (pcf8563_init())
> > is called the driver is registered with the kernel, but the .probe
> > (pcf8563_probe()) is never called.
> >
> > The driver pcf8563 has _NO_ exported structures or functions so I
> > basically have no handle on it
> > that I can utilize in board specific setup.
> >
> > The way I suspect this is supposed to work is that from the board settup
> > files I would do
> > rtc_dev = platform_device_register_simple("pcf8563", -1, NULL, 0);
> > which should later trigger the calling of the pcf8563_probe() function.
> >
> > This is doing things in the same way as the fsl i2c code, i.e.
> > i2c_dev = platform_device_register_simple("i2c", i, r, 2);
> > which by the way does not work untill I have converted the fsl_i2c (
> > i2c-mpc.c) driver to the OF structure.
> >
> > So still the method of gluing together the OF drivers and non OF drivers
> > eludes me.
> >
> > rg
> > kd
> >
> > P.S. I did check the 2.6.21-RC7-git3 and found that the i2c-mpc.c and
> > the rtc-pcf85763.c are basically the same
> > as what I am working with in 2.6.20+
> > ________________________________
> >
> > From: John Rigby [mailto: jcrigby@gmail.com]
> > Sent: 3. júlí 2007 16:31
> > To: Kári Davíðsson
> > Cc: linuxppc-embedded@ozlabs.org
> > Subject: Re: OF devices and non OF devices
> >
> >
> > One place to find binding between OF devices and non OF devices is in
> > arch/powerpc/sysdev/fsl_soc.c
> > The typical pattern is:
> > if of_find_compatible_node "of-device-name"
> > platform_device_register_simple ""platform-device-name"
> > platform_device_add_data ...
> >
> >
> >
> > On 7/3/07, Kári Davíðsson <kari.davidsson@marel.is> wrote:
> >
> > Hi,
> >
> > I am attempting to get some non OF devices working for an mpc
> > 5200 board, in particular
> > PCF8563 RTC.
> >
> > This device has an non OF device interface which I believe is
> > correct. After all it should work
> > on non OF platforms.
> >
> > I have managed to get the board to run the i2c initialization
> > (and probe) for the fsl-mpc i2c driver by
> > converting the fsl-mpc i2c driver to OF driver (I found some
> > patch here that I based this work on).
> >
> >
> > fsl-i2c is one of the devices handled by fsl_soc.c so you shouldn't need
> > to change anything to
> > make it work in the latest kernel. CONFIG_FSL_SOC was only added to
> > lite5200_defconfig recently so
> > that may explain why it's not on in your kernel.
> >
> >
> >
> > Since the PCF8563 driver is not OF driver only its
> > initaliziation code is run but the .probe function
> > of the driver is never run. Basically (as far as I can
> > understand) the .probe is never run because the
> > driver is not an OF driver.
> >
> > I could convert the PCF8563 driver to OF driver and make it work
> > for our puposes but I feel this is
> > 1) Wrong
> > 2) therefore wasted work.
> >
> >
> > Since the driver must run on non OF platforms then it should not be
> > converted. You just need to add a platform_device_register somewhere.
> > I don't think fsl_soc.c is the right place since it is not part of an
> > freescale SOC.
> > You could probably put it in a board specific startup routine.
> >
> >
> >
> > What seems to elude me is some glue that glues together the OF
> > part of the driver space to the non OF part
> > of the driver space.
> >
> > Any hints or pointers on where to find this glue?
> >
> > Regards,
> > kd
> >
> > P.S. Kernel is post 2.6.20.
> >
> > --
> > Kári Davíðsson | kari.davidsson@marel.is
> > Hugbúnaðargerð | www.marel.com
> > Tel: 563-8156 Fax: +354 563 8001
> > Iceland
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> >
> >
> >
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> >
>
>
[-- Attachment #2: Type: text/html, Size: 10840 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: OF devices and non OF devices
2007-07-05 17:20 ` John Rigby
@ 2007-07-18 11:13 ` Kári Davíðsson
0 siblings, 0 replies; 11+ messages in thread
From: Kári Davíðsson @ 2007-07-18 11:13 UTC (permalink / raw)
To: John Rigby; +Cc: linuxppc-embedded
Yes there was indeed.
Combination of my misunderstanding, device trees and board specific =
initialization.
Things are working now.
Thanks,
kd
________________________________
From: John Rigby [mailto:jcrigby@gmail.com]=20
Sent: 5. j=FAl=ED 2007 17:21
To: K=E1ri Dav=ED=F0sson
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: OF devices and non OF devices
There must be something else wrong with your configuration.
On my Lite5200B fsl_i2c_probe gets called with no changes to the driver.
The kernel version is 2.6.22-rc7
The relevant part of my device tree is:=20
i2c@3d00 {
device_type =3D "i2c";
compatible =3D "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c";
cell-index =3D <0>;
reg =3D <3d00 40>;=20
interrupts =3D <2 f 0>;
interrupt-parent =3D <&mpc5200_pic>;
fsl5200-clocking;
};
i2c@3d40 {
device_type =3D "i2c";=20
compatible =3D "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c";
cell-index =3D <1>;
reg =3D <3d40 40>;
interrupts =3D <2 10 0>;
interrupt-parent =3D <&mpc5200_pic>;=20
fsl5200-clocking;
};
I turned on DEBUG in drivers/base/dd.c and a call to pr_debug in the =
probe routine
and here are the relevant log messages:
[ 27.258245] platform: Matched Device fsl-i2c.0 with Driver fsl-i2c
[ 27.258269] platform: Probing driver fsl-i2c with device fsl-i2c.0
[ 27.258299] I2C: here in fsl_i2c_probe
[ 27.258732] bound device 'fsl-i2c.0' to driver 'fsl-i2c'=20
[ 27.258756] platform: Bound Device fsl-i2c.0 to Driver fsl-i2c
[ 27.258776] platform: Matched Device fsl-i2c.1 with Driver fsl-i2c
[ 27.258789] platform: Probing driver fsl-i2c with device fsl-i2c.1
[ 27.258821] I2C: here in fsl_i2c_probe
[ 27.259269] bound device 'fsl-i2c.1' to driver 'fsl-i2c'
[ 27.259293] platform: Bound Device fsl-i2c.1 to Driver fsl-i2c
John
On 7/5/07, John Rigby <jcrigby@gmail.com> wrote:=20
kd,
=09
Ok, obviously It doesn't work the way I thought. Hopefully someone who =
does
understand this will comment.
=09
John=20
=09
=09
=09
On 7/4/07, K=E1ri Dav=ED=F0sson <kari.davidsson@marel.is> wrote:=20
John, thank you for your answare.
=09
Enabling CONFIG_FSL_SOC only enabled the execution of the init =
function (fsl_i2c_init())
of the fsl-i2c driver (i2c-mpc.c). The .probe function of the driver =
was never called
until I converted the driver to the OF model and added the =
.match_table to the driver structure.
=09
Then I get the .probe function (fsl_i2c_probe()) called and the i2c =
bus set up.
=09
Similar thing happens for the i2c device PCF8563 i.e., the init =
functin of the driver (pcf8563_init())
is called the driver is registered with the kernel, but the .probe =
(pcf8563_probe()) is never called.
=09
The driver pcf8563 has _NO_ exported structures or functions so I =
basically have no handle on it=20
that I can utilize in board specific setup.
=09
The way I suspect this is supposed to work is that from the board =
settup files I would do
rtc_dev =3D platform_device_register_simple("pcf8563", -1, NULL, 0);=20
which should later trigger the calling of the pcf8563_probe() =
function.
=09
This is doing things in the same way as the fsl i2c code, i.e.
i2c_dev =3D platform_device_register_simple("i2c", i, r, 2);
which by the way does not work untill I have converted the fsl_i2c =
(i2c-mpc.c) driver to the OF structure.
=09
So still the method of gluing together the OF drivers and non OF =
drivers eludes me.
=09
rg
kd
=09
P.S. I did check the 2.6.21-RC7-git3 and found that the i2c-mpc.c and =
the rtc-pcf85763.c are basically the same
as what I am working with in 2.6.20+
________________________________
=09
From: John Rigby [mailto: jcrigby@gmail.com]
Sent: 3. j=FAl=ED 2007 16:31
To: K=E1ri Dav=ED=F0sson
Cc: linuxppc-embedded@ozlabs.org=20
Subject: Re: OF devices and non OF devices
=09
=09
One place to find binding between OF devices and non OF devices is in =
arch/powerpc/sysdev/fsl_soc.c=20
The typical pattern is:
if of_find_compatible_node "of-device-name"
platform_device_register_simple ""platform-device-name"
platform_device_add_data ...
=09
=09
=09
On 7/3/07, K=E1ri Dav=ED=F0sson <kari.davidsson@marel.is> wrote:
=09
Hi,
=09
I am attempting to get some non OF devices working for an mpc =
5200 board, in particular=20
PCF8563 RTC.
=09
This device has an non OF device interface which I believe is =
correct. After all it should work
on non OF platforms.
=09
I have managed to get the board to run the i2c initialization =
(and probe) for the fsl-mpc i2c driver by=20
converting the fsl-mpc i2c driver to OF driver (I found some =
patch here that I based this work on).
=09
=09
fsl-i2c is one of the devices handled by fsl_soc.c so you shouldn't =
need to change anything to=20
make it work in the latest kernel. CONFIG_FSL_SOC was only added to =
lite5200_defconfig recently so
that may explain why it's not on in your kernel.
=09
=09
=09
Since the PCF8563 driver is not OF driver only its =
initaliziation code is run but the .probe function=20
of the driver is never run. Basically (as far as I can =
understand) the .probe is never run because the
driver is not an OF driver.
=09
I could convert the PCF8563 driver to OF driver and make it =
work for our puposes but I feel this is=20
1) Wrong
2) therefore wasted work.
=09
=09
Since the driver must run on non OF platforms then it should not be =
converted. You just need to add a platform_device_register somewhere.
I don't think fsl_soc.c is the right place since it is not part of an =
freescale SOC.=20
You could probably put it in a board specific startup routine.
=09
=09
=09
What seems to elude me is some glue that glues together the OF =
part of the driver space to the non OF part
of the driver space.=20
=09
Any hints or pointers on where to find this glue?
=09
Regards,
kd
=09
P.S. Kernel is post 2.6.20.
=09
--
K=E1ri Dav=ED=F0sson | =
kari.davidsson@marel.is
Hugb=FAna=F0arger=F0 | www.marel.com
Tel: 563-8156 Fax: +354 563 8001=20
Iceland
_______________________________________________=20
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded =
<https://ozlabs.org/mailman/listinfo/linuxppc-embedded>=20
=09
=09
=09
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
=09
=09
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-07-18 11:13 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 14:54 OF devices and non OF devices Kári Davíðsson
2007-07-03 16:31 ` John Rigby
2007-07-04 4:24 ` about FCC of MPC8270 li.chunlin
2007-07-04 5:42 ` Matvejchikov Ilya
2007-07-04 6:55 ` li.chunlin
2007-07-04 7:02 ` Matvejchikov Ilya
2007-07-04 7:50 ` li.chunlin
2007-07-04 12:00 ` OF devices and non OF devices Kári Davíðsson
2007-07-05 13:28 ` John Rigby
2007-07-05 17:20 ` John Rigby
2007-07-18 11:13 ` Kári Davíðsson
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).