From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by ozlabs.org (Postfix) with ESMTP id C5500DDE3D for ; Wed, 4 Jul 2007 02:31:01 +1000 (EST) Received: by an-out-0708.google.com with SMTP id c37so360417anc for ; Tue, 03 Jul 2007 09:31:00 -0700 (PDT) Message-ID: <4b73d43f0707030931v42aefc72x2598546e48ae87e8@mail.gmail.com> Date: Tue, 3 Jul 2007 10:31:00 -0600 From: "John Rigby" To: "=?ISO-8859-1?Q?K=E1ri_Dav=ED=F0sson?=" Subject: Re: OF devices and non OF devices In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_113345_11808954.1183480260155" References: Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_113345_11808954.1183480260155 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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=E1ri Dav=ED=F0sson 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=E1ri Dav=ED=F0sson | kari.davidsson@marel.is > Hugb=FAna=F0arger=F0 | 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 > ------=_Part_113345_11808954.1183480260155 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline One place to find binding between OF devices and non OF devices is in arch/= powerpc/sysdev/fsl_soc.c
The typical pattern is:
    i= f of_find_compatible_node "of-device-name"
   &= nbsp;    platform_device_register_simple ""platfor= m-device-name"
        platform_device_add_data ...=

 
On 7/3/07, K=E1ri Dav=ED=F0sson <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 dev= ices 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 r= un 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 fo= r our puposes but I feel this is
1) Wrong
2) therefore wasted work.

Since the driver must run on non OF platforms then it s= hould not be converted.  You just need to add a platform_device_regist= er somewhere.
I don't think fsl_soc.c is  the right place since it is not pa= rt of an freescale SOC.
You could probably put it in a board specific st= artup 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. Ker= nel is post=20 2.6.20.

--
K=E1ri Dav=ED=F0sson     &nbs= p;             = | kari.davidsson@marel.isHugb=FAna=F0arger=F0         =           | www.marel.com
Tel: 563-8156 Fax: +354 563 8001
Iceland
_______________________________________________
Linuxppc-= embedded mailing list
Li= nuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
<= /div>
------=_Part_113345_11808954.1183480260155--