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.249]) by ozlabs.org (Postfix) with ESMTP id 14DEEDE0DE for ; Sun, 8 Jul 2007 10:34:36 +1000 (EST) Received: by an-out-0708.google.com with SMTP id c37so99809anc for ; Sat, 07 Jul 2007 17:34:35 -0700 (PDT) Message-ID: <4b73d43f0707071734yeedd7e6g53101d45fbec899e@mail.gmail.com> Date: Sat, 7 Jul 2007 18:34:35 -0600 From: "John Rigby" To: "Grant Likely" Subject: Re: [PATCH] Add USB support to mpc8349-mitx board port In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_163080_15369149.1183854875180" References: <20070706222909.19943.39455.stgit@trillian.secretlab.ca> <200707070148.20526.arnd@arndb.de> Cc: linuxppc-dev@ozlabs.org, leoli@freescale.com, paulus@samba.org, Timur Tabi , Arnd Bergmann List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_163080_15369149.1183854875180 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/6/07, Grant Likely wrote: > > On 7/6/07, Arnd Bergmann wrote: > > On Saturday 07 July 2007, Grant Likely wrote: > > > --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c > > > +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c > > > @@ -63,6 +63,8 @@ static void __init mpc834x_itx_setup_arch(void) > > > > > > ppc_md.pci_exclude_device = mpc83xx_exclude_device; > > > #endif > > > + > > > +mpc834x_usb_cfg(); > > > } > > > > Why is that necessary? Shouldn't there be an of_platform_driver that > > simply does all the setup automatically if the device is present? > > This call is actually for SoC setup stuff. There are actually 2 USB > engines on the SoC, and this call figures out what mode the pins are > supposed to be in. I think this stuff firmly falls into the platform > setup arena since it is highly chip specific. > > You bring up a good point though. The current usb support code in > sysdev/fsl_soc.c uses arch_initcall(fsl_usb_of_init) to go searching > for USB interfaces in the device tree, which are EHCI (and sometimes > OTG) compatible. fsl_usb_of_init calls > platform_device_register_simple() for each USB device found which is > kind of a round about way of doing things. That should probably be > depreciated and an of_platform_device binding should be added to the > EHCI driver. > > This same comment probably goes for the other arch_initcall functions > in fsl_soc.c which do exactly the same thing for other devices. This depends, some devices in fsl_soc.c may exist on non-powerpc SoCs that do not have OF. The USB core in 8349 for example also is in the arm based mx27 and mx31. These devices should remain platform devices and the glue in fls_soc.c will continure to be needed. Cheers, > g. > > -- > Grant Likely, B.Sc., P.Eng. > Secret Lab Technologies Ltd. > grant.likely@secretlab.ca > (403) 399-0195 > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev > ------=_Part_163080_15369149.1183854875180 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 7/6/07, Grant Likely <grant.likely@secretlab.ca> wrote:
On 7/6/07, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 07 July 2007, Grant Likely wrote:
> > --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
> > +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
> > @@ -63,6 +63,8 @@ static void __init mpc834x_itx_setup_arch(void)
> >
> > ppc_md.pci_exclude_device = mpc83xx_exclude_device;
> > #endif
> > +
> > +mpc834x_usb_cfg();
> > }
>
> Why is that necessary? Shouldn't there be an of_platform_driver that
> simply does all the setup automatically if the device is present?

This call is actually for SoC setup stuff.  There are actually 2 USB
engines on the SoC, and this call figures out what mode the pins are
supposed to be in.  I think this stuff firmly falls into the platform
setup arena since it is highly chip specific.

You bring up a good point though.  The current usb support code in
sysdev/fsl_soc.c uses arch_initcall(fsl_usb_of_init) to go searching
for USB interfaces in the device tree, which are EHCI (and sometimes
OTG) compatible.  fsl_usb_of_init calls
platform_device_register_simple() for each USB device found which is
kind of a round about way of doing things.  That should probably be
depreciated and an of_platform_device binding should be added to the
EHCI driver.

This same comment probably goes for the other arch_initcall functions
in fsl_soc.c which do exactly the same thing for other devices.

This depends,  some devices in fsl_soc.c may exist on non-powerpc SoCs
that do not have OF.  The USB core in 8349 for example also is in the
arm based mx27 and mx31.  These devices should remain platform devices
and the glue in fls_soc.c will continure to be needed.


Cheers,
g.

--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

------=_Part_163080_15369149.1183854875180--