Clock setting for i.MX6QP in clk-imx6q.c is correct?

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

Clock setting for i.MX6QP in clk-imx6q.c is correct?

792 Views
takayuki_ishii
Contributor IV

Hello community,

I'm using i.MX6QP-SABRESD with Linux BSP L4.14.98-2.0.0-ga.

In source file root/drivers/clk/imx/clk-imx6q.c of linux bsp, it have some condition branch as following.

} else if (clk_on_imx6q()) {  if (imx_get_soc_revision() >= IMX_CHIP_REVISION_2_0) {
                  :
                }
  else {
                  :
                }
}            

  

         /*  * for i.MX6QP with speeding grading set to 1.2GHz,  * VPU should run at 396MHz.  */ if (clk_on_imx6q() && imx_get_soc_revision() >= IMX_CHIP_REVISION_2_0) {
   :
 }

It seems that target device are both i.MX6Q and i.MX6QP.

But i.MX6QP, clk_on_imx6q() function return 0.

So if device is i.MX6QP this condition will be false and not run this sentence.

Which is correct answer?

 1) It is correct and it run only i.MX6Q revision 2.0 or later.

 2) It is incorrect, need to run both i.MX6QP and i.MX6Q.

Best regards,

Ishii.

Labels (3)
Tags (1)
0 Kudos
4 Replies

657 Views
takayuki_ishii
Contributor IV

Hello jamesbone

Do you have any comment?

Best regards,

Ishii.

0 Kudos

657 Views
takayuki_ishii
Contributor IV

Hello community,

Do you mind to comment this?

Best regards,

Ishii.

0 Kudos

657 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Takayushi San,

The answer  is :   It is correct and it run only i.MX6Q revision 2.0 or later.


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

657 Views
takayuki_ishii
Contributor IV

Hello Jamesbone,

Thank you for your response.

I trace a function imx_get_soc_revision() and imx_set_soc_revision().

It will return a global variable imx_soc_revision.

It calculate in imx_init_revision_from_anatop() on arch/arm/mach-imx/anatop.c from register USB_ANALOG_DIGPROG(0x020c_8000 + 0x260).

From USB_ANALOG_DIGPROG value in Reference manual and

define of IMX_CHIP_REVISION_x_xx in include/soc/imx/revision.h

It will mached as following.

iMX6Q   Silicon revision 1.2 => IMX_CHIP_REVISION_1_2 0x12

iMX6Q   Silicon revision 1.3 => IMX_CHIP_REVISION_1_5 0x15

iMX6Q   Silicon revision 1.6 => not defined.

iMX6QP Silicon revision 1.0 => IMX_CHIP_REVISION_2_0 0x20

iMX6QP Silicon revision 1.1 => IMX_CHIP_REVISION_2_1 0x21

As a result following condition is not true every time.

if (clk_on_imx6q() && imx_get_soc_revision() >= IMX_CHIP_REVISION_2_0) {
}

Is it really OK to use this condition?

Best regards,

Ishii.

0 Kudos