Re: [PATCH 00/14] Modifications for DWC OTG since v13

2011-08-31 Thread Alexander Gordeev
Hi,

В Wed, 31 Aug 2011 10:18:42 +0900
Kyungmin Park kmp...@infradead.org пишет:

 On Wed, Aug 31, 2011 at 12:46 AM, Pratyush Anand
 pratyush.an...@gmail.com wrote:
  On Tue, Aug 30, 2011 at 8:57 PM, Tirumala Marri tma...@apm.com wrote:
  -Original Message-
  From: Pratyush Anand [mailto:pratyush.an...@st.com]
  Sent: Tuesday, August 30, 2011 4:58 AM
  To: linux-...@vger.kernel.org
  Cc: tma...@apm.com; linuxppc-dev@lists.ozlabs.org; fc...@apm.com;
  mmiesf...@apm.com; shiraz.has...@st.com; deepak.si...@st.com;
  vipulkumar.sa...@st.com; rajeev-dlh.ku...@st.com; vipin.ku...@st.com;
  bhupesh.sha...@st.com; viresh.ku...@st.com; amit.vi...@st.com; Pratyush
  Anand
  Subject: [PATCH 00/14] Modifications for DWC OTG since v13
  
  These patches are based on:http://patchwork.ozlabs.org/patch/89560/
  After not getting any reply from developers, I started to do
  modifications for my platform (SPEAr1340).
  I have done modifications in such a way that all the code in
  driver/usb/dwc/ would be platform independent.
  I have tested this code for host/device/dma/slave mode.
  My fifo configuration is dedicated and dynamic.
 
  [Tirumala Marri] We are working on our next release of patches. They
  should be coming out soon.
 
  Oh, thats great !!
  Actually, I did not get any reply of my previous mail on your patch release.
  I thought no one is maintaining., and so I sent them with my modifications,
  after testing them in all dev/host/otg mode.
 
  Regards
  Pratyush
 
 Hi,
 
 Can you provide the git repo to test?
 and I wonder what's the difference between dwc (from you) and dwc3
 (from Felipe Balbi). I think it's dwc targets for usb 2.0 and dwc3 for
 usb 3.0.

It doesn't look the same. At least, register definitions are quite
different.

-- 
  Alexander


signature.asc
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 00/14] Modifications for DWC OTG since v13

2011-08-31 Thread Pratyush Anand
On Wed, Aug 31, 2011 at 6:48 AM, Kyungmin Park kmp...@infradead.org wrote:
 On Wed, Aug 31, 2011 at 12:46 AM, Pratyush Anand
 pratyush.an...@gmail.com wrote:
 On Tue, Aug 30, 2011 at 8:57 PM, Tirumala Marri tma...@apm.com wrote:
 -Original Message-
 From: Pratyush Anand [mailto:pratyush.an...@st.com]
 Sent: Tuesday, August 30, 2011 4:58 AM
 To: linux-...@vger.kernel.org
 Cc: tma...@apm.com; linuxppc-dev@lists.ozlabs.org; fc...@apm.com;
 mmiesf...@apm.com; shiraz.has...@st.com; deepak.si...@st.com;
 vipulkumar.sa...@st.com; rajeev-dlh.ku...@st.com; vipin.ku...@st.com;
 bhupesh.sha...@st.com; viresh.ku...@st.com; amit.vi...@st.com; Pratyush
 Anand
 Subject: [PATCH 00/14] Modifications for DWC OTG since v13
 
 These patches are based on:http://patchwork.ozlabs.org/patch/89560/
 After not getting any reply from developers, I started to do
 modifications for my platform (SPEAr1340).
 I have done modifications in such a way that all the code in
 driver/usb/dwc/ would be platform independent.
 I have tested this code for host/device/dma/slave mode.
 My fifo configuration is dedicated and dynamic.

 [Tirumala Marri] We are working on our next release of patches. They
 should be coming out soon.

 Oh, thats great !!
 Actually, I did not get any reply of my previous mail on your patch release.
 I thought no one is maintaining., and so I sent them with my modifications,
 after testing them in all dev/host/otg mode.

 Regards
 Pratyush

 Hi,

 Can you provide the git repo to test?

