Skip to content

Commit 1d98f89

Browse files
committed
meta-xilinx-standalone: Rework embeddedsw integration
Introduce a new embeddedsw-source recipe that is a single point for unpack, and patch of the sources. This will allow someone to universally patch (via a bbappend or similar) the esw sources. As part of this work, we transfered the various patches for fsbl, pmu, plm, and psm to the universe source recipe. Most of this is transparent to any recipe using xlnx-embeddedsw. The class automaticaly detects if the recipe is a user our the special embeddedsw-source recipe and enables the correct behavior. Since the esw sources expect the S and B to be the same, the cmake objects get written into S, we are not able to follow the gcc-source example. Instead recipes that use the xlnx-embeddedsw class will hard link or copy the source files to their working directory. This avoid the penalty for fetch, unpack and patch. Note these recipes may also add their own SRC_URI which WILL be processed as normal. This is often used to introduce special tcl scripts. See the do_copy_shared_src task injected by the xlnx-embeddedsw.bbclass for technical details. Additionally, correct some of the existing patch Upstream-Status entries to conform to current YP guidelines. For 2024.2 introduce a special Xil_Assert fix for the current toolchain which is more strict on type conversion.. See the patch itself for more details. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
1 parent fc65196 commit 1d98f89

File tree

48 files changed

+169
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+169
-158
lines changed

meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ OECMAKE_ARGS:remove = "-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON"
88

99
SRCREV_FORMAT = "src_decouple"
1010

11-
S = "${UNPACKDIR}/git"
12-
B = "${WORKDIR}/build"
1311
OECMAKE_SOURCEPATH = "${S}/${ESW_COMPONENT_SRC}"
1412
LICFILENAME = "license.txt"
1513

meta-xilinx-standalone-sdt/recipes-bsp/embeddedsw/esw-conf_2024.1.bb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Can't depend on esw since this is needed for setup!
22
inherit xlnx-embeddedsw
33

4-
S = "${UNPACKDIR}/git"
5-
B = "${WORKDIR}/build"
6-
74
INHIBIT_DEFAULT_DEPS = "1"
85

96
# Installing this recipe should install the lopper tools and such

meta-xilinx-standalone-sdt/recipes-bsp/embeddedsw/esw-conf_2024.2.bb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Can't depend on esw since this is needed for setup!
22
inherit xlnx-embeddedsw
33

4-
S = "${UNPACKDIR}/git"
5-
B = "${WORKDIR}/build"
6-
74
INHIBIT_DEFAULT_DEPS = "1"
85

96
# Installing this recipe should install the lopper tools and such

meta-xilinx-standalone-sdt/recipes-libraries/xilstandalone_2024.2.bb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ ESW_COMPONENT_NAME = "libxilstandalone.a"
55

66
DEPENDS += "libgloss"
77

8+
S = "${B}"
9+
810
do_configure:prepend() {
911
# This script should also not rely on relative paths and such
10-
(
11-
cd ${S}
12-
lopper ${DTS_FILE} -- baremetal_bspconfig_xlnx ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC}
13-
install -m 0755 MemConfig.cmake ${S}/${ESW_COMPONENT_SRC}/
14-
install -m 0755 *.c ${S}/${ESW_COMPONENT_SRC}
15-
lopper ${DTS_FILE} -- bmcmake_metadata_xlnx ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} hwcmake_metadata ${S}
16-
install -m 0755 StandaloneExample.cmake ${S}/${ESW_COMPONENT_SRC}/common/
17-
LOPPER_DTC_FLAGS="-b 0 -@" lopper ${DTS_FILE} -- baremetal_xparameters_xlnx.py ${ESW_MACHINE} ${S}
18-
install -m 0755 xparameters.h ${S}/${ESW_COMPONENT_SRC}/common/
19-
)
12+
lopper ${DTS_FILE} -- baremetal_bspconfig_xlnx ${ESW_MACHINE} ${B}/${ESW_COMPONENT_SRC}
13+
install -m 0755 MemConfig.cmake ${B}/${ESW_COMPONENT_SRC}/
14+
install -m 0755 *.c ${B}/${ESW_COMPONENT_SRC}
15+
lopper ${DTS_FILE} -- bmcmake_metadata_xlnx ${ESW_MACHINE} ${B}/${ESW_COMPONENT_SRC} hwcmake_metadata ${B}
16+
install -m 0755 StandaloneExample.cmake ${B}/${ESW_COMPONENT_SRC}/common/
17+
LOPPER_DTC_FLAGS="-b 0 -@" lopper ${DTS_FILE} -- baremetal_xparameters_xlnx.py ${ESW_MACHINE} ${B}
18+
install -m 0755 xparameters.h ${B}/${ESW_COMPONENT_SRC}/common/
2019

2120
}

meta-xilinx-standalone/classes/xlnx-embeddedsw.bbclass

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ LIC_FILES_CHKSUM[xlnx_rel_v2024.1] = '0dcabd3719e5ac33f7c03f0d77d473f2'
3535
LIC_FILES_CHKSUM[xlnx_rel_v2024.2] = '689662801a76c14d0cb57ae169cbec7c'
3636
LIC_FILES_CHKSUM ??= "file://license.txt;md5=${@d.getVarFlag('LIC_FILES_CHKSUM', d.getVar('BRANCH')) or '0'}"
3737

