diff mbox

[2/2] DaVinci: DM365: Enable USB in DM365 EVM

Message ID 1252357282-29527-1-git-send-email-miguel.aguilar@ridgerun.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

miguel.aguilar@ridgerun.com Sept. 7, 2009, 9:01 p.m. UTC
From: Miguel Aguilar <miguel.aguilar@ridgerun.com>

This patch was tested on a DM365 EVM rev c, in both USB modes: Host
and Gadget.

Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Comments

Sergei Shtylyov Sept. 8, 2009, 5:49 p.m. UTC | #1
miguel.aguilar@ridgerun.com wrote:
> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>

> This patch was tested on a DM365 EVM rev c, in both USB modes: Host
> and Gadget.

> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>

> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
> index f6adf79..3a0d404 100644
> --- a/arch/arm/mach-davinci/board-dm365-evm.c
> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
> @@ -38,6 +38,7 @@
>  #include <mach/common.h>
>  #include <mach/mmc.h>
>  #include <mach/nand.h>
> +#include <mach/gpio.h>
>  
>  
>  static inline int have_imager(void)
> @@ -270,6 +271,14 @@ static void dm365evm_mmc_configure(void)
>  	davinci_cfg_reg(DM365_SD1_DATA0);
>  }
>  
> +static void dm365evm_usb_configure(void)
> +{
> +	davinci_cfg_reg(DM365_GPIO33);

    Can fail.

> +	gpio_request(33, "usb");

    Can also fail.

> +	gpio_direction_output(33, 1);

    Should be 0 by default -- the MUSB driver will turn it on.

> +	setup_usb(500, 8);
> +}
> +

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

Miguel Aguilar wrote:

>>> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>

>>> This patch was tested on a DM365 EVM rev c, in both USB modes: Host
>>> and Gadget.

>>> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>

>>> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c 
>>> b/arch/arm/mach-davinci/board-dm365-evm.c
>>> index f6adf79..3a0d404 100644
>>> --- a/arch/arm/mach-davinci/board-dm365-evm.c
>>> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
>>> @@ -38,6 +38,7 @@
>>>  #include <mach/common.h>
>>>  #include <mach/mmc.h>
>>>  #include <mach/nand.h>
>>> +#include <mach/gpio.h>
>>>  
>>>  
>>>  static inline int have_imager(void)
>>> @@ -270,6 +271,14 @@ static void dm365evm_mmc_configure(void)
>>>      davinci_cfg_reg(DM365_SD1_DATA0);
>>>  }
>>>  
>>> +static void dm365evm_usb_configure(void)
>>> +{
>>> +    davinci_cfg_reg(DM365_GPIO33);

>>    Can fail.

> [MA]Can you be more specific?. All of the davinci cfg regs are defined 
> in this way over the DaVinci platforms.

    This function can fail, and you're not handling this.

>>> +    gpio_request(33, "usb");

>>    Can also fail.

> [MA] What you mean is that error handling is missing?.

    Yes.

WBR, Sergei
Subbrathnam, Swaminathan Sept. 9, 2009, 3:25 a.m. UTC | #3
Miguel,

I am in the process of re-structuring the DaVinci USB platform/board specific functionality.  I am delayed a bit as I had to work on fixing a DMA related issue on DaVinci platforms.  Will work on the re-structure by this weekend.

Though it would be difficult to give a clear answer on how the partition would be done but as discussed in Kevin's thread the board specific details would be populated external to musb module.  Musb module would just be invoking the related functionalities in a generic way.

regards
swami
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index f6adf79..3a0d404 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -38,6 +38,7 @@ 
 #include <mach/common.h>
 #include <mach/mmc.h>
 #include <mach/nand.h>
+#include <mach/gpio.h>
 
 
 static inline int have_imager(void)
@@ -270,6 +271,14 @@  static void dm365evm_mmc_configure(void)
 	davinci_cfg_reg(DM365_SD1_DATA0);
 }
 
+static void dm365evm_usb_configure(void)
+{
+	davinci_cfg_reg(DM365_GPIO33);
+	gpio_request(33, "usb");
+	gpio_direction_output(33, 1);
+	setup_usb(500, 8);
+}
+
 static void __init evm_init_i2c(void)
 {
 	davinci_init_i2c(&i2c_pdata);
@@ -471,6 +480,7 @@  static __init void dm365_evm_init(void)
 
 	dm365evm_emac_configure();
 	dm365evm_mmc_configure();
+	dm365evm_usb_configure();
 
 	davinci_setup_mmc(0, &dm365evm_mmc_config);