Currently, these patches are also in circulation for internal reviews.
Once reviewed internally, will push them to git repo and will let you know.

 and I wonder what's the difference between dwc (from you) and dwc3
 (from Felipe Balbi). I think it's dwc targets for usb 2.0 and dwc3 for
 usb 3.0.


dwc3 is for  DesignWare USB3 DRD Controller Core 
these patches are for  DesignWare USB2.0 High Speed OTG Controller

Regards
Pratyush

 Thank you,
 Kyungmin Park

 --
 To unsubscribe from this list: send the line unsubscribe linux-usb in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

 --
 To unsubscribe from this list: send the line unsubscribe linux-usb in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/14] Modifications for DWC OTG since v13

2011-08-31 Thread Felipe Balbi
Hi,

(you did not add Greg in Cc, he's the USB maintainer. You also didn't Cc
myself as maintainer of the gadget framework)

On Tue, Aug 30, 2011 at 05:27:47PM +0530, Pratyush Anand wrote:
 These patches are based on:http://patchwork.ozlabs.org/patch/89560/
 After not getting any reply from developers, I started to do
 modifications for my platform (SPEAr1340).
 I have done modifications in such a way that all the code in 
 driver/usb/dwc/ would be platform independent.
 I have tested this code for host/device/dma/slave mode.
 My fifo configuration is dedicated and dynamic.

Looking at that driver code, I believe this is pretty much Synopsys
reference code with a few tweaks. If you want some tip, don't do that.
The reference driver, while functional, has lots of unnecessary layering
which should be avoided.

See how we wrote the DWC3 driver. It's very small code which does the
necessary. It's now functionally complete, from now on we only need to
improve on performance (for example starting transfers on Transfer
Complete event if we already have requests queued). Nevertheless, the
driver is small and has been tested with all transfer types.

If you really want to use this driver as is, that's your call. But I
would suggest to Greg that he only takes this in if there is someone
dedicated to maintain it. It's a really big codebase and whenever I
change something on the gadget framework I will have to patch this
beast too.

If there's no maintainer assigned to it, who's willing to put effort in
improving this driver in the long run, I think this will become yet
another burden on the community. Still, it's your call.

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 00/14] Modifications for DWC OTG since v13

2011-08-30 Thread Pratyush Anand
These patches are based on:http://patchwork.ozlabs.org/patch/89560/
After not getting any reply from developers, I started to do
modifications for my platform (SPEAr1340).
I have done modifications in such a way that all the code in 
driver/usb/dwc/ would be platform independent.
I have tested this code for host/device/dma/slave mode.
My fifo configuration is dedicated and dynamic.

Changes since v13:

1. All the patches has been renamed from usb/ppc4xx to dwc/otg. Changes
   has been done, because these files are valid for other architecture
   also.
2. Parameter passing mechanism has been modified. Now, driver can also
   receive parameters from a platform device.
3. Next request is started after clear halt for all slave transfer
There might be a situation, when there are data into fifo, EP is
receiving IN token, but EP is disabled. In this case, EP will just
stop and do nothing.  So, for each transfer type start_next_request
is enabled.
4. Dynamic fifo was configured by reading number of endpoints. Number
   of endpoints can be different than the number of dynamic fifo in the
   controller. Number of dynamic fifo is programmed in fifo_number
   parameter. Program fifos only for fifo_number of fifo.
5.  If platform specific functions like phy_init and param_init is
defined then call it.
6.  Few define which are used for TX, were defined as RX in the code.
All such definition has been replaced throughout the code.
7. There are some defined steps to disable an endpoint.  It can not be
   disabled just by setting epdisable bit.  Now, it is disabled as
   specification says.

During stall of and endpoint, first stall bit should be set and then
endpoint should be disabled.

