[U-Boot] [PATCH v3 1/3] AM335x : Add USB support for AM335x in u-boot

Tom Rini trini at ti.com
Wed Jun 27 19:20:28 CEST 2012


On Tue, Jun 26, 2012 at 03:08:01PM +0530, Harman Sohanpal wrote:

> From: Gene Zarkhin <gene_zarkhin at bose.com>
> 
> Adds USB support in uboot for AM335x.
> By default the USB 1 module is enabled.
> The support for USB 0 can be enabled by changing the
> USB base address and the phy control register address
> in the header file am335x.h.
> USB 1 has a full size connector so acts in host mode and
> USB 0 has a mini connector so used in device mode.
> By default, the support is added for host mode hence USB 1
> has been enabled by default.
> 
> Signed-off-by: Gene Zarkhin <gene_zarkhin at bose.com>
> Signed-off-by: Harman Sohanpal <harman_sohanpal at ti.com>

What I was saying was that we want to make am335x.h do:
#define AM335X_USB0_BASE 0x47401000
#define AM335X_USB1_BASE 0x47401800

Then:
#ifdef CONFIG_AM335X_USB0
#define AM335X_USB_OTG_BASE AM335X_USB0_BASE
#elif defined(CONFIG_AM335X_USB1)
#define AM335X_USB_OTG_BASE AM335X_USB1_BASE
#endif
#define AM335X_USB_OTG_CORE_BASE (AM335X_USB_OTG_BASE + 0x400)

So that in boards.cfg we could add an entry for am335x_evm_usb1 and set
CONFIG_AM335X_USB1 dynamically.  Then in am335x_evm.h set either
MUSB_HCD or MUSB_UDC based on if CONFIG_AM335X_USB0 or
CONFIG_AM335X_USB1 is set (and have boards.cfg set CONFIG_AM335X_USB0
for 'am335x_evm).

Then you can test device mode on the evm :)  And how did you test device
mode on the beaglebone?  I couldn't since I don't have the rest set of
adapters here.

Also:

> +++ b/drivers/usb/musb/am335x.h
[snip]
> +/* Control Module Registers */
> +#define CM_REGISTERS			CTRL_BASE
> +#define USB_CTRL0_REG_OFFSET	(0x628)
> +#define USB_CTRL1_REG_OFFSET	(0x680)

Please get all indentation out to a consistent level

> +#define PRCM_IDLEST                             0x30000
> +#define DPLL_CLKDCOLDO_GATE_CTRL                0x300

And always use tabs :)

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120627/d05edaef/attachment.pgp>


More information about the U-Boot mailing list