cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
himesh.bilimoria
Observer
Observer
7,386 Views
Registered: ‎05-21-2015

FPGA Clocks Overwritten by PetaLinux 2015.2

Jump to solution

I am using Vivado 2015.2 with PetaLinux 2015.2. In Vivado I am setting the FPGA FCLKs to specific values and exporting the hardware description file and bitstream to be imported into my PetaLinux project. When I import the .hdf file and check the ps7_init.c file I can see that the FPGA_CLK_CTRL registers have the correct divisors set for my FCLK values. 

 

However, once I boot into PetaLinux and I re-read the register values through software, I notice that the values have changed, meaning my FPGA clock frequency has changed as well. I confirmed this by routing the FPGA clocks to a PMOD connector in Vivado so that I can scope the clock to see the frequency. In Vivado I set the FPGA clock frequency to 50 Mhz, and it is what is set in the FPGA_CLK_CTRL register in the ps7_init.c file prior to boot. Once I boot, and I scope the clock frequency I get a frequency of 100Mhz. 

 

I was wondering if there could be something overwritting the register values once I boot my PetaLinux build and if so what is it so that I can go and change the values to the correct values for my FPGA clocks. 

0 Kudos
1 Solution

Accepted Solutions
himesh.bilimoria
Observer
Observer
13,815 Views
Registered: ‎05-21-2015

I found the solution, it seemed that the ps7_init.c/h files that were located in the /subsystems/linux/hw-description were not being copied over properly into the fsbl build meaning that the clocks that were set there weren't being built into the fsbl. Once I copied the files over my clocks were set properly. 

View solution in original post

0 Kudos
4 Replies
rjsefton
Explorer
Explorer
7,382 Views
Registered: ‎11-25-2014

This one seems to come up at least once a week. You have to enable the clocks in the device tree. See post from @milosoftware here:

 

https://forums.xilinx.com/t5/Embedded-Linux/Can-access-PL-register-from-u-boot-but-not-petalinux/m-p/647821/highlight/true#M13843

 

Also, apparently this issue has been fixed in 2015.2.1. See post by @here:

 

https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Linux-kernel-disables-ps-to-pl-clocks/m-p/651980#M10339

 

 

 

0 Kudos
himesh.bilimoria
Observer
Observer
7,375 Views
Registered: ‎05-21-2015

I have enabled that option in the device tree. The issue isn't that the clock isn't enabled, its the fact that it is set to the wrong frequency after I boot into Linux. 

0 Kudos
rjsefton
Explorer
Explorer
7,371 Views
Registered: ‎11-25-2014

Oops, sorry. Didn't read your entire post.

0 Kudos
himesh.bilimoria
Observer
Observer
13,816 Views
Registered: ‎05-21-2015

I found the solution, it seemed that the ps7_init.c/h files that were located in the /subsystems/linux/hw-description were not being copied over properly into the fsbl build meaning that the clocks that were set there weren't being built into the fsbl. Once I copied the files over my clocks were set properly. 

View solution in original post

0 Kudos