Re: [RFC][PATCH] usb: musb: pass configuration specifics via pdata

2008-06-30 Thread andrzej zaborowski
2008/6/30 David Brownell <[EMAIL PROTECTED]>:
> On Monday 30 June 2008, Felipe Balbi wrote:
>> The patch won't probe. But if you just copy what's added in 
>> board-omap3430sdp.c
>> should work.
>
> Better:  that controller data should be provided by SOC glue
> in those cases (omap2430, omap 3*, DaVinci, etc).  If it's
> not board-specific, it doesn't belong in board-specific glue..

Yep, I believe same applies to devices with the TUSB6010 - musb-hdrc
parameters are TUSB6010 specific and not board specific.

Regards
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] usb: musb: pass configuration specifics via pdata

2008-06-30 Thread Felipe Balbi
On Mon, Jun 30, 2008 at 11:33:15AM -0700, David Brownell wrote:
> On Monday 30 June 2008, Felipe Balbi wrote:
> > The patch won't probe. But if you just copy what's added in 
> > board-omap3430sdp.c
> > should work.
> 
> Better:  that controller data should be provided by SOC glue
> in those cases (omap2430, omap 3*, DaVinci, etc).  If it's
> not board-specific, it doesn't belong in board-specific glue..

Hmm... will do, thanks

-- 
Best Regards,

Felipe Balbi
[EMAIL PROTECTED]
http://blog.felipebalbi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] usb: musb: pass configuration specifics via pdata

2008-06-30 Thread David Brownell
On Monday 30 June 2008, Felipe Balbi wrote:
> The patch won't probe. But if you just copy what's added in 
> board-omap3430sdp.c
> should work.

Better:  that controller data should be provided by SOC glue
in those cases (omap2430, omap 3*, DaVinci, etc).  If it's
not board-specific, it doesn't belong in board-specific glue..

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] usb: musb: pass configuration specifics via pdata

2008-06-30 Thread Felipe Balbi
On Mon, Jun 30, 2008 at 07:56:36PM +0200, Koen Kooi wrote:
> I was wondering what would happen if I would test the patch  on  
> beagleboard, now I know :)

The patch won't probe. But if you just copy what's added in board-omap3430sdp.c
should work.

afaict, they have the same configuration for musb.

I'll try to finish tomorrow the other boards.

-- 
Best Regards,

Felipe Balbi
[EMAIL PROTECTED]
http://blog.felipebalbi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] usb: musb: pass configuration specifics via pdata

2008-06-30 Thread Koen Kooi


Op 30 jun 2008, om 19:49 heeft Felipe Balbi het volgende geschreven:


On Mon, Jun 30, 2008 at 07:29:28PM +0200, Koen Kooi wrote:


Op 30 jun 2008, om 13:50 heeft Felipe Balbi het volgende geschreven:


Use platform_data to pass musb configuration-specific
details to musb driver.

It's easier to maintain in the sense that neither board
will affect the other.

For now tested on n800 only, wanna hear from everybody what
guys think before test on omap3430sdp

Signed-off-by: Felipe Balbi <[EMAIL PROTECTED]>
Cc: Tony Lindgre <[EMAIL PROTECTED]>
Cc: David Brownell <[EMAIL PROTECTED]>
Cc: Anand Gadiyar <[EMAIL PROTECTED]>
Cc: Kevin Hilman <[EMAIL PROTECTED]>
Cc: Bryan Wu <[EMAIL PROTECTED]>
---
arch/arm/mach-omap2/board-3430sdp.c  |   75 ++-
arch/arm/mach-omap2/board-n800-usb.c |   46 +-
arch/arm/mach-omap2/usb-musb.c   |   55 +++
arch/arm/mach-omap2/usb-tusb6010.c   |1 -
drivers/usb/musb/musb_core.c |   37 +++
drivers/usb/musb/musb_core.h |   14 +---
drivers/usb/musb/tusb6010.h  |  169

include/asm-arm/arch-omap/hdrc_cnf.h |  177
--
include/asm-arm/arch-omap/usb-musb.h |6 +-
include/linux/usb/musb.h |   38 +++-
10 files changed, 189 insertions(+), 429 deletions(-)
delete mode 100644 include/asm-arm/arch-omap/hdrc_cnf.h



