From bf738f3461a6ff9bc375ca013e129cd00f3c8992 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Sat, 18 Dec 2021 14:31:28 -0800 Subject: Adjust generic BSPs to support the inheritance model Each inherited BSP must set a MACHINEOVERRIDES and PACKAGE_EXTRA_ARCHS to ensure that various overrides can be set along the way. The general format for this is (in the caller): require conf/machine/.conf The callee is responsible for adding to the MACHINEOVERRIDES and PACKAGE_EXTRA_ARCHS. It does this by setting the following at the beginning and end of the file, respectively. MACHINEOVERRIDES =. "${@['', ':']['' != '${MACHINE}']}" ... ... PACKAGE_EXTRA_ARCHS_append = "${@['', ' ']['' != '${MACHINE}']}" where is the .conf file the line appears in; is the .replace('-', '_') (matching MACHINE_ARCH) if the machine file was used by itself. The MACHINEOVERRIDES uses =. or .= everywhere in the Yocto Project. Doing it via =. in the load order ensures in order evaluation. PACKAGE_EXTRA_ARCHS is set via 'append', but needs to be the last operation to ensure that we are always added AFTER anything we include along the way. Effectively this is a late binding evaluation. Signed-off-by: Mark Hatle --- meta-xilinx-core/conf/machine/versal-generic.conf | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'meta-xilinx-core/conf/machine/versal-generic.conf') diff --git a/meta-xilinx-core/conf/machine/versal-generic.conf b/meta-xilinx-core/conf/machine/versal-generic.conf index a5d99b75..3509d8c4 100644 --- a/meta-xilinx-core/conf/machine/versal-generic.conf +++ b/meta-xilinx-core/conf/machine/versal-generic.conf @@ -7,6 +7,10 @@ USE_BOARD = "${@"conf/machine/include/xilinx-board-pre.inc" if d.getVar("BOARD") require ${USE_BOARD} unset USE_BOARD +#### Preamble +MACHINEOVERRIDES =. "${@['', 'versal-generic:']['versal-generic' != '${MACHINE}']}" +#### Regular settings follow + require conf/machine/include/soc-versal.inc require conf/machine/include/machine-xilinx-default.inc require conf/machine/include/machine-xilinx-qemu.inc @@ -89,6 +93,10 @@ QB_PLM_OPT = " \ " QB_OPT_APPEND:append:qemuboot-xilinx = " -plm-args '${QB_PLM_OPT}'" +#### No additional settings should be after the Postamble +#### Postamble +PACKAGE_EXTRA_ARCHS:append = "${@['', ' versal_generic']['versal-generic' != "${MACHINE}"]}" + # Deprecated board config USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" require ${USE_BOARD} -- cgit v1.2.3-54-g00ecf