summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone/classes
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@kernel.crashing.org>2021-01-23 16:35:15 -0600
committerSai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>2021-07-14 14:48:56 -0700
commit40d304b9534ce9912f9027c14bf97842daccb4ad (patch)
tree516c1b671926d8e4636f34b60dafcf5039f19791 /meta-xilinx-standalone/classes
parent1b5863a50cfbb6c6450a9062d17dd4330fc7bbd0 (diff)
downloadmeta-xilinx-40d304b9534ce9912f9027c14bf97842daccb4ad.tar.gz
Reorganize the various layer components
Machines: Move baremetal machines to meta-xilinx-standalone Layers: - Add new meta-xilinx-standalone-experimental This layer may require components that may not yet be available to the general public. It will contain various experiemntal integration work. - meta-xilinx-standalone This layer should be functional and contain the necessary items to build a baremetal toolchain that can use libxil (replacement to libgloss) from the Xilinx embeddedsw components. (Note, libxil is NOT built as part of this work!) The layer also contains the buildable components for the various firmware components required to startup various Xilinx FPGAs. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Diffstat (limited to 'meta-xilinx-standalone/classes')
-rw-r--r--meta-xilinx-standalone/classes/esw.bbclass106
-rw-r--r--meta-xilinx-standalone/classes/esw_examples.bbclass27
2 files changed, 0 insertions, 133 deletions
diff --git a/meta-xilinx-standalone/classes/esw.bbclass b/meta-xilinx-standalone/classes/esw.bbclass
deleted file mode 100644
index 1f7e35f4..00000000
--- a/meta-xilinx-standalone/classes/esw.bbclass
+++ /dev/null
@@ -1,106 +0,0 @@
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
8include conf/xilinx/esw-srcrev.inc
9
10SRCREV ?= "${AUTOREV}"
11PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}"
12REPO ?= "git://github.com/xilinx/embeddedsw.git;protocol=https"
13BRANCH ?= "master"
14SRC_URI = "${REPO};branch=${BRANCH}"
15
16SRCREV_FORMAT = "src_decouple"
17
18S = "${WORKDIR}/git"
19B = "${WORKDIR}/build"
20OECMAKE_SOURCEPATH = "${S}/${ESW_COMPONENT_SRC}"
21
22SPECFILE_PATH_arm = "${S}/scripts/specs/arm/Xilinx.spec"
23SPECFILE_PATH_aarch64 = "${S}/scripts/specs/arm/Xilinx.spec"
24SPECFILE_PATH_microblaze = "${S}/scripts/specs/microblaze/Xilinx.spec"
25
26ESW_CFLAGS += "-specs=${SPECFILE_PATH}"
27
28inherit ccmake
29
30COMPATIBLE_HOST = ".*-elf"
31COMPATIBLE_HOST_arm = "[^-]*-[^-]*-eabi"
32
33DTBFILE ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb"
34
35def get_xlnx_cmake_machine(fam, d):
36 cmake_machine = fam
37 if (fam == 'zynqmp'):
38 cmake_machine = 'ZynqMP'
39 elif (fam == 'versal'):
40 cmake_machine = 'Versal'
41 elif (fam == 'zynq'):
42 cmake_machine = 'Zynq'
43 return cmake_machine
44
45def get_xlnx_cmake_processor(tune, machine, d):
46 cmake_processor = tune
47 if tune.startswith('microblaze'):
48 if (machine == 'microblaze-pmu'):
49 cmake_processor = 'pmu_microblaze'
50 elif (machine == 'microblaze-plm'):
51 cmake_processor = 'plm_microblaze'
52 else:
53 cmake_processor = 'microblaze'
54 elif (tune in [ 'cortexr5', 'cortexr5f' ]):
55 cmake_processor = 'cortexr5'
56 elif tune.startswith('cortexa9'):
57 cmake_processor = 'cortexa9'
58 elif (tune in [ 'cortexa53', 'cortexa72-cortexa53' ]):
59 cmake_processor = 'cortexa53'
60 elif tune == 'cortexa72':
61 cmake_processor = 'cortexa72'
62 return cmake_processor
63
64XLNX_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)}"
66XLNX_CMAKE_SYSTEM_NAME ?= "Generic"
67
68cmake_do_generate_toolchain_file_append() {
69 cat >> ${WORKDIR}/toolchain.cmake <<EOF
70 include(CMakeForceCompiler)
71 CMAKE_FORCE_C_COMPILER("${OECMAKE_C_COMPILER}" GNU)
72 CMAKE_FORCE_CXX_COMPILER("${OECMAKE_CXX_COMPILER}" GNU)
73 set( CMAKE_SYSTEM_PROCESSOR "${XLNX_CMAKE_PROCESSOR}" )
74 set( CMAKE_MACHINE "${XLNX_CMAKE_MACHINE}" )
75 # Will need this in the future to make cmake understand esw variables
76 # set( CMAKE_SYSTEM_NAME `echo elf | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
77 set( CMAKE_SYSTEM_NAME "${XLNX_CMAKE_SYSTEM_NAME}" )
78EOF
79}
80
81do_install() {
82 install -d ${D}${libdir}
83 install -d ${D}${includedir}
84 install -m 0755 ${B}/${ESW_COMPONENT_NAME} ${D}${libdir}
85 install -m 0644 ${B}/include/*.h ${D}${includedir}
86}
87
88CFLAGS_append = " ${ESW_CFLAGS}"
89
90# We need to find the license file, which vaires depending on the component
91# recurse a maximum of x times, could be fancier but it gets complicated since
92# we dont know for certain we are running devtool or just externalsrc
93python(){
94 import os.path
95 if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC'):
96 externalsrc = d.getVar('EXTERNALSRC')
97 lic_file = d.getVar('LIC_FILES_CHKSUM', False)
98 licpath=externalsrc
99 for i in range(5):
100 if os.path.isfile(licpath + '/' + d.getVar('LICFILENAME',True)):
101 lic_file = lic_file.replace('${S}',licpath)
102 d.setVar('LIC_FILES_CHKSUM', lic_file)
103 return
104 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))
106}
diff --git a/meta-xilinx-standalone/classes/esw_examples.bbclass b/meta-xilinx-standalone/classes/esw_examples.bbclass
deleted file mode 100644
index 391f388e..00000000
--- a/meta-xilinx-standalone/classes/esw_examples.bbclass
+++ /dev/null
@@ -1,27 +0,0 @@
1inherit esw deploy python3native
2
3DEPENDS += "dtc-native python3-dtc-native python3-pyyaml-native xilstandalone libxil xiltimer device-tree"
4
5do_configure_prepend() {
6 cd ${S}
7 nativepython3 ${S}/scripts/linker_gen.py -d ${DTBFILE} -o ${OECMAKE_SOURCEPATH}
8}
9
10do_generate_eglist () {
11 cd ${S}
12 nativepython3 ${S}/scripts/example.py -d ${DTBFILE} -o ${OECMAKE_SOURCEPATH}
13}
14addtask generate_eglist before do_configure after do_prepare_recipe_sysroot
15do_prepare_recipe_sysroot[rdeptask] = "do_unpack"
16
17do_install() {
18 install -d ${D}/${base_libdir}/firmware
19 install -m 0755 ${B}/*.elf ${D}/${base_libdir}/firmware
20}
21
22do_deploy() {
23 install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/
24}
25addtask deploy before do_build after do_package
26
27FILES_${PN} = "${base_libdir}/firmware/*.elf"