Wouldn't omap3-beagleboard.c  and omap3-evm.c need a similar change?


Yeah :-)

but for now I only played with omap2. Omap3-based boards I'm still  
doing

;-)

That's why the patch is marked RFC.


I was wondering what would happen if I would test the patch  on  
beagleboard, now I know :)


regards,

Koen





--
Best Regards,

Felipe Balbi
[EMAIL PROTECTED]
http://blog.felipebalbi.com
--
To unsubscribe from this list: send the line "unsubscribe linux- 
omap" in

the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html





PGP.sig
Description: This is a digitally signed message part


Re: [RFC][PATCH] usb: musb: pass configuration specifics via pdata

2008-06-30 Thread Felipe Balbi
On Mon, Jun 30, 2008 at 07:29:28PM +0200, Koen Kooi wrote:
>
> Op 30 jun 2008, om 13:50 heeft Felipe Balbi het volgende geschreven:
>
>> Use platform_data to pass musb configuration-specific
>> details to musb driver.
>>
>> It's easier to maintain in the sense that neither board
>> will affect the other.
>>
>> For now tested on n800 only, wanna hear from everybody what
>> guys think before test on omap3430sdp
>>
>> Signed-off-by: Felipe Balbi <[EMAIL PROTECTED]>
>> Cc: Tony Lindgre <[EMAIL PROTECTED]>
>> Cc: David Brownell <[EMAIL PROTECTED]>
>> Cc: Anand Gadiyar <[EMAIL PROTECTED]>
>> Cc: Kevin Hilman <[EMAIL PROTECTED]>
>> Cc: Bryan Wu <[EMAIL PROTECTED]>
>> ---
>> arch/arm/mach-omap2/board-3430sdp.c  |   75 ++-
>> arch/arm/mach-omap2/board-n800-usb.c |   46 +-
>> arch/arm/mach-omap2/usb-musb.c   |   55 +++
>> arch/arm/mach-omap2/usb-tusb6010.c   |1 -
>> drivers/usb/musb/musb_core.c |   37 +++
>> drivers/usb/musb/musb_core.h |   14 +---
>> drivers/usb/musb/tusb6010.h  |  169  
>> 
>> include/asm-arm/arch-omap/hdrc_cnf.h |  177  
>> --
>> include/asm-arm/arch-omap/usb-musb.h |6 +-
>> include/linux/usb/musb.h |   38 +++-
>> 10 files changed, 189 insertions(+), 429 deletions(-)
>> delete mode 100644 include/asm-arm/arch-omap/hdrc_cnf.h
>
>
> Wouldn't omap3-beagleboard.c  and omap3-evm.c need a similar change?

Yeah :-)

but for now I only played with omap2. Omap3-based boards I'm still doing
;-)

That's why the patch is marked RFC.

-- 
Best Regards,

Felipe Balbi
[EMAIL PROTECTED]
http://blog.felipebalbi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH] usb: musb: pass configuration specifics via pdata

2008-06-30 Thread Koen Kooi


Op 30 jun 2008, om 13:50 heeft Felipe Balbi het volgende geschreven:


Use platform_data to pass musb configuration-specific
details to musb driver.

It's easier to maintain in the sense that neither board
will affect the other.

For now tested on n800 only, wanna hear from everybody what
guys think before test on omap3430sdp

Signed-off-by: Felipe Balbi <[EMAIL PROTECTED]>
Cc: Tony Lindgre <[EMAIL PROTECTED]>
Cc: David Brownell <[EMAIL PROTECTED]>
Cc: Anand Gadiyar <[EMAIL PROTECTED]>
Cc: Kevin Hilman <[EMAIL PROTECTED]>
Cc: Bryan Wu <[EMAIL PROTECTED]>
---
arch/arm/mach-omap2/board-3430sdp.c  |   75 ++-
arch/arm/mach-omap2/board-n800-usb.c |   46 +-
arch/arm/mach-omap2/usb-musb.c   |   55 +++
arch/arm/mach-omap2/usb-tusb6010.c   |1 -
drivers/usb/musb/musb_core.c |   37 +++
drivers/usb/musb/musb_core.h |   14 +---
drivers/usb/musb/tusb6010.h  |  169  

include/asm-arm/arch-omap/hdrc_cnf.h |  177  
--

