imx6ull increase cpu frequency to 792MHz

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx6ull increase cpu frequency to 792MHz

跳至解决方案
1,790 次查看
userpas
Contributor I

Hi,

I built a Debian based OS with the current environment:

  • Linux 6.6.58-rt45-0 - Mainline
  • u-boot 2024.07 - Mainline

I have a custom HW which has an imx6ull microprocessor.  I based the device tree on imx6ul-14x14-evk.dtsi (uboot and kernel). My custom device tree inherits from "imx6ull.dtsi"

I would like to know if I can use 792MHz or 900MHz for CPU freq.

I've seen those frequencies are available on Device Tree definition:

&cpu0 { 
       clock-frequency = <900000000>;
       operating-points = <
               /* kHz  uV */
               900000  1275000
               792000  1225000
               528000  1175000
               396000  1025000
               198000  950000
       >;
       fsl,soc-operating-points = <
               /* KHz  uV */
               900000  1250000
               792000  1175000
               528000  1175000
               396000  1175000
               198000  1175000
       >;
};

However, in my file system I do not have them available:

root@imx6ull:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 
528000
root@imx6ull:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies  
198000 396000 528000

Does it possible? Does it limited by HW, voltage or current input? 

I've seen other questions in the forum related to it but I did not find a clear answer:

How to set imx6UL CPU to 528MHz in U-boot 

About changing the internal LDOs voltage in i.MX6DQ. 

How to set CPU frequency on u-boot? 

 

Thanks,

Javier

0 项奖励
回复
1 解答
1,685 次查看
lapohab
Contributor III

It has been clearly described in the last post. This cannot be burned by yourself. It is burned during production testing. I attach it again.

r.png
It says "Burned by tester program, forindicating IC core speed (Hotburn may not be used)."

Industrial part and Consumer part have different life times. This is in i.MX 6ULL ​​Product Usage Lifetime Estimates (AN5337).
If you force a higher frequency in the software than its grade defined, the life time will inevitably be shortened.

According to your idea, everyone should buy a cheaper Consumer part and burn it into an industrial part by themselves.
It will save lots of money including my running projects.

According to your idea, another case is just burn fuse of industrial part, it can run at 900M without life time impact.
Why NXP does not have 900M industrial part?

Why are there still different parts of different grades for sale?

Remove the other frequencies? Have you ever tried it? Just looking at the code, it doesn't work.

You can only modify the following code, but I think it is only for testing purpose.
As I said before, If you force a higher frequency in the software, the life time will inevitably be shortened.



if (of_machine_is_compatible("fsl,imx6ull")) {
#if 0
if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ)
imx6x_disable_freq_in_opp(dev, 792000000);

if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)
imx6x_disable_freq_in_opp(dev, 900000000);
#endif
}

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,749 次查看
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

If you want to run the i.MX6ULL at exact 900MHz, then for that you need to modify the dts file.

operating-points = <

      /* kHz  uV */
      900000  1275000

Regards

0 项奖励
回复
1,731 次查看
userpas
Contributor I

Hi Josheph,

I have already available that operating point in my device tree, it is defined in imx6ull.dtsi, and by default is set to 900000000Hz.

I decompiled the Device Tree in my running system and I can see the same configuration:

cpus {
        #address-cells = <0x01>;
        #size-cells = <0x00>;

        cpu@0 {
                compatible = "arm,cortex-a7";
                clocks = <0x01 0x5d 0x01 0x1a 0x01 0x26 0x01 0xdb 0x01 0x38 0x01 0x39 0x01 0x19>;
                nvmem-cells = <0x04>;
                device_type = "cpu";
                soc-supply = <0x03>;
                arm-supply = <0x02>;
                clock-names = "arm\0pll2_bus\0pll2_pfd2_396m\0secondary_sel\0step\0pll1_sw\0pll1_sys";
                fsl,soc-operating-points = <0xdbba0 0x1312d0 0xc15c0 0x11edd8 0x80e80 0x11edd8 0x60ae0 0x11edd8 0x30570 0x11edd8>;
                phandle = <0x37>;
                reg = <0x00>;
                clock-frequency = <0x35a4e900>; // 900000000 Hz
                operating-points = <0xdbba0 0x137478 0xc15c0 0x12b128 0x80e80 0x11edd8 0x60ae0 0xfa3e8 0x30570 0xe7ef0>; //900000 - 1275000 ...
                clock-latency = <0xee6c>;
                #cooling-cells = <0x02>;
                nvmem-cell-names = "speed_grade";
        };
};

 

However, I do not have available 792MHz nor 900MHz from user space. And the system is running at 528MHz.

I have exactly the same configuration in u-boot.

