diff mbox

[RFC,2/3] DA8xx: OHCI platform device (take 2)

Message ID 200908212227.42330.sshtylyov@ru.mvista.com (mailing list archive)
State RFC
Headers show

Commit Message

Sergei Shtylyov Aug. 21, 2009, 6:27 p.m. UTC
Add the function to register the OHCI platform device, given the root hub
related platform data passed from the board specific code.

While at it, modify USB 2.0 clock entry in order to match the clock by name
instead of by device since it is also needed by the OHCI glue layer...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be
not up-to-date! :-)

 arch/arm/mach-davinci/da830.c              |    2 -
 arch/arm/mach-davinci/devices-da8xx.c      |   33 +++++++++++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/da8xx.h |    2 +
 3 files changed, 36 insertions(+), 1 deletion(-)

Comments

Kevin Hilman Aug. 25, 2009, 11:45 a.m. UTC | #1
Sergei Shtylyov <sshtylyov@ru.mvista.com> writes:

> Add the function to register the OHCI platform device, given the root hub
> related platform data passed from the board specific code.
>
> While at it, modify USB 2.0 clock entry in order to match the clock by name
> instead of by device since it is also needed by the OHCI glue layer...
>
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> ---
> Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be
> not up-to-date! :-)
>
>  arch/arm/mach-davinci/da830.c              |    2 -
>  arch/arm/mach-davinci/devices-da8xx.c      |   33 +++++++++++++++++++++++++++++
>  arch/arm/mach-davinci/include/mach/da8xx.h |    2 +
>  3 files changed, 36 insertions(+), 1 deletion(-)
>
> Index: linux-davinci/arch/arm/mach-davinci/da830.c
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/da830.c
> +++ linux-davinci/arch/arm/mach-davinci/da830.c
> @@ -415,7 +415,7 @@ static struct davinci_clk da830_clks[] =
>  	CLK("davinci-mcasp.0",	NULL,		&mcasp0_clk),
>  	CLK("davinci-mcasp.1",	NULL,		&mcasp1_clk),
>  	CLK("davinci-mcasp.2",	NULL,		&mcasp2_clk),
> -	CLK("musb_hdrc",	NULL,		&usb20_clk),
> +	CLK(NULL,		"usb20",	&usb20_clk),

I can live with it this way, but is there a reason you don't
want:

	CLK("ohci,		"usb20",	&usb20_clk),

and add "ohci" to the usb11_clk as well?

Kevin
Sergei Shtylyov Aug. 25, 2009, 3:47 p.m. UTC | #2
Kevin Hilman wrote:

>>Add the function to register the OHCI platform device, given the root hub
>>related platform data passed from the board specific code.

>>While at it, modify USB 2.0 clock entry in order to match the clock by name
>>instead of by device since it is also needed by the OHCI glue layer...

>>Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

>>---
>>Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be
>>not up-to-date! :-)

>> arch/arm/mach-davinci/da830.c              |    2 -
>> arch/arm/mach-davinci/devices-da8xx.c      |   33 +++++++++++++++++++++++++++++
>> arch/arm/mach-davinci/include/mach/da8xx.h |    2 +
>> 3 files changed, 36 insertions(+), 1 deletion(-)

>>Index: linux-davinci/arch/arm/mach-davinci/da830.c
>>===================================================================
>>--- linux-davinci.orig/arch/arm/mach-davinci/da830.c
>>+++ linux-davinci/arch/arm/mach-davinci/da830.c
>>@@ -415,7 +415,7 @@ static struct davinci_clk da830_clks[] =
>> 	CLK("davinci-mcasp.0",	NULL,		&mcasp0_clk),
>> 	CLK("davinci-mcasp.1",	NULL,		&mcasp1_clk),
>> 	CLK("davinci-mcasp.2",	NULL,		&mcasp2_clk),
>>-	CLK("musb_hdrc",	NULL,		&usb20_clk),
>>+	CLK(NULL,		"usb20",	&usb20_clk),

> I can live with it this way, but is there a reason you don't
> want:

