UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
741 Views
Registered: ‎11-11-2015

Peripheral clocks getting disabled

Jump to solution

Zynq 7020, Vivado/PetaLinux 2018.3. I am using SPI0 in the PS and I could not read from the registers for this peripheral, the register reads would always return 0.

If I look at the Zynq Aper_Clk_Ctrl register I see that bit SPI0_CPU_1XCLKACT (bit 14) is 0, meaning that the SPI clock is disabled. The conents of the register are 0x200440. If I set that bit 14 to a 1 I can then read the SPI0 registers.

If I stop at a u-boot prompt and query the address of the aper_clk_ctrl register I see that the value is exactly as is set in my ps7_init.c file (0x017C44CD) and that bit 14 is set to 1. However when Linux boots the value of that register is 0x200440 and bit 14 is cleared. Why is that spi clock getting disabled by the kernel? I looked at the device and the status is okay (not disabled), everything in the dts files looks ok.

What causes the kernel to disable clocks?

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
638 Views
Registered: ‎11-11-2015

Re: Peripheral clocks getting disabled

Jump to solution

In my PL 2018 default setup the Linux kernel power management options "Suspend to RAM and standby" and "Device power management core functionality" were enabled by default.

I disabled both of those and I can now communicate with SPI. I don't know why Linux was suspending the device but I am happy to just disable power management.

 

View solution in original post

0 Kudos
5 Replies
Moderator
Moderator
709 Views
Registered: ‎12-04-2016

Re: Peripheral clocks getting disabled

Jump to solution

Hi @mashman

Try adding the kernel command line parameter  "clk_ignore_unused". This should not disable unused clocks

 

Best Regards

Shabbir

 

0 Kudos
Adventurer
Adventurer
694 Views
Registered: ‎11-11-2015

Re: Peripheral clocks getting disabled

Jump to solution

Thanks, that made a difference, now the value of the aper_clk_cntrl register is 0x012404CC so more clocks are enabled, but the SPI clock is still not. It is enabled in my ps7_init.c file and as I said it is enabled when I query the register in u-boot but Linux still seems to be disabling this clock.

I guess I could map that register into memory in my application and enable any clocks manually but I would rather avoid such a workaround. Any ideas why this clock is still getting disabled? Why are the contents of the aper_clk_cntrl register different after booting linux than what is set in ps7_init (and is read in u-boot)

0 Kudos
Moderator
Moderator
669 Views
Registered: ‎06-27-2017

Re: Peripheral clocks getting disabled

Jump to solution

@mashman,

Zynq has CCF support, clocks for unused modules will be cut off by the CCF framework. May be you are observing the spi clock gated.

Another point I would like to mention is, there might be chance that runtime PM might disabling the spi clock.
could you please share your device tree changes for SPI, if possible?

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.
0 Kudos
Adventurer
Adventurer
659 Views
Registered: ‎11-11-2015

Re: Peripheral clocks getting disabled

Jump to solution

It does seem that Linux is suspending my PS SPI.  If I look at the 'runtime-status' it returns 'suspended'. Could that be why the SPI clock is not enabled?

spiPower.png

 

I've attached my Vivado system.dts (renamed to .txt). Also below is a comparison of the spi nodes in the ISE (working) dts and the Vivado 2018.3 (non-working) dts.  I don't see any obvious reason why the SPI would not be active. The ISE dts is on the left

dtsComp.png

 

0 Kudos
Adventurer
Adventurer
639 Views
Registered: ‎11-11-2015

Re: Peripheral clocks getting disabled

Jump to solution

In my PL 2018 default setup the Linux kernel power management options "Suspend to RAM and standby" and "Device power management core functionality" were enabled by default.

I disabled both of those and I can now communicate with SPI. I don't know why Linux was suspending the device but I am happy to just disable power management.

 

View solution in original post

0 Kudos