From patchwork Sat Jun 1 21:50:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2649011 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 29C8DDFE76 for ; Sat, 1 Jun 2013 21:50:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756078Ab3FAVuT (ORCPT ); Sat, 1 Jun 2013 17:50:19 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:46030 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756026Ab3FAVuS (ORCPT ); Sat, 1 Jun 2013 17:50:18 -0400 Received: by mail-lb0-f169.google.com with SMTP id 10so2734377lbf.0 for ; Sat, 01 Jun 2013 14:50:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=azrnOVHzg6wxtnHg4QXNgh/2CFmiBexsMn0V8KfZWLo=; b=DHRoaiIkwfaCOx7IRvKIy+rbuShC+cEUYah2Rru0kuk9+mGxB00RQfNnUqfZJHMrIS 6ZzRocvGyePLmhsIjcOppfZ8C3bv0JI171Zg1iBvsvTrWjHcEyq12mxGTrzAagZEtrd1 24wBbtDHUVjOeBt13xtL/GoJiqYcO/DwhncHzHVH8Rcw/XrF6gzz/IiAPtjmalBvmKVV 6E6RFWfziVd6v1b4d3LbYmUBEIlHe+PMpLQgPcx6LCjn3tr0WSepO97nWwdT79QEOb83 tjo+3sf06YGxIebBRE0YH2f5uZm5WrB7tD+5iAeAOu5jFGOZe5ux6wl/YaBI/J3Sh3fN +Niw== X-Received: by 10.112.141.70 with SMTP id rm6mr8119628lbb.115.1370123417021; Sat, 01 Jun 2013 14:50:17 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-145-9.pppoe.mtu-net.ru. [91.76.145.9]) by mx.google.com with ESMTPSA id f9sm20988669lbf.4.2013.06.01.14.50.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 01 Jun 2013 14:50:16 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: horms@verge.net.au, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org, balbi@ti.com Subject: [PATCH v8 6/9] phy-rcar-usb: correct base address Date: Sun, 2 Jun 2013 01:50:25 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: gregkh@linuxfoundation.org References: <201306020128.05914.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201306020128.05914.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201306020150.25655.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQnaBdPYd/6N1lUfmqVBR0lbyntwF6Hw+fYSvUpKxTin1wuRzq1QO+xKR2bebsiK391qb08X 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()... Note that the driver and the SoC code have to be in one patch to keep the code bisectable... The patch has been tested on the Marzen board. Signed-off-by: Sergei Shtylyov Acked-by: Kuninori Morimoto Acked-by: Simon Horman Acked-by: Felipe Balbi --- Changes since version 7: - renamed the PHY driver and changed the patch subject accordingly. Changes since version 6: - added an ACK from Felipe Balbi. Changes since version 4: - refreshed the patch. Changes since version 2: - refreshed atop of the prior patches; - added a note about testing to the changelog; - added ACKs from Simon Horman and Kuninori Morimoto. Changes since the original posting: - added a note about bisectability to the changelog. arch/arm/mach-shmobile/setup-r8a7779.c | 2 +- drivers/usb/phy/phy-rcar-usb.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 @@ -391,7 +391,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/phy-rcar-usb.c =================================================================== --- renesas.orig/drivers/usb/phy/phy-rcar-usb.c +++ renesas/drivers/usb/phy/phy-rcar-usb.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) {