2011-05-13 11:45:43     usb gadget drivers fail to load on bf527 trunk

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-05-13 11:45:43     usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 100648   

 

Building the current SVN revision for a BF527 board. MUSB Blackfin driver seems to load ok but when I try to load g_ether or g_serial they fail reporting:

 

root:/> modprobe g_ether

modprobe: can't load module g_ether (kernel/drivers/usb/gadget/g_ether.ko): No such device

 

Config Section in my Board definition file, pretty much as per ezkit. My boot log is also attached.

 

#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)

static struct resource musb_resources[] = {

    [0] = {

        .start    = 0xffc03800,

        .end    = 0xffc03cff,

        .flags    = IORESOURCE_MEM,

    },

    [1] = {    /* general IRQ */

        .start    = IRQ_USB_INT0,

        .end    = IRQ_USB_INT0,

        .flags    = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,

    },

    [2] = {    /* DMA IRQ */

        .start    = IRQ_USB_DMA,

        .end    = IRQ_USB_DMA,

        .flags    = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,

    },

};

 

static struct musb_hdrc_config musb_config = {

    .multipoint    = 0,

    .dyn_fifo    = 0,

    .soft_con    = 1,

    .dma        = 1,

    .num_eps    = 8,

    .dma_channels    = 8,

    .gpio_vrsel    = GPIO_PH10,

    /* Some custom boards need to be active low, just set it to "0"

     * if it is the case.

     */

    .gpio_vrsel_active    = 1,

    .clkin          = 24,           /* musb CLKIN in MHZ */

    .ram_bits = 9,

};

 

static struct musb_hdrc_platform_data musb_plat = {

#if defined(CONFIG_USB_MUSB_OTG)

    .mode        = MUSB_OTG,

#elif defined(CONFIG_USB_MUSB_HDRC_HCD)

    .mode        = MUSB_HOST,

#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)

    .mode        = MUSB_PERIPHERAL,

#endif

    .config        = &musb_config,

    .min_power     = 250,

};

 

static u64 musb_dmamask = ~(u32)0;

 

static struct platform_device musb_device = {

    .name        = "musb-blackfin",

    .id        = 0,

    .dev = {

        .dma_mask        = &musb_dmamask,

        .coherent_dma_mask    = 0xffffffff,

        .platform_data        = &musb_plat,

    },

    .num_resources    = ARRAY_SIZE(musb_resources),

    .resource    = musb_resources,

};

#endif

 

bootGetherErr.log

QuoteReplyEditDelete

 

 

2011-05-16 23:22:34     Re: usb gadget drivers fail to load on bf527 trunk

Bob Liu (CHINA)

Message: 100682   

 

Hi,

 

Could you please also attach your kernel config file?

 

And the detail version.

 

You can get it through command version.

 

root:/> version

 

Thanks

QuoteReplyEditDelete

 

 

2011-05-17 04:59:27     Re: usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 100690   

 

Hi here is the version info

 

 

kernel:    Linux release 2.6.39-rc6-ADI-2011R1-pre-svn9877, build #60 Sat Apr 30 20:18:18 IST 2011

toolchain: bfin-uclinux-gcc release gcc version 4.3.5 (ADI-2010R1-RC4)

user-dist: release svn-10163, build #70 Sat Apr 30 20:17:51 IST 2011

 

 

I've attached the build config file for the kernel. This is what you meant I hope. You can probably test this on the bf-527 ezkit, just change a few of the board specific parameters. The board init file is pretty much the same as the ezkit.

 

I should also mention that this configuration works fine in released version 2010.

 

bf527_config

QuoteReplyEditDelete

 

 

2011-05-18 04:25:19     Re: usb gadget drivers fail to load on bf527 trunk

Bob Liu (CHINA)

Message: 100717   

 

I can't repeat this issue on bf527 ezkit.

 

root:/> modprobe g_ether

g_ether gadget: using random self ethernet address

g_ether gadget: using random host ethernet address

usb0: MAC 02:82:d3:c3:66:00

usb0: HOST MAC 06:ed:7f:c6:f4:c7

g_ether gadget: Ethernet Gadget, version: Memorial Day 2008

g_ether gadget: g_ether ready

root:/>

root:/> version

kernel:    Linux release 2.6.39-rc6-ADI-2011R1-pre-svn9877, build #36 Wed May 18 16:41:42 CST 2011

