diff options
Diffstat (limited to 'meta-xilinx-standalone-experimental/classes/esw.bbclass')
| -rw-r--r-- | meta-xilinx-standalone-experimental/classes/esw.bbclass | 52 |
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 @@ | |||
| 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 | } | ||
