diff options
| author | Mark Hatle <mark.hatle@xilinx.com> | 2021-12-18 14:31:28 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@xilinx.com> | 2022-01-14 15:37:05 -0800 |
| commit | 81a6bfd7943bafb4b26db650ad2af453868d60f0 (patch) | |
| tree | c8d3e0a9e7a3869e2cb7d19823681cbdb2f3591c | |
| parent | 4501eaa3c6eac161ec0aaec87d7b648361552912 (diff) | |
| download | meta-xilinx-81a6bfd7943bafb4b26db650ad2af453868d60f0.tar.gz | |
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/<inherited 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>:']['<machine>' != '${MACHINE}']}"
...
...
PACKAGE_EXTRA_ARCHS_append = "${@['', ' <machine_arch>']['<machine>' != '${MACHINE}']}"
where <machine> is the <machine>.conf file the line appears in;
<machine_arch> is the <machine>.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 <mark.hatle@xilinx.com>
4 files changed, 32 insertions, 0 deletions
diff --git a/meta-xilinx-core/conf/machine/microblaze-generic.conf b/meta-xilinx-core/conf/machine/microblaze-generic.conf index 0ba5b80a..9004282a 100644 --- a/meta-xilinx-core/conf/machine/microblaze-generic.conf +++ b/meta-xilinx-core/conf/machine/microblaze-generic.conf | |||
| @@ -7,6 +7,10 @@ USE_BOARD = "${@"conf/machine/include/xilinx-board-pre.inc" if d.getVar("BOARD") | |||
| 7 | require ${USE_BOARD} | 7 | require ${USE_BOARD} |
| 8 | unset USE_BOARD | 8 | unset USE_BOARD |
| 9 | 9 | ||
| 10 | #### Preamble | ||
| 11 | MACHINEOVERRIDES =. "${@['', 'microblaze-generic:']['microblaze-generic' != '${MACHINE}']}" | ||
| 12 | #### Regular settings follow | ||
| 13 | |||
| 10 | # Set the default for a modern full feature microblaze... | 14 | # Set the default for a modern full feature microblaze... |
| 11 | TUNE_FEATURES:tune-microblaze ?= "microblaze v11.0 barrel-shift pattern-compare reorder divide-hard multiply-high" | 15 | TUNE_FEATURES:tune-microblaze ?= "microblaze v11.0 barrel-shift pattern-compare reorder divide-hard multiply-high" |
| 12 | DEFAULTTUNE ?= "microblaze" | 16 | DEFAULTTUNE ?= "microblaze" |
| @@ -35,6 +39,10 @@ EXTRA_IMAGEDEPENDS += "libyaml-native python3-cython-native python3-pyyaml-nativ | |||
| 35 | UBOOT_MACHINE ?= "microblaze-generic_defconfig" | 39 | UBOOT_MACHINE ?= "microblaze-generic_defconfig" |
| 36 | UBOOT_INITIAL_ENV = "" | 40 | UBOOT_INITIAL_ENV = "" |
| 37 | 41 | ||
| 42 | #### No additional settings should be after the Postamble | ||
| 43 | #### Postamble | ||
| 44 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' ${MB_MACHINE_ARCH}']['microblaze-generic' != "${MACHINE}"]}" | ||
| 45 | |||
| 38 | # Deprecated board config | 46 | # Deprecated board config |
| 39 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" | 47 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" |
| 40 | require ${USE_BOARD} | 48 | require ${USE_BOARD} |
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") | |||
| 7 | require ${USE_BOARD} | 7 | require ${USE_BOARD} |
| 8 | unset USE_BOARD | 8 | unset USE_BOARD |
| 9 | 9 | ||
| 10 | #### Preamble | ||
| 11 | MACHINEOVERRIDES =. "${@['', 'versal-generic:']['versal-generic' != '${MACHINE}']}" | ||
| 12 | #### Regular settings follow | ||
| 13 | |||
| 10 | require conf/machine/include/soc-versal.inc | 14 | require conf/machine/include/soc-versal.inc |
| 11 | require conf/machine/include/machine-xilinx-default.inc | 15 | require conf/machine/include/machine-xilinx-default.inc |
| 12 | require conf/machine/include/machine-xilinx-qemu.inc | 16 | require conf/machine/include/machine-xilinx-qemu.inc |
| @@ -89,6 +93,10 @@ QB_PLM_OPT = " \ | |||
| 89 | " | 93 | " |
| 90 | QB_OPT_APPEND:append:qemuboot-xilinx = " -plm-args '${QB_PLM_OPT}'" | 94 | QB_OPT_APPEND:append:qemuboot-xilinx = " -plm-args '${QB_PLM_OPT}'" |
| 91 | 95 | ||
| 96 | #### No additional settings should be after the Postamble | ||
| 97 | #### Postamble | ||
| 98 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' versal_generic']['versal-generic' != "${MACHINE}"]}" | ||
| 99 | |||
| 92 | # Deprecated board config | 100 | # Deprecated board config |
| 93 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" | 101 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" |
| 94 | require ${USE_BOARD} | 102 | require ${USE_BOARD} |
diff --git a/meta-xilinx-core/conf/machine/zynq-generic.conf b/meta-xilinx-core/conf/machine/zynq-generic.conf index 4a903282..3271051d 100644 --- a/meta-xilinx-core/conf/machine/zynq-generic.conf +++ b/meta-xilinx-core/conf/machine/zynq-generic.conf | |||
| @@ -7,6 +7,10 @@ USE_BOARD = "${@"conf/machine/include/xilinx-board-pre.inc" if d.getVar("BOARD") | |||
| 7 | require ${USE_BOARD} | 7 | require ${USE_BOARD} |
| 8 | unset USE_BOARD | 8 | unset USE_BOARD |
| 9 | 9 | ||
| 10 | #### Preamble | ||
| 11 | MACHINEOVERRIDES =. "${@['', 'zynq-generic:']['zynq-generic' != '${MACHINE}']}" | ||
| 12 | #### Regular settings follow | ||
| 13 | |||
| 10 | require conf/machine/include/soc-zynq.inc | 14 | require conf/machine/include/soc-zynq.inc |
| 11 | require conf/machine/include/machine-xilinx-default.inc | 15 | require conf/machine/include/machine-xilinx-default.inc |
| 12 | require conf/machine/include/machine-xilinx-qemu.inc | 16 | require conf/machine/include/machine-xilinx-qemu.inc |
| @@ -44,6 +48,10 @@ QB_OPT_APPEND = " \ | |||
| 44 | -device loader,addr=0xF8000910,data=0xF,data-len=0x4 \ | 48 | -device loader,addr=0xF8000910,data=0xF,data-len=0x4 \ |
| 45 | " | 49 | " |
| 46 | 50 | ||
| 51 | #### No additional settings should be after the Postamble | ||
| 52 | #### Postamble | ||
| 53 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' zynq_generic']['zynq-generic' != "${MACHINE}"]}" | ||
| 54 | |||
| 47 | # Deprecated board config | 55 | # Deprecated board config |
| 48 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" | 56 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" |
| 49 | require ${USE_BOARD} | 57 | require ${USE_BOARD} |
diff --git a/meta-xilinx-core/conf/machine/zynqmp-generic.conf b/meta-xilinx-core/conf/machine/zynqmp-generic.conf index 317b3fc7..7f89b958 100644 --- a/meta-xilinx-core/conf/machine/zynqmp-generic.conf +++ b/meta-xilinx-core/conf/machine/zynqmp-generic.conf | |||
| @@ -7,6 +7,10 @@ USE_BOARD = "${@"conf/machine/include/xilinx-board-pre.inc" if d.getVar("BOARD") | |||
| 7 | require ${USE_BOARD} | 7 | require ${USE_BOARD} |
| 8 | unset USE_BOARD | 8 | unset USE_BOARD |
| 9 | 9 | ||
| 10 | #### Preamble | ||
| 11 | MACHINEOVERRIDES =. "${@['', 'zynqmp-generic:']['zynqmp-generic' != '${MACHINE}']}" | ||
| 12 | #### Regular settings follow | ||
| 13 | |||
| 10 | # CG is the lowest common demoninator, so use this by default | 14 | # CG is the lowest common demoninator, so use this by default |
| 11 | SOC_VARIANT ?= "cg" | 15 | SOC_VARIANT ?= "cg" |
| 12 | 16 | ||
| @@ -85,6 +89,10 @@ QB_OPT_APPEND:append:qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'" | |||
| 85 | 89 | ||
| 86 | do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy" | 90 | do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy" |
| 87 | 91 | ||
| 92 | #### No additional settings should be after the Postamble | ||
| 93 | #### Postamble | ||
| 94 | PACKAGE_EXTRA_ARCHS:append = "${@['', ' zynqmp_generic']['zynqmp-generic' != "${MACHINE}"]}" | ||
| 95 | |||
| 88 | # Deprecated board config | 96 | # Deprecated board config |
| 89 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" | 97 | USE_BOARD = "${@"conf/machine/include/xilinx-board-post.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" |
| 90 | require ${USE_BOARD} | 98 | require ${USE_BOARD} |
