Skip to contentSkip to conversation

Driver(s) for Synopsys' DesignWare USB OTG

DISCUSSION Nikolai Zhubr 4 participants 7 messages Jan 7, 2012 – Jan 9, 2012

lore
Share & tools
lore
#0 lore raw

Hello developers,

I'm trying to find/combine/fix a driver for Synopsys' DesignWare USB controller. This thing is USB 2.0 host/slave/otg capable and is used in various SoCs including Amlogic 8726M, Ralink RT305x, and probably more.

There is some code floating around, partly usable, but all I could see for now is really not perfect. I also saw commit logs on linuxppc-dev, but failed to find out what repository they are related to. I'd like to know if someone is currently developing/testing/maintaining the driver or is planning to do so in the near future (in a FOSS-friendly manner - making development results public immediately and with eventual goal of inclusion into mainline) in order to avoid duplicate/uncoordinated work and waste of effort.

I'm currently examining 2 versions (That is, 2 sets of files):

1. From android kernel for 8726m-based tablets (like the one I own). Usable to some extent, but there are issues (e.g. it looks like certain packets get corrupted, reproducibly, relevant dumps are available)

2. From openwrt kernel for RT305x-based routers. The code looks a bit more tidy, but not quite well updated (slave-mode parts are unused in openwrt and they can not even be compiled for modern kernels without certain patching; have not tried host-mode on the hardware yet)

Quite obviously both versions originated from the same code initially, but subsequently were apparently tested/corrected/updated by separate teams. It is not quite clear if all bugfixes were cross-applied carefully (if at all). I was initially hoping that compare and bisect will just do the job, but the driver is quite huge... and some files have diverged substantially in the 2 versions, so at the moment I'm a bit fed up and will probably resume a bit later. Meanwhile, I'd be happy to discuss the subject with whoever interested in order to plan my further steps.

Please CC me, I'm not subscribed to the lists.

Thank you.
Nikolai.

#1 lore raw

2012/1/8 Nikolai Zhubr <[email protected]>:

Quoted 7 lines

Hello developers,

I'm trying to find/combine/fix a driver for Synopsys' DesignWare USB controller. This thing is USB 2.0 host/slave/otg capable and is used in various SoCs including Amlogic 8726M, Ralink RT305x, and probably more.

There is some code floating around, partly usable, but all I could see fo=

r

Quoted 2 lines

now is really not perfect. I also saw commit logs on linuxppc-dev, but failed to find out what repository they are related to. I'd like to know =

if

Quoted 3 lines

someone is currently developing/testing/maintaining the driver or is planning to do so in the near future (in a FOSS-friendly manner - making development results public immediately and with eventual goal of inclusio=

n

Quoted 1 line

into mainline) in order to avoid duplicate/uncoordinated work and waste o=

f

Quoted 5 lines

effort.

I'm currently examining 2 versions (That is, 2 sets of files):

1. From android kernel for 8726m-based tablets (like the one I own). Usab=

le

Quoted 1 line

to some extent, but there are issues (e.g. it looks like certain packets =

get

Quoted 3 lines

corrupted, reproducibly, relevant dumps are available)

2. From openwrt kernel for RT305x-based routers. The code looks a bit mor=

e

Quoted 1 line

tidy, but not quite well updated (slave-mode parts are unused in openwrt =

and

Quoted 1 line

they can not even be compiled for modern kernels without certain patching=

;

Quoted 3 lines

have not tried host-mode on the hardware yet)

Quite obviously both versions originated from the same code initially, bu=

t

Quoted 1 line

subsequently were apparently tested/corrected/updated by separate teams. =

It

Quoted 1 line

is not quite clear if all bugfixes were cross-applied carefully (if at al=

l).

Quoted 1 line

I was initially hoping that compare and bisect will just do the job, but =

the

Quoted 1 line

driver is quite huge... and some files have diverged substantially in the=

2

Quoted 1 line

versions, so at the moment I'm a bit fed up and will probably resume a bi=

t

Quoted 2 lines

later. Meanwhile, I'd be happy to discuss the subject with whoever interested in order to plan my further steps.

Please see:
http://marc.info/?l=3Dlinux-usb&m=3D129906859817430&w=3D2

I am not sure we can combine all Synopsys USB drivers to single file, but w= e
can try combine similar IP versions to one file, this work may need all Syn= opsys
USB IP driver maintainer work together.

Quoted 6 lines

Thank you.
Nikolai.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at =A0http://vger.kernel.org/majordomo-info.html

--=20
BR,
Peter Chen

#2 lore raw

Hello Piter,

Quoted 7 lines · you

2012/1/8 Nikolai Zhubr<[email protected]>:

