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.

AM5728: L4PER2 clock being disabled by Linux

Part Number: AM5728

Hi, I am using McASPs in bare metal DSP code alongside a Linux host application. I recently formalised the Linux BSP I was using and now have somehow ended up in a state where the L4PER2 clock is being disabled by the Linux side.

I am not sure of the correct way to tell Linux not to disable this specific clock (I have seen mention of preventing ANY clocks being disabled but I don't imagine this will be good for power consumption / heat).

I tried prodding the CSL_L4PER_CM_CORE_COMPONENT_CM_L4PER2_CLKSTCTRL_REG register in my DSP initialisation code but it seems that Linux is disabling the clock again further on during initialisation. I would also not trust that it would stay enabled indefinitely after this if Linux thinks it owns these clocks.

Is there a way to inform the device tree that a different core will own particular clocks?

I found this in dra7xx-clocks.dtsi

	l4per_cm: l4per_cm@1700 {
		compatible = "ti,omap4-cm";
		reg = <0x1700 0x300>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges = <0 0x1700 0x300>;

		l4per_clkctrl: clk@0 {
			compatible = "ti,clkctrl";
			reg = <0x0 0x20c>;
			#clock-cells = <2>;

			assigned-clocks = <&l4per_clkctrl DRA7_MCASP3_CLKCTRL 24>;
			assigned-clock-parents = <&abe_24m_fclk>;
		};
	};

Is there an override to this to prevent the clock being put to sleep?

Many thanks,

James

  • James,

    Is there a possibility to remove that node altogether on your setup so Linux might not disable unused clocks?
    Basically remove the one you have mentioned above and the once that reference that.

    - Keerthy

  • Keerthy, thank you for your reply. I have attempted this but it seems to be like pulling at a thread as there are many interdependencies via various timers etc.

    I also in despair tried the clk_ignore_unused kernel command line argument however the clock is still being disabled!

    I would really appreciate any further suggestions from anyone.

    Thanks,

    James

  • Okay, so I had to pinch my nose and dive into the kernel source.

    I found the code that is actually doing this is in arch/arm/mach-omap2/clockdomain.c

    I suspect that the definition of the clock sleep dependencies in clockdomains7xx_data.c may not be correct for the l4per2 domain (although I'm not sure if I'm interpreting correctly).

    My solution was to patch the domain flags to forbid sleep:

    static struct clockdomain l4per2_7xx_clkdm = {
    	.name		  = "l4per2_clkdm",
    	.pwrdm		  = { .name = "l4per_pwrdm" },
    	.prcm_partition	  = DRA7XX_CM_CORE_PARTITION,
    	.cm_inst	  = DRA7XX_CM_CORE_L4PER_INST,
    	.clkdm_offs	  = DRA7XX_CM_CORE_L4PER_L4PER2_CDOFFS,
    	.dep_bit	  = DRA7XX_L4PER2_STATDEP_SHIFT,
    	.wkdep_srcs	  = l4per2_wkup_sleep_deps,
    	.sleepdep_srcs	  = l4per2_wkup_sleep_deps,
    	.flags		  = 0,
    };
    

    I hope this may be of help to others that come across similar issues.