summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone-experimental/classes
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2021-03-16 14:02:00 -0700
committerSai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>2021-09-27 21:30:10 -0700
commitac0516ce7916796fbde8a20db8c179b77dc92bdc (patch)
tree00e54739768b100f129500eab217f26dce74d4d0 /meta-xilinx-standalone-experimental/classes
parent58c8191477d70802bf0a88180a0f731f8179731f (diff)
downloadmeta-xilinx-ac0516ce7916796fbde8a20db8c179b77dc92bdc.tar.gz
meta-xilinx-standalone-experimental: Adjust to match recent changes
Changes to meta-xilinx-standalone, as well as the embeddedsw require various changes to be made. This brings the implementation up to the current level. Note: various things do not yet compile! Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-xilinx-standalone-experimental/classes')
-rw-r--r--meta-xilinx-standalone-experimental/classes/esw.bbclass52
-rw-r--r--meta-xilinx-standalone-experimental/classes/esw_examples.bbclass12
2 files changed, 47 insertions, 17 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}
diff --git a/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass b/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass
index 391f388e..9b116e9e 100644
--- a/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass
+++ b/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass
@@ -1,15 +1,18 @@
1inherit esw deploy python3native 1inherit esw deploy python3native
2 2
3DEPENDS += "dtc-native python3-dtc-native python3-pyyaml-native xilstandalone libxil xiltimer device-tree" 3DEPENDS += "python3-dtc-native python3-pyyaml-native xilstandalone libxil xiltimer"
4 4
5do_configure_prepend() { 5do_configure_prepend() {
6 cd ${S} 6 cd ${S}
7 nativepython3 ${S}/scripts/linker_gen.py -d ${DTBFILE} -o ${OECMAKE_SOURCEPATH} 7 lopper.py ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC}
8 install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/
9 install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/
8} 10}
9 11
10do_generate_eglist () { 12do_generate_eglist () {
11 cd ${S} 13 cd ${S}
12 nativepython3 ${S}/scripts/example.py -d ${DTBFILE} -o ${OECMAKE_SOURCEPATH} 14 lopper.py ${DTS_FILE} -- bmcmake_metadata_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} drvcmake_metadata
15 install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/
13} 16}
14addtask generate_eglist before do_configure after do_prepare_recipe_sysroot 17addtask generate_eglist before do_configure after do_prepare_recipe_sysroot
15do_prepare_recipe_sysroot[rdeptask] = "do_unpack" 18do_prepare_recipe_sysroot[rdeptask] = "do_unpack"
@@ -20,7 +23,8 @@ do_install() {
20} 23}
21 24
22do_deploy() { 25do_deploy() {
23 install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/ 26 install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/
27 install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/
24} 28}
25addtask deploy before do_build after do_package 29addtask deploy before do_build after do_package
26 30