|
|
Line 13: |
Line 13: |
| | | |
| Please note some board have disable emmc in u-boot though the hardware actually have emmc. (firefly-rk3288) | | Please note some board have disable emmc in u-boot though the hardware actually have emmc. (firefly-rk3288) |
− |
| |
− |
| |
− |
| |
− | = Overall =
| |
− |
| |
− | Yocto has a ''powerful'' customization architecture that allows people create their own custom Linux distribution for their projectes. Compare to the desktop linux distribution(debian), it's more flexible to develop system/applcation with yocto. For examples, when we want to cross-compile gstreamer-rockchip on debian, we need prepare [http://opensource.rock-chips.com/wiki_Cross_Compile debian docker] and write [https://github.com/rockchip-linux/gstreamer-rockchip/tree/master/debian debian rules], on yocto, it just need a [https://github.com/rockchip-linux/meta-rockchip/blob/master/recipes-multimedia/gstreamer-rockchip/gstreamer1.0-rockchip_20170811.bb single bitbake file].
| |
− |
| |
− | Though it have lots of advantages, it's not recommend to use it to''' bring up new boards '''unless you are familier with rockchip stuff. Please follow the [[Linux_user_guide|Linux_user_guide]] and build/flash kernel/u-boot separately!
| |
− |
| |
− |
| |
− |
| |
− | = Getting the Sources =
| |
− |
| |
− | The rockchip linux SDK source tree is located in multi Git repository hosted by Github.<br/> The SDK uses repo to sync down source code.
| |
− |
| |
− | Create an empty directory to hold your working files
| |
− | <pre>mkdir rk-yocto-bsp
| |
− | cd rk-yocto-bsp
| |
− | </pre>
| |
− |
| |
− | <br/> To initialize Yocto SDK source tree
| |
− | <pre>repo init --repo-url=https://github.com/rockchip-linux/repo -u https://github.com/rockchip-linux/manifests -b yocto
| |
− | repo sync
| |
− | </pre>
| |
− |
| |
− |
| |
− |
| |
− | The above command will choose "''master''" branch of poky (rolling update).
| |
− |
| |
− | If you want to use a [https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance stable yocto branch], then use below comands.
| |
− | <pre>repo init --repo-url=https://github.com/rockchip-linux/repo -u https://github.com/rockchip-linux/manifests -b yocto -m pyro.xml
| |
− | </pre>
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | = Building the Sources =
| |
− |
| |
− | == Build environment ==
| |
− |
| |
− | The essential and graphical support packages you need for a supported Ubuntu or Debian distribution are shown in the following command. see [http://www.yoctoproject.org/docs/2.2.1/mega-manual/mega-manual.html#required-packages-for-the-host-development-system here] for detail.
| |
− | <pre>sudo apt-get install gawk wget git-core diffstat unzip texinfo build-essential chrpath socat cpio python python3 pip3 pexpect libsdl1.2-dev xterm make xsltproc docbook-utils fop dblatex xmlto python-git libssl-dev pv
| |
− | </pre>
| |
− |
| |
− | == Setup Yocto Environment ==
| |
− |
| |
− | For example, if you want to build a x11 backend image for tinker board, you should use "MACHINE=tinker-rk3288 DISTRO=rk-x11".
| |
− | <pre>mkdir <build_dir>
| |
− | MACHINE=<MACHINE> DISTRO=<DISTRO> . ./setup-environment -b <build_dir>
| |
− | </pre>
| |
− |
| |
− | == Start Building ==
| |
− | <pre>bitbake core-image-base
| |
− | </pre>
| |
− |
| |
− | Now you can find images under <build_dir>/tmp/deploy/images/<MACHINE>/.
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | = Flash Image =
| |
− |
| |
− | '''[http://opensource.rock-chips.com/wiki_Partitions reference : partition map]'''
| |
− |
| |
− | '''*gpt.img''' is as same as '''system.img''',''' '''which conatins the complete image.
| |
− |
| |
− | Flash eMMC:
| |
− | <pre>./flash_tool.sh -c rk3288 -p system -i <build_dir>/tmp/deploy/images/<MACHINE>/*gpt.img
| |
− | </pre>
| |
− |
| |
− | Burn SD-Card:
| |
− | <pre>./flash_tool.sh -c rk3288 -d /dev/sdc -p system -i <build_dir>/tmp/deploy/images/<MACHINE>/*gpt.img
| |
− | </pre>
| |
− |
| |
− | To update kernel/dtb/extlinux, boot partition should be updated.
| |
− | <pre>./flash_tool.sh -c rk3288 -p boot -i <build_dir>/tmp/deploy/images/<MACHINE>/*boot.img
| |
− | </pre>
| |
− |
| |
− | To update u-boot, it's kind of complex, please refer to [http://opensource.rock-chips.com/wiki_Boot_option Boot_option]. All necessary binarys can be found in the deploy directory and rkbin directory.
| |
− |
| |
− |
| |
− |
| |
− | = Mainline/Upstream =
| |
− |
| |
− | Meta-rockchip layer support mainline kernel and have patch it for GPU/VPU features.
| |
− |
| |
− | To use mainline kernel, please change
| |
− |
| |
− | PREFERRED_PROVIDER_virtual/kernel = "linux-rockchip"
| |
− |
| |
− | in machine/include/*.conf to
| |
− |
| |
− | PREFERRED_PROVIDER_virtual/kernel = "linux-mainline"
| |
− |
| |
− | <del>Mainline U-boot/ARM-Trust-Firmware are also available, by including</del>
| |
− |
| |
− | <del>include conf/machine/include/openloader.inc.inc</del>
| |
− |
| |
− | <del>in machine/*.conf.</del>
| |
− |
| |
− |
| |
− |
| |
− | = Demo Layer =
| |
− |
| |
− | There are some layers for the spefic prototype under '''[https://github.com/rockchip-linux/meta-rockchip-extra/tree/master/demo meta-rockchip-extra/demo].'''
| |
− |
| |
− | {| border="1"
| |
− | |-
| |
− | ! Prototype
| |
− | ! Introduction
| |
− | |-
| |
− | | QT Player
| |
− | | A play based on QT EGLFS plugin + QTMultimedia, make the video layer at the bottom.
| |
− | |}
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | = Available =
| |
− |
| |
− | == Images ==
| |
− |
| |
− | {| border="1"
| |
− | |-
| |
− | ! Chip
| |
− | ! Graphics
| |
− | |-
| |
− | | rk-image-base
| |
− | | Rockchip base Image.
| |
− | |-
| |
− | | rk-image-multimedia
| |
− | | Image with Rockchip's multimedia packages.
| |
− | |-
| |
− | | rk-image-machine-test
| |
− | | Image with Test tools for developing, testing and benchmark.
| |
− | |-
| |
− | | qt5-image
| |
− | | Image with qt packages.
| |
− | |}
| |
− |
| |
− | == [https://github.com/rockchip-linux/meta-rockchip/tree/master/conf/machine Boards] ==
| |
− |
| |
− | [https://github.com/rockchip-linux/meta-rockchip/tree/master/conf/machine https://github.com/rockchip-linux/meta-rockchip/tree/master/conf/machine]
| |
− |
| |
− |
| |
− |
| |
− | = Developer Guide =
| |
− |
| |
− | == [[Qt|Qt in Yocto]] ==
| |
− |
| |
− | == Apllication/kernel/u-boot ==
| |
− |
| |
− | All build file and code source are in the ''tmp''/work/ or tmp/work-shared subdirectory of the Build Directory.
| |
− | <pre>e.g : u-boot : tmp/work/excavator_rk3399-rk-linux/u-boot-rockchip/20170901-r0/git</pre>
| |
− |
| |
− | Once you have update the code, you should issue command like "bitbake u-boot-rockchip -c compile -f && bitbake u-boot-rockchip" to force it recompile and deploy.
| |
− |
| |
− |
| |
− |
| |
− | == Tips ==
| |
− |
| |
− | *To make an image for suitable of development, you can add "tools-debug debug-tweaks dbg-pkgs" to EXTRA_IMAGE_FEATURES in local.conf to get tools like gdb and add " sshfs-fuse dhcp-client" to "IMAGE_INSTALL_append" to use sshfs for remote transfer. e.g. EXTRA_IMAGE_FEATURES = "tools-debug tools-profile tools-testapps dbg-pkgs debug-tweaks" IMAGE_INSTALL_append = “ sshfs-fuse dhcp-client”
| |
− | *To use local source, you could change SRC_URI in bb file to "[git:///home/debian/kernel.git;protocol=file;nocheckout=1;branch=release-4.4 git:///home/debian/kernel.git;protocol=file;nocheckout=1;branch=release-4.4]"
| |
PMIC setting usually is just important in kernel, but for the board using rk818, USB input current should be configured during boot stage.
Please note some board have disable emmc in u-boot though the hardware actually have emmc. (firefly-rk3288)