What you mean with "modify the dts file" Which dts file? Do you mean leave only 900MHz frequency in DTS?

Thanks,

Javier

0 项奖励
回复
1,729 次查看
lapohab
Contributor III

All frequencies are already in the device tree. The code will determine the chip type based on different fuses and then modify the DTB in real-time.

r.png

 

 

https://github.com/nxp-imx/linux-imx/blob/lf-6.6.3-1.0.0/drivers/cpufreq/imx6q-cpufreq.c

#define OCOTP_CFG3_6UL_SPEED_696MHZ	0x2
#define OCOTP_CFG3_6ULL_SPEED_792MHZ	0x2
#define OCOTP_CFG3_6ULL_SPEED_900MHZ	0x3

static int imx6ul_opp_check_speed_grading(struct device *dev)
{
	u32 val;
	int ret = 0;

	if (of_property_present(dev->of_node, "nvmem-cells")) {
		ret = nvmem_cell_read_u32(dev, "speed_grade", &val);
		if (ret)
			return ret;
	} else {
		struct device_node *np;
		void __iomem *base;

		np = of_find_compatible_node(NULL, NULL, "fsl,imx6ul-ocotp");
		if (!np)
			np = of_find_compatible_node(NULL, NULL,
						     "fsl,imx6ull-ocotp");
		if (!np)
			return -ENOENT;

		base = of_iomap(np, 0);
		of_node_put(np);
		if (!base) {
			dev_err(dev, "failed to map ocotp\n");
			return -EFAULT;
		}

		val = readl_relaxed(base + OCOTP_CFG3);
		iounmap(base);
	}

	/*
	 * Speed GRADING[1:0] defines the max speed of ARM:
	 * 2b'00: Reserved;
	 * 2b'01: 528000000Hz;
	 * 2b'10: 696000000Hz on i.MX6UL, 792000000Hz on i.MX6ULL;
	 * 2b'11: 900000000Hz on i.MX6ULL only;
	 * We need to set the max speed of ARM according to fuse map.
	 */
	val >>= OCOTP_CFG3_SPEED_SHIFT;
	val &= 0x3;

	if (of_machine_is_compatible("fsl,imx6ul"))
		if (val != OCOTP_CFG3_6UL_SPEED_696MHZ)
			imx6x_disable_freq_in_opp(dev, 696000000);

	if (of_machine_is_compatible("fsl,imx6ull")) {
		if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ)
			imx6x_disable_freq_in_opp(dev, 792000000);

		if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)
			imx6x_disable_freq_in_opp(dev, 900000000);
	}

	return ret;
}

 

0 项奖励
回复
1,713 次查看
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

My idea was to remove the other frequencies before blowing the highlighted fuse. You could try to only add the 792MHz node in DTS, if not, you should modify the fuses if your part number matches the 08 code.

JosephAtNXP_0-1731433620226.png

Regards,

0 项奖励
回复
1,686 次查看
lapohab
Contributor III

It has been clearly described in the last post. This cannot be burned by yourself. It is burned during production testing. I attach it again.

r.png
It says "Burned by tester program, forindicating IC core speed (Hotburn may not be used)."

Industrial part and Consumer part have different life times. This is in i.MX 6ULL ​​Product Usage Lifetime Estimates (AN5337).
If you force a higher frequency in the software than its grade defined, the life time will inevitably be shortened.

According to your idea, everyone should buy a cheaper Consumer part and burn it into an industrial part by themselves.
It will save lots of money including my running projects.

According to your idea, another case is just burn fuse of industrial part, it can run at 900M without life time impact.
Why NXP does not have 900M industrial part?

Why are there still different parts of different grades for sale?

Remove the other frequencies? Have you ever tried it? Just looking at the code, it doesn't work.

You can only modify the following code, but I think it is only for testing purpose.
As I said before, If you force a higher frequency in the software, the life time will inevitably be shortened.



if (of_machine_is_compatible("fsl,imx6ull")) {
#if 0
if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ)
imx6x_disable_freq_in_opp(dev, 792000000);

if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)
imx6x_disable_freq_in_opp(dev, 900000000);
#endif
}

0 项奖励
回复
1,678 次查看
userpas
Contributor I

Hi,

Thank you both four replies. Now I understand where the limitation comes from.

The partnumber is MCIMX6Y2CVM05AB, therefore it is nothing to do here.

I've checked the fuses and results match with @lapohab described.

Regarding the software changes... I agree with @lapohab .

By default all frequencies are available in the Device Tree, therefore, if it is supported by the soc, those frequencies must appear in user space and it would be possible to change the CPU frequency in running time. There is no need to hardcode only one frequency in the Device Tree.

Thanks for the support

 

0 项奖励
回复