Problem with USB OTG

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem with USB OTG

2,865件の閲覧回数
hitom
Contributor II

On my Sabre-SD (with imx6q) USB OTG is working well, on a customized board with imx6dl usb otg is not working (all other things including usbh1 are working well)!

My configs:

     #define MX6DL_ICORE_USB_OTG_PWR IMX_GPIO_NR(4, 15)

     MX6DL_PAD_KEY_ROW4__GPIO_4_15,

     MX6DL_PAD_KEY_COL4__USBOH3_USBOTG_OC,

     MX6DL_PAD_GPIO_1__USBOTG_ID,


    

//USB OTG-----------------------------------------------------------------------

static void imx6q_icore_usbotg_vbus(bool on)

{

  if(on)gpio_set_value(MX6DL_ICORE_USB_OTG_PWR,1);

  else gpio_set_value(MX6DL_ICORE_USB_OTG_PWR,0);

}

static void __init imx6q_icore_init_usb(void)

{

  int ret=0;

  imx_otg_base=MX6_IO_ADDRESS(MX6Q_USB_OTG_BASE_ADDR);

  ret=gpio_request(MX6DL_ICORE_USB_OTG_PWR,"usb-pwr");

  if(ret){

  pr_err("failed to get GPIO MX6DL_ICORE_USB_OTG_PWR: %d\n",ret);

  return;

  }

  gpio_direction_output(MX6DL_ICORE_USB_OTG_PWR,0);

  //mxc_iomux_set_gpr_register(1,13,1,1);

  mx6_set_otghost_vbus_func(imx6q_icore_usbotg_vbus);

}


imx6q_icore_init_usb();


Has anybody an idea?


Thanks in advance, tom

ラベル(3)
0 件の賞賛
返信
7 返答(返信)

2,393件の閲覧回数
YixingKong
Senior Contributor IV

Thomas

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 件の賞賛
返信

2,393件の閲覧回数
YixingKong
Senior Contributor IV

Thomas

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 件の賞賛
返信

2,393件の閲覧回数
raymondwang
Senior Contributor I

Why comment our this line?

//mxc_iomux_set_gpr_register(1,13,1,1);

Since your use GPIO1 as OTG ID input. This line is necessary.

  It should be same as MX6Q, I doubt your otg can work properly if this line is out.

0 件の賞賛
返信

2,393件の閲覧回数
hitom
Contributor II

In the GPR1 of the DL this Bit does not exist, but I have tried it also with this line!

0 件の賞賛
返信

2,393件の閲覧回数
raymondwang
Senior Contributor I

Why? My 6DL RM has this bit definition. My RM version is Rev .1, 04/2013.

Thinking about your OTG issue. Please verify your OTG controller can get your VBUS and ID status properly.

You can confirm it with following command:

#cat /proc/driver/isp1504_otg

This command will print OTG Status register and OTG FSM state (a session valid,id state ,etc).

e.g If you connect a usb default deviec role cable to PC. VBUS shoud be supplied from PC, and b_session_valid

should 1, id state should be 1.

  This these states don't conform with your real state, your should check your hardware connection.

0 件の賞賛
返信

2,393件の閲覧回数
hitom
Contributor II

First of all thank you for your support!!!


You are right the bit exist in the new RM!

This is the output:

root@freescale ~$ cat /proc/driver/isp1504_otg

Freescale USB OTG Driver

fsl_usb2_otg version: $Revision: 1.55 $

OTGSC reg: 01201120

PORTSC reg: 1cd01000

USBMODE reg: 00000013

USBCMD reg: 00010004

USBSTS reg: 00001088

OTG state: UNDEFINED

a_bus_req: 1

b_bus_req: 0

a_bus_resume: 0

a_bus_suspend:0

a_conn: 0

a_sess_vld: 0

a_srp_det: 0

a_vbus_vld: 0

b_bus_resume: 0

b_bus_suspend: 0

b_conn: 0

b_se0_srp: 0

b_sess_end: 0

b_sess_vld: 0

id: 1

root@freescale ~$

I've also checked the hardware for many times, also compared to the running sabresd-board!

Thanks in advance!!!!

0 件の賞賛
返信

2,393件の閲覧回数
raymondwang
Senior Contributor I

Check your OTG status register:

OTGSC reg: 01201120

Mine is

OTGSC reg: 09002d20

Check your VBus.

0 件の賞賛
返信