toolchain: bfin-uclinux-gcc release gcc version 4.3.5 (ADI-trunk/svn-4813)

user-dist: release svn-10163, build #12 Wed May 18 16:40:33 CST 2011

root:/>

QuoteReplyEditDelete

 

 

2011-05-18 09:06:49     Re: usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 100723   

 

Is that the latest svn toolchain you're using? Or the equivalent svn revision? Might make a difference.

 

I'll attempt to replicate this on the ez-kit if I have time. Could be some configuration, maybe my musb driver isn't really working.

QuoteReplyEditDelete

 

 

2011-05-18 11:58:38     Re: usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 100725   

 

Getting some warnings on g_ether during make. Maybe you'd like to look at the attached text file.

 

BuildErrsGEther.txt

QuoteReplyEditDelete

 

 

2011-05-18 23:46:21     Re: usb gadget drivers fail to load on bf527 trunk

Bob Liu (CHINA)

Message: 100731   

 

I think it's not related with toolchain.

 

Maybe your hardware or kernel config's problem.

 

Since I only have bf527 on my hand, attached my kernel config on bf527 ezkit.

 

bf527_ezkit.config

QuoteReplyEditDelete

 

 

2011-05-31 04:36:19     Re: usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 100952   

 

Tested this on my bf527-ezkit v2. I'm getting the same error, could this be related to the module name change musb-blackfin to musb-bfin (or something like that)? Did you clean before doing the build?

QuoteReplyEditDelete

 

 

2011-06-02 04:53:59     Re: usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 100976   

 

Okay, managed to get g_ether to begin loading on the ezkit. I had to enable host mode and select otg(peripheral+host). However, this hangs while loading g_ether and eventually the board re-boots.

 

Testing again on my original board, I found the following in the dmesg log for the boot.

 

musb-hdrc: version 6.0, musb-dma, peripheral, debug=0

bus: 'platform': add driver musb-hdrc

bus: 'platform': driver_probe_device: matched device musb-hdrc with driver musb-hdrc

bus: 'platform': really_probe: probing driver musb-hdrc with device musb-hdrc

bus: 'platform': remove driver musb-hdrc

driver: 'musb-hdrc': driver_release

 

 

It seems the musb driver is being unloaded immediately after it is loaded. Could this be related to power management? This seems to be where any major changes happened to the driver since the release version.

 

Note, I did check out a totally clean version of the svn trunk to test on the bf527 ezkit.

QuoteReplyEditDelete

 

 

2011-06-02 05:51:02     Re: usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 100977   

 

I have my board getting to the same state as the ez-kit now, a board init issue. g_ether now loads, but crashes and the board resets. The following final messages:

 

g_ether gadget: using random self ethernet address

g_ether gadget: using random host ethernet address

g_ether gadget: usb0: Features changed: 0x00004800 -> 0x00004000

usb0: MAC a6:21:15:cc:04:56

usb0: HOST MAC 9e:7a:ce:98:c2:69

g_ether gadget: Ethernet Gadget, version: Memorial Day 2008

g_ether gadget: g_ether ready

musb-hdrc musb-hdrc: MUSB HDRC host driver

musb-hdrc musb-hdrc: new USB bus registered, assigned bus number 1

QuoteReplyEditDelete

 

 

2011-06-07 04:50:52     Re: usb gadget drivers fail to load on bf527 trunk

Ciaran Watterson (IRELAND)

Message: 101048   

 

Okay - I have the drivers loading now. seemed I had to build with host+peripheral, and then with peripheral only (those are the only settings I changed). However, with g_ether loaded, it installs in Windows but fails to initialise (Code 10). From the board end it looks as if nothing is wrong in the debug messages. If I load g_serial this works fine.

QuoteReplyEditDelete

 

 

2011-09-02 01:50:51     Re: usb gadget drivers fail to load on bf527 trunk

Unmai rr (INDIA)

Message: 103253   

 

Tested this on my bf527-ezkit v2. I'm getting the same error, could this be related to the module name change musb-blackfin to musb-bfin (or something like that)? Did you clean before doing the build?

 

 

 

 

 

 

 

Hi, Am facing a similar problem with my BF526 board and Ez-kit.  You mentioned some board init problem.  Can you be more specific what you have done to manage the modprobe to work?

 

 

 

Regards,

 

Unmai.

 

---

Outcomes