This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM623: U-boot 2023.04 is running speed grade I (1.0Ghz) part at 1.25Ghz

Part Number: AM623
Other Parts Discussed in Thread: AM625

Is u-boot configuring the slower speed grade parts to run at 1.25Ghz? Is this okay?

Booting an AM6231 with speed grade I. And the kernel with some debug turned on, is reporting that the cpu frequency is running at 1.25Ghz before it turns it down.

U-Boot 2023.04-00123-g870617427115 (Feb 12 2024 - 10:41:02 -0500)

Linux version 6.1.46-00077-gd699d5c7dc30-dirty

[    2.255152] of: _opp_add_static_v2: turbo:0 rate:200000000 uv:750000 uvmin:750000 uvmax:850000 lat
ency:6000000 level:0
[    2.266133] of: _opp_add_static_v2: turbo:0 rate:400000000 uv:750000 uvmin:750000 uvmax:850000 lat
ency:6000000 level:0
[    2.277134] of: _opp_add_static_v2: turbo:0 rate:600000000 uv:750000 uvmin:750000 uvmax:850000 lat
ency:6000000 level:0
[    2.288152] of: _opp_add_static_v2: turbo:0 rate:800000000 uv:750000 uvmin:750000 uvmax:850000 lat
ency:6000000 level:0
[    2.299073] of: _opp_add_static_v2: turbo:0 rate:1000000000 uv:750000 uvmin:750000 uvmax:850000 latency:6000000 level:0
[    2.309894] cpu cpu0: OPP not supported by hardware: opp-1250000000
[    2.317116] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 1250000 KHz, changing to: 1000000 KHz

  • Hello,
    Have we tried adjusting the DT to match the SoC speed grade?
    git.ti.com/.../k3-am62x-r5-sk-common.dtsi
    Best,
    -Hong

  • Thanks for the pointer, I will give that a try. Then see if I can update my code to modify that parameter based on the speed grade.  I assume leaving this alone would not be wise.

  • Yes, please keep us posted with your testing.

  • Is there room to increase the SIZE_LIMIT_PROVIDE_STACK limit in u-boot?  It is currently 0x3500, but is 0x4400 on the 62A and 0x5000 on the 62P.

  • This is related to trying to dynamically adjust the cpu frequency using the cpu speed grade, just fyi.

    If I do manually tweak the device tree, then the kernel cpufreq warning goes away.

  • Hello,
    As you know, it is tight on internal SRAM on AM62x SoC such that it is tricky to add new code in SPL
    One option is removing un-used code from *defconfig, i.e. flash memory which is not used...
    Best,
    -Hong

  • I started trying to get the R5 SPL to change the cpu frequency but this code causes u-boot to hang when it goes to switch to the A53.  Even if I commented out everything but the first fdt_path_offset, it wouldn't boot.  I've run out of time to look into this so for now we are going to limit all our SOMs to 1Ghz while in u-boot.  This didn't impact boot time, which is a bit surprising.

    am625_init.c:

    /**
     * Reduce A53 frequency for lower speed grades in u-boot dts
     */
    static int fixup_cpu_freq(void *fdt_blob)
    {
    	int ret = 0;
    	int nodeoffset, cnt;
    	u32 assigned_clk_rates[2];
    
    	nodeoffset = fdt_path_offset(fdt_blob, "/a53@0");
    	if (nodeoffset < 0) {
    		panic("%s: Could not find /a53@0 node\n", __func__);
    		return nodeoffset;
    	}
    
    	cnt = fdtdec_get_int_array_count(fdt_blob, nodeoffset,
    					 "assigned-clock-rates", assigned_clk_rates,
    					 ARRAY_SIZE(assigned_clk_rates));
    	// printf("cnt: %d\n", cnt);
    	if (cnt < 0) {
    		panic("%s: Could not get assigned-clock-rates for /a53@0 node\n",
    		       __func__);
    		return cnt;
    	}
    	if (cnt != 2) {
    		panic("%s: assigned-clock-rates for /a53@0 node has invalid count %d\n",
    		       __func__, cnt);
    		return -EINVAL;
    	}
    
    	assigned_clk_rates[1] = 1000000000;
    	printf("%s: assigned-clock-rates[0] = %u, assigned-clock-rates[1] = %u\n",
    	       __func__, assigned_clk_rates[0], assigned_clk_rates[1]);
    
    	ret = fdt_setprop(fdt_blob, nodeoffset, "assigned-clock-rates",
    			  assigned_clk_rates, sizeof(assigned_clk_rates));
    	if (ret < 0)
    		panic("Failed to set assigned-clock-rates property: %d\n", ret);
    
    	return ret;
    }
    
    int fdtdec_board_setup(const void *fdt_blob)
    {
    	return fixup_cpu_freq((void *)fdt_blob);
    }