> 	CLK("ohci,		"usb20",	&usb20_clk),

> and add "ohci" to the usb11_clk as well?

    I'm seeing no gain from it, only a drawback (of wasting some memory).

> Kevin 

WBR, Sergei
Kevin Hilman Sept. 14, 2009, 7:43 p.m. UTC | #3
Sergei Shtylyov <sshtylyov@ru.mvista.com> writes:

> Kevin Hilman wrote:
>
>>>Add the function to register the OHCI platform device, given the root hub
>>>related platform data passed from the board specific code.
>
>>>While at it, modify USB 2.0 clock entry in order to match the clock by name
>>>instead of by device since it is also needed by the OHCI glue layer...
>
>>>Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
>>>---
>>>Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be
>>>not up-to-date! :-)
>
>>> arch/arm/mach-davinci/da830.c              |    2 -
>>> arch/arm/mach-davinci/devices-da8xx.c      |   33 +++++++++++++++++++++++++++++
>>> arch/arm/mach-davinci/include/mach/da8xx.h |    2 +
>>> 3 files changed, 36 insertions(+), 1 deletion(-)
>
>>>Index: linux-davinci/arch/arm/mach-davinci/da830.c
>>>===================================================================
>>>--- linux-davinci.orig/arch/arm/mach-davinci/da830.c
>>>+++ linux-davinci/arch/arm/mach-davinci/da830.c
>>>@@ -415,7 +415,7 @@ static struct davinci_clk da830_clks[] =
>>> 	CLK("davinci-mcasp.0",	NULL,		&mcasp0_clk),
>>> 	CLK("davinci-mcasp.1",	NULL,		&mcasp1_clk),
>>> 	CLK("davinci-mcasp.2",	NULL,		&mcasp2_clk),
>>>-	CLK("musb_hdrc",	NULL,		&usb20_clk),
>>>+	CLK(NULL,		"usb20",	&usb20_clk),
>
>> I can live with it this way, but is there a reason you don't
>> want:
>
>> 	CLK("ohci,		"usb20",	&usb20_clk),
>
>> and add "ohci" to the usb11_clk as well?
>
>    I'm seeing no gain from it, only a drawback (of wasting some memory).
>

ok, this looks fine to me.  

Since this is an RFC, do you have an updated version?  or should I
just apply this one.

Kevin
Sergei Shtylyov Sept. 15, 2009, 10:33 a.m. UTC | #4
Hello.

Kevin Hilman wrote:

>>>> Add the function to register the OHCI platform device, given the root hub
>>>> related platform data passed from the board specific code.
>>>>         
>>>> While at it, modify USB 2.0 clock entry in order to match the clock by name
>>>> instead of by device since it is also needed by the OHCI glue layer...
>>>>         
>>>> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>>>>         
>>>> ---
>>>> Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be
>>>> not up-to-date! :-)
>>>>         
>>>> arch/arm/mach-davinci/da830.c              |    2 -
>>>> arch/arm/mach-davinci/devices-da8xx.c      |   33 +++++++++++++++++++++++++++++
>>>> arch/arm/mach-davinci/include/mach/da8xx.h |    2 +
>>>> 3 files changed, 36 insertions(+), 1 deletion(-)
>>>>         
>>>> Index: linux-davinci/arch/arm/mach-davinci/da830.c
>>>> ===================================================================
>>>> --- linux-davinci.orig/arch/arm/mach-davinci/da830.c
>>>> +++ linux-davinci/arch/arm/mach-davinci/da830.c
>>>> @@ -415,7 +415,7 @@ static struct davinci_clk da830_clks[] =
>>>> 	CLK("davinci-mcasp.0",	NULL,		&mcasp0_clk),
>>>> 	CLK("davinci-mcasp.1",	NULL,		&mcasp1_clk),
>>>> 	CLK("davinci-mcasp.2",	NULL,		&mcasp2_clk),
>>>> -	CLK("musb_hdrc",	NULL,		&usb20_clk),
>>>> +	CLK(NULL,		"usb20",	&usb20_clk),
>>>>         
>>> I can live with it this way, but is there a reason you don't
>>> want:
>>>       
>>> 	CLK("ohci,		"usb20",	&usb20_clk),
>>>       
>>> and add "ohci" to the usb11_clk as well?
>>>       
>>    I'm seeing no gain from it, only a drawback (of wasting some memory).
>>     
>
> ok, this looks fine to me.  
>
> Since this is an RFC, do you have an updated version?  or should I
> just apply this one.
>   

   You'd like me to move the OHCI platform device to usb.c, if I don't 
mistake? Then there'll be another take...

> Kevin
>   

WBR, Sergei
Kevin Hilman Sept. 16, 2009, 2:38 p.m. UTC | #5
Sergei Shtylyov <sshtylyov@ru.mvista.com> writes:

> Hello.
>
> Kevin Hilman wrote:
>
>>>>> Add the function to register the OHCI platform device, given the root hub
>>>>> related platform data passed from the board specific code.
>>>>>         While at it, modify USB 2.0 clock entry in order to match
>>>>> the clock by name
>>>>> instead of by device since it is also needed by the OHCI glue layer...
>>>>>         Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>>>>>         ---
>>>>> Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be
>>>>> not up-to-date! :-)
>>>>>         arch/arm/mach-davinci/da830.c              |    2 -
>>>>> arch/arm/mach-davinci/devices-da8xx.c      |   33 +++++++++++++++++++++++++++++
>>>>> arch/arm/mach-davinci/include/mach/da8xx.h |    2 +
>>>>> 3 files changed, 36 insertions(+), 1 deletion(-)
>>>>>         Index: linux-davinci/arch/arm/mach-davinci/da830.c
>>>>> ===================================================================
>>>>> --- linux-davinci.orig/arch/arm/mach-davinci/da830.c
>>>>> +++ linux-davinci/arch/arm/mach-davinci/da830.c
>>>>> @@ -415,7 +415,7 @@ static struct davinci_clk da830_clks[] =
>>>>> 	CLK("davinci-mcasp.0",	NULL,		&mcasp0_clk),
>>>>> 	CLK("davinci-mcasp.1",	NULL,		&mcasp1_clk),
>>>>> 	CLK("davinci-mcasp.2",	NULL,		&mcasp2_clk),
>>>>> -	CLK("musb_hdrc",	NULL,		&usb20_clk),
>>>>> +	CLK(NULL,		"usb20",	&usb20_clk),
>>>>>         
>>>> I can live with it this way, but is there a reason you don't
>>>> want:
>>>>       	CLK("ohci,		"usb20",	&usb20_clk),
>>>>       and add "ohci" to the usb11_clk as well?
>>>>       
>>>    I'm seeing no gain from it, only a drawback (of wasting some memory).
>>>     
>>
>> ok, this looks fine to me.  
>>
>> Since this is an RFC, do you have an updated version?  or should I
>> just apply this one.
>>   
>
>   You'd like me to move the OHCI platform device to usb.c, if I don't
> mistake? 

Yes, please.

> Then there'll be another take...

ok

Kevin
Sergei Shtylyov Sept. 16, 2009, 8:26 p.m. UTC | #6
Hello.

Kevin Hilman wrote:

>>>>>> Add the function to register the OHCI platform device, given the root hub
>>>>>> related platform data passed from the board specific code.
>>>>>>         While at it, modify USB 2.0 clock entry in order to match
>>>>>> the clock by name
>>>>>> instead of by device since it is also needed by the OHCI glue layer...
>>>>>>         Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>>>>>>         ---
>>>>>> Oops, I did hit send too early -- my copy of the DaVinci tree appeared to be
>>>>>> not up-to-date! :-)
>>>>>>         arch/arm/mach-davinci/da830.c              |    2 -
>>>>>> arch/arm/mach-davinci/devices-da8xx.c      |   33 +++++++++++++++++++++++++++++
>>>>>> arch/arm/mach-davinci/include/mach/da8xx.h |    2 +
>>>>>> 3 files changed, 36 insertions(+), 1 deletion(-)
>>>>>>         Index: linux-davinci/arch/arm/mach-davinci/da830.c
>>>>>> ===================================================================
>>>>>> --- linux-davinci.orig/arch/arm/mach-davinci/da830.c
>>>>>> +++ linux-davinci/arch/arm/mach-davinci/da830.c
>>>>>> @@ -415,7 +415,7 @@ static struct davinci_clk da830_clks[] =
>>>>>> 	CLK("davinci-mcasp.0",	NULL,		&mcasp0_clk),
>>>>>> 	CLK("davinci-mcasp.1",	NULL,		&mcasp1_clk),
>>>>>> 	CLK("davinci-mcasp.2",	NULL,		&mcasp2_clk),
>>>>>> -	CLK("musb_hdrc",	NULL,		&usb20_clk),
>>>>>> +	CLK(NULL,		"usb20",	&usb20_clk),
>>>>>>         
>>>>>>             
>>>>> I can live with it this way, but is there a reason you don't
>>>>> want:
>>>>>       	CLK("ohci,		"usb20",	&usb20_clk),
>>>>>       and add "ohci" to the usb11_clk as well?
>>>>>       
>>>>>           
>>>>    I'm seeing no gain from it, only a drawback (of wasting some memory).
>>>>     
>>>>         
>>> ok, this looks fine to me.  
>>>
>>> Since this is an RFC, do you have an updated version?  or should I
>>> just apply this one.
>>>   
>>>       
>>   You'd like me to move the OHCI platform device to usb.c, if I don't
>> mistake? 
>>     
>
> Yes, please.
>
>   
>> Then there'll be another take...
>>     
>
> ok
>   

   Moreover, this patch depends on #1 which contains the platfrom data 
definitions but otherwise belongs to drivers/usb/, so you couldn't have 
committed it without also commiting #1 or breaking things.
I can reverse this dependence though, so that this patch could be 
committed before the glue layer...

> Kevin

WBR, Sergei
diff mbox

Patch

Index: linux-davinci/arch/arm/mach-davinci/da830.c
===================================================================
--- linux-davinci.orig/arch/arm/mach-davinci/da830.c
+++ linux-davinci/arch/arm/mach-davinci/da830.c
@@ -415,7 +415,7 @@  static struct davinci_clk da830_clks[] =
 	CLK("davinci-mcasp.0",	NULL,		&mcasp0_clk),
 	CLK("davinci-mcasp.1",	NULL,		&mcasp1_clk),
 	CLK("davinci-mcasp.2",	NULL,		&mcasp2_clk),
-	CLK("musb_hdrc",	NULL,		&usb20_clk),
+	CLK(NULL,		"usb20",	&usb20_clk),
 	CLK(NULL,		"aemif",	&aemif_clk),
 	CLK(NULL,		"aintc",	&aintc_clk),
 	CLK(NULL,		"secu_mgr",	&secu_mgr_clk),
Index: linux-davinci/arch/arm/mach-davinci/devices-da8xx.c
===================================================================
--- linux-davinci.orig/arch/arm/mach-davinci/devices-da8xx.c
+++ linux-davinci/arch/arm/mach-davinci/devices-da8xx.c
@@ -34,6 +34,7 @@ 
 #define DA8XX_EMAC_CPGMACSS_BASE	0x01e22000
 #define DA8XX_EMAC_CPGMAC_BASE		0x01e23000
 #define DA8XX_EMAC_MDIO_BASE		0x01e24000
+#define DA8XX_USB1_BASE 		0x01e25000
 #define DA8XX_GPIO_BASE			0x01e26000
 #define DA8XX_I2C1_BASE			0x01e28000
 
@@ -235,6 +236,38 @@  int __init da8xx_register_watchdog(void)
 	return platform_device_register(&davinci_wdt_device);
 }
 
