Wiki

This version is outdated by a newer approved version.DiffThis version (18 Mar 2021 16:53) was approved by Michael Hennerich.The Previously approved version (18 Mar 2021 10:15) is available.Diff

This is an old revision of the document!


ADI JESD204B/C Transmit Peripheral Linux Driver

Supported Devices

Description

The AXI JESD204B TX peripheral driver is a simple driver that supports the ADI JESD204B Transmit Peripheral. The driver reads JESD204B link configuration data from the devicetree and configures the peripheral accordingly. After configuration has completed the JESD204B link is enabled. Link state can be monitored through sysfs files.

This driver also work in conjunction with the JESD204 (FSM) Interface Linux Kernel Framework, in this case JESD204B link configuration is provided by the JESD204-FSM framework.

Source Code

Status

Files

Example platform device initialization

The AXI JESD204B driver is a platform driver and can currently only be instantiated via device tree.

Deprecated Non-jesd204-fsm mode

Required devicetree properties:

  • compatible: Must always be “adi,axi-jesd204-tx-1.00.a”
  • reg: Base address and register area size. This parameter expects a register range.
  • interrupts: Property with a value describing the interrupt number.
  • clock-names: List of input clock names - “s_axi_aclk”, “device_clk”
  • clocks: Clock phandles and specifiers (See clock bindings for details on clock-names and clocks).
  • adi,frames-per-multiframe: Number of frames per multi-frame (K)
  • adi,octets-per-frame: Number of octets per frame (F)

Optional devicetree properties:

  • adi,high-density: If specified the JESD204B link is configured for high density (HD) operation.
  • adi,converter-resolution: Converter resolution (N).
  • adi,bits-per-sample: Number of bits per sample (N').
  • adi,converters-per-device: Number of converter per device (M).
  • adi,control-bits-per-sample: Number of control bits per conversion sample (CS).
  • adi,subclass: The JESD204B subclass.

Example:

		jesd204b-tx@77a00000 {
			compatible = "adi,axi-jesd204-tx-1.00.a";
			reg = <0x77a00000 0x10000>;
			interrupts = <0 56 4>;

			clock-names = "s_axi_aclk", "device_clk";
			clocks = <&clkc 14>, <&ad9528 13>;

			adi,octets-per-frame = <32>;
			adi,frames-per-multiframe = <4>;
		};

jesd204-fsm mode

When using the JESD204 (FSM) Interface Linux Kernel Framework the JESD link parameters are broadcasted by the framework to all link components.

Required devicetree properties:

  • compatible: Must always be “adi,axi-jesd204-rx-1.00.a”
  • reg: Base address and register area size. This parameter expects a register range.
  • interrupts: Property with a value describing the interrupt number.
  • clock-names: List of input clock names - “s_axi_aclk”, “device_clk”, “lane_clk”
  • clocks: Clock phandles and specifiers (See clock bindings for details on clock-names and clocks).
  • jesd204-device: Adds device to the jesd204-fsm kernel framework
  • jesd204-inputs: jesd204-fsm devices phandles and specifiers (used to build the link topology)

Optional devicetree clock-names:

  • link_clk: When using the link layer gearbox in order to support NP=12 modes, device_clk and link_clock need to be different. This is typical the case in case SYNTH_DATA_PATH_WIDTH and TPL_DATA_PATH_WIDTH differs. Then device_clk becomes link_clk times SYNTH_DATA_PATH_WIDTH / TPL_DATA_PATH_WIDTH. link_clk still needs to be lane_clk / 40 for JESD204B/8B10B encoding and lane_clk / 66 for JESD204C/64B66B encoding.
  • conv2: Optional SERDES (CPLL/QPLL) REFCLK from a difference source which rate and state must be in sync with the main conv clk.

Example:

		axi_ad9081_tx_jesd: axi-jesd204-tx@84b90000 {
			compatible = "adi,axi-jesd204-tx-1.0";
			reg = <0x84b90000 0x1000>;

			interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;

			clocks = <&zynqmp_clk 71>, <&hmc7044 6>, <&axi_ad9081_adxcvr_tx 0>;
			clock-names = "s_axi_aclk", "device_clk", "lane_clk";

			jesd204-device;
			#jesd204-cells = <2>;
			jesd204-inputs = <&axi_ad9081_adxcvr_tx 0 DEFRAMER_LINK0_TX>;
		};

Enabling 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
	    -*-   Enable ring buffer support within IIO
	    -*-     Industrial I/O lock free software ring
	    -*-   Enable triggered sampling support

            <*>   JESD204 High-Speed Serial Interface Support  --->
	    [--snip--]
		<*>   Analog Devices AXI JESD204B TX Support
	    [--snip--]

Sysfs Interface

This driver provides advanced diagnostics, status and via sysfs. A brief summary is with examples are provided below.

This specifies any shell prompt running on the target

root@analog:/sys/bus/platform/devices/84b90000.axi-jesd204-tx# ls -l
total 0
lrwxrwxrwx 1 root root    0 Feb  6 16:38 driver -> ../../../../bus/platform/drivers/axi-jesd204-tx
-rw-r--r-- 1 root root 4096 Feb  6 16:39 driver_override
-r--r--r-- 1 root root 4096 Feb  6 16:39 encoder
drwxr-xr-x 3 root root    0 Feb  6 16:38 jesd204:5
-r--r--r-- 1 root root 4096 Feb  6 16:39 modalias
lrwxrwxrwx 1 root root    0 Feb  6 16:39 of_node -> ../../../../firmware/devicetree/base/fpga-axi@0/axi-jesd204-tx@84b90000
drwxr-xr-x 2 root root    0 Feb  6 16:39 power
-r--r--r-- 1 root root 4096 Feb  6 16:39 status
lrwxrwxrwx 1 root root    0 Feb  6 16:38 subsystem -> ../../../../bus/platform
-rw-r--r-- 1 root root 4096 Feb  6 16:38 uevent

Reading the device/link status:

This specifies any shell prompt running on the target

root@analog:/sys/bus/platform/devices/84b90000.axi-jesd204-tx# cat status 
Link is enabled
Measured Link Clock: 375.034 MHz
Reported Link Clock: 375.000 MHz
Measured Device Clock: 375.034 MHz
Reported Device Clock: 375.000 MHz
Desired Device Clock: 375.000 MHz
Lane rate: 15000.000 MHz
Lane rate / 40: 375.000 MHz
LMFC rate: 46.875 MHz
SYNC~: deasserted
Link status: DATA
SYSREF captured: Yes
SYSREF alignment error: No

Reading the Encoder used:

This specifies any shell prompt running on the target

root@analog:/sys/bus/platform/devices/84b90000.axi-jesd204-tx# cat encoder 
8b10b

More Information

resources/tools-software/linux-drivers/jesd204/axi_jesd204_tx.1616082719.txt.gz · Last modified: 18 Mar 2021 16:51 by Michael Hennerich