Jetson TX2 installing the operating system of ubuntu 16.04 can't compile xilinx PCIe card's driver

PCIe Card using Xilinx XDMA IP is inserted into the PCIe card slot of Jetson TX2.TX2 can recognize the PCIe card,but the driver provided by Xilinx can't complie successfully on the TX2 installing ubuntu 16.04. The PCIe driver can complie successfully on PC installing the OS of ubuntu 16.04.
Why does it appear? How should I solve this problem? Thank you very much.

You’d need to post the compile error (along with a few lines of non-error prior to the error). Also how you configured the kernel before compile (I prefer using “/proc/config.gz” as a starting point so it matches the existing system).

Sorry,I am not familiar with driver development.Below is compile error
nvidia@tegra-ubuntu:~/wrj/Xilinx_Answer_65444_Linux_Files/driver$ make
make -C /lib/modules/4.4.38-tegra/build M=/home/nvidia/wrj/Xilinx_Answer_65444_Linux_Files/driver modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.4.38-tegra’
CC [M] /home/nvidia/wrj/Xilinx_Answer_65444_Linux_Files/driver/xdma-core.o
scripts/basic/fixdep: 1: scripts/basic/fixdep: Syntax error: “(” unexpected
scripts/Makefile.build:261: recipe for target ‘/home/nvidia/wrj/Xilinx_Answer_65444_Linux_Files/driver/xdma-core.o’ failed
make[2]: *** [/home/nvidia/wrj/Xilinx_Answer_65444_Linux_Files/driver/xdma-core.o] Error 2
Makefile:1414: recipe for target ‘module/home/nvidia/wrj/Xilinx_Answer_65444_Linux_Files/driver’ failed
make[1]: *** [module/home/nvidia/wrj/Xilinx_Answer_65444_Linux_Files/driver] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.4.38-tegra’
Makefile:16: recipe for target ‘all’ failed
make: *** [all] Error 2

Here are some of the config file.

Automatically generated file; DO NOT EDIT.

Linux/arm64 4.4.38 Kernel Configuration

CONFIG_ARM64=y

CONFIG_ARCH_TEGRA_210_SOC is not set

CONFIG_ARCH_TEGRA_APE=y
CONFIG_ARCH_TEGRA_18x_SOC_PRIVATE=y
CONFIG_ARCH_TEGRA_18x_SOC=y
CONFIG_ARCH_TEGRA_19x_SOC=y
CONFIG_64BIT=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ZONE_DMA=y
CONFIG_HAVE_GENERIC_RCU_GUP=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_SMP=y

CONFIG_IOMMU_HELPER is not set

CONFIG_ARM_DMA_USE_IOMMU=y
CONFIG_KERNEL_MODE_NEON=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=3
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

General setup

CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""

CONFIG_COMPILE_TEST is not set

CONFIG_LOCALVERSION=""

CONFIG_LOCALVERSION_AUTO is not set

CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_FHANDLE=y
CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y

IRQ subsystem

CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
CONFIG_HANDLE_DOMAIN_IRQ=y

CONFIG_IRQ_DOMAIN_DEBUG is not set

CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_ARCH_HAS_TICK_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y

Timers subsystem

CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y

CONFIG_HZ_PERIODIC is not set

CONFIG_NO_HZ_IDLE=y

CONFIG_NO_HZ_FULL is not set

CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y

CPU/Task time and stats accounting

CONFIG_TICK_CPU_ACCOUNTING=y

CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set

CONFIG_BSD_PROCESS_ACCT is not set

CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y

RCU Subsystem

CONFIG_PREEMPT_RCU=y

CONFIG_RCU_EXPERT is not set

CONFIG_SRCU=y

CONFIG_TASKS_RCU is not set

CONFIG_RCU_STALL_COMMON=y

CONFIG_TREE_RCU_TRACE is not set

CONFIG_RCU_EXPEDITE_BOOT is not set

CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_CAPACTIY_AWARE_DEFAULT_ENABLED=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_SWAP_ENABLED=y
CONFIG_MEMCG_KMEM=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_BLK_CGROUP=y

CONFIG_DEBUG_BLK_CGROUP is not set

CONFIG_CGROUP_WRITEBACK=y

CONFIG_CHECKPOINT_RESTORE is not set

CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y

CONFIG_SCHED_AUTOGROUP is not set

CONFIG_SYSFS_DEPRECATED is not set

CONFIG_RELAY is not set

CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y

CONFIG_CC_OPTIMIZE_FOR_SIZE is not set

CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_BPF=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_MULTIUSER=y

CONFIG_SGETMASK_SYSCALL is not set

CONFIG_SYSFS_SYSCALL=y

CONFIG_SYSCTL_SYSCALL is not set

CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y

CONFIG_BPF_SYSCALL is not set

CONFIG_SHMEM=y
CONFIG_SHMEM_ALL_RAM=y
CONFIG_AIO=y
CONFIG_ADVISE_SYSCALLS=y

CONFIG_USERFAULTFD is not set

CONFIG_PCI_QUIRKS=y
CONFIG_MEMBARRIER=y
CONFIG_EMBEDDED=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y

Kernel Performance Events And Counters

CONFIG_PERF_EVENTS=y

CONFIG_DEBUG_PERF_USE_VMALLOC is not set

CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
CONFIG_COMPAT_BRK=y

CONFIG_SLAB is not set

CONFIG_SLUB=y

CONFIG_SLOB is not set

CONFIG_SLUB_CPU_PARTIAL=y

CONFIG_SYSTEM_DATA_VERIFICATION is not set

CONFIG_PROFILING is not set

CONFIG_TRACEPOINTS=y

CONFIG_JUMP_LABEL is not set

CONFIG_UPROBES is not set

CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set

CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_RCU_TABLE_FREE=y
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP_FILTER=y
CONFIG_HAVE_CC_STACKPROTECTOR=y

CONFIG_CC_STACKPROTECTOR is not set

CONFIG_CC_STACKPROTECTOR_NONE=y

CONFIG_CC_STACKPROTECTOR_REGULAR is not set

CONFIG_CC_STACKPROTECTOR_STRONG is not set

CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_ARCH_MMAP_RND_BITS=18
CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
CONFIG_CLONE_BACKWARDS=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y

GCOV-based kernel profiling

CONFIG_GCOV_KERNEL is not set

CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y

CONFIG_GCOV_ANDROID_TOOLCHAIN is not set

CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y

CONFIG_MODULE_FORCE_LOAD is not set

CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y

CONFIG_MODVERSIONS is not set

CONFIG_MODULE_SRCVERSION_ALL is not set

CONFIG_MODULE_SIG is not set

CONFIG_MODULE_COMPRESS is not set

CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y

CONFIG_BLK_DEV_BSG is not set

CONFIG_BLK_DEV_BSGLIB is not set

CONFIG_BLK_DEV_INTEGRITY is not set

CONFIG_BLK_DEV_THROTTLING=y

CONFIG_BLK_CMDLINE_PARSER is not set

Partition Types

CONFIG_PARTITION_ADVANCED=y

CONFIG_ACORN_PARTITION is not set

CONFIG_AIX_PARTITION is not set

CONFIG_OSF_PARTITION is not set

CONFIG_AMIGA_PARTITION is not set

CONFIG_ATARI_PARTITION is not set

CONFIG_MAC_PARTITION is not set

CONFIG_MSDOS_PARTITION=y

CONFIG_BSD_DISKLABEL is not set

CONFIG_MINIX_SUBPARTITION is not set

CONFIG_SOLARIS_X86_PARTITION is not set

CONFIG_UNIXWARE_DISKLABEL is not set

CONFIG_LDM_PARTITION is not set

CONFIG_SGI_PARTITION is not set

CONFIG_ULTRIX_PARTITION is not set

CONFIG_SUN_PARTITION is not set

CONFIG_KARMA_PARTITION is not set

CONFIG_EFI_PARTITION=y

CONFIG_SYSV68_PARTITION is not set

CONFIG_CMDLINE_PARTITION is not set

CONFIG_BLOCK_COMPAT=y

IO Schedulers

CONFIG_IOSCHED_NOOP=y

CONFIG_IOSCHED_DEADLINE is not set

CONFIG_IOSCHED_CFQ=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_DEFAULT_CFQ=y

CONFIG_DEFAULT_NOOP is not set

CONFIG_DEFAULT_IOSCHED=“cfq”
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_FREEZER=y

Platform selection

CONFIG_ARCH_BCM_IPROC is not set

CONFIG_ARCH_BERLIN is not set

CONFIG_ARCH_EXYNOS7 is not set

CONFIG_ARCH_LAYERSCAPE is not set

CONFIG_ARCH_HISI is not set

CONFIG_ARCH_MEDIATEK is not set

CONFIG_ARCH_QCOM is not set

CONFIG_ARCH_ROCKCHIP is not set

CONFIG_ARCH_SEATTLE is not set

CONFIG_ARCH_STRATIX10 is not set

CONFIG_ARCH_TEGRA=y

CONFIG_ARCH_TEGRA_132_SOC is not set

CONFIG_ARCH_SPRD is not set

CONFIG_ARCH_THUNDER is not set

CONFIG_ARCH_VEXPRESS is not set

CONFIG_ARCH_XGENE is not set

CONFIG_ARCH_ZYNQMP is not set

Bus support

CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_SYSCALL=y
CONFIG_PCI_BUS_ADDR_T_64BIT=y
CONFIG_PCI_MSI=y
CONFIG_PCI_MSI_IRQ_DOMAIN=y

CONFIG_PCI_DEBUG is not set

CONFIG_PCI_REALLOC_ENABLE_AUTO is not set

CONFIG_PCI_STUB is not set

CONFIG_PCI_IOV is not set

CONFIG_PCI_PRI is not set

CONFIG_PCI_PASID is not set

PCI host controller drivers

CONFIG_PCI_TEGRA=m

CONFIG_PCI_HOST_GENERIC is not set

CONFIG_PCIE_IPROC is not set

CONFIG_PCI_HISI is not set

CONFIG_PCIEPORTBUS=y
CONFIG_PCIEAER=y

CONFIG_PCIE_ECRC is not set

CONFIG_PCIEAER_INJECT is not set

CONFIG_PCIEASPM is not set

CONFIG_PCIE_PME=y

CONFIG_HOTPLUG_PCI is not set

What was the starting config? Is this built out of tree? If so, what configuration was done within the Xilinx code itself? Is the Xilinx code part of the existing kernel and not in need of out-of-tree build? If the Xilinx code is out-of-tree, where is it publicly downloadable at?

Basically I’m trying to find out if your starting configuration was a match to your existing system. Then I’m trying to find out if the Xilinx code was built against properly configured headers, or if it instead ended up pointing at headers which hadn’t been through the “prepare” step to match the running configuration.

It isn’t so much about driver development as it is realizing what has to be done to build an existing kernel to match what is already running, and then to compile the Xilinx code against that tree. Kernel source alone says very little about whether something will work or not…how configuration is set up needs to be known before any conclusion can be reached.

Here is some information on kernel builds in general. Being able to do this, and then to point any out-of-tree module to that particular source would be how you start:
https://devtalk.nvidia.com/default/topic/1038175/jetson-tx2/tx2i-wifi-support/post/5274619/#5274619

you just need root