Wiki

This version (04 Sep 2019 14:16) was approved by spopa.

ADF4371 IIO Wideband Synthesizer Linux Driver

Supported Devices

Supported Boards

This driver supports the

Description

The ADF4371 allows implementation of fractional-N or Integer N phase-locked loop (PLL) frequency synthesizers when used with an external loop filter and an external reference frequency. The wideband microwave voltage controlled oscillator (VCO) design allows frequencies from 62.5 MHz to 32 GHz to be generated.

The ADF4371 has an integrated VCO with a fundamental output frequency ranging from 4000 MHz to 8000 MHz. In addition, the VCO frequency is connected to divide by 1, 2, 4, 8, 16, 32, or 64 circuits that allows the user to generate radio frequency (RF) output frequencies as low as 62.5 MHz at RF8x. A frequency multiplier at RF16x generates from 8 GHz to 16 GHz. A frequency quadrupler generates frequencies from 16 GHz to 32 GHz at RF32x. RFAUX8x duplicates the frequency range of RF8x or permits direct access to the VCO output. To suppress the unwanted products of frequency multiplication, a harmonic filter exists between the multipliers and the output stages of RF16x and RF32x.

Control of all on-chip registers is through a 3-wire interface. The ADF4371 operates with analog and digital power supplies ranging from 3.15 V to 3.45 V, and 5 V for the VCO power supply. The ADF4371 also contains hardware and software power-down modes.

Source Code

Status

Files

Function File
driver drivers/iio/frequency/adf4371.c
Documentation adf4371.yaml
ABI documentation sysfs-bus-iio-frequency-adf4371

Example device tree

Function File
dts rpi-adf4371-overlay.dts

Example platform device initialization

The ADF4371 driver is a SPI bus driver and can be instantiated via device tree.

Required properties:

  • compatible: Should always be one of these:
    • “adi,adf4371”
    • “adi,adf4372”
  • reg: SPI chip select number.
  • spi-max-frequency: Max SPI frequency to use.
  • clocks: a list of phandle, one for each entry in clock-names.
  • clock-names: Must include the following entry: “clkin”

Optional properties:

  • clock-scales: The Common Clock Framework max rate is limited by MAX of unsigned long. For ADF4371/ADF4372 devices this is a deficiency. If specified, this property allows arbitrary scales. The first element in the array should be the multiplier and the second element should be the divider.
  • adi,mute-till-lock-en: If this property is present, then the supply current to RF8P and RF8N output stage will shut down until the ADF4371/ADF4372 achieves lock as measured by the digital lock detect circuitry.
  • adi,charge-pump-microamp: Sets the charge pump current. If this property is not specified, then the charge pump current is set to the default 1750uA. The valid values are listed below. However, if the set value is not supported, the driver will look for the closest valid charge pump current. Valid values: 350, 700, 1050, 1400, 1750, 2100, 2450, 2800, 3150, 3500, 3850, 4200, 4550, 4900, 5250, 5600.
  • adi,loop-filter-inverting: If this property is present, then the phase detector polarity will be set to negative because of the positive tuning of the VCO.

Channel specific optional properties:

  • reg: The channel number. It can have up to 3 channels on adf4372 and 4 channels on adf4371, numbered from 0 to 3.
  • adi,output-enable: If this property is specified, the output channel will be enabled. If left empty, the driver will initialize the defaults (RF8x, channel 0 will be the only one enabled).
  • adi,power-up-frequency: Set the frequency after power up for the channel. If this property is specified, it has to be in sync with the power up frequency set on the other channels. This limitation is due to the fact that all the channel frequencies are derived from the VCO fundamental frequency.
Example:

spi0 {
        #address-cells = <1>;
        #size-cells = <0>;
        frequency@0 {
                compatible = "adi,adf4371";
                reg = <0>;
                #address-cells = <1>;
                #size-cells = <0>;
                #clock-cells = <1>;
                spi-max-frequency = <1000000>;
                clocks = <&adf4371_clkin>;
                clock-names = "clkin";
                clock-scales = <1 10>;
                channel@0 {
                        reg = <0>;
                        adi,output-enable;
                        adi,power-up-frequency = /bits/ 64 <8000000000>;
                };
                channel@1 {
                        reg = <1>;
                        adi,output-enable;
                };
                channel@2 {
                        reg = <2>;
                        adi,output-enable;
                        adi,power-up-frequency = /bits/ 64 <16000000000>;
                };
                channel@3 {
                        reg = <3>;
                        adi,output-enable;
                        adi,power-up-frequency = /bits/ 64 <32000000000>;
                };
        };
    };