Quoted 6 lines

Hello developers,

I'm trying to find/combine/fix a driver for Synopsys' DesignWare USB controller. This thing is USB 2.0 host/slave/otg capable and is used in various SoCs including Amlogic 8726M, Ralink RT305x, and probably more.

[...trim...]

Quoted 3 lines

Please see:
http://marc.info/?l=linux-usb&m=129906859817430&w=2

Ah, thanks. So sadly uncoordinated work in this area is quite common. However, in case of Synopsys the situation is even more disappointing because initially it _was_ a single driver! What probably lacked was some shared repository and proper communication between developers to stay in sync. Maybe there were also licensing issues at some point, though currently file headers contain rather reasonable (imho) permissive license from Synopsys.

Quoted 1 line

I am not sure we can combine all Synopsys USB drivers to single file, but we

Synopsys driver which I examine consists of 16 files (each of 2 versions), 200k lines total. I've already perpared some few smaller files for version merging. So probably it is doable, but quite a lot of work, therefore I wouldn't like it to be wasted.

Quoted 2 lines

can try combine similar IP versions to one file, this work may need all Synopsys USB IP driver maintainer work together.

Exactly. This is why I'm now trying to find all relevant people to begin with.

Thank you.
Nikolai.

Please CC me, I'm not subscribed to the lists.

Quoted 11 lines
Quoted 8 lines

Thank you.
Nikolai.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 15 lines · Nikolai Zhubr

Hello Piter,

Quoted 4 lines · you

2012/1/8 Nikolai Zhubr<[email protected]>:

Please see:
http://marc.info/?l=linux-usb&m=129906859817430&w=2

Ah, thanks. So sadly uncoordinated work in this area is quite common. However, in case of Synopsys the situation is even more disappointing because initially it _was_ a single driver! What probably lacked was some shared repository and proper communication between developers to stay in sync. Maybe there were also licensing issues at some point, though currently file headers contain rather reasonable (imho) permissive license from Synopsys.

Quoted 6 lines
Quoted 1 line

I am not sure we can combine all Synopsys USB drivers to single file, but we

Synopsys driver which I examine consists of 16 files (each of 2 versions), 200k lines total. I've already perpared some few smaller files for version merging. So probably it is doable, but quite a lot of work, therefore I wouldn't like it to be wasted.

I mean one file is just a common udc driver for all Synopsys, not all usb file. For ehci, I think it will be easier to use single file as well as some specific SoC's quirks if needed.
For udc, as there is no standard spec for how usb device should be designed, maybe different Synopsys IPs have a little different for work flow. For otg, it should be not difficult after we split PHY's operation from the otg, as common otg operation is the same.

Quoted 6 lines
Quoted 3 lines

can try combine similar IP versions to one file, this work may need all Synopsys USB IP driver maintainer work together.

Exactly. This is why I'm now trying to find all relevant people to begin with.

I know someone(@Pengutronix and @linux.intel.com) is doing that. I think first we should find which driver file at current code base is most capable and compatible. I would like to help it, and verify it at Freescale i.MX SoCs.

Quoted 24 lines

Thank you.
Nikolai.

Please CC me, I'm not subscribed to the lists.

Quoted 11 lines
Quoted 8 lines

Thank you.
Nikolai.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best Regards,
Peter Chen
#5 lore raw
In reply to Nikolai Zhubr
Quoted 19 lines · Nikolai Zhubr

Hello Piter,

Quoted 9 lines · you

2012/1/8 Nikolai Zhubr<[email protected]>:

Quoted 7 lines

Hello developers,

I'm trying to find/combine/fix a driver for Synopsys' DesignWare USB controller. This thing is USB 2.0 host/slave/otg capable and is used in various SoCs including Amlogic 8726M, Ralink RT305x, and probably more.

[...trim...]

Quoted 4 lines

Please see:
http://marc.info/?l=linux-usb&m=129906859817430&w=2

Quoted 7 lines

Ah, thanks. So sadly uncoordinated work in this area is quite common. However, in case of Synopsys the situation is even more disappointing because initially it _was_ a single driver! What probably lacked was some shared repository and proper communication between developers to stay in sync. Maybe there were also licensing issues at some point, though currently file headers contain rather reasonable (imho) permissive license from Synopsys.

I think the challenge of cooperation in situation like this is that most companies don't like to advertise the source of the licensed IP block. Even the owner of the IP block doesn't list all users of the block(maybe business requirement). It was really hard to find out if the same IP has been used by anyone else. Also the owner of this USB IP block has been changed for several times(ARC, TDI, ChipIdea, and Synopsys) which made it even more difficult to tell.

