YOCTO Meta-layer: How to add support for a custom board (or OpenRex)

Here you will find information about how to create a YOCTO custom meta layer needed to support your custom board. As an example, we will be creating OpenRex meta layer.

Content

See also


Important: Before you start, be sure you go through the previous chapter: YOCTO Linux: How to add support for a custom board (or OpenRex)

Meta: Create a new YOCTO meta layer

We are going to create a new meta layer (this is the place were all the changes for our board will be recorded).
cd ~/fsl-community-bsp/sources
yocto-layer create openrex
Note: If you get "yocto-layer: command not found" error, re-run following commands:
cd ~/fsl-community-bsp/
source setup-environment build
cd ~/fsl-community-bsp/sources
yocto-layer create openrex
Go through the procedure and also create examples (here are the values I used to generate a new layer: 6, y, example, y, example, 0.1). Note: Here you can find more info about how to create new layer: YOCTO - Create a new layer

Running "yocto-layer", will create meta-openrex directory structure under cd ~/fsl-community-bsp/sources. This is the place where we will be putting all our files. You will find there some examples, if you like you can have a look, later we will just delete them.

Now, this is important, do not forget update default bblayers.conf. We need to add info about our new meta layer. Do this:
gedit ~/fsl-community-bsp/sources/base/conf/bblayers.conf
and add this (add this line after '${BSPDIR}/sources/meta-fsl-demos \'):
${BSPDIR}/sources/meta-openrex \
The file may look then like this:
LCONF_VERSION = "6"

BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

BBFILES ?= ""
BBLAYERS = " \
  ${BSPDIR}/sources/poky/meta \
  ${BSPDIR}/sources/poky/meta-yocto \
  \
  ${BSPDIR}/sources/meta-openembedded/meta-oe \
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
  \
  ${BSPDIR}/sources/meta-fsl-arm \
  ${BSPDIR}/sources/meta-fsl-arm-extra \
  ${BSPDIR}/sources/meta-fsl-demos \
  ${BSPDIR}/sources/meta-openrex \
"
We need to add also EULA license file
cp ~/fsl-community-bsp/sources/meta-fsl-arm/EULA ~/fsl-community-bsp/sources/meta-openrex/

Meta: Create support in meta-layer for OpenRex Project

First, we are going to create the config files. They are defined in "~/fsl-community-bsp/sources/meta-openrex/conf" directory. As a template, we will again use the sabersd file:
cd ~/fsl-community-bsp/
mkdir sources/meta-openrex/conf/machine
cp sources/meta-fsl-arm/conf/machine/imx6qsabresd.conf sources/meta-openrex/conf/machine/imx6q-openrex.conf
gedit sources/meta-openrex/conf/machine/imx6q-openrex.conf
You may notice, we need to add also some files from sabresd include directory (e.g. inside imx6qsabresd.conf they refer to "conf/machine/include/imx6sabresd-common.inc"). So, let's create it:
mkdir sources/meta-openrex/conf/machine/include
cp sources/meta-fsl-arm/conf/machine/include/imx6sabresd-common.inc sources/meta-openrex/conf/machine/include/imx6openrex-common.inc
gedit sources/meta-openrex/conf/machine/include/imx6openrex-common.inc
From the imx6openrex-common.inc and "sources/meta-fsl-arm/conf/machine/include" directory we can see we need to include additional file:
cp sources/meta-fsl-arm/conf/machine/include/imx-base.inc sources/meta-openrex/conf/machine/include/imx-base.inc
gedit sources/meta-openrex/conf/machine/include/imx-base.inc
*Note: go through imx-base.inc, but you may not need edit it

You may also want to also edit the default sources/meta-openrex/conf/layer.conf
gedit sources/meta-fsl-arm/conf/layer.conf
gedit sources/meta-openrex/conf/layer.conf
Compare the layer.conf files and adjust the content.

File examples

Here are examples, how the files may look after your changes.

Edit: "sources/meta-openrex/conf/machine/imx6q-openrex.conf"
#@TYPE: Machine
#@NAME: FEDEVEL i.MX6Q OpenRex
#@SOC: i.MX6Q
#@DESCRIPTION: Machine configuration for FEDEVEL i.MX6Q OpenRex
#@MAINTAINER: Robert Feranec <info@fedevel.com>

require conf/machine/include/imx6openrex-common.inc

SOC_FAMILY = "mx6:mx6q"

PREFERRED_PROVIDER_u-boot_mx6 = "u-boot-openrex"
PREFERRED_PROVIDER_virtual/kernel_mx6 = "linux-openrex"
PREFERRED_VERSION_linux-openrex ?= "3.14"

KERNEL_DEVICETREE = "imx6q-openrex.dtb"

UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "mx6qopenrex_config,sdcard"
UBOOT_CONFIG[mfgtool] = "mx6qopenrex_config"
*Note: Notice PREFERED parameters. These must be the same as you will use in the names of your bb files (we will create these files in the next steps, a little bit later .... e.g. sources/meta-openrex/recipes-bsp/u-boot/u-boot-openrex_2015.10.bb or sources/meta-openrex/recipes-kernel/linux/linux-openrex_3.14.bb)

Edit: "sources/meta-openrex/conf/machine/include/imx6openrex-common.inc"
# Provides the i.MX6 OpenRex common settings

require conf/machine/include/imx-base.inc
require conf/machine/include/tune-cortexa9.inc

SERIAL_CONSOLE = "115200 ttymxc0"

MACHINE_FIRMWARE_append_mx6 = " linux-firmware-ath6k"

MACHINE_FEATURES += " pci wifi bluetooth"
Check: "sources/meta-openrex/conf/machine/include/imx-base.inc"
# Provides the i.MX common settings

include conf/machine/include/fsl-default-settings.inc
include conf/machine/include/fsl-default-versions.inc

include conf/machine/include/soc-family.inc

# Set specific make target and binary suffix
PREFERRED_PROVIDER_u-boot ??= "u-boot-fslc"
PREFERRED_PROVIDER_virtual/bootloader ??= "u-boot-fslc"

PREFERRED_PROVIDER_u-boot-mxsboot-native ??= "u-boot-fslc-mxsboot-native"

UBOOT_MAKE_TARGET ?= "u-boot.imx"
UBOOT_MAKE_TARGET_mxs ?= "u-boot.sb"

UBOOT_SUFFIX ?= "imx"
UBOOT_SUFFIX_mxs ?= "sb"

UBOOT_ENTRYPOINT_mxs = "0x40008000"
UBOOT_ENTRYPOINT_mx51  = "0x90008000"
UBOOT_ENTRYPOINT_mx53  = "0x70008000"
UBOOT_ENTRYPOINT_mx6  = "0x10008000"
UBOOT_ENTRYPOINT_mx6sl = "0x80008000"
UBOOT_ENTRYPOINT_mx6sx = "0x80008000"
UBOOT_ENTRYPOINT_mx6ul  = "0x10008000"
UBOOT_ENTRYPOINT_mx7 = "0x80008000"
UBOOT_ENTRYPOINT_vf = "0x80008000"

PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
XSERVER_DRIVER = "xf86-video-fbdev"
XSERVER_DRIVER_mx6 = "xf86-video-imxfb-vivante"
XSERVER_DRIVER_mx6ul = "xf86-video-fbdev"
XSERVER = "xserver-xorg \
           xf86-input-evdev \
           ${XSERVER_DRIVER}"

# Ship kernel modules
MACHINE_EXTRA_RRECOMMENDS = "kernel-modules"

# Tunes for hard/soft float-point selection. Note that we allow building for
# thumb support giving distros the chance to enable thumb by setting
# ARM_INSTRUCTION_SET = "thumb"
#
# handled by software
# DEFAULTTUNE_mx6 ?= "cortexa9t-neon"
# handled by hardware
DEFAULTTUNE_mx6 ?= "cortexa9thf-neon"
DEFAULTTUNE_mx6ul ?= "cortexa7thf-neon"
DEFAULTTUNE_mx7 ?= "cortexa7thf-neon"
DEFAULTTUNE_vf ?= "cortexa5thf-neon"

# Sub-architecture support
MACHINE_SOCARCH_SUFFIX ?= ""
MACHINE_SOCARCH_SUFFIX_mx6q = "-mx6qdl"
MACHINE_SOCARCH_SUFFIX_mx6dl = "-mx6qdl"
MACHINE_SOCARCH_SUFFIX_mx6sx = "-mx6sx"
MACHINE_SOCARCH_SUFFIX_mx6sl = "-mx6sl"
MACHINE_SOCARCH_SUFFIX_mx7 = "-mx7d"
MACHINE_SOCARCH_SUFFIX_vf60 = "-vf60"
MACHINE_SOCARCH_SUFFIX_vf50 = "-vf50"
MACHINE_SOCARCH_SUFFIX_mx6ul = "-mx6ul"

MACHINE_ARCH_FILTER = "virtual/kernel imx-vpu"
MACHINE_SOCARCH_FILTER_append_mx6 = " libfslcodec libfslvpuwrap libfslparser"
MACHINE_SOCARCH_FILTER_append_mx6 = " virtual/libopenvg virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa virtual/libgl virtual/libg2d"

INHERIT += "fsl-dynamic-packagearch"

# Firmware
MACHINE_FIRMWARE ?= ""
MACHINE_FIRMWARE_append_mx7 = " firmware-imx-epdc"
MACHINE_FIRMWARE_append_mx6q = " firmware-imx-vpu-imx6q"
MACHINE_FIRMWARE_append_mx6dl = " firmware-imx-vpu-imx6d firmware-imx-epdc"
MACHINE_FIRMWARE_append_mx6sl = " firmware-imx-epdc"
MACHINE_FIRMWARE_append_mx53 = " firmware-imx-vpu-imx53 firmware-imx-sdma-imx53"
MACHINE_FIRMWARE_append_mx51 = " firmware-imx-vpu-imx51 firmware-imx-sdma-imx51"

# FIXME: Needs addition of firmware-imx of official BSPs
#MACHINE_FIRMWARE_append_mx27 = " firmware-imx-vpu-imx27"
#MACHINE_FIRMWARE_append_mx25 = " firmware-imx-sdma-imx25"

MACHINE_EXTRA_RRECOMMENDS += "${MACHINE_FIRMWARE}"

# Extra audio support
# FIXME: Add support for ALL SoC families
MACHINE_EXTRA_RRECOMMENDS_append_mx6 = " ${@base_contains('DISTRO_FEATURES', 'alsa', 'fsl-alsa-plugins', '', d)}"

# Extra udev rules
MACHINE_EXTRA_RRECOMMENDS += "udev-rules-imx"

# GStreamer 1.0 plugins
MACHINE_GSTREAMER_1_0_PLUGIN ?= ""
MACHINE_GSTREAMER_1_0_PLUGIN_mx6q ?= "gstreamer1.0-plugins-imx-meta"
MACHINE_GSTREAMER_1_0_PLUGIN_mx6dl ?= "gstreamer1.0-plugins-imx-meta"

# Determines if the SoC has support for Vivante kernel driver
SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT       = "0"
SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6q  = "1"
SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6dl = "1"
SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6sx = "1"
SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6sl = "1"

# Handle Vivante kernel driver setting:
#   0 - machine does not have Vivante GPU driver support
#   1 - machine has Vivante GPU driver support
MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT ?= "${SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT}"

# mx6 GPU libraries
PREFERRED_PROVIDER_virtual/egl_mx6q ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/egl_mx6dl ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/egl_mx6sx ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/egl_mx6sl ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/egl_mx6ul ?= "mesa"

PREFERRED_PROVIDER_virtual/libgles1_mx6q ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles1_mx6dl ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles1_mx6sx ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles1_mx6sl ?= "mesa"
PREFERRED_PROVIDER_virtual/libgles1_mx6ul ?= "mesa"

PREFERRED_PROVIDER_virtual/libgles2_mx6q ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles2_mx6dl ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles2_mx6sx ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles2_mx6sl ?= "mesa"
PREFERRED_PROVIDER_virtual/libgles2_mx6ul ?= "mesa"

PREFERRED_PROVIDER_virtual/libgl_mx6q ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgl_mx6dl ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgl_mx6sx ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgl_mx6sl ?= "mesa"
PREFERRED_PROVIDER_virtual/libgl_mx6ul ?= "mesa"

PREFERRED_PROVIDER_virtual/libg2d_mx6 ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libg2d_mx6ul = ""

# Handle default kernel
IMX_DEFAULT_KERNEL = "linux-imx"
IMX_DEFAULT_KERNEL_mxs = "linux-fslc"
IMX_DEFAULT_KERNEL_mx5 = "linux-fslc"
IMX_DEFAULT_KERNEL_mx6 = "linux-fslc-imx"
IMX_DEFAULT_KERNEL_mx6ul = "linux-imx"

PREFERRED_PROVIDER_virtual/kernel ??= "${IMX_DEFAULT_KERNEL}"

SOC_DEFAULT_IMAGE_FSTYPES = "sdcard.gz"
SOC_DEFAULT_IMAGE_FSTYPES_mxs = "uboot.mxsboot-sdcard sdcard.gz"

SDCARD_ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4"
IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}"

