├── boot ├── boot.bif.in └── CMakeLists.txt ├── .gitignore ├── uenv └── uEnv.txt.in ├── patches ├── scripts │ └── apply_patches.sh ├── kernel │ ├── 0002-dts-Add-target-zynq-adrv9364z7020-for-AXI-DMAC-test.patch │ ├── 0003-gcc-10-will-default-to-fno-common-which-causes-this-.patch │ └── 0001-arch-arm-configs-Add-default-configuration-for-adrv9.patch ├── hdl │ └── 0001-projects-adrv9364z7020-ccbob_lvds-Add-AXI-DMAC-loop-.patch └── ssbl │ ├── 0001-configs-zynq_adrv9361_m6_defconfig-Add-configuration.patch │ └── 0002-gcc-10-will-default-to-fno-common-which-causes-this-.patch ├── kmod ├── Makefile └── iio_axi_dmac.c ├── test ├── CMakeLists.txt └── iio_axi_dmac_test.c ├── cmake ├── scripts │ ├── fsbl.cmake │ ├── dmac_kmod.cmake │ ├── hdl.cmake │ ├── ssbl.cmake │ ├── toolchain.cmake │ └── kernel.cmake └── modules │ ├── FindHSI.cmake │ ├── FindBootgen.cmake │ └── FindVivado.cmake ├── doc ├── target.dtsi ├── README ├── target.tcl └── LICENSE ├── scripts └── hsi_gen_fsbl.tcl ├── dts └── zynq_adrv9364_system.dts ├── CMakeLists.txt └── README.md /boot/boot.bif.in: -------------------------------------------------------------------------------- 1 | the_ROM_image: 2 | { 3 | [bootloader]@FSBL_ELF@ 4 | @SSBL_ELF@ 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | external 2 | *build* 3 | *.ko.cmd 4 | *.o.cmd 5 | *.tmp_versions 6 | *.symvers 7 | *.ko 8 | *.mod.c 9 | *.mod.o 10 | *.order 11 | *.o 12 | *.a 13 | *.kdev4 14 | -------------------------------------------------------------------------------- /uenv/uEnv.txt.in: -------------------------------------------------------------------------------- 1 | ethaddr=@SSBL_ETHADDR@ 2 | uenvcmd=run sdboot 3 | sdboot=setenv bitstream_image system.bit; setenv devicetree_image system.dtb; setenv kernel_image uImage; echo Loading bitstream from SD/MMC/eMMC to RAM.. && mmcinfo && load mmc 0 ${loadbit_addr} ${bitstream_image} && fpga loadb 0 ${loadbit_addr} ${filesize} && echo Copying Linux from SD to RAM... && fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && bootm 0x3000000 - 0x2A00000 4 | bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait 5 | -------------------------------------------------------------------------------- /boot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Bootgen "2018.2" REQUIRED) 2 | 3 | if(NOT ${Bootgen_FOUND}) 4 | message(STATUS "Unable to find Bootgen executable. Not preparing boot binary.") 5 | return() 6 | endif() 7 | 8 | # Generate boot binary. 9 | set(BOOTGEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/boot_gen) 10 | configure_file(boot.bif.in ${BOOTGEN_DIR}/boot.bif) 11 | 12 | add_custom_target(boot.bin ALL 13 | DEPENDS ${FSBL_DIR}/executable.elf ${SSBL_DIR}/u-boot ${BOOTGEN_DIR}/boot.bif 14 | COMMAND ${BOOTGEN_EXECUTABLE} -w -image boot.bif -o i ${CMAKE_CURRENT_BINARY_DIR}/image/boot/boot.bin 15 | COMMENT "Generating boot binary..." 16 | WORKING_DIRECTORY ${BOOTGEN_DIR} 17 | USES_TERMINAL 18 | ) 19 | -------------------------------------------------------------------------------- /patches/scripts/apply_patches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$1" ]; then 4 | echo ">>> Error: No patch directory argument supplied!" 5 | exit 1 6 | fi 7 | 8 | for PATCH in $1/*.patch; do 9 | if [ ! -f $PATCH ]; then 10 | echo ">>> NOTE: There are no patches to apply." 11 | exit 0 12 | fi 13 | 14 | echo Applying $PATCH 15 | 16 | if git am --no-gpg-sign $PATCH; then 17 | echo ">>> Success: Applied the following patch: \`$PATCH\`." 18 | elif git apply $PATCH -R --check; then 19 | echo ">>> Success: Already applied the following patch: \`$PATCH\`." 20 | else 21 | echo ">>> ERROR: Failed to apply the following patch: \`$PATCH\`!" 22 | exit 1 23 | fi 24 | done 25 | -------------------------------------------------------------------------------- /kmod/Makefile: -------------------------------------------------------------------------------- 1 | # Get these variables from the environment if set 2 | ARCH ?= arm 3 | CROSS_COMPILE ?= armv7a-unknown-linux-gnueabihf- 4 | INSTALL_MOD_PATH ?= 5 | INSTALL_MOD_DIR ?= extra/drivers/iio/misc 6 | KBUILD ?= /lib/modules/$(shell uname -r)/build/ 7 | 8 | obj-m := iio_axi_dmac.o 9 | 10 | default: 11 | $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KBUILD) \ 12 | M=$(PWD) modules 13 | 14 | clean: 15 | $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KBUILD) \ 16 | M=$(PWD) clean 17 | 18 | modules_install: 19 | $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) \ 20 | INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \ 21 | INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) -C $(KBUILD) \ 22 | M=$$PWD modules_install 23 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SUBPROJECT_NAME adi_dmac_iio_test) 2 | set(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake) 3 | 4 | if(CMAKE_SYSROOT) 5 | set(ENV{PKG_CONFIG_DIR} "") 6 | set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig") 7 | set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) 8 | endif() 9 | 10 | find_package(PkgConfig REQUIRED) 11 | pkg_search_module(libiio REQUIRED IMPORTED_TARGET libiio>=0.18) 12 | 13 | set(SUBPROJECT_SOURCES iio_axi_dmac_test.c) 14 | 15 | add_executable(${SUBPROJECT_NAME} ${SUBPROJECT_SOURCES}) 16 | 17 | target_link_libraries(${SUBPROJECT_NAME} PkgConfig::libiio) 18 | 19 | # Install. 20 | install(TARGETS ${SUBPROJECT_NAME} RUNTIME DESTINATION root/bin) 21 | -------------------------------------------------------------------------------- /cmake/scripts/fsbl.cmake: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | 3 | set_property (DIRECTORY PROPERTY EP_BASE Dependencies) 4 | 5 | ## Use HSI and system definition to generate fsbl project files. 6 | set(EXT_PROJECT fsbl) 7 | set(HSI_GEN_FSBL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/hsi_gen_fsbl.tcl) 8 | set(FSBL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${EXT_PROJECT}/src/${EXT_PROJECT}) 9 | 10 | ExternalProject_Add(${EXT_PROJECT} 11 | DEPENDS hdl 12 | PREFIX ${EXT_PROJECT} 13 | USES_TERMINAL_DOWNLOAD 1 14 | USES_TERMINAL_UPDATE 1 15 | USES_TERMINAL_CONFIGURE 1 16 | USES_TERMINAL_BUILD 1 17 | USES_TERMINAL_INSTALL 1 18 | USES_TERMINAL_TEST 1 19 | DOWNLOAD_COMMAND "" 20 | BUILD_IN_SOURCE 1 21 | CONFIGURE_COMMAND "" 22 | BUILD_COMMAND SYSDEF_FILE=${WITH_SYSDEF_FILE} BASE_DIR=${FSBL_DIR} PROJECT_NAME=${EXT_PROJECT} 23 | REQUIRED_HSI_VERSION=${HSI_VER} hsi -nojournal -nolog -mode tcl -source ${HSI_GEN_FSBL_SCRIPT} 24 | BUILD_BYPRODUCTS ${FSBL_DIR}/executable.elf 25 | INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/boot_gen && 26 | ${CMAKE_COMMAND} -E copy_if_different ${FSBL_DIR}/executable.elf 27 | ${CMAKE_CURRENT_BINARY_DIR}/boot_gen/fsbl.elf 28 | ) 29 | 30 | list (APPEND DEPENDENCIES ${EXT_PROJECT}) 31 | -------------------------------------------------------------------------------- /doc/target.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "skeleton.dtsi" 2 | 3 | /{ 4 | axi_dmac_rx: axi-dmac-rx@0 { 5 | compatible = "adi,iio-rx-dma-1.00.c"; 6 | dmas = <&axi_iio_rx_dma 0>; 7 | dma-names = "rx"; 8 | }; 9 | 10 | axi_dmac_tx: axi-dmac-tx@0 { 11 | compatible = "adi,iio-tx-dma-1.00.c"; 12 | dmas = <&axi_iio_tx_dma 0>; 13 | dma-names = "tx"; 14 | }; 15 | }; 16 | 17 | 18 | &axi_iio_rx_dma { 19 | compatible = "adi,axi-dmac-1.00.a"; 20 | clocks = <&clkc 16>; 21 | #dma-cells = <1>; 22 | 23 | adi,channels { 24 | #size-cells = <0>; 25 | #address-cells = <1>; 26 | 27 | dma-channel@0 { 28 | reg = <0>; 29 | adi,length-width = <24>; 30 | adi,source-bus-width = <64>; 31 | adi,source-bus-type = <1>; 32 | adi,destination-bus-width = <64>; 33 | adi,destination-bus-type = <0>; 34 | }; 35 | }; 36 | }; 37 | 38 | &axi_iio_tx_dma { 39 | compatible = "adi,axi-dmac-1.00.a"; 40 | clocks = <&clkc 16>; 41 | #dma-cells = <1>; 42 | 43 | adi,channels { 44 | #size-cells = <0>; 45 | #address-cells = <1>; 46 | 47 | dma-channel@0 { 48 | reg = <0>; 49 | adi,length-width = <24>; 50 | adi,source-bus-width = <64>; 51 | adi,source-bus-type = <0>; 52 | adi,destination-bus-width = <64>; 53 | adi,destination-bus-type = <1>; 54 | }; 55 | }; 56 | }; 57 | -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | This ADI AXI DMAC IIO client driver and test were created to ease transfer of 2 | data between the PS and PL on Zynq and other such devices. 3 | 4 | 1) Required (Instructions on how build or deploy requirements not included): 5 | i) Linux kernel from https://github.com/analogdevicesinc/linux 6 | Ensure that dma_axi_dmac driver/module is built. 7 | 8 | ii) ADI AXI DMAC PL IP with dependancies from 9 | https://github.com/analogdevicesinc/hdl/tree/master/library/axi_dmac 10 | 11 | iii) ADI libiio from https://github.com/analogdevicesinc/libiio 12 | 13 | 2) Build: 14 | Edit make file and set the following: 15 | CROSS_CC to cross compiler or target compiler 16 | TARGET_ARCH to target 17 | TARGET_ROOT to target root for cross comiling or empty 18 | KERNELDIR to target kernel directory 19 | 20 | 3) PL & Devicetree Notes: 21 | See target.tcl for hints on how to design the PL portion. 22 | See target.dtsi on how to tell the kernel about the devices. 23 | 24 | 4) Test: 25 | Insert module and run test 26 | 27 | 5) Test Notes: 28 | When using iio_axi_dmac_test in a loopback configuration, remember to 29 | start both receiver and transmitter or They will block at 30 | iio_buffer_refill(..) and iio_buffer_push(...) respectively. 31 | 32 | Remember that DMA transfers blocks at a time. 33 | -------------------------------------------------------------------------------- /scripts/hsi_gen_fsbl.tcl: -------------------------------------------------------------------------------- 1 | set this_file [ dict get [ info frame [ info frame ] ] file ] 2 | set this_path [file dirname $this_file] 3 | 4 | set sysdef_file $::env(SYSDEF_FILE) 5 | set base_dir $::env(BASE_DIR) 6 | set project_name $::env(PROJECT_NAME) 7 | set REQUIRED_HSI_VERSION $::env(REQUIRED_HSI_VERSION) 8 | 9 | if {![info exists REQUIRED_HSI_VERSION]} { 10 | set REQUIRED_HSI_VERSION "2018.2" 11 | } 12 | 13 | if {[info exists ::env(IGNORE_VERSION_CHECK)]} { 14 | set IGNORE_VERSION_CHECK 1 15 | } elseif {![info exists IGNORE_VERSION_CHECK]} { 16 | set IGNORE_VERSION_CHECK 0 17 | } 18 | 19 | proc hsi_project_create {project_name} { 20 | global REQUIRED_HSI_VERSION 21 | global IGNORE_VERSION_CHECK 22 | global base_dir 23 | global sysdef_file 24 | 25 | if {!$IGNORE_VERSION_CHECK && [string compare [version -short] $REQUIRED_HSI_VERSION] != 0} { 26 | return -code error [format "ERROR: This project requires HSI %s." $REQUIRED_HSI_VERSION] 27 | } 28 | 29 | set hw_design_file [file tail $sysdef_file ] 30 | file mkdir hw_design 31 | set hw_design_file "hw_design/$hw_design_file" 32 | file copy -force $sysdef_file $hw_design_file 33 | 34 | hsi::open_hw_design $hw_design_file 35 | hsi::generate_app -dir $base_dir -hw [hsi::current_hw_design] -sw fsbl -proc ps7_cortexa9_0 -app zynq_fsbl -compile 36 | hsi::close_hw_design [hsi::current_hw_design] 37 | } 38 | 39 | hsi_project_create $project_name 40 | exit 41 | -------------------------------------------------------------------------------- /patches/kernel/0002-dts-Add-target-zynq-adrv9364z7020-for-AXI-DMAC-test.patch: -------------------------------------------------------------------------------- 1 | From cbe2927339ee8b0fa33a0e834ac4133205b1a837 Mon Sep 17 00:00:00 2001 2 | From: Edward Kigwana 3 | Date: Wed, 8 Jul 2020 21:07:59 +0000 4 | Subject: [PATCH 1/1] dts: Add target zynq-adrv9364z7020 for AXI DMAC test 5 | 6 | Signed-off-by: Edward Kigwana 7 | --- 8 | arch/arm/boot/dts/Makefile | 1 + 9 | arch/arm/boot/dts/zynq-adrv9364z7020.dts | 3 +++ 10 | 2 files changed, 4 insertions(+) 11 | create mode 100644 arch/arm/boot/dts/zynq-adrv9364z7020.dts 12 | 13 | diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile 14 | index b5bd3de87c..585e78215b 100644 15 | --- a/arch/arm/boot/dts/Makefile 16 | +++ b/arch/arm/boot/dts/Makefile 17 | @@ -1121,6 +1121,7 @@ dtb-$(CONFIG_ARCH_VT8500) += \ 18 | wm8750-apc8750.dtb \ 19 | wm8850-w70v2.dtb 20 | dtb-$(CONFIG_ARCH_ZYNQ) += \ 21 | + zynq-adrv9364z7020.dtb \ 22 | zynq-cc108.dtb \ 23 | zynq-microzed.dtb \ 24 | zynq-parallella.dtb \ 25 | diff --git a/arch/arm/boot/dts/zynq-adrv9364z7020.dts b/arch/arm/boot/dts/zynq-adrv9364z7020.dts 26 | new file mode 100644 27 | index 0000000000..84495ad0a1 28 | --- /dev/null 29 | +++ b/arch/arm/boot/dts/zynq-adrv9364z7020.dts 30 | @@ -0,0 +1,3 @@ 31 | +/dts-v1/; 32 | +#include "zynq-adrv9364-z7020.dtsi" 33 | +#include "../../../../../../../dts/zynq_adrv9364_system.dts" 34 | -- 35 | 2.27.0 36 | 37 | -------------------------------------------------------------------------------- /dts/zynq_adrv9364_system.dts: -------------------------------------------------------------------------------- 1 | / { 2 | axi_iio_dma_in: axi-iio-dma-in@10 { 3 | compatible = "adi,iio-rx-dma-1.00.c"; 4 | dmas = <&axi_iio_dmac_in 0>; 5 | dma-names = "rx"; 6 | }; 7 | 8 | axi_iio_dma_out: axi-iio-dma-out@11 { 9 | compatible = "adi,iio-tx-dma-1.00.c"; 10 | dmas = <&axi_iio_dmac_out 0>; 11 | dma-names = "tx"; 12 | }; 13 | }; 14 | 15 | &fpga_axi { 16 | axi_iio_dmac_in: axi_iio_dmac_in@7c460000 { 17 | compatible = "adi,axi-dmac-1.00.a"; 18 | reg = <0x7c460000 0x10000>; 19 | interrupts = <0 31 4>; 20 | clocks = <&clkc 16>; 21 | #dma-cells = <1>; 22 | 23 | adi,channels { 24 | #size-cells = <0>; 25 | #address-cells = <1>; 26 | 27 | dma-channel@0 { 28 | reg = <0>; 29 | adi,source-bus-width = <64>; 30 | adi,source-bus-type = <1>; 31 | adi,destination-bus-width = <64>; 32 | adi,destination-bus-type = <0>; 33 | }; 34 | }; 35 | }; 36 | 37 | axi_iio_dmac_out: axi_iio_dmac_out@7c480000 { 38 | compatible = "adi,axi-dmac-1.00.a"; 39 | reg = <0x7c480000 0x10000>; 40 | interrupts = <0 32 4>; 41 | clocks = <&clkc 16>; 42 | #dma-cells = <1>; 43 | 44 | adi,channels { 45 | #size-cells = <0>; 46 | #address-cells = <1>; 47 | 48 | dma-channel@0 { 49 | reg = <0>; 50 | adi,source-bus-width = <64>; 51 | adi,source-bus-type = <0>; 52 | adi,destination-bus-width = <64>; 53 | adi,destination-bus-type = <1>; 54 | }; 55 | }; 56 | }; 57 | }; 58 | -------------------------------------------------------------------------------- /cmake/modules/FindHSI.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #.rst: 5 | # FindHSI 6 | # ------- 7 | # 8 | # The module defines the following variables: 9 | # 10 | # ``HSI_EXECUTABLE`` 11 | # Path to HSI software suite produced by Xilinx for synthesis and analysis of HDL designs. 12 | # ``HSI_FOUND``, ``HSI_FOUND`` 13 | # True if the HSI tool was found. 14 | # ``HSI_VERSION_STRING`` 15 | # The version of HSI found. 16 | # 17 | # Example usage: 18 | # 19 | # .. code-block:: cmake 20 | # 21 | # find_package(HSI) 22 | # 23 | # if(HSI_FOUND) 24 | # message("HSI found: ${HSI_EXECUTABLE}") 25 | # endif() 26 | 27 | find_program(HSI_EXECUTABLE 28 | NAMES hsi 29 | ENV XILINX_HSI 30 | DOC "Software suite for synthesis and analysis of HDL designs") 31 | 32 | mark_as_advanced(HSI_EXECUTABLE) 33 | 34 | if(HSI_EXECUTABLE) 35 | execute_process(COMMAND ${HSI_EXECUTABLE} -version 36 | OUTPUT_VARIABLE hsi_version 37 | ERROR_QUIET 38 | OUTPUT_STRIP_TRAILING_WHITESPACE) 39 | 40 | separate_arguments(hsi_version) 41 | list(GET hsi_version 1 hsi_version) 42 | string(REGEX REPLACE "[a-zA-v]+" "" HSI_VERSION_STRING ${hsi_version}) 43 | unset(hsi_version) 44 | 45 | include(FindPackageHandleStandardArgs) 46 | 47 | find_package_handle_standard_args(HSI 48 | REQUIRED_VARS HSI_EXECUTABLE 49 | VERSION_VAR HSI_VERSION_STRING) 50 | endif() 51 | -------------------------------------------------------------------------------- /cmake/scripts/dmac_kmod.cmake: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | 3 | set_property (DIRECTORY PROPERTY EP_BASE Dependencies) 4 | 5 | ## Linux kernel variant from Analog Devices. 6 | set(EXT_PROJECT kmod_adi_dmac) 7 | set(EXT_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/kmod) 8 | set(KMOD_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/${EXT_PROJECT}/src/${EXT_PROJECT}) 9 | 10 | # Set build flags based on processor count. 11 | include(ProcessorCount) 12 | 13 | ProcessorCount(N) 14 | 15 | if(NOT N EQUAL 0) 16 | set(BUILD_FLAGS -j${N}) 17 | endif() 18 | 19 | ExternalProject_Add(${EXT_PROJECT} 20 | PREFIX ${EXT_PROJECT} 21 | SOURCE_DIR ${EXT_SRC_DIR} 22 | USES_TERMINAL_CONFIGURE 1 23 | USES_TERMINAL_BUILD 1 24 | USES_TERMINAL_INSTALL 1 25 | USES_TERMINAL_TEST 1 26 | CONFIGURE_COMMAND ${CMAKE_COMMAND} -E create_symlink ${EXT_SRC_DIR}/Makefile ${KMOD_SRC_DIR}-build/Makefile && 27 | ${CMAKE_COMMAND} -E create_symlink ${EXT_SRC_DIR}/iio_axi_dmac.c ${KMOD_SRC_DIR}-build/iio_axi_dmac.c 28 | BUILD_COMMAND make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} KBUILD=${KERNEL_DIR} ${BUILD_FLAGS} 29 | clean && make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} KBUILD=${KERNEL_DIR} ${BUILD_FLAGS} 30 | BUILD_BYPRODUCTS "" 31 | INSTALL_COMMAND make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} KBUILD=${KERNEL_DIR} ${BUILD_FLAGS} 32 | modules_install INSTALL_MOD_PATH=${CMAKE_CURRENT_BINARY_DIR}/image INSTALL_MOD_DIR="extra/drivers/iio/misc" 33 | ) 34 | 35 | list (APPEND DEPENDENCIES ${EXT_PROJECT}) 36 | -------------------------------------------------------------------------------- /cmake/modules/FindBootgen.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #.rst: 5 | # FindBootgen 6 | # ------- 7 | # 8 | # The module defines the following variables: 9 | # 10 | # ``BOOTGEN_EXECUTABLE`` 11 | # Path to Bootgen software suite produced by Xilinx for synthesis and analysis of HDL designs. 12 | # ``Bootgen_FOUND``, ``BOOTGEN_FOUND`` 13 | # True if the Bootgen tool was found. 14 | # ``BOOTGEN_VERSION_STRING`` 15 | # The version of Bootgen found. 16 | # 17 | # Example usage: 18 | # 19 | # .. code-block:: cmake 20 | # 21 | # find_package(Bootgen) 22 | # 23 | # if(Bootgen_FOUND) 24 | # message("Bootgen found: ${BOOTGEN_EXECUTABLE}") 25 | # endif() 26 | 27 | find_program(BOOTGEN_EXECUTABLE 28 | NAMES bootgen 29 | ENV XILINX_BOOTGEN 30 | DOC "Part of Vivado software suite for synthesis and analysis of HDL designs") 31 | 32 | mark_as_advanced(BOOTGEN_EXECUTABLE) 33 | 34 | if(BOOTGEN_EXECUTABLE) 35 | execute_process(COMMAND ${BOOTGEN_EXECUTABLE} -help 36 | OUTPUT_VARIABLE bootgen_version 37 | ERROR_QUIET 38 | OUTPUT_STRIP_TRAILING_WHITESPACE) 39 | 40 | separate_arguments(bootgen_version) 41 | list(GET bootgen_version 3 bootgen_version) 42 | string(REGEX REPLACE "[a-zA-v]+" "" BOOTGEN_VERSION_STRING ${bootgen_version}) 43 | unset(bootgen_version) 44 | 45 | include(FindPackageHandleStandardArgs) 46 | 47 | find_package_handle_standard_args(Bootgen 48 | REQUIRED_VARS BOOTGEN_EXECUTABLE 49 | VERSION_VAR BOOTGEN_VERSION_STRING) 50 | endif() 51 | -------------------------------------------------------------------------------- /cmake/modules/FindVivado.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #.rst: 5 | # FindVivado 6 | # ------- 7 | # 8 | # The module defines the following variables: 9 | # 10 | # ``VIVADO_EXECUTABLE`` 11 | # Path to Vivado software suite produced by Xilinx for synthesis and analysis of HDL designs. 12 | # ``Vivado_FOUND``, ``VIVADO_FOUND`` 13 | # True if the Vivado tool was found. 14 | # ``VIVADO_VERSION_STRING`` 15 | # The version of Vivado found. 16 | # 17 | # Example usage: 18 | # 19 | # .. code-block:: cmake 20 | # 21 | # find_package(Vivado) 22 | 23 | find_program(VIVADO_EXECUTABLE 24 | NAMES vivado 25 | ENV XILINX_VIVADO 26 | DOC "Software suite for synthesis and analysis of HDL designs") 27 | 28 | if(NOT VIVADO_EXECUTABLE) 29 | message(FATAL_ERROR "vivado command not found! Run: \nsource /opt/Xilinx/Vivado/${Vivado_FIND_VERSION}/settings64.sh\n") 30 | endif() 31 | 32 | mark_as_advanced(VIVADO_EXECUTABLE) 33 | 34 | if(VIVADO_EXECUTABLE) 35 | execute_process(COMMAND ${VIVADO_EXECUTABLE} -version 36 | OUTPUT_VARIABLE vivado_version 37 | ERROR_QUIET 38 | OUTPUT_STRIP_TRAILING_WHITESPACE) 39 | 40 | separate_arguments(vivado_version) 41 | list(GET vivado_version 1 vivado_version) 42 | string(REGEX REPLACE "[a-zA-v]+" "" VIVADO_VERSION_STRING ${vivado_version}) 43 | unset(vivado_version) 44 | endif() 45 | 46 | include(FindPackageHandleStandardArgs) 47 | 48 | find_package_handle_standard_args(Vivado 49 | REQUIRED_VARS VIVADO_EXECUTABLE 50 | VERSION_VAR VIVADO_VERSION_STRING 51 | ) 52 | -------------------------------------------------------------------------------- /cmake/scripts/hdl.cmake: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | 3 | set_property (DIRECTORY PROPERTY EP_BASE Dependencies) 4 | 5 | ## ADI HDL Project. 6 | set(EXT_PROJECT hdl) 7 | 8 | set(EXT_PROJECT_GIT_BRANCH "master") 9 | set(EXT_PROJECT_GIT_COMMIT "") 10 | 11 | set(EXT_PROJECT_REPOSITORY "https://github.com/analogdevicesinc/hdl.git") 12 | 13 | set(HDL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${EXT_PROJECT}/src/${EXT_PROJECT}/projects/adrv9364z7020/ccbob_lvds/adrv9364z7020_ccbob_lvds.runs/impl_1) 14 | 15 | ExternalProject_Add(${EXT_PROJECT} 16 | PREFIX ${EXT_PROJECT} 17 | GIT_REPOSITORY ${EXT_PROJECT_REPOSITORY} 18 | GIT_TAG ${EXT_PROJECT_GIT_BRANCH} 19 | GIT_SHALLOW 1 20 | USES_TERMINAL_DOWNLOAD 1 21 | USES_TERMINAL_UPDATE 1 22 | USES_TERMINAL_CONFIGURE 1 23 | USES_TERMINAL_BUILD 1 24 | USES_TERMINAL_INSTALL 1 25 | USES_TERMINAL_TEST 1 26 | UPDATE_COMMAND git checkout ${EXT_PROJECT_GIT_COMMIT} && git checkout -B ${EXT_PROJECT} && 27 | ${CMAKE_CURRENT_SOURCE_DIR}/patches/scripts/apply_patches.sh ${CMAKE_CURRENT_SOURCE_DIR}/patches/hdl 28 | BUILD_IN_SOURCE 1 29 | CONFIGURE_COMMAND "" 30 | BUILD_COMMAND make adrv9364z7020.ccbob_lvds 31 | BUILD_BYPRODUCTS ${HDL_DIR}/system_top.sysdef ${HDL_DIR}/system_top.bit 32 | INSTALL_COMMAND 33 | ${CMAKE_COMMAND} -E copy_if_different ${HDL_DIR}/system_top.bit 34 | ${CMAKE_CURRENT_BINARY_DIR}/image/boot/system.bit && 35 | ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/boot_gen && 36 | ${CMAKE_COMMAND} -E copy_if_different ${HDL_DIR}/system_top.sysdef 37 | ${CMAKE_CURRENT_BINARY_DIR}/boot_gen/system_top.sysdef 38 | ) 39 | 40 | list (APPEND DEPENDENCIES ${EXT_PROJECT}) 41 | -------------------------------------------------------------------------------- /cmake/scripts/ssbl.cmake: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | 3 | set_property (DIRECTORY PROPERTY EP_BASE Dependencies) 4 | 5 | ## Universal Boot Loader. 6 | set(EXT_PROJECT ssbl) 7 | 8 | set(EXT_PROJECT_GIT_BRANCH "master") 9 | set(EXT_PROJECT_GIT_COMMIT "xilinx-v2018.2") 10 | 11 | set(EXT_PROJECT_REPOSITORY "https://github.com/Xilinx/u-boot-xlnx.git") 12 | set(SSBL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${EXT_PROJECT}/src/${EXT_PROJECT}) 13 | 14 | # Set build flags based on processor count. 15 | include(ProcessorCount) 16 | 17 | ProcessorCount(N) 18 | 19 | if(NOT N EQUAL 0) 20 | set(BUILD_FLAGS -j${N}) 21 | endif() 22 | 23 | ExternalProject_Add(${EXT_PROJECT} 24 | DEPENDS fsbl 25 | PREFIX ${EXT_PROJECT} 26 | GIT_REPOSITORY ${EXT_PROJECT_REPOSITORY} 27 | GIT_TAG ${EXT_PROJECT_GIT_BRANCH} 28 | GIT_SHALLOW 1 29 | USES_TERMINAL_DOWNLOAD 1 30 | USES_TERMINAL_UPDATE 1 31 | USES_TERMINAL_CONFIGURE 1 32 | USES_TERMINAL_BUILD 1 33 | USES_TERMINAL_INSTALL 1 34 | USES_TERMINAL_TEST 1 35 | UPDATE_COMMAND git checkout ${EXT_PROJECT_GIT_COMMIT} && git checkout -B ${EXT_PROJECT} && 36 | ${CMAKE_CURRENT_SOURCE_DIR}/patches/scripts/apply_patches.sh ${CMAKE_CURRENT_SOURCE_DIR}/patches/ssbl 37 | BUILD_IN_SOURCE 1 38 | CONFIGURE_COMMAND make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} zynq_adrv9361_m6_defconfig 39 | BUILD_COMMAND make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} ${BUILD_FLAGS} 40 | BUILD_BYPRODUCTS ${SSBL_DIR}/u-boot 41 | INSTALL_COMMAND 42 | ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/boot_gen && 43 | ${CMAKE_COMMAND} -E copy_if_different ${SSBL_DIR}/u-boot ${CMAKE_CURRENT_BINARY_DIR}/boot_gen/u-boot.elf 44 | ) 45 | 46 | list (APPEND DEPENDENCIES ${EXT_PROJECT}) 47 | -------------------------------------------------------------------------------- /patches/kernel/0003-gcc-10-will-default-to-fno-common-which-causes-this-.patch: -------------------------------------------------------------------------------- 1 | From 382e594227c95bfa7ee7ae01b530c7d75e0c0912 Mon Sep 17 00:00:00 2001 2 | From: Edward Kigwana 3 | Date: Wed, 8 Jul 2020 21:31:56 +0000 4 | Subject: [PATCH 1/1] gcc 10 will default to -fno-common, which causes this 5 | error at link time: 6 | 7 | (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here 8 | 9 | This is because both dtc-lexer as well as dtc-parser define the same 10 | global symbol yyloc. Before with -fcommon those were merged into one 11 | defintion. The proper solution would be to to mark this as "extern", 12 | however that leads to: 13 | 14 | dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls] 15 | 26 | extern YYLTYPE yylloc; 16 | | ^~~~~~ 17 | In file included from dtc-lexer.l:24: 18 | dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here 19 | 127 | extern YYLTYPE yylloc; 20 | | ^~~~~~ 21 | cc1: all warnings being treated as errors 22 | 23 | which means the declaration is completely redundant and can just be 24 | dropped. 25 | --- 26 | scripts/dtc/dtc-lexer.l | 1 - 27 | 1 file changed, 1 deletion(-) 28 | 29 | diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l 30 | index 615b7ec658..d3694d6cf2 100644 31 | --- a/scripts/dtc/dtc-lexer.l 32 | +++ b/scripts/dtc/dtc-lexer.l 33 | @@ -38,7 +38,6 @@ LINECOMMENT "//".*\n 34 | #include "srcpos.h" 35 | #include "dtc-parser.tab.h" 36 | 37 | -YYLTYPE yylloc; 38 | extern bool treesource_error; 39 | 40 | /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ 41 | -- 42 | 2.27.0 43 | 44 | -------------------------------------------------------------------------------- /cmake/scripts/toolchain.cmake: -------------------------------------------------------------------------------- 1 | if(CMAKE_TOOLCHAIN_PREFIX) 2 | set(EXTERNAL_CMAKE_ARGS "${EXTERNAL_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_PREFIX=${CMAKE_TOOLCHAIN_PREFIX}") 3 | 4 | if (NOT CC) 5 | # Find CC compiler. 6 | find_program(COMPILER ${CMAKE_TOOLCHAIN_PREFIX}gcc) 7 | 8 | if(NOT COMPILER) 9 | message(FATAL_ERROR "CC compiler ${CMAKE_TOOLCHAIN_PREFIX}gcc not found!") 10 | endif() 11 | 12 | set(CMAKE_C_COMPILER ${CMAKE_TOOLCHAIN_PREFIX}gcc) 13 | else() 14 | set(CMAKE_C_COMPILER ${CC}) 15 | endif() 16 | 17 | if (NOT CXX) 18 | # Find CXX compiler. 19 | find_program(COMPILER ${CMAKE_TOOLCHAIN_PREFIX}g++) 20 | 21 | if(NOT COMPILER) 22 | message(FATAL_ERROR "CXX compiler ${CMAKE_TOOLCHAIN_PREFIX}g++ not found!") 23 | endif() 24 | 25 | set(CMAKE_CXX_COMPILER ${CMAKE_TOOLCHAIN_PREFIX}g++) 26 | else() 27 | set(CMAKE_CXX_COMPILER ${CXX}) 28 | endif() 29 | endif() 30 | 31 | if(CMAKE_SYSROOT) 32 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 33 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 34 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 35 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 36 | 37 | set(EXTERNAL_CMAKE_ARGS ${EXTERNAL_CMAKE_ARGS} 38 | -DCMAKE_SYSROOT=${CMAKE_SYSROOT} 39 | -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM} 40 | -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY} 41 | -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE} 42 | -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE} 43 | ) 44 | endif() 45 | 46 | if(CMAKE_C_COMPILER) 47 | set(EXTERNAL_CMAKE_ARGS ${EXTERNAL_CMAKE_ARGS} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) 48 | endif() 49 | 50 | if(CMAKE_C_FLAGS) 51 | set(EXTERNAL_CMAKE_ARGS ${EXTERNAL_CMAKE_ARGS} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}) 52 | endif() 53 | 54 | if(CMAKE_CXX_COMPILER) 55 | set(EXTERNAL_CMAKE_ARGS ${EXTERNAL_CMAKE_ARGS} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) 56 | endif() 57 | 58 | if(CMAKE_CXX_FLAGS) 59 | set(EXTERNAL_CMAKE_ARGS ${EXTERNAL_CMAKE_ARGS} -DCMAKE_CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}) 60 | endif() 61 | -------------------------------------------------------------------------------- /cmake/scripts/kernel.cmake: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | 3 | set_property (DIRECTORY PROPERTY EP_BASE Dependencies) 4 | 5 | ## Linux kernel. 6 | set(EXT_PROJECT kernel) 7 | 8 | set(EXT_PROJECT_GIT_BRANCH "master") 9 | set(EXT_PROJECT_GIT_COMMIT "") 10 | 11 | set(EXT_PROJECT_REPOSITORY "https://github.com/analogdevicesinc/linux.git") 12 | set(KERNEL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${EXT_PROJECT}/src/${EXT_PROJECT}) 13 | 14 | # Set build flags based on processor count. 15 | include(ProcessorCount) 16 | 17 | ProcessorCount(N) 18 | 19 | if(NOT N EQUAL 0) 20 | set(BUILD_FLAGS -j${N}) 21 | endif() 22 | 23 | ExternalProject_Add(${EXT_PROJECT} 24 | PREFIX ${EXT_PROJECT} 25 | GIT_REPOSITORY ${EXT_PROJECT_REPOSITORY} 26 | GIT_TAG ${EXT_PROJECT_GIT_BRANCH} 27 | GIT_SHALLOW 1 28 | USES_TERMINAL_DOWNLOAD 1 29 | USES_TERMINAL_UPDATE 1 30 | USES_TERMINAL_CONFIGURE 1 31 | USES_TERMINAL_BUILD 1 32 | USES_TERMINAL_INSTALL 1 33 | USES_TERMINAL_TEST 1 34 | UPDATE_COMMAND git checkout ${EXT_PROJECT_GIT_COMMIT} && git checkout -B ${EXT_PROJECT} && 35 | ${CMAKE_CURRENT_SOURCE_DIR}/patches/scripts/apply_patches.sh ${CMAKE_CURRENT_SOURCE_DIR}/patches/kernel 36 | BUILD_IN_SOURCE 1 37 | CONFIGURE_COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_CURRENT_BINARY_DIR}/dts && 38 | ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/dts ${CMAKE_CURRENT_BINARY_DIR}/dts && 39 | ${CMAKE_COMMAND} -E remove -f ${CMAKE_CURRENT_BINARY_DIR}/image && 40 | make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} zynq_adrv9361_dij_defconfig 41 | BUILD_COMMAND make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} ${BUILD_FLAGS} 42 | UIMAGE_LOADADDR=${UIMAGE_LOADADDR} uImage && make ARCH=${TGT_ARCH} 43 | CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} ${BUILD_FLAGS} modules && make ARCH=${TGT_ARCH} 44 | CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} ${BUILD_FLAGS} dtbs 45 | BUILD_BYPRODUCTS ${KERNEL_DIR}/arch/arm/boot/uImage ${CMAKE_CURRENT_BINARY_DIR}/image/lib 46 | INSTALL_COMMAND make ARCH=${TGT_ARCH} CROSS_COMPILE=${CMAKE_TOOLCHAIN_PREFIX} ${BUILD_FLAGS} 47 | modules_install INSTALL_MOD_PATH=${CMAKE_CURRENT_BINARY_DIR}/image && 48 | ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/image/boot && 49 | ${CMAKE_COMMAND} -E copy_if_different ${KERNEL_DIR}/arch/arm/boot/uImage 50 | ${CMAKE_CURRENT_BINARY_DIR}/image/boot/uImage && 51 | ${CMAKE_COMMAND} -E copy_if_different ${KERNEL_DIR}/arch/arm/boot/dts/zynq-adrv9364z7020.dtb 52 | ${CMAKE_CURRENT_BINARY_DIR}/image/boot/system.dtb 53 | ) 54 | 55 | list (APPEND DEPENDENCIES ${EXT_PROJECT}) 56 | -------------------------------------------------------------------------------- /doc/target.tcl: -------------------------------------------------------------------------------- 1 | # This is not an absolute step by step to get a sample system up and running! 2 | # The purpose of this is to show how to connect up the key pieces. 3 | # Note PS configuration not included. For inspiration, see 4 | # https://github.com/analogdevicesinc/hdl/tree/master/projects/common. 5 | # You may build a project that uses the AXI DMAC IP to see how ADI uses it 6 | # The difference is that the setup bellow uses AXIS instead of FIFO's 7 | # This assumes you know how to build ADI's IP and add it to your repo list 8 | 9 | # 1) Confiure 200 MHz clock and reset from PS 10 | # 2) reset for 200 MHz FCLK1 on Zynq for example 11 | set sys_rstgen_200m [create_bd_cell -type ip -vlnv xilinx.com:ip:proc_sys_reset:5.0 sys_rstgen_200m] 12 | set_property -dict [list CONFIG.C_EXT_RST_WIDTH {1}] $sys_rstgen_200m 13 | 14 | # 3) ADI AXI DMAC 15 | set axi_iio_tx_dma [create_bd_cell -type ip -vlnv analog.com:user:axi_dmac:1.0 axi_iio_tx_dma] 16 | set_property -dict [list CONFIG.C_DMA_TYPE_SRC {0}] $axi_iio_tx_dma 17 | set_property -dict [list CONFIG.C_DMA_TYPE_DEST {1}] $axi_iio_tx_dma 18 | set_property -dict [list CONFIG.C_FIFO_SIZE {16}] $axi_iio_tx_dma 19 | set_property -dict [list CONFIG.C_2D_TRANSFER {0}] $axi_iio_tx_dma 20 | set_property -dict [list CONFIG.C_CYCLIC {0}] $axi_iio_tx_dma 21 | set_property -dict [list CONFIG.C_AXI_SLICE_DEST {1}] $axi_iio_tx_dma 22 | set_property -dict [list CONFIG.C_AXI_SLICE_SRC {1}] $axi_iio_tx_dma 23 | set_property -dict [list CONFIG.C_DMA_DATA_WIDTH_DEST {64}] $axi_iio_tx_dma 24 | 25 | set axi_iio_rx_dma [create_bd_cell -type ip -vlnv analog.com:user:axi_dmac:1.0 axi_iio_rx_dma] 26 | set_property -dict [list CONFIG.C_DMA_TYPE_SRC {1}] $axi_iio_rx_dma 27 | set_property -dict [list CONFIG.C_DMA_TYPE_DEST {0}] $axi_iio_rx_dma 28 | set_property -dict [list CONFIG.C_FIFO_SIZE {16}] $axi_iio_rx_dma 29 | set_property -dict [list CONFIG.C_2D_TRANSFER {0}] $axi_iio_rx_dma 30 | set_property -dict [list CONFIG.C_CYCLIC {0}] $axi_iio_rx_dma 31 | set_property -dict [list CONFIG.C_AXI_SLICE_DEST {1}] $axi_iio_rx_dma 32 | set_property -dict [list CONFIG.C_AXI_SLICE_SRC {1}] $axi_iio_rx_dma 33 | set_property -dict [list CONFIG.C_DMA_DATA_WIDTH_DEST {64}] $axi_iio_rx_dma 34 | 35 | # 4) interface connections 36 | ad_connect sys_200m_clk sys_ps7/FCLK_CLK1 37 | ad_connect sys_200m_clk sys_rstgen_200m/slowest_sync_clk 38 | ad_connect sys_200mx_resetn sys_ps7/FCLK_RESET1_N 39 | ad_connect sys_200mx_resetn sys_rstgen_200m/ext_reset_in 40 | ad_connect sys_200m_resetn sys_rstgen_200m/peripheral_aresetn 41 | 42 | # NOTE: for higher throughput connect to separate HP's 43 | ad_mem_hp1_interconnect sys_200m_clk sys_ps7/S_AXI_HP1 44 | ad_mem_hp1_interconnect sys_200m_clk axi_iio_tx_dma/m_dest_axi 45 | ad_mem_hp1_interconnect sys_200m_clk axi_iio_rx_dma/m_src_axi 46 | 47 | # 6) address 48 | ad_cpu_interconnect 0x7c400000 axi_iio_tx_dma 49 | ad_cpu_interconnect 0x7c420000 axi_iio_rx_dma 50 | 51 | # 7) Remember to connect the interrupts to a concat block to PS 52 | 53 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CMake. 2 | cmake_minimum_required(VERSION 3.17.0 FATAL_ERROR) 3 | 4 | set(CMAKE_C_STANDARD 11) 5 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -ggdb3") 6 | set(CMAKE_CXX_STANDARD 17) 7 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -ggdb3") 8 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) 9 | set(CMAKE_VERBOSE_MAKEFILE ON) 10 | set(CMAKE_COLOR_MAKEFILE ON) 11 | 12 | if(CMAKE_BUILD_TYPE STREQUAL "Debug") 13 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0") 14 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0") 15 | else() 16 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") 17 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") 18 | endif() 19 | 20 | # Configure toolchain. 21 | set(TGT_ARCH arm) 22 | include(cmake/scripts/toolchain.cmake) 23 | 24 | # Project configuration. 25 | set(PROJECT_NAME adi_dmac_iio_dev) 26 | project(${PROJECT_NAME} C) 27 | 28 | include(CMakeDependentOption) 29 | 30 | option(WITH_XILINX_PL_DMAC_EXAMPLE "Build FPGA image" OFF) 31 | option(WITH_XILINX_FSBL "Build First stage boot loader (FSBL)" OFF) 32 | option(WITH_XILINX_SSBL "Build Second stage boot loader (SSBL - UBOOT)" OFF) 33 | 34 | cmake_dependent_option(WITH_BOOT_BIN_GEN "Generate Zynq boot binary" OFF 35 | "WITH_XILINX_PL_DMAC_EXAMPLE;WITH_XILINX_FSBL;WITH_XILINX_SSBL" OFF) 36 | 37 | option(WITH_ADI_LINUX_KERNEL "Build Linux kernel Image" OFF) 38 | option(WITH_DMAC_KMOD "Build kernel module" ON) 39 | option(WITH_DMAC_EXAMPLE "Build examples" ON) 40 | 41 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 42 | set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/image" CACHE PATH "default installation path" FORCE) 43 | endif() 44 | 45 | # CMake helpers. 46 | include(GNUInstallDirs) 47 | 48 | find_package (Git "2.14.0" REQUIRED) 49 | 50 | if(WITH_XILINX_PL_DMAC_EXAMPLE) 51 | find_package(Vivado "2021.1" REQUIRED) 52 | 53 | include(cmake/scripts/hdl.cmake) 54 | 55 | set(WITH_SYSDEF_FILE ${CMAKE_CURRENT_BINARY_DIR}/boot_gen/system_top.sysdef) 56 | endif() 57 | 58 | if(WITH_XILINX_FSBL) 59 | set(HSI_VER 2018.2) 60 | find_package(HSI ${HSI_VER} REQUIRED) 61 | 62 | if(NOT WITH_SYSDEF_FILE) 63 | message(FATAL_ERROR "System Definition option not set via -DWITH_SYSDEF_FILE=") 64 | endif() 65 | 66 | include(cmake/scripts/fsbl.cmake) 67 | endif() 68 | 69 | if(WITH_XILINX_SSBL) 70 | include(cmake/scripts/ssbl.cmake) 71 | 72 | if(NOT SSBL_ETHADDR) 73 | set(SSBL_ETHADDR 00:e0:22:fe:ff:ff) 74 | endif() 75 | 76 | configure_file(uenv/uEnv.txt.in ${CMAKE_CURRENT_BINARY_DIR}/image/boot/uEnv.txt @ONLY) 77 | endif() 78 | 79 | if(WITH_BOOT_BIN_GEN) 80 | add_subdirectory(boot) 81 | endif() 82 | 83 | if(WITH_ADI_LINUX_KERNEL) 84 | set(UIMAGE_LOADADDR 0x8000) 85 | 86 | include(cmake/scripts/kernel.cmake) 87 | endif() 88 | 89 | if(WITH_DMAC_KMOD) 90 | if(NOT KERNEL_DIR) 91 | message(FATAL_ERROR "KERNEL_DIR must be set root of kernel sources when WITH_DMAC_KMOD is set") 92 | endif() 93 | 94 | include(cmake/scripts/dmac_kmod.cmake) 95 | endif() 96 | 97 | if(WITH_DMAC_EXAMPLE) 98 | add_subdirectory(test) 99 | endif() 100 | -------------------------------------------------------------------------------- /patches/hdl/0001-projects-adrv9364z7020-ccbob_lvds-Add-AXI-DMAC-loop-.patch: -------------------------------------------------------------------------------- 1 | From 2a5c225179aec45604d542694bac26080d297547 Mon Sep 17 00:00:00 2001 2 | From: Edward Kigwana 3 | Date: Wed, 8 Jul 2020 17:00:07 +0000 4 | Subject: [PATCH 1/1] projects: adrv9364z7020: ccbob_lvds: Add AXI DMAC loop 5 | back for test 6 | 7 | Added RX and TX interfaces to facilitate AXI DMAC IIO kernel development. 8 | 9 | Signed-off-by: Edward Kigwana 10 | --- 11 | .../ccbob_lvds/adi_dmac_loop_back.tcl | 37 +++++++++++++++++++ 12 | .../adrv9364z7020/ccbob_lvds/system_bd.tcl | 1 + 13 | 2 files changed, 38 insertions(+) 14 | create mode 100644 projects/adrv9364z7020/ccbob_lvds/adi_dmac_loop_back.tcl 15 | 16 | diff --git a/projects/adrv9364z7020/ccbob_lvds/adi_dmac_loop_back.tcl b/projects/adrv9364z7020/ccbob_lvds/adi_dmac_loop_back.tcl 17 | new file mode 100644 18 | index 0000000..e5367cf 19 | --- /dev/null 20 | +++ b/projects/adrv9364z7020/ccbob_lvds/adi_dmac_loop_back.tcl 21 | @@ -0,0 +1,37 @@ 22 | +# Receive ADI AXI DMAC 23 | +ad_ip_instance axi_dmac axi_iio_dmac_in 24 | +ad_ip_parameter axi_iio_dmac_in CONFIG.DMA_TYPE_SRC 1 25 | +ad_ip_parameter axi_iio_dmac_in CONFIG.DMA_TYPE_DEST 0 26 | +ad_ip_parameter axi_iio_dmac_in CONFIG.CYCLIC 0 27 | +ad_ip_parameter axi_iio_dmac_in CONFIG.SYNC_TRANSFER_START 1 28 | +ad_ip_parameter axi_iio_dmac_in CONFIG.AXI_SLICE_SRC 0 29 | +ad_ip_parameter axi_iio_dmac_in CONFIG.AXI_SLICE_DEST 0 30 | +ad_ip_parameter axi_iio_dmac_in CONFIG.DMA_2D_TRANSFER 0 31 | +ad_ip_parameter axi_iio_dmac_in CONFIG.DMA_DATA_WIDTH_SRC 64 32 | +ad_connect sys_cpu_clk axi_iio_dmac_in/s_axis_aclk 33 | +ad_connect sys_cpu_resetn axi_iio_dmac_in/m_dest_axi_aresetn 34 | + 35 | +# Transmit ADI AXI DMAC 36 | +ad_ip_instance axi_dmac axi_iio_dmac_out 37 | +ad_ip_parameter axi_iio_dmac_out CONFIG.DMA_TYPE_SRC 0 38 | +ad_ip_parameter axi_iio_dmac_out CONFIG.DMA_TYPE_DEST 1 39 | +ad_ip_parameter axi_iio_dmac_out CONFIG.CYCLIC 0 40 | +ad_ip_parameter axi_iio_dmac_out CONFIG.AXI_SLICE_SRC 0 41 | +ad_ip_parameter axi_iio_dmac_out CONFIG.AXI_SLICE_DEST 0 42 | +ad_ip_parameter axi_iio_dmac_out CONFIG.DMA_2D_TRANSFER 0 43 | +ad_ip_parameter axi_iio_dmac_out CONFIG.DMA_DATA_WIDTH_DEST 64 44 | +ad_connect sys_cpu_clk axi_iio_dmac_out/m_axis_aclk 45 | +ad_connect sys_cpu_resetn axi_iio_dmac_out/m_src_axi_aresetn 46 | + 47 | +# Interconnects 48 | +ad_connect axi_iio_dmac_out/m_axis axi_iio_dmac_in/s_axis 49 | +ad_cpu_interconnect 0x7C460000 axi_iio_dmac_in 50 | +ad_cpu_interconnect 0x7C480000 axi_iio_dmac_out 51 | + 52 | +ad_mem_hp3_interconnect sys_cpu_clk sys_ps7/S_AXI_HP3 53 | +ad_mem_hp3_interconnect sys_cpu_clk axi_iio_dmac_in/m_dest_axi 54 | +ad_mem_hp3_interconnect sys_cpu_clk axi_iio_dmac_out/m_src_axi 55 | + 56 | +# interrupts 57 | +ad_cpu_interrupt ps-2 mb-2 axi_iio_dmac_in/irq 58 | +ad_cpu_interrupt ps-3 mb-3 axi_iio_dmac_out/irq 59 | diff --git a/projects/adrv9364z7020/ccbob_lvds/system_bd.tcl b/projects/adrv9364z7020/ccbob_lvds/system_bd.tcl 60 | index eae7e85..1795517 100644 61 | --- a/projects/adrv9364z7020/ccbob_lvds/system_bd.tcl 62 | +++ b/projects/adrv9364z7020/ccbob_lvds/system_bd.tcl 63 | @@ -1,5 +1,6 @@ 64 | 65 | source ../common/adrv9364z7020_bd.tcl 66 | +source adi_dmac_loop_back.tcl 67 | source ../common/ccbob_bd.tcl 68 | 69 | cfg_ad9361_interface LVDS 70 | -- 71 | 2.27.0 72 | 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ADI AXI DMAC Development System on ADRV9364z7020 Platform 2 | ## Description 3 | This project contains all the components sans an OS image required to develop and test a projects requiring a streaming 4 | DMA interface. 5 | 6 | This project builds and generates all components that can be copied to an existing OS image to facilitate development. 7 | This project consists of the following components: 8 | 9 | * **Firmware** - FPGA hardware bitstream image for a ADRV9364z7020 transceiver to configure the Zynq SoC for 10 | required functionality. 11 | 12 | * **FSBL** - First Stage Bootloader for a Zynq 7000 SoC that loads the 2nd Stage Boot Loader image from the non-volatile 13 | memory (SD) to Memory (DDR/TCM/OCM) and takes Arm processor out of reset. 14 | 15 | * **SSBL** - Configures the FPGA with the appropriate hardware bitstream. The SSBL loads the Operating System (OS) 16 | kernel Image and executes it. 17 | 18 | * **Boot Bin Generation** - Generates the boot binary a Zynq 7000 SoC. The SoC is expected to load it from SD 19 | non-volatile storage 20 | 21 | * **Kernel and Device Tree Blob (dtb)** - The Linux kernel is part of the OS. The DTB describes all available system 22 | hardware to include that instantiated in the FPGA. The kernel uses this information to load the appropriate system level 23 | drivers facilitating access to hardware. 24 | 25 | * **Operating System** - Not provided but required to test. Some ready made OS images and instructions on getting an OS 26 | on bootable media are here: [AD-FMC-SDCARD for Zynq & Altera SoC Quick Start Guide](https://wiki.analog.com/resources/tools-software/linux-software/zynq_images) 27 | 28 | * **Kernel Module** - Custom IIO driver that uses the Linux IIO AXI DMAC driver to bring streaming interfaces to 29 | userspace via [IIO](https://wiki.analog.com/software/linux/docs/iio/iio). 30 | 31 | * **Example Streaming Application** - Example demonstrating how to use the 32 | [IIO library](https://wiki.analog.com/resources/tools-software/linux-software/libiio) to stream data. 33 | 34 | ## Requirements 35 | The following software is required to build the bitstream: 36 | 37 | 1. GNU environment providing GCC compiler 38 | 2. CMake 39 | 3. ninja or make 40 | 4. xilinx vivado version 2018.2 41 | 5. OS image files in a directory. Can be the boot media but it is recommended to copy the root filesystem to a location 42 | such as: /opt/armv7a/adi_zynq_img/ 43 | 44 | ## Building 45 | Building all components is enabled by default. When focusing on a particular component, all other may be disabled as 46 | long as they are not dependent components. A tool chain prefix and OS system root are required to build all components. 47 | The tool chain prefix for tools that are part of Vivado 2018.2 is arm-linux-gnueabihf-. When building the SSBL, the 48 | Ethernet MAC address may be specified on the command line as follows: -DSSBL_ETHADDR="00:e0:22:fe:ff:ff" 49 | 50 | 1. mkdir build 51 | 2. cd build 52 | 3. cmake -G Ninja -DCMAKE_TOOLCHAIN_PREFIX=armv7a-unknown-linux-gnueabihf- -DCMAKE_SYSROOT=/opt/armv7a/adi_zynq_img/ .. 53 | 4. ninja -v 54 | 55 | ## Install 56 | 1. ninja -v install 57 | 58 | ## Output Products 59 | The all components located in the build/image or install prefix subdirectory. The products in this directory are then 60 | transfered to the boot media using common file tranfer methods. 61 | -------------------------------------------------------------------------------- /patches/ssbl/0001-configs-zynq_adrv9361_m6_defconfig-Add-configuration.patch: -------------------------------------------------------------------------------- 1 | From 8188879f0600babed557e5c8053b41eb9b977afd Mon Sep 17 00:00:00 2001 2 | From: Edward Kigwana 3 | Date: Mon, 14 Jan 2019 18:15:38 +0000 4 | Subject: [PATCH 1/1] configs/zynq_adrv9361_m6_defconfig: Add configuration for 5 | ADRV9364 derived M6. 6 | 7 | --- 8 | configs/zynq_adrv9361_m6_defconfig | 84 ++++++++++++++++++++++++++++++ 9 | 1 file changed, 84 insertions(+) 10 | create mode 100644 configs/zynq_adrv9361_m6_defconfig 11 | 12 | diff --git a/configs/zynq_adrv9361_m6_defconfig b/configs/zynq_adrv9361_m6_defconfig 13 | new file mode 100644 14 | index 000000000..bf45439f5 15 | --- /dev/null 16 | +++ b/configs/zynq_adrv9361_m6_defconfig 17 | @@ -0,0 +1,84 @@ 18 | +CONFIG_ARM=y 19 | +CONFIG_SYS_CONFIG_NAME="zynq_zc70x" 20 | +CONFIG_ARCH_ZYNQ=y 21 | +CONFIG_SYS_TEXT_BASE=0x4000000 22 | +CONFIG_IDENT_STRING=" ADI ARDV9364z7020" 23 | +CONFIG_SPL_STACK_R_ADDR=0x200000 24 | +CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706" 25 | +CONFIG_DEBUG_UART=y 26 | +CONFIG_DISTRO_DEFAULTS=y 27 | +CONFIG_FIT=y 28 | +CONFIG_FIT_SIGNATURE=y 29 | +CONFIG_FIT_VERBOSE=y 30 | +CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" 31 | +# CONFIG_DISPLAY_CPUINFO is not set 32 | +CONFIG_SPL=y 33 | +CONFIG_SPL_STACK_R=y 34 | +CONFIG_SPL_OS_BOOT=y 35 | +CONFIG_SYS_PROMPT="Zynq> " 36 | +CONFIG_CMD_THOR_DOWNLOAD=y 37 | +CONFIG_CMD_EEPROM=y 38 | +CONFIG_CMD_MD5SUM=y 39 | +CONFIG_MD5SUM_VERIFY=y 40 | +CONFIG_CMD_MEMINFO=y 41 | +CONFIG_CMD_SHA1SUM=y 42 | +CONFIG_SHA1SUM_VERIFY=y 43 | +CONFIG_CMD_DFU=y 44 | +# CONFIG_CMD_FLASH is not set 45 | +CONFIG_CMD_FPGA_LOADBP=y 46 | +CONFIG_CMD_FPGA_LOADFS=y 47 | +CONFIG_CMD_FPGA_LOADMK=y 48 | +CONFIG_CMD_FPGA_LOADP=y 49 | +CONFIG_CMD_FPGA_LOAD_SECURE=y 50 | +CONFIG_CMD_GPIO=y 51 | +CONFIG_CMD_I2C=y 52 | +CONFIG_CMD_MMC=y 53 | +CONFIG_CMD_SF=y 54 | +CONFIG_CMD_USB=y 55 | +# CONFIG_CMD_SETEXPR is not set 56 | +CONFIG_CMD_TFTPPUT=y 57 | +CONFIG_CMD_CACHE=y 58 | +CONFIG_CMD_ZYNQ_RSA=y 59 | +CONFIG_CMD_AES=y 60 | +CONFIG_CMD_HASH=y 61 | +CONFIG_HASH_VERIFY=y 62 | +CONFIG_CMD_EXT4_WRITE=y 63 | +CONFIG_OF_EMBED=y 64 | +CONFIG_ENV_IS_IN_SPI_FLASH=y 65 | +CONFIG_NET_RANDOM_ETHADDR=y 66 | +CONFIG_SPL_DM_SEQ_ALIAS=y 67 | +CONFIG_DFU_MMC=y 68 | +CONFIG_DFU_RAM=y 69 | +CONFIG_FPGA_XILINX=y 70 | +CONFIG_DM_GPIO=y 71 | +CONFIG_MMC_SDHCI=y 72 | +CONFIG_MMC_SDHCI_ZYNQ=y 73 | +CONFIG_SPI_FLASH=y 74 | +CONFIG_SPI_FLASH_BAR=y 75 | +CONFIG_SF_DUAL_FLASH=y 76 | +CONFIG_SPI_FLASH_ISSI=y 77 | +CONFIG_SPI_FLASH_MACRONIX=y 78 | +CONFIG_SPI_FLASH_SPANSION=y 79 | +CONFIG_SPI_FLASH_STMICRO=y 80 | +CONFIG_SPI_FLASH_WINBOND=y 81 | +CONFIG_PHY_MARVELL=y 82 | +CONFIG_PHY_REALTEK=y 83 | +CONFIG_PHY_XILINX=y 84 | +CONFIG_ZYNQ_GEM=y 85 | +CONFIG_DEBUG_UART_ZYNQ=y 86 | +CONFIG_DEBUG_UART_BASE=0xe0000000 87 | +CONFIG_DEBUG_UART_CLOCK=50000000 88 | +CONFIG_DEBUG_UART_ANNOUNCE=y 89 | +CONFIG_ZYNQ_SERIAL=y 90 | +CONFIG_ZYNQ_QSPI=y 91 | +CONFIG_USB=y 92 | +CONFIG_USB_EHCI_HCD=y 93 | +CONFIG_USB_ULPI_VIEWPORT=y 94 | +CONFIG_USB_ULPI=y 95 | +CONFIG_USB_STORAGE=y 96 | +CONFIG_USB_GADGET=y 97 | +CONFIG_USB_GADGET_MANUFACTURER="Xilinx" 98 | +CONFIG_USB_GADGET_VENDOR_NUM=0x03fd 99 | +CONFIG_USB_GADGET_PRODUCT_NUM=0x0300 100 | +CONFIG_CI_UDC=y 101 | +CONFIG_USB_GADGET_DOWNLOAD=y 102 | -- 103 | 2.20.1 104 | 105 | -------------------------------------------------------------------------------- /kmod/iio_axi_dmac.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ADI AXI DMAC IIO Client Module 3 | * 4 | * Copyright 2015 Edward Kigwana. 5 | * 6 | * Licensed under the GPL-2. 7 | * 8 | * Inspired by ad_adc.c 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | static int dma_hw_submit_block(struct iio_dma_buffer_queue *queue, struct iio_dma_buffer_block *block) 27 | { 28 | struct iio_dev *indio_dev = queue->driver_data; 29 | int direction = DMA_TO_DEVICE; 30 | 31 | if (indio_dev->direction == IIO_DEVICE_DIRECTION_IN) { 32 | direction = DMA_FROM_DEVICE; 33 | block->block.bytes_used = block->block.size; 34 | } 35 | 36 | return iio_dmaengine_buffer_submit_block(queue, block, direction); 37 | } 38 | 39 | static const struct iio_dma_buffer_ops dma_buffer_ops = { 40 | .submit = dma_hw_submit_block, 41 | .abort = iio_dmaengine_buffer_abort, 42 | }; 43 | 44 | int dma_configure_ring_stream(struct iio_dev *indio_dev, const char *dma_name) 45 | { 46 | struct iio_buffer *buffer; 47 | 48 | if (dma_name == NULL) 49 | dma_name = "rx"; 50 | 51 | buffer = iio_dmaengine_buffer_alloc(indio_dev->dev.parent, dma_name, 52 | &dma_buffer_ops, indio_dev); 53 | 54 | if (IS_ERR(buffer)) 55 | return PTR_ERR(buffer); 56 | 57 | indio_dev->modes |= INDIO_BUFFER_HARDWARE; 58 | iio_device_attach_buffer(indio_dev, buffer); 59 | 60 | return 0; 61 | } 62 | 63 | void dma_unconfigure_ring_stream(struct iio_dev *indio_dev) 64 | { 65 | iio_dmaengine_buffer_free(indio_dev->buffer); 66 | } 67 | 68 | struct dma_info { 69 | unsigned int direction; 70 | const struct iio_chan_spec *channels; 71 | unsigned int num_channels; 72 | }; 73 | 74 | #define IIO_CHANNEL(_chan, _rb, _direction) { \ 75 | .type = IIO_VOLTAGE, \ 76 | .indexed = 1, \ 77 | .channel = _chan, \ 78 | .modified = 0, \ 79 | .channel2 = 0, \ 80 | .output = _direction, \ 81 | .address = _chan, \ 82 | .scan_index = _chan, \ 83 | .scan_type = { \ 84 | .sign = 'u', \ 85 | .realbits = _rb, \ 86 | .storagebits = _rb, \ 87 | .shift = 0, \ 88 | .endianness = IIO_LE, \ 89 | }, \ 90 | } 91 | 92 | #define AXI_DMAC_MAX_CHANNEL 1 93 | 94 | struct dma_state { 95 | struct iio_info iio_info; 96 | unsigned id; 97 | struct iio_chan_spec channels[AXI_DMAC_MAX_CHANNEL]; 98 | }; 99 | 100 | static const struct iio_chan_spec iio_channels_in[] = { 101 | IIO_CHANNEL(0, 64, IIO_DEVICE_DIRECTION_IN), 102 | }; 103 | 104 | static const struct dma_info dma_rx_info = { 105 | .direction = IIO_DEVICE_DIRECTION_IN, 106 | .channels = iio_channels_in, 107 | .num_channels = ARRAY_SIZE(iio_channels_in), 108 | }; 109 | 110 | static const struct iio_chan_spec iio_channels_out[] = { 111 | IIO_CHANNEL(0, 64, IIO_DEVICE_DIRECTION_OUT), 112 | }; 113 | 114 | static const struct dma_info dma_tx_info = { 115 | .direction = IIO_DEVICE_DIRECTION_OUT, 116 | .channels = iio_channels_out, 117 | .num_channels = ARRAY_SIZE(iio_channels_out), 118 | }; 119 | 120 | static const struct iio_info dmac_info = { 121 | }; 122 | 123 | static const struct of_device_id dma_of_match[] = { 124 | { .compatible = "adi,iio-rx-dma-1.00.c", .data = &dma_rx_info }, 125 | { .compatible = "adi,iio-tx-dma-1.00.c", .data = &dma_tx_info }, 126 | { /* end of list */ }, 127 | }; 128 | MODULE_DEVICE_TABLE(of, dma_of_match); 129 | 130 | static int dma_probe(struct platform_device *pdev) 131 | { 132 | const struct dma_info *info; 133 | const struct of_device_id *id; 134 | struct device_node *np = pdev->dev.of_node; 135 | 136 | const char *dma_name; 137 | struct iio_dev *indio_dev; 138 | struct dma_state *st; 139 | struct resource *mem; 140 | int ret; 141 | 142 | id = of_match_node(dma_of_match, np); 143 | if (!id) 144 | return -ENODEV; 145 | 146 | info = id->data; 147 | indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*st)); 148 | if (indio_dev == NULL) 149 | return -ENOMEM; 150 | 151 | st = iio_priv(indio_dev); 152 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 153 | 154 | platform_set_drvdata(pdev, indio_dev); 155 | 156 | indio_dev->dev.parent = &pdev->dev; 157 | indio_dev->name = np->name; 158 | indio_dev->modes = INDIO_DIRECT_MODE; 159 | indio_dev->info = &dmac_info; 160 | indio_dev->channels = info->channels; 161 | indio_dev->num_channels = info->num_channels; 162 | indio_dev->direction = info->direction; 163 | 164 | if (of_property_read_string_index(np, "dma-names", 0, &dma_name)) 165 | return -ENODEV; 166 | 167 | ret = dma_configure_ring_stream(indio_dev, dma_name); 168 | if (ret) 169 | return ret; 170 | 171 | ret = iio_device_register(indio_dev); 172 | if (ret) 173 | goto err_unconfigure_ring; 174 | 175 | dev_info(&pdev->dev, "%s : Found", __func__); 176 | return 0; 177 | 178 | err_unconfigure_ring: 179 | dev_info(&pdev->dev, "%s : Failed to register IIO device", __func__); 180 | dma_unconfigure_ring_stream(indio_dev); 181 | 182 | return ret; 183 | } 184 | 185 | static int dma_remove(struct platform_device *pdev) 186 | { 187 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); 188 | 189 | iio_device_unregister(indio_dev); 190 | dma_unconfigure_ring_stream(indio_dev); 191 | 192 | return 0; 193 | } 194 | 195 | static struct platform_driver dma_driver = { 196 | .driver = { 197 | .name = KBUILD_MODNAME, 198 | .owner = THIS_MODULE, 199 | .of_match_table = dma_of_match, 200 | }, 201 | .probe = dma_probe, 202 | .remove = dma_remove, 203 | }; 204 | 205 | module_platform_driver(dma_driver); 206 | 207 | MODULE_AUTHOR("Edward Kigwana "); 208 | MODULE_DESCRIPTION("ADI AXI DMAC IIO client driver"); 209 | MODULE_LICENSE("GPL v2"); 210 | -------------------------------------------------------------------------------- /test/iio_axi_dmac_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Inspired by - ADI AXI DMA IIO streaming example 3 | * 4 | **/ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define IIO_ENSURE(expr) { \ 17 | if (!(expr)) { \ 18 | (void) fprintf(stderr, "assertion failed (%s:%d)\n", __FILE__, __LINE__); \ 19 | (void) abort(); \ 20 | } \ 21 | } 22 | 23 | static const struct option options[] = { 24 | {"help", no_argument, 0, 'h'}, 25 | {"buffer-size", required_argument, 0, 's'}, 26 | {"iio-device-name", required_argument, 0, 'd'}, 27 | {0, 0, 0, 0}, 28 | }; 29 | 30 | static const char *options_descriptions[] = { 31 | "Show this help and quit.", 32 | "Size of the buffer. Default is 1M byte and is loaded with count from 1.", 33 | "Recreate DMA buffer before push or refill.", 34 | "IIO device name." 35 | }; 36 | 37 | static void usage(char *argv[]) 38 | { 39 | unsigned int i; 40 | 41 | printf("Usage:\n\t%s [-s ] \n\nOptions:\n", argv[0]); 42 | for (i = 0; options[i].name; i++) 43 | printf("\t-%c, --%s\n\t\t\t%s\n", 44 | options[i].val, options[i].name, 45 | options_descriptions[i]); 46 | } 47 | 48 | /* IIO structs required for streaming */ 49 | static struct iio_context *ctx = NULL; 50 | static struct iio_channel *dma_chan = NULL; 51 | static struct iio_buffer *dma_buffer = NULL; 52 | 53 | static bool stop = false; 54 | 55 | /* cleanup and exit */ 56 | void shutdown() 57 | { 58 | printf("* Destroying buffer\n"); 59 | if (dma_buffer) 60 | iio_buffer_destroy(dma_buffer); 61 | 62 | printf("* Disabling streaming channel\n"); 63 | if (dma_chan) 64 | iio_channel_disable(dma_chan); 65 | 66 | printf("* Destroying context\n"); 67 | if (ctx) 68 | iio_context_destroy(ctx); 69 | 70 | exit(0); 71 | } 72 | 73 | static void handle_sig(int sig) 74 | { 75 | printf("Waiting for process to finish... Got signal %d\n", sig); 76 | stop = true; 77 | } 78 | 79 | void pbuf(const char *pref, const struct iio_buffer *dma_buffer) 80 | { 81 | if ((pref == NULL) || (dma_buffer == NULL)) 82 | return; 83 | 84 | void *p_dat = NULL; 85 | void *p_end = iio_buffer_end(dma_buffer); 86 | ptrdiff_t p_inc = iio_buffer_step(dma_buffer); 87 | 88 | printf("%s", pref); 89 | for (p_dat = iio_buffer_first(dma_buffer, dma_chan); p_dat < p_end; p_dat += p_inc) 90 | printf("0x%08jx ", *(uint64_t *)p_dat); 91 | printf("\n"); 92 | } 93 | 94 | /* simple configuration and streaming */ 95 | int main (int argc, char **argv) 96 | { 97 | char err_str[512]; 98 | int nbytes = 0; 99 | void *p_dat = NULL; 100 | void *p_end = NULL; 101 | ptrdiff_t p_inc = 0; 102 | uint64_t n = 0; 103 | char sbuf[16]; 104 | 105 | struct iio_device *dev = NULL; 106 | char *dev_name = NULL; 107 | unsigned int buffer_size = 1024 * 1024; 108 | unsigned int i = 0; 109 | bool device_is_tx = false; 110 | bool timeout = false; 111 | int option_index = 0; 112 | int arg_index = 0; 113 | char unit; 114 | int ret = 0; 115 | 116 | while ((i = getopt_long(argc, argv, "d:s:rh", options, &option_index)) != -1) { 117 | switch (i) { 118 | case 'd': 119 | dev_name = optarg; 120 | break; 121 | case 's': 122 | ret = sscanf(optarg, "%d%c", &buffer_size, &unit); 123 | if (ret == 0) 124 | return EXIT_FAILURE; 125 | if (ret == 2) { 126 | if (unit == 'k') 127 | buffer_size *= 1024; 128 | else if (unit == 'M') 129 | buffer_size *= 1024 * 1024; 130 | } 131 | break; 132 | case 'h': 133 | default: 134 | usage(argv); 135 | return EXIT_SUCCESS; 136 | } 137 | } 138 | 139 | if (arg_index + 1 >= argc) { 140 | fprintf(stderr, "Incorrect number of arguments.\n\n"); 141 | usage(argv); 142 | return EXIT_FAILURE; 143 | } 144 | 145 | // Listen to ctrl+c and assert 146 | signal(SIGINT, handle_sig); 147 | 148 | IIO_ENSURE((ctx = iio_create_default_context()) && "No context"); 149 | IIO_ENSURE(iio_context_get_devices_count(ctx) > 0 && "No devices"); 150 | IIO_ENSURE((dev = iio_context_find_device(ctx, dev_name)) && "No streaming device found"); 151 | IIO_ENSURE(iio_device_get_channels_count(dev) == 1 && "No channels"); 152 | IIO_ENSURE((dma_chan = iio_device_get_channel(dev, 0)) && "No channel"); 153 | IIO_ENSURE(iio_channel_is_scan_element(dma_chan) && "No streaming capabilities"); 154 | 155 | iio_channel_enable(dma_chan); 156 | 157 | IIO_ENSURE((dma_buffer = iio_device_create_buffer(dev, buffer_size, false)) && "Failed to create buffer"); 158 | 159 | printf("Performing data transfer. Ctrl + c to terminate.\n"); 160 | 161 | device_is_tx = iio_channel_is_output(dma_chan); 162 | while (!stop) { 163 | if (device_is_tx) { 164 | if (!timeout) { 165 | p_inc = iio_buffer_step(dma_buffer); 166 | p_end = iio_buffer_end(dma_buffer); 167 | for (p_dat = iio_buffer_first(dma_buffer, dma_chan); p_dat < p_end; p_dat += p_inc) 168 | *(uint64_t *)p_dat = ++n; 169 | 170 | pbuf("$ TX: ", dma_buffer); 171 | } 172 | 173 | nbytes = iio_buffer_push(dma_buffer); 174 | if (nbytes < 0) { 175 | iio_strerror(-nbytes, err_str, sizeof(err_str)); 176 | printf("* Error pushing buffer %d: %s\n", nbytes, err_str); 177 | if (nbytes == -ETIMEDOUT) { 178 | printf("* Ensure that transmit buffer is getting emptied. Run RX first if in loopback."); 179 | if (!timeout) 180 | timeout = true; 181 | 182 | continue; 183 | } 184 | 185 | shutdown(); 186 | break; 187 | } 188 | 189 | if (timeout) 190 | timeout = false; 191 | } else { 192 | nbytes = iio_buffer_refill(dma_buffer); 193 | if (nbytes < 0) { 194 | iio_strerror(-nbytes, err_str, sizeof(err_str)); 195 | printf("* Error refilling buffer %d: %s\n", nbytes, err_str); 196 | if (nbytes == -ETIMEDOUT) { 197 | printf("* Ensure that receive buffer is getting filled in PL. Run TX if in loopback."); 198 | if (!timeout) 199 | timeout = true; 200 | 201 | continue; 202 | } 203 | 204 | shutdown(); 205 | break; 206 | } 207 | 208 | if (timeout) 209 | timeout = false; 210 | 211 | (void)snprintf(sbuf, sizeof(sbuf), "$ RX (%d): ", nbytes); 212 | pbuf(sbuf, dma_buffer); 213 | } 214 | } 215 | 216 | shutdown(); 217 | 218 | return 0; 219 | } 220 | -------------------------------------------------------------------------------- /patches/ssbl/0002-gcc-10-will-default-to-fno-common-which-causes-this-.patch: -------------------------------------------------------------------------------- 1 | From 45c95f49110ce9208a1b28e1abc656e0a4b49cef Mon Sep 17 00:00:00 2001 2 | From: Edward Kigwana 3 | Date: Thu, 9 Jul 2020 13:55:41 +0000 4 | Subject: [PATCH 1/1] gcc 10 will default to -fno-common, which causes this 5 | error at link time: 6 | 7 | (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here 8 | 9 | This is because both dtc-lexer as well as dtc-parser define the same 10 | global symbol yyloc. Before with -fcommon those were merged into one 11 | defintion. The proper solution would be to to mark this as "extern", 12 | however that leads to: 13 | 14 | dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls] 15 | 26 | extern YYLTYPE yylloc; 16 | | ^~~~~~ 17 | In file included from dtc-lexer.l:24: 18 | dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here 19 | 127 | extern YYLTYPE yylloc; 20 | | ^~~~~~ 21 | cc1: all warnings being treated as errors 22 | 23 | which means the declaration is completely redundant and can just be 24 | dropped. 25 | 26 | Signed-off-by: Edward Kigwana 27 | --- 28 | scripts/dtc/dtc-lexer.l | 1 - 29 | scripts/dtc/dtc-lexer.lex.c_shipped | 79 ++++++++++++++--------------- 30 | 2 files changed, 39 insertions(+), 41 deletions(-) 31 | 32 | diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l 33 | index fd825ebba..24af54997 100644 34 | --- a/scripts/dtc/dtc-lexer.l 35 | +++ b/scripts/dtc/dtc-lexer.l 36 | @@ -38,7 +38,6 @@ LINECOMMENT "//".*\n 37 | #include "srcpos.h" 38 | #include "dtc-parser.tab.h" 39 | 40 | -YYLTYPE yylloc; 41 | extern bool treesource_error; 42 | 43 | /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ 44 | diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped 45 | index 011bb9632..836456561 100644 46 | --- a/scripts/dtc/dtc-lexer.lex.c_shipped 47 | +++ b/scripts/dtc/dtc-lexer.lex.c_shipped 48 | @@ -34,7 +34,7 @@ 49 | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 50 | 51 | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 52 | - * if you want the limit (max/min) macros for int types. 53 | + * if you want the limit (max/min) macros for int types. 54 | */ 55 | #ifndef __STDC_LIMIT_MACROS 56 | #define __STDC_LIMIT_MACROS 1 57 | @@ -51,7 +51,7 @@ typedef uint32_t flex_uint32_t; 58 | typedef signed char flex_int8_t; 59 | typedef short int flex_int16_t; 60 | typedef int flex_int32_t; 61 | -typedef unsigned char flex_uint8_t; 62 | +typedef unsigned char flex_uint8_t; 63 | typedef unsigned short int flex_uint16_t; 64 | typedef unsigned int flex_uint32_t; 65 | 66 | @@ -165,7 +165,7 @@ extern FILE *yyin, *yyout; 67 | 68 | #define YY_LESS_LINENO(n) 69 | #define YY_LINENO_REWIND_TO(ptr) 70 | - 71 | + 72 | /* Return all but the first "n" matched characters back to the input stream. */ 73 | #define yyless(n) \ 74 | do \ 75 | @@ -631,7 +631,6 @@ char *yytext; 76 | #include "srcpos.h" 77 | #include "dtc-parser.tab.h" 78 | 79 | -YYLTYPE yylloc; 80 | extern bool treesource_error; 81 | 82 | /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ 83 | @@ -720,7 +719,7 @@ extern int yywrap (void ); 84 | #endif 85 | 86 | #ifndef YY_NO_UNPUT 87 | - 88 | + 89 | #endif 90 | 91 | #ifndef yytext_ptr 92 | @@ -851,7 +850,7 @@ YY_DECL 93 | yy_state_type yy_current_state; 94 | char *yy_cp, *yy_bp; 95 | int yy_act; 96 | - 97 | + 98 | if ( !(yy_init) ) 99 | { 100 | (yy_init) = 1; 101 | @@ -1531,7 +1530,7 @@ static int yy_get_next_buffer (void) 102 | { 103 | yy_state_type yy_current_state; 104 | char *yy_cp; 105 | - 106 | + 107 | yy_current_state = (yy_start); 108 | yy_current_state += YY_AT_BOL(); 109 | 110 | @@ -1596,7 +1595,7 @@ static int yy_get_next_buffer (void) 111 | 112 | { 113 | int c; 114 | - 115 | + 116 | *(yy_c_buf_p) = (yy_hold_char); 117 | 118 | if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 119 | @@ -1665,12 +1664,12 @@ static int yy_get_next_buffer (void) 120 | 121 | /** Immediately switch to a different input stream. 122 | * @param input_file A readable stream. 123 | - * 124 | + * 125 | * @note This function does not reset the start condition to @c INITIAL . 126 | */ 127 | void yyrestart (FILE * input_file ) 128 | { 129 | - 130 | + 131 | if ( ! YY_CURRENT_BUFFER ){ 132 | yyensure_buffer_stack (); 133 | YY_CURRENT_BUFFER_LVALUE = 134 | @@ -1683,11 +1682,11 @@ static int yy_get_next_buffer (void) 135 | 136 | /** Switch to a different input buffer. 137 | * @param new_buffer The new input buffer. 138 | - * 139 | + * 140 | */ 141 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 142 | { 143 | - 144 | + 145 | /* TODO. We should be able to replace this entire function body 146 | * with 147 | * yypop_buffer_state(); 148 | @@ -1727,13 +1726,13 @@ static void yy_load_buffer_state (void) 149 | /** Allocate and initialize an input buffer state. 150 | * @param file A readable stream. 151 | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 152 | - * 153 | + * 154 | * @return the allocated buffer state. 155 | */ 156 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 157 | { 158 | YY_BUFFER_STATE b; 159 | - 160 | + 161 | b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 162 | if ( ! b ) 163 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 164 | @@ -1756,11 +1755,11 @@ static void yy_load_buffer_state (void) 165 | 166 | /** Destroy the buffer. 167 | * @param b a buffer created with yy_create_buffer() 168 | - * 169 | + * 170 | */ 171 | void yy_delete_buffer (YY_BUFFER_STATE b ) 172 | { 173 | - 174 | + 175 | if ( ! b ) 176 | return; 177 | 178 | @@ -1781,7 +1780,7 @@ static void yy_load_buffer_state (void) 179 | 180 | { 181 | int oerrno = errno; 182 | - 183 | + 184 | yy_flush_buffer(b ); 185 | 186 | b->yy_input_file = file; 187 | @@ -1797,13 +1796,13 @@ static void yy_load_buffer_state (void) 188 | } 189 | 190 | b->yy_is_interactive = 0; 191 | - 192 | + 193 | errno = oerrno; 194 | } 195 | 196 | /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 197 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 198 | - * 199 | + * 200 | */ 201 | void yy_flush_buffer (YY_BUFFER_STATE b ) 202 | { 203 | @@ -1832,7 +1831,7 @@ static void yy_load_buffer_state (void) 204 | * the current state. This function will allocate the stack 205 | * if necessary. 206 | * @param new_buffer The new state. 207 | - * 208 | + * 209 | */ 210 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 211 | { 212 | @@ -1862,7 +1861,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 213 | 214 | /** Removes and deletes the top of the stack, if present. 215 | * The next element becomes the new top. 216 | - * 217 | + * 218 | */ 219 | void yypop_buffer_state (void) 220 | { 221 | @@ -1886,7 +1885,7 @@ void yypop_buffer_state (void) 222 | static void yyensure_buffer_stack (void) 223 | { 224 | int num_to_alloc; 225 | - 226 | + 227 | if (!(yy_buffer_stack)) { 228 | 229 | /* First allocation is just for 2 elements, since we don't know if this 230 | @@ -1929,13 +1928,13 @@ static void yyensure_buffer_stack (void) 231 | /** Setup the input buffer state to scan directly from a user-specified character buffer. 232 | * @param base the character buffer 233 | * @param size the size in bytes of the character buffer 234 | - * 235 | + * 236 | * @return the newly allocated buffer state object. 237 | */ 238 | YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 239 | { 240 | YY_BUFFER_STATE b; 241 | - 242 | + 243 | if ( size < 2 || 244 | base[size-2] != YY_END_OF_BUFFER_CHAR || 245 | base[size-1] != YY_END_OF_BUFFER_CHAR ) 246 | @@ -1964,14 +1963,14 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 247 | /** Setup the input buffer state to scan a string. The next call to yylex() will 248 | * scan from a @e copy of @a str. 249 | * @param yystr a NUL-terminated string to scan 250 | - * 251 | + * 252 | * @return the newly allocated buffer state object. 253 | * @note If you want to scan bytes that may contain NUL values, then use 254 | * yy_scan_bytes() instead. 255 | */ 256 | YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 257 | { 258 | - 259 | + 260 | return yy_scan_bytes(yystr,(int) strlen(yystr) ); 261 | } 262 | 263 | @@ -1979,7 +1978,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 264 | * scan from a @e copy of @a bytes. 265 | * @param yybytes the byte buffer to scan 266 | * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 267 | - * 268 | + * 269 | * @return the newly allocated buffer state object. 270 | */ 271 | YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) 272 | @@ -1988,7 +1987,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) 273 | char *buf; 274 | yy_size_t n; 275 | int i; 276 | - 277 | + 278 | /* Get memory for full buffer, including space for trailing EOB's. */ 279 | n = (yy_size_t) (_yybytes_len + 2); 280 | buf = (char *) yyalloc(n ); 281 | @@ -2042,16 +2041,16 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ) 282 | /* Accessor methods (get/set functions) to struct members. */ 283 | 284 | /** Get the current line number. 285 | - * 286 | + * 287 | */ 288 | int yyget_lineno (void) 289 | { 290 | - 291 | + 292 | return yylineno; 293 | } 294 | 295 | /** Get the input stream. 296 | - * 297 | + * 298 | */ 299 | FILE *yyget_in (void) 300 | { 301 | @@ -2059,7 +2058,7 @@ FILE *yyget_in (void) 302 | } 303 | 304 | /** Get the output stream. 305 | - * 306 | + * 307 | */ 308 | FILE *yyget_out (void) 309 | { 310 | @@ -2067,7 +2066,7 @@ FILE *yyget_out (void) 311 | } 312 | 313 | /** Get the length of the current token. 314 | - * 315 | + * 316 | */ 317 | int yyget_leng (void) 318 | { 319 | @@ -2075,7 +2074,7 @@ int yyget_leng (void) 320 | } 321 | 322 | /** Get the current token. 323 | - * 324 | + * 325 | */ 326 | 327 | char *yyget_text (void) 328 | @@ -2085,18 +2084,18 @@ char *yyget_text (void) 329 | 330 | /** Set the current line number. 331 | * @param _line_number line number 332 | - * 333 | + * 334 | */ 335 | void yyset_lineno (int _line_number ) 336 | { 337 | - 338 | + 339 | yylineno = _line_number; 340 | } 341 | 342 | /** Set the input stream. This does not discard the current 343 | * input buffer. 344 | * @param _in_str A readable stream. 345 | - * 346 | + * 347 | * @see yy_switch_to_buffer 348 | */ 349 | void yyset_in (FILE * _in_str ) 350 | @@ -2150,7 +2149,7 @@ static int yy_init_globals (void) 351 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 352 | int yylex_destroy (void) 353 | { 354 | - 355 | + 356 | /* Pop the buffer stack, destroying each element. */ 357 | while(YY_CURRENT_BUFFER){ 358 | yy_delete_buffer(YY_CURRENT_BUFFER ); 359 | @@ -2176,7 +2175,7 @@ int yylex_destroy (void) 360 | #ifndef yytext_ptr 361 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 362 | { 363 | - 364 | + 365 | int i; 366 | for ( i = 0; i < n; ++i ) 367 | s1[i] = s2[i]; 368 | @@ -2201,7 +2200,7 @@ void *yyalloc (yy_size_t size ) 369 | 370 | void *yyrealloc (void * ptr, yy_size_t size ) 371 | { 372 | - 373 | + 374 | /* The cast to (char *) in the following accommodates both 375 | * implementations that use char* generic pointers, and those 376 | * that use void* generic pointers. It works with the latter 377 | -- 378 | 2.27.0 379 | 380 | -------------------------------------------------------------------------------- /patches/kernel/0001-arch-arm-configs-Add-default-configuration-for-adrv9.patch: -------------------------------------------------------------------------------- 1 | From c88e222c1b3a3f28caa4f8783577617f2fbbee20 Mon Sep 17 00:00:00 2001 2 | From: Edward Kigwana 3 | Date: Mon, 14 Oct 2019 18:34:07 +0000 4 | Subject: [PATCH] arch: arm: configs: Add default configuration for adrv9364 5 | 6 | Signed-off-by: Edward Kigwana 7 | --- 8 | .../zynq_adrv9361_dij_defconfig | 483 ++++++++++++++++++ 9 | 1 file changed, 483 insertions(+) 10 | create mode 100644 arch/arm/configs/zynq_adrv9361_dij_defconfig 11 | 12 | diff --git a/arch/arm/configs/zynq_adrv9361_dij_defconfig b/arch/arm/configs/zynq_adrv9361_dij_defconfig 13 | new file mode 100644 14 | index 0000000000..b5d51bafd6 15 | --- /dev/null 16 | +++ b/arch/arm/configs/zynq_adrv9361_dij_defconfig 17 | @@ -0,0 +1,483 @@ 18 | +CONFIG_DEFAULT_HOSTNAME="(adrv9364)" 19 | +CONFIG_SYSVIPC=y 20 | +CONFIG_USELIB=y 21 | +CONFIG_IRQ_DOMAIN_DEBUG=y 22 | +CONFIG_GENERIC_IRQ_DEBUGFS=y 23 | +CONFIG_HIGH_RES_TIMERS=y 24 | +CONFIG_BSD_PROCESS_ACCT=y 25 | +CONFIG_BSD_PROCESS_ACCT_V3=y 26 | +CONFIG_IKCONFIG=y 27 | +CONFIG_IKCONFIG_PROC=y 28 | +CONFIG_LOG_BUF_SHIFT=15 29 | +CONFIG_CGROUPS=y 30 | +CONFIG_MEMCG=y 31 | +CONFIG_MEMCG_SWAP=y 32 | +CONFIG_BLK_CGROUP=y 33 | +CONFIG_CGROUP_SCHED=y 34 | +CONFIG_CFS_BANDWIDTH=y 35 | +CONFIG_RT_GROUP_SCHED=y 36 | +CONFIG_CGROUP_PIDS=y 37 | +CONFIG_CGROUP_RDMA=y 38 | +CONFIG_CGROUP_FREEZER=y 39 | +CONFIG_CPUSETS=y 40 | +CONFIG_CGROUP_DEVICE=y 41 | +CONFIG_CGROUP_CPUACCT=y 42 | +CONFIG_CGROUP_PERF=y 43 | +CONFIG_NAMESPACES=y 44 | +CONFIG_USER_NS=y 45 | +CONFIG_SYSCTL_SYSCALL=y 46 | +CONFIG_EMBEDDED=y 47 | +CONFIG_PERF_EVENTS=y 48 | +CONFIG_SLAB=y 49 | +CONFIG_JUMP_LABEL=y 50 | +CONFIG_MODULES=y 51 | +CONFIG_MODULE_UNLOAD=y 52 | +CONFIG_MODULE_FORCE_UNLOAD=y 53 | +CONFIG_MODVERSIONS=y 54 | +CONFIG_BLK_DEV_BSGLIB=y 55 | +CONFIG_ARCH_ZYNQ=y 56 | +CONFIG_PL310_ERRATA_588369=y 57 | +CONFIG_PL310_ERRATA_727915=y 58 | +CONFIG_PL310_ERRATA_769419=y 59 | +# CONFIG_ARM_ERRATA_643719 is not set 60 | +CONFIG_ARM_ERRATA_754322=y 61 | +CONFIG_ARM_ERRATA_754327=y 62 | +CONFIG_ARM_ERRATA_764369=y 63 | +CONFIG_ARM_ERRATA_775420=y 64 | +CONFIG_SMP=y 65 | +CONFIG_SCHED_MC=y 66 | +CONFIG_SCHED_SMT=y 67 | +CONFIG_HOTPLUG_CPU=y 68 | +CONFIG_PREEMPT=y 69 | +CONFIG_HIGHMEM=y 70 | +# CONFIG_HIGHPTE is not set 71 | +# CONFIG_COMPACTION is not set 72 | +CONFIG_CMA=y 73 | +CONFIG_SECCOMP=y 74 | +CONFIG_ZBOOT_ROM_TEXT=0x0 75 | +CONFIG_ZBOOT_ROM_BSS=0x0 76 | +CONFIG_CMDLINE="console=ttyPS0,115200n8 root=/dev/ram rw initrd=0x00800000,16M earlyprintk mtdparts=physmap-flash.0:512K(nor-fsbl),512K(nor-u-boot),5M(nor-linux),9M(nor-user),1M(nor-scratch),-(nor-rootfs)" 77 | +CONFIG_CPU_IDLE=y 78 | +CONFIG_ARM_ZYNQ_CPUIDLE=y 79 | +CONFIG_VFP=y 80 | +CONFIG_NEON=y 81 | +CONFIG_KERNEL_MODE_NEON=y 82 | +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 83 | +# CONFIG_SUSPEND is not set 84 | +CONFIG_PM=y 85 | +CONFIG_NET=y 86 | +CONFIG_PACKET=y 87 | +CONFIG_UNIX=y 88 | +CONFIG_TLS=y 89 | +CONFIG_XFRM_USER=y 90 | +CONFIG_XFRM_SUB_POLICY=y 91 | +CONFIG_XFRM_MIGRATE=y 92 | +CONFIG_INET=y 93 | +CONFIG_IP_MULTICAST=y 94 | +CONFIG_NET_IPIP=y 95 | +CONFIG_NET_IPGRE_DEMUX=y 96 | +CONFIG_NET_IPGRE=y 97 | +CONFIG_NET_IPGRE_BROADCAST=y 98 | +CONFIG_SYN_COOKIES=y 99 | +CONFIG_NET_IPVTI=y 100 | +CONFIG_INET_AH=y 101 | +CONFIG_INET_ESP=y 102 | +CONFIG_INET_IPCOMP=y 103 | +CONFIG_INET6_AH=y 104 | +CONFIG_INET6_ESP=y 105 | +CONFIG_INET6_IPCOMP=y 106 | +CONFIG_IPV6_MIP6=y 107 | +CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y 108 | +CONFIG_IPV6_VTI=y 109 | +CONFIG_IPV6_GRE=y 110 | +CONFIG_IPV6_MULTIPLE_TABLES=y 111 | +CONFIG_NETFILTER=y 112 | +CONFIG_NETFILTER_NETLINK_ACCT=y 113 | +CONFIG_NETFILTER_NETLINK_QUEUE=y 114 | +CONFIG_NETFILTER_NETLINK_LOG=y 115 | +CONFIG_NF_CONNTRACK=y 116 | +CONFIG_NF_LOG_NETDEV=y 117 | +# CONFIG_NF_CONNTRACK_PROCFS is not set 118 | +CONFIG_NF_CONNTRACK_H323=y 119 | +CONFIG_NF_CONNTRACK_SNMP=y 120 | +CONFIG_NF_CONNTRACK_PPTP=y 121 | +CONFIG_NF_CONNTRACK_SIP=y 122 | +CONFIG_NF_CT_NETLINK=y 123 | +CONFIG_NF_TABLES=y 124 | +CONFIG_NF_TABLES_INET=y 125 | +CONFIG_NF_TABLES_NETDEV=y 126 | +CONFIG_NFT_EXTHDR=y 127 | +CONFIG_NFT_META=y 128 | +CONFIG_NFT_RT=y 129 | +CONFIG_NFT_NUMGEN=y 130 | +CONFIG_NFT_SET_RBTREE=y 131 | +CONFIG_NFT_SET_HASH=y 132 | +CONFIG_NFT_SET_BITMAP=y 133 | +CONFIG_NFT_COUNTER=y 134 | +CONFIG_NFT_LOG=y 135 | +CONFIG_NFT_LIMIT=y 136 | +CONFIG_NFT_OBJREF=y 137 | +CONFIG_NFT_QUEUE=y 138 | +CONFIG_NFT_QUOTA=y 139 | +CONFIG_NFT_REJECT=y 140 | +CONFIG_NFT_HASH=y 141 | +CONFIG_NFT_DUP_NETDEV=y 142 | +CONFIG_NFT_FWD_NETDEV=y 143 | +CONFIG_NETFILTER_XT_MATCH_POLICY=y 144 | +CONFIG_IP_SET=y 145 | +CONFIG_IP_SET_BITMAP_IP=y 146 | +CONFIG_IP_SET_BITMAP_IPMAC=y 147 | +CONFIG_IP_SET_BITMAP_PORT=y 148 | +CONFIG_IP_SET_HASH_IP=y 149 | +CONFIG_IP_SET_HASH_IPMARK=y 150 | +CONFIG_IP_SET_HASH_IPPORT=y 151 | +CONFIG_IP_SET_HASH_IPPORTIP=y 152 | +CONFIG_IP_SET_HASH_IPPORTNET=y 153 | +CONFIG_IP_SET_HASH_IPMAC=y 154 | +CONFIG_IP_SET_HASH_MAC=y 155 | +CONFIG_IP_SET_HASH_NETPORTNET=y 156 | +CONFIG_IP_SET_HASH_NET=y 157 | +CONFIG_IP_SET_HASH_NETNET=y 158 | +CONFIG_IP_SET_HASH_NETPORT=y 159 | +CONFIG_IP_SET_HASH_NETIFACE=y 160 | +CONFIG_IP_SET_LIST_SET=y 161 | +CONFIG_NFT_CHAIN_ROUTE_IPV4=y 162 | +CONFIG_NFT_DUP_IPV4=y 163 | +CONFIG_NFT_FIB_IPV4=y 164 | +CONFIG_NF_TABLES_ARP=y 165 | +CONFIG_NF_LOG_ARP=y 166 | +CONFIG_NF_LOG_IPV4=y 167 | +CONFIG_IP_NF_ARPTABLES=y 168 | +CONFIG_IP_NF_ARPFILTER=y 169 | +CONFIG_IP_NF_ARP_MANGLE=y 170 | +CONFIG_NF_CONNTRACK_IPV6=y 171 | +CONFIG_NF_SOCKET_IPV6=y 172 | +CONFIG_NFT_CHAIN_ROUTE_IPV6=y 173 | +CONFIG_NFT_DUP_IPV6=y 174 | +CONFIG_NFT_FIB_IPV6=y 175 | +CONFIG_NF_LOG_IPV6=y 176 | +CONFIG_NF_NAT_IPV6=y 177 | +CONFIG_NFT_CHAIN_NAT_IPV6=y 178 | +CONFIG_NF_NAT_MASQUERADE_IPV6=y 179 | +CONFIG_L2TP=y 180 | +CONFIG_L2TP_V3=y 181 | +CONFIG_L2TP_IP=y 182 | +CONFIG_L2TP_ETH=y 183 | +CONFIG_BT=y 184 | +CONFIG_BT_RFCOMM=y 185 | +CONFIG_BT_RFCOMM_TTY=y 186 | +CONFIG_BT_BNEP=y 187 | +CONFIG_BT_BNEP_MC_FILTER=y 188 | +CONFIG_BT_BNEP_PROTO_FILTER=y 189 | +CONFIG_BT_HIDP=y 190 | +CONFIG_BT_HCIBTSDIO=y 191 | +CONFIG_CFG80211=y 192 | +CONFIG_MAC80211=y 193 | +CONFIG_MAC80211_RC_MINSTREL_VHT=y 194 | +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 195 | +CONFIG_DEVTMPFS=y 196 | +CONFIG_DEVTMPFS_MOUNT=y 197 | +CONFIG_EXTRA_FIRMWARE="adau1761.bin" 198 | +CONFIG_EXTRA_FIRMWARE_DIR="firmware" 199 | +CONFIG_DMA_CMA=y 200 | +CONFIG_CMA_SIZE_MBYTES=128 201 | +CONFIG_CONNECTOR=y 202 | +CONFIG_MTD=y 203 | +CONFIG_MTD_CMDLINE_PARTS=y 204 | +CONFIG_MTD_BLOCK=y 205 | +CONFIG_MTD_CFI=y 206 | +CONFIG_MTD_CFI_AMDSTD=y 207 | +CONFIG_MTD_PHYSMAP=y 208 | +CONFIG_MTD_PHYSMAP_OF=y 209 | +CONFIG_MTD_M25P80=y 210 | +CONFIG_MTD_NAND=y 211 | +CONFIG_MTD_NAND_PL35X=y 212 | +CONFIG_MTD_SPI_NOR=y 213 | +CONFIG_OF_OVERLAY=y 214 | +CONFIG_OF_CONFIGFS=y 215 | +CONFIG_BLK_DEV_LOOP=y 216 | +CONFIG_BLK_DEV_RAM=y 217 | +CONFIG_BLK_DEV_RAM_SIZE=16384 218 | +CONFIG_SRAM=y 219 | +CONFIG_EEPROM_AT24=m 220 | +CONFIG_EEPROM_AT25=y 221 | +CONFIG_MATHWORKS_IP_CORE=y 222 | +CONFIG_MWIPCORE=y 223 | +CONFIG_MWIPCORE_DMA_STREAMING=y 224 | +CONFIG_MWIPCORE_IIO_STREAMING=y 225 | +CONFIG_MATHWORKS_GENERIC_OF=y 226 | +CONFIG_SCSI=y 227 | +CONFIG_BLK_DEV_SD=y 228 | +CONFIG_CHR_DEV_SG=y 229 | +CONFIG_NETDEVICES=y 230 | +CONFIG_MACSEC=y 231 | +CONFIG_TUN=y 232 | +# CONFIG_NET_VENDOR_ALACRITECH is not set 233 | +# CONFIG_NET_VENDOR_AMAZON is not set 234 | +# CONFIG_NET_VENDOR_AQUANTIA is not set 235 | +# CONFIG_NET_VENDOR_ARC is not set 236 | +CONFIG_MACB=y 237 | +# CONFIG_NET_VENDOR_BROADCOM is not set 238 | +# CONFIG_NET_VENDOR_CIRRUS is not set 239 | +# CONFIG_NET_VENDOR_EZCHIP is not set 240 | +# CONFIG_NET_VENDOR_FARADAY is not set 241 | +# CONFIG_NET_VENDOR_HISILICON is not set 242 | +# CONFIG_NET_VENDOR_HUAWEI is not set 243 | +# CONFIG_NET_VENDOR_INTEL is not set 244 | +# CONFIG_NET_VENDOR_MARVELL is not set 245 | +# CONFIG_NET_VENDOR_MELLANOX is not set 246 | +# CONFIG_NET_VENDOR_MICREL is not set 247 | +# CONFIG_NET_VENDOR_MICROCHIP is not set 248 | +# CONFIG_NET_VENDOR_NATSEMI is not set 249 | +# CONFIG_NET_VENDOR_NETRONOME is not set 250 | +# CONFIG_NET_VENDOR_QUALCOMM is not set 251 | +# CONFIG_NET_VENDOR_RENESAS is not set 252 | +# CONFIG_NET_VENDOR_ROCKER is not set 253 | +# CONFIG_NET_VENDOR_SAMSUNG is not set 254 | +# CONFIG_NET_VENDOR_SEEQ is not set 255 | +# CONFIG_NET_VENDOR_SOLARFLARE is not set 256 | +# CONFIG_NET_VENDOR_SMSC is not set 257 | +# CONFIG_NET_VENDOR_STMICRO is not set 258 | +# CONFIG_NET_VENDOR_VIA is not set 259 | +# CONFIG_NET_VENDOR_WIZNET is not set 260 | +# CONFIG_NET_VENDOR_XILINX is not set 261 | +# CONFIG_NET_VENDOR_SYNOPSYS is not set 262 | +CONFIG_MDIO_BITBANG=y 263 | +CONFIG_MARVELL_PHY=y 264 | +CONFIG_PPP=y 265 | +CONFIG_PPP_BSDCOMP=y 266 | +CONFIG_PPP_DEFLATE=y 267 | +CONFIG_PPP_ASYNC=y 268 | +CONFIG_SLIP=y 269 | +CONFIG_SLIP_COMPRESSED=y 270 | +CONFIG_SLIP_SMART=y 271 | +CONFIG_USB_USBNET=y 272 | +# CONFIG_USB_NET_AX8817X is not set 273 | +# CONFIG_USB_NET_AX88179_178A is not set 274 | +CONFIG_USB_NET_CDC_EEM=y 275 | +CONFIG_USB_NET_CDC_MBIM=y 276 | +# CONFIG_USB_NET_NET1080 is not set 277 | +# CONFIG_USB_NET_CDC_SUBSET is not set 278 | +# CONFIG_USB_NET_ZAURUS is not set 279 | +CONFIG_USB_NET_QMI_WWAN=y 280 | +CONFIG_USB_SIERRA_NET=y 281 | +# CONFIG_WLAN_VENDOR_ADMTEK is not set 282 | +# CONFIG_WLAN_VENDOR_ATH is not set 283 | +# CONFIG_WLAN_VENDOR_ATMEL is not set 284 | +# CONFIG_WLAN_VENDOR_BROADCOM is not set 285 | +# CONFIG_WLAN_VENDOR_CISCO is not set 286 | +# CONFIG_WLAN_VENDOR_INTEL is not set 287 | +# CONFIG_WLAN_VENDOR_INTERSIL is not set 288 | +# CONFIG_WLAN_VENDOR_MARVELL is not set 289 | +# CONFIG_WLAN_VENDOR_MEDIATEK is not set 290 | +# CONFIG_WLAN_VENDOR_RALINK is not set 291 | +# CONFIG_WLAN_VENDOR_REALTEK is not set 292 | +CONFIG_RSI_91X=m 293 | +# CONFIG_RSI_USB is not set 294 | +# CONFIG_WLAN_VENDOR_ST is not set 295 | +# CONFIG_WLAN_VENDOR_TI is not set 296 | +# CONFIG_WLAN_VENDOR_ZYDAS is not set 297 | +# CONFIG_WLAN_VENDOR_QUANTENNA is not set 298 | +CONFIG_INPUT_FF_MEMLESS=y 299 | +CONFIG_INPUT_SPARSEKMAP=y 300 | +CONFIG_INPUT_MOUSEDEV=y 301 | +CONFIG_INPUT_MOUSEDEV_PSAUX=y 302 | +CONFIG_INPUT_EVDEV=y 303 | +CONFIG_KEYBOARD_GPIO=y 304 | +CONFIG_KEYBOARD_GPIO_POLLED=y 305 | +# CONFIG_INPUT_MOUSE is not set 306 | +CONFIG_INPUT_MISC=y 307 | +CONFIG_INPUT_UINPUT=y 308 | +CONFIG_VT_HW_CONSOLE_BINDING=y 309 | +# CONFIG_LEGACY_PTYS is not set 310 | +CONFIG_SERIAL_UARTLITE=y 311 | +CONFIG_SERIAL_XILINX_PS_UART=y 312 | +CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y 313 | +# CONFIG_HW_RANDOM is not set 314 | +CONFIG_TCG_TPM=y 315 | +CONFIG_TCG_TIS_SPI=y 316 | +CONFIG_AXI_INTR_MONITOR=y 317 | +CONFIG_I2C=y 318 | +CONFIG_I2C_CHARDEV=y 319 | +CONFIG_I2C_MUX=y 320 | +CONFIG_I2C_MUX_GPIO=y 321 | +CONFIG_I2C_MUX_GPMUX=y 322 | +CONFIG_I2C_MUX_PCA954x=y 323 | +CONFIG_I2C_CADENCE=y 324 | +CONFIG_I2C_GPIO=y 325 | +CONFIG_I2C_XILINX=y 326 | +CONFIG_SPI=y 327 | +CONFIG_SPI_AXI_SPI_ENGINE=y 328 | +CONFIG_SPI_CADENCE=y 329 | +CONFIG_SPI_XILINX=y 330 | +CONFIG_SPI_ZYNQ_QSPI=y 331 | +CONFIG_SPI_SPIDEV=y 332 | +CONFIG_PPS_CLIENT_LDISC=y 333 | +CONFIG_PPS_CLIENT_GPIO=y 334 | +CONFIG_PINCTRL_SINGLE=y 335 | +CONFIG_GPIOLIB=y 336 | +CONFIG_GPIO_SYSFS=y 337 | +CONFIG_GPIO_GENERIC_PLATFORM=y 338 | +CONFIG_GPIO_XILINX=y 339 | +CONFIG_GPIO_ZYNQ=y 340 | +CONFIG_GPIO_MAX7300=y 341 | +CONFIG_GPIO_PCA953X=y 342 | +CONFIG_POWER_RESET=y 343 | +CONFIG_POWER_RESET_GPIO=y 344 | +CONFIG_POWER_RESET_RESTART=y 345 | +CONFIG_GENERIC_ADC_BATTERY=y 346 | +CONFIG_PMBUS=m 347 | +CONFIG_THERMAL=y 348 | +CONFIG_WATCHDOG=y 349 | +CONFIG_XILINX_WATCHDOG=y 350 | +CONFIG_CADENCE_WATCHDOG=y 351 | +CONFIG_REGULATOR=y 352 | +CONFIG_REGULATOR_FIXED_VOLTAGE=y 353 | +CONFIG_REGULATOR_VIRTUAL_CONSUMER=y 354 | +CONFIG_REGULATOR_USERSPACE_CONSUMER=y 355 | +CONFIG_REGULATOR_GPIO=y 356 | +CONFIG_REGULATOR_VCTRL=y 357 | +# CONFIG_RC_CORE is not set 358 | +CONFIG_SOUND=y 359 | +CONFIG_SND=y 360 | +# CONFIG_SND_SUPPORT_OLD_API is not set 361 | +# CONFIG_SND_VERBOSE_PROCFS is not set 362 | +# CONFIG_SND_DRIVERS is not set 363 | +CONFIG_SND_HDA_PREALLOC_SIZE=2048 364 | +# CONFIG_SND_ARM is not set 365 | +# CONFIG_SND_SPI is not set 366 | +# CONFIG_SND_USB is not set 367 | +CONFIG_SND_SOC=m 368 | +CONFIG_SND_SOC_ADI=m 369 | +CONFIG_SND_SOC_ADI_AXI_I2S=m 370 | +CONFIG_SND_SOC_ADRV936X_BOX=m 371 | +CONFIG_SND_SOC_ADAU1701=m 372 | +CONFIG_SND_SIMPLE_CARD=m 373 | +CONFIG_HID_BATTERY_STRENGTH=y 374 | +CONFIG_HIDRAW=y 375 | +CONFIG_USB_HIDDEV=y 376 | +CONFIG_USB=y 377 | +CONFIG_USB_OTG=y 378 | +CONFIG_USB_EHCI_HCD=y 379 | +# CONFIG_USB_EHCI_TT_NEWSCHED is not set 380 | +CONFIG_USB_ACM=y 381 | +CONFIG_USB_TMC=y 382 | +CONFIG_USB_STORAGE=y 383 | +CONFIG_USB_CHIPIDEA=y 384 | +CONFIG_USB_CHIPIDEA_UDC=y 385 | +CONFIG_USB_CHIPIDEA_HOST=y 386 | +CONFIG_USB_SERIAL=y 387 | +CONFIG_USB_SERIAL_GENERIC=y 388 | +CONFIG_USB_SERIAL_CP210X=y 389 | +CONFIG_USB_SERIAL_FTDI_SIO=y 390 | +CONFIG_USB_SERIAL_QUALCOMM=y 391 | +CONFIG_USB_SERIAL_SIERRAWIRELESS=y 392 | +CONFIG_USB_ULPI=y 393 | +CONFIG_USB_GADGET=y 394 | +CONFIG_USB_GADGET_XILINX=y 395 | +CONFIG_USB_CONFIGFS=y 396 | +CONFIG_USB_CONFIGFS_ACM=y 397 | +CONFIG_USB_CONFIGFS_F_FS=y 398 | +CONFIG_USB_ULPI_BUS=y 399 | +CONFIG_MMC=y 400 | +CONFIG_SDIO_UART=y 401 | +CONFIG_MMC_SDHCI=y 402 | +CONFIG_MMC_SDHCI_PLTFM=y 403 | +CONFIG_MMC_SDHCI_OF_ARASAN=y 404 | +CONFIG_NEW_LEDS=y 405 | +CONFIG_LEDS_CLASS=y 406 | +CONFIG_LEDS_GPIO=y 407 | +CONFIG_LEDS_TRIGGERS=y 408 | +CONFIG_LEDS_TRIGGER_TIMER=y 409 | +CONFIG_LEDS_TRIGGER_ONESHOT=y 410 | +CONFIG_LEDS_TRIGGER_HEARTBEAT=y 411 | +CONFIG_LEDS_TRIGGER_CPU=y 412 | +CONFIG_EDAC=y 413 | +CONFIG_RTC_CLASS=y 414 | +CONFIG_RTC_DRV_DS1307=y 415 | +# CONFIG_RTC_DRV_DS1307_HWMON is not set 416 | +CONFIG_RTC_DRV_DS1307_CENTURY=y 417 | +CONFIG_DMADEVICES=y 418 | +CONFIG_AXI_DMAC=y 419 | +CONFIG_PL330_DMA=y 420 | +CONFIG_XILINX_DMA=y 421 | +CONFIG_SYNC_FILE=y 422 | +CONFIG_AUXDISPLAY=y 423 | +CONFIG_UIO=y 424 | +CONFIG_UIO_PDRV_GENIRQ=y 425 | +CONFIG_UIO_DMEM_GENIRQ=y 426 | +CONFIG_UIO_XILINX_APM=y 427 | +CONFIG_STAGING=y 428 | +CONFIG_XILINX_FCLK=m 429 | +CONFIG_COMMON_CLK_AXI_CLKGEN=y 430 | +# CONFIG_IOMMU_SUPPORT is not set 431 | +CONFIG_MEMORY=y 432 | +CONFIG_IIO=y 433 | +CONFIG_IIO_CONFIGFS=y 434 | +CONFIG_AD7291=m 435 | +CONFIG_CF_AXI_ADC=y 436 | +CONFIG_AD9361=y 437 | +CONFIG_CF_AXI_TDD=y 438 | +CONFIG_MAX1363=m 439 | +CONFIG_XILINX_XADC=y 440 | +CONFIG_CF_AXI_DDS=y 441 | +CONFIG_ADF4360=m 442 | +CONFIG_XILINX_INTC=y 443 | +CONFIG_GENERIC_PHY=y 444 | +CONFIG_RAS=y 445 | +CONFIG_FPGA=y 446 | +CONFIG_FPGA_MGR_ZYNQ_FPGA=y 447 | +CONFIG_EXT4_FS=y 448 | +CONFIG_EXT4_FS_POSIX_ACL=y 449 | +CONFIG_EXT4_ENCRYPTION=y 450 | +CONFIG_F2FS_FS=y 451 | +CONFIG_F2FS_CHECK_FS=y 452 | +CONFIG_F2FS_FS_ENCRYPTION=y 453 | +CONFIG_FANOTIFY=y 454 | +CONFIG_FUSE_FS=y 455 | +CONFIG_MSDOS_FS=y 456 | +CONFIG_VFAT_FS=y 457 | +CONFIG_TMPFS=y 458 | +CONFIG_TMPFS_POSIX_ACL=y 459 | +CONFIG_NFS_FS=y 460 | +# CONFIG_NFS_V2 is not set 461 | +# CONFIG_NFS_V3 is not set 462 | +CONFIG_NFS_V4=y 463 | +CONFIG_NFS_V4_1=y 464 | +CONFIG_NFS_V4_2=y 465 | +CONFIG_NLS_CODEPAGE_437=y 466 | +CONFIG_NLS_ASCII=y 467 | +CONFIG_NLS_ISO8859_1=y 468 | +CONFIG_DYNAMIC_DEBUG=y 469 | +CONFIG_DEBUG_INFO=y 470 | +# CONFIG_ENABLE_WARN_DEPRECATED is not set 471 | +# CONFIG_ENABLE_MUST_CHECK is not set 472 | +CONFIG_DEBUG_FS=y 473 | +CONFIG_DETECT_HUNG_TASK=y 474 | +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=20 475 | +# CONFIG_SCHED_DEBUG is not set 476 | +# CONFIG_DEBUG_PREEMPT is not set 477 | +CONFIG_RCU_CPU_STALL_TIMEOUT=60 478 | +# CONFIG_FTRACE is not set 479 | +CONFIG_DEBUG_LL=y 480 | +CONFIG_DEBUG_ZYNQ_UART1=y 481 | +CONFIG_EARLY_PRINTK=y 482 | +CONFIG_TRUSTED_KEYS=y 483 | +CONFIG_ENCRYPTED_KEYS=y 484 | +CONFIG_KEY_DH_OPERATIONS=y 485 | +CONFIG_CRYPTO_DRBG_HASH=y 486 | +CONFIG_CRYPTO_DRBG_CTR=y 487 | +CONFIG_ASYMMETRIC_KEY_TYPE=y 488 | +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y 489 | +CONFIG_X509_CERTIFICATE_PARSER=y 490 | +CONFIG_PKCS7_MESSAGE_PARSER=y 491 | +CONFIG_SYSTEM_TRUSTED_KEYRING=y 492 | +CONFIG_SYSTEM_EXTRA_CERTIFICATE=y 493 | +CONFIG_SECONDARY_TRUSTED_KEYRING=y 494 | +CONFIG_SYSTEM_BLACKLIST_KEYRING=y 495 | +CONFIG_ARM_CRYPTO=y 496 | +CONFIG_CRYPTO_SHA1_ARM_NEON=y 497 | +CONFIG_CRYPTO_SHA256_ARM=y 498 | +CONFIG_CRYPTO_SHA512_ARM=y 499 | +CONFIG_CRYPTO_AES_ARM_BS=y 500 | +CONFIG_CRYPTO_GHASH_ARM_CE=y 501 | -- 502 | 2.23.0 503 | 504 | -------------------------------------------------------------------------------- /doc/LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | --------------------------------------------------------------------------------