[yocto] [meta-zephyr][PATCH 3/7] meta-zephyr: Select BOARD via MACHINE

Juro Bystricky juro.bystricky at intel.com
Sat Jan 14 11:01:49 PST 2017


The meaning of BOARD in Zephyr environment is equivalent to MACHINE
in Yocto environment.
Specifying MACHINE will implicitly determine cross-compiler toolchain as well.

There is 1:1 correspondence between Zephyr BOARD and Yocto MACHINE so
a lookup table BOARD:MACHINE may be needed in the future, presently all
that is required is to convert "-" to "_". (Dash to undersocre)

This means that in order to support a new Zephyr board, we simply need to
create a corresponding MACHINE.conf file.

[YOCTO#10894]

Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
---
 conf/distro/zephyr.conf                               | 2 --
 recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/conf/distro/zephyr.conf b/conf/distro/zephyr.conf
index 9f57c9e..4a832db 100644
--- a/conf/distro/zephyr.conf
+++ b/conf/distro/zephyr.conf
@@ -11,5 +11,3 @@ TCLIBCAPPEND = ""
 TEST_TARGET = "QemuTargetZephyr"
 TEST_SUITES = "zephyr"
 
-BOARD_arm ?= "qemu_cortex_m3"
-BOARD_x86 ?= "qemu_x86"
diff --git a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
index 6fe44b5..30c1a5a 100644
--- a/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
+++ b/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
@@ -4,6 +4,9 @@
 # filesystem.
 IMAGE_NO_MANIFEST = "1"
 
+# Zephyr BOARD is basically our MACHINE, except we must use "-" instead of "_"
+BOARD="$(echo ${MACHINE} | tr - _)"
+
 # oe_runmake isn't used because of the make -e causing issues with some
 # make variables.
 MAKE_COMMAND = "make -j V=1 BOARD=${BOARD} CROSS_COMPILE=${CROSS_COMPILE}"
-- 
2.7.4




More information about the yocto mailing list