SERIAL_CONSOLE = "115200 ttymxc0"
SERIAL_CONSOLE_mxs = "115200 ttyAMA0"

KERNEL_IMAGETYPE = "zImage"

MACHINE_FEATURES = "apm usbgadget usbhost vfat alsa touchscreen"

# Add the ability to specify _imx machines
MACHINEOVERRIDES =. "imx:"
Edit: "sources/meta-openrex/conf/layer.conf"
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
	${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "openrex"
BBFILE_PATTERN_openrex = "^${LAYERDIR}/"
BBFILE_PRIORITY_openrex = "6"

FSL_EULA_FILE = "${LAYERDIR}/EULA"

FSL_MIRROR ?= "http://www.freescale.com/lgfiles/NMG/MAD/YOCTO/"

MIRRORS += " \
${FSL_MIRROR}	http://download.ossystems.com.br/bsp/freescale/source/ \n \
"

# Let us add layer-specific bbappends which are only applied when that
# layer is included in our configuration
BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bbappend' % layer \
               for layer in BBFILE_COLLECTIONS.split())}"
# Add layer-specific bb files too
BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bb' % layer \
               for layer in BBFILE_COLLECTIONS.split())}"

Meta: Create support in meta-layer for OpenRex uBoot

We are going to tell the YOCTO, where our github source codes for uBoot are located.
cd ~/fsl-community-bsp/
mkdir sources/meta-openrex/recipes-bsp
mkdir sources/meta-openrex/recipes-bsp/u-boot
Copy the original u-boot-fslc_2015.10.bb to our meta-openrex:
cp sources/meta-fsl-arm/recipes-bsp/u-boot/u-boot-fslc_2015.10.bb sources/meta-openrex/recipes-bsp/u-boot/u-boot-openrex_2015.10.bb
gedit sources/meta-openrex/recipes-bsp/u-boot/u-boot-openrex_2015.10.bb
If you have a look inside the "u-boot-openrex_2015.10.bb", you will notice, we need to include also "u-boot u-boot-fslc.inc". You really may want to see what is inside "sources/meta-fsl-arm/recipes-bsp/u-boot/u-boot-fslc.inc" so we can add the info to our "u-boot-openrex_2015.10.bb":
gedit sources/meta-fsl-arm/recipes-bsp/u-boot/u-boot-fslc.inc
Combine "u-boot-fslc.inc" and "u-boot-openrex_2015.10.bb" into one file. See below how "u-boot-openrex_2015.10.bb" may look after you finish doing changes.

Edit: "sources/meta-openrex/recipes-bsp/u-boot/u-boot-openrex_2015.10.bb"
# Copyright (C) 2016 FEDEVEL
# Based on u-boot-fslc.inc Copyright (C) 2012-2015 O.S. Systems Software LTDA.
# Released under the MIT license (see COPYING.MIT for the terms)

require recipes-bsp/u-boot/u-boot.inc
inherit fsl-u-boot-localversion

DEPENDS_mxs += "elftosb-native openssl-native"

SUMMARY = "U-Boot bootloader with support for OpenRex board"
DESCRIPTION = "U-Boot bootloader with support for OpenRex board. More info \
at http://www.imx6rex.com/open-rex"

LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"

COMPATIBLE_MACHINE = "(mxs|mx5|mx6|mx6ul|mx7|vf|imx6q-openrex)"

PROVIDES += "u-boot"

PV = "v2015.10+git${SRCPV}"

SRCBRANCH ??= "jethro"

SRC_URI = "git://github.com/FEDEVEL/openrex-uboot-v2015.10.git;branch=${SRCBRANCH}"

#SRCREV is the commit number, must be always changed for a new version
SRCREV = "b17a70691ea4ec77561c4532ec777338f3b0758a" 

S = "${WORKDIR}/git"

# FIXME: Allow linking of 'tools' binaries with native libraries
#        used for generating the boot logo and other tools used
#        during the build process.
EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CPPFLAGS}" \
                 HOSTLDFLAGS="${BUILD_LDFLAGS}" \
                 HOSTSTRIP=true'

