Clock for i.MX8M Plus

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

Clock for i.MX8M Plus

817 Views
Jimmychea
Contributor III

I added the clock generator 5P49V6965 for i.MX8M Plus as main clock source and i updated the device tree file as below. My question is below modification is correct ???

imx8mp-evk.dts

&i2c4 {
    clock-frequency = <400000>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_i2c4>;
    status = "okay";

    versaclock6_bb: clock-controller@6a {
       compatible = "idt,5p49v6965";
       reg = <0x6a>;
       #clock-cells = <1>;
       clocks = <&osc_10m>;
       clock-names = "xin";

       assigned-clocks = <&versaclock6_bb 1>,
                                     <&versaclock6_bb 2>,
                                     <&versaclock6_bb 3>,
                                     <&versaclock6_bb 4>;
       assigned-clock-rates = <25000000>, <26000000>, <24000000>, <32768>;

       OUT1 {
             idt,mode = <VC5_CMOS>;
             idt,voltage-microvolt = <1800000>;
             idt,slew-percent = <100>;
       };

       OUT2 {
             idt,mode = <VC5_CMOS>;
             idt,voltage-microvolt = <1800000>;
             idt,slew-percent = <100>;
       };

       OUT3 {
             idt,mode = <VC5_CMOS>;
             idt,voltage-microvolt = <1800000>;
             idt,slew-percent = <100>;
       };

       OUT4 {
             idt,mode = <VC5_CMOS>;
             idt,voltage-microvolt = <1800000>;
             idt,slew-percent = <100>;
       };
    };
};

 

imx8mp.dtsi

/ {

    osc_10m: clock-osc-10m {
       compatible = "fixed-clock";
       #clock-cells = <0>;
       clock-frequency = <10000000>;
       clock-output-names = "osc_10m";
    };

 

    soc@0 {

       aips1: bus@30000000 {

             clk: clock-controller@30380000 {
                   compatible = "fsl,imx8mp-ccm";
                   reg = <0x30380000 0x10000>;
                   #clock-cells = <1>;
                   clocks = <&versaclock6_bb 4>, <&versaclock6_bb 3>, <&clk_ext1>, <&clk_ext2>,
                   <&clk_ext3>, <&clk_ext4>;
                   clock-names = "xin", "xin", "clk_ext1", "clk_ext2",
                   "clk_ext3", "clk_ext4";
                   assigned-clocks = <&clk IMX8MP_CLK_A53_SRC>,
                      <&clk IMX8MP_CLK_A53_CORE>,
                      <&clk IMX8MP_CLK_NOC>,
                      <&clk IMX8MP_CLK_NOC_IO>,
                      <&clk IMX8MP_CLK_GIC>,
                      <&clk IMX8MP_CLK_AUDIO_AHB>,
                      <&clk IMX8MP_CLK_AUDIO_AXI_SRC>,
                      <&clk IMX8MP_AUDIO_PLL1>,
                      <&clk IMX8MP_AUDIO_PLL2>,
                      <&clk IMX8MP_VIDEO_PLL1>;
                   assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_800M>,
                      <&clk IMX8MP_ARM_PLL_OUT>,
                      <&clk IMX8MP_SYS_PLL2_1000M>,
                      <&clk IMX8MP_SYS_PLL1_800M>,
                      <&clk IMX8MP_SYS_PLL2_500M>,
                      <&clk IMX8MP_SYS_PLL1_800M>,
                      <&clk IMX8MP_SYS_PLL1_800M>;
                   assigned-clock-rates = <0>, <0>,
                      <1000000000>,
                      <800000000>,
                      <500000000>,
                      <400000000>,
                      <800000000>,
                      <393216000>,
                      <361267200>,
                      <1039500000>;
          };

       };

    };

};

Labels (1)
0 Kudos
5 Replies

779 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @Jimmychea 

->One can validate the node's properties in clock-bindings.txt file located at
/<path_to_linux>/git/Documentation/devicetree/bindings/clock
->Structure wise it looks well , Please share the Observation if its not working.

Also I have a query to ask
-> have you set the register to use an external clock in i.MX8mp as mentioned in the reference manual section 5.3(crystal oscillator) , whose link i have mentioned below.
https://www.nxp.com/webapp/Download?colCode=IMX8MPRM

Thanks & Regards

Sanket Parekh

0 Kudos

761 Views
Jimmychea
Contributor III

May i know where and how to change the register so that able to use external clock ? Thanks

0 Kudos

734 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Jimmychea,

As per structure wise the dts made looks correct but there's a suggestion that is recommended:

One should not use external clock on i2c peripheral as a main clock source, because as boot sequence starts, it will look out for clock first and then different peripheral, so it is recommended that one should not configure clock on i2c peripheral, instead one can configure a crystal oscillator as a clock.

Thanks & Regards,
Sanket Parekh

0 Kudos

730 Views
Jimmychea
Contributor III

Can you provide the solution based on your recommendation? Thanks.

0 Kudos

709 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @Jimmychea 

->To configure a crystal oscillator as a clock, There are 2 XTAL modules which are available on the chip, which are used to generate a reference clock, 1st is 24 Mhz & 2nd is 32 kHz.
->For all PLLs, the 24MHz clock from the oscillator can be used as the PLL(peripheral clock) reference clock directly.

->For more details like register definition or memory mapping Please refer to the reference manual (section clock controller module & Crystal oscillator).
I've shared the link for the same, please find the same.
https://www.nxp.com/webapp/Download?colCode=IMX8MPRM

Thanks & Regards.

Sanket Parekh

0 Kudos