diff options
author | Mark Hatle <mark.hatle@xilinx.com> | 2021-03-16 14:02:00 -0700 |
---|---|---|
committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2021-09-27 21:30:10 -0700 |
commit | ac0516ce7916796fbde8a20db8c179b77dc92bdc (patch) | |
tree | 00e54739768b100f129500eab217f26dce74d4d0 /meta-xilinx-standalone-experimental/classes | |
parent | 58c8191477d70802bf0a88180a0f731f8179731f (diff) | |
download | meta-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.bbclass | 52 | ||||
-rw-r--r-- | meta-xilinx-standalone-experimental/classes/esw_examples.bbclass | 12 |
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 @@ | |||
1 | inherit pkgconfig cmake | ||
2 | |||
3 | LICENSE = "Proprietary" | ||
4 | LICFILENAME = "license.txt" | ||
5 | LIC_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 |
8 | include conf/xilinx/esw-srcrev.inc | 2 | include conf/xilinx/esw-srcrev.inc |
9 | 3 | ||
10 | SRCREV ?= "${AUTOREV}" | 4 | inherit xlnx-embeddedsw pkgconfig cmake |
11 | PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}" | ||
12 | REPO ?= "git://github.com/xilinx/embeddedsw.git;protocol=https" | ||
13 | BRANCH ?= "master" | ||
14 | SRC_URI = "${REPO};branch=${BRANCH}" | ||
15 | 5 | ||
16 | SRCREV_FORMAT = "src_decouple" | 6 | SRCREV_FORMAT = "src_decouple" |
17 | 7 | ||
@@ -23,6 +13,8 @@ SPECFILE_PATH_arm = "${S}/scripts/specs/arm/Xilinx.spec" | |||
23 | SPECFILE_PATH_aarch64 = "${S}/scripts/specs/arm/Xilinx.spec" | 13 | SPECFILE_PATH_aarch64 = "${S}/scripts/specs/arm/Xilinx.spec" |
24 | SPECFILE_PATH_microblaze = "${S}/scripts/specs/microblaze/Xilinx.spec" | 14 | SPECFILE_PATH_microblaze = "${S}/scripts/specs/microblaze/Xilinx.spec" |
25 | 15 | ||
16 | ESW_MACHINE ?= "${MACHINE}" | ||
17 | |||
26 | ESW_CFLAGS += "-specs=${SPECFILE_PATH}" | 18 | ESW_CFLAGS += "-specs=${SPECFILE_PATH}" |
27 | 19 | ||
28 | inherit ccmake | 20 | inherit ccmake |
@@ -30,7 +22,14 @@ inherit ccmake | |||
30 | COMPATIBLE_HOST = ".*-elf" | 22 | COMPATIBLE_HOST = ".*-elf" |
31 | COMPATIBLE_HOST_arm = "[^-]*-[^-]*-eabi" | 23 | COMPATIBLE_HOST_arm = "[^-]*-[^-]*-eabi" |
32 | 24 | ||
33 | DTBFILE ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" | 25 | DTS_FILE = "${DEPLOY_DIR_IMAGE}/${ESW_MACHINE}-baremetal.dtb" |
26 | |||
27 | DEPENDS += "python3-pyyaml-native lopper-native device-tree-lops python3-dtc-native" | ||
28 | |||
29 | # We need the deployed output | ||
30 | do_configure[depends] += "device-tree-lops:do_deploy" | ||
31 | do_compile[depends] += "device-tree-lops:do_deploy" | ||
32 | do_install[depends] += "device-tree-lops:do_deploy" | ||
34 | 33 | ||
35 | def get_xlnx_cmake_machine(fam, d): | 34 | def 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 | ||
64 | XLNX_CMAKE_MACHINE = "${@get_xlnx_cmake_machine(d.getVar('SOC_FAMILY'), d)}" | 63 | XLNX_CMAKE_MACHINE = "${@get_xlnx_cmake_machine(d.getVar('SOC_FAMILY'), d)}" |
65 | XLNX_CMAKE_PROCESSOR = "${@get_xlnx_cmake_processor(d.getVar('DEFAULTTUNE'), d.getVar('MACHINE'), d)}" | 64 | XLNX_CMAKE_PROCESSOR = "${@get_xlnx_cmake_processor(d.getVar('DEFAULTTUNE'), d.getVar('ESW_MACHINE'), d)}" |
66 | XLNX_CMAKE_SYSTEM_NAME ?= "Generic" | 65 | XLNX_CMAKE_SYSTEM_NAME ?= "Generic" |
67 | 66 | ||
68 | cmake_do_generate_toolchain_file_append() { | 67 | cmake_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 | |||
107 | do_generate_driver_data[dirs] = "${B}" | ||
108 | do_generate_driver_data[depends] += "device-tree-lops:do_deploy" | ||
109 | python 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 @@ | |||
1 | inherit esw deploy python3native | 1 | inherit esw deploy python3native |
2 | 2 | ||
3 | DEPENDS += "dtc-native python3-dtc-native python3-pyyaml-native xilstandalone libxil xiltimer device-tree" | 3 | DEPENDS += "python3-dtc-native python3-pyyaml-native xilstandalone libxil xiltimer" |
4 | 4 | ||
5 | do_configure_prepend() { | 5 | do_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 | ||
10 | do_generate_eglist () { | 12 | do_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 | } |
14 | addtask generate_eglist before do_configure after do_prepare_recipe_sysroot | 17 | addtask generate_eglist before do_configure after do_prepare_recipe_sysroot |
15 | do_prepare_recipe_sysroot[rdeptask] = "do_unpack" | 18 | do_prepare_recipe_sysroot[rdeptask] = "do_unpack" |
@@ -20,7 +23,8 @@ do_install() { | |||
20 | } | 23 | } |
21 | 24 | ||
22 | do_deploy() { | 25 | do_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 | } |
25 | addtask deploy before do_build after do_package | 29 | addtask deploy before do_build after do_package |
26 | 30 | ||