PACKAGE_ARCH = "${MACHINE_ARCH}"
!IMPORTANT! Do not forget to update SRCBRANCH, SRC_URI, SRCREV and direct it to your github & commit. The github SRC_URI address must start with git://, so if needed, change https:// to git://.

Meta: Create support in meta-layer for OpenRex Linux

Similar as for uBoot, we are going to tell where our Linux github is located and also we will specify defconfig:
cd ~/fsl-community-bsp/
mkdir sources/meta-openrex/recipes-kernel
mkdir sources/meta-openrex/recipes-kernel/linux/
Have a look inside sources/meta-fsl-arm/recipes-kernel/linux what we need to create. We need a *.bb file:
cp sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc-imx_3.14-1.1.x.bb sources/meta-openrex/recipes-kernel/linux/linux-openrex_3.14.bb
gedit sources/meta-openrex/recipes-kernel/linux/linux-openrex_3.14.bb
*Note: Don't forget, the "linux-openrex-3.14.bb" file must have the name which you specified in the "sources/meta-openrex/conf/machine/imx6q-openrex.conf"

Inside the "sources/meta-openrex/recipes-kernel/linux/linux-openrex_3.14.bb", you will notice, that "linux-fslc.inc" is called. Have a look inside it:
gedit sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc.inc
Combine "linux-openrex_3.14.bb" and "linux-fslc.inc" together. See below how your file may then look.

