summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone-experimental/classes/esw.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-standalone-experimental/classes/esw.bbclass')
-rw-r--r--meta-xilinx-standalone-experimental/classes/esw.bbclass52
1 files changed, 39 insertions, 13 deletions
diff --git a/meta-xilinx-standalone-experimental/classes/esw.bbclass b/meta-xilinx-standalone-experimental/classes/esw.bbclass
index 1f7e35f4..682752dd 100644
--- a/meta-xilinx-standalone-experimental/classes/esw.bbclass
+++ b/meta-xilinx-standalone-experimental/classes/esw.bbclass
@@ -1,17 +1,7 @@
1inherit pkgconfig cmake
2
3LICENSE = "Proprietary"
4LICFILENAME = "license.txt"
5LIC_FILES_CHKSUM = "file://${S}/${LICFILENAME};md5=39ab6ab638f4d1836ba994ec6852de94"
6
7# We should move to an actual SRCREV eventually 1# We should move to an actual SRCREV eventually
8include conf/xilinx/esw-srcrev.inc 2include conf/xilinx/esw-srcrev.inc
9 3
10SRCREV ?= "${AUTOREV}" 4inherit xlnx-embeddedsw pkgconfig cmake
11PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}"
12REPO ?= "git://github.com/xilinx/embeddedsw.git;protocol=https"
13BRANCH ?= "master"
14SRC_URI = "${REPO};branch=${BRANCH}"
15 5
16SRCREV_FORMAT = "src_decouple" 6SRCREV_FORMAT = "src_decouple"
17 7
@@ -23,6 +13,8 @@ SPECFILE_PATH_arm = "${S}/scripts/specs/arm/Xilinx.spec"
23SPECFILE_PATH_aarch64 = "${S}/scripts/specs/arm/Xilinx.spec" 13SPECFILE_PATH_aarch64 = "${S}/scripts/specs/arm/Xilinx.spec"
24SPECFILE_PATH_microblaze = "${S}/scripts/specs/microblaze/Xilinx.spec" 14SPECFILE_PATH_microblaze = "${S}/scripts/specs/microblaze/Xilinx.spec"
25 15
16ESW_MACHINE ?= "${MACHINE}"
17
26ESW_CFLAGS += "-specs=${SPECFILE_PATH}" 18ESW_CFLAGS += "-specs=${SPECFILE_PATH}"
27 19
28inherit ccmake 20inherit ccmake
@@ -30,7 +22,14 @@ inherit ccmake
30COMPATIBLE_HOST = ".*-elf" 22COMPATIBLE_HOST = ".*-elf"
31COMPATIBLE_HOST_arm = "[^-]*-[^-]*-eabi" 23COMPATIBLE_HOST_arm = "[^-]*-[^-]*-eabi"
32 24
33DTBFILE ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" 25DTS_FILE = "${DEPLOY_DIR_IMAGE}/${ESW_MACHINE}-baremetal.dtb"
26
27DEPENDS += "python3-pyyaml-native lopper-native device-tree-lops python3-dtc-native"
28
29# We need the deployed output
30do_configure[depends] += "device-tree-lops:do_deploy"
31do_compile[depends] += "device-tree-lops:do_deploy"
32do_install[depends] += "device-tree-lops:do_deploy"
34 33
35def get_xlnx_cmake_machine(fam, d): 34def get_xlnx_cmake_machine(fam, d):
36 cmake_machine = fam 35 cmake_machine = fam
@@ -62,7 +61,7 @@ def get_xlnx_cmake_processor(tune, machine, d):
62 return cmake_processor 61 return cmake_processor
63 62
64XLNX_CMAKE_MACHINE = "${@get_xlnx_cmake_machine(d.getVar('SOC_FAMILY'), d)}" 63XLNX_CMAKE_MACHINE = "${@get_xlnx_cmake_machine(d.getVar('SOC_FAMILY'), d)}"
65XLNX_CMAKE_PROCESSOR = "${@get_xlnx_cmake_processor(d.getVar('DEFAULTTUNE'), d.getVar('MACHINE'), d)}" 64XLNX_CMAKE_PROCESSOR = "${@get_xlnx_cmake_processor(d.getVar('DEFAULTTUNE'), d.getVar('ESW_MACHINE'), d)}"
66XLNX_CMAKE_SYSTEM_NAME ?= "Generic" 65XLNX_CMAKE_SYSTEM_NAME ?= "Generic"
67 66
68cmake_do_generate_toolchain_file_append() { 67cmake_do_generate_toolchain_file_append() {
@@ -104,3 +103,30 @@ python(){
104 licpath=os.path.dirname(licpath) 103 licpath=os.path.dirname(licpath)
105 bb.error("Couldn't find license file: %s, within directory %s or his parent directories" % (d.getVar('LICFILENAME',True), externalsrc)) 104 bb.error("Couldn't find license file: %s, within directory %s or his parent directories" % (d.getVar('LICFILENAME',True), externalsrc))
106} 105}
106
107do_generate_driver_data[dirs] = "${B}"
108do_generate_driver_data[depends] += "device-tree-lops:do_deploy"
109python do_generate_driver_data() {
110 import glob, subprocess, os
111
112 system_dt = glob.glob(d.getVar('DTS_FILE'))
113 src_dir = glob.glob(d.getVar('OECMAKE_SOURCEPATH'))
114 machine = d.getVar('ESW_MACHINE')
115
116 driver_name = d.getVar('REQUIRED_DISTRO_FEATURES')
117
118 if len(system_dt) == 0:
119 bb.error("Couldn't find device tree %s" % d.getVar('DTS_FILE'))
120
121 if len(src_dir) == 0:
122 bb.error("Couldn't find source dir %s" % d.getVar('OECMAKE_SOURCEPATH'))
123
124 os.chdir(d.getVar('B'))
125 command = ["lopper.py"] + ["-f"] + [system_dt[0]] + ["--"] + ["baremetalconfig_xlnx.py"] + [machine] + [src_dir[0]]
126 subprocess.run(command, check = True)
127 src_file = str("x") + driver_name.replace('-', '_') + str("_g.c")
128 if os.path.exists(src_file):
129 bb.note("Generated config file for driver %s" % driver_name)
130 command = ["install"] + ["-m"] + ["0755"] + [src_file] + [src_dir[0]]
131 subprocess.run(command, check = True)
132}