Quoted 10 lines
Quoted 4 lines

I am not sure we can combine all Synopsys USB drivers to single file, but we

Synopsys driver which I examine consists of 16 files (each of 2 versions), 200k lines total. I've already perpared some few smaller files for version merging. So probably it is doable, but quite a lot of work, therefore I wouldn't like it to be wasted.

I didn't examine the Synopsys driver myself. But if it is so complex as you described, it might be better to start with the in-tree drivers IMO.

- Leo

#4 lore raw
In reply to Peter Chen

Hello Peter,

09.01.2012 6:12, Peter Chen:

Quoted 14 lines
Quoted 6 lines
Quoted 1 line

I am not sure we can combine all Synopsys USB drivers to single file, but we

Synopsys driver which I examine consists of 16 files (each of 2 versions), 200k lines total. I've already perpared some few smaller files for version merging. So probably it is doable, but quite a lot of work, therefore I wouldn't like it to be wasted.

I mean one file is just a common udc driver for all Synopsys, not all usb file. For ehci, I think it will be easier to use single file as well as some specific SoC's quirks if needed.
For udc, as there is no standard spec for how usb device should be designed, maybe different Synopsys IPs have a little different for work flow. For otg, it should be not difficult after we split PHY's operation from the otg, as common otg operation is the same.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

can try combine similar IP versions to one file, this work may need all Synopsys USB IP driver maintainer work together.

Exactly. This is why I'm now trying to find all relevant people to begin with.

I know someone(@Pengutronix and @linux.intel.com) is doing that. I think first we should find which driver file at current code base is most capable and compatible. I would like to help it, and verify it at Freescale i.MX SoCs.

Ok. Because my resources are limited (and my knowledge is actually limited too) I'll list what exactly I'm able (and willing) to do:

- split formatting/naming/uninteresting changes from algorythmical changes, prepare clean diffs as necessary (boring work, but anyway);
- bisect changes which make the driver stop working on my tablet;
- try whichever driver parameters and see what happens to my tablet;
- connect the tablet to a regular linux PC with USB cable, do some tests, capture traffic dumps as necessary;
- connect some devices to the tablet, do tests, report results;

and with some luck:
- prepare bufixes (depending very much on how simple is the bug).

So basically my effort would probably only be usefull in cooperation with someone with more knowledge and understanding of the situation in whole. Otherwise it would be more wasting of time.

If usb issues were solved, it might make some sense to try to create e.g. a generic openwrt target for 8726m-based tablet. (Of course it wouldn't allow to use the device for its intended purpose yet, but still might be interesting as kind of devel/testing reference option)

Thank you.
Nikolai.

Quoted 25 lines
Quoted 24 lines

Thank you.
Nikolai.

Please CC me, I'm not subscribed to the lists.

Quoted 11 lines
Quoted 8 lines

Thank you.
Nikolai.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to Leo Li

Hello Leo,

09.01.2012 9:17, Leo Li:

Quoted 9 lines · Nikolai Zhubr
Quoted 8 lines
Quoted 8 lines

2012/1/8 Nikolai Zhubr<[email protected]>:

Quoted 7 lines

Hello developers,

I'm trying to find/combine/fix a driver for Synopsys' DesignWare USB controller. This thing is USB 2.0 host/slave/otg capable and is used in various SoCs including Amlogic 8726M, Ralink RT305x, and probably more.

[...trim...]

Quoted 8 lines

I think the challenge of cooperation in situation like this is that most companies don't like to advertise the source of the licensed IP block. Even the owner of the IP block doesn't list all users of the block(maybe business requirement). It was really hard to find out if the same IP has been used by anyone else. Also the owner of this USB IP block has been changed for several times(ARC, TDI, ChipIdea, and Synopsys) which made it even more difficult to tell.

Ah, I see. It explains.
But communicating in private and keeping some public repository up to date would still be allowed I suppose?

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

I am not sure we can combine all Synopsys USB drivers to single file, but we

Quoted 8 lines
Quoted 4 lines

Synopsys driver which I examine consists of 16 files (each of 2 versions), 200k lines total. I've already perpared some few smaller files for version merging. So probably it is doable, but quite a lot of work, therefore I wouldn't like it to be wasted.

I didn't examine the Synopsys driver myself. But if it is so complex as you described, it might be better to start with the in-tree drivers IMO.

Unfortunately its far beyond my capabilities at the moment. Besides, it looks like huge effort has already been invested into the existing driver, so to me it seems fixing it rather than starting from scratch would be more realistic anyway (unless a company with unlimited resources step in...)

Thank you.
Nikolai.

Quoted 4 lines

- Leo