
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 06/29/2012 08:58 PM, Marek Vasut wrote:
Dear Harman Sohanpal,
On Sat, Jun 30, 2012 at 6:15 AM, Marek Vasut marex@denx.de wrote:
Dear Harman Sohanpal,
These patches add USB support in u-boot for AM335x. The support for host or device is selected depending on the config selected from boards.cfg file. Host mode is selected for USB1 and device mode is selected for USB0. Base addresses are selected accordingly.
Gene Zarkhin (1): AM335x : Add USB support for AM335x in u-boot
Harman Sohanpal (2): AM335x : Configs to add USB host support. musb_udc : Fix compile warning.
Dumb question ... but, can this not be made part of am35x USB ?
Hi Marek, Well this can always be made part of am35x.c. But there would be a lot of changes required in the file.
Why? They use different IP block or something?
It's not an identical block so register maps have changed slightly. More so if we get a later conversion of the other similar parts (da850.c, davinci.c, omap3.c).
And also I believe it would not make much sense. It would require ifdefs at a lot of places. Best example I can give to support what i said is that the control register is at an offset of 4 in am35x and 14 in am335x.
So what, define two sets of register structures and pass them according to CPU ID.
I am sure adding an ifdef at that place would not seem good to you to change address from 4 to 14 acc to platform.
well ... struct regs_a { uint32_t padding[?]; uint32_t reg; ... };
struct regs_b { uint32_t reg; ... };
Create IO accessors ... like ... my_usb_writel() and my_usb_readl() to read and write the registers. And those accessors will cover the differences. Or is there more?
Is there much pain to add these 2 files?
Yes, duplication of code is always bad.
In my opinion we must need to have a separate file for this.
Why? If it's only about the registers, won't the approach above work?
This is as per my understanding. It could also cause confusions to some due to name. maybe :)
I'm no omap guru, Tom is. Tom?
I think what we need to do is take a shot at converting am35x.c and am335x.c into a 'ti_musb.[ch]' and per-family header files that give the register layout, etc, etc. We need to see how maintainable or not such a setup will be.
- -- Tom