From patchwork Fri Apr 19 22:01:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2467141 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E411D3FD8C for ; Fri, 19 Apr 2013 22:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934319Ab3DSWB4 (ORCPT ); Fri, 19 Apr 2013 18:01:56 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:52761 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934183Ab3DSWBz (ORCPT ); Fri, 19 Apr 2013 18:01:55 -0400 Received: by mail-la0-f43.google.com with SMTP id ea20so484230lab.30 for ; Fri, 19 Apr 2013 15:01:53 -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=CsWAXIdr/alqNErMnAhZivWkXxrKCJpgrwnt7/zyzVc=; b=d1rSHh58QOKtcgkqQTCbO3KhvxxuC41zFAnXCvzm1pgBTN4oTs/L1bS04A4uXLnuJJ hyc1C3Sec5UZmQB8ej5tZsyUOMxfwTD/mZS5S7h5MkuHDyW+grQDrCBAikiWbvgwjuvV 1lNk9wvYO8AslrD6SIHLPg4L5Ij0F8qcQeKDdd5ZfPu664Oe4zAyY+//SY7pyxCcAT9g JBxrJyK2m2xeYgRXXPF+HSlWef7zikpQna2LHsxsGlzD57NWJv0xhoCaXHNTmMmHI5pz p+sVo04QgsYB9/GHwZMIWT/ko8XEhfuHQwg35Iw97MQ8OOoMkANOAKqxkC5mURYZ9geK NZrw== X-Received: by 10.112.129.2 with SMTP id ns2mr8965133lbb.53.1366408913834; Fri, 19 Apr 2013 15:01:53 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-86-130.pppoe.mtu-net.ru. [91.79.86.130]) by mx.google.com with ESMTPS id xw14sm6717218lab.6.2013.04.19.15.01.51 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Apr 2013 15:01:52 -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 v5 6/9] rcar-phy: correct base address From: Sergei Shtylyov Organization: Cogent Embedded Date: Sat, 20 Apr 2013 02:01:03 +0400 MIME-Version: 1.0 Message-Id: <201304200201.04320.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQkQ+zyqZPsOTEyXv9VhMgWKRW4Qr4o/Y8OSapnfx8cQniCi/5WQhf6l2ZyFrcmaAlBExcMY 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 --- 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/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 @@ -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/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) {