mark_3094
Posts: 74
Joined: Mon Jul 02, 2012 8:38 am
Location: Australia
Contact: Website

Implementing a USB Driver

Mon Dec 31, 2012 8:07 am

Hi,

I have had a look through the BCM2835 manual, and in the section on USB it refers to "DesignWare Hi-Speed USB On-the-Go Controller" documentation:
https://www.synopsys.com/dw/ipdir.php?d ... 2_0_hs_otg

I went to this site and I can't download it, as when I try it tells me that I need an account, and the site is undergoing maintenance, etc... It also refers to needing a site ID, so I probably would need an account with them or something.

Does anyone know if there's somewhere else that I can find this documentation? Or whether it's publically available at all?

I have had a look at the USB driver here:
https://github.com/Chadderz121/csud
However, without the documentation I'm not sure what is being done and why.


Thanks for your help

ghans
Posts: 7791
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Implementing a USB Driver

Mon Dec 31, 2012 9:47 am

The only one who has access to the IP is Gordon (gsh) AFAIK ,
because he works for Broadcom.
He tried to publicise a usable Datasheet , but something
(legal ?) got in his way.
And it doesn't look like Synopsys will simply give you that info.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

mark_3094
Posts: 74
Joined: Mon Jul 02, 2012 8:38 am
Location: Australia
Contact: Website

Re: Implementing a USB Driver

Mon Dec 31, 2012 10:43 am

I thought that may be the case...

Has anyone figured out (and documented) anything from the Linux drivers?
I was able to get the memory locations for several registers from the CSUD driver, but that's all so far.

ghans
Posts: 7791
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Implementing a USB Driver

Mon Dec 31, 2012 10:58 am

AFAIK the guys who ported Plan 9 had made some headway already ...

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Mon Dec 31, 2012 12:39 pm

This whole "cloak and dagger" thing from Broadcom is really irritating me now and am I the only one
that thinks it's getting in the way of real progress (not to mention freedom) in using the RPI?

As far as I can gather, the chip set used in the RPI was originally designed for set top boxes so I understand
that there could be some "sticky" issues revolving around the GPU and more speciffically codecs
but USB?
What is so secret about it?

What next, Ethernet?

ghans
Posts: 7791
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Implementing a USB Driver

Mon Dec 31, 2012 12:48 pm

This is not Broadcoms IP.
They did not even write the Linux driver AFAIK.
So you should focus on those who are actually the creators
of it.
You might have noticed that the Ethernet chip is a
USB Hub at the same time.
Interestingly , it isn't made by Broadcom either.


ghans

PS: You are currently a customer of a customer of a licensee to Synopsys ,
i'm not sure if they mind your pleas at all.
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Mon Dec 31, 2012 6:22 pm

Rene_is_I wrote:This whole "cloak and dagger" thing from Broadcom is really irritating me now and am I the only one
that thinks it's getting in the way of real progress (not to mention freedom) in using the RPI?

As far as I can gather, the chip set used in the RPI was originally designed for set top boxes so I understand
that there could be some "sticky" issues revolving around the GPU and more speciffically codecs
but USB?
What is so secret about it?

