U-boot integration - first stage
Subsystems (2)
cover U-boot integration - first stage
At this stage uboot is not usable as somehow - don't know why yet - I can't read uImage from sdcard. Seems to be something related to the uboot sdhci driver. If anybody knows/suspects where the issue might be, please hit me a reply.
Andrei Gherzan (9):
bcm2835-bootfiles: Use deploy as it should be used
rpi-config: Use deploy as it should be used
rpi-default-providers: Use u-boot-rpi as u-boot provider
rpi-default-providers: Move PREFERRED_VERSIONs to
rpi-default-versions.inc
raspberrypi.conf: Let KERNEL_IMAGETYPE be modified
sdcard_image-rpi: Add support for u-boot and uImage
README: Add info about U-Boot support
u-boot-rpi: Integrate package
rpi-mkimage: Integrate package
README | 9 +++ classes/sdcard_image-rpi.bbclass | 11 ++- conf/machine/include/rpi-default-providers.inc | 4 +- conf/machine/include/rpi-default-versions.inc | 1 + conf/machine/raspberrypi.conf | 2 +- recipes-bcm/bcm2835/bcm2835_1.34.bb | 41 ---------- recipes-bcm/bcm2835/bcm2835_1.36.bb | 41 ++++++++++ recipes-bcm/bootfiles/bcm2835-bootfiles.bb | 34 +++++---- recipes-bcm/bootfiles/rpi-config_git.bb | 87 ++++++++++++---------- recipes-bsp/rpi-mkimage/rpi-mkimage/License | 25 +++++++ .../open-files-relative-to-script.patch | 17 +++++ recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb | 22 ++++++ recipes-bsp/u-boot/u-boot-rpi_git.bb | 29 ++++++++ .../packagegroups/packagegroup-rpi-test.bb | 4 +- recipes-devtools/python/rpi-gpio_0.5.3a.bb | 20 ----- recipes-devtools/python/rpi-gpio_0.5.4.bb | 19 +++++ ...nd-headers-from-ffmpeg-are-installed-in-u.patch | 24 +++--- .../omxplayer/fix-tar-command-with-DIST.patch | 18 +++++ recipes-multimedia/omxplayer/omxplayer_git.bb | 10 ++- 19 files changed, 279 insertions(+), 139 deletions(-) delete mode 100644 recipes-bcm/bcm2835/bcm2835_1.34.bb create mode 100644 recipes-bcm/bcm2835/bcm2835_1.36.bb create mode 100644 recipes-bsp/rpi-mkimage/rpi-mkimage/License create mode 100644 recipes-bsp/rpi-mkimage/rpi-mkimage/open-files-relative-to-script.patch create mode 100644 recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb create mode 100644 recipes-bsp/u-boot/u-boot-rpi_git.bb delete mode 100644 recipes-devtools/python/rpi-gpio_0.5.3a.bb create mode 100644 recipes-devtools/python/rpi-gpio_0.5.4.bb create mode 100644 recipes-multimedia/omxplayer/omxplayer/fix-tar-command-with-DIST.patch
--
1.8.1.4
PATCH 1/9 bcm2835-bootfiles: Use deploy as it should be used
--- recipes-bcm/bootfiles/bcm2835-bootfiles.bb | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-)
recipes-bcm/bootfiles/bcm2835-bootfiles.bb +20 -14
@@ -3,6 +3,8 @@ LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=e86e693d19572ee64cc8b17fb062faa9" +inherit deploy + include ../common/firmware.inc RDEPENDS_${PN} = "rpi-config"
@@ -13,21 +15,25 @@ S = "${RPIFW_S}/boot" PR = "r3" -addtask deploy before do_package after do_install - do_deploy() { - install -d ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles - for i in *.elf ; do - cp $i ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles - done - for i in *.dat ; do - cp $i ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles - done - for i in *.bin ; do - cp $i ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles - done - # Add stamp in deploy directory - touch ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/${PN}-${PV}.stamp + install -d ${DEPLOYDIR}/${PN} + + for i in ${S}/*.elf ; do + cp $i ${DEPLOYDIR}/${PN} + done + for i in ${S}/*.dat ; do + cp $i ${DEPLOYDIR}/${PN} + done + for i in ${S}/*.bin ; do + cp $i ${DEPLOYDIR}/${PN} + done + + # Add stamp in deploy directory + touch ${DEPLOYDIR}/${PN}/${PN}-${PV}.stamp } +addtask deploy before do_package after do_install +do_deploy[dirs] += "${DEPLOYDIR}/${PN}" + PACKAGE_ARCH = "${MACHINE_ARCH}" +
Signature · 1 line
1.8.1.4
PATCH 2/9 rpi-config: Use deploy as it should be used
In reply to Andrei Gherzan--- recipes-bcm/bootfiles/rpi-config_git.bb | 87 +++++++++++++++++---------------- 1 file changed, 46 insertions(+), 41 deletions(-)
recipes-bcm/bootfiles/rpi-config_git.bb +46 -41
@@ -15,49 +15,54 @@ S = "${WORKDIR}/git" PR = "r4" -addtask deploy before do_package after do_install +inherit deploy do_deploy() { - install -d ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles - cp config.txt ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/ - if [ -n "${KEY_DECODE_MPG2}" ]; then - sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${KEY_DECODE_WVC1}" ]; then - sed -i '/#decode_WVC1/ c\decode_MVC1=${KEY_DECODE_WVC1}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${DISABLE_OVERSCAN}" ]; then - sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${ARM_FREQ}" ]; then - sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${CORE_FREQ}" ]; then - sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${SDRAM_FREQ}" ]; then - sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${OVER_VOLTAGE}" ]; then - sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - - # GPU memory - if [ -n "${GPU_MEM}" ]; then - sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${GPU_MEM_256}" ]; then - sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - if [ -n "${GPU_MEM_512}" ]; then - sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi - - # Video camera support - if [ -n "${VIDEO_CAMERA}" ]; then - echo "# Enable video camera" >>${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - echo "start_x=1" >>${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/config.txt - fi + install -d ${DEPLOYDIR}/bcm2835-bootfiles + + cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/ + + if [ -n "${KEY_DECODE_MPG2}" ]; then + sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${KEY_DECODE_WVC1}" ]; then + sed -i '/#decode_WVC1/ c\decode_MVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${DISABLE_OVERSCAN}" ]; then + sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${ARM_FREQ}" ]; then + sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${CORE_FREQ}" ]; then + sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${SDRAM_FREQ}" ]; then + sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${OVER_VOLTAGE}" ]; then + sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # GPU memory + if [ -n "${GPU_MEM}" ]; then + sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${GPU_MEM_256}" ]; then + sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${GPU_MEM_512}" ]; then + sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Video camera support + if [ -n "${VIDEO_CAMERA}" ]; then + echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi } +addtask deploy before do_package after do_install +do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles" + PACKAGE_ARCH = "${MACHINE_ARCH}"
Signature · 1 line
1.8.1.4
PATCH 3/9 rpi-default-providers: Use u-boot-rpi as u-boot provider
In reply to Andrei Gherzan--- conf/machine/include/rpi-default-providers.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
conf/machine/include/rpi-default-providers.inc +2 -1
@@ -1,9 +1,10 @@ # RaspberryPi BSP default providers PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi" -# The default kernel version is the same as used by Raspbian PREFERRED_VERSION_linux-raspberrypi ?= "3.10.%" +PREFERRED_PROVIDER_u-boot = "u-boot-rpi" + PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg" PREFERRED_PROVIDER_virtual/egl ?= "userland" PREFERRED_PROVIDER_virtual/libgles2 ?= "userland"
Signature · 1 line
1.8.1.4
PATCH 4/9 rpi-default-providers: Move PREFERRED_VERSIONs to rpi-default-versions.inc
In reply to Andrei Gherzan--- conf/machine/include/rpi-default-providers.inc | 3 --- conf/machine/include/rpi-default-versions.inc | 1 + 2 files changed, 1 insertion(+), 3 deletions(-)
conf/machine/include/rpi-default-providers.inc +0 -3
@@ -1,10 +1,7 @@ # RaspberryPi BSP default providers PREFERRED_PROVIDER_virtual/kernel = "linux-raspberrypi" -PREFERRED_VERSION_linux-raspberrypi ?= "3.10.%" - PREFERRED_PROVIDER_u-boot = "u-boot-rpi" - PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg" PREFERRED_PROVIDER_virtual/egl ?= "userland" PREFERRED_PROVIDER_virtual/libgles2 ?= "userland"
conf/machine/include/rpi-default-versions.inc +1 -0
@@ -1,2 +1,3 @@ # RaspberryPi BSP default versions +PREFERRED_VERSION_linux-raspberrypi ?= "3.10.%"
Signature · 1 line
1.8.1.4
PATCH 5/9 raspberrypi.conf: Let KERNEL_IMAGETYPE be modified
In reply to Andrei Gherzan--- conf/machine/raspberrypi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
conf/machine/raspberrypi.conf +1 -1
@@ -22,7 +22,7 @@ XSERVER = " \ xf86-video-fbdev \ " -KERNEL_IMAGETYPE = "Image" +KERNEL_IMAGETYPE ?= "Image" MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
Signature · 1 line
1.8.1.4
PATCH 6/9 sdcard_image-rpi: Add support for u-boot and uImage
In reply to Andrei GherzanIf KERNEL_IMAGETYPE is uImage, use u-boot image as kernel.img and copy uImage too. Otherwise, use kernel image as kernel.img (as we did until now unconditionally).
--- classes/sdcard_image-rpi.bbclass | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
classes/sdcard_image-rpi.bbclass +10 -1
@@ -45,6 +45,7 @@ IMAGE_DEPENDS_rpi-sdimg = " \ dosfstools-native \ virtual/kernel \ ${IMAGE_BOOTLOADER} \ + ${@base_contains("KERNEL_IMAGETYPE", "uImage", "u-boot", "",d)} \ " # SD card image name
@@ -91,7 +92,15 @@ IMAGE_CMD_rpi-sdimg () { BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }') mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::kernel.img + case "${KERNEL_IMAGETYPE}" in + "uImage") + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.img ::kernel.img + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::uImage + ;; + "*") + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::kernel.img + ;; + esac if [ -n ${FATPAYLOAD} ] ; then echo "Copying payload into VFAT"
Signature · 1 line
1.8.1.4
PATCH 7/9 README: Add info about U-Boot support
In reply to Andrei Gherzan--- README | 9 +++++++++ 1 file changed, 9 insertions(+)
README +9 -0
@@ -36,6 +36,7 @@ Contents: 2.E. Set overclocking options 2.F. Optional - Video camera support with V4L2 drivers 2.G. Images + 2.H. Boot to U-Boot 3. Extra apps 3.A. omxplayer 4. Source code and mirrors
@@ -146,6 +147,14 @@ VIDEO_CAMERA = "1" Image based on rpi-basic-image which includes most of the packages in this layer and some media samples. +2.H. Boot to U-Boot +=================== +To have u-boot load kernel image, set in your local.conf +KERNEL_IMAGETYPE = "uImage" + +This will make kernel.img be u-boot image which will load uImage. +By default, kernel.img is the actual kernel image (ex. Image). + 3. Extra apps =============
Signature · 1 line
1.8.1.4
PATCH 8/9 u-boot-rpi: Integrate package
In reply to Andrei Gherzan--- recipes-bsp/u-boot/u-boot-rpi_git.bb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot-rpi_git.bb
recipes-bsp/u-boot/u-boot-rpi_git.bb new file +29 -0
@@ -0,0 +1,29 @@ +DESCRIPTION = "U-Boot port for RaspberryPi" + +require recipes-bsp/u-boot/u-boot.inc + +DEPENDS += "rpi-mkimage-native" + +PROVIDES += "u-boot" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb" + +SRCREV = "6709570cdc947c2a546f96d571551acf4474778c" +SRC_URI = "git://github.com/gonzoua/u-boot-pi.git;branch=rpi" + +S = "${WORKDIR}/git" + +UBOOT_MACHINE = "rpi_b" +UBOOT_MAKE_TARGET = "u-boot.bin" +UBOOT_SUFFIX = "img" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +COMPATIBLE_MACHINE = "raspberrypi" + +do_compile_append() { + # Create kernel.img from uboot.bin and name it u-boot.img + ${STAGING_DIR_NATIVE}/usr/lib/rpi-mkimage/imagetool-uncompressed.py u-boot.bin + mv kernel.img u-boot.img +}
Signature · 1 line
1.8.1.4
PATCH 9/9 rpi-mkimage: Integrate package
In reply to Andrei GherzanTool needed to convert bootable images in kernel.img files which can be loaded by rpi bootloader.
--- recipes-bsp/rpi-mkimage/rpi-mkimage/License | 25 ++++++++++++++++++++++ .../open-files-relative-to-script.patch | 17 +++++++++++++++ recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb | 22 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 recipes-bsp/rpi-mkimage/rpi-mkimage/License create mode 100644 recipes-bsp/rpi-mkimage/rpi-mkimage/open-files-relative-to-script.patch create mode 100644 recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb
recipes-bsp/rpi-mkimage/rpi-mkimage/License new file +25 -0
@@ -0,0 +1,25 @@ +Copyright (c) 2012, Broadcom Europe Ltd +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +
recipes-bsp/rpi-mkimage/rpi-mkimage/open-files-relative-to-script.patch new file +17 -0
@@ -0,0 +1,17 @@ +When using open, use path relative to imagetool-uncompressed.py + +Signed-off-by: Andrei Gherzan <[email protected]> + +Index: git/mkimage/imagetool-uncompressed.py +=================================================================== +--- a/mkimage/imagetool-uncompressed.py ++++ b/mkimage/imagetool-uncompressed.py +@@ -18,7 +18,7 @@ re_line = re.compile(r"0x(?P<value>[0-9a + mem = [0 for i in range(32768)] + + def load_to_mem(name, addr): +- f = open(name) ++ f = open(os.path.dirname(__file__) + '/' + name) + + for l in f.readlines(): + m = re_line.match(l)
recipes-bsp/rpi-mkimage/rpi-mkimage_git.bb new file +22 -0
@@ -0,0 +1,22 @@ +SUMMARY = "RaspberryPi tool to produce kernel.img" +LICENSE = "Broadcom" +LIC_FILES_CHKSUM = "file://${WORKDIR}/License;md5=957f6640d5e2d2acfce73a36a56cb32f" +SECTION = "bootloader" + +DEPENDS = "python" + +SRCREV = "330c72c2412f75a32932c4d9b51c9c678bce4180" +SRC_URI = " \ + git://github.com/raspberrypi/tools.git;branch=master;protocol=git \ + file://License \ + file://open-files-relative-to-script.patch \ +" + +S = "${WORKDIR}/git" + +do_install () { + install -d ${D}${libexecdir} + cp ./mkimage/* ${D}${libexecdir} +} + +BBCLASSEXTEND = "native"
Signature · 1 line
1.8.1.4
Quoted 5 lines · Andrei Gherzan
At this stage uboot is not usable as somehow - don't know why yet - I can't read uImage from sdcard. Seems to be something related to the uboot sdhci driver. If anybody knows/suspects where the issue might be, please hit me a reply.
Quoted 12 lines
Andrei Gherzan (9):
bcm2835-bootfiles: Use deploy as it should be used
rpi-config: Use deploy as it should be used
rpi-default-providers: Use u-boot-rpi as u-boot provider
rpi-default-providers: MovePREFERRED_VERSIONsto
rpi-default-versions.inc
raspberrypi.conf: LetKERNEL_IMAGETYPEbe modified
sdcard_image-rpi: Add support for u-boot and uImage
README: Add info about U-Boot support
u-boot-rpi: Integrate package
rpi-mkimage: Integrate package
All these merged.
Signature · 2 lines
*Andrei Gherzan* m: +40.744.478.414 | f: +40.31.816.28.12