| From 506b69e1654ef414cbe6b6cc77a0b1b4bde48b27 Mon Sep 17 00:00:00 2001 |
| From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
| Date: Sun, 2 Jun 2013 01:37:01 +0400 |
| Subject: ARM: shmobile: r8a7779: setup EHCI internal buffer |
| |
| Setup the EHCI internal buffer (before EHCI driver has a chance to touch the |
| registers) using the pre_setup() method in 'struct usb_ehci_pdata'. |
| |
| The patch has been tested on the Marzen board. |
| |
| Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
| Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| (cherry picked from commit 84a812da09887a473f596a107096e8e1671505c9) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| arch/arm/mach-shmobile/setup-r8a7779.c | 16 ++++++++++++++++ |
| 1 file changed, 16 insertions(+) |
| |
| diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c |
| index a57495bd..09876545 100644 |
| --- a/arch/arm/mach-shmobile/setup-r8a7779.c |
| +++ b/arch/arm/mach-shmobile/setup-r8a7779.c |
| @@ -33,6 +33,7 @@ |
| #include <linux/sh_timer.h> |
| #include <linux/dma-mapping.h> |
| #include <linux/usb/otg.h> |
| +#include <linux/usb/hcd.h> |
| #include <linux/usb/ehci_pdriver.h> |
| #include <linux/usb/ohci_pdriver.h> |
| #include <linux/pm_runtime.h> |
| @@ -435,10 +436,25 @@ static void usb_power_off(struct platform_device *pdev) |
| pm_runtime_disable(&pdev->dev); |
| } |
| |
| +static int ehci_init_internal_buffer(struct usb_hcd *hcd) |
| +{ |
| + /* |
| + * Below are recommended values from the datasheet; |
| + * see [USB :: Setting of EHCI Internal Buffer]. |
| + */ |
| + /* EHCI IP internal buffer setting */ |
| + iowrite32(0x00ff0040, hcd->regs + 0x0094); |
| + /* EHCI IP internal buffer enable */ |
| + iowrite32(0x00000001, hcd->regs + 0x009C); |
| + |
| + return 0; |
| +} |
| + |
| static struct usb_ehci_pdata ehcix_pdata = { |
| .power_on = usb_power_on, |
| .power_off = usb_power_off, |
| .power_suspend = usb_power_off, |
| + .pre_setup = ehci_init_internal_buffer, |
| }; |
| |
| static struct resource ehci0_resources[] = { |
| -- |
| 1.8.4.3.gca3854a |
| |