linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Li Yang <leoli@freescale.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 5/6] powerpc: add USB peripheral support to MPC836xMDS
Date: Wed, 6 Aug 2008 16:07:47 +0400	[thread overview]
Message-ID: <20080806120747.GA7717@polina.dev.rtsoft.ru> (raw)
In-Reply-To: <1218006285-27138-5-git-send-email-leoli@freescale.com>

Hello Li,

On Wed, Aug 06, 2008 at 03:04:44PM +0800, Li Yang wrote:
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
>  arch/powerpc/boot/dts/mpc836x_mds.dts     |   15 ++++++-
>  arch/powerpc/platforms/83xx/mpc836x_mds.c |   19 ++++++++-
>  arch/powerpc/platforms/83xx/mpc83xx.h     |    1 +
>  arch/powerpc/platforms/83xx/usb.c         |   67 +++++++++++++++++++++++++++++
>  4 files changed, 100 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
> index a3b76a7..596377b 100644
> --- a/arch/powerpc/boot/dts/mpc836x_mds.dts
> +++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
> @@ -235,6 +235,17 @@
>  					0  2  1  0  1  0>; /* MDC */
>  			};
>  
> +			pio_usb: usb_pin@01 {
> +				pio-map = <
> +			/* port  pin  dir  open_drain  assignment  has_irq */
> +					1  2  1  0  3  0        /* USBOE  */
> +					1  3  1  0  3  0        /* USBTP  */
> +					1  8  1  0  1  0        /* USBTN  */
> +					1 10  2  0  3  0        /* USBRXD */
> +					1  9  2  1  3  0        /* USBRP  */
> +					1 11  2  1  3  0>;      /* USBRN  */
> +			};
> +
>  		};
>  	};
>  
> @@ -280,11 +291,13 @@
>  		};
>  
>  		usb@6c0 {
> -			compatible = "qe_udc";
> +			compatible = "fsl,qe_udc";

You might want to reuse existing bindings as described in
Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt.

>  			reg = <0x6c0 0x40 0x8b00 0x100>;
>  			interrupts = <11>;
>  			interrupt-parent = <&qeic>;
>  			mode = "slave";

I'd suggest to rename this to "peripheral" as we use for fsl dual-role
usb controller.

> +			usb-clock = <21>;
> +			pio-handle = <&pio_usb>;

Can we not introduce new pio maps? The pio setup should be done
by the firmware, or at least fixed up via the board file, as in
arch/powerpc/platforms/83xx/mpc832x_rdb.c.

[...]
> +#ifdef CONFIG_QUICC_ENGINE
> +/* QE USB_CLOCK configure functions */
> +int qe_usb_clock_set(struct device_node *np)

We already have this function, in arch/powerpc/sysdev/qe_lib/usb.c

It does not parse any of properties though, driver should do this.

> +{
> +	u32 tmpreg = 0;
> +	struct qe_mux *qemux = NULL;
> +	const int *clock;
> +
> +	qemux = &qe_immr->qmx;
> +
> +	clock = of_get_property(np, "usb-clock", NULL);
> +	if (!clock)
> +		return -EINVAL;
> +
> +	/* CLK21 -> USBCLK on MPC8360-PB*/
> +	tmpreg = in_be32(&qemux->cmxgcr) & ~QE_CMXGCR_USBCS;
> +	switch (*clock) {
> +	case 21:
> +		tmpreg |= 0x8;
> +		out_be32(&qemux->cmxgcr, tmpreg);
> +		par_io_config_pin(2, 20, 2, 0, 1, 0);  /* PC20 for CLK21 */

No, pio config is very board-specific. This should be done by the
firmware (ideally) or by the board file.

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  parent reply	other threads:[~2008-08-06 12:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06  7:04 [PATCH 1/6] powerpc: update flash size and partition in mpc8272ads dts Li Yang
2008-08-06  7:04 ` [PATCH 2/6] powerpc: export cpm2_immr symbol for CPM2 drivers to compile as module Li Yang
2008-08-06  7:04   ` [PATCH 3/6] powerpc: update QE/CPM2 headers for USB support Li Yang
2008-08-06  7:04     ` [PATCH 4/6] powerpc: add USB peripheral support to MPC8272ADS Li Yang
2008-08-06  7:04       ` [PATCH 5/6] powerpc: add USB peripheral support to MPC836xMDS Li Yang
2008-08-06  7:04         ` [PATCH 6/6] powerpc: add 82xx platform level support to SEC engine Li Yang
2008-08-06 17:27           ` Scott Wood
2008-08-06  7:50         ` [PATCH 5/6] powerpc: add USB peripheral support to MPC836xMDS Stephen Rothwell
2008-08-06 12:07         ` Anton Vorontsov [this message]
2008-08-07  9:31           ` Li Yang
2008-08-07 13:23             ` Anton Vorontsov
2008-08-06 17:29         ` Scott Wood
2008-08-07  3:32           ` Li Yang
2008-08-06  7:48       ` [PATCH 4/6] powerpc: add USB peripheral support to MPC8272ADS Stephen Rothwell
2008-08-06 17:19       ` Scott Wood
2008-08-07  3:50         ` Li Yang
2008-08-07 14:19           ` Scott Wood
2008-08-06 15:24   ` [PATCH 2/6] powerpc: export cpm2_immr symbol for CPM2 drivers to compile as module Anton Vorontsov
2008-08-07 10:19     ` Li Yang
2008-08-07 11:38       ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080806120747.GA7717@polina.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=leoli@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).