diff options
| author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2013-06-01 17:50:25 -0400 |
|---|---|---|
| committer | Simon Horman <horms+renesas@verge.net.au> | 2013-06-11 03:10:47 -0400 |
| commit | 725bf9dcafe16aa69c8ab34c63ba36c6eb4492f2 (patch) | |
| tree | 6e55071261b8d7c95233c7df904865bf4427aba3 | |
| parent | bb6e7d61dd95153c8c5d0ee52f303e0f475b736e (diff) | |
phy-rcar-usb: correct base address
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 <sergei.shtylyov@cogentembedded.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
| -rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7779.c | 2 | ||||
| -rw-r--r-- | drivers/usb/phy/phy-rcar-usb.c | 28 |
2 files changed, 11 insertions, 19 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index a6406cd61ff3..a00283fe528c 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c | |||
| @@ -391,7 +391,7 @@ static struct platform_device sata_device = { | |||
| 391 | /* USB PHY */ | 391 | /* USB PHY */ |
| 392 | static struct resource usb_phy_resources[] = { | 392 | static struct resource usb_phy_resources[] = { |
| 393 | [0] = { | 393 | [0] = { |
| 394 | .start = 0xffe70000, | 394 | .start = 0xffe70800, |
| 395 | .end = 0xffe70900 - 1, | 395 | .end = 0xffe70900 - 1, |
| 396 | .flags = IORESOURCE_MEM, | 396 | .flags = IORESOURCE_MEM, |
| 397 | }, | 397 | }, |
diff --git a/drivers/usb/phy/phy-rcar-usb.c b/drivers/usb/phy/phy-rcar-usb.c index 4893dbde4ee1..d636cc742e8f 100644 --- a/drivers/usb/phy/phy-rcar-usb.c +++ b/drivers/usb/phy/phy-rcar-usb.c | |||
| @@ -16,13 +16,13 @@ | |||
| 16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
| 17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 18 | 18 | ||
| 19 | /* USBH common register */ | 19 | /* REGS block */ |
| 20 | #define USBPCTRL0 0x0800 | 20 | #define USBPCTRL0 0x00 |
| 21 | #define USBPCTRL1 0x0804 | 21 | #define USBPCTRL1 0x04 |
| 22 | #define USBST 0x0808 | 22 | #define USBST 0x08 |
| 23 | #define USBEH0 0x080C | 23 | #define USBEH0 0x0C |
| 24 | #define USBOH0 0x081C | 24 | #define USBOH0 0x1C |
| 25 | #define USBCTL0 0x0858 | 25 | #define USBCTL0 0x58 |
| 26 | 26 | ||
| 27 | /* USBPCTRL1 */ | 27 | /* USBPCTRL1 */ |
| 28 | #define PHY_RST (1 << 2) | 28 | #define PHY_RST (1 << 2) |
| @@ -139,17 +139,9 @@ static int rcar_usb_phy_probe(struct platform_device *pdev) | |||
| 139 | return -EINVAL; | 139 | return -EINVAL; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | /* | 142 | reg0 = devm_ioremap_resource(dev, res0); |
| 143 | * CAUTION | 143 | if (IS_ERR(reg0)) |
| 144 | * | 144 | return PTR_ERR(reg0); |
| 145 | * Because this phy address is also mapped under OHCI/EHCI address area, | ||
| 146 | * this driver can't use devm_request_and_ioremap(dev, res) here | ||
| 147 | */ | ||
| 148 | reg0 = devm_ioremap_nocache(dev, res0->start, resource_size(res0)); | ||
| 149 | if (!reg0) { | ||
| 150 | dev_err(dev, "ioremap error\n"); | ||
| 151 | return -ENOMEM; | ||
| 152 | } | ||
| 153 | 145 | ||
| 154 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); | 146 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); |
| 155 | if (!priv) { | 147 | if (!priv) { |
