From 1d7a1b9784aabb69babecf2a47a809cad6c9bb28 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Fri, 28 Sep 2018 17:02:54 +0300 Subject: imx8: adapt to sumo Use WIC to create the image. Change-Id: I0413f60f96f2f4d3300dc84fdd2baabcc9bb120d Reviewed-by: Mikko Gronoff --- .../conf/distro/include/apalis-imx8.conf | 30 +------- .../conf/distro/include/fsl-imx8.inc | 79 +++++++++++++++++++++ .../conf/distro/include/imx8qmlpddr4arm2.conf | 30 +------- .../recipes-bsp/firmware-imx/firmware-imx.inc | 81 ++++++++++++++++++++++ meta-fsl-extras/recipes-bsp/imx-vpu/imx-vpu.inc | 28 ++++++++ .../recipes/linux/linux-imx_4.%.bbappend | 3 + .../recipes/linux/linux-toradex_4.%.bbappend | 5 +- meta-fsl-extras/wic/imx8-uboot-bootpart.wks | 19 +++++ 8 files changed, 216 insertions(+), 59 deletions(-) create mode 100644 meta-boot2qt-distro/conf/distro/include/fsl-imx8.inc create mode 100644 meta-fsl-extras/recipes-bsp/firmware-imx/firmware-imx.inc create mode 100644 meta-fsl-extras/recipes-bsp/imx-vpu/imx-vpu.inc create mode 100644 meta-fsl-extras/wic/imx8-uboot-bootpart.wks diff --git a/meta-boot2qt-distro/conf/distro/include/apalis-imx8.conf b/meta-boot2qt-distro/conf/distro/include/apalis-imx8.conf index d570e3a..7a7728c 100644 --- a/meta-boot2qt-distro/conf/distro/include/apalis-imx8.conf +++ b/meta-boot2qt-distro/conf/distro/include/apalis-imx8.conf @@ -27,36 +27,8 @@ ## ############################################################################ -include conf/distro/include/fsl.inc +include conf/distro/include/fsl-imx8.inc DEPLOY_CONF_NAME = "Toradex Apalis iMX8" SERIAL_CONSOLE = "115200 ttyLP1" - -FSL_EULA_FILE := "${COREBASE}/../meta-fsl-bsp-release/imx/EULA.txt" - -RDEPENDS_gstreamer1.0-meta-base_remove_pn-gstreamer1.0-meta-base = " gstreamer1.0-plugins-good-souphttpsrc" -RDEPENDS_gstreamer1.0-meta-base_append_pn-gstreamer1.0-meta-base = " gstreamer1.0-plugins-good-soup" - -BBMASK += "\ - meta-fsl-bsp-release/imx/meta-bsp/recipes-browser \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/bluez5 \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/nfs-utils \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/wpa-supplicant \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-core/systemd/systemd_%.bbappend \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-multimedia/alsa/alsa-lib_%.bbappend \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-multimedia/pulseaudio \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/fsl-rc-local \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/packagegroup \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-graphics/devil \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-qt5/qt5 \ - meta-boot2qt/meta-fsl-extras/recipes/u-boot/u-boot-toradex_%.bbappend \ - meta-boot2qt-distro/recipes-connectivity/connman/connman_%.bbappend \ - meta-freescale/recipes-graphics/wayland/weston \ - " - -KERNEL_MODULE_PACKAGE_SUFFIX ?= "-${@d.getVar('KERNEL_VERSION', True).replace('_','-')}" -EXTRA_OECONF_append_pn-gstreamer1.0-plugins-base = " --disable-introspection" - -MACHINE_GSTREAMER_1_0_PLUGIN += "imx-gst1.0-plugin" diff --git a/meta-boot2qt-distro/conf/distro/include/fsl-imx8.inc b/meta-boot2qt-distro/conf/distro/include/fsl-imx8.inc new file mode 100644 index 0000000..4e4256b --- /dev/null +++ b/meta-boot2qt-distro/conf/distro/include/fsl-imx8.inc @@ -0,0 +1,79 @@ +############################################################################ +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the Boot to Qt meta layer. +## +## $QT_BEGIN_LICENSE:GPL$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 or (at your option) any later version +## approved by the KDE Free Qt Foundation. The licenses are as published by +## the Free Software Foundation and appearing in the file LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################ + +include conf/distro/include/fsl.inc + +FSL_EULA_FILE := "${COREBASE}/../meta-fsl-bsp-release/imx/EULA.txt" + +DISTRO_FEATURES_remove = "vulkan" + +RDEPENDS_gstreamer1.0-meta-base_remove_pn-gstreamer1.0-meta-base = " gstreamer1.0-plugins-good-souphttpsrc" +RDEPENDS_gstreamer1.0-meta-base_append_pn-gstreamer1.0-meta-base = " gstreamer1.0-plugins-good-soup" + +BBMASK += "\ + meta-boot2qt-distro/recipes-connectivity/connman/connman_%.bbappend \ + meta-boot2qt/meta-fsl-extras/recipes/u-boot/u-boot-toradex_%.bbappend \ + meta-freescale/recipes-graphics/wayland/weston \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-browser \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-bsp/imx-test \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/bluez5 \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/connman \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/nfs-utils \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/wpa-supplicant \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-core/systemd/systemd_%.bbappend \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-devtools/gdb \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-extended/logrotate \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-graphics/opencv \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-graphics/xorg-driver \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-kernel/cryptodev \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-multimedia/alsa \ + meta-fsl-bsp-release/imx/meta-bsp/recipes-multimedia/pulseaudio \ + meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/fsl-rc-local \ + meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images \ + meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/packagegroup \ + meta-fsl-bsp-release/imx/meta-sdk/recipes-graphics/devil \ + meta-fsl-bsp-release/imx/meta-sdk/recipes-qt5/qt5 \ + " + +KERNEL_MODULE_PACKAGE_SUFFIX ?= "-${@d.getVar('KERNEL_VERSION', True).replace('_','-')}" +EXTRA_OECONF_append_pn-gstreamer1.0-plugins-base = " --disable-introspection" + +MACHINE_GSTREAMER_1_0_PLUGIN += "imx-gst1.0-plugin" + +WKS_FILE = "imx8-uboot-bootpart.wks" +WIC_CREATE_EXTRA_ARGS = "--no-fstab-update" +WKS_FILE_DEPENDS += "imx-boot" + +BOOT_CONFIG_MACHINE_pn-imx-boot = "${BOOT_NAME}-${UBOOT_CONFIG}.bin" + +IMAGE_BOOT_FILES = "\ + Image \ + fsl-*.dtb \ + hdmitxfw.bin \ + " diff --git a/meta-boot2qt-distro/conf/distro/include/imx8qmlpddr4arm2.conf b/meta-boot2qt-distro/conf/distro/include/imx8qmlpddr4arm2.conf index 6dfaa3a..a3a2c29 100644 --- a/meta-boot2qt-distro/conf/distro/include/imx8qmlpddr4arm2.conf +++ b/meta-boot2qt-distro/conf/distro/include/imx8qmlpddr4arm2.conf @@ -27,36 +27,8 @@ ## ############################################################################ -include conf/distro/include/fsl.inc +include conf/distro/include/fsl-imx8.inc DEPLOY_CONF_NAME = "NXP iMX8QM" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-imx" - -FSL_EULA_FILE := "${COREBASE}/../meta-fsl-bsp-release/imx/EULA.txt" - -RDEPENDS_gstreamer1.0-meta-base_remove_pn-gstreamer1.0-meta-base = " gstreamer1.0-plugins-good-souphttpsrc" -RDEPENDS_gstreamer1.0-meta-base_append_pn-gstreamer1.0-meta-base = " gstreamer1.0-plugins-good-soup" - -BBMASK += "\ - meta-fsl-bsp-release/imx/meta-bsp/recipes-browser \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/bluez5 \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/nfs-utils \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-connectivity/wpa-supplicant \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-core/systemd/systemd_%.bbappend \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-multimedia/alsa/alsa-lib_%.bbappend \ - meta-fsl-bsp-release/imx/meta-bsp/recipes-multimedia/pulseaudio \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/fsl-rc-local \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/packagegroup \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-graphics/devil \ - meta-fsl-bsp-release/imx/meta-sdk/recipes-qt5/qt5 \ - meta-boot2qt/meta-fsl-extras/recipes/u-boot/u-boot-toradex_%.bbappend \ - meta-boot2qt-distro/recipes-connectivity/connman/connman_%.bbappend \ - meta-freescale/recipes-graphics/wayland/weston \ - " - -KERNEL_MODULE_PACKAGE_SUFFIX ?= "-${@d.getVar('KERNEL_VERSION', True).replace('_','-')}" -EXTRA_OECONF_append_pn-gstreamer1.0-plugins-base = " --disable-introspection" - -MACHINE_GSTREAMER_1_0_PLUGIN += "imx-gst1.0-plugin" diff --git a/meta-fsl-extras/recipes-bsp/firmware-imx/firmware-imx.inc b/meta-fsl-extras/recipes-bsp/firmware-imx/firmware-imx.inc new file mode 100644 index 0000000..5407a5a --- /dev/null +++ b/meta-fsl-extras/recipes-bsp/firmware-imx/firmware-imx.inc @@ -0,0 +1,81 @@ +SUMMARY = "Freescale IMX firmware" +DESCRIPTION = "Freescale IMX firmware such as for the VPU" +SECTION = "base" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://COPYING;md5=8cf95184c220e247b9917e7244124c5a" + +PE = "1" + +#BRCM firmware git +SRCBRANCH ?= "master" + +SRC_URI = "${FSL_MIRROR}/firmware-imx-${PV}.bin;fsl-eula=true \ + git://git.freescale.com/imx/imx-firmware.git;branch=${SRCBRANCH};destsuffix=${S}/git " + +inherit fsl-eula-unpack allarch + +do_install() { + install -d ${D}${base_libdir}/firmware/imx + install -d ${D}${base_libdir}/firmware/bcm + install -d ${D}${sysconfdir}/firmware + + cp -rfv firmware/* ${D}${base_libdir}/firmware/ + + #1BW_BCM43340 + install -d ${D}${base_libdir}/firmware/bcm/1BW_BCM43340 + cp -rfv git/brcm/1BW_BCM43340/*.bin ${D}${base_libdir}/firmware/bcm/1BW_BCM43340 + cp -rfv git/brcm/1BW_BCM43340/*.cal ${D}${base_libdir}/firmware/bcm/1BW_BCM43340 + cp -rfv git/brcm/1BW_BCM43340/*.hcd ${D}${sysconfdir}/firmware/ + + #1DX_BCM4343W + install -d ${D}${base_libdir}/firmware/bcm/1DX_BCM4343W + cp -rfv git/brcm/1DX_BCM4343W/*.bin ${D}${base_libdir}/firmware/bcm/1DX_BCM4343W + cp -rfv git/brcm/1DX_BCM4343W/*.cal ${D}${base_libdir}/firmware/bcm/1DX_BCM4343W + cp -rfv git/brcm/1DX_BCM4343W/*.hcd ${D}${sysconfdir}/firmware/ + + #SN8000_BCM43362 + install -d ${D}${base_libdir}/firmware/bcm/SN8000_BCM43362 + cp -rfv git/brcm/SN8000_BCM43362/*.bin ${D}${base_libdir}/firmware/bcm/SN8000_BCM43362 + cp -rfv git/brcm/SN8000_BCM43362/*.cal ${D}${base_libdir}/firmware/bcm/SN8000_BCM43362 + cp -rfv git/brcm/1DX_BCM4343W/*.hcd ${D}${sysconfdir}/firmware/ + + #ZP_BCM4339 + install -d ${D}${base_libdir}/firmware/bcm/ZP_BCM4339 + cp -rfv git/brcm/ZP_BCM4339/*.bin ${D}${base_libdir}/firmware/bcm/ZP_BCM4339 + cp -rfv git/brcm/ZP_BCM4339/*.cal ${D}${base_libdir}/firmware/bcm/ZP_BCM4339 + cp -rfv git/brcm/ZP_BCM4339/*.hcd ${D}${sysconfdir}/firmware/ + + mv ${D}${base_libdir}/firmware/epdc/ ${D}${base_libdir}/firmware/imx/epdc/ + mv ${D}${base_libdir}/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted ${D}${base_libdir}/firmware/imx/epdc/epdc_ED060XH2C1.fw + + find ${D}${base_libdir}/firmware -type f -exec chmod 644 '{}' ';' + find ${D}${base_libdir}/firmware -type f -exec chown root:root '{}' ';' + + # Remove files not going to be installed + find ${D}${base_libdir}/firmware/ -name '*.mk' -exec rm '{}' ';' +} + +python populate_packages_prepend() { + vpudir = bb.data.expand('${base_libdir}/firmware/vpu', d) + do_split_packages(d, vpudir, '^vpu_fw_([^_]*).*\.bin', + output_pattern='firmware-imx-vpu-%s', + description='Freescale IMX Firmware %s', + extra_depends='', + prepend=True) + + sdmadir = bb.data.expand('${base_libdir}/firmware/sdma', d) + do_split_packages(d, sdmadir, '^sdma-([^-]*).*\.bin', + output_pattern='firmware-imx-sdma-%s', + description='Freescale IMX Firmware %s', + extra_depends='', + prepend=True) +} + +ALLOW_EMPTY_${PN} = "1" + +PACKAGES_DYNAMIC = "${PN}-vpu-* ${PN}-sdma-*" + +PACKAGES =+ "${PN}-epdc ${PN}-brcm" + +FILES_${PN}-epdc = "${base_libdir}/firmware/imx/epdc/" +FILES_${PN}-brcm = "${base_libdir}/firmware/bcm/*/*.bin ${base_libdir}/firmware/bcm/*/*.cal ${sysconfdir}/firmware/" diff --git a/meta-fsl-extras/recipes-bsp/imx-vpu/imx-vpu.inc b/meta-fsl-extras/recipes-bsp/imx-vpu/imx-vpu.inc new file mode 100644 index 0000000..7b33956 --- /dev/null +++ b/meta-fsl-extras/recipes-bsp/imx-vpu/imx-vpu.inc @@ -0,0 +1,28 @@ +# Copyright (C) 2013-2017 O.S. Systems Software LTDA. +# Copyright (C) 2013 Freescale Semiconductor +# Copyright 2017 NXP + +DESCRIPTION = "Freescale VPU library" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://vpu/EULA.txt;md5=b063366b066c9f10037c59756a9ced54" +DEPENDS = "virtual/kernel" + +PROVIDES = "virtual/imxvpu" + +inherit fsl-eula-unpack + +PLATFORM_mx6 = "IMX6Q" + +SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true" + +do_compile () { + INCLUDE_DIR="-I${STAGING_KERNEL_DIR}/include/uapi -I${STAGING_KERNEL_DIR}/include" + + oe_runmake CROSS_COMPILE="${HOST_PREFIX}" PLATFORM="${PLATFORM}" INCLUDE="${INCLUDE_DIR}" all +} + +do_install () { + oe_runmake PLATFORM="${PLATFORM}" DEST_DIR="${D}" install +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-fsl-extras/recipes/linux/linux-imx_4.%.bbappend b/meta-fsl-extras/recipes/linux/linux-imx_4.%.bbappend index eb5364d..9b4cc9b 100644 --- a/meta-fsl-extras/recipes/linux/linux-imx_4.%.bbappend +++ b/meta-fsl-extras/recipes/linux/linux-imx_4.%.bbappend @@ -30,6 +30,9 @@ # kernel image files are not needed in the image RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "" +# remove from imx8 kernel build +SRC_URI_remove = " file://Install-dma-buf-h.patch" + do_preconfigure_prepend() { # FunctionFS for qdbd echo "CONFIG_USB_FUNCTIONFS=m" >> ${WORKDIR}/defconfig diff --git a/meta-fsl-extras/recipes/linux/linux-toradex_4.%.bbappend b/meta-fsl-extras/recipes/linux/linux-toradex_4.%.bbappend index 9298747..df39774 100644 --- a/meta-fsl-extras/recipes/linux/linux-toradex_4.%.bbappend +++ b/meta-fsl-extras/recipes/linux/linux-toradex_4.%.bbappend @@ -1,6 +1,6 @@ ############################################################################ ## -## Copyright (C) 2016 The Qt Company Ltd. +## Copyright (C) 2018 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the Boot to Qt meta layer. @@ -29,6 +29,9 @@ RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image ${KERNEL_PACKAGE_NAME}-devicetree" +# remove from imx8 kernel build +SRC_URI_remove = " file://Install-dma-buf-h.patch" + do_preconfigure_prepend () { # FunctionFS for qdbd echo "CONFIG_USB_FUNCTIONFS=m" >> ${WORKDIR}/defconfig diff --git a/meta-fsl-extras/wic/imx8-uboot-bootpart.wks b/meta-fsl-extras/wic/imx8-uboot-bootpart.wks new file mode 100644 index 0000000..33de776 --- /dev/null +++ b/meta-fsl-extras/wic/imx8-uboot-bootpart.wks @@ -0,0 +1,19 @@ +# short-description: Create SD card image with a boot partition +# long-description: +# Create an image that can be written onto a SD card using dd for use +# with i.MX SoC family +# It uses u-boot +# +# The disk layout used is: +# - --------- -------------- -------------- +# | | u-boot | boot | rootfs | +# - --------- -------------- -------------- +# ^ ^ ^ ^ +# | | | | +# 0 33kiB 4MiB 32MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB) +# +part u-boot --source rawcopy --sourceparams="file=imx-boot-sd.bin" --ondisk mmcblk --no-table --align 33 +part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 32 +part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096 + +bootloader --ptable msdos -- cgit v1.2.3-54-g00ecf