Hi, could anybody try to config C6745 USB without BIOS? I use USB 2.0 User´s Guide as a reference but the USB init code is not working. It locks on a loop waiting USB clock is ok, but it never ends it.
My board uses a 20MHz crystal to generate the clock and USB uses its as ACLK signal.
The config init code is:
void USBInit(void)
{
Uint16 I;
volatile Uint32 value =0;
CSL_SyscfgRegsOvly BootCfg = (CSL_SyscfgRegsOvly)(CSL_SYSCFG_0_REGS);
BootCfg->KICK0R = 0x83e70b13; // Write Access Key 0
BootCfg->KICK1R = 0x95A4F1E0; // Write Access Key 1
// Reset the USB controller:
usbRegs->CTRLR |= 0x00000001;
//Wait until controller is finished with Reset. When done, it will clear the RESET bit field.
while ((usbRegs->CTRLR & 0x1) == 1);
BootCfg->CFGCHIP2 |= 0x1 << 11; //AUXCLK = USB 2.0 PHY
BootCfg->CFGCHIP2 |= 0x08; //Fin = 20MHz
// RESET: Hold PHY in Reset
BootCfg->CFGCHIP2 |= 0x00008000; // Hold PHY in Reset
// Drive Reset for few clock cycles
for (I=0; I < 50; I++);
// RESET: Release PHY from Reset
BootCfg->CFGCHIP2 &= 0xFFFF7FFF; // Release PHY from Reset
/* Configure PHY with the Desired Operation */
// OTGMODE
BootCfg->CFGCHIP2 &= 0xFFFF9FFF; // 00= > Do Not Override PHY Values
// PHYPWDN
BootCfg->CFGCHIP2 &= 0xFFFFFBFF; // 1/0 => PowerdDown/ NormalOperation
// OTGPWRDN
BootCfg->CFGCHIP2 &= 0xFFFFFDFF; // 1/0 => PowerDown/ NormalOperation
// DATAPOL
BootCfg->CFGCHIP2 |= 0x00000100; // 1/0 => Normal/ Reversed
// SESNDEN
BootCfg->CFGCHIP2 &= ~0x00000020; // 1/0 => NormalOperation/ SessionEnd
// VBDTCTEN
BootCfg->CFGCHIP2 &= ~0x00000010; // 1/0 => VBUS Comparator Enable/ Disable
/* Configure PHY PLL use and Select Source */
// REF_FREQ[3:0]
// USB2PHYCLKMUX: Select internal Source
BootCfg->CFGCHIP2 |= 0x00000800; // 1/0 => Internal/External(Pin)
// PHY_PLLON: On Simulation PHY PLL is OFF
BootCfg->CFGCHIP2 |= 0x00000040; // 1/0 => On/ Off
//Mode = Force Device Mode
BootCfg->CFGCHIP2 |= 0x00004000;
/* Wait Until PHY Clock is Good */
while((BootCfg->CFGCHIP2 & 0x00020000)==0);
.....