What next, Ethernet?
Er, what clock and dagger stuff are you talking about? Synopsis designed the USB hardware in the chip, and provided the driver. Which sucks (that fact wasn't known at the time). Broadcom, since they bought the design, do have access to the RTL and documentation (which also sucks). BUT, they are not allowed to distribute that information. Nothing cloak and dagger at all.

The chip wasn't specifically designed for Set top boxes, it just found that niche. Then it found the Raspi...
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Mon Dec 31, 2012 10:33 pm

@jamesh

So let me get this straight, Broadcom bought a crappy design from Synopsis, now they are stuck
with it and can't even release some info so that the community could possibly come up with a
solution/work-around at no cost to Broadcom?

Sounds like a very bad deal to me.

ghans
Posts: 7791
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Implementing a USB Driver

Tue Jan 01, 2013 12:32 am

The only customer using the USB host mode is
the Raspberry Pi foundation AFAIK. No other customer did
choose this outdated SoC for a recent product , because they
simply can afford better or take anything else.
I don't think anyone else will ever choose this SoC again too,
because it is so outdated.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 6:33 am

Surely you mean badly designed?
Just because something is outdated, does not make it bad.

User avatar
Chadderz
Posts: 64
Joined: Thu Aug 30, 2012 12:50 pm
Location: Cambridge, UK

Re: Implementing a USB Driver

Tue Jan 01, 2013 9:24 am

The lack of documentation is a barrier, but shouldn't stop you. I developed the CSUD driver by example. I accept, this is severely limiting, but it can be done with enough effort. If you have any questions, I can have a stab at answering them.

richardp
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:04 am

Rene_is_I wrote:
As far as I can gather, the chip set used in the RPI was originally designed for set top boxes so I understand
that there could be some "sticky" issues revolving around the GPU....
Not a STB processor. It has all the hallmarks of a mobile phone CPU. PoP memory, no Ethernet Mac, camera port, USB OTG port....etc. I think the Nokia N8 phone uses the CPU.

R
RaspberryPi's galore
Solid run CuBox
ODroid U2

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:09 am

@ Chadderz
That is exactly the point.

SOme RPI users have the capability and know how to reverse engineer, troll thru thousands of lines
of code (in the linux source code) and spend countless hours researching online for something when
it could have all been avoided if only the documentation was available.
Surely this is a big barrier for others that can't or don't have the time for this whole rig moral.

I thought the RPI was meant to be an educational tool meant to bring the joys and ease of programming
back to the "masses" but it's bogged down in non-existent documentation, legal IP issues and according
to jamesh even some crappy hardware and/or drivers.
Not much fun then is it?

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:19 am

richardp wrote: Not a STB processor. It has all the hallmarks of a mobile phone CPU. PoP memory, no Ethernet Mac, camera port, USB OTG port....etc. I think the Nokia N8 phone uses the CPU.

R
Could very well be as I have a N8 and often wondered why it has a HDMI output but no composite video output like other phones do.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:20 am

richardp wrote:
Rene_is_I wrote:
As far as I can gather, the chip set used in the RPI was originally designed for set top boxes so I understand
that there could be some "sticky" issues revolving around the GPU....
Not a STB processor. It has all the hallmarks of a mobile phone CPU. PoP memory, no Ethernet Mac, camera port, USB OTG port....etc. I think the Nokia N8 phone uses the CPU.

R
The 808 (and all the latest Symbian Smartphones) use the BCM2763, which is a BCM2835 without the Arm. A Videocore 4 coprocessor in effect. The N8 uses a BCM2727 which is a Videocore 3.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:24 am

Very interesting info jamesh, thanks.
Since I'm not fimiliar with all the Nokia models, do you perhaps know which CPU the new Nokia Windows phones use?

By the way, I see that the 808 has a FM transmitter like the N8.
Very handy for traffic jams or in stores that play background music from a local radio station :D
Last edited by Rene_is_I on Tue Jan 01, 2013 10:31 am, edited 1 time in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:29 am

Rene_is_I wrote:@ Chadderz
That is exactly the point.

SOme RPI users have the capability and know how to reverse engineer, troll thru thousands of lines
of code (in the linux source code) and spend countless hours researching online for something when
it could have all been avoided if only the documentation was available.
Surely this is a big barrier for others that can't or don't have the time for this whole rig moral.

I thought the RPI was meant to be an educational tool meant to bring the joys and ease of programming
back to the "masses" but it's bogged down in non-existent documentation, legal IP issues and according
to jamesh even some crappy hardware and/or drivers.
Not much fun then is it?
Chill out man, stop going off on one. Yes, the Synopsis design is a bit pants. Broadcom didn't know that at the time. It's quite possible this is the first time this design has been used as a host - the client side works fine which is what is usually used in systems that use the design - so its entirely possible no-one has ever encountered the problems before. Now on to the legal stuff. Broadcom are NOT ALLOWED to distribute the RTL or the documentation for this design. It part of the legal contract between Broadcom and Synopsis drawn up when the design was bought. It would be good if they could, because there are indeed some decent engineers out there. But they cannot. This is the COMPLETELY standard approach to this - chip companies buy designs from others, and those designs are built in to chips. But most people never know that the chip they are using uses IP from many sources, because its all handled by the end supplier (in this case Broadcom). I guarantee many chips you use in your every day life use exactly the same system. Including your N8 which has exactly the same Synopsis design inside it IIRC!

But that said, as far as I concerned, having the USB HW docs is irrelevent to the educational possibilities of the Raspi. The vast majority of people can use it fine right now, and once gsh has had another go at the driver, it will be even better. It already brings the 'joys and ease' of programming to the masses, even now. ANd will only get better. It;s fun now - you shouldn't let one tiny aspect which you don't like put you off the rest of the product.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:30 am

Rene_is_I wrote:Very interesting info jamesh, thanks.
Since I'm not fimiliar with all the Nokia models, do you perhaps know which CPU the new Nokia Windows phones use?
Qualcomm I think. Not entirely sure though.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 10:40 am

@jamesh

Code: Select all

MyRant:

MOV r4, 0
SWI ReturnFromTangent
B MyRant

OK ;)
Seriously though, I don't want to program and tinker with my N8 but I do with my RPI
but we will leave it at that.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 6:01 pm

Rene_is_I wrote:@jamesh

Code: Select all

MyRant:

MOV r4, 0
SWI ReturnFromTangent
B MyRant

OK ;)
Seriously though, I don't want to program and tinker with my N8 but I do with my RPI
but we will leave it at that.
Well, I'm sure there is plenty to tinker with on the Raspi without having the USB docs...I'd give you a list , but, well, it's a long list. As I've said, Gordon's going to be working full time on the USB stuff - he DOES have access to the docs AND the RTL (he's of the opinion you need the RTL as the docs are, shall we say, less than perfect)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 7:01 pm

