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.

AM625: SDK 10: ti-sci-clk: recalc-rate failed for dev=81, clk=20, ret=-19

Part Number: AM625

Tool/software:

We have been testing the new 10 SDK and have just noticed this clock error. We see that it was a problem in the 9.2 sdk (see this e2e post: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1328959/am625-ti-sci-clk-recalc-rate-errors/5081170).

My question is: How can we fix this?

Thank you,

    Joshua Bourgeot

  • Hello Joshua,

    Looks like this was not filed in time to get into SDK 10.0, but we do have a bug filed to fix for SDK 10.1. It looks like the person who wrote the code for AM62x PRUSS just copy-pasted the clock settings from AM64x PRU_ICSSG, without taking into account the fact that the AM62x clock tree is different.

    Ok, so how to fix it? 

    That requires a longer discussion.

    Since these settings were copied from AM64x, let's first figure out what is going on with AM64x:

    In the default AM64x settings, the interface clock (iclk) sources the VCLK input (i.e., iclk = VCLK):

    And we can verify from the AM64x TISCI clocks that clock ID 20 = VCLK = iclk = 250MHz
    https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am64x/clocks.html#clocks-for-pru-icssg0-device

    What if we want to do the same thing on AM62x? Can we just find the VCLK entry and set the clock source to that?

    No. Or at least, I don't think so.

    First off, I strongly suspect that the AM62x TRM graphic on the PRU's clock generation is WRONG. i.e., I believe this diagram and paragraph are NOT CORRECT. I will file a bug against the TRM to make sure:

    Here's what we know for sure:

    The clock going to the AM62x PRU cores can be sourced from either MAIN_PLL2_HSDIV0_CLKOUT, or MAIN_PLL_HSDIV9_CLKOUT. From the TRM's module integration chapter:

    Here's what I don't know: 

    AM64x had several additional clocking options (e.g., send VCLK input to CORE_CLK and IEP_CLK so that IEP counter & core counter are synchronous with the interface clock, route IEP_CLK input to the CORE_CLK). I do not see any evidence that those clocking options also exist on AM62x, but I will check.

    Note the devicetree's addresses here for both AM64x & AM62x:
    pruss_cfg: cfg@26000 refers to the PRU CFG registers at offset 0x2_6000 from the beginning of the PRU register set
    coreclk-mux@3c refers to the CFG register at 0x3C. On AM64x, this register selects the CORE_CLK source between ICSSGn_CORE_CLK and ICLK/VCLK.

    I don't know what that register does on AM62x (if anything). If it still selects between CORE_CLK and VCLK, that behavior is undocumented.

    ok, so... what next?

    Are you actually using the PRU subsystem, or are you just trying to squash any error outputs during boot time?

    If you are using the PRU subsystem, what frequency do you want to run the PRU cores at? "standard" options are 200MHz, 250MHz, 333MHz (5ns, 4ns, 3ns per clock cycle)

    I suspect we'll need to do "multiple levels of clock muxing" as described here for AM64x, but I don't know for sure since I haven't tried on AM62x yet:
    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

    Regards,

    Nick

  • Hi Nick,

        Thank you for the quick and thorough response. We were testing the board and saw this non trivial error message and wanted to ensure it wasn't causing any problems. We are not currently using the PRU subsystem. Based on your write-up, I believe we should be fine until this is addressed in the 10.1 SDK.

    Thank you again,

        Joshua Bourgeot

  • Hello Joshua,

    Sounds good. I'll continue working on this in the background to make sure it actually gets addressed for SDK 10.1. Feel free to create a new thread if any other questions pop up.

    Regards,

    Nick

  • Partial update for any future customers:

    Rev B of AM62x TRM is wrong. The PRU subsystem in AM62x has the same input clock configuration as AM64x:

    And the mux for CORE_CLK input and IEP_CLK input is still controlled by the same registers as AM64x:

    ICSSG_IEPCLK_REG (offset 0x26000, register 0x30)
    Bit IEP_OCP_CLK_EN: 0h = iep_clk is the source, 1h = ICSSGn_CORE_CLK is the source

    ICSSG_CORE_SYNC_REG (offset 0x26000, register 0x3C)
    Bit CORE_VBUSP_SYNC_EN: 0h = ICSSGn_CORE_CLK is the source, 1h = ICSSGn_ICLK is the source

    Note that the PRU core frequency (CORE_CLK) can be sourced by either the external CORE_CLK input, or the VCLK (i.e., interface clock) input, but NOT the IEP_CLK input. The paragraph in the image above says that the "CORE block" allows software to select from the IEP_CLK, but it looks like "CORE block" (which includes IEP_CLK, CORE_CLK, and VCLK) is different from "PRU core" (which is CORE_CLK).

    Regards,

    Nick

  • Hi Nick,

        If you have the an early kernel patch for this bug, we would be happy to test it on our end.

    Thank you,

        Joshua Bourgeot

  • Hello Joshua,

    The simplest modification would be to select the VCLK's 250MHz clock source for the PRU subsystem. That way you don't have to worry about a 2 stage clock configuration. Like this:

                                    pruss_coreclk_mux: coreclk-mux@3c {
                                            reg = <0x3c>;
                                            #clock-cells = <0>;
                                            clocks = <&k3_clks 81 0>,  /* pruss_core_clk */
                                                     <&k3_clks 81 14>; /* pruss_vclk */
                                            assigned-clocks = <&pruss_coreclk_mux>;
                                            assigned-clock-parents = <&k3_clks 81 14>;
                                    }; 

    Regards,

    Nick

  • Hi Nick,

        Sorry about the delay. We just tested your patch and the warnings related to ti-sci-clk no longer appear. However, we are now seeing a new related warning:

    [    1.181114] OF: /bus@f0000/pruss@30040000/cfg@26000/clocks/coreclk-mux@3c: #clock-cells = 2 found 1

        Does this error make sense to you? #clock-cells is set to 0, not 2 or 1, so we are unsure where to even begin.

    Thank you,

        Joshua Bourgeot

  • Hello Joshua,

    No rush on this side. I might not get developer bandwidth to fix this for the next release for a while.

    Hmm. I am not sure I understand the clock-cells entry based on some initial google searches - let me check around with the rest of the team.

    I wonder if it is complaining about k3_clks, which does have #clock-cells = <2>; However, if I am understanding google correctly, that would mean that &k3_clks references should have 2 entries after it when it is referenced, which is what we are doing (e.g., &k3_clks 81 0, as opposed to #clock-cells = <1>; which would just be in the form &k3_clks 81, or #clock-cells = <0>; which would be in the form &k3_clks).

    To confirm, are you seeing that message as a terminal output on bootup?

    Could I get you to copy-paste your dts modification just so I can take a look?

    Regards,

    Nick

  • That pattern does actually seem to hold up if we look at

                                    pruss_iepclk_mux: iepclk-mux@30 {
                                            reg = <0x30>;
                                            #clock-cells = <0>;
                                            clocks = <&k3_clks 81 3>,       /* pruss_iep_clk */
                                                     <&pruss_coreclk_mux>;  /* pruss_coreclk_mux */
                                            assigned-clocks = <&pruss_iepclk_mux>;
                                            assigned-clock-parents = <&pruss_coreclk_mux>;
                                    };
    

    k3_clks has #clock-cells = <2>. So when it is referenced, it is in the form &k3_clks # #.

    Meanwhile, pruss_coreclk_mux has #clock-cells = <0>. So when it is referenced, it is just in the form &pruss_coreclk_mux.

    Regards,

    Nick

  • Hello Nick,

        We did see this message in the terminal output on bootup, actually in the same place we had got the original recalc-rate warning. The only modification we have made is changing the 20 index to a 14.

    --- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
    @@ -1171,9 +1171,9 @@ pruss_coreclk_mux: coreclk-mux@3c {
                                            reg = <0x3c>;
                                            #clock-cells = <0>;
                                            clocks = <&k3_clks 81 0>,  /* pruss_core_clk */
    -                                                <&k3_clks 81 20>; /* pruss_iclk */
    +                                                <&k3_clks 81 14>; /* pruss_iclk */
                                            assigned-clocks = <&pruss_coreclk_mux>;
    -                                       assigned-clock-parents = <&k3_clks 81 20>;
    +                                       assigned-clock-parents = <&k3_clks 81 14>;
                                    };

        As this does not seem to be causing any problems at the moment, is it ok to ignore?

    Thank you,

        Joshua Bourgeot

  • Hello Joshua,

    You should be able to ignore that output. If anything is getting messed up, it would be the PRU subsystem's clock source, but that does not matter if you are not using the subsystem.

    By the way, if you are not using the subsystem, I would suggest disabling the devicetree node, like this example. I would actually expect the error outputs to go away, since Linux would no longer be trying to initialize that subsystem.
    arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts (sdk 9.2.1 version of the code)

    /*
     * All SoC variants with the AMC package have no PRU.
     * Attempting to access the PRU on these devices will
     * result in a crash at kernel bootup.
     *
     * For now, we do not have any code that can figure out
     * the absence of the PRU by reading any SoC registers,
     * so for now disable the PRU here in the board DTS file.
     */
    &pruss {
            status = "disabled";
    };
    

    Note to future readers: this pruss "disabled" code has been removed from Linux SDK 10.0. I assume that is a bug, because I just had a customer this week who verified they were unable to attach CCS to a PRU subsystem on the AM62x LP SK (i.e., they confirmed that the processor part number on the LP SK does not have a PRU subsystem in it). I have filed a bug against both the software and the hardware documentation to get the lack of a PRU subsystem re-documented.

    Regards,

    Nick

  • Hi Nick,

        Thank you for the response. While we are not currently testing the PRU subsystem, we do believe it may be a valuable feature for our customers and do not want to outright disable it. Is there a prebuilt PRU firmware test we could run to make sure the PRU subsystem is completely functional?

    Best,

        Joshua Bourgeot

  • Hello Joshua,

    Please refer to the RPMsg Echo code. I'll link you to the quick start guide below (which is currently a bit out of date)

    Note that you will NOT need to rebuild the kernel & kernel modules - the default filesystem image should already have PRU RPMsg enabled. There should already be RPMsg Echo PRU firmware built into the AM62x SDK 10 default filesystem.

    The PRU firmware location has moved in SDK 10.0. If you go to /lib/firmware and do ls -al (those are "L"s), you'll see where the PRU firmware is now stored.

    Follow these steps to see which remoteprocX is which, and use echo > start to start up the PRU firmware. I would not expect you to need to point to different firmware than the default PRU firmware:
    https://dev.ti.com/tirex/explore/node?node=A__AckaMLLzyxszvNaSLSFIQg__AM62-ACADEMY__uiYMDcq__LATEST 

    Steps to actually run the RPMsg echo test: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_00_07_04/exports/docs/linux/Foundational_Components/PRU-ICSS/RPMsg_Quick_Start_Guide.html#booting-the-board-and-testing-rpmsg 

    Here's the source code if it is needed:
    Source: https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am62x

    Regards,

    Nick