Commit Graph

2984 Commits (fbe084a7b7804e2dd2837d1918ec38d96fec320b)

Author SHA1 Message Date
LBFFilho e757859b56
SPI Engine: create inverted CS mode (#1301)
SPI Engine: create inverted CS mode

Add a CS Invert Mask instruction for selecting the polarity of
the Chip Select pins.

Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2024-05-08 11:19:37 -03:00
Ionut Podgoreanu b8418e7e92 xilinx/common: Set the register to an initial value
Signed-off-by: Ionut Podgoreanu <ionut.podgoreanu@analog.com>
2024-05-02 11:02:20 +03:00
Jorge Marques 38037641af
i3c_controller: Naming convention, corner case fix (#1314)
Rename "idle bus" to "bus available" per specification:
* Tune it to require < 1us.

Rename "IBI auto" to "IBI listen":
* Clarify that the controller is listening for IBI's:
* Explain that this field should be set.
* Fix for known IBI's DA with IBI disabled.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-04-30 12:14:47 -03:00
Ionut Podgoreanu 107047e442 axi_dmac: Add Cache Coherency support
This commit implements Cache Coherency through dedicated parameters.

The AxCACHE/AxPROT parameters are automatically set to the most commonly
used values unless otherwise specified. Their default values are:
AxCACHE = CACHE_COHERENT ? 4'b1111 : 4'b0011
AxPROT  = CACHE_COHERENT ? 3'b010  : 3'b000

If Cache Coherency is enabled, the AxCACHE/AxPROT values can be changed
to support systems with different caching policies.

Signed-off-by: Ionut Podgoreanu <ionut.podgoreanu@analog.com>
2024-04-30 17:41:57 +03:00
AndreiGrozav 7e84c2575c axi_pwm_gen: Fix 100% duty cycle width
Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2024-04-30 15:28:14 +03:00
bluncan 5405050518 common: vpk180: Add support for vpk180
Signed-off-by: bluncan <bogdan.luncan@analog.com>
2024-04-26 15:01:50 +03:00
PIoandan 606551b478
ad7606x: Add configurable digital interface support
Unified the ad7606x_fmc project, where both the serial and the parallel interface are implemented.
---------

Signed-off-by: Ioan-daniel Pop <Pop.Ioan-daniel@analog.com>
2024-04-26 12:03:31 +03:00
AndreiGrozav 03043f732a axi_ad9963: Fix TxQ 1 sample delay compared to TxI
For ODDR in "SAME_EDGE" mode.

Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2024-04-19 19:36:40 +03:00
dumitruceclan a23ed6f715 axi_logic_analyzer: Improve overwrite control logic
1. Add intermediary data_src_select register to control output selection
 between DMA and RAW. The switch RAW->DMA is not made until DMA has valid
 data; the switch DMA->RAW is not made until overwrite_enable is 1
 regardless of dac_valid.

2. When overwrite is enabled, set the intermediary DMA register data_r
 to the RAW value.

  This fixes an issue of the logic analizer that caused the last sample of a DMA
transfer to be visible at the next DMA transfer.

Signed-off-by: dumitruceclan <dumitru.ceclan@analog.com>
2024-04-19 19:35:50 +03:00
AndreiGrozav 8c08c5a65a axi_pwm_gen: Update constraint file
This change will fix the timing closure for designs where the external
clock is not a submultiple of the s_axi_clk.

Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2024-04-19 15:23:55 +03:00
AndreiGrozav 344ca6fc3d axi_pwm_gen: New features and fixes
New features:

1. External sync force the phase align. The external sync was used to align
   the phases of enabled pwms, but only after being armed by a
   load_config signal toggle.
   This feature lets the user decide between using load_config to
   arm and wait for a neg-edge of sync or automatic phase align trigger
   on the ext_sync neg-edge.
2. Force align. Lets the user chose between immediately stopping the
   active pulses and realigning them, or waiting for all running pulse
   periods end, before realigning.
3. Start at sync. When this feature is activated, the pulses will start immediately
   after the trigger event. Otherwise, each pulse will start after a period
   equal to the one for which it is set.
4. Use parameters to set the default status after reset of the
   - soft reset
   - start at sync
   - force align
   - ext sync align

Update regmap.

Fixes:

1. The polarity on disabled channels was staying high instead of low.
2. Fix 0 and 100 proc duty cycle configuration.

Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
Signed-off-by: Alin-Tudor Sferle <Alin-Tudor.Sferle@analog.com>
2024-04-19 15:23:55 +03:00
AndreiGrozav 765e9e36f8 axi_dac_interpolate: Update license header 2024-04-19 10:00:35 +03:00
AndreiGrozav faf88adf85 axi_dac_interpolate: Fix low sampling rate issues
Intermittently DAC channel data is 0 after multiple new buffers.
Due to the low sampling rate and DMA flushing, it happens that the
transfer SM gets stuck in flushing mode right before the transmission
should start.

Another frequent issue happens when a new transmission is started.
A buffer must be pushed independently for each channel because of
separate DMAs.
After the first buffer is pushed the Linux driver deactivates the
start_sync flag. Not knowing if the other channel/buffer will be
active/pushed. The start_sync will be re-enabled with the second buffer.
The issue was that the SM of the first buffer went one step further
before the push if the second buffer,not being stopped by the
start_sync.

Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2024-04-19 10:00:35 +03:00
PIoandan ab4ea30f6b
Pulsar_LVDS: Add Project on Zedboard
* Add axi_pulsar_lvds IP core

---------

Signed-off-by: Ioan-daniel Pop <Pop.Ioan-daniel@analog.com>
2024-04-16 11:25:32 +03:00
Jorge Marques e646e61ce4 i3c_controller: Add I3C Controller IP
Add I3C Controller IP with required I3C features support.
Uses IRQ based DAA.
Supports speeds at 100MHz clk: 12.50MHz, 6.25MHz, 3.12MHz, 1.56MHz
Basic IBI support with/without MDB.
Compatible with AMD Xilinx and Altera FPGAs.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-04-12 09:19:18 -03:00
Jorge Marques 6c8dd7ee15 common: Add ad_mem_dual
Dual access memory abstraction.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-04-12 09:19:18 -03:00
Jorge Marques a2a8518911
spi_engine: Remove nonexistent interface, add dep (#1289)
Remove nonexistant pulse_gen_* interface on axi_spi_engine_hw.
Add sync_event.v to spi_engine_offload's intel_deps.
Fixes simultation on questasim.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-04-12 09:17:18 -03:00
IstvanZsSzekely 74089397b3
util_do_ram: Added keep signal to the FIFO (#1291)
util_do_ram: Added keep signal to the FIFO

Signed-off-by: Istvan-Zsolt Szekely <istvan.szekely@analog.com>
2024-04-04 14:35:13 +03:00
Villyam fd81a821b0 library/axi_pwm_gen: Replaced blocking assignments in reset.
Lattice tools give error for using blocking assignments at one side
and non blocking in the other.

Signed-off-by: Villyam <Vilmoscsaba.Jozsa@analog.com>
2024-03-28 17:16:04 +02:00
Villyam 5ebd95004d library/axi_clock_monitor: Removed ID offset check, regmap optimized.
Signed-off-by: Villyam <Vilmoscsaba.Jozsa@analog.com>
2024-03-28 09:34:21 +02:00
Jorge Marques f2a00c8528
spi_engine: Revert Offload AXI signals, ctrl fixup (#1288)
Revert AXI bus signals back to upper case on SPI Engine Offload IP,
changed on e2ca5a991a.
Fixup signals from sd*_data_* to sd*_* for spi_engine_ctrl interface.
Non-breaking mistake, but added warnings to the IP.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-03-14 11:45:33 -03:00
LBFFilho 2052817dcb
SPI Engine: Add registers for Offload memory and FIFO sizes (#1279)
* SPI Engine: Add registers for Offload memory and FIFO sizes

Adds registers at dword 0x04 and 0x05, respectively allowing software
to get the sizes of the Offload Module memories (command and sdo) or
the sizes of the FIFOs on the AXI regmap.

Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2024-03-08 08:40:48 -03:00
Jorge Marques e2ca5a991a
spi_engine: Create interface_ip.tcl (#1251)
Use tcl script instead of static xmls for the interface.
Easier to maintain and are not gitignored.
Rename spi_master to spi_engine because every interface should be
prefixed by the IP name; in this case, spi_engine.
Also, remove interface/*.sv files on make clean and git ignore them.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-02-28 10:31:46 -03:00
Iulia Moldovan 1e4dc519fc adi_util_hbm.tcl: Change wrong var name rx_tx_n->tx_rx_n
Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2024-02-20 17:43:30 +02:00
Iulia Moldovan 608044d124 util_hbm_ip.tcl: Fix LENGTH_WIDTH and HBM_SEGMENTS_PER_MASTER errors
* Value 24 was wrongfully set for parameter LENGTH_WIDTH, because
  it is not among the valid values, which are 28, 29, ..., 34. Set '28'
  to be the default value
* Vivado Tcl somehow didn't accept the old expression set for
  calculating the HBM_SEGMENTS_PER_MASTER parameter, so it was changed
  accordingly to work. Dropped "expr", ".0" and "int ()" parsing and now
  it works

Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2024-02-20 17:43:30 +02:00
PIoandan 86cd484865
lib/axi_pwm_gen: Update pause_cnt logic (#1271)
Signed-off-by: Ioan-daniel Pop <Pop.Ioan-daniel@analog.com>
2024-02-07 11:16:40 +02:00
LBFFilho f01d7e5951
SPI Engine: fix early sdi data clear (#1231)
* SPI Engine: fix early sdi data clear

In case an SPI read was immediately followed by a cs assert, the sdi
register was being cleared one cycle too soon, so that the data being
passed on was always 'b0.

Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2024-02-05 17:18:27 -03:00
IstvanZsSzekely 57356cc4ee
util_axis_fifo: Update (#1255)
* util_axis_fifo: Update

- Added missing signal drivers for tlast and tkeep

Signed-off-by: Istvan-Zsolt Szekely <istvan.szekely@analog.com>
2024-01-26 13:31:21 +02:00
Laez Barbosa d300b9c55c SPI Engine: Formatting on spi_engine_offload
Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2024-01-17 09:11:24 -03:00
Laez Barbosa d45be68ac4 SPI Engine: edge-based trigger
Previous level-based trigger could cause issues in some low
sampling rate setups. This commit changes it to edge-based.

Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2024-01-17 09:11:24 -03:00
Iulia Moldovan b45e7a7313 Replace other master branch references to main
* README.md
* adi_regmap_xcvr.txt
* build_hdl.rst
* hdl_coding_guideline.rst
* data_offload/README.md

Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2024-01-16 16:48:45 +02:00
Iulia Moldovan 68461110aa Replace link in license header from master to main
Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2024-01-16 16:48:45 +02:00
Jorge Marques 107b043550
library: jesd204: Fixup Vivado exiting with error (#1243)
The lack of the create_xgui_files causes Vivado to exit with an error
when running multiple Vivado instances (parallel make case)

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-01-16 12:43:03 +00:00
caosjr bad1d03678
spi_engine: Fixup param ranges and CPHA info (#1239)
Set validation ranges for DATA_WIDTH and NUM_OF_CS for the expected
min/max values in the verilog source code.
Also, fix swapped description for CPHA in the documentation.

Signed-off-by: Carlos Oliveira <caosjr8@gmail.com>
2023-12-18 10:52:26 -03:00
AndreiGrozav 870b27d3d3 axi_pwm_gen: Update ttcl constraints
Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2023-12-15 15:03:07 +02:00
AndreiGrozav e0fc09fc9e axi_pwm_gen: Start, Stop fix
Previously when issuing a load_config, each pwm channel
was stopped in its tracks and waited for an external sync,
if that was active, or load_config release.
The desired behaviour is to wait for the pwm channels to finish
their events from the current period, before a new aligned start.
Also, the first positive edge of each pulse was initiated only
in the second pwm channel period.
This niche behaviours have not affected any functionality in the
long term alignments for current setups.

Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2023-12-15 15:03:07 +02:00
AndreiGrozav e7dd5ce394 axi_pwm_gen: Offset mecanism fix
When leaving the offset equal to zero for a pwm
channel. That pwm channel was not waiting for all
channels to get in sync after a load config.

Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2023-12-15 15:03:07 +02:00
Alin-Tudor Sferle 119d4e43a3 axi_pwm_gen: Add support for 16 channels
Signed-off-by: Alin-Tudor Sferle <Alin-Tudor.Sferle@analog.com>
Signed-off-by: AndreiGrozav <andrei.grozav@analog.com>
2023-12-15 15:03:07 +02:00
Liam Beguin 887ffac0ed
scripts: Parallel build with pattern rules (#1202)
Drop shell for loops in favor of makefile pattern rules,
so make can run targets in parallel using -j.
This doesn't affect Vivado's own settings.

As a benchmark, 12th Gen Intel(R) Core(TM) i9-12900H 5GHz(max):
	$ make -C projects/adrv9009/zcu102/ clean-all
	$ time make -C projects/adrv9009/zcu102/ -j$CORES lib
CORES=1:
	real    9m27.223s
	user    9m2.556s
	sys     0m32.358s
CORES=8:
	real    1m54.639s
	user    16m26.512s
	sys     1m2.317s
i.e. about 5 times faster to build IP core dependencies.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2023-12-14 17:27:23 +00:00
AndreiGrozav 39b2a2b8bb axi_dac_interpolate: Improve the ctrl logic
1. Simplify the control logic by adding a state machine.
The improvements are on code readability and reliability.

2.Add a flush feature which can be used to clean the data from the DMA fifo.
This is useful when the DMA is programmed in cyclic mode and
data transmission is stopped by dma_transfer_suspend flag
The software intervention is reduced at setting the flag(dma_flush_en).
Flushing can also be done when activating the raw value with dma_flush_en active.

3. Add raw value support. Through this changes a user can set
the dac output to a fixed predefined value in the following two cases:
  1. direct, without using the dma.
  2. with dma, as a hold value. The fixed value will be kipped after a cyclic
buffer is stopped by axi_dac_interpolate, through dma_transfer_suspend
register/signal.
The raw value ca be set and transmitted independently on each channel.
The predefined value is stored in reg 0x19(0x64). For more details se
the documentation available at
https://wiki.analog.com/resources/fpga/docs/axi_dac_interpolate
2023-12-12 16:51:05 +02:00
AndreiGrozav 6998cc99b4 m2k: Remove dac last_sample_hold control
axi_dac_interpolate - Remove last sample hold control
axi_ad9963 - Remove last sample hold control and set as default the
last sample hold functionality plus code optimization changes.
2023-12-12 16:51:05 +02:00
Ionut Podgoreanu 2687bbc02e util_hbm: Add the SG interface in DMA instances
Signed-off-by: Ionut Podgoreanu <ionut.podgoreanu@analog.com>
2023-12-04 14:34:33 +02:00
Ionut Podgoreanu f41391fa93 axi_dmac: Add support for DMA Scatter-Gather
This commit introduces a different interface to submit transfers, using
DMA descriptors.

The structure of the DMA descriptor is as follows:

struct dma_desc {
    u32 flags,
    u32 id,
    u64 dest_addr,
    u64 src_addr,
    u64 next_sg_addr,
    u32 y_len,
    u32 x_len,
    u32 src_stride,
    u32 dst_stride,
};

The 'flags' field currently offers two control bits:
- bit 0: if set, the transfer will complete after this last descriptor
  is processed, and the DMA core will go back to idle state; if cleared,
  the next DMA descriptor pointed to by 'next_sg_addr' will be loaded.
- bit 1: if set, an end-of-transfer interrupt will be raised after the
  memory segment pointed to by this descriptor has been transferred.

The 'id' field corresponds to an identifier of the descriptor.

The 'dest_addr' and 'src_addr' contain the destination and source
addresses to use for the transfer, respectively.

The 'x_len' field contains the number of bytes to transfer,
minus one.

The 'y_len', 'src_stride' and 'dst_stride' fields are only useful for
2D transfers, and should be set to zero if 2D transfers are not
required.

To start a transfer, the address of the first DMA descriptor must be
written to register 0x47c and the HWDESC bit of CONTROL register must
be set. The Scatter-Gather transfer is queued similarly to the simple
transfers, by writing 1 in TRANSFER_SUBMIT.

The Scatter-Gather interface has a dedicated AXI-MM bus configured for
read transfers, with its own dedicated clock, which can be asynchronous.

The Scatter-Gather reset is generated by the reset manager to reset the
logic after completing any pending transactions on the bus.

When the Scatter-Gather is enabled during runtime, the legacy cyclic
functionality of the DMA is disabled.

Signed-off-by: Ionut Podgoreanu <ionut.podgoreanu@analog.com>
2023-12-04 14:34:33 +02:00
Stanca Pop 9ba84cf7c0 axi_ad7616: Remove serial dependencies 2023-11-09 14:43:20 +02:00
Alin-Tudor Sferle 03c4276a2b axi_ad7606x: Add the correct IP's name
Signed-off-by: Alin-Tudor Sferle <Alin-Tudor.Sferle@analog.com>
2023-11-07 15:00:06 +02:00
LBFFilho becc035ba9
SPI Engine: Fixed delay behaviour on Chip-Select and Sleep instructions (#1200)
Fixed wrong behaviour on chip select instruction:
- previously, a sleep time happened before the chip select change
- the intended behaviour was for another sleep time, of equal amount, to happen after the chip select change as well
- additionally, the counter logic implementation was creating an additional factor of 2 on the sleep time

All of the above points were fixed. The changes introduced also fix another issue where the sleep instruction was likewise happening with a duration larger than intended by a factor of 2


Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2023-10-30 09:52:04 -03:00
AndreiGrozav f8ee407f34 axi_ad4858: Initial commit
The axi_ad4858 IP core is design as the HDL interface for the AD4858 ADC.
Features:
 - AXI based configuration
 - LVDS and CMOS support
 - Configurable number of active data lines (CMOS - build-time configurable)
 - Oversampling support
 - Supports packet formats 0,1,2 or 3
 - CRC check support
 - Real-time data header access
 - Channel based raw data access(0x0408)
 - Xilinx devices compatible

Documentation at https://wiki.analog.com/resources/fpga/docs/axi_ad4858
2023-10-05 10:19:03 +03:00
AndreiGrozav 6128dd1ab5 up_dac_channel: Cosmetics - fix indentation 2023-10-02 11:14:57 +03:00
PopPaul2021 cd33c99b94 library/axi_ad3552r: Added interface IP for Xilinx projects.
The custom interface IP for AD3552R DAC has more operation capabilities:
  - 8b register read/write SDR/DDR
  - 16b register read/write SDR/DDR
  - data stream SDR/DDR ( clk_in/8 or clk_in/4 update rate)
  - selectable input source : DMA/ADC/TEST_RAMP
  - data out clock(SCLK) has clk_in/8 frequency when the converter is configured and clk_in/2 when the converter is in stream mode
  - the IP reference clock (clk_in) can have a maximum frequency of 132MHz
  - the IP has multiple device synchronization capability when the DMA is set as an input data source

Signed-off-by: PopPaul2021 <Paul.Pop@analog.com>
2023-10-02 11:07:08 +03:00
PopPaul2021 86836f5a40 library/common: Added DAC custom read/write interface in up_dac_common.
The DAC common regmap was updated with 3 registers(rd/wr/ctrl) and 1 interface status flag for converters with custom control interface.
2023-10-02 11:07:08 +03:00