Edit: "sources/meta-openrex/recipes-kernel/linux/linux-openrex_3.14.bb"
# Copyright (C) 2016 FEDEVEL
# Released under the MIT license (see COPYING.MIT for the terms)

SUMMARY = "Linux Kernel for OpenRex board"
DESCRIPTION = "Linux Kernel for OpenRex board. More info \
at http://www.imx6rex.com/open-rex"

require recipes-kernel/linux/linux-imx.inc
require recipes-kernel/linux/linux-dtb.inc

DEPENDS += "lzop-native bc-native"

include linux-fslc.inc

#PV .= "+git${SRCPV}"
PV .= ""

SRCBRANCH = "jethro"
LOCALVERSION = "-yocto"

#Always update SRCREV based on your last commit
SRCREV = "58f44dd3178b7a9878298bd948082e01f4fe28fb"

KERNEL_SRC ?= "git://github.com/FEDEVEL/openrex-linux-3.14.git;protocol=git"
SRC_URI = "${KERNEL_SRC};branch=${SRCBRANCH} file://defconfig"

COMPATIBLE_MACHINE = "(mx6|mx7|imx6q-openrex)"
*Note: The github SRC_URI address must start with git://, so if needed, change https:// to git://. Also, don't forget to change address to your github.

Now, add the defconfig.
mkdir sources/meta-openrex/recipes-kernel/linux/linux-openrex-3.14
cp sources/meta-fsl-arm/recipes-kernel/linux/linux-fslc-imx/defconfig sources/meta-openrex/recipes-kernel/linux/linux-openrex-3.14/defconfig
gedit sources/meta-openrex/recipes-kernel/linux/linux-openrex-3.14/defconfig
*Note: It's important how you call the "linux-openrex-3.14" directory. Otherwise defconfig may not be found, but if YOCTO can not find it, bitbake will give you an error message with some suggestions.

You need to fill up "defconfig" file with some paremeters. Initially, you can go to your github (e.g. "https://github.com/FEDEVEL/openrex-linux-3.14/blob/master/arch/arm/configs/") and copy content of "imx_v7_defconfig" file into our new "defconfig".

If you would like to change some CONFIG parameters for your board, "sources/meta-openrex/recipes-kernel/linux/linux-openrex-3.14/defconfig" is the place where to do it. See below how your defconfig file may then look.

Edit: "sources/meta-openrex/recipes-kernel/linux/linux-openrex-3.14/defconfig"
CONFIG_KERNEL_LZO=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_EXPERT=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PERF_EVENTS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
CONFIG_GPIO_PCA953X=y
CONFIG_ARCH_MXC=y
CONFIG_MACH_IMX51_DT=y
CONFIG_MACH_EUKREA_CPUIMX51SD=y
CONFIG_SOC_IMX50=y
CONFIG_SOC_IMX53=y
CONFIG_SOC_IMX6Q=y
CONFIG_SOC_IMX6SL=y
CONFIG_SOC_IMX6SX=y
CONFIG_SOC_IMX6UL=y
CONFIG_SOC_IMX7D=y
CONFIG_SOC_VF610=y
# CONFIG_SWP_EMULATE is not set
CONFIG_SMP=y
CONFIG_HAVE_ARM_ARCH_TIMER=y
CONFIG_VMSPLIT_2G=y
CONFIG_PREEMPT=y
CONFIG_AEABI=y
CONFIG_HIGHMEM=y
CONFIG_CMA=y
CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
CONFIG_KEXEC=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_ARM_IMX6Q_CPUFREQ=y
CONFIG_ARM_IMX7D_CPUFREQ=y
CONFIG_CPU_IDLE=y
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_BINFMT_MISC=m
CONFIG_PM_RUNTIME=y
CONFIG_PM_DEBUG=y
CONFIG_PM_TEST_SUSPEND=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
CONFIG_IPV6=y
CONFIG_NETFILTER=y
CONFIG_VLAN_8021Q=y
CONFIG_LLC2=y
CONFIG_CAN=y
CONFIG_CAN_FLEXCAN=y
CONFIG_CAN_M_CAN=y
CONFIG_BT=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_ATH3K=y
CONFIG_BT_HCIBCM203X=y
CONFIG_BT_ATH3K=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=320
CONFIG_IMX_WEIM=y
CONFIG_CONNECTOR=y
CONFIG_MTD=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
CONFIG_MTD_NAND_MXC=y
CONFIG_MTD_SPI_NOR=y
CONFIG_SPI_FSL_QUADSPI=y
CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
CONFIG_SENSORS_FXOS8700=y
CONFIG_SENSORS_FXAS2100X=y
CONFIG_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y
# CONFIG_SCSI_LOWLEVEL is not set
CONFIG_ATA=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_IMX=y
CONFIG_PATA_IMX=y
CONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_BROADCOM is not set
CONFIG_CS89x0=y
CONFIG_CS89x0_PLATFORM=y
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_SEEQ is not set
CONFIG_SMC91X=y
CONFIG_SMC911X=y
CONFIG_SMSC911X=y
# CONFIG_NET_VENDOR_STMICRO is not set
CONFIG_MICREL_PHY=y
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_BCMDHD=m
CONFIG_BCMDHD_SDIO=y
CONFIG_BCMDHD_FW_PATH="/lib/firmware/bcm/fw_bcmdhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/bcm/bcmdhd.cal"
# CONFIG_RTL_CARDS is not set
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=m
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_IMX=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_TOUCHSCREEN_EGALAX=y
CONFIG_TOUCHSCREEN_ELAN=y
CONFIG_TOUCHSCREEN_MAX11801=y
CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
CONFIG_TOUCHSCREEN_MC13783=y
CONFIG_TOUCHSCREEN_TSC2007=y
CONFIG_TOUCHSCREEN_STMPE=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_MMA8450=y
CONFIG_INPUT_ISL29023=y
CONFIG_INPUT_MPL3115=y
CONFIG_SENSOR_FXLS8471=y
CONFIG_SERIO_SERPORT=m
# CONFIG_LEGACY_PTYS is not set
# CONFIG_DEVKMEM is not set
CONFIG_SERIAL_IMX=y
CONFIG_SERIAL_IMX_CONSOLE=y
CONFIG_SERIAL_FSL_LPUART=y
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
CONFIG_FSL_OTP=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
CONFIG_I2C_IMX=y
CONFIG_SPI=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_IMX=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_74X164=y
CONFIG_POWER_SUPPLY=y
CONFIG_SABRESD_MAX8903=y
CONFIG_SENSORS_MAX17135=y
CONFIG_SENSORS_MAG3110=y
CONFIG_THERMAL=y
CONFIG_CPU_THERMAL=y
CONFIG_IMX_THERMAL=y
CONFIG_DEVICE_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_IMX2_WDT=y
CONFIG_MFD_DA9052_I2C=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
CONFIG_MFD_MAX17135=y
CONFIG_MFD_SI476X_CORE=y
CONFIG_MFD_STMPE=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_DA9052=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_MAX17135=y
CONFIG_REGULATOR_MC13783=y
CONFIG_REGULATOR_MC13892=y
CONFIG_REGULATOR_PFUZE100=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_RC_SUPPORT=y
CONFIG_RC_DEVICES=y
CONFIG_IR_GPIO_CIR=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_MXC_OUTPUT=y
CONFIG_VIDEO_MXC_CAPTURE=m
CONFIG_MXC_CAMERA_OV5640=m
CONFIG_MXC_CAMERA_OV5642=m
CONFIG_MXC_CAMERA_OV5640_MIPI=m
CONFIG_MXC_TVIN_ADV7180=m
CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m
CONFIG_VIDEO_MXC_IPU_OUTPUT=y
CONFIG_VIDEO_MXC_PXP_V4L2=y
CONFIG_VIDEO_MXC_CSI_CAMERA=m
CONFIG_MXC_VADC=m
CONFIG_MXC_MIPI_CSI=m
CONFIG_MXC_CAMERA_OV5647_MIPI=m
CONFIG_SOC_CAMERA=y
CONFIG_VIDEO_MX3=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_VIDEO_CODA=y
CONFIG_RADIO_SI476X=y
CONFIG_SOC_CAMERA_OV2640=y
CONFIG_DRM=y
CONFIG_DRM_VIVANTE=y
CONFIG_FB=y
CONFIG_FB_MXS=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_L4F00242T03=y
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_PWM=y
CONFIG_FB_MXC_SYNC_PANEL=y
CONFIG_FB_MXC_LDB=y
CONFIG_FB_MXC_MIPI_DSI=y
CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
CONFIG_FB_MXC_HDMI=y
CONFIG_FB_MXC_EINK_PANEL=y
CONFIG_FB_MXC_EINK_V2_PANEL=y
CONFIG_FB_MXS_SII902X=y
CONFIG_FB_MXC_DCIC=m
CONFIG_HANNSTAR_CABC=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_LOGO=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_SOC=y
CONFIG_SND_IMX_SOC=y
CONFIG_SND_SOC_EUKREA_TLV320=y
CONFIG_SND_SOC_IMX_CS42888=y
CONFIG_SND_SOC_IMX_SII902X=y
CONFIG_SND_SOC_IMX_WM8958=y
CONFIG_SND_SOC_IMX_WM8960=y
CONFIG_SND_SOC_IMX_WM8962=y
CONFIG_SND_SOC_IMX_SGTL5000=y
CONFIG_SND_SOC_IMX_MQS=y
CONFIG_SND_SOC_IMX_SPDIF=y
CONFIG_SND_SOC_IMX_MC13783=y
CONFIG_SND_SOC_IMX_HDMI=y
CONFIG_SND_SOC_IMX_SI476X=y
CONFIG_USB=y
CONFIG_USB_OTG_WHITELIST=y
CONFIG_USB_OTG_FSM=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_MXC=y
CONFIG_USB_HCD_TEST_MODE=y
CONFIG_USB_ACM=m
CONFIG_USB_STORAGE=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_USB_EHSET_TEST_FIXTURE=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_MXS_PHY=y
CONFIG_USB_GADGET=y
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_ZERO=m
CONFIG_USB_ETH=m
CONFIG_USB_G_NCM=m
CONFIG_USB_GADGETFS=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y
CONFIG_MMC_UNSAFE_RESUME=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_ESDHC_IMX=y
CONFIG_MXC_IPU=y
CONFIG_MXC_GPU_VIV=y
CONFIG_MXC_IPU_V3_PRE=y
CONFIG_MXC_MIPI_CSI2=y
CONFIG_MXC_SIM=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_GPIO=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
CONFIG_RTC_DRV_MC13XXX=y
CONFIG_RTC_DRV_MXC=y
CONFIG_RTC_DRV_SNVS=y
CONFIG_DMADEVICES=y
CONFIG_MXC_PXP_V2=y
CONFIG_MXC_PXP_V3=y
CONFIG_IMX_SDMA=y
CONFIG_MXS_DMA=y
CONFIG_STAGING=y
CONFIG_STAGING_MEDIA=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_IIO=y
CONFIG_VF610_ADC=y
CONFIG_AD2802A=y
CONFIG_PWM=y
CONFIG_PWM_IMX=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
CONFIG_NLS_DEFAULT="cp437"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_UTF8=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_FTRACE is not set
CONFIG_CORESIGHT=y
CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
CONFIG_CORESIGHT_SINK_TPIU=y
CONFIG_CORESIGHT_SINK_ETBV10=y
CONFIG_CORESIGHT_SOURCE_ETM3X=y
CONFIG_SECURITYFS=y
CONFIG_CRYPTO_USER=y
CONFIG_CRYPTO_TEST=m
CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CTS=y
CONFIG_CRYPTO_LRW=y
CONFIG_CRYPTO_XTS=y
CONFIG_CRYPTO_MD4=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=y
CONFIG_CRYPTO_RMD128=y
CONFIG_CRYPTO_RMD160=y
CONFIG_CRYPTO_RMD256=y
CONFIG_CRYPTO_RMD320=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA512=y
CONFIG_CRYPTO_TGR192=y
CONFIG_CRYPTO_WP512=y
CONFIG_CRYPTO_BLOWFISH=y
CONFIG_CRYPTO_CAMELLIA=y
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_TWOFISH=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRYPTO_DEV_FSL_CAAM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y

Meta: Compile and Test

To compile the meta-layer which we just created run following commands:
cd ~/fsl-community-bsp/
MACHINE=imx6q-openrex source setup-environment build-openrex
MACHINE=imx6q-openrex bitbake core-image-base
*Notes: "MACHINE=imx6q-openrex" is the name of our *.conf file inside conf/machine directory. The "build-openrex" is directory where all the files will be located (the path will be actually ~/fsl-community-bsp/build-openrex)

To test the created files, follow Creating SD card or SATA disk >

Meta: Upload your meta layer to github

First, create README.md file, so everyone knows how to use your new meta layer.
cd ~/fsl-community-bsp/sources/meta-openrex
gedit README.md
Here is example of README.md file
# meta-openrex
FEDEVEL Yocto Project for OpenRex

# How to compile & use software for OpenRex 

Here you will find some basic info about how to start with YOCTO and OpenRex. If you follow the steps below, you should be able to compile the source code. 


In case you would like to know more about YOCTO & How To Use It, for example how to create, modify, compile and use meta-openrex or how to create your own custom layer, have a look at OpenRex website: http://www.imx6rex.com/open-rex/software/

### 1) Install the repo utility
    mkdir ~/bin
    curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    chmod a+x ~/bin/repo

### 2) Get the YOCTO project
    cd
    mkdir fsl-community-bsp
    cd fsl-community-bsp
    PATH=${PATH}:~/bin
    repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b jethro

### 3) Add openrex support - create manifest 
    cd ~/fsl-community-bsp/
    mkdir -pv .repo/local_manifests/

Copy and paste this into your Linux host machine 

    cat > .repo/local_manifests/imx6openrex.xml << EOF
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
    
      <remote fetch="git://github.com/FEDEVEL" name="fedevel"/>
    
      <project remote="fedevel" revision="jethro" name="meta-openrex" path="sources/meta-openrex">
        <copyfile src="openrex-setup.sh" dest="openrex-setup.sh"/>
      </project>
    </manifest>
    EOF

### 4) Sync repositories
    repo sync

### 5) Add OpenRex meta layer into BSP
    source openrex-setup.sh

# Building images
    cd ~/fsl-community-bsp/

### Currently Supported machines <machine name>
Here is a list of 'machine names' which you can use to build OpenRex images. Use the 'machine name' based on the board you have:


    imx6q-openrex
    
### Setup and Build Console image
    MACHINE=<machine name> source setup-environment build-openrex
    MACHINE=<machine name> bitbake core-image-base

Example:


    MACHINE=imx6q-openrex source setup-environment build-openrex
    MACHINE=imx6q-openrex bitbake core-image-base

### Setup and Build Toolchain    
    MACHINE=<machine name> bitbake core-image-base -c populate_sdk
    
### Setup and Build FSL GUI image
    MACHINE=<machine name> source fsl-setup-release.sh -b build-x11 -e x11
    MACHINE=<machine name> bitbake fsl-image-gui

# Creating SD card
Output directories and file names depend on what you build. Following example is based on running 'bitbake core-image-base':


    umount /dev/sdb?
    gunzip -c ~/fsl-community-bsp/build-openrex/tmp/deploy/images/imx6q-openrex/core-image-base-imx6q-openrex.sdcard.gz > ~/fsl-community-bsp/build-openrex/tmp/deploy/images/imx6q-openrex/core-image-base-imx6q-openrex.sdcard
    sudo dd if=~/fsl-community-bsp/build-openrex/tmp/deploy/images/imx6q-openrex/core-image-base-imx6q-openrex.sdcard of=/dev/sdb
    umount /dev/sdb?
    
# Testing it on OpenRex (initial uBoot runs from SPI)
To test your uBoot on SD card, plug in the card which you have just created into an OpenRex board. Reset the OpenRex board (press "Reset" button), interrupt the uBoot countdown (press "Spacebar" or the "Enter" key) and run following command:

    mw.l 0x020d8040 0x2840; mw.l 0x020d8044 0x10000000; reset

# Updating OpenRex
TO
Create openrex-setup.sh script:
cd ~/fsl-community-bsp/sources/meta-openrex
gedit openrex-setup.sh
Put there this:
#!/bin/sh

LAYERS_DIR=./sources/base/conf/
LAYER_OPENREX_STRING="BBLAYERS += \"\${BSPDIR}/sources/meta-openrex\""

if [ -w ${LAYERS_DIR}/bblayers.conf ]
then
	grep "${LAYER_OPENREX_STRING}" "${LAYERS_DIR}/bblayers.conf" > /dev/null
	TMPRETVAL=$(echo $?)
	TMPPRINT=""

	if [ ${TMPRETVAL} -eq 0 ]
	then
		TMPPRINT="already present"
	fi

	if [ ${TMPRETVAL} -eq 1 ]
	then
		echo "${LAYER_OPENREX_STRING}" >> ${LAYERS_DIR}/bblayers.conf
		TMPPRINT="added"
	fi

	echo "Layer meta-openrex ${TMPPRINT}"
fi
Delete the files from examples:
cd ~/fsl-community-bsp/sources/meta-openrex
rm -rf recipes-example
rm -rf recipes-example-bbappend
rm README
rm COPYING.MIT
This is what should left there:
fedevel@ubuntu:~/fsl-community-bsp/sources/meta-openrex$ ls -la
total 60
drwxrwxr-x  5 fedevel fedevel  4096 Mar  9 04:55 .
drwxrwxr-x 10 fedevel fedevel  4096 Mar  1 07:37 ..
drwxrwxr-x  3 fedevel fedevel  4096 Mar  8 05:45 conf
-rw-rw-r--  3 fedevel fedevel 32631 Mar  8 08:20 EULA
-rw-rw-r--  1 fedevel fedevel   498 Mar  9 04:51 openrex-setup.sh
-rw-rw-r--  1 fedevel fedevel  2006 Mar  9 04:49 README.md
drwxrwxr-x  3 fedevel fedevel  4096 Mar  7 05:59 recipes-bsp
drwxrwxr-x  3 fedevel fedevel  4096 Mar  8 01:51 recipes-kernel
fedevel@ubuntu:~/fsl-community-bsp/sources/meta-openrex$
Put "meta-openrex" on github:
cd ~/fsl-community-bsp/sources/meta-openrex
git init
git add .
git commit -m 'Initial version'
git remote add origin https://github.com/FEDEVEL/meta-openrex.git
git push -u origin master
Create a branch (the same branch as we used for linux and uboot):
git branch jethro
git push origin jethro
Change to the branch 'jethro':
git checkout jethro
If you need to do any additional changes in meta layer, first be sure you have the latest code - same code as it is in the github (Note: if you have done any changes in the source code before running the pull command, you will need to merge them!)
git checkout jethro
git branch #be sure you are working with jethro branch
git pull origin jethro
Do the changes and then upload them to github:
git branch #be sure you are working with jethro branch
git status
git add .
git diff origin/jethro #check differences
git commit -m 'Updated README'
git push origin jethro
*Note: If you make a mistake and diff doesn't look right, do the "commit" anyway and then reset it by running "git reset --hard HEAD~1" and start again from "fetch". In that case, you may need to us 'git fetch origin jethro' instead of 'git pull origin jethro'

Meta: Try it

To try your new meta layer, see: How to Compile YOCTO, Create SD card, Test & Update Software on the Board