Thanks Balbi and Steve Chen

The problem is caused by the wrong initial value GPIO_nVBUS_DRV in
driver/usb/musb/davinci.c .
42: #ifdef CONFIG_MACH_DAVINCI_EVM
43: #define GPIO_nVBUS_DRV                87

87 is out of the range for davinci DM6646. Should be [0,70]
And as GPIO2 is used with DVEVM, if DVEVM is used this number should be 2
for the one have been modified for OTG according to
http://wiki.davincidsp.com/index.php?title=USB_OTG_on_DaVinci. As GPIOV33_16
is used for VBUS on non-modified DVEVM, this number should be 70DVEVM .
On Fri, Oct 31, 2008 at 8:25 PM, Felipe Balbi <[EMAIL PROTECTED]>wrote:

> On Fri, Oct 31, 2008 at 10:02:13AM +0800, ext David Chan wrote:
> > Hi,sir
> > Could you please give me some idea about this. My platform is dm6446.
> Kernel
> > is from source.mvista.com, the latest version.
>
> Could you please send this cc:ing [EMAIL PROTECTED]
>
> Also, do you know whether your code is in sync with mainline's musb code
> ?
>
> >
> > 2008/10/30 David Chan <[EMAIL PROTECTED]>
> >
> > > Hi all,
> > > As I followed the code. I found the pointer of the function in line 122
> > > drv->probe is NULL
> > > //file  driver/base/dd.c
> > >     111         if (driver_sysfs_add(dev)) {
> > >     112                 printk(KERN_ERR "%s: driver_sysfs_add(%s)
> > > failed\n",
> > >     113                         __func__, dev->bus_id);
> > >     114                 goto probe_failed;
> > >     115         }
> > >     116
> > >     117         if (dev->bus->probe) {
> > >     118                 ret = dev->bus->probe(dev);
> > >     119                 if (ret)
> > >     120                         goto probe_failed;
> > >     121         } else if (drv->probe) {
> > >     122                 ret = drv->probe(dev);
>
> This can't be. drv->probe() will only be called if drv->probe has a
> valid pointer.
>
> The problem seems to be in your musb_platform_init(). Apply this patch
> to your tree and send me the results of it I need to narrow down at
> which line and which function the code actually oopses:
>
> diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
> index dfb3bcb..7157716 100644
> --- a/drivers/usb/musb/davinci.c
> +++ b/drivers/usb/musb/davinci.c
> @@ -155,23 +155,30 @@ static DECLARE_WORK(evm_vbus_work,
> evm_deferred_drvvbus);
>
>  static void davinci_source_power(struct musb *musb, int is_on, int
> immediate)
>  {
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>        if (is_on)
>                is_on = 1;
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>        if (vbus_state == is_on)
>                return;
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>        vbus_state = !is_on;            /* 0/1 vs "-1 == unknown/init" */
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>  #ifdef CONFIG_MACH_DAVINCI_EVM
>        if (machine_is_davinci_evm()) {
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>                if (immediate)
>                        gpio_set_value_cansleep(GPIO_nVBUS_DRV, vbus_state);
>                else
>                        schedule_work(&evm_vbus_work);
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>        }
>  #endif
>        if (immediate)
>                vbus_state = is_on;
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>  }
>
>  static void davinci_set_vbus(struct musb *musb, int is_on)
> @@ -369,6 +376,7 @@ int __init musb_platform_init(struct musb *musb)
>        void __iomem    *tibase = musb->ctrl_base;
>        u32             revision;
>
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>        musb->mregs += DAVINCI_BASE_OFFSET;
>  #if 0
>        /* REVISIT there's something odd about clocking, this
> @@ -387,20 +395,27 @@ int __init musb_platform_init(struct musb *musb)
>        revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG);
>        if (revision == 0)
>                return -ENODEV;
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>        if (is_host_enabled(musb))
>                setup_timer(&otg_workaround, otg_timer, (unsigned long)
> musb);
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>        musb->board_set_vbus = davinci_set_vbus;
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>        davinci_source_power(musb, 0, 1);
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>        /* reset the controller */
>        musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1);
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>        /* start the on-chip PHY and its PLL */
>        phy_on();
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>        msleep(5);
> +       printk(KERN_INFO "===> %s %d\n", __func__, __LINE__);
>
>        /* NOTE:  irqs are in mixed mode, not bypass to pure-musb */
>        pr_debug("DaVinci OTG revision %08x phy %03x control %02x\n",
>
> --
> balbi
>



-- 
David

Manager, Business Development
Embedio. Inc.
+86 13581953152
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to