Skip to contentSkip to conversation

AM335x: Add USB support in u-boot.

PATCH New Harman Sohanpal 4 participants 15 messages Jun 29, 2012 – Oct 16, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover AM335x: Add USB support in u-boot.

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.

 drivers/usb/musb/Makefile    |    1 +
 drivers/usb/musb/am335x.c    |  121 ++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/musb/am335x.h    |  113 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/musb/musb_core.h |    2 +
 drivers/usb/musb/musb_hcd.h  |    3 -
 include/configs/am335x_evm.h |   41 ++++++++++++++
 include/usb.h                |    3 +-
 7 files changed, 280 insertions(+), 4 deletions(-)
 create mode 100644 drivers/usb/musb/am335x.c
 create mode 100644 drivers/usb/musb/am335x.h
#1 lore raw

PATCH v4 1/3 AM335x : Add USB support for AM335x in u-boot

From: Gene Zarkhin <[email protected]>

Adds USB support in uboot for AM335x.
The support for USB0 and USB1 can be added dynamically by changing the boards.cfg file for USB0 or USB1. This patch adds support for USB0.
USB 1 has a full size connector so acts in host mode and USB 0 has a mini connector so used in device mode.

---
Changes for v2:
- none
Changes for v3:
- Changed commit message to specify why USB 1 has been enabled by default.
Changes for v4:
- Selected USB module from board.cfg.
- Cleaned up indentation.
- Base address of USB selected according to config selected in boards.cfg.

 boards.cfg                |    2 +-
 drivers/usb/musb/Makefile |    1 +
 drivers/usb/musb/am335x.c |  121 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/musb/am335x.h |  122 +++++++++++++++++++++++++++++++++++++++++++++
 include/usb.h             |    3 +-
 5 files changed, 247 insertions(+), 2 deletions(-)
 create mode 100644 drivers/usb/musb/am335x.c
 create mode 100644 drivers/usb/musb/am335x.h
boards.cfg +1 -1
index 9ef903a..35aec79 100644
@@ -183,7 +183,7 @@ versatileqemu                arm         arm926ejs   versatile           armltd
 integratorap_cm946es         arm         arm946es    integrator          armltd         -               integratorap:CM946ES
 integratorcp_cm946es         arm         arm946es    integrator          armltd         -               integratorcp:CM946ES
 ca9x4_ct_vxp                 arm         armv7       vexpress            armltd
-am335x_evm                   arm         armv7       am335x              ti             am33xx
+am335x_evm                   arm         armv7       am335x              ti             am33xx		am335x_evm:AM335X_USB0
 highbank                     arm         armv7       highbank            -              highbank
 efikamx                      arm         armv7       efikamx             -              mx5		efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKAMX,IMX_CONFIG=board/efikamx/imximage_mx.cfg
 efikasb                      arm         armv7       efikamx             -              mx5		efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKASB,IMX_CONFIG=board/efikamx/imximage_sb.cfg
drivers/usb/musb/Makefile +1 -0
index 20b5503..d00ec40 100644
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
 COBJS-$(CONFIG_USB_OMAP3) += omap3.o
 COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
 COBJS-$(CONFIG_USB_AM35X) += am35x.o
+COBJS-$(CONFIG_USB_AM335X) += am335x.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/usb/musb/am335x.c new file +121 -0

121 lines not on this page · raw message

drivers/usb/musb/am335x.h new file +122 -0

122 lines not on this page · raw message

include/usb.h +2 -1
index 6da91e7..13f5434 100644
@@ -141,7 +141,8 @@ struct usb_device {
 	defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
 	defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
 	defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
-	defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)
+	defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X) || \
+	defined(CONFIG_USB_AM335X)
 
 int usb_lowlevel_init(void);
 int usb_lowlevel_stop(void);
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v4 2/3 AM335x : Configs to add USB support.

In reply to Harman Sohanpal

Adds required configs in config file for am335x_evm to add support for usb.
Host mode or device mode selected according to the USB module selected from boards.cfg file. Host for USB1 and device for USB0.
By default USB0 is selected.

---
Changes for v2:
- #define cleanups
Changes for v3:
- remove configs for usb as keyboard in host mode.
- removed extra test of CONFIG_USB_AM335X
- changed commit message.
Changes for v4:
-Selecting USB module according to config selected
from boards.cfg file.
- Selecting host mode if USB1 is selected.
- Selecting device mode if USB0 is selected.

 include/configs/am335x_evm.h |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