include/asm-arm/arch-omap/usb-musb.h |6 +-
include/linux/usb/musb.h |   38 +++-
10 files changed, 189 insertions(+), 429 deletions(-)
delete mode 100644 include/asm-arm/arch-omap/hdrc_cnf.h



Wouldn't omap3-beagleboard.c  and omap3-evm.c need a similar change?

regards,

Koen






diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach- 
omap2/board-3430sdp.c

index f6cd08b..e3db60e 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -285,6 +285,79 @@ static int __init omap3430_i2c_init(void)

extern void __init sdp3430_flash_init(void);

+static struct musb_hdrc_eps_bits musb_eps[] = {
+   {   "ep1_tx", 10, },
+   {   "ep1_rx", 10, },
+   {   "ep2_tx", 9,  },
+   {   "ep2_rx", 9,  },
+   {   "ep3_tx", 3,  },
+   {   "ep3_rx", 3,  },
+   {   "ep4_tx", 3,  },
+   {   "ep4_rx", 3,  },
+   {   "ep5_tx", 3,  },
+   {   "ep5_rx", 3,  },
+   {   "ep6_tx", 3,  },
+   {   "ep6_rx", 3,  },
+   {   "ep7_tx", 3,  },
+   {   "ep7_rx", 3,  },
+   {   "ep8_tx", 2,  },
+   {   "ep8_rx", 2,  },
+   {   "ep9_tx", 2,  },
+   {   "ep9_rx", 2,  },
+   {   "ep10_tx", 2, },
+   {   "ep10_rx", 2, },
+   {   "ep11_tx", 2, },
+   {   "ep11_rx", 2, },
+   {   "ep12_tx", 2, },
+   {   "ep12_rx", 2, },
+   {   "ep13_tx", 2, },
+   {   "ep13_rx", 2, },
+   {   "ep14_tx", 2, },
+   {   "ep14_rx", 2, },
+   {   "ep15_tx", 2, },
+   {   "ep15_rx", 2, },
+};
+
+static struct musb_hdrc_config musb_config = {
+   .multipoint = 1,
+   .dyn_fifo   = 1,
+   .soft_con   = 1,
+   .dma= 1,
+   .num_eps= 32,
+   .dma_channels   = 7,
+   .dma_req_chan   = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
+   .ram_bits   = 12,
+   .eps_bits   = musb_eps,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#ifdef CONFIG_USB_MUSB_OTG
+   .mode   = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+   .mode   = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+   .mode   = MUSB_PERIPHERAL,
+#endif
+   .clock  = "hsotgusb_ick",
+   .config = &musb_config,
+};
+
+static struct resource musb_resources[] = {
+   [0] = {
+   .start  = OMAP34XX_HSUSB_OTG_BASE,
+   .end= OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = { /* general IRQ */
+   .start  = INT_243X_HS_USB_MC,
+   .flags  = IORESOURCE_IRQ,
+   },
+   [2] = { /* DMA IRQ */
+   .start  = INT_243X_HS_USB_DMA,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
static void __init omap_3430sdp_init(void)
{
platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
@@ -300,7 +373,7 @@ static void __init omap_3430sdp_init(void)
ads7846_dev_init();
sdp3430_flash_init();
omap_serial_init();
-   usb_musb_init();
+	usb_musb_init(&musb_plat, musb_resources,  
ARRAY_SIZE(musb_resources));

usb_ehci_init();
hsmmc_init();
}
diff --git a/arch/arm/mach-omap2/board-n800-usb.c b/arch/arm/mach- 
omap2/board-n800-usb.c

index 7599f64..16ea8fc 100644
--- a/arch/arm/mach-omap2/board-n800-usb.c
+++ b/arch/arm/mach-omap2/board-n800-usb.c
@@ -35,14 +35,58 @@ static int tusb_set_clock(struct clk *osc_ck,  
int state);

#   define BOARD_MODE   MUSB_HOST
#endif

+static struct musb_hdrc_eps_bits musb_eps[] = {
+   {   "ep1_tx", 5,  },
+   {   "ep1_rx", 5,  },
+   {   "ep2_tx", 5,  },
+   {   "ep2_rx", 5,  },
+   {   "ep3_tx", 3,  },
+   {   "ep3_rx", 3,  },
+   {   "ep4_tx", 3,  },
+   {