In dwc_otg_pcd_ep_disable, TX fifo must be flushed along with
disabling of endpoint.

In DMA mode if Fifo is flushed only once then, DMA will write data
into it again. So, it must be flushed till DMA transfer is complete.
8. dwc_otg_ep_deactivate is called after dwc_otg_ep_disable.
9. platform_get_irq return -ENXIO , if requested IRQ is not found.  So,
   return must be checked accordingly.

10.  There is a struct (core_params) for all possible variable
 parameters of OTG.  Earlier, these parameters were not modifiable
 for any platform data. It was reading from the HW and then was
 programming the same value again.

Now, it has been modified. A platform code can modify these
parameters.

Struct definition has been moved from cil.h to a new file
include/linux/usb/dwc_otg.h.

Some of the parameters have been initialized with default values,
while other with -1.

A new parameter fifo_number has been added. This parameter is also
defined in the specification. Otg code was reading number of
endpoint from hwcfg regs for the purpose of this parameter, which
was wrong.

SW checks for only fifo_number fifos and not MAX_TX_FIFOS.

Now , there is only one define for MAX_TX_FIFO and MAX_PERIO_FIFOS.
As, per specification they can not be different.
11. In dwc_otg_pcd_handle_np_tx_fifo_empty_intr a different interrupt
was cleared. Corrected it to clear NP TX Fifo empty interrupt.

Re-enabling of interrupt was not correct when packets were still
pending. This patch also corrects this behaviour.
12. Code checks for space availability in fifo during
write_epmty_tx_fifo.  It was writing only when space available was
more than data to be written. So, it was writing 512 bytes only when
516 bytes space was available.  Modified condition check from  to
=.
13.  When TX fifo empty interrupt is received, transfer completion may
 not be true. Next transfer should only be started when transfer is
 complete, i.e. packet count in dieptsiz register has become zero.
14.  Max number of EP increased to 16
15. There can be few devices like SPEAr1340, which issues a connection
only after removal of soft disconnect. Default reset value is
disconnected.  It will not have any side effect even for the device
where reset value is connected.
16.  As per data sheet, when bit 31 of GRSTCTL is 1 then AHB is IDLE.
 Earlier function was waiting for this but to be 0, which was wrong.
17. Although name of file suggest that it is specific for PPC.  But, all
of its content are common for OTG and can be used for any platform.
There were some compilation issued on ARM platform with this file.
It has been removed by calling by proper functions.



Pratyush Anand (4):
  dwc/otg: Structure declaration for shared data
  include/linux/usb/gadget.h : include linux/device.h for successful
compilation
  usb/gadget/kconfig: added dwc otg as an option for peripheral
controller
  arm/include/asm/io.h : added macros to read/write big/little endian
register

Tirumala Marri (10):
  dwc/otg: Add Register definitions
  dwc/otg: Add driver framework
  dwc/otg: Add Core 

RE: [PATCH 00/14] Modifications for DWC OTG since v13

2011-08-30 Thread Tirumala Marri
-Original Message-
From: Pratyush Anand [mailto:pratyush.an...@st.com]
Sent: Tuesday, August 30, 2011 4:58 AM
To: linux-...@vger.kernel.org
Cc: tma...@apm.com; linuxppc-dev@lists.ozlabs.org; fc...@apm.com;
mmiesf...@apm.com; shiraz.has...@st.com; deepak.si...@st.com;
vipulkumar.sa...@st.com; rajeev-dlh.ku...@st.com; vipin.ku...@st.com;
bhupesh.sha...@st.com; viresh.ku...@st.com; amit.vi...@st.com; Pratyush
Anand
Subject: [PATCH 00/14] Modifications for DWC OTG since v13

These patches are based on:http://patchwork.ozlabs.org/patch/89560/
After not getting any reply from developers, I started to do
modifications for my platform (SPEAr1340).
I have done modifications in such a way that all the code in
driver/usb/dwc/ would be platform independent.
I have tested this code for host/device/dma/slave mode.
My fifo configuration is dedicated and dynamic.