include/configs/am335x_evm.h +36 -0
index d0fbc88..2a3ae0c 100644
@@ -165,6 +165,42 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
+
+/*
+ * USB configuration
+ * Enables CONFIG_MUSB_HCD for Host functionalities MSC for USB1
+ * Enables CONFIG_MUSB_UDC for Device functionalities for USB0
+ * Selected according to the USB module selected from boards.cfg.
+ */
+
+#define CONFIG_USB_AM335X
+#ifdef CONFIG_AM335X_USB0
+#define CONFIG_MUSB_UDC
+#elif defined(CONFIG_AM335X_USB1)
+#define CONFIG_MUSB_HCD
+#endif
+
+#ifdef CONFIG_MUSB_HCD
+#define CONFIG_CMD_USB
+#define CONFIG_USB_STORAGE
+#define CONGIG_CMD_STORAGE
+#define CONFIG_CMD_FAT
+#endif /* CONFIG_MUSB_HCD */
+
+#ifdef CONFIG_MUSB_UDC
+/* USB device configuration */
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_USB_DEVICE
+#define CONFIG_USB_TTY
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#endif	/* CONFIG_SPL_BUILD */
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID            0x0451
+#define CONFIG_USBD_PRODUCTID           0x5678
+#define CONFIG_USBD_MANUFACTURER        "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME        "AM335xEVM"
+#endif /* CONFIG_MUSB_UDC */
+
 /* Unsupported features */
 #undef CONFIG_USE_IRQ
 
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH v4 3/3 musb_udc : Fix compile warning.

In reply to Harman Sohanpal

Fix the compile warning :
implicit declaration of musb_platform_init
when CONFIG_MUSB_UDC is defined.
The extern musb_platform_init was declared in musb_hcd.h but no such extern function was declared for musb_udc. So a common function has been declared in musb_core.h which can be used for both host mode and device mode.

---
Changes for v2:
- none
Changes for v3:
- none
Changes for v4:
- none

 drivers/usb/musb/musb_core.h |    2 ++
 drivers/usb/musb/musb_hcd.h  |    3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/usb/musb/musb_core.h +2 -0
index a8adcce..14253f0 100644
@@ -360,6 +360,8 @@ extern void musb_start(void);
 extern void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt);
 extern void write_fifo(u8 ep, u32 length, void *fifo_data);
 extern void read_fifo(u8 ep, u32 length, void *fifo_data);
+extern int musb_platform_init(void);
+extern void musb_platform_deinit(void);
 
 #if defined(CONFIG_USB_BLACKFIN)
 /* Every USB register is accessed as a 16-bit even if the value itself
drivers/usb/musb/musb_hcd.h +0 -3
index dde7d37..5621f7e 100644
@@ -105,8 +105,5 @@ extern unsigned char new[];
 #define RH_REQ_ERR		   -1
 #define RH_NACK			   0x00
 
-/* extern functions */
-extern int musb_platform_init(void);
-extern void musb_platform_deinit(void);
 
 #endif	/* __MUSB_HCD_H__ */
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH v4 3/3 musb_udc : Fix compile warning.

Dear Harman Sohanpal,

Quoted 9 lines

Fix the compile warning :
implicit declaration of musb_platform_init
when CONFIG_MUSB_UDC is defined.
The extern musb_platform_init was declared in musb_hcd.h but no such extern function was declared for musb_udc. So a common function has been declared in musb_core.h which can be used for both host mode and device mode.

[...]

Tom, what's the status? I dont see the warning.

Best regards,
Marek Vasut

#5 lore raw

PATCH v4 3/3 musb_udc : Fix compile warning.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/15/12 22:43, Marek Vasut wrote:

Lets just drop this patch. The whole series if still in patchwork should be superseded by the work Ilya is doing for MUSB.

- --
Tom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQfXBLAAoJENk4IS6UOR1WpqoQAJXf8eI46hYnDEi0USaiErml FEBVR3gn+PjQBTFmZHV+x7CXrNtr7knMht5xV/EFYVhnMUuNAHMRH8Txbcp01FSf VM4nZtTIRYvEknkY4vDdqu+xv5xjc8mNiPfyrjkefjMkCIETFWKc0N7bBdlKhyOs PNSkCybZ7dB6Rpicu1Xls+9B+TIUdAiqCvMnJtumcwYx5M6IkXVQS0I1RcMBFjEt M0oQ7AtsYcVTCO9A1H/m+AEk6egUjEmqSz1lxHm5/TGf5O+54jn+GK2WPwsZhj6Y pamdOuKNx3AjQifzZTs71Is2WEpCsSd6InHrx3+LKjLBcio3pHJVlbxJ+DnWO7XY stc3WCXrM6681kJKhmJDbCbQWN+gbo2vm/HIlYgTlhLg3cDGOjoOvVOOwLZGmLRJ YRU6vnxDoLwCIfjLwVgp1vLwox6jTLjGPoUQK30KeBQxDePO2+PpLuxirsdLmLEa Vxw9Qz9m9k4/C1mW/p0ySgFEMe6xpXtg1w8LbYQSVA3da5z6pfkIkbi+sQzNB+dF NHLl/xST9UnCPX9DGOzsUClw/gpXmoIlNoisoUIRXZ771ENSyLpmrhrET2MUO6NT zTt7maQjQZmOOAKNeNPQmm4RCmSQmDOjpacfKBvCHUblKg77qHJGUuE7RR7X+39H /UQ1037H2OBgvc1NnsSV
=fPvR
-----END PGP SIGNATURE-----

