From patchwork Thu Apr 4 23:05:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2395401 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E0C6FDFE76 for ; Thu, 4 Apr 2013 23:06:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764778Ab3DDXGe (ORCPT ); Thu, 4 Apr 2013 19:06:34 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:60982 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764500Ab3DDXGa (ORCPT ); Thu, 4 Apr 2013 19:06:30 -0400 Received: by mail-la0-f43.google.com with SMTP id ek20so2979569lab.16 for ; Thu, 04 Apr 2013 16:06:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:from:organization:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=FZazVRgeKklQG97nRwHRQV2khzDMWCumhpsUY6Lx/Yk=; b=iNtgFmeaoNE+cpWUBELbwZedGCBBueNtuYcL/ekHnl8RzeU0Vb2v5vRob9DCS0VSgv pVt/2qLLUhcs3s82h3V4k5ijTRDQWlYdJX5P9QiqqmqQbhio/FfJaxmpF7eczCCNy0Ke tGV+UBB9uoZ7rxAuwEvRcMNdqTASKSqAFk4pQ+hIerQuwYvoZbNZuDBw9XL3tBDB9FxY /E5suV0L2kdaDQRh3UHw5Fk3ztxifdgifprwaU3gywulbX0W2YWGmNs0yIwqPFoIpUVh 3zBwQ3EuKE7OcI0asC46IRte2ZAo1zni9Aj2JIG82AA1qi/b2chMzvUYawCZO2LBGYnN COGg== X-Received: by 10.112.10.102 with SMTP id h6mr4450565lbb.75.1365116788383; Thu, 04 Apr 2013 16:06:28 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-100-82.pppoe.mtu-net.ru. [91.79.100.82]) by mx.google.com with ESMTPS id h7sm4595704lbp.16.2013.04.04.16.06.26 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 16:06:27 -0700 (PDT) To: horms@verge.net.au, magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, balbi@ti.com Subject: [PATCH 5/8] rcar-phy: correct base address From: Sergei Shtylyov Organization: Cogent Embedded Date: Fri, 5 Apr 2013 03:05:14 +0400 MIME-Version: 1.0 Message-Id: <201304050305.15517.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQn27Kde6ayZdHosB/h3asIE9c9J5qn1hlgti8jEp+K63PEjS7RqSoBAi+IZ69Fj+SyDYHLz Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org The memory region that is used by the driver overlaps EHCI and OHCI register regions for absolutely no reason now -- fix it by adding offset of 0x800 to the base address, changing the register #define's accordingly. This has extra positive effect that we now can use devm_ioremap_resource(). Signed-off-by: Sergei Shtylyov --- arch/arm/mach-shmobile/setup-r8a7779.c | 2 +- drivers/usb/phy/rcar-phy.c | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 19 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c =================================================================== --- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c +++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c @@ -401,7 +401,7 @@ static struct platform_device sata_devic /* USB PHY */ static struct resource usb_phy_resources[] = { [0] = { - .start = 0xffe70000, + .start = 0xffe70800, .end = 0xffe70900 - 1, .flags = IORESOURCE_MEM, }, Index: renesas/drivers/usb/phy/rcar-phy.c =================================================================== --- renesas.orig/drivers/usb/phy/rcar-phy.c +++ renesas/drivers/usb/phy/rcar-phy.c @@ -16,13 +16,13 @@ #include #include -/* USBH common register */ -#define USBPCTRL0 0x0800 -#define USBPCTRL1 0x0804 -#define USBST 0x0808 -#define USBEH0 0x080C -#define USBOH0 0x081C -#define USBCTL0 0x0858 +/* REGS block */ +#define USBPCTRL0 0x00 +#define USBPCTRL1 0x04 +#define USBST 0x08 +#define USBEH0 0x0C +#define USBOH0 0x1C +#define USBCTL0 0x58 /* USBPCTRL1 */ #define PHY_RST (1 << 2) @@ -139,17 +139,9 @@ static int rcar_usb_phy_probe(struct pla return -EINVAL; } - /* - * CAUTION - * - * Because this phy address is also mapped under OHCI/EHCI address area, - * this driver can't use devm_request_and_ioremap(dev, res) here - */ - reg0 = devm_ioremap_nocache(dev, res0->start, resource_size(res0)); - if (!reg0) { - dev_err(dev, "ioremap error\n"); - return -ENOMEM; - } + reg0 = devm_ioremap_resource(dev, res0); + if (IS_ERR(reg0)) + return PTR_ERR(reg0); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) {