Skip to content

Commit

Permalink
merge: sync repository with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bensoussan committed Oct 16, 2017
2 parents 0f79540 + fe99478 commit f3cd2eb
Show file tree
Hide file tree
Showing 26 changed files with 352 additions and 409 deletions.
29 changes: 0 additions & 29 deletions classes/linux-raspberrypi-base.bbclass

This file was deleted.

43 changes: 23 additions & 20 deletions classes/sdcard_image-rpi.bbclass
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
inherit image_types
inherit linux-raspberrypi-base

#
# Create an image that can by written onto a SD card using dd.
Expand Down Expand Up @@ -49,15 +48,15 @@ IMAGE_ROOTFS_ALIGNMENT = "4096"

# Use an uncompressed ext3 by default as rootfs
SDIMG_ROOTFS_TYPE ?= "ext3"
SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}"
SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${SDIMG_ROOTFS_TYPE}"

do_image_rpi_sdimg[depends] = " \
parted-native:do_populate_sysroot \
mtools-native:do_populate_sysroot \
dosfstools-native:do_populate_sysroot \
virtual/kernel:do_deploy \
${IMAGE_BOOTLOADER}:do_deploy \
${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'u-boot:do_deploy', '',d)} \
${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
"

# SD card image name
Expand All @@ -77,6 +76,17 @@ FATPAYLOAD ?= ""
SDIMG_VFAT = "${IMAGE_NAME}.vfat"
SDIMG_LINK_VFAT = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.vfat"

def split_overlays(d, out, ver=None):
dts = d.getVar("KERNEL_DEVICETREE")
if out:
overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d)
overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d)
else:
overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) + \
" " + oe.utils.str_filter('\S+\.dtbo$', dts, d)

return overlays

IMAGE_CMD_rpi-sdimg () {

# Align partitions
Expand All @@ -87,7 +97,7 @@ IMAGE_CMD_rpi-sdimg () {
echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB"

# Check if we are building with device tree support
DTS="${@get_dts(d)}"
DTS="${KERNEL_DEVICETREE}"

# Initialize sdcard image file
dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
Expand Down Expand Up @@ -127,16 +137,13 @@ IMAGE_CMD_rpi-sdimg () {
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.${DTB_EXT} ::overlays/${DTB_BASE_NAME}.${DTB_EXT}
done
fi
case "${KERNEL_IMAGETYPE}" in
"uImage")
if [ "${RPI_USE_U_BOOT}" = "1" ]; then
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.bin ::${SDIMG_KERNELIMAGE}
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::uImage
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${KERNEL_IMAGETYPE}
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr
;;
*)
else
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${SDIMG_KERNELIMAGE}
;;
esac
fi

if [ -n ${FATPAYLOAD} ] ; then
echo "Copying payload into VFAT"
Expand All @@ -151,23 +158,19 @@ IMAGE_CMD_rpi-sdimg () {
mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info ::

# Deploy vfat partition (for u-boot case only)
case "${KERNEL_IMAGETYPE}" in
"uImage")
if [ "${RPI_USE_U_BOOT}" = "1" ]; then
cp ${WORKDIR}/boot.img ${IMGDEPLOYDIR}/${SDIMG_VFAT}
ln -sf ${SDIMG_VFAT} ${SDIMG_LINK_VFAT}
;;
*)
;;
esac
fi

# Burn Partitions
dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
# If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz"
then
xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
else
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
fi

# Optionally apply compression
Expand Down
9 changes: 9 additions & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ BBFILE_PRIORITY_raspberrypi = "9"
# Additional license directories.
LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"

# The dynamic-layers directory hosts the extensions and layer specific
# modifications.
#
# The .bbappend and .bb files are included if the respective layer
# collection is available.
BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bbappend' % layer \
for layer in BBFILE_COLLECTIONS.split())}"
BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bb' % layer \
for layer in BBFILE_COLLECTIONS.split())}"
22 changes: 18 additions & 4 deletions conf/machine/include/rpi-base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,17 @@ KERNEL_DEVICETREE ?= " \
overlays/pi3-miniuart-bt.dtbo \
overlays/vc4-kms-v3d.dtbo \
"
KERNEL_IMAGETYPE ?= "Image"

