FSL_TICS_Rita 发表于 2014-4-18 14:55
还有你是如何操作的?
是飞思卡尔i.MX 6Quqd Sabrelite开发板,跑的是android
在U-Boot中,在include/configs/mx6q_sabrelite_android.h添加了支持USB命令的宏定义
#define CONFIG_CMD_USB
#define CONFIG_USB_STORAGE
#define CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_FSL
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
#define CONFIG_SYS_FLS_USDHC_NUM 4
#define CONFIG_DOS_PARTITION 1
#define CONFIG_CMD_FAT 1
然后修改了了driver/usb/host/ehic-fsl.c文件的int ehci_hcd_init(void)
int ehci_hcd_init(void)
{
struct usb_ehci *ehci;
//ehci = (struct usb_ehci *)CONFIG_SYS_MPC8xxx_USB_ADDR;
ehci = (struct usb_ehci *)0x02184200;
hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength);
hcor = (struct ehci_hcor *)((uint32_t) hccr +
HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
/* Set to Host mode */
/*
setbits_le32(&ehci->usbmode, CM_HOST);
out_be32(&ehci->snoop1, SNOOP_SIZE_2GB);
out_be32(&ehci->snoop2, 0x80000000 | SNOOP_SIZE_2GB);
*/
/* Init phy */
/*
if (!strcmp(getenv("usb_phy_type"), "utmi"))
out_le32(&(hcor->or_portsc[0]), PORT_PTS_UTMI);
else
out_le32(&(hcor->or_portsc[0]), PORT_PTS_ULPI);
*/
/* Enable interface. */
/*
setbits_be32(&ehci->control, USB_EN);
out_be32(&ehci->prictrl, 0x0000000c);
out_be32(&ehci->age_cnt_limit, 0x00000040);
out_be32(&ehci->sictrl, 0x00000001);
in_le32(&ehci->usbmode);*/
return 0;
}
由于编译不能通过所以就屏蔽了后面部分,结果就出现了
U-Boot > usb start
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... |