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.

Error Compliing MUSB drivers

Other Parts Discussed in Thread: OMAPL138, OMAP-L137, OMAP-L138

My project is to find means to transfer bulk of data from host computer to ZOOM OMAPL138 EVM board via USB 2.0/OTG port. From reading of user guide, I understand that Mentor USB controller is used in the OMAPL138 Platform.

However, I have a few questions regarded to musb drivers for OMAPL-138 platform.I  have searched TI wiki for the information about USB drivers and found there are a few things confused me.

Firstly, in the USB OTG page for Davinci(http://processors.wiki.ti.com/index.php/USB_OTG_on_DaVinci#Jumper_Settings), it mentioned that OTG has been implemented on the DM355 and DM6446 platform. In addition, it also mentioned that OMAPl137 has used the same Inventra (M)HDRC USB Peripheral in link(http://processors.wiki.ti.com/index.php/Inventra_HDRC_USB_Controller). However, when I compiled the kernel and selected both host and peripheral (On The Go) rule, I get the following errors:


CHK     include/linux/version.h

  CHK     include/generated/utsrelease.h

make[1]: `include/generated/mach-types.h' is up to date.

  CALL    scripts/checksyscalls.sh

  CHK     include/generated/compile.h

  GZIP    kernel/config_data.gz

  IKCFG   kernel/config_data.h

  CC      kernel/configs.o

  LD      kernel/built-in.o

  CC      drivers/usb/musb/musb_core.o

drivers/usb/musb/musb_core.c: In function 'musb_init_controller':

drivers/usb/musb/musb_core.c:1948: error: label 'bad_config' used but not defined

make[2]: *** [drivers/usb/musb/musb_core.o] Error 1

make[1]: *** [drivers/usb/musb] Error 2

make: *** [drivers] Error 2

So my first question is is there a kernel patch which can fix error? or I have to modify the musb_core.c to make it work?


Secondly, in another wikipage for Davinci GIT Kernel(http://processors.wiki.ti.com/index.php/DaVinci_GIT_Linux_Kernel#USB_OTG), it mentioned that 

USB OTG

DevicesDM644xDM6467DM355DM365DA830/OMAP-L137DA850/OMAP-L138Mainline
Status

Status / To Do

  1. MUSB support need to be added in OMAPL138 board file.
  2. CPPI4.1 DMA driver needs to be added for OMAPL1x.
  3. USB patches to support DM365 and DM646x needs to be added.
  4. CPPI3.0 DMA fine tuning for performance enhancements is pending


 Because I am new to Linux , I am not quite understand what is a board file and what steps do I need to take to modify/add to this board file?
Finally, is there a sample testing file that I can use to test the transfer speed ?

if anyone can point me to the right direction, It will be highly appreciated. 



  • Yang,

    You can refer below page on how to configure for OTG mode,

    http://processors.wiki.ti.com/index.php/UserGuideUsbDriver_PSP_03.00.00.05#MUSB_OTG_controller_in_gadget_mode

    I hope you are using TI releases PSP packages for your testing.

    Regards,
    ajay

  • AJAY,

    Thank you for the quick reply.

    However, after following the instructions in your link, My complier still returned errors after  I select the and error message is :

    drivers/usb/musb/musb_core.c: In function 'musb_init_controller':

    drivers/usb/musb/musb_core.c:1948: error: label 'bad_config' used but not defined

    make[2]: *** [drivers/usb/musb/musb_core.o] Error 1

    make[1]: *** [drivers/usb/musb] Error 2

    make: *** [drivers] Error 2

    Is there anything I can do to modify this file? 

    Also, the WIKI didn't mention OMAPL-138 platform, I am not sure whether this relates to the error.

    Thanks

  • Yang,

    The wiki page is for OMAP but all linux configuration are same across the platforms. So it's fine.

    I think the code base you are using was never compiled for OTG mode and so this error. Now there are two option,

    1. Config only for gadget mode which would full fill your requirement. You can refer same wiki page for gadget only config.

    2. Use below patch to fix above error.

    diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
    index 512b2d9..c387c8f 100644
    --- a/drivers/usb/musb/musb_core.c
    +++ b/drivers/usb/musb/musb_core.c
    @@ -1945,7 +1945,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
     #ifdef CONFIG_USB_MUSB_DUAL_ROLE
                    break;
     #else
    -               goto bad_config;
    +               break;
     #endif
            case MUSB_OTG:
     #ifdef CONFIG_USB_MUSB_OTG

     

    Regards,

    Ajay