diff mbox

[1/7] ARM: shmobile: marzen: add USB phy support

Message ID 1352446306-19945-2-git-send-email-horms@verge.net.au (mailing list archive)
State Accepted
Commit b5ce635d45fc7da686c9f3071877689d8db1d284
Headers show

Commit Message

Simon Horman Nov. 9, 2012, 7:31 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/configs/marzen_defconfig     |    3 ++-
 arch/arm/mach-shmobile/board-marzen.c |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

Comments

Sergei Shtylyov March 13, 2013, 10:20 p.m. UTC | #1
Hello.

On 11/09/2012 10:31 AM, Simon Horman wrote:

> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>   arch/arm/configs/marzen_defconfig     |    3 ++-
>   arch/arm/mach-shmobile/board-marzen.c |   21 +++++++++++++++++++++
>   2 files changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 69f7f46..74c7f0b 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -144,11 +144,32 @@ static struct platform_device hspi_device = {
>   	.num_resources	= ARRAY_SIZE(hspi_resources),
>   };
>   
> +/* USB PHY */
> +static struct resource usb_phy_resources[] = {
> +	[0] = {
> +		.start		= 0xffe70000,

    Why not 0xffe70800? 0xffe70000 is where the EHCI registers start.
I don't see why they should be overlapped like this.

> +		.end		= 0xffe70900 - 1,
> +		.flags		= IORESOURCE_MEM,
> +	},
> +	[1] = {
> +		.start		= 0xfff70000,
> +		.end		= 0xfff70900 - 1,

    Hm, this PHY register range doesn't seem to be documented?

> +		.flags		= IORESOURCE_MEM,
> +	},
> +};
> +
> +static struct platform_device usb_phy_device = {
> +	.name		= "rcar_usb_phy",
> +	.resource	= usb_phy_resources,
> +	.num_resources	= ARRAY_SIZE(usb_phy_resources),
> +};
> +
>   static struct platform_device *marzen_devices[] __initdata = {
>   	&eth_device,
>   	&sdhi0_device,
>   	&thermal_device,
>   	&hspi_device,
> +	&usb_phy_device,
>   };
>   
>   static void __init marzen_init(void)

    Finally, the same question as for EHCI: why this ended up in the 
board file instead of setup-r8a7779.c?

WBR, Sergei

--
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
Kuninori Morimoto March 14, 2013, 12:44 a.m. UTC | #2
Hi Sergei

> > +/* USB PHY */
> > +static struct resource usb_phy_resources[] = {
> > +	[0] = {
> > +		.start		= 0xffe70000,
> 
>     Why not 0xffe70800? 0xffe70000 is where the EHCI registers start.
> I don't see why they should be overlapped like this.

Current rcar-phy try to access 0xffe7009x

> > +	[1] = {
> > +		.start		= 0xfff70000,
> > +		.end		= 0xfff70900 - 1,
> 
>     Hm, this PHY register range doesn't seem to be documented?

0xffe70000 is for port0/1
0xfff70000 is for port2

But this 0xfff70000 is only for 0xfff7009x access

Best regards
---
Kuninori Morimoto
--
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
Sergei Shtylyov March 14, 2013, 1:20 p.m. UTC | #3
Hello.

On 14-03-2013 4:44, Kuninori Morimoto wrote:

>>> +/* USB PHY */
>>> +static struct resource usb_phy_resources[] = {
>>> +	[0] = {
>>> +		.start		= 0xffe70000,

>>      Why not 0xffe70800? 0xffe70000 is where the EHCI registers start.
>> I don't see why they should be overlapped like this.

> Current rcar-phy try to access 0xffe7009x

    That should be changed too IHO, as these registers are not really PHY 
related, they control EHCI itself. These writes should be done somewhere in 
setup-r8a7779.c probably.

>>> +	[1] = {
>>> +		.start		= 0xfff70000,
>>> +		.end		= 0xfff70900 - 1,

>>      Hm, this PHY register range doesn't seem to be documented?

> 0xffe70000 is for port0/1
> 0xfff70000 is for port2

> But this 0xfff70000 is only for 0xfff7009x access

    Yeah, I understood that it's only for the extra EHCI registers.

> Best regards
> ---
> Kuninori Morimoto

WBR, Sergei

--
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
diff mbox

Patch

diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 5b8215f..8a861b7 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -78,7 +78,8 @@  CONFIG_GPIO_SYSFS=y
 CONFIG_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_SSB=y
-# CONFIG_USB_SUPPORT is not set
+CONFIG_USB=y
+CONFIG_USB_RCAR_PHY=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_UIO=y
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 69f7f46..74c7f0b 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -144,11 +144,32 @@  static struct platform_device hspi_device = {
 	.num_resources	= ARRAY_SIZE(hspi_resources),
 };
 
+/* USB PHY */
+static struct resource usb_phy_resources[] = {
+	[0] = {
+		.start		= 0xffe70000,
+		.end		= 0xffe70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start		= 0xfff70000,
+		.end		= 0xfff70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device usb_phy_device = {
+	.name		= "rcar_usb_phy",
+	.resource	= usb_phy_resources,
+	.num_resources	= ARRAY_SIZE(usb_phy_resources),
+};
+
 static struct platform_device *marzen_devices[] __initdata = {
 	&eth_device,
 	&sdhi0_device,
 	&thermal_device,
 	&hspi_device,
+	&usb_phy_device,
 };
 
 static void __init marzen_init(void)