From patchwork Wed Feb 29 12:41:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sangwook X-Patchwork-Id: 7000 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D2C2C23E48 for ; Wed, 29 Feb 2012 12:43:32 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 92CB0A18115 for ; Wed, 29 Feb 2012 12:43:32 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so3199906iag.11 for ; Wed, 29 Feb 2012 04:43:32 -0800 (PST) Received: from mr.google.com ([10.42.131.129]) by 10.42.131.129 with SMTP id z1mr19396ics.53.1330519412439 (num_hops = 1); Wed, 29 Feb 2012 04:43:32 -0800 (PST) Received: by 10.42.131.129 with SMTP id z1mr15647ics.53.1330519412384; Wed, 29 Feb 2012 04:43:32 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp2177ibg; Wed, 29 Feb 2012 04:43:31 -0800 (PST) Received: by 10.216.134.30 with SMTP id r30mr40150wei.42.1330519410087; Wed, 29 Feb 2012 04:43:30 -0800 (PST) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id bs13si16109146wib.8.2012.02.29.04.43.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Feb 2012 04:43:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of sangwook.lee@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of sangwook.lee@linaro.org) smtp.mail=sangwook.lee@linaro.org Received: by wibhm14 with SMTP id hm14so5647704wib.37 for ; Wed, 29 Feb 2012 04:43:29 -0800 (PST) Received-SPF: pass (google.com: domain of sangwook.lee@linaro.org designates 10.180.91.227 as permitted sender) client-ip=10.180.91.227; Received: from mr.google.com ([10.180.91.227]) by 10.180.91.227 with SMTP id ch3mr427217wib.17.1330519409689 (num_hops = 1); Wed, 29 Feb 2012 04:43:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.91.227 with SMTP id ch3mr347804wib.17.1330519409599; Wed, 29 Feb 2012 04:43:29 -0800 (PST) Received: from localhost.localdomain (host109-145-96-242.range109-145.btcentralplus.com. [109.145.96.242]) by mx.google.com with ESMTPS id bg3sm35014523wib.10.2012.02.29.04.43.27 (version=SSLv3 cipher=OTHER); Wed, 29 Feb 2012 04:43:29 -0800 (PST) From: Sangwook Lee To: linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: ben-linux@fluff.org, gregkh@suse.de, kgene.kim@samsung.com, stern@rowland.harvard.edu, jg1.han@samsung.com, jy0922.shim@samsung.com, patches@linaro.org, linaro-dev@lists.linaro.org, linux@arm.linux.org.uk, Sangwook Lee Subject: [PATCH 1/2] ARM: EXYNOS: Add EHCI AHB burst function Date: Wed, 29 Feb 2012 12:41:22 +0000 Message-Id: <1330519283-4722-2-git-send-email-sangwook.lee@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1330519283-4722-1-git-send-email-sangwook.lee@linaro.org> References: <1330519283-4722-1-git-send-email-sangwook.lee@linaro.org> X-Gm-Message-State: ALoCoQluOHooTewrEBeBWUZo5o77Fol6Vv1jZTLM1cEnHtGAyFLlnMQOrwMqqA90txzrSyh7Wwch Enable burst transfer from AHB for EHCI. This fixes data transfer of USB Ethernet with EHCI. Without this patch, scp hardly works. Signed-off-by: Sangwook Lee --- arch/arm/mach-exynos/setup-usb-phy.c | 6 ++++++ arch/arm/plat-samsung/devs.c | 2 ++ arch/arm/plat-samsung/include/plat/ehci.h | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c index 41743d2..5a20460 100644 --- a/arch/arm/mach-exynos/setup-usb-phy.c +++ b/arch/arm/mach-exynos/setup-usb-phy.c @@ -18,6 +18,7 @@ #include #include #include +#include static atomic_t host_usage; @@ -149,3 +150,8 @@ int s5p_usb_phy_exit(struct platform_device *pdev, int type) return -EINVAL; } + +void s5p_ehci_burst_enable(struct platform_device *pdev, void __iomem *base) +{ + writel(EHCI_INSNREG00_ENABLE_BURST, base + EHCI_INSNREG00); +} diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index f10768e..8fd1bd3 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c @@ -1402,6 +1402,8 @@ void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd) npd->phy_init = s5p_usb_phy_init; if (!npd->phy_exit) npd->phy_exit = s5p_usb_phy_exit; + if (!npd->burst_enable) + npd->burst_enable = s5p_ehci_burst_enable; } #endif /* CONFIG_S5P_DEV_USB_EHCI */ diff --git a/arch/arm/plat-samsung/include/plat/ehci.h b/arch/arm/plat-samsung/include/plat/ehci.h index 5f28cae..9c866b7 100644 --- a/arch/arm/plat-samsung/include/plat/ehci.h +++ b/arch/arm/plat-samsung/include/plat/ehci.h @@ -14,8 +14,27 @@ struct s5p_ehci_platdata { int (*phy_init)(struct platform_device *pdev, int type); int (*phy_exit)(struct platform_device *pdev, int type); + void (*burst_enable)(struct platform_device *pdev, void __iomem *base); }; extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); +extern void s5p_ehci_burst_enable(struct platform_device *pdev, + void __iomem *base); + +/* EHCI EXYNOS specific register */ +#define EHCI_INSNREG00 0x90 + +/* + * EHCI INSNREG00 Specific fields + * Enable AHB master to use burst transfer from 4 to 16 + */ +#define EHCI_INSNREG00_ENABLE_INCR16 (1 << 25) +#define EHCI_INSNREG00_ENABLE_INCR8 (1 << 24) +#define EHCI_INSNREG00_ENABLE_INCR4 (1 << 23) +/* Force AHB master to start burst transfer only for 4,8,16 alignment */ +#define EHCI_INSNREG00_ENABLE_INCRX_ALIGN (1 << 22) +#define EHCI_INSNREG00_ENABLE_BURST \ + (EHCI_INSNREG00_ENABLE_INCR16 | EHCI_INSNREG00_ENABLE_INCR8 | \ + EHCI_INSNREG00_ENABLE_INCR4 | EHCI_INSNREG00_ENABLE_INCRX_ALIGN) #endif /* __PLAT_SAMSUNG_EHCI_H */