Skip to content

Commit

Permalink
kc1: MUSB USB controller and fastboot USB gadget support
Browse files Browse the repository at this point in the history
This adds support for the MUSB USB dual-role controller in peripheral mode,
with configuration options for the fastboot USB gadget.

At this point, flashing the internal eMMC is support.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
  • Loading branch information
paulkocialkowski authored and trini committed Mar 15, 2016
1 parent 27754d1 commit e66782e
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
27 changes: 27 additions & 0 deletions board/amazon/kc1/kc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#include <config.h>
#include <common.h>
#include <linux/ctype.h>
#include <linux/usb/musb.h>
#include <asm/omap_musb.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/mmc_host_def.h>
#include <asm/gpio.h>
Expand All @@ -21,6 +24,26 @@ const struct omap_sysinfo sysinfo = {
.board_string = "kc1"
};

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 = {
.interface_type = MUSB_INTERFACE_UTMI,
};

static struct musb_hdrc_platform_data musb_platform_data = {
.mode = MUSB_PERIPHERAL,
.config = &musb_config,
.power = 100,
.platform_ops = &omap2430_ops,
.board_data = &musb_board_data,
};


void set_muxconf_regs(void)
{
do_set_mux((*ctrl)->control_padconf_core_base, core_padconf_array,
Expand Down Expand Up @@ -66,6 +89,10 @@ int misc_init_r(void)

omap_die_id_serial();

/* MUSB */

musb_register(&musb_platform_data, &musb_board_data, (void *)MUSB_BASE);

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amazon/kc1/kc1.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ const struct pad_conf_entry core_padconf_array[] = {
{ UNIPRO_RY1, (IEN | DIS | M3) }, /* gpio_178 */
{ UNIPRO_RX2, (IDIS | DIS | M7) }, /* safe_mode */
{ UNIPRO_RY2, (IDIS | DIS | M7) }, /* safe_mode */
/* USBA0_OTG */
{ USBA0_OTG_CE, (IDIS | PTD | M0) }, /* usba0_otg_ce */
{ USBA0_OTG_DP, (IEN | DIS | M0) }, /* usba0_otg_dp */
{ USBA0_OTG_DM, (IEN | DIS | M0) }, /* usba0_otg_dm */
};

#endif
2 changes: 2 additions & 0 deletions configs/kc1_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ CONFIG_CMD_GPIO=y
# CONFIG_CMD_SETEXPR is not set
# CONFIG_CMD_NFS is not set
CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_MUSB_GADGET=y
35 changes: 35 additions & 0 deletions include/configs/kc1.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,41 @@
#define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, \
115200 }

/*
* USB gadget
*/

#define CONFIG_USB_MUSB_PIO_ONLY
#define CONFIG_USB_MUSB_OMAP2PLUS

#define CONFIG_USB_GADGET
#define CONFIG_USB_GADGET_DUALSPEED
#define CONFIG_USB_GADGET_VBUS_DRAW 0

/*
* Download
*/

#define CONFIG_USB_GADGET_DOWNLOAD

#define CONFIG_G_DNL_VENDOR_NUM 0x0451
#define CONFIG_G_DNL_PRODUCT_NUM 0xd022
#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"

/*
* Fastboot
*/

#define CONFIG_USB_FUNCTION_FASTBOOT

#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
#define CONFIG_FASTBOOT_BUF_SIZE 0x2000000

#define CONFIG_FASTBOOT_FLASH
#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0

#define CONFIG_CMD_FASTBOOT

/*
* Environment
*/
Expand Down

0 comments on commit e66782e

Please sign in to comment.