Re: [PATCH v2] usb: ehci-sh: Add PHY init function with platform data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
CC: Shimoda Yoshihiro <yoshihiro.shimoda.uh@xxxxxxxxxxx>

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?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux