Programming Clocks on the ZCU111

This wiki will discuss the on-board ZCU111 clock topology and how these can be programmed via Linux (i2c-tool) or via a C application on the A53.

Table of Contents

ZCU111 Board Clocks Topology:

The clocking structure on the ZCU111 can be seen on page 54 here. The Clock sources; LMK04208 and LMX2594 are accessible via the I2CSPI over the IC21 bus:

The device-tree node for this can be seen here:

As shown in the sc18is603 device node, there are 4 CS for each clock source:

  1. LE_2494_A (LMX RF1 PLL)  = 0x8
  2. LE_2594_B (LMX RF2 PLL)  = 0x4
  3. LE_4208 (LMK)                      = 0x2
  4. LE_2594_C (LMX RF3 PLL)  = 0x1


ZCU111 Board Clocks Programming:

There is source code provided in the RFDC driver example; xrfdc_clk.c and xrfdc_clk.h (used above) that contain pre-written configure sequence from TI TICS PRO utility,

that is used to program the clock sources on the ZCU111. Users can also use the i2c-tools utility in Linux to program these clocks. Both flows are discussed below

LMK04208:

This is the low noise jitter cleaner that feds the LMK2594. The LMX2594 is programmed using 24-bit shift registers. The shift register consists of a R/W bit (MSB), followed

by a 7-bit address field and a 16-bit data field. For the R/W bit, 0 is for write, and 1 is for read. The address field

ADDRESS[6:0] is used to decode the internal register address. The remaining 16 bits form the data field DATA[15:0].

LMX2594:

The LMX is programmed using 24 bit shift register. This is the clock provides the clock to the tiles on the RFDC:

LMK04208 C Code Programming:

The LMK04208 can be programmed via a C code application delivered with the RFDC driver, the code snippet is shown below.

LMX2594 C Code programming:

The LMK04208 can be programmed via a C code application delivered with the RFDC driver, the code snippet is shown below.

There are pre-configured sequences in the code that will allow the user to use one any of the frequencies below:

These two functions can be called in the user application as shown below:

Using i2c-tools to program the LMK and LMX devices:

Users can use the i2cdetect utility to read all the devices on the I2C bus. For example:

Here, the driver will “hop” through each mux to show all possible devices in the i2c bus topology.

In order to program the LMK or LMX devices on the ZCU111, users will need to find the SCI18IS60C device on the I2C bus.

To do this, users can do a i2cdetect -y -r busaddr

Where the busaddr would be 0 to 22 in this case (as per the i2cdetect -l command above).

Users can do a grep on the result to see if the 0x2f (as we seen form the device node above is the SCI18IS60C device).

If the i2c bus topology isnt likely to change, then we can just hard-code this address into the script command.

However, if the bus topology is likely to change, ie add remove i2c from PS or AXI I2C in the PL, then user can script around this to dynamically find the SCI18IS60C device

For example, the function below will search through all possible bus addresses, and do a grep until it finds the expected device ID (0x2f):

Now, that the bus address for the SCI18IS602 device is found. we can access the various clocks by passing the CS. The various CS can be seen below:

  1. LE_2494_A (LMX RF1 PLL)  = 0x8
  2. LE_2594_B (LMX RF2 PLL)  = 0x4
  3. LE_4208 (LMK)                      = 0x2
  4. LE_2594_C (LMX RF3 PLL)  = 0x1

To target the LMK, then the i2cset command would look like:

To target the LMX, then the i2cset command would look like:

The data can be created using the TICS Pro tool from TI. This script can be passed to the Petalinux project as shown below:

update the project-spec\meta-user\recipes-apps\bootscript\bootscript.bb:

Then update the project-spec\meta-user\recipes-apps\bootscript\files\bootscript with the i2cset commands (also attached below):

This script should be auto-ran upon boot: