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.

Not able to control USB ID pin through Software and USB Hot-plugging is not working

Other Parts Discussed in Thread: DM385

Hi,

We are using a custom dm385 board and USB Hot-plugging is not working and i am trying make it host only Linux version is 2.6.37.

In defconfig following configuration is enable to control USBID through software.

If usb device or OTG cable is connected at the boot time then i can connect or disconnect at it any time. I connect usb stick after boot it is not detecting.

CONFIG_USB_TI81XX_USBID_CTRL_SW=y

Checked with DM388evm board, USB hotplug is not working and not able to control USB ID ping through software. 

When jumper are shorted , ID pin is getting ground and Hot-plugging is working.

If otg cable or converter is connected to usb port at the time of booting then Hot-plugging is working. If nothing is connect to the  port USB doen't detect even once.

In below link they are asking to set the USBxMode register bit 8 to 0 and bit 7 = 1  to tell the controller to ignore id pin and use software based information to enter either into host mode.

e2e.ti.com/.../197987

In code (kernel/drivers/usb/musb/ti81xx.c)  they are trying to set bit 7 = 1 but is failing set that bit. According to TRM it is a reserve bit.

        if (musb_mode == MUSB_HOST) {
                regval = musb_readl(reg_base, USB_MODE_REG);
                regval &= ~USBMODE_USBID_HIGH;

          /* changed if condition to support our bord */
                if (usbid_sw_ctrl && cpu_is_ti81xx()) {
                        regval |= USBMODE_USBID_MUXSEL;
                        printk("reg_base = %p USBMODE_USBID_MUXSEL = %p regval = %x\n", reg_base, USBMODE_USBID_MUXSEL, regval);
                }
                musb_writel(reg_base, USB_MODE_REG, regval);
                musb_writel(musb->ctrl_base, USB_PHY_UTMI_REG, 0x02);
                DBG(4, "host: value of mode reg=%x regval(%x)\n",
                        musb_readl(reg_base, USB_MODE_REG), regval);
        } else
        if

when print values  i can see

reg_base= c901e000 

USB_MODE_REG = 00000080

regval = 80h

Regards

Vikram KS