diff options
| author | Allen Martin <amartin@nvidia.com> | 2012-12-19 13:02:36 -0800 | 
|---|---|---|
| committer | Allen Martin <amartin@nvidia.com> | 2012-12-19 13:02:36 -0800 | 
| commit | a098cf41fdb2a6607c675f7fe4f3164617c9367e (patch) | |
| tree | b37acb36f65909e6f74cc537d73efd883a1485a6 /board/logicpd/am3517evm/am3517evm.c | |
| parent | b8a7c467960ffb4d5a5e1eef5f7783fb6f594542 (diff) | |
| parent | 095728803eedfce850a2f85828f79500cb09979e (diff) | |
| download | olio-uboot-2014.01-a098cf41fdb2a6607c675f7fe4f3164617c9367e.tar.xz olio-uboot-2014.01-a098cf41fdb2a6607c675f7fe4f3164617c9367e.zip | |
Merge remote-tracking branch 'u-boot/master' into u-boot-arm-merged
Conflicts:
	README
	arch/arm/cpu/armv7/exynos/clock.c
	board/samsung/universal_c210/universal.c
	drivers/misc/Makefile
	drivers/power/power_fsl.c
	include/configs/mx35pdk.h
	include/configs/mx53loco.h
	include/configs/seaboard.h
Diffstat (limited to 'board/logicpd/am3517evm/am3517evm.c')
| -rw-r--r-- | board/logicpd/am3517evm/am3517evm.c | 74 | 
1 files changed, 74 insertions, 0 deletions
| diff --git a/board/logicpd/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c index d316f33cd..0b3721ed8 100644 --- a/board/logicpd/am3517evm/am3517evm.c +++ b/board/logicpd/am3517evm/am3517evm.c @@ -25,12 +25,20 @@  #include <common.h>  #include <asm/io.h> +#include <asm/omap_musb.h> +#include <asm/arch/am35x_def.h>  #include <asm/arch/mem.h>  #include <asm/arch/mux.h>  #include <asm/arch/sys_proto.h>  #include <asm/arch/mmc_host_def.h> +#include <asm/arch/musb.h>  #include <asm/mach-types.h> +#include <asm/errno.h> +#include <linux/usb/ch9.h> +#include <linux/usb/gadget.h> +#include <linux/usb/musb.h>  #include <i2c.h> +#include <netdev.h>  #include "am3517evm.h"  DECLARE_GLOBAL_DATA_PTR; @@ -50,6 +58,52 @@ int board_init(void)  	return 0;  } +#ifdef CONFIG_USB_MUSB_AM35X +static struct musb_hdrc_config musb_config = { +	.multipoint     = 1, +	.dyn_fifo       = 1, +	.num_eps        = 16, +	.ram_bits       = 12, +}; + +static struct omap_musb_board_data musb_board_data = { +	.set_phy_power		= am35x_musb_phy_power, +	.clear_irq		= am35x_musb_clear_irq, +	.reset			= am35x_musb_reset, +}; + +static struct musb_hdrc_platform_data musb_plat = { +#if defined(CONFIG_MUSB_HOST) +	.mode           = MUSB_HOST, +#elif defined(CONFIG_MUSB_GADGET) +	.mode		= MUSB_PERIPHERAL, +#else +#error "Please define either CONFIG_MUSB_HOST or CONFIG_MUSB_GADGET" +#endif +	.config         = &musb_config, +	.power          = 250, +	.platform_ops	= &am35x_ops, +	.board_data	= &musb_board_data, +}; + +static void am3517_evm_musb_init(void) +{ +	/* +	 * Set up USB clock/mode in the DEVCONF2 register. +	 * USB2.0 PHY reference clock is 13 MHz +	 */ +	clrsetbits_le32(&am35x_scm_general_regs->devconf2, +			CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE, +			CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | +			CONF2_VBDTCTEN | CONF2_DATPOL); + +	musb_register(&musb_plat, &musb_board_data, +			(void *)AM35XX_IPSS_USBOTGSS_BASE); +} +#else +#define am3517_evm_musb_init() do {} while (0) +#endif +  /*   * Routine: misc_init_r   * Description: Init i2c, ethernet, etc... (done here so udelay works) @@ -62,6 +116,8 @@ int misc_init_r(void)  	dieid_num_r(); +	am3517_evm_musb_init(); +  	return 0;  } @@ -83,3 +139,21 @@ int board_mmc_init(bd_t *bis)         return 0;  }  #endif + +#if defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET) +int board_eth_init(bd_t *bis) +{ +	int rv, n = 0; + +	rv = cpu_eth_init(bis); +	if (rv > 0) +		n += rv; + +	rv = usb_eth_initialize(bis); +	if (rv > 0) +		n += rv; + +	return n; +} +#endif + |