#6 lore raw

v4 cover AM335x: Add USB support in u-boot.

In reply to Harman Sohanpal

Dear Harman Sohanpal,

Quoted 6 lines

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.

I'll go through these once I get some sleep ... aka in 12 hours or so

Best regards,
Marek Vasut

#7 lore raw

v4 cover AM335x: Add USB support in u-boot.

In reply to Harman Sohanpal

Dear Harman Sohanpal,

Quoted 7 lines

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.

Quoted 6 lines

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 ?

Quoted 11 lines
 drivers/usb/musb/Makefile    |    1 +
 drivers/usb/musb/am335x.c    |  121
++++++++++++++++++++++++++++++++++++++++++ drivers/usb/musb/am335x.h    | 
113 +++++++++++++++++++++++++++++++++++++++ drivers/usb/musb/musb_core.h |
   2 +
 drivers/usb/musb/musb_hcd.h  |    3 -
 include/configs/am335x_evm.h |   41 ++++++++++++++
 include/usb.h                |    3 +-
 7 files changed, 280 insertions(+), 4 deletions(-)
 create mode 100644 drivers/usb/musb/am335x.c
 create mode 100644 drivers/usb/musb/am335x.h

Best regards,
Marek Vasut

#8 lore raw

v4 cover AM335x: Add USB support in u-boot.

Quoted 9 lines · Marek Vasut

Dear Harman Sohanpal,

Quoted 7 lines

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.

Quoted 8 lines
Quoted 6 lines

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. 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.
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. Is there much pain to add these 2 files?
In my opinion we must need to have a separate file for this. This is as per my understanding.
It could also cause confusions to some due to name. maybe :) Kindly give your thoughts.
In case still some changes are required, we can think upon it :) Thanks,
Harman

Quoted 14 lines
Quoted 11 lines

?drivers/usb/musb/Makefile ? ?| ? ?1 + ?drivers/usb/musb/am335x.c ? ?| ?121 ++++++++++++++++++++++++++++++++++++++++++ drivers/usb/musb/am335x.h ? ?| 113 +++++++++++++++++++++++++++++++++++++++ drivers/usb/musb/musb_core.h | ? ?2 +

?drivers/usb/musb/musb_hcd.h ?| ? ?3 -
?include/configs/am335x_evm.h | ? 41 ++++++++++++++
?include/usb.h ? ? ? ? ? ? ? ?| ? ?3 +-

?7 files changed, 280 insertions(+), 4 deletions(-) ?create mode 100644 drivers/usb/musb/am335x.c ?create mode 100644 drivers/usb/musb/am335x.h

Best regards,
Marek Vasut

#9 lore raw

v4 cover AM335x: Add USB support in u-boot.

Dear Harman Sohanpal,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Dear Harman Sohanpal,

Quoted 13 lines

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

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.

Quoted 2 lines

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?

Quoted 1 line

Is there much pain to add these 2 files?

Yes, duplication of code is always bad.

Quoted 1 line

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?

Quoted 2 lines

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?

Quoted 1 line

Kindly give your thoughts.

Oh my brain is spinning from this :-)

Quoted 1 line

In case still some changes are required, we can think upon it :)

I'm really glad to hear that, let's do our best to find the best possible solution :-)

Quoted 2 lines

Thanks,
Harman

Best regards,
Marek Vasut

#10 lore raw

v4 cover AM335x: Add USB support in u-boot.

Quoted 77 lines · Marek Vasut

Dear Harman Sohanpal,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Dear Harman Sohanpal,

Quoted 13 lines

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

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.

Quoted 2 lines

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?

Quoted 1 line

Is there much pain to add these 2 files?

Yes, duplication of code is always bad.

Quoted 1 line

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?

Quoted 2 lines

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?

Quoted 1 line

Kindly give your thoughts.

Oh my brain is spinning from this :-)

Quoted 1 line

In case still some changes are required, we can think upon it :)

I'm really glad to hear that, let's do our best to find the best possible solution :-)

