AM625: Help setting PRUSS clock to 333MHz on AM6254

Part Number: AM625
Other Parts Discussed in Thread: SK-AM62B-P1

Tool/software:

Hi all,

I'm trying to set the PRUSS core clock to 333 on an SK-AM62B-P1 board using information from the following pages:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1048998/re-am6442-how-to-check-and-set-the-pru-core-frequency-in-linux

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1049800/faq-pru_icssg-how-to-check-and-set-pru-core-frequency-in-linux

Ultimately I went for using the following addition to `pruss_core_clk`:

&pruss_coreclk_mux {
	assigned-clocks = <&k3_clks 81 0>, <&pruss_coreclk_mux>;
	assigned-clock-parents = <&k3_clks 81 1>, <&k3_clks 81 20>;
	assigned-clock-rates = <333000000>;
};

`k3conf` seems to confirm that the PRU is running at 333MHz, but I'm not exactly sure of what to make of its output:

# k3conf dump clock 81

|------------------------------------------------------------------------------|
| VERSION INFO                                                                 |
|------------------------------------------------------------------------------|
| K3CONF | (version 0.3-nogit built Thu Jul 25 14:13:02 UTC 2024)              |
| SoC    | AM62X SR1.0                                                         |
| SYSFW  | ABI: 4.0 (firmware version 0x000a '10.1.1--v10.01.01 (Fiery Fox))') |
|------------------------------------------------------------------------------|

|-----------------------------------------------------------------------------------------------------------------------------------|
| Device ID | Clock ID | Clock Name                                                             | Status          | Clock Frequency |
|-----------------------------------------------------------------------------------------------------------------------------------|
|    81     |     0    | DEV_ICSSM0_CORE_CLK                                                    | CLK_STATE_READY | 333333333       |
|    81     |     1    | DEV_ICSSM0_CORE_CLK_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT0_CLK           | CLK_STATE_READY | 333333333       |
|    81     |     2    | DEV_ICSSM0_CORE_CLK_PARENT_POSTDIV4_16FF_MAIN_0_HSDIVOUT9_CLK          | CLK_STATE_READY | 333333333       |
|    81     |     3    | DEV_ICSSM0_IEP_CLK                                                     | CLK_STATE_READY | 250000000       |
|    81     |     4    | DEV_ICSSM0_IEP_CLK_PARENT_POSTDIV4_16FF_MAIN_2_HSDIVOUT5_CLK           | CLK_STATE_READY | 250000000       |
|    81     |     5    | DEV_ICSSM0_IEP_CLK_PARENT_POSTDIV4_16FF_MAIN_0_HSDIVOUT6_CLK           | CLK_STATE_READY | 200000000       |
|    81     |     6    | DEV_ICSSM0_IEP_CLK_PARENT_BOARD_0_CP_GEMAC_CPTS0_RFT_CLK_OUT           | CLK_STATE_READY | 0               |
|    81     |     8    | DEV_ICSSM0_IEP_CLK_PARENT_BOARD_0_MCU_EXT_REFCLK0_OUT                  | CLK_STATE_READY | 0               |
|    81     |     9    | DEV_ICSSM0_IEP_CLK_PARENT_BOARD_0_EXT_REFCLK1_OUT                      | CLK_STATE_READY | 0               |
|    81     |    10    | DEV_ICSSM0_IEP_CLK_PARENT_SAM62_PLL_CTRL_WRAP_MCU_0_CHIP_DIV1_CLK_CLK  | CLK_STATE_READY | 400000000       |
|    81     |    11    | DEV_ICSSM0_IEP_CLK_PARENT_SAM62_PLL_CTRL_WRAP_MAIN_0_CHIP_DIV1_CLK_CLK | CLK_STATE_READY | 500000000       |
|    81     |    13    | DEV_ICSSM0_UCLK_CLK                                                    | CLK_STATE_READY | 192000000       |
|    81     |    14    | DEV_ICSSM0_VCLK_CLK                                                    | CLK_STATE_READY | 250000000       |
|-----------------------------------------------------------------------------------------------------------------------------------|

So I built a small firmware that just toggles a GPO at fixed rate (cycles):

    while (1 ) {
        __delay_cycles(100);
        __R30 |= 0x80;
        __delay_cycles(100);
        __R30 &= ~0x80;
    }

And measured the output with a scope.

What I found is that although `k3conf` follows the assigned-clock-rate that I set, the timings of the GPO remain unchanged, whereas I'd expect them to scale almost linearly with the configured PRU frequency (200, 250 or 333 MHz).

Even though this has been thoroughly covered in the links above I'm probably still missing some key to understand that information and need your help figuring this out.

Is my assumption that the loop above does not scale up in speed as we increase the PRU clock?

What is ` <&k3_clks 81 20>`  ? I searched it in AM62X Clock Identifiers and couldn't find a description.

Finally, in addition to the increase of the clock to 333MHz, is it possible to enable spread spectrum on the input PLL?

Kind regards,

António