Project

General

Profile

Using custom DTS in yocto flow

Added by Daniel Vincelette over 10 years ago

Posting on behalf of a customer and for future reference as well:

How do you get yocto to use a custom dts instead of the socfpga_mitysom5csx_devkit.dts?

The customer will be checking the kernel source and dts into version control and would be doing the yocto build locally.

I would guess that if they updated the SRC_URI in both meta-mitysom-5csx/recipes-kernel/linux/linux-libc-headers-mitysom-5csx.inc and meta-mitysom-5csx/recipes-kernel/linux/linux-mitysom-5csx.inc to point to file:/// instead of the git Critical Link git repo, would work. Or if they are using a supported version control protocol, I believe both svn and git are supported, the recipe could point directly to that.

Dan


Replies (1)

RE: Using custom DTS in yocto flow - Added by Michael Williamson over 10 years ago

Right now, the kernel recipe that gets used for our dev kit is indeed in the meta-mitysom-5csx/recipes-kernel/linux folder.

You will need to get familiar with bitbake and how recipes work for the yocto build system.

Here are the basic steps to change your kernel source / build / configuration:

Change your kernel source

If you investigate the bitbake recipe there you will find that the kernel source location is set by the SRC_URI variable in the linux-mitysom-5csx.inc. This variable currently points to the Critical Link git server, the latest commit on the socfpga-3.12 branch (for the 3.12 version of the kernel). If you want to use your own kernel source repository, you'll need to update this variable to point to your kernel source. You can use a local git server, local SVN server, a server serving up a tarball, or put a copy of your kernel right in your local repository.

Select your board config file

To tune the recipe to use a kernel configuration that is specific to your board and not the MitySOM-5CSX devkit, then you will need to modify the board configuration that will be used to configure the kernel. The board configuration is chosen based on the MACHINE_DEFCONFIG variable in your build/conf/local.conf file. Edit that variable to refer you your checked in build configuration file.

Install your Device Tree Block (DTB) file

Right now, the linux-mitysom-5csx.inc file "hardcodes" the device tree block to be "socfpga_mitysom5csx_devkit". On the line:

KERNEL_DEVICETREE = "socfpga_mitysom5csx_devkit "

Modify this line to be the following (we will patch our meta layer with this soon):

KERNEL_DEVICETREE ?= "socfpga_mitysom5csx_devkit "

This will set the KERNEL_DEVICETREE file (the base of the .dts file in the arch/arm/boot/dts area) to use the devkit file only if it is not already set. To set it for your custom board, edit your build/conf/local.conf file and add the following line:

KERNEL_DEVICETREE = "your_dtsbasefilename "

Don't include the ".dts" extension. You can actually build multiple DTB files if you like by adding additional whitespace separated variables. You should also bump the PR to "r2" or something in the linux-mitysom-5csx.inc file to ensure that you get a new build or force a clean of previous kernel builds.

Now when you build your kernel by bitbake virtual/kernel or when you create your filesystem you should get your kernel.

You might also update the linux-libc-headers-mitysom-5csx.inc file to point your the same SRC_URI for the kernel as your kernel build. The libc-headers are used when building your toolchain and libraries, etc. If you don't change kernel revisions or don't add custom APIs to the kernel, then you can leave it, but it's not really consistent.

    (1-1/1)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)