Quoted 6 lines
Quoted 2 lines

Thanks,
Harman

Best regards,
Marek Vasut

Also we are adding the USB module to be selected dynamically from boards.cfg as suggested by Tom.
If such is the case I believe the same should be done for am35x. Also from the previous mail of Tom, he seemed to be fine with separate files.
The best approach would be to wait for Tom's reply. Thanks for the review :)
Harman

#11 lore raw

v4 cover AM335x: Add USB support in u-boot.

Dear Harman Sohanpal,

Quoted 84 lines · Marek Vasut
Quoted 74 lines

Dear Harman Sohanpal,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Dear Harman Sohanpal,

Quoted 13 lines

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

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.

Quoted 2 lines

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?

Quoted 1 line

Is there much pain to add these 2 files?

Yes, duplication of code is always bad.

Quoted 1 line

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?

Quoted 2 lines

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?

Quoted 1 line

Kindly give your thoughts.

Oh my brain is spinning from this :-)

Quoted 1 line

In case still some changes are required, we can think upon it :)

Quoted 8 lines

I'm really glad to hear that, let's do our best to find the best possible solution :-)

Quoted 2 lines

Thanks,
Harman

Best regards,
Marek Vasut

Quoted 7 lines

Also we are adding the USB module to be selected dynamically from boards.cfg as suggested by Tom.
If such is the case I believe the same should be done for am35x. Also from the previous mail of Tom, he seemed to be fine with separate files.
The best approach would be to wait for Tom's reply. Thanks for the review :)

Hm, previous review? Was I not CCed on it maybe ? I'll check it.

Quoted 1 line

Harman

Best regards,
Marek Vasut

#12 lore raw

v4 cover AM335x: Add USB support in u-boot.

In reply to Marek Vasut

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 18 lines · Marek Vasut

Dear Harman Sohanpal,

Quoted 16 lines
Quoted 14 lines · Marek Vasut

Dear Harman Sohanpal,

Quoted 11 lines

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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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).

Quoted 25 lines
Quoted 4 lines

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.

Quoted 2 lines

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?

Quoted 1 line

Is there much pain to add these 2 files?

Yes, duplication of code is always bad.

Quoted 1 line

In my opinion we must need to have a separate file for this.

Quoted 7 lines

Why? If it's only about the registers, won't the approach above work?

Quoted 2 lines

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP8bcGAAoJENk4IS6UOR1WaSYP/0v/+GcjCUL08ZmjQANyavZf Grl3OYjx4p7IwsBgOXCE14SKS5UKabJywoUil25O+T0ZM1ubzHyGzHuszYb7WfsZ e/hUWwMATw7f+qnQAOYR6AGDQgbvS1aFWy01+CT4xLPmU0XO6kBrmgRuhmml9Uf1 RegM1+TrAVtHA9VPkVNvIok7598LIQhjnnq5ey9fMPYuqL4LqkBGl7ui/+28c59g rbFEkjv52jwTPiDT8PYYSRQlWv5pgoMmm/eW8HoXUV3V4iPBU1xaW79brXNV3ZKw FTstoAbwdGNteyBGJtmvBrwP0EL2dAsdIF+N7XstZ7UNfvRmdM+xo+1ZK0T8f/Xz J3s5yVo4tQcwQxrUtZCaTcFNGjkcybb28oSRy5jsONPTMggWC68aqsB/RjDZUKqP AG49caTx1aGspyHc3FLRaaSnRb0xS3JosDz235mYfwqW67tsDUm7Zqak3VlrShk0 7poY8+9WmePtdaqMGrC98vz+SMTaepgjoUO65NJGh2souVEO6nPf2+hy/3/B36Gi 9iXx+qRTKBcxxOmla/kxN0/NAHL+vTpA8nAjZeqra5dVvH2LKJUgTst4XSp7fX3E 5NljiVj9nxsxgni12XJgyYVjRIve3pFBW32P4VoDCsDvi1Q0T0SZrH4DAg7E3qLU iX0bhFBvMYrQXxde8tsf
=TS6u
-----END PGP SIGNATURE-----

#13 lore raw

v4 cover AM335x: Add USB support in u-boot.

Dear Tom Rini,

[...]

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

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.

Good, will you please poke into it, guys?

Best regards,
Marek Vasut

#14 lore raw

v4 cover AM335x: Add USB support in u-boot.

Quoted 7 lines · Marek Vasut

Dear Tom Rini,

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

This is as per my understanding. It could also cause confusions to some due to name. maybe :)

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

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.

Good, will you please poke into it, guys?

If Harman doesn't, Ilya will.

Signature · 1 line
Tom