Skip to content

Commit

Permalink
Merge pull request #31 from EmbeddedCamerata/ospp
Browse files Browse the repository at this point in the history
开源之夏2023:基于Zynq MPSoC,尝试支持Xilinx Vitis AI的DPU驱动
  • Loading branch information
yc66542260 authored Oct 31, 2023
2 parents 9c1a1cc + 2075307 commit 8de812f
Show file tree
Hide file tree
Showing 70 changed files with 1,963 additions and 0 deletions.
49 changes: 49 additions & 0 deletions RT-AK/rt_ai_tools/platforms/drivers/dpu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# makefile for DPU driver outside the linux kernel tree, and generate dpu.ko file
#
# a typical command for build the driver for Zynq 7000:
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KERNELDIR=/path/to/your/kernel
#
# a typical command for build the driver for UltraScale+:
# make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- KERNELDIR=/path/to/your/kernel
#
modname:=dpu
obj-m:=$(modname).o
dpu-objs:=dpucore.o

PWD :=$(shell pwd)
MAKE :=make


KCFLAGS=KCFLAGS="
ifeq ($(DPU_TARGET),1.1)
KCFLAGS +=-DCONFIG_DPU_v1_1_X
else
KCFLAGS +=-DCONFIG_DPU_v1_3_0
endif

ifeq ($(ARCH),arm)
KCFLAGS +=-DSIG_BASE_ADDR=0X4FF00000 -DCACHE_OFF
endif
ifeq ($(ARCH),arm64)
KCFLAGS +=-DSIG_BASE_ADDR=0X8FF00000
endif

# check the compiler version
GCCV1 := $(shell $(CROSS_COMPILE)gcc -dumpversion | cut -f1 -d. )
GCCV2 := $(shell $(CROSS_COMPILE)gcc -dumpversion | cut -f2 -d. )
GCCV3 := $(shell expr `echo $(GCCV1)"*100+"$(GCCV2) | bc` )

DT_FLAG := $(shell expr `echo $(GCCV3)` \>= 409)
ifeq ($(DT_FLAG),1)
KCFLAGS += -Wno-error=date-time -Wno-date-time
endif
KCFLAGS+="

all:
$(KCFLAGS) $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNELDIR) M=$(PWD) modules

clean:
rm -rf $(modname).ko *.o *mod* \.*cmd *odule* .tmp_versions

.PHONY: all clean

675 changes: 675 additions & 0 deletions RT-AK/rt_ai_tools/platforms/drivers/dpu/README.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions RT-AK/rt_ai_tools/platforms/drivers/dpu/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# RT-Thread building script for component

from building import *

cwd = GetCurrentDir()
CPPPATH = [cwd]

src = Split("""dpucore.c""")

group = DefineGroup('dpu', src, depend = [''], CPPPATH = CPPPATH)

objs = [group]

Return('objs')
Loading

0 comments on commit 8de812f

Please sign in to comment.