38-
SRC_URI = "${EMBEDDEDSW_SRCURI}"
3938
PV .= "+git"
4039

4140
python() {
@@ -47,3 +46,24 @@ python() {
4746
except:
4847
raise bb.parse.SkipRecipe('BB_NO_NETWORK is enabled, can not fetch SRCREV (%s)' % d.getVar('SRCREV'))
4948
}
49+
50+
SHARED_S = "${TMPDIR}/work-shared/embeddedsw-${PV}-${PR}/source/git"
51+
S = "${WORKDIR}/source"
52+
B = "${WORKDIR}/build"
53+
54+
ERROR_QA:remove = "buildpaths"
55+
56+
# The following is for recipes that use the common sources
57+
python do_copy_shared_src() {
58+
src = d.getVar('SHARED_S')
59+
dest = d.getVar('S')
60+
if src != dest:
61+
oe.path.copyhardlinktree(src, dest)
62+
}
63+
64+
python() {
65+
if d.getVar('BPN') != "embeddedsw-source":
66+
bb.build.addtask('do_copy_shared_src', 'do_configure do_populate_lic do_deploy_source_date_epoch', 'do_patch', d)
67+
68+
d.appendVarFlag('do_copy_shared_src', 'depends', ' embeddedsw-source-${PV}:do_patch')
69+
}

meta-xilinx-standalone/conf/distro/xilinx-standalone.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ DISTRO_VERSION = "1.0"
33
TARGET_VENDOR = "-xilinx"
44

55
TCLIBC = "newlib"
6-
TCLIBCAPPEND =""
76

87
# Change SDK name
98
SDK_VERSION = "xilinx-standalone"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
deltask do_configure
2+
deltask do_compile
3+
deltask do_install
4+
deltask do_populate_sysroot
5+
deltask do_populate_lic
6+
RM_WORK_EXCLUDE += "${PN}"
7+
8+
inherit xlnx-embeddedsw nopackages
9+
10+
COMPATIBLE_HOST = ".*"
11+
COMPATIBLE_MACHINE = ".*"
12+
13+
PN = "embeddedsw-source-${PV}"
14+
WORKDIR = "${TMPDIR}/work-shared/embeddedsw-${PV}-${PR}"
15+
SSTATE_SWSPEC = "sstate:embeddedsw::${PV}:${PR}::${SSTATE_VERSION}:"
16+
17+
STAMP = "${STAMPS_DIR}/work-shared/embeddedsw-${PV}-${PR}"
18+
STAMPCLEAN = "${STAMPS_DIR}/work-shared/embeddedsw-${PV}-*"
19+
20+
INHIBIT_DEFAULT_DEPS = "1"
21+
DEPENDS = ""
22+
PACKAGES = ""
23+
TARGET_ARCH = "allarch"
24+
TARGET_AS_ARCH = "none"
25+
TARGET_CC_ARCH = "none"
26+
TARGET_LD_ARCH = "none"
27+
TARGET_OS = "linux"
28+
baselib = "lib"
29+
PACKAGE_ARCH = "all"
30+
31+
UNPACKDIR = "${WORKDIR}/source"
32+
S = "${SHARED_S}"
33+
B = "${WORKDIR}/build"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require recipes-bsp/embeddedsw/embeddedsw-source.inc
2+
3+
4+
BPN = "embeddedsw-source"
5+
EXCLUDE_FROM_WORLD = "1"
6+
7+
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw/${PV}:${FILE_DIRNAME}/embeddedsw"
8+
9+
SRC_URI = " \
10+
${EMBEDDEDSW_SRCURI} \
11+
file://makefile-skip-copy_bsp.sh.patch \
12+
file://fsbl-fixups.patch \
13+
file://0001-versal_fw-Fixup-core-makefiles.patch \
14+
"
15+
16+
# file://fix-xil-assert-filename.patch \
17+
#
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require recipes-bsp/embeddedsw/embeddedsw-source.inc
2+
3+
4+
BPN = "embeddedsw-source"
5+
EXCLUDE_FROM_WORLD = "1"
6+
7+
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw/${PV}:${FILE_DIRNAME}/embeddedsw"
8+
9+
SRC_URI = " \
10+
${EMBEDDEDSW_SRCURI} \
11+
file://makefile-skip-copy_bsp.sh.patch \
12+
file://fsbl-fixups.patch \
13+
file://0001-versal_fw-Fixup-core-makefiles.patch \
14+
"
15+
16+
# file://fix-xil-assert-filename.patch \
17+
#
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require recipes-bsp/embeddedsw/embeddedsw-source.inc
2+
3+
4+
BPN = "embeddedsw-source"
5+
EXCLUDE_FROM_WORLD = "1"
6+
7+
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw/${PV}:${FILE_DIRNAME}/embeddedsw"
8+
9+
SRC_URI = " \
10+
${EMBEDDEDSW_SRCURI} \
11+
file://makefile-skip-copy_bsp.sh.patch \
12+
file://fsbl-fixups.patch \
13+
file://0001-versal_fw-Fixup-core-makefiles.patch \
14+
"
15+
16+
# file://fix-xil-assert-filename.patch \
17+
#

0 commit comments

Comments
 (0)