Dear Experts,
I am using TI OMAP35X, and I want to enter USB test mode to test the usb diagram for USB Host.
(OMAP USB HOST CTL --> USB PHY --> USB HUB --> USB TYPE A CONNECTOR)
Is Section 23.1.4.11 (Register to Enable the USB 2.0 Test Modes) for both OTG Controller (Section 23.1) and Host Subsystem (Section 23.2) ? or only for USB OTG Controller ?
I write some program to enter test mode in wince/e-boot, but I can’t get waveform from USB connector.
Can anyone tell me how to enter USB Host Controller test mode ~??!! Thx ~
Below is my code ~
=====================================================
@boot\xldr\platform.c
//Enable the CLK for USB // hbchen form indy
SETREG32(&pPrcmCoreCM->CM_ICLKEN1_CORE, 1<<4); //enable EN_HOSTOTGUSB bit
SETREG32(&pPrcmCoreCM->CM_AUTOIDLE1_CORE, 1<<4); //enable CM_AUTOIDLE1_CORE bit
=====================================================
#define USB_BA 0x480AB000 // +0fh Register to Enable the USB 2.0 Test Modes
@boot\eboot\menu.c
VOID USBTest(OAL_BLMENU_ITEM *pMenu) {
UINT8 mode = (UINT8)pMenu->pParam3;
unsigned long volatile *bufa=NULL, *bufb=NULL;
unsigned char volatile *b8=NULL;
UINT16 c=0, cnt=1000;
//----------------------
OALLog(L" ======USB HOST Test MODE : [0x%x]======\r\n",mode);
if (mode & MUSB_TEST_FORCE_HOST) OALLog(L"FORCE HOST ");
if (mode & MUSB_TEST_FIFO_ACCESS) OALLog(L"FIFO ACCESS ");
if (mode & MUSB_TEST_FORCE_FS) OALLog(L"FULL SPEED ");
if (mode & MUSB_TEST_FORCE_HS) OALLog(L"HIGH SPEED ");
if (mode & MUSB_TEST_PACKET)
{
OALLog(L"TEST_PACKET ");
musb_load_testpacket();
}
if (mode & MUSB_TEST_K) OALLog(L"TEST_K ");
if (mode & MUSB_TEST_J) OALLog(L"TEST_J ");
if (mode & MUSB_TEST_SE0_NAK) OALLog(L"TEST_SE0_NAK ");
b8= (unsigned char volatile *)OALPAtoUA(USB_BA+0xf); // change to uncached address
*b8=mode;
}
=====================================================
VOID musb_load_testpacket()
{
unsigned char volatile *b8=NULL;
UINT16 volatile *b16=NULL;
unsigned long volatile *bufa=NULL;
UINT8 i=0;
UINT16 cnt=1000;
//-------------------------------
b8= (unsigned char volatile *)OALPAtoUA(USB_BA+0xe); //
*b8=0; // select ep 0 ???
bufa= (void volatile *)OALPAtoUA(USB_BA+0x20);
for(i=0;i<53;i++)
{
cnt=1000;
*bufa = musb_test_packet[i]; //write pattern to fifo
while(cnt--);
}
b16=(UINT16 volatile *)OALPAtoUA(USB_BA+0x12); // change to uncached address
*b16 = 0x0002;//MUSB_CSR0_TXPKTRDY 0x0002
}