+static struct resource da8xx_usb11_resources[] = {
+	[0] = {
+		.start	= DA8XX_USB1_BASE,
+		.end	= DA8XX_USB1_BASE + SZ_4K - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_DA8XX_IRQN,
+		.end	= IRQ_DA8XX_IRQN,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
+
+static struct platform_device da8xx_usb11_device = {
+	.name		= "ohci",
+	.id		= 0,
+	.dev = {
+		.dma_mask		= &da8xx_usb11_dma_mask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+	},
+	.num_resources	= ARRAY_SIZE(da8xx_usb11_resources),
+	.resource	= da8xx_usb11_resources,
+};
+
+int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata)
+{
+	da8xx_usb11_device.dev.platform_data = pdata;
+	return platform_device_register(&da8xx_usb11_device);
+}
+
 static struct resource da8xx_emac_resources[] = {
 	{
 		.start	= DA8XX_EMAC_CPPI_PORT_BASE,
Index: linux-davinci/arch/arm/mach-davinci/include/mach/da8xx.h
===================================================================
--- linux-davinci.orig/arch/arm/mach-davinci/include/mach/da8xx.h
+++ linux-davinci/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -17,6 +17,7 @@ 
 #include <mach/emac.h>
 #include <mach/asp.h>
 #include <mach/mmc.h>
+#include <mach/usb.h>
 
 /*
  * The cp_intc interrupt controller for the da8xx isn't in the same
@@ -72,6 +73,7 @@  void __init da850_init(void);
 int da8xx_register_edma(void);
 int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
 int da8xx_register_watchdog(void);
+int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
 int da8xx_register_emac(void);
 int da8xx_register_lcdc(void);
 int da8xx_register_mmcsd0(struct davinci_mmc_config *config);