diff --git a/patches/buildroot.diff b/patches/buildroot.diff index dc27b62..99c6fae 100644 --- a/patches/buildroot.diff +++ b/patches/buildroot.diff @@ -39,7 +39,7 @@ index a3b3f6f664..55601033c6 100644 -https://wiki.analog.com/university/tools/pluto +https://github.com/plutoplus/plutoplus diff --git a/configs/zynq_pluto_defconfig b/configs/zynq_pluto_defconfig -index 6203766e04..884adfcd30 100644 +index 6203766e04..f3b791ba18 100644 --- a/configs/zynq_pluto_defconfig +++ b/configs/zynq_pluto_defconfig @@ -29,6 +29,7 @@ BR2_PACKAGE_MTD=y @@ -50,7 +50,7 @@ index 6203766e04..884adfcd30 100644 BR2_PACKAGE_LINUX_FIRMWARE=y BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT61=y BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT73=y -@@ -36,24 +37,39 @@ BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX=y +@@ -36,24 +37,40 @@ BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX=y BR2_PACKAGE_LINUX_FIRMWARE_RTL_81XX=y BR2_PACKAGE_LINUX_FIRMWARE_RTL_87XX=y BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y @@ -89,10 +89,11 @@ index 6203766e04..884adfcd30 100644 BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y +BR2_PACKAGE_OPKG=n +BR2_PACKAGE_NANO=n ++BR2_PACKAGE_MG=y BR2_PACKAGE_POLL_SYSFS=y BR2_PACKAGE_AD936X_REF_CAL=y BR2_TARGET_ROOTFS_CPIO=y -@@ -62,3 +78,15 @@ BR2_TARGET_ROOTFS_CPIO_UIMAGE=y +@@ -62,3 +79,15 @@ BR2_TARGET_ROOTFS_CPIO_UIMAGE=y BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y @@ -108,26 +109,27 @@ index 6203766e04..884adfcd30 100644 +BR2_PACKAGE_FFMPEG_DEMUXERS="aac h264 mpegts mpegvideo pcm_s16le rawvideo rtp hevc flv dvbsub" +BR2_PACKAGE_FFMPEG_PARSERS="aac h264 mjpeg mpegaudio mpegvideo hevc" +#BR2_PACKAGE_STRACE=y -diff --git a/package/ad936x_ref_cal/ad936x_ref_cal.hash b/package/ad936x_ref_cal/ad936x_ref_cal.hash -index 24eb7fb88b..ca5798774c 100644 ---- a/package/ad936x_ref_cal/ad936x_ref_cal.hash -+++ b/package/ad936x_ref_cal/ad936x_ref_cal.hash -@@ -1,5 +1,5 @@ - # Locally computed --sha256 26aedd8021fa939ab2f53e55904d869207265242fef7ad86aa4673e219b7cbef ad936x_ref_cal-01747db5cd60ff64115a73ac1f3bb97911f5c58e-br1.tar.gz -+sha256 4814915de63d975807e918df82bb86021d0e78839e8cc4116a36476d0b33180c ad936x_ref_cal-01747db5cd60ff64115a73ac1f3bb97911f5c58e-br1.tar.gz - - # License files (locally computed as well) - sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE -diff --git a/package/libiio/libiio.hash b/package/libiio/libiio.hash -index f1c58efb5e..cb6378f77b 100644 ---- a/package/libiio/libiio.hash -+++ b/package/libiio/libiio.hash -@@ -1,6 +1,5 @@ +diff --git a/package/libffi/libffi.hash b/package/libffi/libffi.hash +index 8d2349ec21..75be5bbcef 100644 +--- a/package/libffi/libffi.hash ++++ b/package/libffi/libffi.hash +@@ -1,4 +1,4 @@ # Locally calculated - sha256 a2b5d848531ea64fd9f95327dfd5a588bd227d9577281ec375e822702c6a52d5 libiio-0.24.tar.gz - sha256 21972599a3c143ab1f98002ad2b3f28f4aff927fde5f677478311cd4e517730c libiio-0.25.tar.gz --sha256 e791ad1cf35aef08fc6e2b6b0dcdd1cc21d36cf287d81fa14adb088c6c1d4c49 libiio-38483f31be391af66b35542f733e569febe13d3a-br1.tar.gz -+sha256 865fe496624bebc7c4266bf157fb4b5ec851b5f929d2571ec73846e4f317cf46 libiio-38483f31be391af66b35542f733e569febe13d3a-br1.tar.gz - sha256 102900208eef27b766380135906d431dba87edaa7ec6aa72e6ebd3dd67f3a97b COPYING.txt -- +-sha256 d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676 libffi-3.4.4.tar.gz ++sha256 bc9842a18898bfacb0ed1252c4febcc7e78fa139fd27fdc7a3e30d9d9356119b libffi-3.4.8.tar.gz + # License files, locally calculated +-sha256 2c9c2acb9743e6b007b91350475308aee44691d96aa20eacef8e199988c8c388 LICENSE ++sha256 67894089811f93fca47a76f85e017da6f8582d4ba0905963c6e0f1ad6df7a195 LICENSE +diff --git a/package/libffi/libffi.mk b/package/libffi/libffi.mk +index 8f6844113c..813aaf2538 100644 +--- a/package/libffi/libffi.mk ++++ b/package/libffi/libffi.mk +@@ -4,7 +4,7 @@ + # + ################################################################################ + +-LIBFFI_VERSION = 3.4.4 ++LIBFFI_VERSION = 3.4.8 + LIBFFI_SITE = \ + https://github.com/libffi/libffi/releases/download/v$(LIBFFI_VERSION) + LIBFFI_LICENSE = MIT diff --git a/patches/hdl.diff b/patches/hdl.diff index a991602..8f79cfc 100644 --- a/patches/hdl.diff +++ b/patches/hdl.diff @@ -1,12 +1,26 @@ diff --git a/projects/pluto/system_bd.tcl b/projects/pluto/system_bd.tcl -index 4787085d0..027c2cb51 100644 +index 0133b3f04..96d9a6005 100644 --- a/projects/pluto/system_bd.tcl +++ b/projects/pluto/system_bd.tcl -@@ -50,6 +50,13 @@ ad_ip_parameter sys_ps7 CONFIG.PCW_FPGA0_PERIPHERAL_FREQMHZ 100.0 +@@ -22,9 +22,9 @@ create_bd_port -dir I spi0_sdo_i + create_bd_port -dir O spi0_sdo_o + create_bd_port -dir I spi0_sdi_i + +-create_bd_port -dir I -from 17 -to 0 gpio_i +-create_bd_port -dir O -from 17 -to 0 gpio_o +-create_bd_port -dir O -from 17 -to 0 gpio_t ++create_bd_port -dir I -from 16 -to 0 gpio_i ++create_bd_port -dir O -from 16 -to 0 gpio_o ++create_bd_port -dir O -from 16 -to 0 gpio_t + + create_bd_port -dir O spi_csn_o + create_bd_port -dir I spi_csn_i +@@ -53,7 +53,13 @@ ad_ip_parameter sys_ps7 CONFIG.PCW_EN_RST1_PORT 1 + ad_ip_parameter sys_ps7 CONFIG.PCW_FPGA0_PERIPHERAL_FREQMHZ 100.0 ad_ip_parameter sys_ps7 CONFIG.PCW_FPGA1_PERIPHERAL_FREQMHZ 200.0 ad_ip_parameter sys_ps7 CONFIG.PCW_GPIO_EMIO_GPIO_ENABLE 1 - ad_ip_parameter sys_ps7 CONFIG.PCW_GPIO_EMIO_GPIO_IO 18 -+ +-ad_ip_parameter sys_ps7 CONFIG.PCW_GPIO_EMIO_GPIO_IO 18 ++ad_ip_parameter sys_ps7 CONFIG.PCW_GPIO_EMIO_GPIO_IO 17 +ad_ip_parameter sys_ps7 CONFIG.PCW_EN_ENET0 1 +ad_ip_parameter sys_ps7 CONFIG.PCW_ENET0_PERIPHERAL_ENABLE 1 +ad_ip_parameter sys_ps7 CONFIG.PCW_ENET0_ENET0_IO {MIO 16 .. 27} @@ -16,15 +30,15 @@ index 4787085d0..027c2cb51 100644 ad_ip_parameter sys_ps7 CONFIG.PCW_SPI1_PERIPHERAL_ENABLE 0 ad_ip_parameter sys_ps7 CONFIG.PCW_I2C0_PERIPHERAL_ENABLE 0 ad_ip_parameter sys_ps7 CONFIG.PCW_UART1_PERIPHERAL_ENABLE 1 -@@ -57,16 +64,28 @@ ad_ip_parameter sys_ps7 CONFIG.PCW_UART1_UART1_IO {MIO 12 .. 13} +@@ -61,16 +67,28 @@ ad_ip_parameter sys_ps7 CONFIG.PCW_UART1_UART1_IO {MIO 12 .. 13} ad_ip_parameter sys_ps7 CONFIG.PCW_I2C1_PERIPHERAL_ENABLE 0 ad_ip_parameter sys_ps7 CONFIG.PCW_QSPI_PERIPHERAL_ENABLE 1 ad_ip_parameter sys_ps7 CONFIG.PCW_QSPI_GRP_SINGLE_SS_ENABLE 1 -ad_ip_parameter sys_ps7 CONFIG.PCW_SD0_PERIPHERAL_ENABLE 0 ++ad_ip_parameter sys_ps7 CONFIG.PCW_SD0_PERIPHERAL_ENABLE 1 ad_ip_parameter sys_ps7 CONFIG.PCW_SPI0_PERIPHERAL_ENABLE 1 ad_ip_parameter sys_ps7 CONFIG.PCW_SPI0_SPI0_IO EMIO + -+ad_ip_parameter sys_ps7 CONFIG.PCW_SD0_PERIPHERAL_ENABLE 1 +ad_ip_parameter sys_ps7 CONFIG.PCW_SD0_SD0_IO "MIO 40 .. 45" +ad_ip_parameter sys_ps7 CONFIG.PCW_SD0_GRP_CD_ENABLE 1 +ad_ip_parameter sys_ps7 CONFIG.PCW_SD0_GRP_CD_IO "MIO 47" @@ -47,16 +61,16 @@ index 4787085d0..027c2cb51 100644 ad_ip_parameter sys_ps7 CONFIG.PCW_IRQ_F2P_INTR 1 ad_ip_parameter sys_ps7 CONFIG.PCW_IRQ_F2P_MODE REVERSE ad_ip_parameter sys_ps7 CONFIG.PCW_MIO_0_PULLUP {enabled} -@@ -382,4 +401,3 @@ ad_connect sys_cpu_resetn axi_ad9361_dac_dma/m_src_axi_aresetn +@@ -380,4 +398,3 @@ ad_connect sys_cpu_resetn axi_ad9361_dac_dma/m_src_axi_aresetn ad_cpu_interrupt ps-13 mb-13 axi_ad9361_adc_dma/irq ad_cpu_interrupt ps-12 mb-12 axi_ad9361_dac_dma/irq ad_cpu_interrupt ps-11 mb-11 axi_spi/ip2intc_irpt - diff --git a/projects/pluto/system_constr.xdc b/projects/pluto/system_constr.xdc -index 3877ade6f..bf0ae5d12 100644 +index 59611ccc8..4ce9c8378 100644 --- a/projects/pluto/system_constr.xdc +++ b/projects/pluto/system_constr.xdc -@@ -1,78 +1,69 @@ +@@ -6,78 +6,69 @@ # constraints # ad9361 (SWAP == 0x1) @@ -198,7 +212,7 @@ index 3877ade6f..bf0ae5d12 100644 create_clock -name rx_clk -period 16.27 [get_ports rx_clk_in] -@@ -89,123 +80,123 @@ set_input_jitter clk_fpga_1 0.15 +@@ -94,123 +85,123 @@ set_input_jitter clk_fpga_1 0.15 set_property IOSTANDARD LVCMOS18 [get_ports *fixed_io_mio*] set_property SLEW SLOW [get_ports *fixed_io_mio*] set_property DRIVE 8 [get_ports *fixed_io_mio*] @@ -400,16 +414,16 @@ index 3877ade6f..bf0ae5d12 100644 set_property IOSTANDARD DIFF_SSTL15_T_DCI [get_ports *ddr_dqs*] set_property SLEW FAST [get_ports *ddr_dqs*] set_property PACKAGE_PIN C2 [get_ports ddr_dqs_p[0]] -@@ -215,4 +206,3 @@ set_property PACKAGE_PIN F2 [get_ports ddr_dqs_n[1]] +@@ -220,4 +211,3 @@ set_property PACKAGE_PIN F2 [get_ports ddr_dqs_n[1]] set_false_path -from [get_pins {i_system_wrapper/system_i/axi_ad9361/inst/i_rx/i_up_adc_common/up_adc_gpio_out_int_reg[0]/C}] set_false_path -from [get_pins {i_system_wrapper/system_i/axi_ad9361/inst/i_tx/i_up_dac_common/up_dac_gpio_out_int_reg[0]/C}] - diff --git a/projects/pluto/system_project.tcl b/projects/pluto/system_project.tcl -index cdfaccf93..fb5a8f0b2 100644 +index 3c5d49aa2..877a64074 100644 --- a/projects/pluto/system_project.tcl +++ b/projects/pluto/system_project.tcl -@@ -2,7 +2,7 @@ source ../../scripts/adi_env.tcl +@@ -7,7 +7,7 @@ source ../../scripts/adi_env.tcl source $ad_hdl_dir/projects/scripts/adi_project_xilinx.tcl source $ad_hdl_dir/projects/scripts/adi_board.tcl @@ -418,8 +432,95 @@ index cdfaccf93..fb5a8f0b2 100644 adi_project_files pluto [list \ "system_top.v" \ -@@ -12,4 +12,3 @@ adi_project_files pluto [list \ +@@ -17,4 +17,3 @@ adi_project_files pluto [list \ set_property is_enabled false [get_files *system_sys_ps7_0.xdc] adi_project_run pluto source $ad_hdl_dir/library/axi_ad9361/axi_ad9361_delay.tcl - +diff --git a/projects/pluto/system_top.v b/projects/pluto/system_top.v +index acb97bb70..08317af42 100644 +--- a/projects/pluto/system_top.v ++++ b/projects/pluto/system_top.v +@@ -60,6 +60,9 @@ module system_top ( + inout fixed_io_ps_porb, + inout fixed_io_ps_srstb, + ++ inout iic_scl, ++ inout iic_sda, ++ + input rx_clk_in, + input rx_frame_in, + input [11:0] rx_data_in, +@@ -81,28 +84,16 @@ module system_top ( + output spi_mosi, + input spi_miso, + +- output pl_gpio0, +- input pl_gpio1, +- inout pl_gpio2, +- inout pl_gpio3, +- inout pl_gpio4 ++ output pl_spi_clk_o, ++ output pl_spi_mosi, ++ input pl_spi_miso + ); + + // internal signals + +- wire [17:0] gpio_i; +- wire [17:0] gpio_o; +- wire [17:0] gpio_t; +- +- wire iic_scl; +- wire iic_sda; +- wire phaser_enable; +- wire pl_burst; +- wire pl_muxout; +- wire pl_spi_clk_o; +- wire pl_spi_miso; +- wire pl_spi_mosi; +- wire pl_txdata; ++ wire [16:0] gpio_i; ++ wire [16:0] gpio_o; ++ wire [16:0] gpio_t; + + // instantiations + +@@ -118,27 +109,6 @@ module system_top ( + gpio_status})); // 7: 0 + + assign gpio_i[16:14] = gpio_o[16:14]; +- assign gpio_i[17] = pl_muxout; +- assign phaser_enable = gpio_o[14]; +- +- assign pl_gpio4 = iic_scl; //PL_GPIO4 +- assign pl_gpio3 = iic_sda; //PL_GPIO3 +- +- //PL_GPIO2 +- ad_iobuf #( +- .DATA_WIDTH(1) +- ) i_pl_gpio_iobuf ( +- .dio_t (phaser_enable), +- .dio_i (pl_spi_clk_o), +- .dio_o (pl_muxout), +- .dio_p (pl_gpio2)); +- +- //PL_GPIO1 +- assign pl_spi_miso = pl_gpio1 & ~phaser_enable; +- assign pl_burst = pl_gpio1 & phaser_enable; +- +- //PL_GPIO0 +- assign pl_gpio0 = phaser_enable ? pl_txdata : pl_spi_mosi; + + system_wrapper i_system_wrapper ( + .ddr_addr (ddr_addr), +@@ -190,9 +160,6 @@ module system_top ( + .spi_sdo_i(1'b0), + .spi_sdo_o(pl_spi_mosi), + +- .tdd_ext_sync(pl_burst), +- .txdata_o(pl_txdata), +- + .tx_clk_out (tx_clk_out), + .tx_data_out (tx_data_out), + .tx_frame_out (tx_frame_out), diff --git a/patches/linux.diff b/patches/linux.diff index f70cdc6..e2a9d12 100644 --- a/patches/linux.diff +++ b/patches/linux.diff @@ -320,10 +320,10 @@ index 08c5a42204f3..0fe5bba8a082 100644 status = "okay"; diff --git a/arch/arm/boot/dts/zynq-zc702.dts b/arch/arm/boot/dts/zynq-zc702.dts -index aa084a9938d9..b91785c93349 100644 +index 27fb48bd8eed..c41ff0e7b4b9 100644 --- a/arch/arm/boot/dts/zynq-zc702.dts +++ b/arch/arm/boot/dts/zynq-zc702.dts -@@ -57,6 +57,14 @@ led-ds23 { +@@ -60,6 +60,14 @@ led-ds23 { linux,default-trigger = "heartbeat"; }; }; @@ -338,7 +338,7 @@ index aa084a9938d9..b91785c93349 100644 }; &can0 { -@@ -441,6 +449,7 @@ &uart1 { +@@ -444,6 +452,7 @@ &uart1 { &usb0 { status = "okay"; dr_mode = "host"; @@ -347,10 +347,10 @@ index aa084a9938d9..b91785c93349 100644 pinctrl-0 = <&pinctrl_usb0_default>; }; diff --git a/arch/arm/boot/dts/zynq-zc706.dts b/arch/arm/boot/dts/zynq-zc706.dts -index 6a6e8312b3f7..cb6e9117f3a3 100644 +index 835813c424e5..eaa478b3d4f0 100644 --- a/arch/arm/boot/dts/zynq-zc706.dts +++ b/arch/arm/boot/dts/zynq-zc706.dts -@@ -27,6 +27,14 @@ chosen { +@@ -29,6 +29,14 @@ chosen { bootargs = ""; stdout-path = "serial0:115200n8"; }; @@ -365,7 +365,7 @@ index 6a6e8312b3f7..cb6e9117f3a3 100644 }; &clkc { -@@ -352,6 +360,7 @@ &uart1 { +@@ -355,6 +363,7 @@ &uart1 { &usb0 { status = "okay"; dr_mode = "host"; @@ -399,10 +399,10 @@ index 60f73cd2601b..2d531a6ea2ca 100644 + usb-phy = <&usb_phy0>; }; diff --git a/arch/arm/configs/zynq_pluto_defconfig b/arch/arm/configs/zynq_pluto_defconfig -index 506eec34f4b4..818b84bddc05 100644 +index 47b7b92fbeda..05131e8f4463 100644 --- a/arch/arm/configs/zynq_pluto_defconfig +++ b/arch/arm/configs/zynq_pluto_defconfig -@@ -269,3 +269,15 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60 +@@ -266,3 +266,15 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60 CONFIG_DEBUG_LL=y CONFIG_DEBUG_ZYNQ_UART1=y CONFIG_EARLY_PRINTK=y diff --git a/plutosdr-fw b/plutosdr-fw index 0359a0b..9e90bce 160000 --- a/plutosdr-fw +++ b/plutosdr-fw @@ -1 +1 @@ -Subproject commit 0359a0b9a474567ab658619f3edf53ac65594f5a +Subproject commit 9e90bce43f849882cd43c20a08effca132790fb3 diff --git a/scripts/apply.sh b/scripts/apply.sh index 092c777..9061d21 100755 --- a/scripts/apply.sh +++ b/scripts/apply.sh @@ -1,11 +1,13 @@ +set -xe + cd plutosdr-fw git apply ../patches/fw.diff -cd hdl -git apply ../../patches/hdl.diff -cd ../linux -git apply ../../patches/linux.diff -cd ../u-boot-xlnx +cd u-boot-xlnx git apply ../../patches/u-boot-xlnx.diff cd ../buildroot git apply ../../patches/buildroot.diff +cd ../linux +git apply ../../patches/linux.diff +cd ../hdl +git apply ../../patches/hdl.diff cd ../.. diff --git a/scripts/collect.sh b/scripts/collect.sh index 83fc092..09c2546 100755 --- a/scripts/collect.sh +++ b/scripts/collect.sh @@ -1,3 +1,5 @@ +set -xe + cd plutosdr-fw git diff --ignore-submodules > ../patches/fw.diff cd hdl diff --git a/scripts/revert.sh b/scripts/revert.sh index 3bc4241..29089ed 100755 --- a/scripts/revert.sh +++ b/scripts/revert.sh @@ -1,3 +1,5 @@ +set -xe + cd plutosdr-fw git checkout . cd hdl