How to enable clock by devicetree for usbhub?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable clock by devicetree for usbhub?

2,792 Views
kaa
Contributor II

Hello!

I have custom board based on IMX.6 Dual Lite, with external usbhub 2.0  CY7C65632 it's connected to usb_h1

I need to enable CCM_CLKO1(MX6QDL_PAD_GPIO_0__CCM_CLKO1) with 48 MHz, can it be done with device tree?

Labels (2)
0 Kudos
3 Replies

1,091 Views
kaa
Contributor II

Solution was:

&iomuxc {
     usbhub {
          pinctrl_usbhub: usbhubgrp {
               fsl,pins = <
                    MX6QDL_PAD_GPIO_0__CCM_CLKO1          0x130b0
                    MX6QDL_PAD_ENET_MDIO__GPIO1_IO22     0x80000000
               >;
          };
     };
};

/ {
     usb_hub: usb-hub {
          compatible = "smsc,usb3503";
          pinctrl-names = "default";
          pinctrl-0 = <&pinctrl_usbhub>;
          reset-gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
          clocks = <&clks IMX6QDL_CLK_CKO1>;
          clock-names = "refclk";
          assigned-clocks = <&clks IMX6QDL_CLK_CKO>,
               <&clks IMX6QDL_CLK_CKO1_SEL>,
               <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
               <&clks IMX6QDL_CLK_CKO1>;
          assigned-clock-parents = <&clks IMX6QDL_CLK_CKO1>,
               <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
               <&clks IMX6QDL_CLK_OSC>,
               <&clks IMX6QDL_CLK_CKO1_PODF>;
     };
};

PS:

update drivers/usb/misc/usb3503.c should be updated to support clocks from devicetree

1,091 Views
igorpadykov
NXP Employee
NXP Employee

Hi Oleh

please check below link for general steps

i.MX7D 24MHz clock output to CCM_CLK1_P pin 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,091 Views
kaa
Contributor II

Thank you Igor for your reply.

I tried to specify this:

    usbhub {
        clocks = <&clks IMX6QDL_CLK_CKO1>;
        assigned-clocks = <&clks IMX6QDL_CLK_CKO1_SEL>,
            <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
        assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
    };

As I understand there must be "compatible" option?
But I can't find any suitable driver for this purpose, should I write this driver by myself?

0 Kudos