I.MX8mm Set OTG to peripheral mode

cancel
Showing results for 
Search instead for 
Did you mean: 

I.MX8mm Set OTG to peripheral mode

812 Views
1603354597
Contributor II

I have a i.mx8m mini evk boad and I want to set otgusb1 to peripheral mode and otgusb2 to otg mode.

So I changed the dts , as result the otgusb2 could work as otg  fuction but the otgusb1 could not be  identified as usb peripheral. Following is my dts:

 

&usbotg1 {
dr_mode = "peripheral";
extcon = <0>, <&typec1_ptn5110>;
picophy,pre-emp-curr-control = <3>;
picophy,dc-vol-level-adjust = <7>;
status = "okay"; 
};

&usbotg2 {
dr_mode = "otg";
extcon = <0>, <&typec2_ptn5110>;
picophy,pre-emp-curr-control = <3>;
picophy,dc-vol-level-adjust = <7>;
status = "okay"; 
};

Is there anything else I ignored?Please tell me.

Thank you for any help.

Tags (2)
0 Kudos
5 Replies

570 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello 王 澳刚 ,

Does the problem still persists? The settings look correct.

https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/generic.txt

I was looking at peripherals setup and it could be that a module needs to be loaded for the peripheral so that it can be enumerated as the correct type for it.

Regards,

0 Kudos

570 Views
1603354597
Contributor II

Hi  gusarambula,

   Thank you for you reply.

   The dts what I used is official dts ,I just changed usbotg1's    dr_mode = "otg"   to   dr_mode = "peripheral"

and usbotg1's status = "disabled" to status = "okay".

I found that the USB1 peripheral's circuit diagram is differ from USB2's, the USB1 is ont the power supply. Is it the circuit's problem ?

   

Regards,

0 Kudos

570 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello 王 澳刚,

The circuitry does have to be different depending on your configuration. This because a host only USB port would need to be able to provide power to the peripheral. A peripheral would need to be able to drain power from the host (even if it’s powered externally, the circuitry would need to allow that the host tries to deliver power). Finally, the OTG port would need to be able to provide or drive power as needed, depending on what it’s connected.

If you are changing the configuration on a board, it could be that the board design was made with certain configuration in mind.

I hope this helps!

Regards,

0 Kudos

570 Views
1603354597
Contributor II

Hi  gusarambula,

   I found that the imx8mm evk only has  one usb  clock--"usb1_ctrl_root_clk" ,  if I configure the usb1 and usb 2 to "okay",they will use one clock together. Is that useful?  Following is my dts :

   

usbotg1: usb@32e40000 {
compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
reg = <0x0 0x32e40000 0x0 0x200>;
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_USB1_CTRL_ROOT>;
clock-names = "usb1_ctrl_root_clk";
assigned-clocks = <&clk IMX8MM_CLK_USB_BUS>,
<&clk IMX8MM_CLK_USB_CORE_REF>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_500M>,
<&clk IMX8MM_SYS_PLL1_100M>;
fsl,usbphy = <&usbphynop1>;
fsl,usbmisc = <&usbmisc1 0>;
power-domains = <&usb_otg1_pd>;
status = "okay";
};

usbotg2: usb@32e50000 {
compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
reg = <0x0 0x32e50000 0x0 0x200>;
interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_USB1_CTRL_ROOT>;
clock-names = "usb1_ctrl_root_clk";
assigned-clocks = <&clk IMX8MM_CLK_USB_BUS>,
<&clk IMX8MM_CLK_USB_CORE_REF>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_500M>,
<&clk IMX8MM_SYS_PLL1_100M>;
fsl,usbphy = <&usbphynop2>;
fsl,usbmisc = <&usbmisc2 0>;
power-domains = <&usb_otg2_pd>;
status = "okay";
};

Does imx8mm evk support using two usbs in the meantime?  

 

Best wishes!

0 Kudos

570 Views
1603354597
Contributor II

Hi  gusarambula,

   Thank you for you reply.

   When I set 

   &usbotg1 {
   dr_mode = "peripheral";
   extcon = <0>, <&typec1_ptn5110>;
   picophy,pre-emp-curr-control = <3>;
   picophy,dc-vol-level-adjust = <7>;
   status = "okay"; 
   };

   &usbotg2 {
   dr_mode = "otg";
   extcon = <0>, <&typec2_ptn5110>;
   picophy,pre-emp-curr-control = <3>;
   picophy,dc-vol-level-adjust = <7>;
   status = "okay"; 
   };

   32e40000.usb is USB1's address,

   Then I access serial port

    evk_8mm:/sys/devices/platform/32e40000.usb/ci_hdrc.0/udc/ci_hdrc.0 #  cat is_a_peripheral
    0

    When the usb2 is set to otg mode, the usb1 is disabled even if usb1 is set to peripheral mode.

Does something make usb1 disabled when usb2 is set to otg mode in the source code?

0 Kudos