This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unable to write in control module register USB0_CTRL OTGVDET_EN bit /phy is not enable (MUSB as Device)

Other Parts Discussed in Thread: SYSCONFIG, AM3358

I am using linux 3.8.13+

Board Beaglebone Black

writing Musb device drive (type B)

>>>I am compiling my driver Separately, For that in Linux Kernel

>>i commented driver/usb/Kconfig file #source "drivers/usb/musb/Kconfig"

>> and in driver/usb/Makefile #obj-$(CONFIG_USB_MUSB_HDRC)    += musb/

#clock configuratiion/enabling the clock in the smart mode    

INITIALIZATION  of Registers is as follows

#Control Module Register
    CM_PER_USB0_CLKCTRL.MODULEMODE = 0x1;
    poll until(CM_PER_USB0_CLKCTRL.IDLEST == 0);

CM_CLKDCOLDO_DPLL_PER.DPLL_CLKDCOLDO_GATE_CTRL = 1;


    CTRLR.RST = 1;    //this is Mentor core register bit


    #Software reset of USBSS,modules.
    #Write 1 = Initiate software reset.
    SYSCONFIG.SOFT_RESET= 1;      
    poll until(SYSCONFIG.SOFT_RESET == 0);
    
    ##Software reset of  USB0, modules.
    USB0CTRLR.SOFT_RESET = 1;      
    poll until(USB0CTRLR.SOFT_RESET == 0);
    
    #USB interrupt enable
    USB0CTRLR.UINT = 0;
    
    USBMODE0.IDDIG_MUX = 1;
    USBMODE0.IDDIG = 1;  
    DEVCTL.SESSION = 1;
    
    #PHY MODULE
    USB_CTRL0.cm_pwrdn = 0; //normal mode
    USB_CTRL0.otg_pwrdn = 0;
    USB_CTRL0.otgvdet_en = 1;
    USB_CTRL0.otgsessenden = 1;
   
   
    
    #USB0UTMI
    USB0UTMI.FSSE0EXT = 1;
    USB0UTMI.VBUSVLDEXTSEL = 1;
    USB0UTMI.VBUSVLDEXT = 1;
    
    #mentor core initilization
    
    INTRUSBE=0XF7;                
    INTRTXE = 0xFFFF;            
    INTRRXE = 0xFFFF;                
    RXMAP = 64;
    TXMAP = 64;
    INDEXD.EPSEL = 0;

  INTCLRR,TX,=1;
  INTCLRR,RX=1;
  INTCLRR.USB =1;


   
    
    #Transparent DMA Transfer Setup
    USB0CTRLR.RNDIS = 0;
    USB0TXMODE = 0;
    USB0RXMODE = 0;
        
    #CPPI DMA Scheduler Initialization
    DMA_SCHED_CTRL.ENABLE_FLD = 1;

unable to write in control module register and interrupt is not getting generate.

please any one can help me to resolve this problem, 

  • sorry to disturb you again i need order as well i.e USB initialization
    1.phy
    2.usbss
    3.usb0
    4.core
    is it correct?
    or i hvave to change order

    and also i am unable to write in control module registers

    while reading i am getting value is 0

  • Hello Mohammed,
    We do not give any support regarding Linux. You must ask for help to the Linux community. Which USB device are you using?

    Regards,
    Gerardo
  • am3358 musb0 i thought start with fresh, so i started the testing musb0 module.

    1.after enumeration i am getting INTRRX interrupt but not INTRTX.

    2.after one device read, device is getting reset. after some time offlined.

    enpoint configuration is as follow

    USB_EP1_IN : -
            REGW16(AM3358_TXMAXP + 16 * (epno-1),maxpkt);
            varperirxcsr = REGR16(AM3358_PERI_RXCSR + 16);
            varperirxcsr = varperirxcsr & ~(1<<0);                                                RXPKTRDY = 0
            REGW16(AM3358_PERI_RXCSR,varperirxcsr);
            varperitxcsr |= ((1 << 13)|(1 << 6)|(1 << 3));                                      MODE = 1;CLRDATATOG = 1;FLUSHFIFO = 1;
            varperitxcsr &= ~((1 << 14) | (1 << 11));                                             ISO = 0; FRCDATATOG =0 ;
            REGW16(AM3358_PERI_TXCSR,varperitxcsr);

    USB_EP2_OUT:-

              REGW16(AM3358_RXMAXP + 16 * (epno-1),maxpkt);
            varperitxcsr = REGR16(AM3358_PERI_TXCSR + 16);
            varperitxcsr = varperitxcsr & ~((1<<13)|(1<<0));                                               MODE = 0;TXPKTRDY = 0;
            REGW16(AM3358_PERI_TXCSR + 16,varperitxcsr);
            REGW16(AM3358_PERI_RXCSR + 16,((1<<4)|(1<<7)));                                FLUSHFIFO =1;CLRDATATOG = 1;