diff --git a/documentation/bsp-guide/bsp.xml b/documentation/bsp-guide/bsp.xml index 7f793c896e..f9b4e66ea5 100644 --- a/documentation/bsp-guide/bsp.xml +++ b/documentation/bsp-guide/bsp.xml @@ -29,9 +29,14 @@ The information here does not provide an example of how to create a BSP. - For information on how to create a BSP, see the Yocto Project Development Manual or the - - wiki page. + For examples on how to create a BSP, see the + + BSP Development Example in + + The Yocto Project Development Manual. + You can also see the + + wiki page. @@ -116,31 +121,46 @@ meta-<bsp_name>/conf/machine/*.conf meta-<bsp_name>/recipes-bsp/* meta-<bsp_name>/recipes-graphics/* - meta-<bsp_name>/recipes-kernel/linux/linux-yocto_git.bbappend + meta-<bsp_name>/recipes-kernel/linux/linux-yocto_<kernel_rev>.bbappend - Below is an example of the Crownbay BSP: + Below is an example of the Crown Bay BSP: meta-crownbay/COPYING.MIT meta-crownbay/README - meta-crownbay/binary/.gitignore + meta-crownbay/binary + meta-crownbay/conf/ meta-crownbay/conf/layer.conf + meta-crownbay/conf/machine/ meta-crownbay/conf/machine/crownbay.conf - meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/machconfig + meta-crownbay/conf/machine/crownbay-noemgd.conf + meta-crownbay/recipes-bsp/ + meta-crownbay/recipes-bsp/formfactor/ meta-crownbay/recipes-bsp/formfactor/formfactor_0.0.bbappend - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xorg.conf + meta-crownbay/recipes-bsp/formfactor/formfactor/ + meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/ + meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/machconfig + meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay-noemgd/ + meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay-noemgd/machconfig + meta-crownbay/recipes-graphics/ + meta-crownbay/recipes-graphics/xorg-xserver/ + meta-crownbay/recipes-graphics/xorg-xserver/emgd-driver-bin_1.6.bb meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd-bin/.gitignore - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd-bin_1.7.99.2.bb - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/crosscompile.patch - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/fix_open_max_preprocessor_error.patch - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/macro_tweak.patch - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/nodolt.patch - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd_1.7.99.2.bb - meta-crownbay/recipes-kernel/linux/linux-yocto_git.bbappend + meta-crownbay/recipes-graphics/xorg-xserver/emgd-driver-bin-1.6/ + meta-crownbay/recipes-graphics/xorg-xserver/emgd-driver-bin-1.6/.gitignore + meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/ + meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/ + meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xorg.conf + meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay-noemgd/ + meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay-noemgd/xorg.conf + meta-crownbay/recipes-kernel/ + meta-crownbay/recipes-kernel/linux/ + meta-crownbay/recipes-kernel/linux/linux-yocto_2.6.34.bbappend + meta-crownbay/recipes-kernel/linux/linux-yocto_2.6.37.bbappend + meta-crownbay/recipes-kernel/linux/linux-yocto_3.0.bbappend @@ -161,7 +181,7 @@ These optional files satisfy licensing requirements for the BSP. The type or types of files here can vary depending on the licensing requirements. - For example, in the Crownbay BSP all licensing requirements are handled with the + For example, in the Crown Bay BSP all licensing requirements are handled with the COPYING.MIT file. @@ -223,14 +243,15 @@
Layer Configuration File - You can find these files in the Yocto Project file's directory structure at: + You can find this file in the Yocto Project file's directory structure at: - meta-<bsp_name>/conf/layer.conf + meta-<bsp_name>/conf/layer.conf - This file identifies the structure as a Yocto Project layer, identifies the + The conf/layer.conf file identifies the file structure as a Yocto + Project layer, identifies the contents of the layer, and contains information about how Yocto Project should use it. Generally, a standard boilerplate file such as the following works. In the following example you would replace "bsp" and "_bsp" with the actual name @@ -272,12 +293,13 @@ in the BSP into a format that the Yocto Project build system can understand. If the BSP supports multiple machines, multiple machine configuration files can be present. - These filenames correspond to the values to which users have set the MACHINE variable. + These filenames correspond to the values to which users have set the + MACHINE variable. These files define things such as the kernel package to use - (PREFERRED_PROVIDER of virtual/kernel), the hardware drivers to + (PREFERRED_PROVIDER of virtual/kernel), the hardware drivers to include in different types of images, any special software components that are needed, any bootloader information, and also any special image format requirements. @@ -286,6 +308,15 @@ At least one machine file is required for a BSP layer. However, you can supply more than one file. + For example, in the Crown Bay BSP shown earlier in this section, the + conf/machine directory contains two configuration files: + crownbay.conf and crownbay-noemgd.conf. + The crownbay.conf file is used for the Crown Bay BSP + that supports the Intel Embedded + Media and Graphics Driver (Intel + EMGD), while the crownbay-noemgd.conf file is used for the + Crown Bay BSP that does not support the Intel + EMGD. @@ -326,10 +357,16 @@ This optional directory contains miscellaneous recipe files for the BSP. Most notably would be the formfactor files. - For example, in the Crownbay BSP there is a machconfig file and a - formfactor_0.0.bbappend file: + For example, in the Crown Bay BSP there is the + formfactor_0.0.bbappend file, which is an append file used + to augment the recipe that starts the build. + Furthermore, there are machine-specific settings used during the build that are + defined by the machconfig files. + In the Crown Bay example, two machconfig files exist: + one that supports the Intel EMGD and one that does not: meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/machconfig + meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay-noemgd/machconfig meta-crownbay/recipes-bsp/formfactor/formfactor_0.0.bbappend @@ -353,17 +390,13 @@ This optional directory contains recipes for the BSP if it has special requirements for graphics support. All files that are needed for the BSP to support a display are kept here. - For example, in the Crownbay BSP several display support files exist: + For example, the Crown Bay BSP contains the following files that support + building a BSP that supports and does not support the Intel EMGD: - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xorg.conf + meta-crownbay/recipes-graphics/xorg-xserver/emgd-driver-bin_1.6.bb meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd-bin/.gitignore - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd-bin_1.7.99.2.bb - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/crosscompile.patch - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/fix_open_max_preprocessor_error.patch - eta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/macro_tweak.patch - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd/nodolt.patch - meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-emgd_1.7.99.2.bb + meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xorg.conf + meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay-noemgd/xorg.conf
@@ -373,65 +406,98 @@ You can find these files in the Yocto Project file's directory structure at: - meta-<bsp_name>/recipes-kernel/linux/linux-yocto_git.bbappend + meta-<bsp_name>/recipes-kernel/linux/linux-yocto_*.bbappend - This file appends your specific changes to the kernel you are using. + These files append your specific changes to the kernel you are using. - For your BSP you typically want to use an existing Yocto Project kernel found in the + For your BSP, you typically want to use an existing Yocto Project kernel found in the Yocto Project repository at meta/recipes-kernel/linux. - You can append your specific changes to the kernel recipe by using an append file, - which is located in the - meta-<bsp_name>/recipes-kernel/linux + You can append your specific changes to the kernel recipe by using a + similarly named append file, which is located in the + meta-<bsp_name>/recipes-kernel/linux directory. - Suppose you use a BSP that uses the linux-yocto_git.bb kernel, + Suppose you use a BSP that uses the linux-yocto_3.0.bb kernel, which is the preferred kernel to use for developing a new BSP using the Yocto Project. In other words, you have selected the kernel in your - <bsp_name>.conf file by adding the following statement: + <bsp_name>.conf file by adding the following statements: PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" + PREFERRED_VERSION_linux-yocto = "3.0%" - You would use the linux-yocto_git.bbappend file to append + You would use the linux-yocto_3.0.bbappend file to append specific BSP settings to the kernel, thus configuring the kernel for your particular BSP. - Now take a look at the existing Crownbay BSP. + As an example, look at the existing Crown Bay BSP. The append file used is: - meta-crownbay/recipes-kernel/linux/linux-yocto_git.bbappend + meta-crownbay/recipes-kernel/linux/linux-yocto_3.0.bbappend The file contains the following: - FILESEXTRAPATHS := "${THISDIR}/${PN}" + FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + COMPATIBLE_MACHINE_crownbay = "crownbay" - KMACHINE_crownbay = "yocto/standard/crownbay" + KMACHINE_crownbay = "yocto/standard/crownbay" + KERNEL_FEATURES_append_crownbay += " cfg/smp.scc" + + COMPATIBLE_MACHINE_crownbay-noemgd = "crownbay-noemgd" + KMACHINE_crownbay-noemgd = "yocto/standard/crownbay" + KERNEL_FEATURES_append_crownbay-noemgd += " cfg/smp.scc" + + SRCREV_machine_pn-linux-yocto_crownbay ?= "6b4b9acde5fb0ff66ae58fa98274bfe631501499" + SRCREV_meta_pn-linux-yocto_crownbay ?= "5b535279e61197cb194bb2dfceb8b7a04128387c" + + SRCREV_machine_pn-linux-yocto_crownbay-noemgd ?= "6b4b9acde5fb0ff66ae58fa98274bfe631501499" + SRCREV_meta_pn-linux-yocto_crownbay-noemgd ?= "5b535279e61197cb194bb2dfceb8b7a04128387c" - This append file adds Crownbay as a compatible machine, - and additionally sets a Yocto Kernel-specific variable that identifies the name of the - BSP branch to use in the Git repository to find configuration information. + This append file contains statements used to support the Crown Bay BSP that both + supports and does not support the Intel EMGD. + If, for example, you were going to build the BSP that did not support Intel EMGD, + you would simply comment out or delete the statements that support building + Crown Bay with Intel EMGD support. + So, the linux-yocto_3.0.bbappend could be as follows: + + FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + + COMPATIBLE_MACHINE_crownbay = "crownbay" + KMACHINE_crownbay = "yocto/standard/crownbay" + KERNEL_FEATURES_append_crownbay += " cfg/smp.scc" + + SRCREV_machine_pn-linux-yocto_crownbay ?= "6b4b9acde5fb0ff66ae58fa98274bfe631501499" + SRCREV_meta_pn-linux-yocto_crownbay ?= "5b535279e61197cb194bb2dfceb8b7a04128387c" + + The append file defines "crownbay" as the compatible machine, + defines the KMACHINE, points to some configuration fragments + to use by setting the KERNEL_FEATURES variable, and then points + to the specific commits in the Yocto Project files Git repository and the + meta Git repository branches to identify the exact kernel needed + to build the Crown Bay BSP. One thing missing in this particular BSP, which you will typically need when - developing a BSP, is the kernel configuration (.config) for your BSP. + developing a BSP, is the kernel configuration file (.config) for your BSP. When developing a BSP, you probably have a kernel configuration file or a set of kernel configuration files that, when taken together, define the kernel configuration for your BSP. You can accomplish this definition by putting the configurations in a file or a set of files inside a directory located at the same level as your append file and having the same name as the kernel. - With all these conditions met simply reference those files in a SRC_URI statement in the append - file. + With all these conditions met simply reference those files in a + SRC_URI statement in the append file. For example, suppose you had a set of configuration options in a file called defconfig. If you put that file inside a directory named - /linux-yocto and then added - a SRC_URI statement such as the following to the append file, those configuration + /linux-yocto and then added + a SRC_URI statement such as the following to the append file, + those configuration options will be picked up and applied when the kernel is built. SRC_URI += "file://defconfig" @@ -439,9 +505,9 @@ As mentioned earlier, you can group related configurations into multiple files and - name them all in the SRC_URI statement as well. + name them all in the SRC_URI statement as well. For example, you could group separate configurations specifically for Ethernet and graphics - into their own files and add those by using a SRC_URI statement like the + into their own files and add those by using a SRC_URI statement like the following in your append file: SRC_URI += "file://defconfig \ @@ -450,24 +516,24 @@ - The FILESEXTRAPATHS variable is in boilerplate form here in order to make it easy - to do that. + The FILESEXTRAPATHS variable is in boilerplate form here + in order to make it easy to do that. It basically allows those configuration files to be found by the build process. Other methods exist to accomplish grouping and defining configuration options. For example, you could directly add configuration options to the Yocto kernel - meta branch for your BSP. + meta branch for your BSP. The configuration options will likely end up in that location anyway if the BSP gets added to the Yocto Project. - For information on how to add these configurations directly, see the - "Yocto Project Kernel Architecture and Use Manual" on the - Yocto Project website - Documentation Page + For information on how to add these configurations directly, see + + The Yocto Project Kernel Architecture and Use Manual. - In general, however, the Yocto Project maintainers take care of moving the SRC_URI-specified - configuration options to the meta branch. + In general, however, the Yocto Project maintainers take care of moving the + SRC_URI-specified + configuration options to the meta branch. Not only is it easier for BSP developers to not have to worry about putting those configurations in the branch, but having the maintainers do it allows them to apply 'global' knowledge about the kinds of common configuration options multiple BSPs in