diff options
Diffstat (limited to 'documentation/bsp-guide')
-rw-r--r-- | documentation/bsp-guide/bsp.xml | 326 |
1 files changed, 251 insertions, 75 deletions
diff --git a/documentation/bsp-guide/bsp.xml b/documentation/bsp-guide/bsp.xml index 3cad0fd01..076c08cf6 100644 --- a/documentation/bsp-guide/bsp.xml +++ b/documentation/bsp-guide/bsp.xml @@ -33,7 +33,7 @@ It is intended that this information can be used by other systems besides Poky and OpenEmbedded and that it will be simple to extract information and convert it to other formats if required. - Poky, through its standard layers mechanism, can directly accept The format + Poky, through its standard layers mechanism, can directly accept the format described as a layer. The BSP captures all the hardware-specific details in one place in a standard format, which is @@ -63,62 +63,132 @@ "bsp_name" is a placeholder for the machine or platform name. Here are some example base directory names: <literallayout class='monospaced'> - meta-Emenlow + meta-emenlow meta-intel_n450 - meta-oaktrail + meta-beagleboard </literallayout> </para> <para> - The file structure inside the base directory takes on the following form: + Below is the common form for the file structure inside a base directory. + While you can use this basic form for the standard, realize that the actual structures + for specific BSPs could differ. + <programlisting> meta-<bsp_name>/ -meta-<bsp_name>/binary/zImage -meta-<bsp_name>/binary/poky-image-minimal.directdisk +meta-<bsp_name>/<bsp_license_file> +meta-<bsp_name>/README +meta-<bsp_name>/binary/<bootable_images> meta-<bsp_name>/conf/layer.conf -meta-<bsp_name>/conf/machine/*.conf -meta-<bsp_name>/conf/machine/include/tune-*.inc -meta-<bsp_name>/recipes-kernel/bootloader/bootloader_0.1.bb -meta-<bsp_name>/recipes-kernel/linux/linux-bsp-2.6.50/*.patch -meta-<bsp_name>/recipes-kernel/linux/linux-bsp-2.6.50/defconfig-bsp -meta-<bsp_name>/recipes-kernel/linux/linux-bsp_2.6.50.bb -meta-<bsp_name>/recipes-<bsp_name>/modem/modem-driver_0.1.bb -meta-<bsp_name>/recipes-<bsp_name>/modem/modem-daemon_0.1.bb -meta-<bsp_name>/recipes-<bsp_name>/image-creator/image-creator-native_0.1.bb -meta-<bsp_name>/prebuilds/ +meta-<bsp_name>/conf/machine/*.conf +meta-<bsp_name>/recipes-bsp/* +meta-<bsp_name>/recipes-graphics/* +meta-<bsp_name>/recipes-kernel/linux/linux-yocto-stable.bbappend </programlisting> </para> <para> - The following sections detail what these files and directories could contain. + Below is an example of the crownbay BSP: + + <programlisting> +meta-crownbay/COPYING.MIT +meta-crownbay/README +meta-crownbay/binary/.gitignore +meta-crownbay/conf/layer.conf +meta-crownbay/conf/machine/crownbay.conf +meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/machconfig +meta-crownbay/recipes-bsp/formfactor/formfactor_0.0.bbappend +meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xcorg.conf +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-wrs_git.bbappend + </programlisting> </para> - </section> + <para> + The following sections describe each part of the proposed BSP format. + </para> - <section id="bsp-filelayout-binary"> - <title>Pre-built User Binaries (meta-<bsp_name>/binary/*)</title> + <section id="bsp-filelayout-license"> + <title>License Files</title> + <programlisting> +meta-<bsp_name>/<bsp_license_file> + </programlisting> + + <para> + 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 + <filename>COPYING.MIT</filename> file. + </para> + + <para> + Licensing files can be MIT, BSD, GPLv*, and so forth. + These files are recommended for the BSP but are optional and totally up to the BSP developer. + </para> + </section> + + <section id="bsp-filelayout-readme"> + <title>README File</title> + <programlisting> +meta-<bsp_name>/README + </programlisting> + + <para> + This file provides information on how to boot the live images that are optionally + included in the <filename>/binary</filename> directory. + The <filename>README</filename> file also provides special information needed for + building the image. + </para> + + <para> + Technically speaking a <filename>README</filename> is optional but it is highly + recommended that every BSP has one. + </para> + </section> + + <section id="bsp-filelayout-binary"> + <title>Pre-built User Binaries</title> + <programlisting> +meta-<bsp_name>/binary/<bootable_images> + </programlisting> <para> This optional area contains useful pre-built kernels and userspace filesystem - images appropriate to the target system. + images appropriate to the target system. + This directory contains the Application Development Toolkit (ADT) and minimal + live images when the BSP is has been "tar-balled" and placed on the Yocto Project website. You can use these kernels and images to get a system running and quickly get started - on development tasks. + on development tasks. + </para> + + <para> The exact types of binaries present are highly hardware-dependent. - However, a README file should be present that explains how to use the kernels and - images with the target hardware. + However, a README file should be present in the BSP file structure that explains how to use + the kernels and images with the target hardware. If pre-built binaries are present, source code to meet licensing requirements must also be provided in some form. </para> - </section> + </section> - <section id='bsp-filelayout-layer'> - <title>Layer Configuration (meta-<bsp_name>/conf/layer.conf)</title> + <section id='bsp-filelayout-layer'> + <title>Layer Configuration File</title> + <programlisting> +meta-<bsp_name>/conf/layer.conf + </programlisting> <para> This file identifies the structure as a Poky layer, identifies the - contents of the layer, and contains information about how Poky should use - it. - Generally, a standard boilerplate file such as the following works: + contents of the layer, and contains information about how Poky 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 + of the BSP (i.e. <bsp_name> from the example template). </para> <para> @@ -139,10 +209,13 @@ BBFILE_PRIORITY_bsp = "5" This file simply makes BitBake aware of the recipes and configuration directories. This file must exist so that Poky can recognize the BSP. </para> - </section> + </section> - <section id="bsp-filelayout-machine"> - <title>Hardware Configuration Options (meta-<bsp_name>/conf/machine/*.conf)</title> + <section id="bsp-filelayout-machine"> + <title>Hardware Configuration Options</title> + <programlisting> +meta-<bsp_name>/conf/machine/*.conf + </programlisting> <para> The machine files bind together all the information contained elsewhere @@ -161,16 +234,12 @@ BBFILE_PRIORITY_bsp = "5" </para> <para> - At least one machine file is required for a Poky BSP layer. + At least one machine file is required for a BSP layer. However, you can supply more than one file. </para> - </section> - - <section id="bsp-filelayout-tune"> - <title>Hardware Optimization Options (meta-<bsp_name>/conf/machine/include/tune-*.inc)</title> <para> - These files are shared hardware "tuning" definitions and are commonly used to + This directory could also contain shared hardware "tuning" definitions that are commonly used to pass specific optimization flags to the compiler. An example is <filename>tune-atom.inc</filename>: </para> @@ -191,57 +260,163 @@ TARGET_CC_ARCH = "-m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse" files included with Poky itself. </para> <para> - Both the base package architecuture file and the tune file are optional for a Poky BSP layer. + Both the base package architecture file and the tune file are optional for a Poky BSP layer. </para> - </section> + </section> - <section id='bsp-filelayout-kernel'> - <title>Linux Kernel Configuration (meta-<bsp_name>/recipes-kernel/linux/*)</title> + <section id='bsp-filelayout-misc-recipes'> + <title>Miscellaneous Recipe Files</title> + <programlisting> +meta-<bsp_name>/recipes-bsp/* + </programlisting> <para> - These files make up the definition of a kernel to use with this hardware. - In this case, it is a complete self-contained kernel with its own - configuration and patches. - However, kernels can be shared between many machines as well. - Following is an example: - <programlisting> -meta-Emenlow/recipes-kernel/linux/linux-bsp_2.6.50.bb - </programlisting> - This example file is the core kernel recipe that details from where to get the kernel - source. - All standard source code locations are supported. - Consequently, the source could be a release tarball, a git repository, or source included in - the directory within the BSP itself. - </para> - <para> - The file then contains information about what patches to apply and how to configure and build them. - Because the file can reuse the main Poky kernel build class, the definitions here can - remain very simple. + 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 <filename>machconfig</filename> file and a + <filename>formfactor_0.0.bbappend</filename> file: + <programlisting> +meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/machconfig +meta-crownbay/recipes-bsp/formfactor/formfactor_0.0.bbappend + </programlisting> </para> + + <note><para> + If a BSP does not have a formfactor entry, defaults are established according to + the configuration script. + </para></note> + </section> + + <section id='bsp-filelayout-recipes-graphics'> + <title>Display Support Files</title> + <programlisting> +meta-<bsp_name>/recipes-graphics/* + </programlisting> + <para> + 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: <programlisting> -linux-bsp-2.6.50/*.patch +meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xcorg.conf +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 </programlisting> </para> + </section> + + <section id='bsp-filelayout-kernel'> + <title>Linux Kernel Configuration</title> + <programlisting> +meta-<bsp_name>/recipes-kernel/linux/linux-yocto-stable.bbappend + </programlisting> + + <para> + This file appends your specific changes to the kernel you are using. + </para> <para> - The above example file contains patches you can apply against the base kernel, from wherever - they may have been obtained. + For your BSP you typically want to use an existing Poky kernel found in the + Poky repository at <filename class='directory'>meta/recipes-kernel/kernel</filename>. + You can append your specific changes to the kernel recipe by using an append file, + which is located in the + <filename class='directory'>meta-<bsp_name>/recipes-kernel/linux</filename> + directory. </para> <para> + Suppose you use a BSP that uses the <filename>linux-yocto-stable_git.bb</filename> 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 + <filename><bsp_name>.conf</filename> file by adding the following statement: <programlisting> -meta-Emenlow/recipes-kernel/linux/linux-bsp-2.6.50/defconfig-bsp +PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-stable" </programlisting> + You would use the <filename>linux-yocto-stable_git.bbappend</filename> file to append + specific BSP settings to the kernel, thus configuring the kernel for your particular BSP. </para> <para> - Finally, this last example file contains kernel configuration information. + Now take a look at the existing "crownbay" BSP. + The append file used is: + <programlisting> +meta-crownbay/recipes-kernel/linux/linux-yocto-stable_git.bbappend + </programlisting> + The file contains the following: + <programlisting> +FILESEXTRAPATHS := "${THISDIR}/${PN}" +COMPATIBLE_MACHINE_crownbay = "crownbay" +KMACHINE_crownbay = "crownbay" + </programlisting> + 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. + </para> + <para> + One thing missing in this particular BSP, which you will typically need when + developing a BSP, is the kernel configuration (.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. + </para> + <para> + For example, suppose you had a set of configuration options in a file called + <filename>defconfig</filename>. + If you put that file inside a directory named + <filename class='directory'>/linux-yocto-stable</filename> 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. + <programlisting> +SRC_URI += "file://defconfig" + </programlisting> </para> <para> - Examples of kernel recipes are available in Poky itself, and thus, make these files optional. - However, it would be unusual not to have a kernel configuration. + As mentioned earlier, you can group related configurations into multiple files and + 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 + following in your append file: + <programlisting> +SRC_URI += "file://defconfig \ + file://eth.cfg \ + file://gfx.cfg" + </programlisting> </para> - </section> + <para> + The FILESEXTRAPATHS variable is boilerplated here in order to make it easy to do that. + It basically allows those configuration files to be found by the build process. + </para> + <note><para> + Other methods exist to accomplish grouping and defining configuration options. + For example, you could directly add configuration options to the Yocto kernel + <filename class='directory'>wrs_meta</filename> 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 + <ulink url="http://yoctoproject.org/community/documentation">Yocto Project website + Documentation Page</ulink> + </para> + <para> + In general, however, the Yocto Project maintainers take care of moving the SRC_URI-specified + configuration options to the <filename class='directory'>wrs_meta</filename> 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 + the tree are typically using. + This allows for promotion of common configurations into common features. + </para></note> + </section> - <section id='bsp-filelayout-packages'> +<!-- <section id='bsp-filelayout-packages'> <title>Other Software (meta-<bsp_name>/recipes-kernel/*)</title> <para> @@ -286,9 +461,9 @@ meta-Emenlow/recipes-Emenlow/modem/modem-daemon_0.1.bb meta-Emenlow/recipes-Emenlow/image-creator/image-creator-native_0.1.bb </programlisting> </para> - </section> + </section> - <section id='bs-filelayout-bbappend'> + <section id='bs-filelayout-bbappend'> <title>Append BSP-Specific Information to Existing Recipes</title> <para> Suppose you have a recipe such as "pointercal" that requires machine-specific information. @@ -306,7 +481,7 @@ meta-Emenlow/recipes-Emenlow/image-creator/image-creator-native_0.1.bb This allows the BSP layer to do whatever it might want to do to customize the original recipe. </para> <para> - If your recipe needs to reference extra files it can use the FILESEXTRAPATH variable + If your recipe needs to reference extra files it can use the FILESEXTRAPATHS variable to specify their location. The example below shows extra files contained in a folder called ${PN} (the package name). </para> @@ -318,9 +493,9 @@ FILESEXTRAPATHS := "${THISDIR}/${PN}" which will be picked up by BitBake. For an example see <filename>meta-emenlow/packages/formfactor</filename>. </para> - </section> + </section> - <section id="bsp-filelayout-prebuilds"> + <section id="bsp-filelayout-prebuilds"> <title>Pre-build Data (meta-<bsp_name>/prebuilds/*)</title> <para> This location can contain precompiled representations of the source code @@ -328,6 +503,7 @@ FILESEXTRAPATHS := "${THISDIR}/${PN}" Assuming a compatible configuration is used, Poky can process and use these optional pre-compiled representations to provide much faster build times. </para> + </section> --> </section> <section id='bsp-click-through-licensing'> |