@jamesh

That is good news that Gordon will be working on the USB.
Perhaps he could even publish some sort of API listing which will allow
others to access the hardware.
Surely this would not be infringing on the NDA?

dwelch67
Posts: 943
Joined: Sat May 26, 2012 5:32 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 7:34 pm

Rene_is_I wrote:@ Chadderz
That is exactly the point.

SOme RPI users have the capability and know how to reverse engineer, troll thru thousands of lines
of code (in the linux source code) and spend countless hours researching online for something when
it could have all been avoided if only the documentation was available.
Surely this is a big barrier for others that can't or don't have the time for this whole rig moral.

I thought the RPI was meant to be an educational tool meant to bring the joys and ease of programming
back to the "masses" but it's bogged down in non-existent documentation, legal IP issues and according
to jamesh even some crappy hardware and/or drivers.
Not much fun then is it?
I dont remember seeing anywhere where it was designed for bare metal programming education. Add software, etc and it becomes a very inexpensive, linux programming and general linux platform for the masses. Many many programming languages and environments are supported.

Bare metal, that is for folks that are willing to work for their education and results anyway, dont want to take the lazy path. From a bare metal perspective this chip is actually one of the easiest I have had the pleasure of programming. The drawback of course is Broadcom. On the bright side though they have come out of their shell a bit and actually provided some flavor of document, and from what I guess, are backing this project.

Relative to other platforms, programming at the bare metal level, this *IS* actually a fun system due to its simplicity. All vendors documents suck. Broadcom doc is on the bad end of that scale yes, but the community support compensates. Ever notice that some folks like to sit in their garage and re-build a car from the ground up that they are hardly ever going to drive? And some folks buy a fixed up car to park it as well, and others buy it or fix it up to actually drive it. Some folks like to spend their spare time digging through source code and hacking at hardware trying to figure out how something works.

BTW I second jamesh, right on the money there. I know first hand that chip companies buy/license IP from some vendor. As much as the engineers may wish that DDR3, PCIe, ethernet, etc are all in house designs, they are usually purchased. Even worse under some flavor of NDA which makes creating a programming manual and providing source for software painful for those logic blocks. And you always have that gamble of how well did the IP vendor test their product (likewise how well were you able to test it), by the time you figure out they have a major or minor bug, you may have already taped out and be into silicon. Even worse (if you can afford a spin and) if the IP vendor ditches the design they sold you and moves on to another. It is the nature of the chip business. You gamble on the time frame to do your in house designs, you gamble on the purchased designs, you gamble on the testing you can get done, you gamble on the foundry and the technology. Makes you wonder why 95% of silicon start-ups fail.

David

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 7:35 pm

Rene_is_I wrote:@jamesh

That is good news that Gordon will be working on the USB.
Perhaps he could even publish some sort of API listing which will allow
others to access the hardware.
Surely this would not be infringing on the NDA?
I don't know the legalities. It may be even a completely new document that described the HW interface would go against the NDA. There's a lot of code already in this driver - it would be a brave man who attempted to completely rewrite it although some will try, certainly the bare metal people!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 7:36 pm

dwelch67 wrote: BTW I second jamesh, right on the money there. I know first hand that chip companies buy/license IP from some vendor. As much as the engineers may wish that DDR3, PCIe, ethernet, etc are all in house designs, they are usually purchased. Even worse under some flavor of NDA which makes creating a programming manual and providing source for software painful for those logic blocks. And you always have that gamble of how well did the IP vendor test their product (likewise how well were you able to test it), by the time you figure out they have a major or minor bug, you may have already taped out and be into silicon. Even worse (if you can afford a spin and) if the IP vendor ditches the design they sold you and moves on to another. It is the nature of the chip business. You gamble on the time frame to do your in house designs, you gamble on the purchased designs, you gamble on the testing you can get done, you gamble on the foundry and the technology. Makes you wonder why 95% of silicon start-ups fail.
David
Well, I do work for Broadcom, so do have some inside information!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Rene_is_I
Posts: 172
Joined: Tue Dec 25, 2012 12:52 pm

Re: Implementing a USB Driver

Tue Jan 01, 2013 7:54 pm

dwelch67 wrote:
Bare metal, that is for folks that are willing to work for their education and results anyway, dont want to take the lazy path.
Agreed but there is a limit of what is realistically achievable if the facts and figures are kept secret.
It just makes it harder for more people to experiment with.
Others will reverse engineer and some will even have access to high speed data analyzers making it
possible to peek at the data being exchanged with the chip (if it's a stand alone one).
Since none of these folks would have signed a NDA, they will be free to share the info although there
may be legal ramifications if money is made from the resulting code but for tinkering with, it should be OK.
Last edited by Rene_is_I on Tue Jan 01, 2013 8:06 pm, edited 2 times in total.

Return to “Bare metal, Assembly language”

Who is online

Users browsing this forum: No registered users and 10 guests