[Tirumala Marri] We are working on our next release of patches. They
should be coming out soon.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/14] Modifications for DWC OTG since v13

2011-08-30 Thread Pratyush Anand
On Tue, Aug 30, 2011 at 8:57 PM, Tirumala Marri tma...@apm.com wrote:
 -Original Message-
 From: Pratyush Anand [mailto:pratyush.an...@st.com]
 Sent: Tuesday, August 30, 2011 4:58 AM
 To: linux-...@vger.kernel.org
 Cc: tma...@apm.com; linuxppc-dev@lists.ozlabs.org; fc...@apm.com;
 mmiesf...@apm.com; shiraz.has...@st.com; deepak.si...@st.com;
 vipulkumar.sa...@st.com; rajeev-dlh.ku...@st.com; vipin.ku...@st.com;
 bhupesh.sha...@st.com; viresh.ku...@st.com; amit.vi...@st.com; Pratyush
 Anand
 Subject: [PATCH 00/14] Modifications for DWC OTG since v13
 
 These patches are based on:http://patchwork.ozlabs.org/patch/89560/
 After not getting any reply from developers, I started to do
 modifications for my platform (SPEAr1340).
 I have done modifications in such a way that all the code in
 driver/usb/dwc/ would be platform independent.
 I have tested this code for host/device/dma/slave mode.
 My fifo configuration is dedicated and dynamic.

 [Tirumala Marri] We are working on our next release of patches. They
 should be coming out soon.

Oh, thats great !!
Actually, I did not get any reply of my previous mail on your patch release.
I thought no one is maintaining., and so I sent them with my modifications,
after testing them in all dev/host/otg mode.

Regards
Pratyush

 --
 To unsubscribe from this list: send the line unsubscribe linux-usb in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/14] Modifications for DWC OTG since v13

2011-08-30 Thread Kyungmin Park
On Wed, Aug 31, 2011 at 12:46 AM, Pratyush Anand
pratyush.an...@gmail.com wrote:
 On Tue, Aug 30, 2011 at 8:57 PM, Tirumala Marri tma...@apm.com wrote:
 -Original Message-
 From: Pratyush Anand [mailto:pratyush.an...@st.com]
 Sent: Tuesday, August 30, 2011 4:58 AM
 To: linux-...@vger.kernel.org
 Cc: tma...@apm.com; linuxppc-dev@lists.ozlabs.org; fc...@apm.com;
 mmiesf...@apm.com; shiraz.has...@st.com; deepak.si...@st.com;
 vipulkumar.sa...@st.com; rajeev-dlh.ku...@st.com; vipin.ku...@st.com;
 bhupesh.sha...@st.com; viresh.ku...@st.com; amit.vi...@st.com; Pratyush
 Anand
 Subject: [PATCH 00/14] Modifications for DWC OTG since v13
 
 These patches are based on:http://patchwork.ozlabs.org/patch/89560/
 After not getting any reply from developers, I started to do
 modifications for my platform (SPEAr1340).
 I have done modifications in such a way that all the code in
 driver/usb/dwc/ would be platform independent.
 I have tested this code for host/device/dma/slave mode.
 My fifo configuration is dedicated and dynamic.

 [Tirumala Marri] We are working on our next release of patches. They
 should be coming out soon.

 Oh, thats great !!
 Actually, I did not get any reply of my previous mail on your patch release.
 I thought no one is maintaining., and so I sent them with my modifications,
 after testing them in all dev/host/otg mode.

 Regards
 Pratyush

Hi,

Can you provide the git repo to test?
and I wonder what's the difference between dwc (from you) and dwc3
(from Felipe Balbi). I think it's dwc targets for usb 2.0 and dwc3 for
usb 3.0.

Thank you,
Kyungmin Park

 --
 To unsubscribe from this list: send the line unsubscribe linux-usb in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

 --
 To unsubscribe from this list: send the line unsubscribe linux-usb in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev