AnsweredAssumed Answered

How to add a new board to imx28 yocto build?

Question asked by Colin Moloney on Jan 21, 2015
Latest reply on Jan 22, 2015 by Fabio Estevam

Hi,   (re-posted from wrong group)

 

  We have our own hardware based on the imx28evk.  I have built systems for it using LTIB but we want to upgrade to Yocto and to a recent kernel.

I have installed Yocto and built a successfully target for the imx28evk using Yocto.

Now I want to understand how to build for our target hardware.

I have made a little progress, I have added a layer and it is included in the layers seen by bitbake.

 

  The next thing I want to change is the device tree.  Searching the internet yields many different suggestions.

I have set KERNEL_DEVICETREE = "mtd4000.dtb" in the machine conf file but when I try "bitbake core-image-minimal" it fails trying to build mtd4000.dtb: No rule to build target.

I can't work out where I'm supposed to put the dts files and how to tell the system where they are.

 

Referring to my workspace below,

 

1) Can anyone explain where to put the .dts/.dtsi files?

Which path is correct:

    .../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/git/...

or  .../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/image/usr/...

or some other path?

 

2) How do I tell Yocto/bitbake about the new .dts file(s)? 

 

3) If the .dtb has to have an entry in a makefile in the list for the MXS, eg:  "dtb-$(CONFIG_ARCH_MXS) += mtd4000.dtb", how do I do that using my layer?

There is a Makefile in "tmp/work/mtd4000-poky-linux-gnueabi/linux-fslc/3.14+gitAUTOINC+00e472111a-r0/git/arch/arm/boot/dts/Makefile" but

it is replaced when I clean and re-build the target (As I would expect: stuff under 'tmp/...' is transient)

 

4) Also, I will need to get the "defconfig" right for this new machine.  Where does it go and how to tell Yocto/bitbake ?

     .../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/defconfig

or  .../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/mtd4000/defconfig

There is a SRC_URI in linux-fslc.inc that refers to "file://defconfig" but I don't know which directory this implies?

 

[ 5) Later I'll need to change the DDR RAM settings and then build u-boot too ]

 

Thanks in advance,

 

Colin Moloney

-----------

 

My build workspace is called "mdtata", my layer is "meta-mtdata" and my new machine is "mtd4000".  My workspace is like:

 

.../help/

.../mtdata/

.../README

.../README.cm

.../.repo/

.../setup-environment.../download

.../sources/base/

.../sources/meta-fsl-arm/

.../sources/meta-fsl-arm-extra/

.../sources/meta-fsl-demos/

.../sources/meta-openembedded/

.../sources/poky/

and my layer

.../sources/meta-mtdata/

.../sources/meta-mtdata/README

.../sources/meta-mtdata/recipes-kernel/

.../sources/meta-mtdata/recipes-kernel/linux/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc.inc

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc_3.14.bbappend

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/git/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/git/arch/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/git/arch/arm/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/git/arch/arm/boot/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/git/arch/arm/boot/dts/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/3.14/git/arch/arm/boot/dts/mtd4000.dts

 

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/defconfig

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/mtd4000/

.../sources/meta-mtdata/recipes-kernel/linux/linux-fslc/mtd4000/defconfig

 

.../sources/meta-mtdata/recipes-bsp/

.../sources/meta-mtdata/recipes-bsp/u-boot/

.../sources/meta-mtdata/recipes-bsp/u-boot/u-boot-fslc.inc

.../sources/meta-mtdata/recipes-bsp/u-boot/u-boot-fslc_2014.01.bb

.../sources/meta-mtdata/recipes-bsp/u-boot/u-boot-mtd4000/

 

.../sources/meta-mtdata/conf/

.../sources/meta-mtdata/conf/machine/

.../sources/meta-mtdata/conf/machine/mtd4000.conf

.../sources/meta-mtdata/conf/layer.conf

and build directory:

.../mtdata/bitbake.lock

.../mtdata/cache/

.../mtdata/state-cache

.../mtdata/conf/

.../mtdata/conf/local.conf

.../mtdata/conf/templateconf.cfg

.../mtdata/conf/sanity_info

.../mtdata/conf/bblayers.conf

.../mtdata/tmp/

 

My machine config mtd4000.conf has:

    include conf/machine/include/mxs-base.inc

    PREFERRED_PROVIDER_virtual/kernel = "linux-fslc"

    PREFERRED_VERSION_linux-fslc = "3.14%"

    IMXBOOTLETS_MACHINE = "MTD4000"

    KERNEL_IMAGETYPE = "uImage"

and several attempts at the device tree:

    #KERNEL_DEVICETREE = "imx28-evk.dtb"   -- original freescale

none of these worked:

    KERNEL_DEVICETREE = "mtd4000.dtb"

    KERNEL_DEVICETREE = "${S}/git/arch/arm/boot/dts/mtd4000.dtb"

    KERNEL_DEVICETREE = "${WORKDIR}/mtd4000.dts"

    KERNEL_DEVICETREE = "${WORKDIR}/mtd4000"

 

The local.conf has:

    MACHINE ??= "mtd4000"

 

The layer "linux-fslc.inc" is:

    LICENSE = "GPLv2"

    LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

    DEPENDS += "lzop-native bc-native"

    PROVIDES = "virtual/kernel linux-mainline"

    inherit kernel

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

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

    SRCBRANCH ?= ""

    SRC_URI = "git://github.com/Freescale/linux-mainline.git;branch=${SRCBRANCH} \

               file://defconfig"

    LOCALVERSION = "-fslc"

 

The layer "linux-fslc_3.14.bbappend" is:

 

  # Which of these to supply a path to the .dts (and/or the defconfig)?

    FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

    FILESEXTRAPATHS_prepend := "${THISDIR}:${THISDIR}/mxs:"

    FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:${THISDIR}/mxs:${THISDIR}/${PN}/${PV}/git/arch/arm/boot/dts:"

 

    COMPATIBLE_MACHINE_mtd4000 = "mtd4000"      # Should this be appended or assigned ?

    KMACHINE_mtd4000 = "mtd4000"

Outcomes