All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH v2] usb: ehci-sh: Add PHY init function with platform data
Date: Fri, 23 Mar 2012 04:38:38 +0000	[thread overview]
Message-ID: <4F6BFE4E.9040506@renesas.com> (raw)
In-Reply-To: <1332312420-31674-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>

Paul Mundt さんは書きました:
> On Wed, Mar 21, 2012 at 03:47:00PM +0900, Nobuhiro Iwamatsu wrote:
>> In devices using ehci-sh, initialization of the PHY may be necessary.
>> This adds platform data to ehci-sh and provide function to initialize PHY.
>>
>> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>> CC: Shimoda Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
> 
> It's impossible to say whether this makes sense or not without first
> seeing what you are trying to do in the callback.
> 

For example, it is necessary to initialize it after having
ebabled clock of ehci in sh7734.
I perform initialization CPU specific in callback.
For example, following.

/* USB */
#define USBPCTRL1		0xFFE70804
#define USBST			0xFFE70808
#define USBEH0			0xFFE7080C
#define USBOH0			0xFFE7081C
#define USBCTL0			0xFFE70858

#define USBPCTRL1_RST       (1 << 31)
#define USBPCTRL1_PHYENB    (1 << 0)
#define USBPCTRL1_PLLENB    (1 << 1)
#define USBPCTRL1_PHYRST    (1 << 2)
#define USBST_ACT           (1 << 31)
define USBST_PPL           (1 << 30)
#define USBCTL0_CLKSEL      (1 << 7)

static void usb_ehci_phy_init(void)
{
	/* Init check */
	if (__raw_readl(USBPCTRL1) & USBPCTRL1_PHYRST)
		return;

	__raw_writel(USBPCTRL1_RST, USBPCTRL1);
	__raw_writel(0, USBPCTRL1);

	__raw_writel(USBPCTRL1_PHYENB, USBPCTRL1);
	__raw_writel(__raw_readl(USBPCTRL1)|USBPCTRL1_PLLENB, USBPCTRL1);
	while (__raw_readl(USBST) != (USBST_ACT|USBST_PPL))
		cpu_relax();

	__raw_writel(__raw_readl(USBPCTRL1) | USBPCTRL1_PHYRST, USBPCTRL1);
}

Should I move this by initialization of board?

  parent reply	other threads:[~2012-03-23  4:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21  6:47 [PATCH v2] usb: ehci-sh: Add PHY init function with platform data Nobuhiro Iwamatsu
2012-03-21  6:58 ` Paul Mundt
2012-03-23  4:38 ` Nobuhiro Iwamatsu [this message]
2012-03-23  7:18 ` Paul Mundt
2012-04-12  1:54 ` Nobuhiro Iwamatsu

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=4F6BFE4E.9040506@renesas.com \
    --to=nobuhiro.iwamatsu.yj@renesas.com \
    --cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.