summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAppana Durga Kedareswara rao <appana.durga.rao@xilinx.com>2021-04-07 16:03:50 +0530
committerSai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>2021-09-27 21:33:21 -0700
commitaede5eaa25f673dd20b7dc969750772c88da1915 (patch)
tree79f81c64e79dd1acf2fd1e940aa51048bcb5bba2
parent86b18ccdead121b0d03a7145ddb81cb116182abe (diff)
downloadmeta-xilinx-aede5eaa25f673dd20b7dc969750772c88da1915.tar.gz
meta-xilinx-standalone-experimental: recipes-applications: peripheral-tests: Add recipe for peripheral test
This recipe does the below --> Generates the required meta-data files for the periheral test. --> Compiles the peripheral test application. Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
-rw-r--r--meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb
new file mode 100644
index 00000000..22bf3d64
--- /dev/null
+++ b/meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb
@@ -0,0 +1,63 @@
1inherit esw deploy
2
3ESW_COMPONENT_SRC = "/lib/sw_apps/peripheral_tests/src/"
4
5DEPENDS += "libxil xiltimer"
6
7inherit python3native
8
9do_configure_prepend() {
10 cd ${S}
11 lopper.py ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC}
12 install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/
13 install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/
14}
15
16python do_generate_app_data() {
17 import glob, subprocess, os
18
19 system_dt = glob.glob(d.getVar('DTS_FILE'))
20 srcdir = glob.glob(d.getVar('S'))
21 src_dir = glob.glob(d.getVar('OECMAKE_SOURCEPATH'))
22 machine = d.getVar('ESW_MACHINE')
23
24 if len(system_dt) == 0:
25 bb.error("Couldn't find device tree %s" % d.getVar('DTS_FILE'))
26
27 if len(src_dir) == 0:
28 bb.error("Couldn't find source dir %s" % d.getVar('OECMAKE_SOURCEPATH'))
29
30 driver_name = d.getVar('REQUIRED_DISTRO_FEATURES')
31 command = ["lopper.py"] + ["-f"] + [system_dt[0]] + ["--"] + ["baremetal_gentestapp_xlnx"] + [machine] + [srcdir[0]]
32 subprocess.run(command, check = True)
33 with open("file_list.txt", 'r') as fd:
34 for line in fd:
35 command = ["install"] + ["-m"] + ["0755"] + [line.strip()] + [src_dir[0]]
36 subprocess.run(command, check = True)
37}
38addtask do_generate_app_data before do_configure after do_prepare_recipe_sysroot
39do_prepare_recipe_sysroot[rdeptask] = "do_unpack"
40
41PERIPHERAL_TEST_APP_IMAGE_NAME ??= "peripheral-tests"
42
43inherit image-artifact-names
44
45PERIPHERAL_TEST_BASE_NAME ?= "${PERIPHERAL_TEST_APP_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
46
47ESW_COMPONENT ??= "executable.elf"
48
49do_compile_append() {
50 ${OBJCOPY} -O binary ${B}/${ESW_COMPONENT} ${B}/executable.bin
51}
52
53do_install() {
54 :
55}
56
57do_deploy() {
58 install -Dm 0644 ${B}/${ESW_COMPONENT} ${DEPLOYDIR}/${PERIPHERAL_TEST_BASE_NAME}.elf
59 ln -sf ${PERIPHERAL_TEST_BASE_NAME}.elf ${DEPLOYDIR}/${PERIPHERAL_TEST_APP_IMAGE_NAME}.elf
60 install -m 0644 ${B}/executable.bin ${DEPLOYDIR}/${PERIPHERAL_TEST_BASE_NAME}.bin
61 ln -sf ${PERIPHERAL_TEST_BASE_NAME}.bin ${DEPLOYDIR}/${PERIPHERAL_TEST_APP_IMAGE_NAME}.bin
62}
63addtask deploy before do_build after do_install