Enabling Linux driver support

Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)

The ADF4371 driver depends on SPI and selects REGMAP_SPI

Adding Linux driver support

Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)

Linux Kernel Configuration
	Device Drivers  --->
	<*>     Industrial I/O support --->
	    --- Industrial I/O support
	             Frequency Synthesizers DDS/PLL --->
                             *** Phase-Locked Loop (PLL) frequency synthesizers ***
                             <*> Analog Devices ADF4371/ADF4372 Wideband Synthesizers

Hardware configuration

Driver testing

Each and every IIO device, typically a hardware chip, has a device folder under /sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under every of these directory folders reside a set of files, depending on the characteristics and features of the hardware device in question. These files are consistently generalized and documented in the IIO ABI documentation. In order to determine which IIO deviceX corresponds to which hardware device, the user can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the sequence in which the iio device drivers are loaded/registered is constant, the numbering is constant and may be known in advance.

02 Mar 2011 15:16

This specifies any shell prompt running on the target

analog:/sys/bus/iio/devices/iio:device0# cd /sys/bus/iio/devices/
root@analog:/sys/bus/iio/devices# ls
iio:device0  iio:device1  iio:device2  iio:device3
root@analog:/sys/bus/iio/devices#

root@analog:/sys/bus/iio/devices# cd iio\:device0
root@analog:/sys/bus/iio/devices/iio:device0# ls -l
total 0
-r--r--r-- 1 root root 4096 sep  4 14:05 dev
-rw-r--r-- 1 root root 4096 sep  4 14:05 muxout_enable
-rw-r--r-- 1 root root 4096 sep  4 14:05 muxout_mode
-r--r--r-- 1 root root 4096 sep  4 14:05 name
lrwxrwxrwx 1 root root    0 sep  4 14:05 of_node -> ../../../../../../../../firmware/devicetree/base/soc/spi@7e204000/adf4371@0
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage0_frequency
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage0_name
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage0_powerdown
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage1_frequency
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage1_name
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage1_powerdown
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage2_frequency
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage2_name
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage2_powerdown
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage3_frequency
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage3_name
-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage3_powerdown
-r--r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage_muxout_mode_available
drwxr-xr-x 2 root root    0 sep  4 14:05 power
lrwxrwxrwx 1 root root    0 sep  2 17:46 subsystem -> ../../../../../../../../bus/iio
-rw-r--r-- 1 root root 4096 sep  2 17:46 uevent

root@analog:/sys/bus/iio/devices/iio:device0#

Show device name

This specifies any shell prompt running on the target

root@analog:/sys/bus/iio/devices/iio:device0# cat name
adf4371

Read channel frequency

This specifies any shell prompt running on the target

root@analog:/sys/bus/iio/devices/iio:device0# cat out_altvoltage0_frequency
8000000000

Read channel name

This specifies any shell prompt running on the target

root@analog:/sys/bus/iio/devices/iio:device0# cat out_altvoltage0_name
RF8x

Set channel frequency

This specifies any shell prompt running on the target

root@analog:/sys/bus/iio/devices/iio:device0# echo 1000000000 > out_altvoltage0_frequency
root@analog:/sys/bus/iio/devices/iio:device0# cat out_altvoltage0_frequency
1000000000

Channel power down

This specifies any shell prompt running on the target

root@analog:/sys/bus/iio/devices/iio:device0# cat out_altvoltage0_powerdown
0
root@analog:/sys/bus/iio/devices/iio:device0# echo 1 > out_altvoltage0_powerdown
root@analog:/sys/bus/iio/devices/iio:device0# cat out_altvoltage0_powerdown
1

Muxout mode

The mux output allows the user to access various internal points on the chip. Valid values that can be written:

This specifies any shell prompt running on the target

root@analog:/sys/bus/iio/devices/iio:device0# cat out_altvoltage_muxout_mode_available
tristate digital_lock charge_pump_up charge_pump_down RDIV2 N_div_out VCO_test high VCO_calib_R_band VCO_calib_N_band
root@analog:/sys/bus/iio/devices/iio:device0# cat muxout_mode
digital_lock
root@analog:/sys/bus/iio/devices/iio:device0# echo charge_pump_up > muxout_mode
root@analog:/sys/bus/iio/devices/iio:device0# cat muxout_mode
charge_pump_up 

More Information

resources/tools-software/linux-drivers/iio-pll/adf4371.txt · Last modified: 04 Sep 2019 14:13 by spopa