# By default:
#
# * When u-boot is disabled use the "Image" format which can be directly loaded
# by the rpi firmware.
#
# * When u-boot is enabled use the "uImage" format and the "bootm" command
# within u-boot to load the kernel.
KERNEL_BOOTCMD ??= "bootm"
KERNEL_IMAGETYPE_UBOOT ??= "uImage"
KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', '${KERNEL_IMAGETYPE_UBOOT}', 'Image', d)}"

MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"

Expand Down Expand Up @@ -83,10 +93,14 @@ def make_dtb_boot_files(d):

IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \
${@make_dtb_boot_files(d)} \
${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', '${KERNEL_IMAGETYPE}', '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'u-boot.bin;${SDIMG_KERNELIMAGE}', '', d)} \
${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'boot.scr;boot.scr', '', d)} \
${@bb.utils.contains('RPI_USE_U_BOOT', '1', \
'${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
'${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
"
do_image_wic[depends] += " \
bcm2835-bootfiles:do_deploy \
${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \
"

# The kernel image is installed into the FAT32 boot partition and does not need
# to also be installed into the rootfs.
Expand Down
5 changes: 5 additions & 0 deletions conf/machine/raspberrypi3-64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ VC4_CMA_SIZE ?= "cma-256"

UBOOT_MACHINE = "rpi_3_config"
MACHINE_FEATURES_append = " vc4graphics"

# When u-boot is enabled we need to use the "Image" format and the "booti"
# command to load the kernel
KERNEL_IMAGETYPE_UBOOT ?= "Image"
KERNEL_BOOTCMD ?= "booti"
6 changes: 0 additions & 6 deletions docs/extra-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@ able to compile omxplayer you will need to whiteflag the commercial
license in your local.conf:

LICENSE_FLAGS_WHITELIST = "commercial"
## raspberrypi3-64

Currently, raspberrypi3-64 does not boot into graphics, this needs more investigation
and fixes, until then none of images using graphics stack would boot into UI, although
the system would be up and ready, graphics wont come up. One can use serial console or
remote login to get into system
8 changes: 5 additions & 3 deletions docs/extra-build-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ To disable rpi boot logo, set this variable in local.conf:

To have u-boot load kernel image, set in your local.conf:

KERNEL_IMAGETYPE = "uImage"
RPI_USE_U_BOOT = "1"

This will make kernel.img be u-boot image which will load uImage. By default,
kernel.img is the actual kernel image (ex. Image).
This will select the appropriate image format for use with u-boot automatically.
For further customisation the KERNEL_IMAGETYPE and KERNEL_BOOTCMD variables can
be overridden to select the exact kernel image type (eg. zImage) and u-boot
command (eg. bootz) to be used.

## Image with Initramfs

Expand Down
3 changes: 0 additions & 3 deletions recipes-bsp/bootfiles/rpi-config_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ do_deploy_append_raspberrypi3-64() {
echo "# have a properly sized image" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "disable_overscan=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt

echo "# for sound over HDMI" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "hdmi_drive=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt

echo "# Enable audio (loads snd_bcm2835)" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt

Expand Down
3 changes: 0 additions & 3 deletions recipes-bsp/rpi-u-boot-scr/files/boot.cmd

This file was deleted.

3 changes: 3 additions & 0 deletions recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
fatload mmc 0:1 ${kernel_addr_r} @@KERNEL_IMAGETYPE@@
@@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr}
5 changes: 4 additions & 1 deletion recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ COMPATIBLE_MACHINE = "^rpi$"

DEPENDS = "u-boot-mkimage-native"

SRC_URI = "file://boot.cmd"
SRC_URI = "file://boot.cmd.in"

do_compile() {
sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \
-e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \
"${WORKDIR}/boot.cmd.in" > "${WORKDIR}/boot.cmd"
mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr
}

Expand Down

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions recipes-bsp/u-boot/u-boot_%.bbappend
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot:"

SRC_URI_append_rpi = " \
file://0001-Revert-dm-arm-rpi-Drop-CONFIG_OF_EMBED.patch \
file://0002-rpi-Enable-USB-keyboard-support.patch \
"

RDEPENDS_${PN}_append_rpi = " rpi-u-boot-scr"
Loading

0 comments on commit f3cd2eb

Please sign in to comment.