summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone-sdt/recipes-applications/peripheral-tests/peripheral-tests_2024.1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-standalone-sdt/recipes-applications/peripheral-tests/peripheral-tests_2024.1.bb')
-rw-r--r--meta-xilinx-standalone-sdt/recipes-applications/peripheral-tests/peripheral-tests_2024.1.bb53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta-xilinx-standalone-sdt/recipes-applications/peripheral-tests/peripheral-tests_2024.1.bb b/meta-xilinx-standalone-sdt/recipes-applications/peripheral-tests/peripheral-tests_2024.1.bb
new file mode 100644
index 00000000..d2fb106a
--- /dev/null
+++ b/meta-xilinx-standalone-sdt/recipes-applications/peripheral-tests/peripheral-tests_2024.1.bb
@@ -0,0 +1,53 @@
1inherit esw python3native esw_apps_common
2
3ESW_COMPONENT_SRC = "/lib/sw_apps/peripheral_tests/src/"
4
5DEPENDS += "libxil xiltimer"
6
7ESW_EXECUTABLE_NAME = "peripheral_tests"
8
9do_configure:prepend() {
10 (
11 cd ${S}
12 lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC}
13 install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/
14 cp -rf ${S}/scripts/linker_files/ ${S}/${ESW_COMPONENT_SRC}/linker_files
15 install -m 0644 ${S}/cmake/UserConfig.cmake ${S}/${ESW_COMPONENT_SRC}
16 )
17}
18
19python do_generate_app_data() {
20 import glob, subprocess, os
21
22 system_dt = glob.glob(d.getVar('DTS_FILE'))
23 srcdir = glob.glob(d.getVar('S'))
24 src_dir = glob.glob(d.getVar('OECMAKE_SOURCEPATH'))
25 machine = d.getVar('ESW_MACHINE')
26
27 if len(system_dt) == 0:
28 bb.error("Couldn't find device tree %s" % d.getVar('DTS_FILE'))
29
30 if len(src_dir) == 0:
31 bb.error("Couldn't find source dir %s" % d.getVar('OECMAKE_SOURCEPATH'))
32
33 driver_name = d.getVar('REQUIRED_MACHINE_FEATURES')
34 command = ["lopper"] + ["-f"] + ["-O"] + [src_dir[0]] + [system_dt[0]] + ["--"] + ["baremetal_gentestapp_xlnx"] + [machine] + [srcdir[0]]
35 subprocess.run(command, check = True)
36}
37addtask do_generate_app_data before do_configure after do_prepare_recipe_sysroot
38do_prepare_recipe_sysroot[rdeptask] = "do_unpack"
39
40do_compile:append() {
41 ${OBJCOPY} -O binary ${B}/${ESW_EXECUTABLE_NAME}.elf ${B}${ESW_EXECUTABLE_NAME}.bin
42}
43
44do_install() {
45 :
46}
47
48do_deploy() {
49 install -Dm 0644 ${B}/${ESW_EXECUTABLE_NAME}.elf ${DEPLOYDIR}/${APP_IMAGE_NAME}.elf
50 ln -sf ${APP_IMAGE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}-${BB_CURRENT_MC}.elf
51 install -m 0644 ${B}/${ESW_EXECUTABLE_NAME}.bin ${DEPLOYDIR}/${APP_IMAGE_NAME}.bin
52 ln -sf ${APP_IMAGE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}-${BB_CURRENT_MC}.bin
53}