summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README9
-rw-r--r--classes/sdcard_image-rpi.bbclass11
-rw-r--r--conf/machine/include/rpi-default-providers.inc4
-rw-r--r--conf/machine/include/rpi-default-versions.inc1
-rw-r--r--conf/machine/raspberrypi.conf2
-rw-r--r--recipes-bcm/bootfiles/bcm2835-bootfiles.bb34
-rw-r--r--recipes-bcm/bootfiles/rpi-config_git.bb87
-rw-r--r--recipes-bsp/rpi-mkimage/rpi-mkimage/License25
-rw-r--r--recipes-bsp/rpi-mkimage/rpi-mkimage/open-files-relative-to-script.patch17
-rw-r--r--recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb22
-rw-r--r--recipes-bsp/u-boot/u-boot-rpi_git.bb29
11 files changed, 181 insertions, 60 deletions
diff --git a/README b/README
index 474c5f3..fc492c5 100644
--- a/README
+++ b/README
@@ -36,6 +36,7 @@ Contents:
36 2.E. Set overclocking options 36 2.E. Set overclocking options
37 2.F. Optional - Video camera support with V4L2 drivers 37 2.F. Optional - Video camera support with V4L2 drivers
38 2.G. Images 38 2.G. Images
39 2.H. Boot to U-Boot
393. Extra apps 403. Extra apps
40 3.A. omxplayer 41 3.A. omxplayer
414. Source code and mirrors 424. Source code and mirrors
@@ -146,6 +147,14 @@ VIDEO_CAMERA = "1"
146 Image based on rpi-basic-image which includes most of the packages in this 147 Image based on rpi-basic-image which includes most of the packages in this
147 layer and some media samples. 148 layer and some media samples.
148 149
1502.H. Boot to U-Boot
151===================
152To have u-boot load kernel image, set in your local.conf
153KERNEL_IMAGETYPE = "uImage"
154
155This will make kernel.img be u-boot image which will load uImage.
156By default, kernel.img is the actual kernel image (ex. Image).
157
149 158
1503. Extra apps 1593. Extra apps
151============= 160=============
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index 3ee4e94..179b7b7 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -45,6 +45,7 @@ IMAGE_DEPENDS_rpi-sdimg = " \
45 dosfstools-native \ 45 dosfstools-native \
46 virtual/kernel \ 46 virtual/kernel \
47 ${IMAGE_BOOTLOADER} \ 47 ${IMAGE_BOOTLOADER} \
48 ${@base_contains("KERNEL_IMAGETYPE", "uImage", "u-boot", "",d)} \
48 " 49 "
49 50
50# SD card image name 51# SD card image name
@@ -91,7 +92,15 @@ IMAGE_CMD_rpi-sdimg () {
91 BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }') 92 BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
92 mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS 93 mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
93 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ 94 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/
94 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::kernel.img 95 case "${KERNEL_IMAGETYPE}" in
96 "uImage")
97 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.img ::kernel.img
98 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::uImage
99 ;;
100 *)
101 mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::kernel.img
102 ;;
103 esac
95 104
96 if [ -n ${FATPAYLOAD} ] ; then 105 if [ -n ${FATPAYLOAD} ] ; then
97 echo "Copying payload into VFAT" 106 echo "Copying payload into VFAT"
diff --git a/conf/machine/include/rpi-default-providers.inc b/conf/machine/include/rpi-default-providers.inc
index f86aab4..3c5b294 100644
--- a/conf/machine/include/rpi-default-providers.inc
+++ b/conf/machine/include/rpi-default-providers.inc
@@ -1,9 +1,7 @@
1# RaspberryPi BSP default providers 1# RaspberryPi BSP default providers
2 2
3PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi" 3PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi"
4# The default kernel version is the same as used by Raspbian 4PREFERRED_PROVIDER_u-boot = "u-boot-rpi"
5PREFERRED_VERSION_linux-raspberrypi ?= "3.10.%"
6
7PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg" 5PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
8PREFERRED_PROVIDER_virtual/egl ?= "userland" 6PREFERRED_PROVIDER_virtual/egl ?= "userland"
9PREFERRED_PROVIDER_virtual/libgles2 ?= "userland" 7PREFERRED_PROVIDER_virtual/libgles2 ?= "userland"
diff --git a/conf/machine/include/rpi-default-versions.inc b/conf/machine/include/rpi-default-versions.inc
index fe60791..04297ba 100644
--- a/conf/machine/include/rpi-default-versions.inc
+++ b/conf/machine/include/rpi-default-versions.inc
@@ -1,2 +1,3 @@
1# RaspberryPi BSP default versions 1# RaspberryPi BSP default versions
2 2
3PREFERRED_VERSION_linux-raspberrypi ?= "3.10.%"
diff --git a/conf/machine/raspberrypi.conf b/conf/machine/raspberrypi.conf
index 1e619a7..1b3702f 100644
--- a/conf/machine/raspberrypi.conf
+++ b/conf/machine/raspberrypi.conf
@@ -22,7 +22,7 @@ XSERVER = " \
22 xf86-video-fbdev \ 22 xf86-video-fbdev \
23" 23"
24 24
25KERNEL_IMAGETYPE = "Image" 25KERNEL_IMAGETYPE ?= "Image"
26 26
27MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" 27MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
28 28
diff --git a/recipes-bcm/bootfiles/bcm2835-bootfiles.bb b/recipes-bcm/bootfiles/bcm2835-bootfiles.bb
index 36cbcf5..9751f95 100644
--- a/recipes-bcm/bootfiles/bcm2835-bootfiles.bb
+++ b/recipes-bcm/bootfiles/bcm2835-bootfiles.bb
@@ -3,6 +3,8 @@ LICENSE = "Proprietary"
3 3
4LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=e86e693d19572ee64cc8b17fb062faa9" 4LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=e86e693d19572ee64cc8b17fb062faa9"
5 5
6inherit deploy
7
6include ../common/firmware.inc 8include ../common/firmware.inc
7 9
8RDEPENDS_${PN} = "rpi-config" 10RDEPENDS_${PN} = "rpi-config"
@@ -13,21 +15,25 @@ S = "${RPIFW_S}/boot"
13 15
14PR = "r3" 16PR = "r3"
15 17
16addtask deploy before do_package after do_install
17
18do_deploy() { 18do_deploy() {
19 install -d ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles 19 install -d ${DEPLOYDIR}/${PN}
20 for i in *.elf ; do 20
21 cp $i ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles 21 for i in ${S}/*.elf ; do
22 done 22 cp $i ${DEPLOYDIR}/${PN}
23 for i in *.dat ; do 23 done
24 cp $i ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles 24 for i in ${S}/*.dat ; do
25 done 25 cp $i ${DEPLOYDIR}/${PN}
26 for i in *.bin ; do 26 done
27 cp $i ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles 27 for i in ${S}/*.bin ; do
28 done 28 cp $i ${DEPLOYDIR}/${PN}
29 # Add stamp in deploy directory 29 done
30 touch ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/${PN}-${PV}.stamp 30
31 # Add stamp in deploy directory
32 touch ${DEPLOYDIR}/${PN}/${PN}-${PV}.stamp
31} 33}
32 34
35addtask deploy before do_package after do_install
36do_deploy[dirs] += "${DEPLOYDIR}/${PN}"
37
33PACKAGE_ARCH = "${MACHINE_ARCH}" 38PACKAGE_ARCH = "${MACHINE_ARCH}"
39
diff --git a/recipes-bcm/bootfiles/rpi-config_git.bb b/recipes-bcm/bootfiles/rpi-config_git.bb
index 66a8fa8..9b5c1e6 100644
--- a/recipes-bcm/bootfiles/rpi-config_git.bb
+++ b/recipes-bcm/bootfiles/rpi-config_git.bb
@@ -15,49 +15,54 @@ S = "${WORKDIR}/git"
15 15
16PR = "r4" 16PR = "r4"
17 17
18addtask deploy before do_package after do_install 18inherit deploy
19 19
20do_deploy() { 20do_deploy() {
21 install -d ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles 21 install -d ${DEPLOYDIR}/bcm2835-bootfiles
22 cp config.txt ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/ 22
23 if [ -n "${KEY_DECODE_MPG2}" ]; then 23 cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/
24 sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 24
25 fi 25 if [ -n "${KEY_DECODE_MPG2}" ]; then
26 if [ -n "${KEY_DECODE_WVC1}" ]; then 26 sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
27 sed -i '/#decode_WVC1/ c\decode_MVC1=${KEY_DECODE_WVC1}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 27 fi
28 fi 28 if [ -n "${KEY_DECODE_WVC1}" ]; then
29 if [ -n "${DISABLE_OVERSCAN}" ]; then 29 sed -i '/#decode_WVC1/ c\decode_MVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
30 sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 30 fi
31 fi 31 if [ -n "${DISABLE_OVERSCAN}" ]; then
32 if [ -n "${ARM_FREQ}" ]; then 32 sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
33 sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 33 fi
34 fi 34 if [ -n "${ARM_FREQ}" ]; then
35 if [ -n "${CORE_FREQ}" ]; then 35 sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
36 sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 36 fi
37 fi 37 if [ -n "${CORE_FREQ}" ]; then
38 if [ -n "${SDRAM_FREQ}" ]; then 38 sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
39 sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 39 fi
40 fi 40 if [ -n "${SDRAM_FREQ}" ]; then
41 if [ -n "${OVER_VOLTAGE}" ]; then 41 sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
42 sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 42 fi
43 fi 43 if [ -n "${OVER_VOLTAGE}" ]; then
44 44 sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
45 # GPU memory 45 fi
46 if [ -n "${GPU_MEM}" ]; then 46
47 sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 47 # GPU memory
48 fi 48 if [ -n "${GPU_MEM}" ]; then
49 if [ -n "${GPU_MEM_256}" ]; then 49 sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
50 sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 50 fi
51 fi 51 if [ -n "${GPU_MEM_256}" ]; then
52 if [ -n "${GPU_MEM_512}" ]; then 52 sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
53 sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 53 fi
54 fi 54 if [ -n "${GPU_MEM_512}" ]; then
55 55 sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
56 # Video camera support 56 fi
57 if [ -n "${VIDEO_CAMERA}" ]; then 57
58 echo "# Enable video camera" >>${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 58 # Video camera support
59 echo "start_x=1" >>${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt 59 if [ -n "${VIDEO_CAMERA}" ]; then
60 fi 60 echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
61 echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
62 fi
61} 63}
62 64
65addtask deploy before do_package after do_install
66do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
67
63PACKAGE_ARCH = "${MACHINE_ARCH}" 68PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/recipes-bsp/rpi-mkimage/rpi-mkimage/License b/recipes-bsp/rpi-mkimage/rpi-mkimage/License
new file mode 100644
index 0000000..2582681
--- /dev/null
+++ b/recipes-bsp/rpi-mkimage/rpi-mkimage/License
@@ -0,0 +1,25 @@
1Copyright (c) 2012, Broadcom Europe Ltd
2All rights reserved.
3
4Redistribution and use in source and binary forms, with or without
5modification, are permitted provided that the following conditions are met:
6 * Redistributions of source code must retain the above copyright
7 notice, this list of conditions and the following disclaimer.
8 * Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution.
11 * Neither the name of the copyright holder nor the
12 names of its contributors may be used to endorse or promote products
13 derived from this software without specific prior written permission.
14
15THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
19DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
diff --git a/recipes-bsp/rpi-mkimage/rpi-mkimage/open-files-relative-to-script.patch b/recipes-bsp/rpi-mkimage/rpi-mkimage/open-files-relative-to-script.patch
new file mode 100644
index 0000000..fa9e88b
--- /dev/null
+++ b/recipes-bsp/rpi-mkimage/rpi-mkimage/open-files-relative-to-script.patch
@@ -0,0 +1,17 @@
1When using open, use path relative to imagetool-uncompressed.py
2
3Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
4
5Index: git/mkimage/imagetool-uncompressed.py
6===================================================================
7--- a/mkimage/imagetool-uncompressed.py
8+++ b/mkimage/imagetool-uncompressed.py
9@@ -18,7 +18,7 @@ re_line = re.compile(r"0x(?P<value>[0-9a
10 mem = [0 for i in range(32768)]
11
12 def load_to_mem(name, addr):
13- f = open(name)
14+ f = open(os.path.dirname(__file__) + '/' + name)
15
16 for l in f.readlines():
17 m = re_line.match(l)
diff --git a/recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb b/recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb
new file mode 100644
index 0000000..24da7a0
--- /dev/null
+++ b/recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb
@@ -0,0 +1,22 @@
1SUMMARY = "RaspberryPi tool to produce kernel.img"
2LICENSE = "Broadcom"
3LIC_FILES_CHKSUM = "file://${WORKDIR}/License;md5=957f6640d5e2d2acfce73a36a56cb32f"
4SECTION = "bootloader"
5
6DEPENDS = "python"
7
8SRCREV = "330c72c2412f75a32932c4d9b51c9c678bce4180"
9SRC_URI = " \
10 git://github.com/raspberrypi/tools.git;branch=master;protocol=git \
11 file://License \
12 file://open-files-relative-to-script.patch \
13"
14
15S = "${WORKDIR}/git"
16
17do_install () {
18 install -d ${D}${libexecdir}
19 cp ./mkimage/* ${D}${libexecdir}
20}
21
22BBCLASSEXTEND = "native"
diff --git a/recipes-bsp/u-boot/u-boot-rpi_git.bb b/recipes-bsp/u-boot/u-boot-rpi_git.bb
new file mode 100644
index 0000000..db5ea84
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-rpi_git.bb
@@ -0,0 +1,29 @@
1DESCRIPTION = "U-Boot port for RaspberryPi"
2
3require recipes-bsp/u-boot/u-boot.inc
4
5DEPENDS += "rpi-mkimage-native"
6
7PROVIDES += "u-boot"
8
9LICENSE = "GPLv2+"
10LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb"
11
12SRCREV = "6709570cdc947c2a546f96d571551acf4474778c"
13SRC_URI = "git://github.com/gonzoua/u-boot-pi.git;branch=rpi"
14
15S = "${WORKDIR}/git"
16
17UBOOT_MACHINE = "rpi_b"
18UBOOT_MAKE_TARGET = "u-boot.bin"
19UBOOT_SUFFIX = "img"
20
21PACKAGE_ARCH = "${MACHINE_ARCH}"
22
23COMPATIBLE_MACHINE = "raspberrypi"
24
25do_compile_append() {
26 # Create kernel.img from uboot.bin and name it u-boot.img
27 ${STAGING_DIR_NATIVE}/usr/lib/rpi-mkimage/imagetool-uncompressed.py u-boot.bin
28 mv kernel.img u-boot.img
29}