-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ad5791 offload #2616
base: main
Are you sure you want to change the base?
ad5791 offload #2616
Changes from all commits
bcad791
e92fabe
2602f64
5c9afcd
ac02938
52de110
bac3e06
86c20ff
ef456b2
e9af1e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* Analog Devices AD5791 | ||
* https://www.analog.com/en/products/ad5791.html | ||
* https://analogdevicesinc.github.io/hdl/projects/ad57xx_ardz/index.html | ||
* https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-AD5791ARDZ.html | ||
* https://wiki.analog.com/resources/tools-software/linux-build/generic/socfpga | ||
dlech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* hdl_project: <ad57xx_ardz/de10nano> | ||
* board_revision: <B> | ||
* | ||
* Copyright (C) 2024 Analog Devices Inc. | ||
*/ | ||
/dts-v1/; | ||
#include "socfpga_cyclone5_de10_nano_hps.dtsi" | ||
#include <dt-bindings/dma/axi-dmac.h> | ||
#include <dt-bindings/interrupt-controller/irq.h> | ||
#include <dt-bindings/gpio/gpio.h> | ||
|
||
/ { | ||
dac_vdd: regulator-vdd { | ||
compatible = "regulator-fixed"; | ||
regulator-name = "fixed-supply"; | ||
regulator-min-microvolt = <4096000>; | ||
regulator-max-microvolt = <4096000>; | ||
regulator-always-on; | ||
}; | ||
|
||
dac_vss: regulator-vss { | ||
compatible = "regulator-fixed"; | ||
regulator-name = "fixed-supply"; | ||
regulator-min-microvolt = <4096000>; | ||
regulator-max-microvolt = <4096000>; | ||
regulator-always-on; | ||
}; | ||
|
||
}; | ||
|
||
&fpga_axi { | ||
|
||
adc_trigger: pwm@0x00050000 { | ||
compatible = "adi,axi-pwmgen-2.00.a"; | ||
reg = <0x00050000 0x1000>; | ||
#pwm-cells = <2>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok. |
||
clocks = <&spi_clk 0>; | ||
}; | ||
|
||
tx_dma: tx-dma@0x00030000 { | ||
compatible = "adi,axi-dmac-1.00.a"; | ||
reg = <0x00030000 0x00000800>; | ||
#dma-cells = <1>; | ||
interrupt-parent = <&intc>; | ||
interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>; | ||
clocks = <&spi_clk 0>; | ||
}; | ||
|
||
spi_clk: clock-controller@0x00060000 { | ||
compatible = "altr,c5-fpll"; | ||
reg = <0x00060000 0x00000100>; | ||
#clock-cells = <0x1>; | ||
|
||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
clocks = <&sys_clk>; | ||
assigned-clocks = <&spi_clk 0>; | ||
assigned-clock-rates = <185000000>; | ||
clock-output-names = "outclk0"; | ||
adi,fractional-carry-bit = <32>; | ||
|
||
spi_c0: channel@0 { | ||
reg = <0>; | ||
adi,extended-name = "SPI_CLOCK"; | ||
}; | ||
}; | ||
|
||
spi@0x00040000 { | ||
compatible = "adi-ex,axi-spi-engine-1.00.a"; | ||
reg = <0x00040000 0x00010000>; | ||
interrupt-parent = <&intc>; | ||
interrupts = <0 45 IRQ_TYPE_LEVEL_HIGH>; | ||
clocks = <&sys_clk>, <&spi_clk 0>; | ||
clock-names = "s_axi_aclk", "spi_clk"; | ||
#address-cells = <0x1>; | ||
#size-cells = <0x0>; | ||
|
||
ad57xx_1: dac@0 { | ||
compatible = "adi,ad5791"; | ||
spi-cpha; | ||
reg = <0>; | ||
spi-max-frequency = <35000000>; | ||
vss-supply = <&dac_vss>; | ||
vdd-supply = <&dac_vdd>; | ||
reset-gpios = <&gpio_bd 16 GPIO_ACTIVE_LOW>; | ||
clear-gpios = <&gpio_bd 17 GPIO_ACTIVE_LOW>; | ||
ldac-gpios = <&gpio_bd 18 GPIO_ACTIVE_LOW>; | ||
|
||
clocks = <&spi_clk 0>; | ||
clock-names = "ref_clk"; | ||
|
||
dmas = <&tx_dma 0>; | ||
dma-names = "tx"; | ||
pwms = <&adc_trigger 0 0>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How unusual to have the default period 0. I'd rather expect to see a period that matches the max freq for that chip here (or something bigger). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok. just for the record, i could not clearly make out a max frequency clearly mentioned on the datasheet. |
||
pwm-names = "cnv"; | ||
|
||
}; | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jonathan also likes to have all of the power supplies in the bindings, so we can add
vcc-suppy
,vrefp-supply
,vrefn-supply
andiovcc-supply
when we submit this upstream.