summaryrefslogtreecommitdiffstats
path: root/bsp/meta-freescale
diff options
context:
space:
mode:
authortakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
committertakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
commit1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch)
treecd70a267a5ef105ba32f200aa088e281fbd85747 /bsp/meta-freescale
parent4204309872da5cb401cbb2729d9e2d4869a87f42 (diff)
recipes
Diffstat (limited to 'bsp/meta-freescale')
-rw-r--r--bsp/meta-freescale/.gitignore4
-rw-r--r--bsp/meta-freescale/EULA1050
-rw-r--r--bsp/meta-freescale/README22
-rw-r--r--bsp/meta-freescale/classes/dtc-145.bbclass7
-rw-r--r--bsp/meta-freescale/classes/fsl-dynamic-packagearch.bbclass28
-rw-r--r--bsp/meta-freescale/classes/fsl-eula-unpack.bbclass123
-rw-r--r--bsp/meta-freescale/classes/fsl-vivante-kernel-driver-handler.bbclass6
-rw-r--r--bsp/meta-freescale/classes/kernel-itbimage.bbclass6
-rw-r--r--bsp/meta-freescale/classes/machine-overrides-extender.bbclass6
-rw-r--r--bsp/meta-freescale/classes/qoriq_build_64bit_kernel.bbclass4
-rw-r--r--bsp/meta-freescale/classes/use-imx-headers.bbclass18
-rw-r--r--bsp/meta-freescale/conf/layer.conf10
-rw-r--r--bsp/meta-freescale/conf/machine/imx25pdk.conf2
-rw-r--r--bsp/meta-freescale/conf/machine/imx28evk.conf2
-rw-r--r--bsp/meta-freescale/conf/machine/imx6qdlsabreauto.conf4
-rw-r--r--bsp/meta-freescale/conf/machine/imx6qdlsabresd.conf29
-rw-r--r--bsp/meta-freescale/conf/machine/imx6slevk.conf2
-rw-r--r--bsp/meta-freescale/conf/machine/imx6sllevk.conf12
-rw-r--r--bsp/meta-freescale/conf/machine/imx6sxsabreauto.conf4
-rw-r--r--bsp/meta-freescale/conf/machine/imx6sxsabresd.conf2
-rw-r--r--bsp/meta-freescale/conf/machine/imx6ulevk.conf17
-rw-r--r--bsp/meta-freescale/conf/machine/imx6ullevk.conf23
-rw-r--r--bsp/meta-freescale/conf/machine/imx7dsabresd.conf17
-rw-r--r--bsp/meta-freescale/conf/machine/imx7ulpevk.conf30
-rw-r--r--bsp/meta-freescale/conf/machine/imx8mmevk.conf44
-rw-r--r--bsp/meta-freescale/conf/machine/imx8mnevk.conf61
-rw-r--r--bsp/meta-freescale/conf/machine/imx8mqevk.conf44
-rw-r--r--bsp/meta-freescale/conf/machine/imx8qmmek.conf42
-rw-r--r--bsp/meta-freescale/conf/machine/imx8qxpmek.conf39
-rw-r--r--bsp/meta-freescale/conf/machine/include/imx-base.inc131
-rw-r--r--bsp/meta-freescale/conf/machine/include/qoriq-base.inc14
-rw-r--r--bsp/meta-freescale/conf/machine/include/utilities.inc12
-rw-r--r--bsp/meta-freescale/conf/machine/ls1012afrwy-32b.conf33
-rw-r--r--bsp/meta-freescale/conf/machine/ls1012afrwy.conf4
-rw-r--r--bsp/meta-freescale/conf/machine/ls1012ardb-32b.conf34
-rw-r--r--bsp/meta-freescale/conf/machine/ls1012ardb.conf7
-rw-r--r--bsp/meta-freescale/conf/machine/ls1021atwr.conf14
-rw-r--r--bsp/meta-freescale/conf/machine/ls1028ardb.conf38
-rw-r--r--bsp/meta-freescale/conf/machine/ls1043ardb-32b.conf39
-rw-r--r--bsp/meta-freescale/conf/machine/ls1043ardb-be.conf40
-rw-r--r--bsp/meta-freescale/conf/machine/ls1043ardb.conf21
-rw-r--r--bsp/meta-freescale/conf/machine/ls1046afrwy.conf41
-rw-r--r--bsp/meta-freescale/conf/machine/ls1046ardb-32b.conf40
-rw-r--r--bsp/meta-freescale/conf/machine/ls1046ardb-be.conf37
-rw-r--r--bsp/meta-freescale/conf/machine/ls1046ardb.conf16
-rw-r--r--bsp/meta-freescale/conf/machine/ls1088ardb-be.conf34
-rw-r--r--bsp/meta-freescale/conf/machine/ls1088ardb-pb.conf6
-rw-r--r--bsp/meta-freescale/conf/machine/ls1088ardb.conf6
-rw-r--r--bsp/meta-freescale/conf/machine/ls2080ardb.conf2
-rw-r--r--bsp/meta-freescale/conf/machine/ls2088ardb-be.conf35
-rw-r--r--bsp/meta-freescale/conf/machine/ls2088ardb.conf8
-rw-r--r--bsp/meta-freescale/conf/machine/lx2160ardb.conf9
-rw-r--r--bsp/meta-freescale/conf/machine/mpc8548cds.conf4
-rw-r--r--bsp/meta-freescale/conf/machine/p1020rdb.conf12
-rw-r--r--bsp/meta-freescale/conf/machine/p2020rdb.conf18
-rw-r--r--bsp/meta-freescale/conf/machine/p2041rdb.conf9
-rw-r--r--bsp/meta-freescale/conf/machine/p3041ds.conf9
-rw-r--r--bsp/meta-freescale/conf/machine/p4080ds.conf9
-rw-r--r--bsp/meta-freescale/conf/machine/p5040ds-64b.conf7
-rw-r--r--bsp/meta-freescale/conf/machine/p5040ds.conf9
-rw-r--r--bsp/meta-freescale/conf/machine/t1024rdb-64b.conf7
-rw-r--r--bsp/meta-freescale/conf/machine/t1024rdb.conf9
-rw-r--r--bsp/meta-freescale/conf/machine/t1042d4rdb-64b.conf7
-rw-r--r--bsp/meta-freescale/conf/machine/t1042d4rdb.conf7
-rw-r--r--bsp/meta-freescale/conf/machine/t2080rdb-64b.conf8
-rw-r--r--bsp/meta-freescale/conf/machine/t2080rdb.conf10
-rw-r--r--bsp/meta-freescale/conf/machine/t4240rdb-64b.conf4
-rw-r--r--bsp/meta-freescale/conf/machine/t4240rdb.conf6
-rw-r--r--bsp/meta-freescale/dynamic-layers/aglprofilegraphical/recipes-graphics/wayland/weston-init.bbappend3
-rw-r--r--bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init.bbappend1
-rw-r--r--bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init/weston.ini104
-rw-r--r--bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend8
-rw-r--r--bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-dpaa/fmc/fmc_git.bb2
-rw-r--r--bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-MGS-515-ccc-Opencv-app-can-t-run-on-imx6sx-with-cam.patch46
-rw-r--r--bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_3.4.%.bbappend5
-rw-r--r--bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.%.bbappend3
-rw-r--r--bsp/meta-freescale/dynamic-layers/qt4-layer/recipes-qt4/qt4/qt4-imx-support.inc2
-rw-r--r--bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0015-Add-eglfs-to-IMX-GPU.patch13
-rw-r--r--bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0016-Configure-eglfs-with-egl-pkg-config.patch13
-rw-r--r--bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend27
-rw-r--r--bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend3
-rw-r--r--bsp/meta-freescale/recipes-bsp/atf/atf-tools_git.bb19
-rw-r--r--bsp/meta-freescale/recipes-bsp/atf/atf_git.bb247
-rw-r--r--bsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess.bb19
-rwxr-xr-xbsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl40
-rw-r--r--bsp/meta-freescale/recipes-bsp/ddr-phy/ddr-phy_git.bb25
-rw-r--r--bsp/meta-freescale/recipes-bsp/dp-firmware-cadence/dp-firmware-cadence_20.04.bb30
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8.5.inc (renamed from bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-7.8.inc)8
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8_8.5.bb (renamed from bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8_7.8.bb)2
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8m_8.5.bb (renamed from bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8m_7.8.bb)0
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8x_7.8.bb20
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx_8.5.bb (renamed from bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx_7.8.bb)48
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca.inc15
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca6174_3.0.1.bb27
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca9377_3.0.1.bb27
-rw-r--r--bsp/meta-freescale/recipes-bsp/firmware-qca/qca-tools_3.0.1.bb20
-rw-r--r--bsp/meta-freescale/recipes-bsp/fsl-tlu/fsl-tlu_1.0.0.bb2
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-atf/imx-atf_2.0.bb (renamed from bsp/meta-freescale/recipes-bsp/imx-atf/imx-atf_1.5.0.bb)20
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-kobs/imx-kobs_git.bb7
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-boot_0.2.bb69
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-mkimage_git.inc6
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-sc-firmware/imx-sc-firmware_1.2.7.1.bb (renamed from bsp/meta-freescale/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.9.bb)12
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-seco/imx-seco_2.3.1.bb30
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-mxc_v4l2_test-fix-compilation-error-produced-by-gcc9.patch39
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-test-Makefile-Add-include-path-to-CC-command.patch27
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-test/imx-test_git.bb29
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-uuc/imx-uuc_git.bb11
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0001-Get-i.MX-custom-headers-from-usr-include-imx.patch49
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.16.0.bb (renamed from bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb)9
-rw-r--r--bsp/meta-freescale/recipes-bsp/imx-vpu/imx-vpu_5.4.39.2.bb (renamed from bsp/meta-freescale/recipes-bsp/imx-vpu/imx-vpu_5.4.38.bb)8
-rw-r--r--bsp/meta-freescale/recipes-bsp/inphi/inphi_git.bb4
-rw-r--r--bsp/meta-freescale/recipes-bsp/libimxdmabuffer/files/run-ptest10
-rw-r--r--bsp/meta-freescale/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb46
-rw-r--r--bsp/meta-freescale/recipes-bsp/ls2-phy/ls2-phy_git.bb6
-rw-r--r--bsp/meta-freescale/recipes-bsp/mc-utils/mc-utils_git.bb28
-rw-r--r--bsp/meta-freescale/recipes-bsp/ppfe-firmware/ppfe-firmware_git.bb6
-rw-r--r--bsp/meta-freescale/recipes-bsp/qe-ucode/qe-ucode_git.bb19
-rw-r--r--bsp/meta-freescale/recipes-bsp/rcw/rcw_git.bb28
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-common_2020.04.inc (renamed from bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-common_2018.11.inc)7
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-fw-utils_2018.11.bb45
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-mxsboot_2020.04.bb (renamed from bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-mxsboot_2018.11.bb)4
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc_2020.04.bb (renamed from bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc_2018.11.bb)4
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-common.inc20
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb (renamed from bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-mfgtool_2017.03.bb)2
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-tools_2019.04.bb10
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch49
-rwxr-xr-xbsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-tools-allow-to-override-python.patch46
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx_2019.04.bb (renamed from bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx_2017.03.bb)25
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.03.inc19
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.09.inc19
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-fw-utils_2018.03.bb45
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-Remove-redundant-YYLOC-global-declaration.patch29
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Convert-a-few-tests-to-Python-3.patch79
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Move-to-use-Python-3.patch30
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-buildman-Convert-to-Python-3.patch928
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Adjust-command-to-return-strings-instead-of-b.patch228
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Drop-binary-parameter.patch105
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Update-command.Run-to-handle-failure-better.patch42
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch117
-rw-r--r--bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq_2019.10.bb (renamed from bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq_2018.09.bb)42
-rw-r--r--bsp/meta-freescale/recipes-bsp/uefi/uefi_git.bb6
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch49
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch43
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch88
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-eng_devcrypto-add-support-for-TLS-algorithms-offload.patch389
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0002-eng_devcrypto-add-support-for-TLS1.2-algorithms-offl.patch285
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh222
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/run-ptest14
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb186
-rw-r--r--bsp/meta-freescale/recipes-connectivity/openssl/openssl_%.bbappend6
-rw-r--r--bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq.bb5
-rw-r--r--bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq/73-fsl-enetc-networking.rules16
-rw-r--r--bsp/meta-freescale/recipes-daemons/ptpd/ptpd-qoriq.bb2
-rw-r--r--bsp/meta-freescale/recipes-devtools/cst/cst/0001-tools-Mark-struct-input_field-file_field-extern.patch43
-rw-r--r--bsp/meta-freescale/recipes-devtools/cst/cst_git.bb19
-rw-r--r--bsp/meta-freescale/recipes-devtools/devregs/devregs_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-devtools/imx-usb-loader/imx-usb-loader_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch67
-rw-r--r--bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch33
-rw-r--r--bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/memfd.patch41
-rw-r--r--bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/run-ptest2
-rw-r--r--bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_4.1.0.bb53
-rw-r--r--bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_git.bb72
-rw-r--r--bsp/meta-freescale/recipes-dpaa/eth-config/eth-config_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-dpaa/fm-ucode/fm-ucode_git.bb4
-rw-r--r--bsp/meta-freescale/recipes-dpaa/fmlib/fmlib_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-dpaa2/aiopsl/aiopsl_git.bb11
-rw-r--r--bsp/meta-freescale/recipes-dpaa2/dce/dce_git.bb6
-rw-r--r--bsp/meta-freescale/recipes-dpaa2/dpl-examples/dpl-examples_git.bb35
-rw-r--r--bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.14.1.bb (renamed from bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.12.0.bb)9
-rw-r--r--bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.20.4.bb41
-rw-r--r--bsp/meta-freescale/recipes-dpaa2/restool/restool_git.bb4
-rw-r--r--bsp/meta-freescale/recipes-dpaa2/spc/spc_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-extended/crconf/crconf/0001-Modify-the-Makefile-for-cross-compile.patch30
-rw-r--r--bsp/meta-freescale/recipes-extended/crconf/crconf_git.bb18
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk.inc119
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-Add-RTE_KERNELDIR_OUT.patch26
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-add-Wno-cast-function-type.patch26
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-examples-ipsec-gw-fix-gcc-10-maybe-uninitialized-war.patch53
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-fix-gcc-8-build-error.patch51
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk/0004-update-WERROR_FLAGS.patch39
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk_17.11.bb104
-rw-r--r--bsp/meta-freescale/recipes-extended/dpdk/dpdk_19.11-20.04.bb19
-rw-r--r--bsp/meta-freescale/recipes-extended/hyperrelay/hyperrelay_git.bb36
-rw-r--r--bsp/meta-freescale/recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch69
-rw-r--r--bsp/meta-freescale/recipes-extended/jailhouse/jailhouse_0.11.bb122
-rw-r--r--bsp/meta-freescale/recipes-extended/libpkcs11/libpkcs11_git.bb4
-rw-r--r--bsp/meta-freescale/recipes-extended/ovs-dpdk/files/0001-netdev-dpdk-have-env-based-configurable-number-of-pa.patch34
-rw-r--r--bsp/meta-freescale/recipes-extended/ovs-dpdk/ovs-dpdk_2.13.0.bb (renamed from bsp/meta-freescale/recipes-extended/ovs-dpdk/ovs-dpdk_2.9.bb)16
-rw-r--r--bsp/meta-freescale/recipes-extended/pktgen-dpdk/pktgen-dpdk_19.12.0.bb (renamed from bsp/meta-freescale/recipes-extended/pktgen-dpdk/pktgen-dpdk_git.bb)14
-rw-r--r--bsp/meta-freescale/recipes-extended/secure-obj/secure-obj.inc8
-rw-r--r--bsp/meta-freescale/recipes-extended/secure-obj/secure-obj_git.bb4
-rw-r--r--bsp/meta-freescale/recipes-extended/skmm-ep/skmm-ep_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-extended/tsntool/tsntool_git.bb31
-rw-r--r--bsp/meta-freescale/recipes-extended/vpp-core/files/0001-GCC-above-5.4-fails-when-we-specify-arch-funattribut.patch26
-rw-r--r--bsp/meta-freescale/recipes-extended/vpp-core/files/0001-Link-vpp-api-with-shared-libs-if-static-is-disabled.patch28
-rw-r--r--bsp/meta-freescale/recipes-extended/vpp-core/files/config.h1
-rw-r--r--bsp/meta-freescale/recipes-extended/vpp-core/vpp-core.bb65
-rw-r--r--bsp/meta-freescale/recipes-extended/vpp-core/vpp-pkgs.inc227
-rw-r--r--bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-mfgtool.bb2
-rw-r--r--bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca6174.bb13
-rw-r--r--bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca9377.bb12
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm-armada_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch54
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch140
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch24
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm/installtests.patch25
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm/musl-ioctl.patch35
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch35
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm/mx7/drm-update-arm.patch35
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm_%.bbappend5
-rw-r--r--bsp/meta-freescale/recipes-graphics/drm/libdrm_2.4.99.imx.bb (renamed from bsp/meta-freescale/recipes-graphics/drm/libdrm_2.4.91.imx.bb)50
-rw-r--r--bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb/0001-Replace-vendor-specific-header-with-generic.patch28
-rw-r--r--bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend8
-rw-r--r--bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend2
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-dpu-g2d/imx-dpu-g2d_1.8.3.bb (renamed from bsp/meta-freescale/recipes-graphics/imx-dpu-g2d/imx-dpu-g2d_1.4.8.bb)23
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0001-switch-from-python2-to-python3.patch10004
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0002-specs-Tie-Python-2-3-conversion-loose-ends.patch169
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch276
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0004-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch62
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0005-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch60
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_9.0.0.bb (renamed from bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_7.1.0.bb)25
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.4.0.p2.0.bb (renamed from bsp/meta-freescale/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.2.4.p1.8.bb)12
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc78
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.4.p1.8-aarch64.bb6
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.0.p2.0-aarch32.bb (renamed from bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.4.p1.8-aarch32.bb)7
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.0.p2.0-aarch64.bb6
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch28
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend24
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend2
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend20
-rw-r--r--bsp/meta-freescale/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch47
-rw-r--r--bsp/meta-freescale/recipes-graphics/waffle/waffle/0002-meson-Separate-surfaceless-option-from-x11.patch44
-rw-r--r--bsp/meta-freescale/recipes-graphics/waffle/waffle_%.bbappend21
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0001-unstable-Add-alpha-compositing-protocol.patch195
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0002-unstable-Add-hdr10-metadata-protocol.patch134
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols_1.18.imx.bb (renamed from bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols_1.13.imx.bb)10
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston-init.bbappend43
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston-init/imxdrm/weston.config3
-rwxr-xr-xbsp/meta-freescale/recipes-graphics/wayland/weston-init/mx6sl/weston.config1
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston-init/mx8mm/weston.config3
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.config2
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.ini25
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.service38
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston/0001-g2d-renderer-Fix-open-function-build-break.patch33
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston/0001-make-error-portable.patch78
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch129
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston/imx/weston.ini20
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston/mx8mq/weston.ini24
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston_4.0.0.imx.bb144
-rw-r--r--bsp/meta-freescale/recipes-graphics/wayland/weston_8.0.0.imx.bb168
-rw-r--r--bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-armada_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb11
-rw-r--r--bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-imx-vivante_6.4.0.p0.0.bb (renamed from bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-imx-vivante_6.2.4.p1.8.bb)2
-rw-r--r--bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xf86-config/mx6ull/xorg.conf12
-rw-r--r--bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch47
-rw-r--r--bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend3
-rw-r--r--bsp/meta-freescale/recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch31
-rw-r--r--bsp/meta-freescale/recipes-kernel/ceetm/ceetm_git.bb9
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-1.10.inc21
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.10.bb5
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.9.bb16
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.10.bb10
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.9.bb21
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.10.bb8
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.9.bb26
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq_1.9.inc26
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch66
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch24
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch50
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Disable-installing-header-file-provided-by-another-p.patch22
-rw-r--r--bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0003-update-the-install-path-for-cryptodev-tests.patch28
-rw-r--r--bsp/meta-freescale/recipes-kernel/dtc/dtc-145_git.bb20
-rw-r--r--bsp/meta-freescale/recipes-kernel/dtc/files/0001-Fix-compiler-warnings-seen-with-musl.patch55
-rw-r--r--bsp/meta-freescale/recipes-kernel/dtc/files/make_install.patch17
-rw-r--r--bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.4.0.p2.0.bb (renamed from bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.4.p1.8.bb)4
-rw-r--r--bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-ipc.inc2
-rw-r--r--bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca6174_3.0.bb14
-rw-r--r--bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca9377_3.0.bb17
-rw-r--r--bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qcacld-lea.inc23
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0001-fix-build.patch71
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0002-no-split-ptlocks.patch85
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch126
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0004-export-swait-locked-functions.patch31
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/defconfig439
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt_4.1-2.0.x.bb26
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/imx/defconfig (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool-4.9.123/defconfig)288
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/mx8/defconfig (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-imx-4.9.123/mx8/defconfig)660
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_4.9-1.0.x.bb16
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_5.4.bb86
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19.bb (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-fslc_4.20.bb)8
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/defconfig (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/defconfig)285
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mx25/defconfig189
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mxs/defconfig180
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc-qoriq_5.4.bb17
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc/defconfig29
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mx25/defconfig6
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mxs/defconfig3
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-fslc_5.4.bb27
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers-4.9.123/0001-uapi-Install-custom-headers.patch40
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers_5.4.3.bb (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers_4.9.123.bb)39
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool_5.4.3.bb (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool_4.9.123.bb)1
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx.inc19
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch63
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx/imx/defconfig (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-imx-4.9.123/imx/defconfig)288
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx/mx8/defconfig797
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx_4.9.123.bb20
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-imx_5.4.3.bb35
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-qoriq.inc (renamed from bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_4.14.bb)12
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makefile-fix-gcc-8-build-error.patch25
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makfefile-linux-5.4-add-warning-cflags-on-LSDK-20.04.patch26
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-fix-gcc8-build-error.patch25
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch63
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_4.9.bb71
-rw-r--r--bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_5.4.bb11
-rw-r--r--bsp/meta-freescale/recipes-kernel/skmm-host/skmm-host_git.bb2
-rw-r--r--bsp/meta-freescale/recipes-multimedia/alsa/imx-alsa-plugins_1.0.26.bb4
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch42
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch47
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch33
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch35
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-fix-host-contamination.patch36
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch32
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch26
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.16.0.bb70
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch45
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/configure-allow-to-disable-libssh2.patch61
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-ext-wayland-fix-meson-build-in-nxp-fork.patch60
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch36
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-fix-build-with-opencv-enabled-and-opencv4.-Fix.patch45
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-allow-compilation-against-4.3.x.patch34
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch63
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch30
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch85
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch28
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch49
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.imx.bb174
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.imx.bb173
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch171
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-gstreamer1.0-plugins-base-Fix-ion.h-header-inclusion.patch45
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch289
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0003-riff-add-missing-include-directories-when-calling-in.patch28
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch27
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/make-gio_unix_2_0-dependency-configurable.patch45
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gst-libs-gst-gl-wayland-fix-meson-build.patch36
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gstreamer-plugins-base-fix-meson-build-in-nxp-fork.patch220
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch34
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-meson-Add-variables-for-gir-files.patch233
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-viv-fb-Make-sure-config.h-is-included.patch30
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-glimagesink-Downrank-to-marginal.patch30
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.bb76
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.%.bbappend (renamed from bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.14.%.bbappend)4
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.imx.bb100
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.14.imx.bb71
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.%.bbappend (renamed from bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.%.bbappend)0
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.imx.bb79
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.13.1.bb (renamed from bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_git.bb)10
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.16.0.bb39
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch36
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.16.0.bb32
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch (renamed from bsp/meta-freescale/recipes-multimedia/gstreamer/files/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch)0
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch36
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch74
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch257
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch37
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.14.imx.bb76
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.16.imx.bb84
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin/0001-imx-gst1.0-plugin-Fix-ion.h-header-inclusion-to-be-s.patch44
-rw-r--r--bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.5.3.bb (renamed from bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.4.2.bb)4
-rw-r--r--bsp/meta-freescale/recipes-multimedia/imx-codec/imx-codec_4.5.3.bb (renamed from bsp/meta-freescale/recipes-multimedia/imx-codec/imx-codec_4.4.2.bb)22
-rw-r--r--bsp/meta-freescale/recipes-multimedia/imx-dspc-asrc/imx-dspc-asrc_1.0.1.bb22
-rw-r--r--bsp/meta-freescale/recipes-multimedia/imx-parser/imx-parser_4.5.3.bb (renamed from bsp/meta-freescale/recipes-multimedia/imx-parser/imx-parser_4.4.2.bb)12
-rw-r--r--bsp/meta-freescale/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_4.5.3.bb (renamed from bsp/meta-freescale/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_4.4.2.bb)10
-rw-r--r--bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.0.1.bb25
-rw-r--r--bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi_git.bb4
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch54
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-client/tee-supplicant.service11
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-client_3.2.0.imx.bb52
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch158
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch427
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-os_3.2.0.imx.bb96
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch48
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch41
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch62
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch57
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch88
-rw-r--r--bsp/meta-freescale/recipes-security/optee-imx/optee-test_3.2.0.imx.bb58
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-client-qoriq.bb6
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch148
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch80
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-os-qoriq_git.bb10
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-8.patch40
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-9.patch28
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-use-python3-instead-of-python.patch48
-rw-r--r--bsp/meta-freescale/recipes-security/optee/optee-test-qoriq_git.bb9
-rw-r--r--bsp/meta-freescale/wic/imx-imx-boot-bootpart.wks.in13
-rw-r--r--bsp/meta-freescale/wic/imx-uboot-bootpart.wks.in (renamed from bsp/meta-freescale/wic/imx-uboot-bootpart.wks)2
-rw-r--r--bsp/meta-freescale/wic/imx-uboot-spl-bootpart.wks.in (renamed from bsp/meta-freescale/wic/imx-uboot-spl-bootpart.wks)2
-rw-r--r--bsp/meta-freescale/wic/imx-uboot-spl.wks.in (renamed from bsp/meta-freescale/wic/imx-uboot-spl.wks)2
399 files changed, 23179 insertions, 7530 deletions
diff --git a/bsp/meta-freescale/.gitignore b/bsp/meta-freescale/.gitignore
index b25c15b8..983cee9c 100644
--- a/bsp/meta-freescale/.gitignore
+++ b/bsp/meta-freescale/.gitignore
@@ -1 +1,5 @@
*~
+*.bak
+*.orig
+*.rej
+*.swp
diff --git a/bsp/meta-freescale/EULA b/bsp/meta-freescale/EULA
index 4504a14d..402c87ca 100644
--- a/bsp/meta-freescale/EULA
+++ b/bsp/meta-freescale/EULA
@@ -1,288 +1,283 @@
-LA_OPT_BASE_LICENSE v24 May 2018
-
-
+LA_OPT_NXP_Software_License v10 December 2019
IMPORTANT. Read the following NXP Software License Agreement ("Agreement")
-completely. By selecting the "I Accept" button at the end of this page, you
-indicate that you accept the terms of the Agreement and you acknowledge that
-you have the authority, for yourself or on behalf of your company, to bind your
-company to these terms. You may then download or install the file.
-
-
+completely. By selecting the "I Accept" button at the end of this page, or by
+downloading, installing, or using the Licensed Software, you indicate that you
+accept the terms of the Agreement and you acknowledge that you have the
+authority, for yourself or on behalf of your company, to bind your company to
+these terms. You may then download or install the file. In the event of a
+conflict between the terms of this Agreement and any license terms and
+conditions for NXP's proprietary software embedded anywhere in the Licensed
+Software file, the terms of this Agreement shall control. If a separate
+license agreement for the Licensed Software has been signed by you and NXP,
+then that agreement shall govern your use of the Licensed Software and shall
+supersede this Agreement.
NXP SOFTWARE LICENSE AGREEMENT
-
-
-This is a legal agreement between you, as an authorized representative of your
-employer, or if you have no employer, as an individual (together "you"), and
-NXP B.V. ("NXP"). It concerns your rights to use the software identified in
-the Software Content Register and provided to you in binary or source code form
-and any accompanying written materials (the "Licensed Software"). The Licensed
-Software may include any updates or error corrections or documentation relating
-to the Licensed Software provided to you by NXP under this License. In
-consideration for NXP allowing you to access the Licensed Software, you are
-agreeing to be bound by the terms of this Agreement. If you do not agree to all
-of the terms of this Agreement, do not download or install the Licensed
-Software. If you change your mind later, stop using the Licensed Software and
-delete all copies of the Licensed Software in your possession or control. Any
-copies of the Licensed Software that you have already distributed, where
-permitted, and do not destroy will continue to be governed by this Agreement.
-Your prior use will also continue to be governed by this Agreement.
-
-1. DEFINITIONS
-
-1.1. For NXP, the term "Affiliate" means (i) any Person Controlled by NXP
-Semiconductors N.V. or (ii) any Person Controlled by any transferee of all or
-substantially all of the assets of NXP Semiconductors N.V., where "Controlled"
-means the direct or indirect beneficial ownership of more than fifty percent
-(50%) of the voting stock, or decision-making authority in the event that there
-is no voting stock, in another entity; provided, any such Person described in
-clause (i) or (ii) shall be deemed to be an "Affiliate" only for so long as
-such Person is Controlled by NXP Semiconductors N.V. or such transferee. For
-the purposes of this definition, "Person" is defined to mean "an individual,
-corporation, partnership, limited liability company, association,
-unincorporated association, trust or other entity or organization, including a
-government or political subdivision or an agency or instrumentality thereof."
-
-1.2. "Essential Patent" means a patent to the limited extent that infringement
-of such patent cannot be avoided in remaining compliant with the technology
-standards implicated by the usage of any of the Licensed Software, including
-optional implementation of the standards, on technical but not commercial
-grounds, taking into account normal technical practice and the state of the art
-generally available at the time of standardization.
-
-1.3. "Intellectual Property Rights" means any and all rights under statute,
-common law or equity in and under copyrights, trade secrets, and patents
-(including utility models), and analogous rights throughout the world,
+This is a legal agreement between your employer, of which you are an authorized
+representative, or, if you have no employer, you as an individual ("you" or
+"Licensee"), and NXP B.V. ("NXP"). It concerns your rights to use the software
+provided to you in binary or source code form and any accompanying written
+materials (the "Licensed Software"). The Licensed Software may include any
+updates or error corrections or documentation relating to the Licensed Software
+provided to you by NXP under this Agreement. In consideration for NXP allowing
+you to access the Licensed Software, you are agreeing to be bound by the terms
+of this Agreement. If you do not agree to all of the terms of this Agreement,
+do not download or install the Licensed Software. If you change your mind
+later, stop using the Licensed Software and delete all copies of the Licensed
+Software in your possession or control. Any copies of the Licensed Software
+that you have already distributed, where permitted, and do not destroy will
+continue to be governed by this Agreement. Your prior use will also continue to
+be governed by this Agreement.
+
+1. DEFINITIONS
+
+1.1. "Affiliate" means, with respect to a party, any corporation or
+other legal entity that now or hereafter Controls, is Controlled by or is under
+common Control with such party; where "Control" means the direct or indirect
+ownership of greater than fifty percent (50%) of the shares or similar
+interests entitled to vote for the election of directors or other persons
+performing similar functions. An entity is considered an Affiliate only so long
+as such Control exists.
+
+1.2 "Authorized System" means either (i) Licensee's hardware product
+which incorporates an NXP Product or (ii) Licensee's software program which is
+used exclusively in connection with an NXP Product and with which the Licensed
+Software will be integrated.
+
+1.3. "Derivative Work" means a work based upon one or more pre-existing
+works. A work consisting of editorial revisions, annotations, elaborations, or
+other modifications which, as a whole, represent an original work of
+authorship, is a Derivative Work.
+
+1.4 "Intellectual Property Rights" means any and all rights under
+statute, common law or equity in and under copyrights, trade secrets, and
+patents (including utility models), and analogous rights throughout the world,
including any applications for and the right to apply for, any of the foregoing.
-1.4. "Software Content Register" means the documentation accompanying the
-Licensed Software which identifies the contents of the Licensed Software,
-including but not limited to identification of any Third Party Software.
+1.5 "NXP Product" means a programmable processing unit (e.g. a
+microprocessor, microcontroller, sensor or digital signal processor) supplied
+directly or indirectly from NXP or an NXP Affiliate.
+
+1.6 "Software Content Register" means the documentation which may
+accompany the Licensed Software which identifies the contents of the Licensed
+Software, including but not limited to identification of any Third Party
+Software, if any, and may also contain other related information as whether the
+license in 2.3 is applicable.
-1.5. "Third Party Software" means, any software included in the Licensed
-Software that is not NXP Proprietary software, and is not open source software,
+1.7 "Third Party Software" means, any software included in the Licensed
+Software that is not NXP proprietary software, and is not open source software,
and to which different license terms may apply.
-2. LICENSE GRANT.
-
-2.1. Separate license grants to Third Party Software, or other terms applicable
-to the Licensed Software if different from those granted in this Section 2, are
-contained in Appendix A. The Licensed Software is accompanied by a Software
-Content Register which will identify that portion of the Licensed Software, if
-any, that is subject to the different terms in Appendix A.
-
-2.2. Exclusively in connection with your development and distribution of
-product containing a programmable processing unit (e.g. a microprocessor,
-microcontroller, sensor or digital signal processor) ("NXP Product") supplied
-directly or indirectly from NXP ("Authorized System"), and exclusively for use
-with or integrated within an NXP Product, NXP grants you a world-wide,
-personal, non-transferable, non-exclusive, non-sublicensable, license, under
-NXP's Intellectual Property Rights:
-
-(a) to use and reproduce the Licensed Software only as part of, or integrated
-within, Authorized Systems and not on a standalone basis;
-
-(b) to directly or indirectly manufacture, demonstrate, copy, distribute,
-market and sell the Licensed Software in object code (machine readable) only as
-part of, or embedded within, Authorized Systems in object code form and not on
-a standalone basis. Notwithstanding the foregoing, those files marked as .h
-files ("Header files") may be distributed in source or object code form, but
-only as part of, or embedded within Authorized Systems.
-
-(c) to copy, use and distribute as needed, solely in connection with an
-Authorized System, proprietary NXP information associated with the Licensed
-Software for the purpose of developing, maintaining and supporting Authorized
-Systems with which the Licensed Software is integrated or associated.
-
-
-
-2.3. For Licensed Software provided to you in source code form (human
-readable), exclusively for use with or integrated within an NXP Product, NXP
-further grants to you a worldwide, personal, non-transferable, non-exclusive,
-non-sublicensable, license, under NXP's Intellectual Property Rights:
-
-(a) to prepare derivative works of the Licensed Software, only as part of, or
-integrated within, Authorized Systems and not on a standalone basis;
-
-(b) to use, demonstrate, copy, distribute, market and sell the derivative
-works of the Licensed Software in object code (machine readable) only as part
-of, or integrated within, Authorized Systems and not on a standalone basis.
-Notwithstanding the foregoing, those files marked as .h files ("Header files")
-may be distributed in source or object code form, but only as part of, or
-embedded within Authorized Systems.
-
-2.4. You may use subcontractors on your premises to exercise your rights under
-Section 2.2 and 2.3 so long as you have an agreement in place with the
-subcontractor containing confidentiality restrictions no less stringent than
-those contained in this Agreement. You will remain liable for your
-subcontractors' adherence to the terms of this Agreement and for any and all
-acts and omissions of such subcontractors with respect to this Agreement and
-the Licensed Software.
-
-3. LICENSE LIMITATIONS AND RESTRICTIONS.
-
-3.1. The licenses granted above in Section 2.3 only extend to NXP intellectual
-property rights that would be infringed by the Licensed Software prior to your
-preparation of any derivative work.
-
-3.2. The Licensed Software is licensed to you, not sold. Title to Licensed
-Software delivered hereunder remains vested in NXP or NXP's licensor and cannot
-be assigned or transferred. You are expressly forbidden from selling or
-otherwise distributing the Licensed Software, or any portion thereof, except as
-expressly permitted herein. This Agreement does not grant to you any implied
-rights under any NXP or third party intellectual property.
-
-3.3. You may not translate, reverse engineer, decompile, or disassemble the
-Licensed Software except to the extent applicable law specifically prohibits
-such restriction. You must prohibit your sublicensees from translating,
-reverse engineering, decompiling, or disassembling the Licensed Software except
-to the extent applicable law specifically prohibits such restriction.
-
-3.4. You must reproduce any and all of NXP's (or its third party licensor's)
-copyright notices and other proprietary legends on copies of Licensed Software.
-
-
-3.5. If you distribute the Licensed Software to the United States Government,
-then the Licensed Software is "restricted computer software" and is subject to
-FAR 52.227-19 (c)(1) and (c)(2).
-
-3.6. You grant to NXP a non-exclusive, non-transferable, irrevocable,
+2. LICENSE GRANT.
+
+2.1. If you are not expressly granted the production use license in
+Section 2.3 in the Software Content Register, then you are only granted the
+rights in Section 2.2 and not in 2.3. If you are expressly granted the
+production use license in Section 2.3 in the Software Content Register, then
+you are granted the rights in both Section 2.2 and 2.3.
+
+2.2. Internal Use License. Subject to the terms and conditions of this
+Agreement, NXP grants you a worldwide, personal, non-transferable,
+non-exclusive, non-sublicensable license, solely for the development of an
+Authorized System:
+
+(a) to use and reproduce the Licensed Software (and its Derivative Works
+prepared under the license in Section 2.2(b)); and
+
+(b) for Licensed Software provided to you in source code form (human
+readable), to prepare Derivative Works of the Licensed Software.
+
+You may not distribute or sublicense the Licensed Software to others under the
+license granted in this Section 2.2.
+
+2.3. Production Use License. If expressly authorized in the Software
+Content Register, subject to the terms and conditions of this Agreement, NXP
+grants you a worldwide, personal, non-transferable, non-exclusive,
+non-sublicensable license solely in connection with your manufacturing and
+distribution of an Authorized System:
+
+(a) to manufacture (or have manufactured), distribute, and market
+the Licensed Software (and its Derivative Works prepared under the license in
+2.2(b)) in object code (machine readable format) only as part of, or embedded
+within, Authorized Systems and not on a standalone basis. Notwithstanding the
+foregoing, those files marked as .h files ("Header files") may be distributed
+in source or object code form, but only as part of, or embedded within
+Authorized Systems; and
+
+(b) to copy and distribute as needed, solely in connection with an
+Authorized System, non-confidential NXP information provided as part of the
+Licensed Software for the purpose of maintaining and supporting Authorized
+Systems with which the Licensed Software is integrated.
+
+2.4 Separate license grants to Third Party Software, or other terms
+applicable to the Licensed Software if different from those granted in this
+Section 2, are contained in Appendix A. The Licensed Software may be
+accompanied by a Software Content Register which will identify that portion of
+the Licensed Software, if any, that is subject to the different terms in
+Appendix A.
+
+2.5. You may use subcontractors on your premises to exercise your
+rights under Section 2.2 and Section 2.3, if any, so long as you have an
+agreement in place with the subcontractor containing confidentiality
+restrictions no less stringent than those contained in this Agreement. You will
+remain liable for your subcontractors' adherence to the terms of this Agreement
+and for any and all acts and omissions of such subcontractors with respect to
+this Agreement and the Licensed Software.
+
+3. LICENSE LIMITATIONS AND RESTRICTIONS.
+
+3.1. The licenses granted above in Section 2 only extend to NXP
+Intellectual Property Rights that would be infringed by the unmodified Licensed
+Software prior to your preparation of any Derivative Work.
+
+3.2. The Licensed Software is licensed to you, not sold. Title to
+Licensed Software delivered hereunder remains vested in NXP or NXP's licensor
+and cannot be assigned or transferred. You are expressly forbidden from selling
+or otherwise distributing the Licensed Software, or any portion thereof, except
+as expressly permitted herein. This Agreement does not grant to you any implied
+rights under any NXP or third party Intellectual Property Rights.
+
+3.3. You may not translate, reverse engineer, decompile, or disassemble
+the Licensed Software except to the extent applicable law specifically
+prohibits such restriction. You must prohibit your subcontractors or customers
+(if distribution is permitted) from translating, reverse engineering,
+decompiling, or disassembling the Licensed Software except to the extent
+applicable law specifically prohibits such restriction.
+
+3.4. You must reproduce any and all of NXP's (or its third-party
+licensor's) copyright notices and other proprietary legends on copies of
+Licensed Software.
+
+3.5. If you distribute the Licensed Software to the United States
+Government, then the Licensed Software is "restricted computer software" and is
+subject to FAR 52.227-19.
+
+3.6. You grant to NXP a non-exclusive, non-transferable, irrevocable,
perpetual, worldwide, royalty-free, sub-licensable license under your
Intellectual Property Rights to use without restriction and for any purpose any
suggestion, comment or other feedback related to the Licensed Software
(including, but not limited to, error corrections and bug fixes).
-3.7. You will not take or fail to take any action that could subject the
-Licensed Software to an Excluded License. An Excluded License means any license
-that requires, as a condition of use, modification or distribution of software
-subject to the Excluded License, that such software or other software combined
-and/or distributed with the software be (i) disclosed or distributed in source
-code form; (ii) licensed for the purpose of making derivative works; or (iii)
-redistributable at no charge.
-
-3.8. You may not publish or distribute information, results or data associated
-with the use of the Licensed Software to anyone other than NXP; however, you
-must advise NXP of any results obtained including any problems or suggested
-improvements thereof. NXP retains the right to use such results and related
-information in any manner it deems appropriate.
-
-4. OPEN SOURCE. Open source software included in the
-Licensed Software is not licensed under the terms of this Agreement but is
-instead licensed under the terms of the applicable open source license(s), such
-as the BSD License, Apache License or the GNU Lesser General Public License.
-Your use of the open source software is subject to the terms of each applicable
-license. You must agree to the terms of each applicable license, or you cannot
-use the open source software.
-
-5. INTELLECTUAL PROPERTY RIGHTS. Subject to NXP's ownership
-interest in the underlying Licensed Software, all intellectual property rights
-associated with, and title to, your Authorized System will be retained by or
-will vest in you. Your modifications to the Licensed Software, and all
-intellectual property rights associated with, and title thereto, will be the
-property of NXP. Upon request, you must provide NXP the source code of any
-derivative of the Licensed Software. You agree to assign all, and hereby do
-assign all rights, title, and interest to any such modifications to the
-Licensed Software to NXP and agree to provide all assistance reasonably
-requested by NXP to establish, preserve or enforce such right. Further, you
-agree to waive all moral rights relating to your modifications to the Licensed
-Software, including, without limitation, all rights of identification of
-authorship and all rights of approval, restriction, or limitation on use or
-subsequent modification. Notwithstanding the foregoing, you will have the
-license rights granted in Section 2 hereto to any such modifications made by
-you or your licensees.
-
-6. PATENT COVENANT NOT TO SUE. As partial, material consideration
-for the rights granted to you under this Agreement, you covenant not to sue or
-otherwise assert your patents against NXP, a NXP Affiliate or subsidiary, or a
-NXP licensee of the Licensed Software for infringement of your Intellectual
+3.7. You will not take or fail to take any action that could subject
+the Licensed Software to an Excluded License. An Excluded License means any
+license that requires, as a condition of use, modification or distribution of
+software subject to the Excluded License, that such software or other software
+combined and/or distributed with the software be (i) disclosed or distributed
+in source code form; (ii) licensed for the purpose of making Derivative Works;
+or (iii) redistributable at no charge.
+
+3.8. You may not publish or distribute information, results or data
+associated with the use of the Licensed Software to anyone other than NXP;
+however, you must advise NXP of any results obtained including any problems or
+suggested improvements thereof. NXP retains the right to use such results and
+related information in any manner it deems appropriate
+
+4. OPEN SOURCE. Open source software included in the Licensed
+Software is not licensed under the terms of this Agreement but is instead
+licensed under the terms of the applicable open source license(s), such as the
+BSD License, Apache License or the GNU Lesser General Public License. Your use
+of the open source software is subject to the terms of each applicable license.
+You must agree to the terms of each applicable license, or you cannot use the
+open source software.
+
+5. INTELLECTUAL PROPERTY RIGHTS. Your modifications to the Licensed
+Software, and all Intellectual Property Rights associated with, and title
+thereto, will be the property of NXP. Upon request, you must provide NXP the
+source code of any derivative of the Licensed Software. You agree to assign
+all, and hereby do assign all rights, title, and interest to any such
+modifications to the Licensed Software to NXP and agree to provide all
+assistance reasonably requested by NXP to establish, preserve or enforce such
+right. Further, you agree to waive all moral rights relating to your
+modifications to the Licensed Software, including, without limitation, all
+rights of identification of authorship and all rights of approval, restriction,
+or limitation on use or subsequent modification. Notwithstanding the foregoing,
+you will have the license rights granted in Section 2 hereto to any such
+modifications made by you or your subcontractor.
+
+6. PATENT COVENANT NOT TO SUE. As partial, material consideration for the
+rights granted to you under this Agreement, you covenant not to sue or
+otherwise assert your patents against NXP or an NXP Affiliate, or a NXP
+licensee of the Licensed Software for infringement of your Intellectual
Property Rights by the manufacture, use, sale, offer for sale, importation or
other disposition or promotion of the Licensed Software and/or any
redistributed portions of the Licensed Software.
-7. ESSENTIAL PATENTS. You are solely responsible for obtaining
-licenses for any relevant Essential Patents for your use in connection with
-technology that you incorporate into your product (whether as part of the
-Licensed Software or not).
+7. ESSENTIAL PATENTS. NXP has no obligation to identify or obtain any
+license to any Intellectual Property Right of a third-party that may be
+necessary for use in connection with technology that is incorporated into the
+Authorized System (whether or not as part of the Licensed Software).
-8. TERM AND TERMINATION. This Agreement will remain in effect
-unless terminated as provided in this Section 8.
+8. TERM AND TERMINATION. This Agreement will remain in effect unless
+terminated as provided in this Section.
-8.1. You may terminate this Agreement immediately upon written notice to NXP at
-the address provided below.
+8.1. You may terminate this Agreement immediately upon written notice
+to NXP at the address provided below.
-8.2. Either party may terminate this Agreement if the other party is in default
-of any of the terms and conditions of this Agreement, and termination is
-effective if the defaulting party fails to correct such default within 30 days
-after written notice thereof by the non-defaulting party to the defaulting
+8.2. Either party may terminate this Agreement if the other party is in
+default of any of the terms and conditions of this Agreement, and termination
+is effective if the defaulting party fails to correct such default within 30
+days after written notice thereof by the non-defaulting party to the defaulting
party at the address below.
-8.3. Notwithstanding the foregoing, NXP may terminate this Agreement
+8.3. Notwithstanding the foregoing, NXP may terminate this Agreement
immediately upon written notice if you: breach any of your confidentiality
-obligations or the license restrictions under this Agreement; become bankrupt,
-insolvent, or file a petition for bankruptcy or insolvency, make an assignment
+obligations or the license restrictions under this Agreement; become bankrupt,
+insolvent, or file a petition for bankruptcy or insolvency; make an assignment
for the benefit of its creditors; enter proceedings for winding up or
-dissolution ;are dissolved; or are nationalized or become subject to the
-expropriation of all or substantially all of its business or assets.
-
-8.4. Upon termination of this Agreement, all licenses granted under Section 2
-will expire, except that any licenses extended to end-users pursuant to
-Sections 2.2(b), 2.2(c), and 2.3(b), which have been granted prior to such
-termination will survive.
-
-8.5. After termination of this Agreement by either party and upon NXP's written
-request, you will, at your discretion, return to the NXP any confidential
-information including all copies thereof or furnish to NXP at the address
-below, a statement certifying, with respect to the Licensed Software delivered
-hereunder that the original and all copies, except for archival copies to be
-used solely for dispute resolution purposes, in whole or in part, in any form,
-of the Licensed Software have been destroyed.
-
-8.6. Notwithstanding the termination of this Agreement for any reason, the
-terms of Sections 1, 3, 5 through 25 will survive.
-
-9. SUPPORT. NXP is not obligated to provide any support, upgrades
-or new releases of the Licensed Software under this Agreement. If you wish, you
+dissolution; are dissolved; or are nationalized or become subject to the
+expropriation of all or substantially all of your business or assets.
+
+8.4. Upon termination of this Agreement, all licenses granted under
+Section 2 will expire.
+
+8.5. After termination of this Agreement by either party you will
+destroy all parts of Licensed Software and its Derivative Works (if any) and
+will provide to NXP a statement certifying the same.
+
+8.6. Notwithstanding the termination of this Agreement for any reason,
+the terms of Sections 1 and 3 through 25 will survive.
+
+9. SUPPORT. NXP is not obligated to provide any support, upgrades or
+new releases of the Licensed Software under this Agreement. If you wish, you
may contact NXP and report problems and provide suggestions regarding the
Licensed Software. NXP has no obligation to respond to such a problem report or
suggestion. NXP may make changes to the Licensed Software at any time, without
any obligation to notify or provide updated versions of the Licensed Software
to you.
+10. NO WARRANTY. To the maximum extent permitted by law, NXP expressly
+disclaims any warranty for the Licensed Software. The Licensed Software is
+provided "AS IS", without warranty of any kind, either express or implied,
+including without limitation the implied warranties of merchantability, fitness
+for a particular purpose, or non-infringement. You assume the entire risk
+arising out of the use or performance of the licensed software, or any systems
+you design using the licensed software (if any).
-10. NO WARRANTY. To the maximum extent permitted by law, NXP
-expressly disclaims any warranty for the Licensed Software. The Licensed
-Software is provided "AS IS", without warranty of any kind, either express or
-implied, including without limitation the implied warranties of
-merchantability, fitness for a particular purpose, or non-infringement. You
-assume the entire risk arising out of the use or performance of the licensed
-software, or any systems you design using the licensed software (if any).
-
-11. INDEMNITY. You agree to fully defend and indemnify NXP from all
+11. INDEMNITY. You agree to fully defend and indemnify NXP from all
claims, liabilities, and costs (including reasonable attorney's fees) related
-to (1) your use (including your contractors or distributee's use, if permitted)
-of the Licensed Software or (2) your violation of the terms and conditions of
-this Agreement.
+to (1) your use (including your subcontractor's or distributee's use, if
+permitted) of the Licensed Software or (2) your violation of the terms and
+conditions of this Agreement.
-12. LIMITATION OF LIABILITY. EXCLUDING LIABILITY FOR A BREACH OF
+12. LIMITATION OF LIABILITY. EXCLUDING LIABILITY FOR A BREACH OF
SECTION 2 (LICENSE GRANTS), SECTION 3 (LICENSE LIMITATIONS AND RESTRICTIONS),
SECTION 17 (CONFIDENTIAL INFORMATION), OR CLAIMS UNDER SECTION 11(INDEMNITY),
IN NO EVENT WILL EITHER PARTY BE LIABLE, WHETHER IN CONTRACT, TORT, OR
OTHERWISE, FOR ANY INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR PUNITIVE
DAMAGES, INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR ANY LOSS OF USE, LOSS OF
TIME, INCONVENIENCE, COMMERCIAL LOSS, OR LOST PROFITS, SAVINGS, OR REVENUES, TO
-THE FULL EXTENT SUCH MAY BE DISCLAIMED BY LAW. NXP'S TOTAL LIABILITY FOR ALL
+THE FULL EXTENT SUCH MAY BE DISCLAIMED BY LAW. NXP'S TOTAL LIABILITY FOR ALL
COSTS, DAMAGES, CLAIMS, OR LOSSES WHATSOEVER ARISING OUT OF OR IN CONNECTION
WITH THIS AGREEMENT OR PRODUCT(S) SUPPLIED UNDER THIS AGREEMENT IS LIMITED TO
THE AGGREGATE AMOUNT PAID BY YOU TO NXP IN CONNECTION WITH THE LICENSED
-SOFTWARE TO WHICH LOSSES OR DAMAGES ARE CLAIMED.
-
+SOFTWARE PROVIDED UNDER THIS AGREEMENT TO WHICH LOSSES OR DAMAGES ARE CLAIMED.
-13. EXPORT COMPLIANCE. Each party shall comply with all applicable
+13. EXPORT COMPLIANCE. Each party shall comply with all applicable
export and import control laws and regulations including but not limited to the
-US Export Administration Regulations (including prohibited party lists issued
-by other federal governments), Catch-all regulations and all national and
+US Export Administration Regulation (including prohibited party lists issued by
+other federal governments), Catch-all regulations and all national and
international embargoes. Each party further agrees that it will not knowingly
transfer, divert, export or re-export, directly or indirectly, any product,
software, including software source code, or technology restricted by such
@@ -293,88 +288,75 @@ such transfer, diversion, export or re-export is restricted or prohibited,
without obtaining prior written authorization from the applicable competent
government authorities to the extent required by those laws.
-14. GOVERNMENT CONTRACT COMPLIANCE.
-
-14.1. If you sell Authorized Systems directly to any government
-or public entity, including U.S., state, local, foreign or international
-governments or public entities, or indirectly via a prime contractor or
-subcontractor of such governments or entities, NXP makes no representations,
-certifications, or warranties whatsoever about compliance with government or
-public entity acquisition statutes or regulations, including, without
-limitation, statutes or regulations that may relate to pricing, quality, origin
-or content.
-
-14.2. The Licensed Software has been developed at private
-expense and is a "Commercial Item" as defined in 48 C.F.R. §2.101, consisting
-of "Commercial Computer Software", and/or "Commercial Computer Software
-Documentation," as such terms are used in 48 C.F.R. §12.212 (or 48 C.F.R.
-§227.7202, as applicable) and may only be licensed to or shared with U.S.
-Government end users in object code form as part of, or embedded within,
-Authorized Systems. Any agreement pursuant to which you share the Licensed
-Software will include a provision that reiterates the limitations of this
-document and requires all sub-agreements to similarly contain such limitations.
-
-15. SAFETY CRITICAL APPLICATIONS
-
-15.1. In some cases, NXP may promote certain Licensed Software
-for use in safety-related applications. NXP's goal is to educate licensees so
-that they can design their own end-product solutions to meet applicable
-functional safety standards and requirements. You make the ultimate design
-decisions regarding your products and are solely responsible for compliance
-with all legal, regulatory, safety, and security related requirements
-concerning your products, regardless of any information or support that may be
-provided by NXP. Accordingly, you will indemnify and hold NXP harmless from
-any claims, liabilities, damages and associated costs and expenses (including
-attorneys' fees) that NXP may incur related to your incorporation of any
-product in a safety-critical application or system.
-
-15.2. Only Licensed Software that NXP has specifically
-designated as "Automotive Qualified" is intended for use in automotive,
-military, or aerospace applications or environments. If you use Licensed
-Software that has not been designated as "Automotive Qualified" in an
-automotive, military, or aerospace application or environment, you do so at
-your own risk.
-
-15.3. Licensed Software is not intended or authorized for any
-use in anti-personnel landmines.
-
-16. CHOICE OF LAW; VENUE. This Agreement will be governed by,
+14. GOVERNMENT CONTRACT COMPLIANCE
+
+14.1. If you sell Authorized Systems directly to any government or public
+entity, including U.S., state, local, foreign or international governments or
+public entities, or indirectly via a prime contractor or subcontractor of such
+governments or entities, NXP makes no representations, certifications, or
+warranties whatsoever about compliance with government or public entity
+acquisition statutes or regulations, including, without limitation, statutes or
+regulations that may relate to pricing, quality, origin or content.
+
+14.2. The Licensed Software has been developed at private expense and is a
+"Commercial Item" as defined in 48 C.F.R. Section 2.101, consisting of
+"Commercial Computer Software", and/or "Commercial Computer Software
+Documentation," as such terms are used in 48 C.F.R. Section 12.212 (or 48
+C.F.R. Section 227.7202, as applicable) and may only be licensed to or shared
+with U.S. Government end users in object code form as part of, or embedded
+within, Authorized Systems. Any agreement pursuant to which you share the
+Licensed Software will include a provision that reiterates the limitations of
+this document and requires all sub-agreements to similarly contain such
+limitations.
+
+15. CRITICAL APPLICATIONS
+
+15.1. You make the ultimate design decisions regarding your products and
+are solely responsible for compliance with all legal, regulatory, safety, and
+security related requirements concerning your products, regardless of any
+information or support that may be provided by NXP. The Licensed Software is
+not designed for use in connection with products, applications, or systems
+where a failure could cause personal injury or death. If Licensee's, or
+Licensee's contractors or distributees, permit use of the Licensed Software for
+such products, applications, or systems, Licensee agrees to indemnify NXP and
+its officers and employees from all liability, including attorneys' fees and
+costs.
+
+16. CHOICE OF LAW; VENUE. This Agreement will be governed by,
construed, and enforced in accordance with the laws of The Netherlands, without
regard to conflicts of laws principles, will apply to all matters relating to
this Agreement or the Licensed Software, and you agree that any litigation will
be subject to the exclusive jurisdiction of the courts of Amsterdam, The
-Netherlands. The United Nations Convention on Contracts for the International
+Netherlands. The United Nations Convention on Contracts for the International
Sale of Goods will not apply to this document.
-17. CONFIDENTIAL INFORMATION. Subject to the license grants and
+17. CONFIDENTIAL INFORMATION. Subject to the license grants and
restrictions contained herein, you must treat the Licensed Software as
confidential information and you agree to retain the Licensed Software in
-confidence perpetually, with respect to Licensed Software in source code form
-(human readable), or for a period of five (5) years from the date of
-termination of this Agreement, with respect to all other parts of the Licensed
-Software. During this period, you may not disclose any part of the Licensed
-Software to anyone other than employees, or sub-contractors in accordance with
-Section 2.4 who have a need to know of the Licensed Software and who have
-executed written agreements obligating them to protect such Licensed Software
-to at least the same degree of care as in this Agreement. You agree to use the
-same degree of care, but no less than a reasonable degree of care, with the
-Licensed Software as you do with your own confidential information. You may
-disclose Licensed Software to the extent required by a court or under operation
-of law or order provided that you notify NXP of such requirement prior to
-disclosure, which you only disclose information required, and that you allow
-NXP the opportunity to object to such court or other legal body requiring such
+confidence perpetually. You may not disclose any part of the Licensed Software
+to anyone other than distributees in accordance with Section 2.3 and employees,
+or subcontractors in accordance with Section 2.5, who have a need to know of
+the Licensed Software and who have executed written agreements obligating them
+to protect such Licensed Software to at least the same degree of
+confidentiality as in this Agreement. You agree to use the same degree of care,
+but no less than a reasonable degree of care, with the Licensed Software as you
+do with your own confidential information. You may disclose Licensed Software
+to the extent required by a court or under operation of law or order provided
+that you notify NXP of such requirement prior to disclosure, which you only
+disclose the minimum of the required information, and that you allow NXP the
+opportunity to object to such court or other legal body requiring such
disclosure.
-18. TRADEMARKS. You are not authorized to use any NXP trademarks,
-brand names, or logos.
+18. TRADEMARKS. You are not authorized to use any NXP trademarks, brand
+names, or logos.
-19. ENTIRE AGREEMENT. This Agreement constitutes the entire
-agreement between you and NXP regarding the subject matter of this Agreement,
-and supersedes all prior communications, negotiations, understandings,
-agreements or representations, either written or oral, if any. This Agreement
-may only be amended in written form, signed by you and NXP.
+19 ENTIRE AGREEMENT. This Agreement constitutes the entire agreement
+between you and NXP regarding the subject matter of this Agreement, and
+supersedes all prior communications, negotiations, understandings, agreements
+or representations, either written or oral, if any. This Agreement may only be
+amended in written form, signed by you and NXP.
-20. SEVERABILITY. If any provision of this Agreement is held for any
+20. SEVERABILITY. If any provision of this Agreement is held for any
reason to be invalid or unenforceable, then the remaining provisions of this
Agreement will be unimpaired and, unless a modification or replacement of the
invalid or unenforceable provision is further held to deprive you or NXP of a
@@ -383,211 +365,208 @@ invalid or unenforceable provision will be replaced with a provision that is
valid and enforceable and that comes closest to the intention underlying the
invalid or unenforceable provision.
-21. NO WAIVER. The waiver by NXP of any breach of any provision of
-this Agreement will not operate or be construed as a waiver of any other or a
+21. NO WAIVER. The waiver by NXP of any breach of any provision of this
+Agreement will not operate or be construed as a waiver of any other or a
subsequent breach of the same or a different provision.
-22. AUDIT. You will keep full, clear and accurate records with
-respect to your compliance with the limited license rights granted under this
-Agreement for three years following expiration or termination of this
-Agreement. NXP will have the right, either itself or through an independent
-certified public accountant to examine and audit, at NXP's expense, not more
-than once a year, and during normal business hours, all such records that may
-bear upon your compliance with the limited license rights granted above. You
-must make prompt adjustment to compensate for any errors and/or omissions
-disclosed by such examination or audit.
-
-23. NOTICES. All notices and communications under this
+22. AUDIT. You will keep full, clear and accurate records with respect
+to your compliance with the limited license rights granted under this Agreement
+for three years following expiration or termination of this Agreement. NXP will
+have the right, either itself or through an independent certified public
+accountant to examine and audit, at NXP's expense, not more than once a year,
+and during normal business hours, all such records that may bear upon your
+compliance with the limited license rights granted above. You must make prompt
+adjustment to compensate for any errors and/or omissions disclosed by such
+examination or audit.
+
+23. NOTICES. All notices and communications under this
Agreement will be made in writing, and will be effective when received at the
following addresses:
-NXP: NXP B.V.
-
- High Tech Campus 60
-
- 5656 AG Eindhoven
-
- The Netherlands
-
- ATTN: Legal Department
+ NXP: NXP B.V.
+ High Tech Campus 60
+ 5656 AG Eindhoven
+ The Netherlands
+ ATTN: Legal Department
+You: The address provided at registration will be used.
-
- You: The address provided at registration will
-be used.
-
-24. RELATIONSHIP OF THE PARTIES. The parties are independent
-contractors. Nothing in this Agreement will be construed to create any
-partnership, joint venture, or similar relationship. Neither party is
+24. RELATIONSHIP OF THE PARTIES. The parties are independent
+contractors. Nothing in this Agreement will be construed to create any
+partnership, joint venture, or similar relationship. Neither party is
authorized to bind the other to any obligations with third parties.
-25. SUCCESSION AND ASSIGNMENT. This Agreement will be binding upon
-and inure to the benefit of the parties and their permitted successors and
-assigns. You may not assign this Agreement, or any part of this Agreement,
-without the prior written approval of NXP, which approval will not be
-unreasonably withheld or delayed. NXP may assign this Agreement, or any part of
-this Agreement, in its sole discretion.
-
-
-
-
+25. SUCCESSION AND ASSIGNMENT. This Agreement will be binding upon and
+inure to the benefit of the parties and their permitted successors and assigns.
+ You may not assign this Agreement, or any part of this Agreement, without the
+prior written approval of NXP, which approval will not be unreasonably withheld
+or delayed. NXP may assign this Agreement, or any part of this Agreement, in
+its sole discretion.
APPENDIX A
Other License Grants and Restrictions:
The Licensed Software may include some or all of the following software, which
-is either 1) not NXP proprietary software or 2) NXP proprietary software
-subject to different terms than those in the Agreement. If the Software
-Content Register that accompanies the Licensed Software identifies any of the
-following Third Party Software or specific components of the NXP Proprietary
-Software, the following terms apply to the extent they deviate from the terms
-in the Agreement:
-
-
-
-Third Party Software Use Restrictions
-
-Amphion Semiconductor Ltd.
-Distribution of Amphion software must be a part of, or embedded within,
-Authorized Systems that include an Amphion Video Decoder.
-
-Atheros
-Use of Atheros software is limited to evaluation and demonstration only.
-Permitted distributions must be similarly limited. Further rights must be
-obtained directly from Atheros.
-
-ATI (AMD)
-Distribution of ATI software must be a part of, or embedded within, Authorized
-Systems that include a ATI graphics processor core.
-
-Broadcom Corporation
-Your use of Broadcom Corporation software is restricted to Authorized Systems
-that incorporate a compatible integrated circuit device manufactured or sold by
-Broadcom.
-
-Cadence Design Systems
-Use of Cadence audio codec software is limited to evaluation and demonstration
-only of one copy embedded in a single NXP Product. Further rights must be
-obtained from Cadence. The license granted herein to the Cadence Design Systems
-HiFi aacPlus Audio Decoder software does not include a license to the AAC
-family of technologies which you or your customer may need to obtain.
-Configuration tool outputs may only be distributed by licensees of the relevant
-Cadence SDK and distribution is limited to distribution of one copy embedded in
-a single NXP Product.
-
-Cirque Corporation
-Use of Cirque Corporation technology is limited to evaluation, demonstration,
-or certification testing only. Permitted distributions must be similarly
-limited. Further rights, including but not limited to ANY commercial
-distribution rights, must be obtained directly from Cirque Corporation.
-
-Coding Technologies (Dolby Labs)
-Use of CTS software is limited to evaluation and demonstration only. Permitted
-distributions must be similarly limited. Further rights must be obtained from
-Dolby Laboratories.
-
-CSR
-Use of Cambridge Silicon Radio, Inc. ("CSR") software is limited to evaluation
+is either 1) Third Party Software or 2) NXP proprietary software subject to
+different terms than those in the Agreement. If the Software Content Register
+that accompanies the Licensed Software identifies any of the following Third
+Party Software or specific components of the NXP proprietary software, the
+following terms apply to the extent they deviate from the terms in the
+Agreement:
+
+Amazon: Use of the Amazon software constitutes your acceptance of the terms of
+the Amazon Program Materials License Agreement (including the AVS Component
+Schedule, if applicable), located at
+https://developer.amazon.com/support/legal/pml. All Amazon software is hereby
+designated "Amazon confidential". Amazon is a third-party beneficiary to this
+Agreement with respect to the Amazon software.
+
+Amphion Semiconductor Ltd.: Distribution of Amphion software must be a part of,
+or embedded within, Authorized Systems that include an Amphion Video Decoder.
+
+Aquantia Corp.: You may use Aquantia's API binaries solely to flash the API
+software to an NXP Product which mates with an Aquantia device.
+
+Atheros: Use of Atheros software is limited to evaluation and demonstration
+only. Permitted distributions must be similarly limited. Further rights must
+be obtained directly from Atheros.
+
+ATI (AMD): Distribution of ATI software must be a part of, or embedded within,
+Authorized Systems that include a ATI graphics processor core.
+
+Broadcom Corporation: Your use of Broadcom Corporation software is restricted
+to Authorized Systems that incorporate a compatible integrated circuit device
+manufactured or sold by Broadcom.
+
+Cadence Design Systems: Use of Cadence audio codec software is limited to
+distribution only of one copy per single NXP Product. The license granted
+herein to the Cadence Design Systems HiFi aacPlus Audio Decoder software does
+not include a license to the AAC family of technologies which you or your
+customer may need to obtain. Configuration tool outputs may only be distributed
+by licensees of the relevant Cadence SDK and distribution is limited to
+distribution of one copy embedded in a single NXP Product.
+
+Cirque Corporation: Use of Cirque Corporation technology is limited to
+evaluation, demonstration, or certification testing only. Permitted
+distributions must be similarly limited. Further rights, including but not
+limited to ANY commercial distribution rights, must be obtained directly from
+Cirque Corporation.
+
+Coding Technologies (Dolby Labs): Use of CTS software is limited to evaluation
and demonstration only. Permitted distributions must be similarly limited.
-Further rights must be obtained directly from CSR.
-
-NXP Wireless Charging Library
-License to the Software is limited to use in inductive coupling or wireless
-charging applications
-
-Global Locate (Broadcom Corporation)
-Use of Global Locate, Inc. software is limited to evaluation and demonstration
-only. Permitted distributions must be similarly limited. Further rights must
-be obtained from Global Locate.
-
-Imagination Technologies Limited (IMG)
-If the Licensed Software includes proprietary software developed by IMG, your
-rights are limited to a non-exclusive, world-wide right and nontransferable and
-non-sub-licensable license (i) to use and modify the Licensed Software and
-documentation and (ii) to copy and distribute the Licensed Software only in
-object code form solely for use on NXP Rayleigh products. If you are provided
-with the Licensed Software in source code format, you are restricted to
-accessing only those deliverables in source code format which are necessary for
-you to carry out either specific customization or porting work in association
-with NXP's Rayleigh products or your Authorized System.
-
-The confidentiality restrictions shall continue in force without limit in time
-notwithstanding the termination or expiration of this Agreement.
-
-Micrium
-uC/OS-II and uC/OS-III is provided in source form for FREE short-term
-evaluation, for educational use or for peaceful research. If you plan or
-intend to use uC/OS-II or uC/OS-III in a commercial application/product then,
-you need to contact Micrium to properly license uC/OS-II or uC/OSIII for its
-use in your application/product. We provide ALL the source code for your
-convenience and to help you experience uC/OS-II or uC/OSIII. The fact that the
-source is provided does NOT mean that you can use it commercially without
-paying a licensing fee.
-
-Microsoft
-If the Licensed Software includes software owned by Microsoft
-Corporation ("Microsoft"), it is subject to the terms of your license with
-Microsoft (the "Microsoft Underlying Licensed Software") and as such, NXP
-grants no license to you, beyond evaluation and demonstration in connection
-with NXP processors, in the Microsoft Underlying Licensed Software. You must
-separately obtain rights beyond evaluation and demonstration in connection with
-the Microsoft Underlying Licensed Software from Microsoft.
-
-Microsoft does not provide support services for the components provided to you
-through this Agreement. If you have any questions or require technical
-assistance, please contact NXP. Microsoft Corporation is a third party
-beneficiary to this Agreement with the right to enforce the terms of this
-Agreement. TO THE MAXIMUM EXTENT PERMITTED BY LAW, MICROSOFT AND ITS
-AFFILIATES DISCLAIM ANY WARRANTIES FOR THE
-MICROSOFT UNDERLYING LICENSED SOFTWARE. TO THE MAXIMUM
-EXTENT PERMITTED BY LAW, NEITHER MICROSOFT NOR ITS AFFILIATES
-WILL BE LIABLE, WHETHER IN CONTRACT, TORT, OR OTHERWISE, FOR ANY
-DIRECT, INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR PUNITIVE
-DAMAGES, INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR ANY LOSS
-OF USE, LOSS OF TIME, INCONVENIENCE, COMMERCIAL LOSS, OR LOST PROFITS, SAVINGS,
-OR REVENUES, ARISING FROM THE FROM THE USE OF THE MICROSOFT UNDERLYING LICENSED
-SOFTWARE.
-
-MindTree
-Notwithstanding the terms contained in Section 2.3 (a), if the Licensed
-Software includes proprietary software of MindTree in source code format,
-Licensee may make modifications and create derivative works only to the extent
-necessary for debugging of the Licensed Software.
-
-MPEG LA
-Use of MPEG LA audio or video codec technology is limited to evaluation and
+Further rights must be obtained from Dolby Laboratories.
+
+CSR: Use of Cambridge Silicon Radio, Inc. ("CSR") software is limited to
+evaluation and demonstration only. Permitted distributions must be similarly
+limited. Further rights must be obtained directly from CSR.
+
+Crank: Use of Crank Software Inc. software is limited to evaluation and
demonstration only. Permitted distributions must be similarly limited. Further
-rights must be obtained directly from MPEG LA.
-
-MQX RTOS Code
-MQX RTOS source code may not be re-distributed by any NXP Licensee under any
-circumstance, even by a signed written amendment to this Agreement.
-
-Opus
-Use of Opus software must be consistent with the terms of the Opus license
-which can be found at: http://www.opus-codec.org/license/
-
-Qualcomm Atheros, Inc.
-Notwithstanding anything in this Agreement, Qualcomm Atheros, Inc. Wi-Fi
-software must be used strictly in accordance with the Qualcomm Atheros, Inc.
-Technology License Agreement that accompanies such software. Any other use is
-expressly prohibited.
-
-Real Networks - its GStreamer Optimized Real Format Client Code implementation
-or OpenMax Optimized Real Format Client Code
-Use of the GStreamer Optimized Real Format Client Code, or OpenMax Optimized
-Real Format Client code is restricted to applications in the automotive market.
- Licensee must be a final manufacturer in good standing with a current license
-with Real Networks for the commercial use and distribution of products
-containing the GStreamer Optimized Real Format Client Code implementation or
-OpenMax Optimized Real Format Client Code
-
-Real Time Engineers Ltd.
-Any FreeRTOS source code, whether modified or in its original release form, or
-whether in whole or in part, can only be distributed by you under the terms of
-version 2 of the GNU General Public License plus this exception. An
-independent module is a module which is not derived from or based on FreeRTOS.
+rights must be obtained directly from Crank Software Inc.
+
+Cypress Semiconductor Corporation: WWD RTOS source code may only be used in
+accordance with the Cypress IOT Community License Agreement located at
+https://community.cypress.com/terms-and-conditions!input.jspa?displayOnly=true.
+
+Embedded Systems Academy GmbH (EmSA): Any use of Micro CANopen Plus is subject
+to the acceptance of the license conditions described in the LICENSE.INFO file
+distributed with all example projects and in the documentation and the
+additional clause described below.
+
+Clause 1: Micro CANopen Plus may not be used for any competitive or comparative
+purpose, including the publication of any form of run time or compile time
+metric, without the express permission of EmSA.
+
+Future Technology Devices International Ltd.: Future Technology Devices
+International software must be used consistent with the terms found here:
+http://www.ftdichip.com/Drivers/FTDriverLicenceTerms.htm
+
+Global Locate (Broadcom Corporation): Use of Global Locate, Inc. software is
+limited to evaluation and demonstration only. Permitted distributions must be
+similarly limited. Further rights must be obtained from Global Locate.
+
+Microsoft: Except for Microsoft PlayReady software, if the Licensed Software
+includes software owned by Microsoft Corporation ("Microsoft"), it is subject
+to the terms of your license with Microsoft (the "Microsoft Underlying Licensed
+Software") and as such, NXP grants no license to you, beyond evaluation and
+demonstration in connection with NXP processors, in the Microsoft Underlying
+Licensed Software. You must separately obtain rights beyond evaluation and
+demonstration in connection with the Microsoft Underlying Licensed Software
+from Microsoft. Microsoft does not provide support services for the components
+provided to you through this Agreement. If you have any questions or require
+technical assistance, please contact NXP. Microsoft Corporation is a third
+party beneficiary to this Agreement with the right to enforce the terms of this
+Agreement. TO THE MAXIMUM EXTENT PERMITTED BY LAW, MICROSOFT AND ITS
+AFFILIATES DISCLAIM ANY WARRANTIES FOR THE MICROSOFT UNDERLYING LICENSED
+SOFTWARE. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NEITHER MICROSOFT NOR ITS
+AFFILIATES WILL BE LIABLE, WHETHER IN CONTRACT, TORT, OR OTHERWISE, FOR ANY
+DIRECT, INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR PUNITIVE DAMAGES,
+INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR ANY LOSS OF USE, LOSS OF TIME,
+INCONVENIENCE, COMMERCIAL LOSS, OR LOST PROFITS, SAVINGS, OR REVENUES, ARISING
+FROM THE FROM THE USE OF THE MICROSOFT UNDERLYING LICENSED SOFTWARE. With
+respect to the Microsoft PlayReady software, you will have the license rights
+granted in Section 2, provided that you may not use the Microsoft PlayReady
+software unless you have entered into a Microsoft PlayReady Master Agreement
+and license directly with Microsoft.
+
+MindTree: Notwithstanding the terms contained in Section 2.3 (a), if the
+Licensed Software includes proprietary software of MindTree in source code
+format, Licensee may make modifications and create derivative works only to the
+extent necessary for debugging of the Licensed Software.
+
+MM SOLUTIONS AD: Use of MM SOLUTIONS AEC (Auto Exposure Control) and AWB (Auto
+White Balance) software is limited to demonstration, testing, and evaluation
+only. In no event may Licensee distribute or sublicense the MM SOLUTIONS
+software. Further rights must be obtained directly from MM SOLUTIONS.
+
+MPEG LA: Use of MPEG LA audio or video codec technology is limited to
+evaluation and demonstration only. Permitted distributions must be similarly
+limited. Further rights must be obtained directly from MPEG LA.
+
+MQX RTOS Code: MQX RTOS source code may not be re-distributed by any NXP
+Licensee under any circumstance, even by a signed written amendment to this
+Agreement.
+
+NXP Wireless Charging Library: License to the Software is limited to use in
+inductive coupling or wireless charging applications
+
+Opus: Use of Opus software must be consistent with the terms of the Opus
+license which can be found at: http://www.opus-codec.org/license/
+
+Oracle JRE (Java): The Oracle JRE must be used consistent with terms found
+here: http://java.com/license
+
+P&E Micro: P&E Software must be used consistent with the terms found here:
+http://www.pemicro.com/licenses/gdbserver/license_gdb.pdf
+
+Pro Design Electronic: Licensee may not modify, create derivative works based
+on, or copy the Pro Design software, documentation, hardware execution key or
+the accompanying materials. Licensee shall not use Pro Design's or any of its
+licensors names, logos or trademarks to market the Authorized System. Only NXP
+customers and distributors are permitted to further redistribute the Pro Design
+software and only as part of an Authorized System which contains the Pro Design
+software.
+
+Qualcomm Atheros, Inc.: Notwithstanding anything in this Agreement, Qualcomm
+Atheros, Inc. Wi-Fi software must be used strictly in accordance with the
+Qualcomm Atheros, Inc. Technology License Agreement that accompanies such
+software. Any other use is expressly prohibited.
+
+Real Networks - GStreamer Optimized Real Format Client Code implementation or
+OpenMax Optimized Real Format Client Code: Use of the GStreamer Optimized Real
+Format Client Code, or OpenMax Optimized Real Format Client code is restricted
+to applications in the automotive market. Licensee must be a final
+manufacturer in good standing with a current license with Real Networks for the
+commercial use and distribution of products containing the GStreamer Optimized
+Real Format Client Code implementation or OpenMax Optimized Real Format Client
+Code
+
+Real Time Engineers Ltd.: Any FreeRTOS source code, whether modified or in its
+original release form, or whether in whole or in part, can only be distributed
+by you under the terms of version 2 of the GNU General Public License plus this
+exception. An independent module is a module which is not derived from or
+based on FreeRTOS.
Clause 1: Linking FreeRTOS with other modules is making a combined work based
on FreeRTOS. Thus, the terms and conditions of the GNU General Public License
@@ -606,24 +585,25 @@ including the publication of any form of run time or compile time metric,
without the express permission of Real Time Engineers Ltd. (this is the norm
within the industry and is intended to ensure information accuracy).
-RivieraWaves SAS (a member of the CEVA, Inc. family of companies)
-You may not use the RivieraWaves intellectual property licensed under this
-Agreement if you develop, market, and/or license products similar to such
-RivieraWaves intellectual property. Such use constitutes a breach of this
-Agreement. Any such use rights must be obtained directly from RivieraWaves.
+RivieraWaves SAS (a member of the CEVA, Inc. family of companies): You may not
+use the RivieraWaves intellectual property licensed under this Agreement if you
+develop, market, and/or license products similar to such RivieraWaves
+intellectual property. Such use constitutes a breach of this Agreement. Any
+such use rights must be obtained directly from RivieraWaves.
-SanDisk Corporation
-If the Licensed Software includes software developed by SanDisk Corporation
-("SanDisk"), you must separately obtain the rights to reproduce and distribute
-this software in source code form from SanDisk. Please follow these easy steps
-to obtain the license and software:
+SanDisk Corporation: If the Licensed Software includes software developed by
+SanDisk Corporation ("SanDisk"), you must separately obtain the rights to
+reproduce and distribute this software in source code form from SanDisk.
+Please follow these easy steps to obtain the license and software:
-1. Contact your local SanDisk sales representative to obtain the SanDisk
+(1) Contact your local SanDisk sales representative to obtain the SanDisk
License Agreement.
-2. Sign the license agreement. Fax the signed agreement to SanDisk USA
+
+(2) Sign the license agreement. Fax the signed agreement to SanDisk USA
marketing department at 408-542-0403. The license will be valid when fully
executed by SanDisk.
-3. If you have specific questions, please send an email to sales@sandisk.com
+
+(3) If you have specific questions, please send an email to sales@sandisk.com
You may only use the SanDisk Corporation Licensed Software on products
compatible with a SanDisk Secure Digital Card. You may not use the SanDisk
@@ -631,29 +611,43 @@ Corporation Licensed Software on any memory device product. SanDisk retains
all rights to any modifications or derivative works to the SanDisk Corporation
Licensed Software that you may create.
-SEGGER Microcontroller
-Your use of SEGGER emWin software is restricted to NXP ARM7, ARM9, Cortex-M0,
-Cortex-M3, and Cortex-M4 based devices only.
+SEGGER Microcontroller - emWin Software: Your use of SEGGER emWin software and
+components is restricted for development of NXP ARM7, ARM9, Cortex-M0,
+Cortex-M3, Cortex-M4, Cortex-M33, Cortex-M7, and Cortex-A7 based products only.
+
+SEGGER Microcontroller - J-Link/J-Trace Software: Segger software must be used
+consistent with the terms found here: http://www.segger.com/jlink-software.html
-Synopsys/Target Compiler Technologies
-Your use of the Synopsys/Target Compiler Technologies Licensed Software and
-related documentation is subject to the following:
+Synopsys/Target Compiler Technologies: Your use of the Synopsys/Target Compiler
+Technologies Licensed Software and related documentation is subject to the
+following:
-* Duration of the license for the Licensed Software is limited to 12
-months, unless otherwise specified in the license file.
-* The Licensed Software is usable by one user at a time on a single
+(1) Duration of the license for the Licensed Software is limited to 12 months,
+unless otherwise specified in the license file.
+
+(2) The Licensed Software is usable by one user at a time on a single
designated computer, unless otherwise agreed by Synopsys.
-* Licensed Software and documentation are to be used only on a designated
+
+(3) Licensed Software and documentation are to be used only on a designated
computer at the designated physical address provided by you on the APEX license
form.
-* The Licensed Software is not sub-licensable.
+(4) The Licensed Software is not sub-licensable.
+
+TARA Systems: Use of TARA Systems GUI technology Embedded Wizard is limited to
+evaluation and demonstration only. Permitted distributions must be similarly
+limited. Further rights must be obtained directly from TARA Systems.
+
+Texas Instruments: Your use of Texas Instruments Inc. WiLink8 Licensed Software
+is restricted to NXP SoC based systems that include a compatible connectivity
+device manufactured by TI.
-Texas Instruments
-Your use of Texas Instruments Inc. WiLink8 Licensed Software is restricted to
-NXP SoC based systems that include a compatible connectivity device
-manufactured by TI.
+TES Electronic Solutions Germany (TES): TES 3D Surround View software and
+associated data and documentation may only be used for evaluation purposes and
+for demonstration to third parties in integrated form on a board package
+containing an NXP S32V234 device. Licensee may not distribute or sublicense the
+TES software. Your license to the TES software may be terminated at any time
+upon notice.
-Vivante
-Distribution of Vivante software must be a part of, or embedded within,
-Authorized Systems that include a Vivante Graphics Processing Unit.
+Vivante: Distribution of Vivante software must be a part of, or embedded
+within, Authorized Systems that include a Vivante Graphics Processing Unit.
diff --git a/bsp/meta-freescale/README b/bsp/meta-freescale/README
index 1f40864b..6745e069 100644
--- a/bsp/meta-freescale/README
+++ b/bsp/meta-freescale/README
@@ -13,26 +13,22 @@ revision: HEAD
Contributing
------------
-To contribute to this layer you should submit the patches for review to the
-mailing list (meta-freescale@yoctoproject.org).
+Please submit any patches against the `meta-freescale` layer by using the
+GitHub pull-request feature. Fork the repo, make a branch, do the
+work, rebase from upstream, create the pull request.
-Please refer to:
+For some useful guidelines to be followed when submitting patches,
+please refer to:
http://openembedded.org/wiki/Commit_Patch_Message_Guidelines
-for some useful guidelines to be followed when submitting patches.
+Pull requests will be discussed within the GitHub pull-request
+infrastructure. If you want to get informed on new PRs and the
+follow-up discussions please use the GitHub's notification system.
Mailing list:
- https://lists.yoctoproject.org/listinfo/meta-freescale
+ https://lists.yoctoproject.org/g/meta-freescale
Source code:
https://github.com/Freescale/meta-freescale
-
-When creating patches, please use something like:
-
- git format-patch -s origin
-
-When sending patches, please use something like:
-
- git send-email --to meta-freescale@yoctoproject.org <generated patch>
diff --git a/bsp/meta-freescale/classes/dtc-145.bbclass b/bsp/meta-freescale/classes/dtc-145.bbclass
deleted file mode 100644
index d4a30711..00000000
--- a/bsp/meta-freescale/classes/dtc-145.bbclass
+++ /dev/null
@@ -1,7 +0,0 @@
-# Use this class for U-Boot 2017.03 or older.
-
-DEPENDS_append = " dtc-145-native"
-
-do_configure_prepend () {
- sed -i -e 's/^DTC[[:space:]]*=[[:space:]]*dtc[[:space:]]*$/DTC = dtc-145/' ${S}/Makefile
-}
diff --git a/bsp/meta-freescale/classes/fsl-dynamic-packagearch.bbclass b/bsp/meta-freescale/classes/fsl-dynamic-packagearch.bbclass
index a7cc53fc..9fcf37be 100644
--- a/bsp/meta-freescale/classes/fsl-dynamic-packagearch.bbclass
+++ b/bsp/meta-freescale/classes/fsl-dynamic-packagearch.bbclass
@@ -26,22 +26,22 @@
# Copyright 2013-2016 (C) O.S. Systems Software LTDA.
python __anonymous () {
- machine_arch_filter = set((d.getVar("MACHINE_ARCH_FILTER", True) or "").split())
- machine_socarch_filter = set((d.getVar("MACHINE_SOCARCH_FILTER", True) or "").split())
+ machine_arch_filter = set((d.getVar("MACHINE_ARCH_FILTER") or "").split())
+ machine_socarch_filter = set((d.getVar("MACHINE_SOCARCH_FILTER") or "").split())
if machine_socarch_filter or machine_arch_filter:
- provides = set((d.getVar("PROVIDES", True) or "").split())
- depends = set((d.getVar("DEPENDS", True) or "").split())
- PN = d.getVar("PN", True)
+ provides = set((d.getVar("PROVIDES") or "").split())
+ depends = set((d.getVar("DEPENDS") or "").split())
+ PN = d.getVar("PN")
package_arch = None
if list(machine_arch_filter & (provides | depends)):
- package_arch = d.getVar("MACHINE_ARCH", True)
+ package_arch = d.getVar("MACHINE_ARCH")
elif list(machine_socarch_filter & (provides | depends)):
- package_arch = d.getVar("MACHINE_SOCARCH", True)
+ package_arch = d.getVar("MACHINE_SOCARCH")
if not package_arch:
raise bb.parse.SkipPackage("You must set MACHINE_SOCARCH as MACHINE_SOCARCH_FILTER is set for this SoC.")
- machine_socarch_suffix = d.getVar("MACHINE_SOCARCH_SUFFIX", True)
+ machine_socarch_suffix = d.getVar("MACHINE_SOCARCH_SUFFIX")
if not machine_socarch_suffix:
raise bb.parse.SkipPackage("You must set MACHINE_SOCARCH_SUFFIX as MACHINE_SOCARCH_FILTER is set for this SoC.")
@@ -49,18 +49,18 @@ python __anonymous () {
bb.debug(1, "Use '%s' as package architecture for '%s'" % (package_arch, PN))
d.setVar("PACKAGE_ARCH", package_arch)
- cur_package_archs = (d.getVar("PACKAGE_ARCHS", True) or "").split()
- machine_socarch = (d.getVar("MACHINE_SOCARCH", True) or "")
+ cur_package_archs = (d.getVar("PACKAGE_ARCHS") or "").split()
+ machine_socarch = (d.getVar("MACHINE_SOCARCH") or "")
if not machine_socarch in cur_package_archs:
d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % machine_socarch)
- if d.getVar("TUNE_ARCH", True) == "arm":
+ if d.getVar("TUNE_ARCH") == "arm":
# For ARM we have two possible machine_socarch values, one for the arm and one for the thumb instruction set
# add the other value to extra archs also, so that a image recipe searches both for packages.
- if d.getVar("ARM_INSTRUCTION_SET", True) == "thumb":
- d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % d.getVar("ARM_EXTRA_SOCARCH", True))
+ if d.getVar("ARM_INSTRUCTION_SET") == "thumb":
+ d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % d.getVar("ARM_EXTRA_SOCARCH"))
else:
- d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % d.getVar("THUMB_EXTRA_SOCARCH", True))
+ d.appendVar("PACKAGE_EXTRA_ARCHS", " %s" % d.getVar("THUMB_EXTRA_SOCARCH"))
}
MACHINE_SOCARCH = "${TUNE_PKGARCH}${MACHINE_SOCARCH_SUFFIX}"
diff --git a/bsp/meta-freescale/classes/fsl-eula-unpack.bbclass b/bsp/meta-freescale/classes/fsl-eula-unpack.bbclass
index 198a1944..0671da91 100644
--- a/bsp/meta-freescale/classes/fsl-eula-unpack.bbclass
+++ b/bsp/meta-freescale/classes/fsl-eula-unpack.bbclass
@@ -6,12 +6,67 @@
#
# SRC_URI = "${FSL_MIRROR}/firmware-imx-${PV};fsl-eula=true"
-LIC_FILES_CHKSUM_append = " file://${FSL_EULA_FILE};md5=ab61cab9599935bfe9f700405ef00f28"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V8 = "01ba08a2b77c3a0a9d0ab5d4d83fed64"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V10 = "3880bb9c943b135a30fad5e8aabd3ee9"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V11 = "a31dce3023402a821cfcdc1bb8dbdbc0"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V12 = "8cf95184c220e247b9917e7244124c5a"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V13 = "102094e9e695888c6a9f9fda9004165d"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V14 = "d4f548f93b5fe0ee2bc86758c344412d"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V16 = "be67a88e9e6c841043b005ad7bcf8309"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V17 = "88595f92466edd79be7f4f9547ffa0ef"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V18 = "6b552f505eedab4a11ab538cf3db743a"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V20 = "08fd295cce89b0a9c74b9b83ed74f671"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V21 = "6bd2df2910a2234bf6f419b7d2f531a3"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V22 = "75abe2fa1d16ca79f87cde926f05f72d"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V24 = "ab61cab9599935bfe9f700405ef00f28"
+FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V26 = "5ab1a30d0cd181e3408077727ea5a2db"
+FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V3 = "6dfb32a488e5fd6bae52fbf6c7ebb086"
+FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V5 = "80c0478f4339af024519b3723023fe28"
+FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V7 = "fb0303e4ee8b0e71c094171e2272bd44"
+FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V8 = "72c0f70181bb6e83eee6aab8de12a9f3"
+FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9 = "6c12031a11b81db21cdfe0be88cac4b3"
+FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V10 = "fd4b227530cd88a82af6a5982cfb724d"
+FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V11 = "228c72f2a91452b8a03c4cab30f30ef9"
+FSL_EULA_FILE_MD5SUMS = " \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V8} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V10} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V11} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V12} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V13} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V14} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V16} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V17} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V18} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V20} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V21} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V22} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V24} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_BASE_LICENSE_V26} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V3} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V5} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V7} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V8} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V9} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V10} \
+ ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V11} \
+"
+
+# The checksum for the EULA in the layer
+FSL_EULA_FILE_MD5SUM ?= \
+ "${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V10}"
+
+LIC_FILES_CHKSUM_LAYER ?= "file://${FSL_EULA_FILE};md5=${FSL_EULA_FILE_MD5SUM}"
+LIC_FILES_CHKSUM_append = " ${LIC_FILES_CHKSUM_LAYER}"
LIC_FILES_CHKSUM[vardepsexclude] += "FSL_EULA_FILE"
+do_fetch_prepend() {
+ if "Proprietary" not in d.getVar("LICENSE"):
+ bb.fatal("The recipe LICENSE should include Proprietary but is " + d.getVar("LICENSE") + ".")
+}
+
python fsl_bin_do_unpack() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
+ src_uri = (d.getVar('SRC_URI') or "").split()
if len(src_uri) == 0:
return
@@ -21,32 +76,54 @@ python fsl_bin_do_unpack() {
rootdir = localdata.getVar('WORKDIR', True)
fetcher = bb.fetch2.Fetch(src_uri, localdata)
+ found = 0
for url in fetcher.ud.values():
- save_cwd = os.getcwd()
- # Check for supported fetchers
- if url.type in ['http', 'https', 'ftp', 'file']:
- if url.parm.get('fsl-eula', False):
- # If download has failed, do nothing
- if not os.path.exists(url.localpath):
- bb.debug(1, "Exiting as '%s' cannot be found" % url.basename)
- return
-
- # Change to the working directory
- bb.note("Handling file '%s' as a Freescale's EULA binary." % url.basename)
- save_cwd = os.getcwd()
- os.chdir(rootdir)
-
- cmd = "sh %s --auto-accept --force" % (url.localpath)
- bb.fetch2.runfetchcmd(cmd, d, quiet=True)
+ # Skip this fetcher if it's not under EULA or if the fetcher type is not supported
+ if not url.parm.get('fsl-eula', False) or url.type not in ['http', 'https', 'ftp', 'file']:
+ continue
+ # If download has failed, do nothing
+ if not os.path.exists(url.localpath):
+ bb.debug(1, "Exiting as '%s' cannot be found" % url.basename)
+ return
+ found += 1
+ bb.note("Handling file '%s' as a Freescale EULA-licensed archive." % url.basename)
+ cmd = "sh %s --auto-accept --force" % (url.localpath)
+ bb.fetch2.runfetchcmd(cmd, d, quiet=True, workdir=rootdir)
- # Return to the previous directory
- os.chdir(save_cwd)
+ # Check for two EULAs, one from the layer and one from the package
+ bb.note("Checking LIC_FILES_CHKSUM for Freescale EULA consistency...")
+ if found > 1:
+ bb.warn("The package contains multiple Freescale EULA-licensed archives. The consistency logic may not be able to detect a EULA problem.")
+ layer_license = d.getVar('LIC_FILES_CHKSUM_LAYER')
+ licenses = d.getVar('LIC_FILES_CHKSUM') or ""
+ md5sums = d.getVar('FSL_EULA_FILE_MD5SUMS') or ""
+ found_layer_license = False
+ found_package_license = False
+ for license in licenses.split():
+ try:
+ (method, host, path, user, pswd, parm) = bb.fetch.decodeurl(license)
+ if method != "file" or not path:
+ raise bb.fetch.MalformedUrl()
+ except bb.fetch.MalformedUrl:
+ bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), license))
+ if license == layer_license:
+ bb.note("Found Freescale EULA for the layer %s." % license)
+ found_layer_license = True
+ elif parm.get('md5') in md5sums:
+ bb.note("Found Freescale EULA for the package %s." % license)
+ found_package_license = True
+ if not found_layer_license:
+ bb.fatal("The Freescale layer EULA '%s' is not listed in LIC_FILES_CHKSUM '%s'."
+ % (layer_license, licenses))
+ if not found_package_license:
+ bb.fatal("A valid package EULA with md5sum in %s was not found in LIC_FILES_CHKSUM '%s'."
+ % (md5sums.split(), licenses))
}
python do_unpack() {
- eula = d.getVar('ACCEPT_FSL_EULA', True)
- eula_file = d.getVar('FSL_EULA_FILE', True)
- pkg = d.getVar('PN', True)
+ eula = d.getVar('ACCEPT_FSL_EULA')
+ eula_file = d.getVar('FSL_EULA_FILE')
+ pkg = d.getVar('PN')
if eula == None:
bb.fatal("To use '%s' you need to accept the Freescale EULA at '%s'. "
"Please read it and in case you accept it, write: "
diff --git a/bsp/meta-freescale/classes/fsl-vivante-kernel-driver-handler.bbclass b/bsp/meta-freescale/classes/fsl-vivante-kernel-driver-handler.bbclass
index e0578f4e..8ac8a334 100644
--- a/bsp/meta-freescale/classes/fsl-vivante-kernel-driver-handler.bbclass
+++ b/bsp/meta-freescale/classes/fsl-vivante-kernel-driver-handler.bbclass
@@ -41,9 +41,9 @@ python fsl_vivante_kernel_driver_handler () {
return
if use_vivante_kernel_driver_module != "1":
- e.data.appendVar('RPROVIDES_kernel-base', ' kernel-module-imx-gpu-viv')
- e.data.appendVar('RREPLACES_kernel-base', ' kernel-module-imx-gpu-viv')
- e.data.appendVar('RCONFLICTS_kernel-base', ' kernel-module-imx-gpu-viv')
+ e.data.appendVar('RPROVIDES_${KERNEL_PACKAGE_NAME}-base', ' kernel-module-imx-gpu-viv')
+ e.data.appendVar('RREPLACES_${KERNEL_PACKAGE_NAME}-base', ' kernel-module-imx-gpu-viv')
+ e.data.appendVar('RCONFLICTS_${KERNEL_PACKAGE_NAME}-base', ' kernel-module-imx-gpu-viv')
}
addhandler fsl_vivante_kernel_driver_handler
diff --git a/bsp/meta-freescale/classes/kernel-itbimage.bbclass b/bsp/meta-freescale/classes/kernel-itbimage.bbclass
index 703fa616..84262879 100644
--- a/bsp/meta-freescale/classes/kernel-itbimage.bbclass
+++ b/bsp/meta-freescale/classes/kernel-itbimage.bbclass
@@ -12,9 +12,9 @@ python __anonymous () {
else:
replacementtype = "vmlinux"
- # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
- # to kernel.bbclass . We have to override it, since we pack zImage
- # (at least for now) into the fitImage .
+ # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
+ # to kernel.bbclass . We have to override it, since we pack zImage
+ # (at least for now) into the fitImage .
typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
if 'itbImage' in typeformake.split():
d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('itbImage', replacementtype))
diff --git a/bsp/meta-freescale/classes/machine-overrides-extender.bbclass b/bsp/meta-freescale/classes/machine-overrides-extender.bbclass
index 959fdc16..4b7d66d5 100644
--- a/bsp/meta-freescale/classes/machine-overrides-extender.bbclass
+++ b/bsp/meta-freescale/classes/machine-overrides-extender.bbclass
@@ -15,18 +15,18 @@
# Copyright 2016-2018 (C) O.S. Systems Software LTDA.
def machine_overrides_extender(d):
- machine_overrides = (d.getVar('PRISTINE_MACHINEOVERRIDES', True) or '').split(':')
+ machine_overrides = (d.getVar('PRISTINE_MACHINEOVERRIDES') or '').split(':')
# Gather the list of overrides to filter out
machine_overrides_filter_out = []
for override in machine_overrides:
- machine_overrides_filter_out += (d.getVar('MACHINEOVERRIDES_EXTENDER_FILTER_OUT_%s' % override, True) or '').split()
+ machine_overrides_filter_out += (d.getVar('MACHINEOVERRIDES_EXTENDER_FILTER_OUT_%s' % override) or '').split()
# Drop any overrides of filter_out prior extending
machine_overrides = [o for o in machine_overrides if o not in machine_overrides_filter_out]
for override in machine_overrides:
- extender = d.getVar('MACHINEOVERRIDES_EXTENDER_%s' % override, True)
+ extender = d.getVar('MACHINEOVERRIDES_EXTENDER_%s' % override)
if extender:
extender = extender.split(':')
diff --git a/bsp/meta-freescale/classes/qoriq_build_64bit_kernel.bbclass b/bsp/meta-freescale/classes/qoriq_build_64bit_kernel.bbclass
index 2209e339..93b4d412 100644
--- a/bsp/meta-freescale/classes/qoriq_build_64bit_kernel.bbclass
+++ b/bsp/meta-freescale/classes/qoriq_build_64bit_kernel.bbclass
@@ -1,4 +1,4 @@
-inherit distro_features_check
+inherit features_check
REQUIRED_DISTRO_FEATURES_e6500 += "multiarch"
python () {
@@ -12,7 +12,7 @@ python () {
d.setVar('KERNEL_LD', d.getVar('CCACHE', False) + sys_multilib + '-' + 'ld.bfd' + d.getVar('HOST_LD_KERNEL_ARCH', False) + tc_options)
d.setVar('KERNEL_AR', d.getVar('CCACHE', False) + sys_multilib + '-' + 'ar' + d.getVar('HOST_AR_KERNEL_ARCH', False))
- error_qa = d.getVar('ERROR_QA', True)
+ error_qa = d.getVar('ERROR_QA')
if 'arch' in error_qa:
d.setVar('ERROR_QA', error_qa.replace(' arch', ''))
}
diff --git a/bsp/meta-freescale/classes/use-imx-headers.bbclass b/bsp/meta-freescale/classes/use-imx-headers.bbclass
index 9dcd864d..fcec68c8 100644
--- a/bsp/meta-freescale/classes/use-imx-headers.bbclass
+++ b/bsp/meta-freescale/classes/use-imx-headers.bbclass
@@ -14,6 +14,24 @@
# Copyright 2018 (C) O.S. Systems Software LTDA.
DEPENDS_append_imx = " linux-imx-headers"
+
+# Set runtime dependency of -dev for package inheriting this class to
+# linux-imx-headers-dev package. This is required in order to propagate
+# headers into the SDK
+RDEPENDS_${PN}-dev += "linux-imx-headers-dev"
+
PACKAGE_ARCH_imx ?= "${MACHINE_SOCARCH}"
STAGING_INCDIR_IMX = "${STAGING_INCDIR}/imx"
+
+# Recipes that inherit this class are contracted to use NXP BSP only.
+# This is done by overriding the COMPATIBLE_HOST, as this would effectively
+# cause recipes to be skipped in case if 'use-nxp-bsp' override is not
+# defined for them. This effectively marks recipes that should only be
+# built using NXP BSP, and gives an indication to mainline BSP creators
+# that recipe is not compatible with mainline.
+#
+# Typical example here would be imx-vpu-hantro recipe, which requires NXP
+# BSP and is not compatible with mainline.
+COMPATIBLE_HOST = '(null)'
+COMPATIBLE_HOST_use-nxp-bsp = '.*'
diff --git a/bsp/meta-freescale/conf/layer.conf b/bsp/meta-freescale/conf/layer.conf
index e171fdaa..1a22e024 100644
--- a/bsp/meta-freescale/conf/layer.conf
+++ b/bsp/meta-freescale/conf/layer.conf
@@ -8,7 +8,7 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
BBFILE_COLLECTIONS += "freescale-layer"
BBFILE_PATTERN_freescale-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_freescale-layer = "5"
-LAYERSERIES_COMPAT_freescale-layer = "thud"
+LAYERSERIES_COMPAT_freescale-layer = "zeus dunfell"
# Add the Freescale-specific licenses into the metadata
LICENSE_PATH += "${LAYERDIR}/custom-licenses"
@@ -16,23 +16,27 @@ LICENSE_PATH += "${LAYERDIR}/custom-licenses"
FSL_EULA_FILE = "${LAYERDIR}/EULA"
IMX_MIRROR ?= "https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/"
-QORIQ_MIRROR ?= "http://git.freescale.com/source/"
# FIXME: set this to avoid changing all the recipes that use it
FSL_MIRROR ?= "${IMX_MIRROR}"
MIRRORS += " \
${IMX_MIRROR} http://download.ossystems.com.br/bsp/freescale/source/ \n \
-${QORIQ_MIRROR} http://download.ossystems.com.br/bsp/freescale/source/ \n \
"
BBFILES_DYNAMIC += " \
+ aglprofilegraphical:${LAYERDIR}/dynamic-layers/aglprofilegraphical/*/*/*.bb \
+ aglprofilegraphical:${LAYERDIR}/dynamic-layers/aglprofilegraphical/*/*/*.bbappend \
+ \
browser-layer:${LAYERDIR}/dynamic-layers/browser-layer/*/*/*.bb \
browser-layer:${LAYERDIR}/dynamic-layers/browser-layer/*/*/*.bbappend \
\
filesystem-layer:${LAYERDIR}/dynamic-layers/filesystem-layer/*/*/*.bb \
filesystem-layer:${LAYERDIR}/dynamic-layers/filesystem-layer/*/*/*.bbappend \
\
+ ivi:${LAYERDIR}/dynamic-layers/ivi/*/*/*.bb \
+ ivi:${LAYERDIR}/dynamic-layers/ivi/*/*/*.bbappend \
+ \
networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bb \
networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bbappend \
\
diff --git a/bsp/meta-freescale/conf/machine/imx25pdk.conf b/bsp/meta-freescale/conf/machine/imx25pdk.conf
index e22d9f4e..9e8ad003 100644
--- a/bsp/meta-freescale/conf/machine/imx25pdk.conf
+++ b/bsp/meta-freescale/conf/machine/imx25pdk.conf
@@ -13,7 +13,7 @@ UBOOT_MACHINE ?= "mx25pdk_defconfig"
KERNEL_DEVICETREE = "imx25-pdk.dtb"
-SERIAL_CONSOLE = "115200 ttymxc0"
+SERIAL_CONSOLES = "115200;ttymxc0"
MACHINE_FEATURES = "usbgadget usbhost vfat alsa touchscreen"
diff --git a/bsp/meta-freescale/conf/machine/imx28evk.conf b/bsp/meta-freescale/conf/machine/imx28evk.conf
index 937fd143..7c359e54 100644
--- a/bsp/meta-freescale/conf/machine/imx28evk.conf
+++ b/bsp/meta-freescale/conf/machine/imx28evk.conf
@@ -18,7 +18,7 @@ UBOOT_CONFIG[sd-auart-console] = "mx28evk_auart_console_config,sdcard"
KERNEL_DEVICETREE = "imx28-evk.dtb"
-SERIAL_CONSOLE = "115200 ttyAMA0"
+SERIAL_CONSOLES = "115200;ttyAMA0"
MACHINE_FEATURES = "usbgadget usbhost vfat alsa touchscreen"
diff --git a/bsp/meta-freescale/conf/machine/imx6qdlsabreauto.conf b/bsp/meta-freescale/conf/machine/imx6qdlsabreauto.conf
index 71b1cf88..16c1dcb6 100644
--- a/bsp/meta-freescale/conf/machine/imx6qdlsabreauto.conf
+++ b/bsp/meta-freescale/conf/machine/imx6qdlsabreauto.conf
@@ -38,9 +38,9 @@ UBOOT_MACHINE ?= "mx6sabreauto_defconfig"
UBOOT_MAKE_TARGET = "all"
UBOOT_SUFFIX = "img"
SPL_BINARY = "SPL"
-WKS_FILE = "imx-uboot-spl-bootpart.wks"
+WKS_FILE = "imx-uboot-spl-bootpart.wks.in"
-SERIAL_CONSOLE = "115200 ttymxc3"
+SERIAL_CONSOLES = "115200;ttymxc3"
MACHINE_FIRMWARE_append_mx6 = " linux-firmware-ath6k"
diff --git a/bsp/meta-freescale/conf/machine/imx6qdlsabresd.conf b/bsp/meta-freescale/conf/machine/imx6qdlsabresd.conf
index a8407e28..2fe95dc6 100644
--- a/bsp/meta-freescale/conf/machine/imx6qdlsabresd.conf
+++ b/bsp/meta-freescale/conf/machine/imx6qdlsabresd.conf
@@ -17,14 +17,23 @@ require conf/machine/include/imx-base.inc
require conf/machine/include/tune-cortexa9.inc
KERNEL_DEVICETREE = " \
- imx6qp-sabresd.dtb imx6qp-sabresd-btwifi.dtb imx6qp-sabresd-hdcp.dtb \
- imx6qp-sabresd-ldo.dtb imx6qp-sabresd-ldo-pcie-cert.dtb \
- \
- imx6q-sabresd.dtb imx6q-sabresd-ldo.dtb imx6q-sabresd-hdcp.dtb \
- imx6q-sabresd-enetirq.dtb imx6q-sabresd-btwifi.dtb \
- \
- imx6dl-sabresd.dtb imx6dl-sabresd-ldo.dtb imx6dl-sabresd-hdcp.dtb \
- imx6dl-sabresd-enetirq.dtb imx6dl-sabresd-btwifi.dtb \
+ imx6qp-sabresd-btwifi.dtb \
+ imx6qp-sabresd.dtb \
+ imx6qp-sabresd-hdcp.dtb \
+ imx6qp-sabresd-ldo.dtb \
+ \
+ imx6q-sabresd-btwifi.dtb \
+ imx6q-sabresd.dtb \
+ imx6q-sabresd-enetirq.dtb \
+ imx6q-sabresd-hdcp.dtb \
+ imx6q-sabresd-ldo.dtb \
+ imx6q-sabresd-uart.dtb \
+ \
+ imx6dl-sabresd-btwifi.dtb \
+ imx6dl-sabresd.dtb \
+ imx6dl-sabresd-enetirq.dtb \
+ imx6dl-sabresd-hdcp.dtb \
+ imx6dl-sabresd-ldo.dtb \
"
KERNEL_DEVICETREE_use-mainline-bsp = " \
imx6qp-sabresd.dtb \
@@ -38,9 +47,9 @@ UBOOT_MACHINE ?= "mx6sabresd_defconfig"
UBOOT_MAKE_TARGET = "all"
UBOOT_SUFFIX = "img"
SPL_BINARY = "SPL"
-WKS_FILE = "imx-uboot-spl-bootpart.wks"
+WKS_FILE = "imx-uboot-spl-bootpart.wks.in"
-SERIAL_CONSOLE = "115200 ttymxc0"
+SERIAL_CONSOLES = "115200;ttymxc0"
MACHINE_FIRMWARE_append_mx6 = " linux-firmware-ath6k"
diff --git a/bsp/meta-freescale/conf/machine/imx6slevk.conf b/bsp/meta-freescale/conf/machine/imx6slevk.conf
index ffcbaaa7..5d81272f 100644
--- a/bsp/meta-freescale/conf/machine/imx6slevk.conf
+++ b/bsp/meta-freescale/conf/machine/imx6slevk.conf
@@ -19,7 +19,7 @@ UBOOT_CONFIG[epdc] = "mx6slevk_epdc_config"
UBOOT_CONFIG[spinor] = "mx6slevk_spinor_config"
UBOOT_CONFIG[mfgtool] = "mx6slevk_config"
-SERIAL_CONSOLE = "115200 ttymxc0"
+SERIAL_CONSOLES = "115200;ttymxc0"
MACHINE_FEATURES += " pci wifi bluetooth"
diff --git a/bsp/meta-freescale/conf/machine/imx6sllevk.conf b/bsp/meta-freescale/conf/machine/imx6sllevk.conf
index 84d1e319..478d1bbd 100644
--- a/bsp/meta-freescale/conf/machine/imx6sllevk.conf
+++ b/bsp/meta-freescale/conf/machine/imx6sllevk.conf
@@ -1,24 +1,22 @@
#@TYPE: Machine
-#@NAME: Freescale i.MX6SLL Evaluation Kit
+#@NAME: NXP i.MX6SLL Evaluation Kit
#@SOC: i.MX6SLL
-#@DESCRIPTION: Machine configuration for Freescale i.MX6SLL EVK
-#@MAINTAINER: Lauren Post lauren.post@nxp.com
+#@DESCRIPTION: Machine configuration for NXP i.MX6SLL EVK
+#@MAINTAINER: Alexandru Palalau ioan-alexandru.palalau@nxp.com
MACHINEOVERRIDES =. "mx6:mx6sll:"
include conf/machine/include/imx-base.inc
include conf/machine/include/tune-cortexa9.inc
-MACHINE_FIRMWARE_append = " firmware-imx-epdc firmware-imx-brcm"
-
-KERNEL_DEVICETREE = "imx6sll-evk.dtb imx6sll-evk-btwifi.dtb"
+KERNEL_DEVICETREE = "imx6sll-evk.dtb imx6sll-evk-btwifi.dtb imx6sll-evk-reva.dtb"
UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "mx6sllevk_config,sdcard"
UBOOT_CONFIG[epdc] = "mx6sllevk_epdc_config"
UBOOT_CONFIG[mfgtool] = "mx6sllevk_config"
-SERIAL_CONSOLE = "115200 ttymxc0"
+SERIAL_CONSOLES = "115200;ttymxc0"
MACHINE_FEATURES += " pci wifi bluetooth"
diff --git a/bsp/meta-freescale/conf/machine/imx6sxsabreauto.conf b/bsp/meta-freescale/conf/machine/imx6sxsabreauto.conf
index ca5c9746..1bdb1080 100644
--- a/bsp/meta-freescale/conf/machine/imx6sxsabreauto.conf
+++ b/bsp/meta-freescale/conf/machine/imx6sxsabreauto.conf
@@ -9,7 +9,7 @@ MACHINEOVERRIDES =. "mx6:mx6sx:"
require conf/machine/include/imx-base.inc
require conf/machine/include/tune-cortexa9.inc
-KERNEL_DEVICETREE = "imx6sx-sabreauto.dtb imx6sx-sabreauto-m4.dtb"
+KERNEL_DEVICETREE = "imx6sx-sabreauto.dtb"
KERNEL_DEVICETREE_use-mainline-bsp = "imx6sx-sabreauto.dtb"
PREFERRED_PROVIDER_u-boot = "u-boot-imx"
@@ -21,7 +21,7 @@ UBOOT_CONFIG[qspi1] = "mx6sxsabreauto_qspi1_config"
UBOOT_CONFIG[nand] = "mx6sxsabreauto_nand_config,ubifs"
UBOOT_CONFIG[mfgtool] = "mx6sxsabreauto_config"
-SERIAL_CONSOLE = "115200 ttymxc3"
+SERIAL_CONSOLES = "115200;ttymxc3"
MACHINE_FIRMWARE_append_mx6 = " linux-firmware-ath6k"
diff --git a/bsp/meta-freescale/conf/machine/imx6sxsabresd.conf b/bsp/meta-freescale/conf/machine/imx6sxsabresd.conf
index 3a969e4a..5793a0b0 100644
--- a/bsp/meta-freescale/conf/machine/imx6sxsabresd.conf
+++ b/bsp/meta-freescale/conf/machine/imx6sxsabresd.conf
@@ -22,7 +22,7 @@ UBOOT_CONFIG[qspi2] = "mx6sxsabresd_qspi2_config"
UBOOT_CONFIG[m4fastup] = "mx6sxsabresd_m4fastup_config"
UBOOT_CONFIG[mfgtool] = "mx6sxsabresd_config"
-SERIAL_CONSOLE = "115200 ttymxc0"
+SERIAL_CONSOLES = "115200;ttymxc0"
MACHINE_FIRMWARE_append_mx6 = " linux-firmware-ath6k"
diff --git a/bsp/meta-freescale/conf/machine/imx6ulevk.conf b/bsp/meta-freescale/conf/machine/imx6ulevk.conf
index 01ebce6f..18b6b04b 100644
--- a/bsp/meta-freescale/conf/machine/imx6ulevk.conf
+++ b/bsp/meta-freescale/conf/machine/imx6ulevk.conf
@@ -2,7 +2,7 @@
#@NAME: NXP i.MX6UL Evaluation Kit
#@SOC: i.MX6UL
#@DESCRIPTION: Machine configuration for NXP i.MX6UL EVK
-#@MAINTAINER: Lauren Post <lauren.post@nxp.com>
+#@MAINTAINER: Alexandru Palalau <ioan-alexandru.palalau@nxp.com>
MACHINEOVERRIDES =. "mx6:mx6ul:"
@@ -11,16 +11,23 @@ include conf/machine/include/tune-cortexa7.inc
MACHINE_FEATURES += " pci wifi bluetooth"
-KERNEL_DEVICETREE = "imx6ul-14x14-evk.dtb imx6ul-14x14-evk-csi.dtb imx6ul-14x14-evk-btwifi.dtb \
- imx6ul-14x14-evk-gpmi-weim.dtb imx6ul-14x14-evk-usb-certi.dtb \
- imx6ul-14x14-evk-emmc.dtb "
+KERNEL_DEVICETREE = " \
+ imx6ul-14x14-evk-btwifi.dtb \
+ imx6ul-14x14-evk-btwifi-oob.dtb \
+ imx6ul-14x14-evk-csi.dtb \
+ imx6ul-14x14-evk.dtb \
+ imx6ul-14x14-evk-ecspi.dtb \
+ imx6ul-14x14-evk-ecspi-slave.dtb \
+ imx6ul-14x14-evk-emmc.dtb \
+ imx6ul-14x14-evk-gpmi-weim.dtb \
+"
KERNEL_DEVICETREE_use-mainline-bsp = "imx6ul-14x14-evk.dtb"
# Use fslc u-boot by default. See also imx-base.inc.
UBOOT_MAKE_TARGET = ""
UBOOT_SUFFIX = "img"
SPL_BINARY = "SPL"
-WKS_FILE = "imx-uboot-spl-bootpart.wks"
+WKS_FILE = "imx-uboot-spl-bootpart.wks.in"
UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "mx6ul_14x14_evk_config,sdcard"
diff --git a/bsp/meta-freescale/conf/machine/imx6ullevk.conf b/bsp/meta-freescale/conf/machine/imx6ullevk.conf
index 7cf9c328..1b31c2f7 100644
--- a/bsp/meta-freescale/conf/machine/imx6ullevk.conf
+++ b/bsp/meta-freescale/conf/machine/imx6ullevk.conf
@@ -1,24 +1,29 @@
#@TYPE: Machine
-#@NAME: Freescale i.MX6ULL Evaluation Kit
+#@NAME: NXP i.MX6ULL Evaluation Kit
#@SOC: i.MX6ULL
-#@DESCRIPTION: Machine configuration for Freescale i.MX6ULL EVK
-#@MAINTAINER: Daiane Angolini <daiane.angolini@nxp.com>
+#@DESCRIPTION: Machine configuration for NXP i.MX6ULL EVK
+#@MAINTAINER: Alexandru Palalau <ioan-alexandru.palalau@nxp.com>
MACHINEOVERRIDES =. "mx6:mx6ull:"
include conf/machine/include/imx-base.inc
include conf/machine/include/tune-cortexa7.inc
-KERNEL_DEVICETREE = "imx6ull-14x14-evk.dtb imx6ull-14x14-evk-btwifi.dtb"
+KERNEL_DEVICETREE = " \
+ imx6ull-14x14-evk.dtb \
+"
+
+KERNEL_DEVICETREE_append_use-nxp-bsp = " \
+ imx6ull-14x14-evk-btwifi.dtb \
+ imx6ull-14x14-evk-btwifi-oob.dtb \
+ imx6ull-14x14-evk-emmc.dtb \
+ imx6ull-14x14-evk-gpmi-weim.dtb \
+"
UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "mx6ull_14x14_evk_config,sdcard"
UBOOT_CONFIG[mfgtool] = "mx6ull_14x14_evk_config"
-PREFERRED_PROVIDER_u-boot = "u-boot-imx"
-PREFERRED_PROVIDER_virtual/bootloader = "u-boot-imx"
-PREFERRED_PROVIDER_virtual/kernel = "linux-imx"
-
-SERIAL_CONSOLE = "115200 ttymxc0"
+SERIAL_CONSOLES = "115200;ttymxc0"
MACHINE_FEATURES += "wifi bluetooth"
diff --git a/bsp/meta-freescale/conf/machine/imx7dsabresd.conf b/bsp/meta-freescale/conf/machine/imx7dsabresd.conf
index be9a6703..84de3862 100644
--- a/bsp/meta-freescale/conf/machine/imx7dsabresd.conf
+++ b/bsp/meta-freescale/conf/machine/imx7dsabresd.conf
@@ -11,11 +11,17 @@ require conf/machine/include/tune-cortexa7.inc
MACHINE_FEATURES += " pci wifi bluetooth"
-KERNEL_DEVICETREE = "imx7d-sdb.dtb imx7d-sdb-epdc.dtb imx7d-sdb-gpmi-weim.dtb \
- imx7d-sdb-m4.dtb imx7d-sdb-mipi-dsi.dtb imx7d-sdb-qspi.dtb \
- imx7d-sdb-reva.dtb imx7d-sdb-reva-epdc.dtb imx7d-sdb-reva-gpmi-weim.dtb \
- imx7d-sdb-reva-hdmi-audio.dtb imx7d-sdb-reva-m4.dtb imx7d-sdb-reva-qspi.dtb \
- imx7d-sdb-reva-touch.dtb imx7d-sdb-reva-wm8960.dtb"
+KERNEL_DEVICETREE = " \
+ imx7d-sdb.dtb \
+ imx7d-sdb-epdc.dtb \
+ imx7d-sdb-gpmi-weim.dtb \
+ imx7d-sdb-m4.dtb \
+ imx7d-sdb-mipi-dsi.dtb \
+ imx7d-sdb-qspi.dtb \
+ imx7d-sdb-reva.dtb \
+ imx7d-sdb-sht11.dtb \
+"
+
KERNEL_DEVICETREE_use-mainline-bsp = "imx7d-sdb.dtb"
UBOOT_CONFIG ??= "sd"
@@ -25,4 +31,3 @@ UBOOT_CONFIG[nand] = "mx7dsabresd_nand_config,ubifs"
UBOOT_CONFIG[epdc] = "mx7dsabresd_epdc_config"
UBOOT_CONFIG[mfgtool] = "mx7dsabresd_config"
-MACHINE_EXTRA_RRECOMMENDS += "firmware-imx-brcm"
diff --git a/bsp/meta-freescale/conf/machine/imx7ulpevk.conf b/bsp/meta-freescale/conf/machine/imx7ulpevk.conf
index d077de74..d9d2a559 100644
--- a/bsp/meta-freescale/conf/machine/imx7ulpevk.conf
+++ b/bsp/meta-freescale/conf/machine/imx7ulpevk.conf
@@ -2,26 +2,34 @@
#@NAME: NXP i.MX7ULP Evaluation Kit
#@SOC: i.MX7ULP
#@DESCRIPTION: Machine configuration for NXP i.MX7ULP EVK
-#@MAINTAINER: Lauren Post <Lauren.Post@nxp.com>
+#@MAINTAINER: Alexandru Palalau <ioan-alexandru.palalau@nxp.com>
+
+MACHINEOVERRIDES =. "mx7:mx7ulp:"
require conf/machine/include/imx-base.inc
require conf/machine/include/tune-cortexa7.inc
-MACHINE_FEATURES += " pci wifi bluetooth"
+MACHINE_FEATURES += " pci wifi bluetooth qca9377"
-MACHINEOVERRIDES =. "mx7:mx7ulp:"
-
-KERNEL_DEVICETREE = "imx7ulp-evk.dtb imx7ulp-evk-emmc.dtb imx7ulp-evk-emmc-qspi.dtb imx7ulp-evk-ft5416.dtb imx7ulp-evk-mipi.dtb"
-KERNEL_DEVICETREE += "imx7ulp-evk-lpuart.dtb imx7ulp-evk-qspi.dtb imx7ulp-evk-sd1.dtb imx7ulp-evk-sensors-to-i2c5.dtb"
-KERNEL_DEVICETREE += "imx7ulp-evk-wm8960.dtb"
+KERNEL_DEVICETREE = " \
+ imx7ulp-evkb.dtb \
+ imx7ulp-evkb-emmc.dtb \
+ imx7ulp-evkb-lpuart.dtb \
+ imx7ulp-evkb-mipi.dtb \
+ imx7ulp-evkb-rm68191-qhd.dtb \
+ imx7ulp-evkb-rm68200-wxga.dtb \
+ imx7ulp-evkb-sd1.dtb \
+ imx7ulp-evkb-sensors-to-i2c5.dtb \
+ imx7ulp-evkb-spi-slave.dtb \
+ imx7ulp-evk.dtb \
+ imx7ulp-evk-ft5416.dtb \
+ imx7ulp-evk-mipi.dtb \
+"
UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "mx7ulp_evk_config,sdcard"
UBOOT_CONFIG[emmc] = "mx7ulp_evk_emmc_config,sdcard"
UBOOT_CONFIG[mfgtool] = "mx7ulp_evk_config"
-# Install brcm firmware
-MACHINE_FIRMWARE_append = " firmware-imx-brcm"
-
# Set Serial console
-SERIAL_CONSOLE = "115200 ttyLP0"
+SERIAL_CONSOLES = "115200;ttyLP0"
diff --git a/bsp/meta-freescale/conf/machine/imx8mmevk.conf b/bsp/meta-freescale/conf/machine/imx8mmevk.conf
index 44b3249f..2a2893e6 100644
--- a/bsp/meta-freescale/conf/machine/imx8mmevk.conf
+++ b/bsp/meta-freescale/conf/machine/imx8mmevk.conf
@@ -1,28 +1,32 @@
#@TYPE: Machine
-#@NAME: NXP i.MX 8M Mini Evaluation Kit
+#@NAME: NXP i.MX8MM LPDDR4 Evaluation Kit and i.MX8MM DDR4 Evaluation Kit
#@SOC: i.MX8MM
-#@DESCRIPTION: Machine configuration for NXP i.MX 8M Mini EVK
+#@DESCRIPTION: Machine configuration for NXP i.MX8MMini LPDDR4 EVK and i.MX8MMini DDR4 EVK
#@MAINTAINER: Jun Zhu <junzhu@nxp.com>
MACHINEOVERRIDES =. "mx8:mx8m:mx8mm:"
require conf/machine/include/imx-base.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-MACHINE_FEATURES += " pci wifi bluetooth optee qca9377 qca6174"
-
-KERNEL_DEVICETREE = "freescale/fsl-imx8mm-evk.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mm-evk-ak4497.dtb freescale/fsl-imx8mm-evk-ak5558.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mm-evk-audio-tdm.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mm-evk-inmate.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mm-evk-m4.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mm-evk-rm67191.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mm-evk-root.dtb"
-
-IMAGE_BOOTFILES += "imx8mm_m4_TCM_hello_world.bin \
- imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin \
- imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.bin \
- imx8mm_m4_TCM_sai_low_power_audio.bin \
+require conf/machine/include/tune-cortexa53.inc
+
+IMX_DEFAULT_BSP = "nxp"
+
+MACHINE_FEATURES += " pci wifi bluetooth optee qca9377"
+
+KERNEL_DEVICETREE = " \
+ freescale/imx8mm-ddr4-evk.dtb \
+ freescale/imx8mm-ddr4-evk-revb.dtb \
+ freescale/imx8mm-ddr4-evk-revb-rm67191.dtb \
+ freescale/imx8mm-ddr4-evk-rm67191.dtb \
+ freescale/imx8mm-evk-ak4497.dtb \
+ freescale/imx8mm-evk-ak5558.dtb \
+ freescale/imx8mm-evk-audio-tdm.dtb \
+ freescale/imx8mm-evk.dtb \
+ freescale/imx8mm-evk-inmate.dtb \
+ freescale/imx8mm-evk-revb.dtb \
+ freescale/imx8mm-evk-rm67191.dtb \
+ freescale/imx8mm-evk-root.dtb \
+ freescale/imx8mm-evk-rpmsg.dtb \
"
UBOOT_CONFIG ??= "sd"
@@ -41,12 +45,10 @@ UBOOT_DTB_NAME = "fsl-imx8mm-evk.dtb"
IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_evk_flexspi', 'flash_evk', d)}"
# Set Serial console
-SERIAL_CONSOLE = "115200 ttymxc1"
+SERIAL_CONSOLES = "115200;ttymxc1"
IMAGE_BOOTLOADER = "imx-boot"
-BOOT_SPACE = "65536"
-
LOADADDR = ""
UBOOT_SUFFIX = "bin"
UBOOT_MAKE_TARGET = ""
diff --git a/bsp/meta-freescale/conf/machine/imx8mnevk.conf b/bsp/meta-freescale/conf/machine/imx8mnevk.conf
new file mode 100644
index 00000000..adf80ea8
--- /dev/null
+++ b/bsp/meta-freescale/conf/machine/imx8mnevk.conf
@@ -0,0 +1,61 @@
+#@TYPE: Machine
+#@NAME: NXP i.MX8M Nano DDR4 Evaluation Kit
+#@SOC: i.MX8MM
+#@DESCRIPTION: Machine configuration for NXP i.MX8M Nano DDR4 EVK
+#@MAINTAINER: Andrey Zhizhikin <andrey.z@gmail.com>
+
+MACHINEOVERRIDES =. "mx8:mx8m:mx8mn:"
+
+require conf/machine/include/imx-base.inc
+require conf/machine/include/tune-cortexa53.inc
+
+IMX_DEFAULT_BSP = "nxp"
+
+MACHINE_FEATURES += "wifi bluetooth optee bcm43455"
+
+KERNEL_DEVICETREE = " \
+ freescale/imx8mn-ddr4-evk-ak5558.dtb \
+ freescale/imx8mn-ddr4-evk.dtb \
+ freescale/imx8mn-ddr4-evk-inmate.dtb \
+ freescale/imx8mn-ddr4-evk-rm67191.dtb \
+ freescale/imx8mn-ddr4-evk-root.dtb \
+ freescale/imx8mn-ddr4-evk-rpmsg.dtb \
+ freescale/imx8mn-evk.dtb \
+ freescale/imx8mn-evk-rm67191.dtb \
+"
+
+UBOOT_CONFIG ??= "sd"
+UBOOT_CONFIG[sd] = "imx8mn_ddr4_evk_defconfig,sdcard"
+UBOOT_CONFIG[mfgtool] = "imx8mn_ddr4_evk_defconfig"
+SPL_BINARY = "spl/u-boot-spl.bin"
+
+# Set DDR FIRMWARE
+DDR_FIRMWARE_NAME = "ddr4_imem_1d_201810.bin \
+ ddr4_dmem_1d_201810.bin \
+ ddr4_imem_2d_201810.bin \
+ ddr4_dmem_2d_201810.bin"
+
+# Set u-boot DTB
+UBOOT_DTB_NAME = "fsl-imx8mn-ddr4-evk.dtb"
+
+# Set imx-mkimage boot target
+IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_ddr4_evk_flexspi', 'flash_ddr4_evk', d)}"
+
+# Set Serial console
+SERIAL_CONSOLES = "115200;ttymxc1"
+
+IMAGE_BOOTLOADER = "imx-boot"
+BOOT_SPACE = "65536"
+LOADADDR = ""
+UBOOT_SUFFIX = "bin"
+UBOOT_MAKE_TARGET = ""
+
+# Image boot offset as defined in section 6.1.6.1 "Primary image offset and IVT offset" of
+# i.MX 8M Nano Applications Processor Reference Manual, Rev. 0, 12/2019
+# Doc ID: IMX8MNRM
+IMX_BOOT_SEEK = "32"
+
+OPTEE_BIN_EXT = "8mn"
+
+# Add additional firmware
+MACHINE_FIRMWARE_append = " linux-firmware-ath10k"
diff --git a/bsp/meta-freescale/conf/machine/imx8mqevk.conf b/bsp/meta-freescale/conf/machine/imx8mqevk.conf
index 8ddb03cb..40794c35 100644
--- a/bsp/meta-freescale/conf/machine/imx8mqevk.conf
+++ b/bsp/meta-freescale/conf/machine/imx8mqevk.conf
@@ -2,26 +2,35 @@
#@NAME: NXP i.MX8MQ Evaluation Kit
#@SOC: i.MX8MQ
#@DESCRIPTION: Machine configuration for NXP i.MX8MQ EVK
-#@MAINTAINER: Jun Zhu <junzhu@nxp.com>
+#@MAINTAINER: Alexandru Palalau <ioan-alexandru.palalau@nxp.com>
MACHINEOVERRIDES =. "mx8:mx8m:mx8mq:"
require conf/machine/include/imx-base.inc
-require conf/machine/include/arm/arch-arm64.inc
+require conf/machine/include/tune-cortexa53.inc
+
+IMX_DEFAULT_BSP = "nxp"
MACHINE_FEATURES += "pci wifi bluetooth optee qca6174"
MACHINE_SOCARCH_FILTER_append_mx8mq = " virtual/libopenvg virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa virtual/libgl virtual/libg2d"
-KERNEL_DEVICETREE = "freescale/fsl-imx8mq-evk.dtb freescale/fsl-imx8mq-evk-ak4497.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mq-evk-audio-tdm.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8mq-evk-dcss-adv7535.dtb freescale/fsl-imx8mq-evk-dcss-rm67191.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8mq-evk-dual-display.dtb freescale/fsl-imx8mq-evk-drm.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8mq-evk-lcdif-adv7535.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8mq-evk-m4.dtb freescale/fsl-imx8mq-evk-mipi-csi2.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8mq-evk-pcie1-m2.dtb freescale/fsl-imx8mq-evk-pdm.dtb"
-
-IMAGE_BOOTFILES += "imx8mq_m4_TCM_hello_world.bin imx8mq_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin"
+KERNEL_DEVICETREE = " \
+ freescale/imx8mq-evk-ak4497.dtb \
+ freescale/imx8mq-evk-audio-tdm.dtb \
+ freescale/imx8mq-evk-dcss-adv7535.dtb \
+ freescale/imx8mq-evk-dcss-rm67191.dtb \
+ freescale/imx8mq-evk-dp.dtb \
+ freescale/imx8mq-evk.dtb \
+ freescale/imx8mq-evk-dual-display.dtb \
+ freescale/imx8mq-evk-inmate.dtb \
+ freescale/imx8mq-evk-lcdif-adv7535.dtb \
+ freescale/imx8mq-evk-lcdif-rm67191.dtb \
+ freescale/imx8mq-evk-pcie1-m2.dtb \
+ freescale/imx8mq-evk-pdm.dtb \
+ freescale/imx8mq-evk-root.dtb \
+ freescale/imx8mq-evk-rpmsg.dtb \
+"
UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "imx8mq_evk_config,sdcard"
@@ -35,15 +44,13 @@ DDR_FIRMWARE_NAME = "lpddr4_pmu_train_1d_imem.bin lpddr4_pmu_train_1d_dmem.bin l
UBOOT_DTB_NAME = "fsl-imx8mq-evk.dtb"
# Set imx-mkimage boot target
-IMXBOOT_TARGETS = "flash_evk flash_evk_no_hdmi"
+IMXBOOT_TARGETS = "flash_evk flash_evk_no_hdmi flash_dp_evk"
# Set Serial console
-SERIAL_CONSOLE = "115200 ttymxc0"
+SERIAL_CONSOLES = "115200;ttymxc0"
IMAGE_BOOTLOADER = "imx-boot"
-BOOT_SPACE = "65536"
-
LOADADDR = ""
UBOOT_SUFFIX = "bin"
UBOOT_MAKE_TARGET = ""
@@ -53,3 +60,10 @@ OPTEE_BIN_EXT = "8mq"
# Add additional firmware
MACHINE_FIRMWARE_append = " linux-firmware-ath10k"
+
+# Use gstreamer 1.16 from meta-freescale
+PREFERRED_VERSION_gstreamer1.0 ?= "1.16.imx"
+PREFERRED_VERSION_gstreamer1.0-plugins-base ?= "1.16.imx"
+PREFERRED_VERSION_gstreamer1.0-plugins-good ?= "1.16.imx"
+PREFERRED_VERSION_gstreamer1.0-plugins-bad ?= "1.16.imx"
+PREFERRED_VERSION_gstreamer1.0-libav ?= "1.16.0"
diff --git a/bsp/meta-freescale/conf/machine/imx8qmmek.conf b/bsp/meta-freescale/conf/machine/imx8qmmek.conf
index e1f26b44..c92e5fd2 100644
--- a/bsp/meta-freescale/conf/machine/imx8qmmek.conf
+++ b/bsp/meta-freescale/conf/machine/imx8qmmek.conf
@@ -1,12 +1,14 @@
#@TYPE: Machine
#@NAME: i.MX 8QM MEK
#@DESCRIPTION: i.MX 8QuadMax MEK board
-#@MAINTAINER: Jun Zhu <junzhu@nxp.com>
+#@MAINTAINER: Alexandru Palalau <ioan-alexandru.palalau@nxp.com>
MACHINEOVERRIDES =. "mx8:mx8qm:"
require conf/machine/include/imx-base.inc
-require conf/machine/include/arm/arch-arm64.inc
+require conf/machine/include/tune-cortexa72-cortexa53.inc
+
+IMX_DEFAULT_BSP = "nxp"
MACHINE_FEATURES_append = " qca6174"
@@ -16,21 +18,28 @@ RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
LOADADDR = ""
# We have to disable SERIAL_CONSOLE due to auto-serial-console
-SERIAL_CONSOLE = "115200 ttyAMA0"
+SERIAL_CONSOLES = "115200;ttyAMA0"
# we do not want to have getty running on tty1 as we run
# auto-serial-console there
USE_VT = "0"
-KERNEL_DEVICETREE = "freescale/fsl-imx8qm-mek.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qm-mek_ca53.dtb freescale/fsl-imx8qm-mek_ca72.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8qm-mek-8cam.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8qm-mek-hdmi.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8qm-mek-jdi-wuxga-lvds1-panel.dtb freescale/fsl-imx8qm-mek-dsi-rm67191.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qm-mek-mipi-ov5640.dtb freescale/fsl-imx8qm-mek-mipi-two-ov5640.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qm-mek-enet2-tja1100.dtb "
-KERNEL_DEVICETREE += "freescale/fsl-imx8qm-mek-dom0.dtb freescale/fsl-imx8qm-mek-domu.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qp-lpddr4-arm2.dtb"
+KERNEL_DEVICETREE = " \
+ freescale/imx8qm-mek-ca53.dtb \
+ freescale/imx8qm-mek-ca72.dtb \
+ freescale/imx8qm-mek-dom0.dtb \
+ freescale/imx8qm-mek-domu.dtb \
+ freescale/imx8qm-mek-dsi-rm67191.dtb \
+ freescale/imx8qm-mek-dsp.dtb \
+ freescale/imx8qm-mek.dtb \
+ freescale/imx8qm-mek-enet2-tja1100.dtb \
+ freescale/imx8qm-mek-hdmi.dtb \
+ freescale/imx8qm-mek-inmate.dtb \
+ freescale/imx8qm-mek-jdi-wuxga-lvds1-panel.dtb \
+ freescale/imx8qm-mek-ov5640.dtb \
+ freescale/imx8qm-mek-root.dtb \
+ freescale/imx8qm-mek-rpmsg.dtb \
+"
UBOOT_MAKE_TARGET = "u-boot.bin"
UBOOT_SUFFIX = "bin"
@@ -39,12 +48,15 @@ UBOOT_CONFIG[sd] = "imx8qm_mek_defconfig,sdcard"
UBOOT_CONFIG[fspi] = "imx8qm_mek_fspi_defconfig"
UBOOT_CONFIG[mfgtool] = "imx8qm_mek_defconfig"
-BOOT_SPACE = "65536"
IMAGE_BOOTLOADER = "imx-boot"
IMX_BOOT_SEEK = "33"
-IMAGE_BOOTFILES_DEPENDS += "firmware-imx:do_deploy"
-IMAGE_BOOTFILES += "hdmitxfw.bin hdmirxfw.bin dpfw.bin"
+WKS_FILE_DEPENDS_append = " firmware-imx-8"
+IMAGE_BOOT_FILES += "hdmitxfw.bin hdmirxfw.bin dpfw.bin"
+
+IMXBOOT_TARGETS = \
+ "${@bb.utils.contains('UBOOT_CONFIG', 'sd', 'flash', \
+ 'flash_flexspi', d)}"
BOARD_TYPE = "mek"
diff --git a/bsp/meta-freescale/conf/machine/imx8qxpmek.conf b/bsp/meta-freescale/conf/machine/imx8qxpmek.conf
index 2ffbcacc..bdce4b68 100644
--- a/bsp/meta-freescale/conf/machine/imx8qxpmek.conf
+++ b/bsp/meta-freescale/conf/machine/imx8qxpmek.conf
@@ -1,11 +1,14 @@
#@TYPE: Machine
#@NAME: i.MX 8QXP MEK
-#@DESCRIPTION: i.MX 8QXP MEK board
+#@DESCRIPTION: i.MX 8QXP Multisensory Enablement Kit (MEK) board
+#@MAINTAINER: Cristinel Panfir <cristinel.panfir@nxp.com>
MACHINEOVERRIDES =. "mx8:mx8x:mx8qxp:"
require conf/machine/include/imx-base.inc
-require conf/machine/include/arm/arch-arm64.inc
+require conf/machine/include/tune-cortexa35.inc
+
+IMX_DEFAULT_BSP = "nxp"
MACHINE_FEATURES_append = " qca6174"
@@ -15,17 +18,31 @@ RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
LOADADDR = ""
# We have to disable SERIAL_CONSOLE due to auto-serial-console
-SERIAL_CONSOLE = "115200 ttyAMA0"
+SERIAL_CONSOLES = "115200;ttyAMA0"
# we do not want to have getty running on tty1 as we run
# auto-serial-console there
USE_VT = "0"
-KERNEL_DEVICETREE = "freescale/fsl-imx8qxp-mek.dtb freescale/fsl-imx8qxp-mek-dom0.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qxp-mek-dsi-rm67191.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qxp-mek-enet2.dtb freescale/fsl-imx8qxp-mek-enet2-tja1100.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qxp-mek-csi.dtb"
-KERNEL_DEVICETREE += "freescale/fsl-imx8qxp-mek-mipi-ov5640.dtb freescale/fsl-imx8qxp-mek-ov5640.dtb"
+KERNEL_DEVICETREE = " \
+ freescale/imx8qxp-mek-a0.dtb \
+ freescale/imx8qxp-mek-dom0.dtb \
+ freescale/imx8qxp-mek-dsi-rm67191.dtb \
+ freescale/imx8qxp-mek-dsp.dtb \
+ freescale/imx8qxp-mek.dtb \
+ freescale/imx8qxp-mek-enet2.dtb \
+ freescale/imx8qxp-mek-enet2-tja1100.dtb \
+ freescale/imx8qxp-mek-inmate.dtb \
+ freescale/imx8qxp-mek-it6263-lvds0-dual-channel.dtb \
+ freescale/imx8qxp-mek-it6263-lvds1-dual-channel.dtb \
+ freescale/imx8qxp-mek-jdi-wuxga-lvds0-panel.dtb \
+ freescale/imx8qxp-mek-jdi-wuxga-lvds1-panel.dtb \
+ freescale/imx8qxp-mek-ov5640.dtb \
+ freescale/imx8qxp-mek-root.dtb \
+ freescale/imx8qxp-mek-rpmsg.dtb \
+ freescale/imx8qxp-mek-sof-cs42888.dtb \
+ freescale/imx8qxp-mek-sof-wm8960.dtb \
+"
UBOOT_MAKE_TARGET = "u-boot.bin"
UBOOT_SUFFIX = "bin"
@@ -33,10 +50,14 @@ UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG[sd] = "imx8qxp_mek_config,sdcard"
UBOOT_CONFIG[fspi] = "imx8qxp_mek_fspi_defconfig"
-BOOT_SPACE = "65536"
IMAGE_BOOTLOADER = "imx-boot"
IMX_BOOT_SEEK = "32"
+IMXBOOT_TARGETS = \
+ "${@bb.utils.contains('UBOOT_CONFIG', 'sd', 'flash', \
+ bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \
+ 'UNKNOWN', d), d)}"
+
BOARD_TYPE = "mek"
# Add additional firmware
diff --git a/bsp/meta-freescale/conf/machine/include/imx-base.inc b/bsp/meta-freescale/conf/machine/include/imx-base.inc
index 20f861f2..4be14fb1 100644
--- a/bsp/meta-freescale/conf/machine/include/imx-base.inc
+++ b/bsp/meta-freescale/conf/machine/include/imx-base.inc
@@ -9,12 +9,30 @@ require conf/machine/include/utilities.inc
IMX_DEFAULT_BOOTLOADER = "u-boot-fslc"
IMX_DEFAULT_BOOTLOADER_mx8 = "u-boot-imx"
+# Machines or distros can define which BSP it should use by default. We are
+# intending to default for mainline BSP by default and specific machines or
+# DISTROs might change it if need.
+#
+# Two values are considered valid: mainline, nxp
+IMX_DEFAULT_BSP ?= "mainline"
+
+# Those are SoC families we'd like to force the use of mainline BSP.
+IMX_DEFAULT_BSP_mxs ?= "mainline"
+IMX_DEFAULT_BSP_mx5 ?= "mainline"
+
+MACHINEOVERRIDES =. "use-${IMX_DEFAULT_BSP}-bsp:"
+
PREFERRED_PROVIDER_u-boot ??= "${IMX_DEFAULT_BOOTLOADER}"
+PREFERRED_PROVIDER_u-boot-tools-native ??= "${IMX_DEFAULT_BOOTLOADER}-tools-native"
+PREFERRED_PROVIDER_nativesdk-u-boot-tools ??= "nativesdk-${IMX_DEFAULT_BOOTLOADER}-tools"
+PREFERRED_PROVIDER_u-boot-mkimage-native ??= "${IMX_DEFAULT_BOOTLOADER}-tools-native"
+PREFERRED_PROVIDER_nativesdk-u-boot-mkimage ??= "nativesdk-${IMX_DEFAULT_BOOTLOADER}-tools"
PREFERRED_PROVIDER_virtual/bootloader ??= "${IMX_DEFAULT_BOOTLOADER}"
PREFERRED_PROVIDER_u-boot-mxsboot-native ??= "u-boot-fslc-mxsboot-native"
-UBOOT_MAKE_TARGET ?= "u-boot.imx"
+UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
+UBOOT_MAKE_TARGET ?= "u-boot.${UBOOT_SUFFIX}"
UBOOT_MAKE_TARGET_mxs ?= "u-boot.sb"
UBOOT_MAKE_TARGET_mx8 ?= ""
@@ -32,6 +50,9 @@ UBOOT_ENTRYPOINT_mx6sx = "0x80008000"
UBOOT_ENTRYPOINT_mx6ul = "0x10008000"
UBOOT_ENTRYPOINT_mx6ull = "0x10008000"
UBOOT_ENTRYPOINT_mx7 = "0x80008000"
+UBOOT_ENTRYPOINT_mx7ulp = "0x60008000"
+UBOOT_ENTRYPOINT_mx8mm = "0x40480000"
+UBOOT_ENTRYPOINT_mx8mn = "0x40480000"
UBOOT_ENTRYPOINT_mx8mq = "0x40480000"
UBOOT_ENTRYPOINT_vf = "0x80008000"
@@ -55,11 +76,17 @@ MACHINE_EXTRA_RRECOMMENDS = "kernel-modules"
# handled by software
# DEFAULTTUNE_mx6 ?= "cortexa9t-neon"
# handled by hardware
-DEFAULTTUNE_mx6 ?= "cortexa9thf-neon"
-DEFAULTTUNE_mx6ul ?= "cortexa7thf-neon"
+DEFAULTTUNE_mx6 ?= "cortexa9thf-neon"
+DEFAULTTUNE_mx6ul ?= "cortexa7thf-neon"
DEFAULTTUNE_mx6ull ?= "cortexa7thf-neon"
-DEFAULTTUNE_mx7 ?= "cortexa7thf-neon"
-DEFAULTTUNE_vf ?= "cortexa5thf-neon"
+DEFAULTTUNE_mx7 ?= "cortexa7thf-neon"
+DEFAULTTUNE_vf ?= "cortexa5thf-neon"
+
+DEFAULTTUNE_mx8mm ?= "cortexa53-crypto"
+DEFAULTTUNE_mx8mn ?= "cortexa53-crypto"
+DEFAULTTUNE_mx8mq ?= "cortexa53-crypto"
+DEFAULTTUNE_mx8qm ?= "cortexa72-cortexa53-crypto"
+DEFAULTTUNE_mx8qxp ?= "cortexa35-crypto"
INHERIT += "machine-overrides-extender"
@@ -75,10 +102,13 @@ MACHINEOVERRIDES_EXTENDER_mx7d = "imxfbdev:imxpxp:imxepdc"
MACHINEOVERRIDES_EXTENDER_mx7ulp = "imxfbdev:imxpxp:imxgpu:imxgpu2d:imxgpu3d"
MACHINEOVERRIDES_EXTENDER_mx8qm = "imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d"
MACHINEOVERRIDES_EXTENDER_mx8mm = "imxdrm:imxvpu:imxgpu:imxgpu2d:imxgpu3d"
+MACHINEOVERRIDES_EXTENDER_mx8mn = "imxdrm:imxgpu:imxgpu3d"
MACHINEOVERRIDES_EXTENDER_mx8mq = "imxdrm:imxvpu:imxgpu:imxgpu3d"
MACHINEOVERRIDES_EXTENDER_mx8qxp = "imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d"
MACHINEOVERRIDES_EXTENDER_FILTER_OUT_use-mainline-bsp = " \
+ imx \
+ \
mx6 \
mx6q \
mx6dl \
@@ -95,16 +125,13 @@ MACHINEOVERRIDES_EXTENDER_FILTER_OUT_use-mainline-bsp = " \
mx8 \
mx8qm \
mx8mm \
+ mx8mn \
mx8mq \
mx8qxp \
"
# Sub-architecture support
MACHINE_SOCARCH_SUFFIX ?= ""
-MACHINE_SOCARCH_SUFFIX_mx23 = "-mxs"
-MACHINE_SOCARCH_SUFFIX_mx28 = "-mxs"
-MACHINE_SOCARCH_SUFFIX_mx51 = "-mx5"
-MACHINE_SOCARCH_SUFFIX_mx53 = "-mx5"
MACHINE_SOCARCH_SUFFIX_mx6q = "-mx6qdl"
MACHINE_SOCARCH_SUFFIX_mx6dl = "-mx6qdl"
MACHINE_SOCARCH_SUFFIX_mx6sx = "-mx6sx"
@@ -118,6 +145,7 @@ MACHINE_SOCARCH_SUFFIX_mx6ul = "-mx6ul"
MACHINE_SOCARCH_SUFFIX_mx6ull = "-mx6ul"
MACHINE_SOCARCH_SUFFIX_mx8qm = "-mx8"
MACHINE_SOCARCH_SUFFIX_mx8mm = "-mx8mm"
+MACHINE_SOCARCH_SUFFIX_mx8mn = "-mx8mn"
MACHINE_SOCARCH_SUFFIX_mx8mq = "-mx8m"
MACHINE_SOCARCH_SUFFIX_mx8qxp = "-mx8"
MACHINE_SOCARCH_SUFFIX_use-mainline-bsp = "-imx"
@@ -125,6 +153,7 @@ MACHINE_SOCARCH_SUFFIX_use-mainline-bsp = "-imx"
MACHINE_ARCH_FILTER = "virtual/kernel"
MACHINE_SOCARCH_FILTER_append_imx = " \
alsa-lib \
+ gstreamer1.0 \
weston \
"
MACHINE_SOCARCH_FILTER_append_imxvpu = " \
@@ -140,7 +169,6 @@ MACHINE_SOCARCH_FILTER_append_imxgpu = " \
virtual/libopenvg \
libdrm \
cairo \
- gstreamer1.0-plugins-bad \
libgal-imx \
pango \
"
@@ -207,13 +235,31 @@ MACHINE_FIRMWARE_append_use-mainline-bsp = " linux-firmware-imx-sdma-imx6q linux
MACHINE_EXTRA_RRECOMMENDS += "${MACHINE_FIRMWARE}"
# Extra audio support
-MACHINE_EXTRA_RRECOMMENDS_append_mx6 = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'imx-alsa-plugins', '', d)}"
-MACHINE_EXTRA_RRECOMMENDS_append_mx7 = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'imx-alsa-plugins', '', d)}"
-MACHINE_EXTRA_RRECOMMENDS_append_mx8 = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'imx-alsa-plugins', '', d)}"
+IMX_ALSA_EXTRA = ""
+IMX_ALSA_EXTRA_use-nxp-bsp = "imx-alsa-plugins"
+MACHINE_EXTRA_RRECOMMENDS_append_mx6 = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', '${IMX_ALSA_EXTRA}', '', d)}"
+MACHINE_EXTRA_RRECOMMENDS_append_mx7 = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', '${IMX_ALSA_EXTRA}', '', d)}"
+MACHINE_EXTRA_RRECOMMENDS_append_mx8 = " ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', '${IMX_ALSA_EXTRA}', '', d)}"
+
+# Extra Cypress Wi-Fi and BTW firmware (Murata)
+MACHINE_FIRMWARE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'bcm4339', 'linux-firmware-bcm4339', '', d)}"
+MACHINE_FIRMWARE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'bcm43430', 'linux-firmware-bcm43430', '', d)}"
+MACHINE_FIRMWARE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'bcm43455', 'linux-firmware-bcm43455', '', d)}"
+MACHINE_FIRMWARE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'bcm4356', 'linux-firmware-bcm4356-pcie', '', d)}"
+MACHINE_FIRMWARE_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'bcm4359', 'linux-firmware-bcm4359-pcie', '', d)}"
+
+# Extra QCA Wi-Fi & BTE driver and firmware
+MACHINE_EXTRA_RRECOMMENDS_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'qca6174', 'packagegroup-fsl-qca6174', '', d)}"
+MACHINE_EXTRA_RRECOMMENDS_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'qca9377', 'packagegroup-fsl-qca9377', '', d)}"
# Extra udev rules
MACHINE_EXTRA_RRECOMMENDS += "udev-rules-imx"
+# Jailhouse
+MACHINE_EXTRA_RRECOMMENDS += " \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'jailhouse', 'jailhouse', '', d)} \
+"
+
# GStreamer 1.0 plugins
MACHINE_GSTREAMER_1_0_PLUGIN ?= ""
MACHINE_GSTREAMER_1_0_PLUGIN_mx6dl ?= "gstreamer1.0-plugins-imx-meta"
@@ -244,60 +290,72 @@ PREFERRED_PROVIDER_virtual/libgl_imxgpu3d ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles1_imxgpu3d ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libgles2_imxgpu3d ?= "imx-gpu-viv"
PREFERRED_PROVIDER_virtual/libg2d ?= "imx-gpu-g2d"
+PREFERRED_PROVIDER_virtual/libg2d_imxdpu ?= "imx-dpu-g2d"
-PREFERRED_VERSION_weston_mx6 ?= "4.0.0.imx"
-PREFERRED_VERSION_weston_mx7 ?= "4.0.0.imx"
-PREFERRED_VERSION_weston_mx8 ?= "4.0.0.imx"
+PREFERRED_VERSION_weston_imx ?= "8.0.0.imx"
+PREFERRED_VERSION_weston_use-mainline-bsp = ""
-PREFERRED_VERSION_wayland-protocols_mx6 ?= "1.13.imx"
-PREFERRED_VERSION_wayland-protocols_mx7 ?= "1.13.imx"
-PREFERRED_VERSION_wayland-protocols_mx8 ?= "1.13.imx"
+PREFERRED_VERSION_wayland-protocols_mx6 ?= "1.18.imx"
+PREFERRED_VERSION_wayland-protocols_mx7 ?= "1.18.imx"
+PREFERRED_VERSION_wayland-protocols_mx8 ?= "1.18.imx"
# Use i.MX libdrm Version
-PREFERRED_VERSION_libdrm_mx6 ?= "2.4.91.imx"
-PREFERRED_VERSION_libdrm_mx7 ?= "2.4.91.imx"
-PREFERRED_VERSION_libdrm_mx8 ?= "2.4.91.imx"
+PREFERRED_VERSION_libdrm_mx6 ?= "2.4.99.imx"
+PREFERRED_VERSION_libdrm_mx7 ?= "2.4.99.imx"
+PREFERRED_VERSION_libdrm_mx8 ?= "2.4.99.imx"
+
+# Use i.MX optee Version
+PREFERRED_VERSION_optee-os_mx8 ?= "3.2.0.imx"
+PREFERRED_VERSION_optee-client_mx8 ?= "3.2.0.imx"
+PREFERRED_VERSION_optee-test_mx8 ?= "3.2.0.imx"
# Handle default kernel
IMX_DEFAULT_KERNEL = "linux-imx"
IMX_DEFAULT_KERNEL_mxs = "linux-fslc"
IMX_DEFAULT_KERNEL_mx5 = "linux-fslc"
-IMX_DEFAULT_KERNEL_mx6 = "linux-fslc-imx"
-IMX_DEFAULT_KERNEL_mx7 = "linux-fslc-imx"
+IMX_DEFAULT_KERNEL_mx6 = "linux-imx"
+IMX_DEFAULT_KERNEL_mx7 = "linux-imx"
IMX_DEFAULT_KERNEL_mx8 = "linux-imx"
IMX_DEFAULT_KERNEL_mx7ulp = "linux-imx"
IMX_DEFAULT_KERNEL_mx6sll = "linux-imx"
-IMX_DEFAULT_KERNEL_mx6ul = "linux-fslc-imx"
-IMX_DEFAULT_KERNEL_mx6ull = "linux-fslc-imx"
+IMX_DEFAULT_KERNEL_mx6ul = "linux-imx"
+IMX_DEFAULT_KERNEL_mx6ull = "linux-imx"
IMX_DEFAULT_KERNEL_use-mainline-bsp = "linux-fslc"
PREFERRED_PROVIDER_virtual/kernel ??= "${IMX_DEFAULT_KERNEL}"
SOC_DEFAULT_IMAGE_FSTYPES = "wic.bmap wic.gz"
-SOC_DEFAULT_IMAGE_FSTYPES_mxs = "uboot-mxsboot-sdcard wic.gz"
+SOC_DEFAULT_IMAGE_FSTYPES_mxs = "uboot-mxsboot-sdcard wic.bmap wic.gz"
# Do not update fstab file when using wic images
WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update"
-SDCARD_ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4"
+OPTEE_BOOT_IMAGE = "uTee"
+OPTEE_BOOT_IMAGE_aarch64 = ""
+
IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}"
IMAGE_BOOT_FILES ?= " \
${KERNEL_IMAGETYPE} \
${@make_dtb_boot_files(d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'optee', '${OPTEE_BOOT_IMAGE}', '', d)} \
"
### wic default support
+OPTEE_WKS_FILE_DEPENDS = "optee-os"
+OPTEE_WKS_FILE_DEPENDS_aarch64 = ""
+
WKS_FILE_DEPENDS ?= " \
virtual/bootloader \
\
e2fsprogs-native \
bmap-tools-native \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'optee', '${OPTEE_WKS_FILE_DEPENDS}', '', d)} \
"
-WKS_FILE_DEPENDS_mx8 += "imx-boot"
+WKS_FILE_DEPENDS_append_mx8 = " imx-boot "
-SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks"
+SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE_mx8 ?= "imx-imx-boot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE_mxs ?= "imx-uboot-mxs-bootpart.wks.in"
@@ -309,21 +367,24 @@ WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"
UBOOT_MAKE_TARGET_use-fsl-bsp_mx6 = "u-boot.imx"
UBOOT_SUFFIX_use-fsl-bsp_mx6 = "imx"
SPL_BINARY_use-fsl-bsp_mx6 = ""
-WKS_FILE_use-fsl-bsp_mx6 = "imx-uboot-bootpart.wks"
+WKS_FILE_use-fsl-bsp_mx6 = "imx-uboot-bootpart.wks.in"
UBOOT_MAKE_TARGET_use-fsl-bsp_mx7 = "u-boot.imx"
UBOOT_SUFFIX_use-fsl-bsp_mx7 = "imx"
SPL_BINARY_use-fsl-bsp_mx7 = ""
-WKS_FILE_use-fsl-bsp_mx7 = "imx-uboot-bootpart.wks"
+WKS_FILE_use-fsl-bsp_mx7 = "imx-uboot-bootpart.wks.in"
-SERIAL_CONSOLE = "115200 ttymxc0"
-SERIAL_CONSOLE_mxs = "115200 ttyAMA0"
+SERIAL_CONSOLES = "115200;ttymxc0"
+SERIAL_CONSOLES_mxs = "115200;ttyAMA0"
KERNEL_IMAGETYPE = "zImage"
KERNEL_IMAGETYPE_aarch64 = "Image"
MACHINE_FEATURES = "usbgadget usbhost vfat alsa touchscreen"
+SOC_MACHINE_FEATURES_BACKFILL_mx8m = "jailhouse"
+MACHINE_FEATURES_BACKFILL_append = " ${SOC_MACHINE_FEATURES_BACKFILL}"
+
# Add the ability to specify _imx machines
MACHINEOVERRIDES =. "imx:"
-HOSTTOOLS_NONFATAL_append_mx8x = " sha384sum"
+HOSTTOOLS_NONFATAL_append_mx8 = " sha384sum"
diff --git a/bsp/meta-freescale/conf/machine/include/qoriq-base.inc b/bsp/meta-freescale/conf/machine/include/qoriq-base.inc
index b19332e3..93e48505 100644
--- a/bsp/meta-freescale/conf/machine/include/qoriq-base.inc
+++ b/bsp/meta-freescale/conf/machine/include/qoriq-base.inc
@@ -2,9 +2,8 @@
PREFERRED_PROVIDER_cryptodev-linux = "cryptodev-qoriq-linux"
PREFERRED_PROVIDER_cryptodev-module = "cryptodev-qoriq-module"
PREFERRED_PROVIDER_cryptodev-tests = "cryptodev-qoriq-tests"
-PREFERRED_PROVIDER_openssl = "openssl-qoriq"
PREFERRED_PROVIDER_u-boot ?= "u-boot-qoriq"
-PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-qoriq"
+PREFERRED_PROVIDER_virtual/bootloader ?= "${PREFERRED_PROVIDER_u-boot}"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-qoriq"
PREFERRED_VERSION_testfloat = "2a"
PREFERRED_PROVIDER_ptpd = "ptpd-qoriq"
@@ -19,11 +18,20 @@ EXTRA_IMAGEDEPENDS += "u-boot cst-native"
MACHINEOVERRIDES =. "qoriq:"
+# Machines or distros can define which BSP it should use by default. We are
+# intending to default for nxp BSP by default and specific machines or
+# DISTROs might change it if need.
+#
+# Two values are considered valid: mainline, nxp
+QORIQ_DEFAULT_BSP ?= "nxp"
+
+MACHINEOVERRIDES =. "use-${QORIQ_DEFAULT_BSP}-bsp:"
+
# Sub-architecture support
MACHINE_SOCARCH_SUFFIX ?= ""
MACHINE_SOCARCH_SUFFIX_qoriq = "-qoriq"
MACHINE_ARCH_FILTER = "virtual/kernel"
-MACHINE_SOCARCH_FILTER_append_qoriq = " cryptodev-qoriq-linux cryptodev-qoriq-module cryptodev-qoriq-test openssl-qoriq"
+MACHINE_SOCARCH_FILTER_append_qoriq = " cryptodev-qoriq-linux cryptodev-qoriq-module cryptodev-qoriq-test"
INHERIT += "fsl-dynamic-packagearch"
diff --git a/bsp/meta-freescale/conf/machine/include/utilities.inc b/bsp/meta-freescale/conf/machine/include/utilities.inc
index e6cfda80..e9695bde 100644
--- a/bsp/meta-freescale/conf/machine/include/utilities.inc
+++ b/bsp/meta-freescale/conf/machine/include/utilities.inc
@@ -6,11 +6,17 @@ def make_dtb_boot_files(d):
# Use only the basename for dtb files:
alldtbs = d.getVar('KERNEL_DEVICETREE')
+
+ # DTBs may be built out of kernel with devicetree.bbclass
+ if not alldtbs:
+ return ''
+
def transform(dtb):
- if dtb.endswith('dtb') or dtb.endswith('dtbo'):
+ if not (dtb.endswith('dtb') or dtb.endswith('dtbo')):
# eg: whatever/bcm2708-rpi-b.dtb has:
# DEPLOYDIR file: bcm2708-rpi-b.dtb
# destination: bcm2708-rpi-b.dtb
- return os.path.basename(dtb)
+ bb.error("KERNEL_DEVICETREE entry %s is not a .dtb or .dtbo file." % (dtb) )
+ return os.path.basename(dtb)
- return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
+ return ' '.join([transform(dtb) for dtb in alldtbs.split() if dtb])
diff --git a/bsp/meta-freescale/conf/machine/ls1012afrwy-32b.conf b/bsp/meta-freescale/conf/machine/ls1012afrwy-32b.conf
deleted file mode 100644
index 88f071ea..00000000
--- a/bsp/meta-freescale/conf/machine/ls1012afrwy-32b.conf
+++ /dev/null
@@ -1,33 +0,0 @@
-#@TYPE: Machine
-#@NAME: NXP LS1012AFRWY board
-#@SOC: LSCH2
-#@DESCRIPTION: Machine configuration for NXP QorIQ LS1012AFRWY in 32-bit mode
-# with ARM Cortext-A53 core
-#@MAINTAINER: Chunrong Guo <Chunrong.Guo@nxp.com>
-
-MACHINEOVERRIDES =. "fsl-lsch2:fsl-lsch2-32b:ls1012a:"
-
-require conf/machine/include/qoriq-arm.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-DEFAULTTUNE = "armv7ahf-neon"
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x90000000"
-UBOOT_ENTRYPOINT = "0x80080000"
-
-UBOOT_CONFIG ??= "qspi-secure-boot qspi"
-UBOOT_CONFIG[qspi] = "ls1012afrwy_qspi_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi-secure-boot] = "ls1012afrwy_qspi_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-
-KERNEL_DEVICETREE ?= "freescale/fsl-ls1012a-frwy.dtb"
-KERNEL_DEFCONFIG ?= "multi_v7_defconfig"
-
-EXTRA_IMAGEDEPENDS += "ppfe-firmware rcw"
-USE_VT = "0"
-
-require conf/multilib.conf
-MULTILIBS ?= "multilib:lib64"
-DEFAULTTUNE_virtclass-multilib-lib64 ?= "aarch64"
diff --git a/bsp/meta-freescale/conf/machine/ls1012afrwy.conf b/bsp/meta-freescale/conf/machine/ls1012afrwy.conf
index bd154acb..449e518c 100644
--- a/bsp/meta-freescale/conf/machine/ls1012afrwy.conf
+++ b/bsp/meta-freescale/conf/machine/ls1012afrwy.conf
@@ -10,6 +10,8 @@ MACHINEOVERRIDES =. "fsl-lsch2:ls1012a:"
require conf/machine/include/qoriq-arm64.inc
require conf/machine/include/arm/arch-arm64.inc
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -20,7 +22,7 @@ UBOOT_CONFIG ??= "tfa-secure-boot tfa"
UBOOT_CONFIG[tfa] = "ls1012afrwy_tfa_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[tfa-secure-boot] = "ls1012afrwy_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-RCWQSPI ?= "N_SSNP_3305/rcw_1000_default.bin"
+RCWQSPI ?= "N_SSNP_3305/rcw_1000"
KERNEL_DEVICETREE ?= "freescale/fsl-ls1012a-frwy.dtb"
KERNEL_DEFCONFIG ?= "defconfig"
diff --git a/bsp/meta-freescale/conf/machine/ls1012ardb-32b.conf b/bsp/meta-freescale/conf/machine/ls1012ardb-32b.conf
deleted file mode 100644
index 43abf70a..00000000
--- a/bsp/meta-freescale/conf/machine/ls1012ardb-32b.conf
+++ /dev/null
@@ -1,34 +0,0 @@
-#@TYPE: Machine
-#@NAME: NXP LS1012ARDB board
-#@SOC: LSCH2
-#@DESCRIPTION: Machine configuration for NXP QorIQ LS1012ARDB
-# with ARM Cortext-A53 core
-#@MAINTAINER: Zongchun Yu <Zongchun.Yu@nxp.com>
-
-MACHINEOVERRIDES =. "fsl-lsch2:fsl-lsch2-32b:ls1012a:"
-
-require conf/machine/include/qoriq-arm.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-DEFAULTTUNE = "armv7ahf-neon"
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x90000000"
-UBOOT_ENTRYPOINT = "0x80008000"
-
-UBOOT_CONFIG ??= "qspi-secure-boot qspi"
-UBOOT_CONFIG[qspi] = "ls1012ardb_qspi_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi-secure-boot] = "ls1012ardb_qspi_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-
-KERNEL_IMAGETYPE = "zImage"
-KERNEL_DEVICETREE ?= "freescale/fsl-ls1012a-rdb.dtb"
-KERNEL_DEFCONFIG ?= "multi_v7_defconfig"
-
-EXTRA_IMAGEDEPENDS += "rcw"
-USE_VT = "0"
-
-require conf/multilib.conf
-MULTILIBS ?= "multilib:lib64"
-DEFAULTTUNE_virtclass-multilib-lib64 ?= "aarch64"
diff --git a/bsp/meta-freescale/conf/machine/ls1012ardb.conf b/bsp/meta-freescale/conf/machine/ls1012ardb.conf
index f05507d7..6efd6b3d 100644
--- a/bsp/meta-freescale/conf/machine/ls1012ardb.conf
+++ b/bsp/meta-freescale/conf/machine/ls1012ardb.conf
@@ -10,6 +10,8 @@ MACHINEOVERRIDES =. "fsl-lsch2:ls1012a:"
require conf/machine/include/qoriq-arm64.inc
require conf/machine/include/arm/arch-arm64.inc
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -20,9 +22,10 @@ UBOOT_CONFIG ??= "tfa-secure-boot tfa"
UBOOT_CONFIG[tfa] = "ls1012ardb_tfa_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[tfa-secure-boot] = "ls1012ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-RCWQSPI ?= "R_SPNH_3508/rcw_1000_default.bin"
+RCWQSPI ?= "R_SPNH_3508/rcw_1000"
+RCWQSPISEC ?= "R_SPNH_3508/rcw_1000"
-KERNEL_DEVICETREE ?= "freescale/fsl-ls1012a-rdb.dtb"
+KERNEL_DEVICETREE ?= "freescale/fsl-ls1012a-rdb.dtb freescale/fsl-ls1012a-qds.dtb"
KERNEL_DEFCONFIG ?= "defconfig"
EXTRA_IMAGEDEPENDS += "ppfe-firmware rcw atf"
diff --git a/bsp/meta-freescale/conf/machine/ls1021atwr.conf b/bsp/meta-freescale/conf/machine/ls1021atwr.conf
index a238fdca..aa0f0943 100644
--- a/bsp/meta-freescale/conf/machine/ls1021atwr.conf
+++ b/bsp/meta-freescale/conf/machine/ls1021atwr.conf
@@ -10,15 +10,17 @@ MACHINEOVERRIDES =. "ls102xa:"
require conf/machine/include/qoriq-arm.inc
require conf/machine/include/tune-cortexa7.inc
+MACHINE_FEATURES += "optee"
+
DEFAULTTUNE = "cortexa7hf-neon"
UBOOT_CONFIG ??= "sdcard-ifc-secure-boot sdcard-ifc sdcard-qspi lpuart qspi secure-boot nor"
-UBOOT_CONFIG[nor] = "ls1021atwr_nor_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[sdcard-ifc] = "ls1021atwr_sdcard_ifc_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[sdcard-qspi] = "ls1021atwr_sdcard_qspi_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[lpuart] = "ls1021atwr_nor_lpuart_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi] = "ls1021atwr_qspi_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[secure-boot] = "ls1021atwr_nor_SECURE_BOOT_config,,u-boot-dtb.bin"
+UBOOT_CONFIG[nor] = "ls1021atwr_nor_defconfig,,u-boot-dtb.bin"
+UBOOT_CONFIG[sdcard-ifc] = "ls1021atwr_sdcard_ifc_defconfig,,u-boot-with-spl-pbl.bin"
+UBOOT_CONFIG[sdcard-qspi] = "ls1021atwr_sdcard_qspi_defconfig,,u-boot-with-spl-pbl.bin"
+UBOOT_CONFIG[lpuart] = "ls1021atwr_nor_lpuart_defconfig,,u-boot-dtb.bin"
+UBOOT_CONFIG[qspi] = "ls1021atwr_qspi_defconfig,,u-boot-dtb.bin"
+UBOOT_CONFIG[secure-boot] = "ls1021atwr_nor_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[sdcard-ifc-secure-boot] = "ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig,,u-boot-with-spl-pbl.bin"
QE_UCODE="iram_Type_A_LS1021a_r1.0.bin"
diff --git a/bsp/meta-freescale/conf/machine/ls1028ardb.conf b/bsp/meta-freescale/conf/machine/ls1028ardb.conf
new file mode 100644
index 00000000..b0bbc5b8
--- /dev/null
+++ b/bsp/meta-freescale/conf/machine/ls1028ardb.conf
@@ -0,0 +1,38 @@
+#@TYPE: Machine
+#@NAME: NXP LS1028ARDB
+#@SOC: LSCH3
+#@DESCRIPTION: Machine configuration for running LS1028ARDB in 64-bit mode
+#@MAINTAINER: Chunrong.Guo <chunrong.guo@nxp.com>
+
+require conf/machine/include/qoriq-arm64.inc
+require conf/machine/include/arm/arch-arm64.inc
+
+MACHINE_FEATURES += "optee"
+
+MACHINEOVERRIDES =. "fsl-lsch3:ls1028a:"
+
+KERNEL_CLASSES = " kernel-fitimage "
+KERNEL_IMAGETYPES = "fitImage"
+
+UBOOT_DTB_LOADADDRESS = "0x90000000"
+UBOOT_ENTRYPOINT = "0x80080000"
+
+UBOOT_CONFIG ??= "tfa-secure-boot tfa"
+UBOOT_CONFIG[tfa-secure-boot] = "ls1028ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
+UBOOT_CONFIG[tfa] = "ls1028ardb_tfa_defconfig,,u-boot-dtb.bin"
+
+KERNEL_DEVICETREE ?= "freescale/fsl-ls1028a-rdb.dtb freescale/fsl-ls1028a-qds.dtb"
+KERNEL_DEVICETREE_append_use-nxp-bsp = "\
+ freescale/fsl-ls1028a-rdb-dpdk.dtb \
+"
+KERNEL_DEFCONFIG ?= "defconfig"
+
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
+SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
+
+RCWSD ?= "R_SQPP_0x85bb/rcw_1500_gpu600"
+RCWXSPI ?= "R_SQPP_0x85bb/rcw_1500_gpu600"
+RCWEMMC ?= "R_SQPP_0x85bb/rcw_1500_gpu600"
+
+EXTRA_IMAGEDEPENDS += "rcw atf dp-firmware-cadence"
+USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls1043ardb-32b.conf b/bsp/meta-freescale/conf/machine/ls1043ardb-32b.conf
deleted file mode 100644
index aa7f3f6f..00000000
--- a/bsp/meta-freescale/conf/machine/ls1043ardb-32b.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-#@TYPE: Machine
-#@NAME: NXP LS1043ARDB-32B
-#@SOC: LSCH2
-#@DESCRIPTION: Machine configuration for running LS1043A in 32B mode
-#@MAINTAINER: Ting Liu <ting.liu@nxp.com>
-
-MACHINEOVERRIDES =. "fsl-lsch2:fsl-lsch2-32b:ls1043a:"
-
-require conf/machine/include/qoriq-arm.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-DEFAULTTUNE = "armv7ahf-neon"
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x9ffe0000"
-UBOOT_ENTRYPOINT = "0x80008000"
-
-UBOOT_CONFIG ??= "nand sdcard nor"
-UBOOT_CONFIG[nor] = "ls1043ardb_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[nand] = "ls1043ardb_nand_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[sdcard] = "ls1043ardb_sdcard_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[secure-boot] = "ls1043ardb_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-
-QE_UCODE = "iram_Type_A_LS1021a_r1.0.bin"
-
-KERNEL_DEVICETREE ?= "freescale/fsl-ls1043a-rdb-sdk.dtb freescale/fsl-ls1043a-rdb-usdpaa.dtb"
-KERNEL_DEFCONFIG ?= "multi_v7_defconfig"
-
-SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyAMA0"
-SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
-
-EXTRA_IMAGEDEPENDS += "fm-ucode rcw qe-ucode"
-USE_VT = "0"
-
-require conf/multilib.conf
-MULTILIBS ?= "multilib:lib64"
-DEFAULTTUNE_virtclass-multilib-lib64 ?= "aarch64"
diff --git a/bsp/meta-freescale/conf/machine/ls1043ardb-be.conf b/bsp/meta-freescale/conf/machine/ls1043ardb-be.conf
deleted file mode 100644
index 3582162f..00000000
--- a/bsp/meta-freescale/conf/machine/ls1043ardb-be.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-#@TYPE: Machine
-#@NAME: Freescale LS1043ARDB
-#@SOC: LSCH2
-#@DESCRIPTION: Machine configuration for running LS1043A in 64-bit mode
-#@MAINTAINER: Chunrong Guo <nxa13725@nxp.com>
-
-DEFAULTTUNE = "aarch64_be"
-
-require conf/machine/include/qoriq-arm64.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-MACHINEOVERRIDES =. "fsl-lsch2:ls1043a:"
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x90000000"
-UBOOT_ENTRYPOINT = "0x80080000"
-
-UBOOT_CONFIG ??= "nand sdcard nor"
-UBOOT_CONFIG[nor] = "ls1043ardb_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[nand] = "ls1043ardb_nand_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[sdcard] = "ls1043ardb_sdcard_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[secure-boot] = "ls1043ardb_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[nand-secure-boot] = "ls1043ardb_nand_SECURE_BOOT_defconfig,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[nand-spl-secure-boot] = "ls1043ardb_nand_SECURE_BOOT_defconfig,,spl/u-boot-spl.bin"
-UBOOT_CONFIG[nand-dtb-secure-boot] = "ls1043ardb_nand_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[sdcard-secure-boot] = "ls1043ardb_sdcard_SECURE_BOOT_defconfig,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[sdcard-spl-secure-boot] = "ls1043ardb_sdcard_SECURE_BOOT_defconfig,,spl/u-boot-spl.bin"
-UBOOT_CONFIG[sdcard-dtb-secure-boot] = "ls1043ardb_sdcard_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-
-QE_UCODE = "iram_Type_A_LS1021a_r1.0.bin"
-LE_UBOOT_FOR_ARMBE_TARGET = "1"
-
-KERNEL_DEVICETREE ?= "freescale/fsl-ls1043a-rdb-sdk.dtb freescale/fsl-ls1043a-rdb-usdpaa.dtb"
-KERNEL_DEFCONFIG ?= "defconfig"
-
-EXTRA_IMAGEDEPENDS += "fm-ucode rcw qe-ucode"
-
-USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls1043ardb.conf b/bsp/meta-freescale/conf/machine/ls1043ardb.conf
index f9b0d3d9..6f1f7ea4 100644
--- a/bsp/meta-freescale/conf/machine/ls1043ardb.conf
+++ b/bsp/meta-freescale/conf/machine/ls1043ardb.conf
@@ -10,6 +10,8 @@ MACHINEOVERRIDES =. "fsl-lsch2:ls1043a:"
require conf/machine/include/qoriq-arm64.inc
require conf/machine/include/arm/arch-arm64.inc
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -20,14 +22,23 @@ UBOOT_CONFIG ??= "tfa-secure-boot tfa"
UBOOT_CONFIG[tfa] = "ls1043ardb_tfa_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[tfa-secure-boot] = "ls1043ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-KERNEL_DEVICETREE ?= "freescale/fsl-ls1043a-rdb-sdk.dtb freescale/fsl-ls1043a-rdb-usdpaa.dtb"
+KERNEL_DEVICETREE ?= "\
+ freescale/fsl-ls1043a-rdb.dtb \
+ freescale/fsl-ls1043a-qds.dtb \
+"
+# usdpaa dtb is used for dpdk. TODO: rename in kernel
+KERNEL_DEVICETREE_append_use-nxp-bsp = "\
+ freescale/fsl-ls1043a-rdb-sdk.dtb \
+ freescale/fsl-ls1043a-rdb-usdpaa.dtb \
+ freescale/fsl-ls1043a-qds-sdk.dtb \
+"
KERNEL_DEFCONFIG ?= "defconfig"
UEFI_NORBOOT ?= "LS1043ARDB_EFI_NORBOOT.fd"
-RCWNOR ?= "RR_FQPP_1455/rcw_1600.bin"
-RCWSD ?= "RR_FQPP_1455/rcw_1600_sdboot.bin"
-RCWNAND ?= "RR_FQPP_1455/rcw_1600_nandboot.bin"
+RCWNOR ?= "RR_FQPP_1455/rcw_1600"
+RCWSD ?= "RR_FQPP_1455/rcw_1600_sdboot"
+RCWNAND ?= "RR_FQPP_1455/rcw_1600_nandboot"
QE_UCODE = "iram_Type_A_LS1021a_r1.0.bin"
-EXTRA_IMAGEDEPENDS += "fm-ucode rcw qe-ucode uefi atf"
+EXTRA_IMAGEDEPENDS += "fm-ucode rcw qe-ucode uefi atf ls2-phy"
USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls1046afrwy.conf b/bsp/meta-freescale/conf/machine/ls1046afrwy.conf
new file mode 100644
index 00000000..884f7666
--- /dev/null
+++ b/bsp/meta-freescale/conf/machine/ls1046afrwy.conf
@@ -0,0 +1,41 @@
+#@TYPE: Machine
+#@NAME: NXP LS1046AFRWY
+#@SOC: LSCH2
+#@DESCRIPTION: Machine configuration for running LS1046A in 64-bit mode
+#@MAINTAINER: Chunrong.guo <chunrong.guo@nxp.com>
+
+MACHINEOVERRIDES =. "fsl-lsch2:ls1046a:"
+
+require conf/machine/include/qoriq-arm64.inc
+require conf/machine/include/arm/arch-arm64.inc
+
+MACHINE_FEATURES += "optee"
+
+KERNEL_CLASSES = " kernel-fitimage "
+KERNEL_IMAGETYPES = "fitImage"
+
+UBOOT_DTB_LOADADDRESS = "0x90000000"
+UBOOT_ENTRYPOINT = "0x80080000"
+
+UBOOT_CONFIG ??= "tfa-secure-boot tfa"
+UBOOT_CONFIG[tfa] = "ls1046afrwy_tfa_defconfig,,u-boot-dtb.bin"
+UBOOT_CONFIG[tfa-secure-boot] = "ls1046afrwy_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
+
+KERNEL_DEVICETREE ?= "\
+ freescale/fsl-ls1046a-frwy.dtb \
+"
+# usdpaa dtb is used for dpdk. TODO: rename in kernel
+KERNEL_DEVICETREE_append_use-nxp-bsp = "\
+ freescale/fsl-ls1046a-frwy-sdk.dtb \
+ freescale/fsl-ls1046a-frwy-usdpaa.dtb \
+"
+KERNEL_DEFCONFIG ?= "defconfig"
+
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyAMA0 115200;ttyLP0"
+SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
+
+RCWQSPI ?= "NN_NNQNNPNP_3040_0506/rcw_1600_qspiboot"
+RCWSD ?= "NN_NNQNNPNP_3040_0506/rcw_1600_sdboot"
+
+EXTRA_IMAGEDEPENDS += "fm-ucode rcw atf ls2-phy qe-ucode"
+USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls1046ardb-32b.conf b/bsp/meta-freescale/conf/machine/ls1046ardb-32b.conf
deleted file mode 100644
index 4267c0f1..00000000
--- a/bsp/meta-freescale/conf/machine/ls1046ardb-32b.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-#@TYPE: Machine
-#@NAME: NXP LS1046ARDB
-#@SOC: LSCH2
-#@DESCRIPTION: Machine configuration for running LS1046A in 32-bit mode
-#@MAINTAINER: Zhenhua Luo <zhenhua.luo@nxp.com>
-
-MACHINEOVERRIDES =. "fsl-lsch2:fsl-lsch2-32b:ls1046a:"
-
-require conf/machine/include/qoriq-arm.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-DEFAULTTUNE = "armv7ahf-neon"
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x9ffe0000"
-UBOOT_ENTRYPOINT = "0x80008000"
-
-UBOOT_CONFIG ??= "emmc sdcard qspi-secure-boot qspi"
-UBOOT_CONFIG[emmc] = "ls1046ardb_emmc_defconfig,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[sdcard] = "ls1046ardb_sdcard_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[qspi] = "ls1046ardb_qspi_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi-secure-boot] = "ls1046ardb_qspi_SECURE_BOOT_config,,u-boot-dtb.bin"
-
-KERNEL_DEVICETREE ?= "\
- freescale/fsl-ls1046a-rdb-sdk.dtb \
- freescale/fsl-ls1046a-rdb-usdpaa.dtb \
-"
-KERNEL_DEFCONFIG ?= "multi_v7_defconfig"
-
-SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyAMA0 115200;ttyLP0"
-SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
-
-EXTRA_IMAGEDEPENDS += "fm-ucode rcw"
-USE_VT = "0"
-
-require conf/multilib.conf
-MULTILIBS ?= "multilib:lib64"
-DEFAULTTUNE_virtclass-multilib-lib64 ?= "aarch64"
diff --git a/bsp/meta-freescale/conf/machine/ls1046ardb-be.conf b/bsp/meta-freescale/conf/machine/ls1046ardb-be.conf
deleted file mode 100644
index 0f72d579..00000000
--- a/bsp/meta-freescale/conf/machine/ls1046ardb-be.conf
+++ /dev/null
@@ -1,37 +0,0 @@
-#@TYPE: Machine
-#@NAME: NXP LS1046ARDB
-#@SOC: LSCH2
-#@DESCRIPTION: Machine configuration for running LS1046A in 64-bit mode
-#@MAINTAINER: Zhenhua Luo <zhenhua.luo@nxp.com>
-
-DEFAULTTUNE = "aarch64_be"
-
-MACHINEOVERRIDES =. "fsl-lsch2:ls1046a:"
-
-require conf/machine/include/qoriq-arm64.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x90000000"
-UBOOT_ENTRYPOINT = "0x80080000"
-
-LE_UBOOT_FOR_ARMBE_TARGET = "1"
-UBOOT_CONFIG ??= "emmc sdcard sdcard-dtb-secure-boot sdcard-spl-secure-boot sdcard-secure-boot qspi-secure-boot qspi"
-UBOOT_CONFIG[emmc] = "ls1046ardb_emmc_defconfig,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[sdcard] = "ls1046ardb_sdcard_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[qspi] = "ls1046ardb_qspi_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi-secure-boot] = "ls1046ardb_qspi_SECURE_BOOT_config,,u-boot-dtb.bin"
-UBOOT_CONFIG[sdcard-secure-boot] = "ls1046ardb_sdcard_SECURE_BOOT_defconfig,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[sdcard-spl-secure-boot] = "ls1046ardb_sdcard_SECURE_BOOT_defconfig,,spl/u-boot-spl.bin"
-UBOOT_CONFIG[sdcard-dtb-secure-boot] = "ls1046ardb_sdcard_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-
-KERNEL_DEVICETREE ?= "\
- freescale/fsl-ls1046a-rdb-sdk.dtb \
- freescale/fsl-ls1046a-rdb-usdpaa.dtb \
-"
-KERNEL_DEFCONFIG ?= "defconfig"
-
-EXTRA_IMAGEDEPENDS += "fm-ucode rcw"
-USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls1046ardb.conf b/bsp/meta-freescale/conf/machine/ls1046ardb.conf
index 83309c95..e8773366 100644
--- a/bsp/meta-freescale/conf/machine/ls1046ardb.conf
+++ b/bsp/meta-freescale/conf/machine/ls1046ardb.conf
@@ -9,6 +9,8 @@ MACHINEOVERRIDES =. "fsl-lsch2:ls1046a:"
require conf/machine/include/qoriq-arm64.inc
require conf/machine/include/arm/arch-arm64.inc
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -20,17 +22,23 @@ UBOOT_CONFIG[tfa] = "ls1046ardb_tfa_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[tfa-secure-boot] = "ls1046ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
KERNEL_DEVICETREE ?= "\
+ freescale/fsl-ls1046a-rdb.dtb \
+ freescale/fsl-ls1046a-qds.dtb \
+"
+# usdpaa dtb is used for dpdk. TODO: rename in kernel
+KERNEL_DEVICETREE_append_use-nxp-bsp = "\
freescale/fsl-ls1046a-rdb-sdk.dtb \
freescale/fsl-ls1046a-rdb-usdpaa.dtb \
+ freescale/fsl-ls1046a-qds-sdk.dtb \
"
KERNEL_DEFCONFIG ?= "defconfig"
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyAMA0 115200;ttyLP0"
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
-UEFI_NORBOOT ?= "LS1046ARDB_EFI_NORBOOT.fd"
-RCWQSPI ?= "RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin"
-RCWSD ?= "RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin"
+UEFI_QSPIBOOT ?= "LS1046ARDB_EFI_QSPIBOOT.fd"
+RCWQSPI ?= "RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot"
+RCWSD ?= "RR_FFSSPPPH_1133_5559/rcw_1800_sdboot"
-EXTRA_IMAGEDEPENDS += "fm-ucode rcw uefi atf"
+EXTRA_IMAGEDEPENDS += "fm-ucode rcw uefi atf qe-ucode ls2-phy"
USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls1088ardb-be.conf b/bsp/meta-freescale/conf/machine/ls1088ardb-be.conf
deleted file mode 100644
index 3460a9c1..00000000
--- a/bsp/meta-freescale/conf/machine/ls1088ardb-be.conf
+++ /dev/null
@@ -1,34 +0,0 @@
-#@TYPE: Machine
-#@NAME: NXP LS1088ARDB
-#@SOC: LSCH3
-#@DESCRIPTION: Machine configuration for running LS1088ARDB in 64-bit mode
-#@MAINTAINER: Zongchun Yu <Zongchun.Yu@nxp.com>
-
-require conf/machine/include/qoriq-arm64.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-DEFAULTTUNE = "aarch64_be"
-
-LE_UBOOT_FOR_ARMBE_TARGET = "1"
-
-MACHINEOVERRIDES =. "fsl-lsch3:ls1088a:"
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x90000000"
-UBOOT_ENTRYPOINT = "0x80080000"
-
-UBOOT_CONFIG ??= "secure-boot sdcard-qspi qspi"
-UBOOT_CONFIG[secure-boot] = "ls1088ardb_qspi_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi] = "ls1088ardb_qspi_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[sdcard-qspi] = "ls1088ardb_sdcard_qspi_defconfig,,u-boot-with-spl.bin"
-
-KERNEL_DEVICETREE ?= "freescale/fsl-ls1088a-rdb.dtb"
-KERNEL_DEFCONFIG ?= "defconfig"
-
-SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
-SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
-
-EXTRA_IMAGEDEPENDS += "mc-utils rcw management-complex"
-USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls1088ardb-pb.conf b/bsp/meta-freescale/conf/machine/ls1088ardb-pb.conf
index 3726efa2..2e456f1b 100644
--- a/bsp/meta-freescale/conf/machine/ls1088ardb-pb.conf
+++ b/bsp/meta-freescale/conf/machine/ls1088ardb-pb.conf
@@ -9,6 +9,8 @@ require conf/machine/include/arm/arch-arm64.inc
MACHINEOVERRIDES =. "fsl-lsch3:ls1088a:"
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -25,8 +27,8 @@ KERNEL_DEFCONFIG ?= "defconfig"
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
-RCWSD ?= "FCSSRR_PPPP_0x1d_0x13/rcw_1600_sd.bin"
-RCWQSPI ?= "FCSSRR_PPPP_0x1d_0x13/rcw_1600_qspi.bin"
+RCWSD ?= "FCSSRR_PPPP_0x1d_0x13/rcw_1600_sd"
+RCWQSPI ?= "FCSSRR_PPPP_0x1d_0x13/rcw_1600_qspi"
EXTRA_IMAGEDEPENDS += "mc-utils rcw management-complex atf"
diff --git a/bsp/meta-freescale/conf/machine/ls1088ardb.conf b/bsp/meta-freescale/conf/machine/ls1088ardb.conf
index 13c8bf29..8f47f284 100644
--- a/bsp/meta-freescale/conf/machine/ls1088ardb.conf
+++ b/bsp/meta-freescale/conf/machine/ls1088ardb.conf
@@ -9,6 +9,8 @@ require conf/machine/include/arm/arch-arm64.inc
MACHINEOVERRIDES =. "fsl-lsch3:ls1088a:"
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -25,8 +27,8 @@ KERNEL_DEFCONFIG ?= "defconfig"
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
-RCWSD ?= "FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin"
-RCWQSPI ?= "FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin"
+RCWSD ?= "FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd"
+RCWQSPI ?= "FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi"
EXTRA_IMAGEDEPENDS += "mc-utils rcw management-complex atf"
USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls2080ardb.conf b/bsp/meta-freescale/conf/machine/ls2080ardb.conf
index d58a86a4..859a41be 100644
--- a/bsp/meta-freescale/conf/machine/ls2080ardb.conf
+++ b/bsp/meta-freescale/conf/machine/ls2080ardb.conf
@@ -16,5 +16,5 @@ UBOOT_CONFIG[nor] = "ls2080ardb_defconfig,,u-boot-dtb.bin"
KERNEL_DEVICETREE ?= "freescale/fsl-ls2080a-rdb.dtb"
KERNEL_DEFCONFIG ?= "defconfig"
-EXTRA_IMAGEDEPENDS += "dpl-examples ls2-phy rcw management-complex"
+EXTRA_IMAGEDEPENDS += "ls2-phy rcw management-complex"
USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls2088ardb-be.conf b/bsp/meta-freescale/conf/machine/ls2088ardb-be.conf
deleted file mode 100644
index 71cf596d..00000000
--- a/bsp/meta-freescale/conf/machine/ls2088ardb-be.conf
+++ /dev/null
@@ -1,35 +0,0 @@
-#@TYPE: Machine
-#@NAME: NXP LS2088ARDB
-#@SOC: LSCH3
-#@DESCRIPTION: Machine configuration for running LS2088ARDB in 64-bit mode
-#@MAINTAINER: Zongchun Yu <Zongchun.Yu@nxp.com>
-
-require conf/machine/include/qoriq-arm64.inc
-require conf/machine/include/arm/arch-arm64.inc
-
-DEFAULTTUNE = "aarch64_be"
-
-LE_UBOOT_FOR_ARMBE_TARGET = "1"
-
-MACHINEOVERRIDES =. "fsl-lsch3:ls2088a:"
-
-KERNEL_CLASSES = " kernel-fitimage "
-KERNEL_IMAGETYPES = "fitImage"
-
-UBOOT_DTB_LOADADDRESS = "0x90000000"
-UBOOT_ENTRYPOINT = "0x80080000"
-
-UBOOT_CONFIG ??= "qspi-secure-boot qspi nand nor"
-UBOOT_CONFIG[nor] = "ls2080ardb_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[nand] = "ls2080ardb_nand_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi] = "ls2088ardb_qspi_defconfig,,u-boot-dtb.bin"
-UBOOT_CONFIG[qspi-secure-boot] = "ls2088ardb_qspi_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-
-KERNEL_DEVICETREE ?= "freescale/fsl-ls2088a-rdb.dtb"
-KERNEL_DEFCONFIG ?= "defconfig"
-
-SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
-SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
-
-EXTRA_IMAGEDEPENDS += "mc-utils ls2-phy rcw management-complex"
-USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/ls2088ardb.conf b/bsp/meta-freescale/conf/machine/ls2088ardb.conf
index 04f3bbdc..f920d601 100644
--- a/bsp/meta-freescale/conf/machine/ls2088ardb.conf
+++ b/bsp/meta-freescale/conf/machine/ls2088ardb.conf
@@ -9,6 +9,8 @@ require conf/machine/include/arm/arch-arm64.inc
MACHINEOVERRIDES =. "fsl-lsch3:ls2088a:"
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -19,11 +21,11 @@ UBOOT_CONFIG ??= "tfa-secure-boot tfa"
UBOOT_CONFIG[tfa] = "ls2088ardb_tfa_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[tfa-secure-boot] = "ls2088ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-RCWNOR ?= "FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin"
-RCWQSPI?= "FFFFFFFF_PP_HH_0x2a_0x41/rcw_2000_qspi.bin"
+RCWNOR ?= "FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800"
+RCWQSPI?= "FFFFFFFF_PP_HH_0x2a_0x41/rcw_2000_qspi"
UEFI_NORBOOT ?= "LS2088ARDB_EFI_NORBOOT.fd"
-KERNEL_DEVICETREE ?= "freescale/fsl-ls2088a-rdb.dtb"
+KERNEL_DEVICETREE ?= "freescale/fsl-ls2088a-rdb.dtb freescale/fsl-ls2088a-qds.dtb"
KERNEL_DEFCONFIG ?= "defconfig"
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
diff --git a/bsp/meta-freescale/conf/machine/lx2160ardb.conf b/bsp/meta-freescale/conf/machine/lx2160ardb.conf
index 44eba5d9..a8bbdbda 100644
--- a/bsp/meta-freescale/conf/machine/lx2160ardb.conf
+++ b/bsp/meta-freescale/conf/machine/lx2160ardb.conf
@@ -9,6 +9,8 @@ require conf/machine/include/arm/arch-arm64.inc
MACHINEOVERRIDES =. "fsl-lsch3:lx2160a:"
+MACHINE_FEATURES += "optee"
+
KERNEL_CLASSES = " kernel-fitimage "
KERNEL_IMAGETYPES = "fitImage"
@@ -19,15 +21,16 @@ UBOOT_CONFIG ??= "tfa-secure-boot tfa"
UBOOT_CONFIG[tfa] = "lx2160ardb_tfa_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[tfa-secure-boot] = "lx2160ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
-KERNEL_DEVICETREE ?= "freescale/fsl-lx2160a-rdb.dtb"
+KERNEL_DEVICETREE ?= "freescale/fsl-lx2160a-rdb.dtb freescale/fsl-lx2160a-qds.dtb"
KERNEL_DEFCONFIG ?= "defconfig"
SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0"
SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}"
UEFI_XSPIBOOT ?= "LX2160ARDB_EFI_NORBOOT.fd"
-RCWXSPI ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2.bin"
-RCWSD ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2_sd.bin"
+RCWXSPI ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2"
+RCWSD ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2"
+RCWEMMC ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2"
EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy uefi atf inphi"
USE_VT = "0"
diff --git a/bsp/meta-freescale/conf/machine/mpc8548cds.conf b/bsp/meta-freescale/conf/machine/mpc8548cds.conf
index 73194402..c7c49ddc 100644
--- a/bsp/meta-freescale/conf/machine/mpc8548cds.conf
+++ b/bsp/meta-freescale/conf/machine/mpc8548cds.conf
@@ -6,9 +6,9 @@
require conf/machine/include/e500v2.inc
UBOOT_CONFIG ??= "nor"
-UBOOT_CONFIG[nor] = "MPC8548CDS_defconfig,,u-boot.bin"
+UBOOT_CONFIG[nor] = "MPC8548CDS_defconfig,,u-boot-with-dtb.bin"
-KERNEL_DEVICETREE = "mpc8548cds_32b.dtb"
+KERNEL_DEVICETREE = "fsl/mpc8548cds_32b.dtb"
KERNEL_DEFCONFIG = "mpc85xx_defconfig"
USE_VT ?= "0"
diff --git a/bsp/meta-freescale/conf/machine/p1020rdb.conf b/bsp/meta-freescale/conf/machine/p1020rdb.conf
index 50edba7d..974213c1 100644
--- a/bsp/meta-freescale/conf/machine/p1020rdb.conf
+++ b/bsp/meta-freescale/conf/machine/p1020rdb.conf
@@ -7,20 +7,20 @@
require conf/machine/include/e500v2.inc
-MACHINEOVERRIDES =. "p1020"
+MACHINEOVERRIDES =. "p1020:"
BOOTFORMAT_CONFIG = "config_sram_p1022ds.dat"
UBOOT_CONFIG ??= "nand sdcard spi nor"
-UBOOT_CONFIG[nor] = "P1020RDB-PD_config"
-UBOOT_CONFIG[nand] = "P1020RDB-PD_NAND_config"
-UBOOT_CONFIG[sdcard] = "P1020RDB-PD_SDCARD_config"
-UBOOT_CONFIG[spi] = "P1020RDB-PD_SPIFLASH_config"
+UBOOT_CONFIG[nor] = "P1020RDB-PD_config,,u-boot-with-dtb.bin"
+UBOOT_CONFIG[nand] = "P1020RDB-PD_NAND_config,,u-boot-with-spl.bin"
+UBOOT_CONFIG[sdcard] = "P1020RDB-PD_SDCARD_config,,u-boot-with-spl.bin"
+UBOOT_CONFIG[spi] = "P1020RDB-PD_SPIFLASH_config,,u-boot-with-spl.bin"
UBOOT_SOURCE_NAND = "u-boot-with-spl.bin"
UBOOT_SOURCE_SPI = "u-boot-with-spl.bin"
UBOOT_SOURCE_SD = "u-boot-with-spl.bin"
-KERNEL_DEVICETREE ?= "p1020rdb-pd.dtb"
+KERNEL_DEVICETREE ?= "fsl/p1020rdb-pd.dtb"
KERNEL_DEFCONFIG ?= "mpc85xx_smp_defconfig"
JFFS2_ERASEBLOCK = "0x20000"
diff --git a/bsp/meta-freescale/conf/machine/p2020rdb.conf b/bsp/meta-freescale/conf/machine/p2020rdb.conf
index 324186ca..40e279d2 100644
--- a/bsp/meta-freescale/conf/machine/p2020rdb.conf
+++ b/bsp/meta-freescale/conf/machine/p2020rdb.conf
@@ -11,16 +11,16 @@ MACHINEOVERRIDES =. "p2020:"
BOOTFORMAT_CONFIG = "config_sram_p1022ds.dat"
UBOOT_CONFIG ??= "nand sdcard spi 36bit-nor 36bit-spi 36bit-nand 36bit-sdcard nor"
-UBOOT_CONFIG[nor] = "P2020RDB-PC_config,,u-boot.bin"
-UBOOT_CONFIG[nand] = "P2020RDB-PC_NAND_config,,u-boot.bin"
-UBOOT_CONFIG[sdcard] = "P2020RDB-PC_SDCARD_config,,u-boot.bin"
-UBOOT_CONFIG[spi] = "P2020RDB-PC_SPIFLASH_config,,u-boot.bin"
-UBOOT_CONFIG[36bit-nor] = "P2020RDB-PC_36BIT_config,,u-boot.bin"
-UBOOT_CONFIG[36bit-spi] = "P2020RDB-PC_36BIT_SPIFLASH_config,,u-boot.bin"
-UBOOT_CONFIG[36bit-nand] = "P2020RDB-PC_36BIT_NAND_config,,u-boot.bin"
-UBOOT_CONFIG[36bit-sdcard] = "P2020RDB-PC_36BIT_SDCARD_config,,u-boot.bin"
+UBOOT_CONFIG[nor] = "P2020RDB-PC_config,,u-boot-with-dtb.bin"
+UBOOT_CONFIG[nand] = "P2020RDB-PC_NAND_config,,u-boot-with-spl.bin"
+UBOOT_CONFIG[sdcard] = "P2020RDB-PC_SDCARD_config,,u-boot-with-spl.bin"
+UBOOT_CONFIG[spi] = "P2020RDB-PC_SPIFLASH_config,,u-boot-with-spl.bin"
+UBOOT_CONFIG[36bit-nor] = "P2020RDB-PC_36BIT_config,,u-boot-with-dtb.bin"
+UBOOT_CONFIG[36bit-spi] = "P2020RDB-PC_36BIT_SPIFLASH_config,,u-boot-with-spl.bin"
+UBOOT_CONFIG[36bit-nand] = "P2020RDB-PC_36BIT_NAND_config,,u-boot-with-spl.bin"
+UBOOT_CONFIG[36bit-sdcard] = "P2020RDB-PC_36BIT_SDCARD_config,,u-boot-with-spl.bin"
-KERNEL_DEVICETREE ?= "p2020rdb-pc_32b.dtb"
+KERNEL_DEVICETREE ?= "fsl/p2020rdb-pc_32b.dtb"
KERNEL_DEFCONFIG ?= "mpc85xx_smp_defconfig"
JFFS2_ERASEBLOCK = "0x20000"
diff --git a/bsp/meta-freescale/conf/machine/p2041rdb.conf b/bsp/meta-freescale/conf/machine/p2041rdb.conf
index 102cc8db..67fa16d1 100644
--- a/bsp/meta-freescale/conf/machine/p2041rdb.conf
+++ b/bsp/meta-freescale/conf/machine/p2041rdb.conf
@@ -7,18 +7,17 @@
require conf/machine/include/e500mc.inc
-MACHINEOVERRIDES =. "p2041"
+MACHINEOVERRIDES =. "p2041:"
-UBOOT_CONFIG ??= "nand secure-boot sdcard spi nor"
-UBOOT_CONFIG[nor] = "P2041RDB_config"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "P2041RDB_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "P2041RDB_NAND_config,,u-boot.pbl"
-UBOOT_CONFIG[secure-boot] = "P2041RDB_SECURE_BOOT_config"
UBOOT_CONFIG[sdcard] = "P2041RDB_SDCARD_config,,u-boot.pbl"
UBOOT_CONFIG[spi] = "P2041RDB_SPIFLASH_config,,u-boot.pbl"
HV_CFG_M = "p2041rdb"
-KERNEL_DEVICETREE ?= "p2041rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/p2041rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet32_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/p3041ds.conf b/bsp/meta-freescale/conf/machine/p3041ds.conf
index c7ce4692..cb8099c2 100644
--- a/bsp/meta-freescale/conf/machine/p3041ds.conf
+++ b/bsp/meta-freescale/conf/machine/p3041ds.conf
@@ -7,18 +7,17 @@
require conf/machine/include/e500mc.inc
-MACHINEOVERRIDES =. "p3041"
+MACHINEOVERRIDES =. "p3041:"
-UBOOT_CONFIG ??= "nand secure-boot sdcard spi nor"
-UBOOT_CONFIG[nor] = "P3041DS_config"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "P3041DS_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "P3041DS_NAND_config,,u-boot.pbl"
-UBOOT_CONFIG[secure-boot] = "P3041DS_SECURE_BOOT_config"
UBOOT_CONFIG[sdcard] = "P3041DS_SDCARD_config,,u-boot.pbl"
UBOOT_CONFIG[spi] = "P3041DS_SPIFLASH_config,,u-boot.pbl"
HV_CFG_M = "p3041ds"
-KERNEL_DEVICETREE ?= "p3041ds.dtb"
+KERNEL_DEVICETREE ?= "fsl/p3041ds.dtb"
KERNEL_DEFCONFIG ?= "corenet32_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/p4080ds.conf b/bsp/meta-freescale/conf/machine/p4080ds.conf
index 23a7816b..e648a242 100644
--- a/bsp/meta-freescale/conf/machine/p4080ds.conf
+++ b/bsp/meta-freescale/conf/machine/p4080ds.conf
@@ -7,17 +7,16 @@
require conf/machine/include/e500mc.inc
-MACHINEOVERRIDES =. "p4080"
+MACHINEOVERRIDES =. "p4080:"
-UBOOT_CONFIG ??= "secure-boot sdcard spi nor"
-UBOOT_CONFIG[nor] = "P4080DS_config"
-UBOOT_CONFIG[secure-boot] = "P4080DS_SECURE_BOOT_config"
+UBOOT_CONFIG ??= "sdcard spi nor"
+UBOOT_CONFIG[nor] = "P4080DS_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[sdcard] = "P4080DS_SDCARD_config,,u-boot.pbl"
UBOOT_CONFIG[spi] = "P4080DS_SPIFLASH_config,,u-boot.pbl"
HV_CFG_M = "p4080ds"
-KERNEL_DEVICETREE ?= "p4080ds.dtb"
+KERNEL_DEVICETREE ?= "fsl/p4080ds.dtb"
KERNEL_DEFCONFIG ?= "corenet32_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/p5040ds-64b.conf b/bsp/meta-freescale/conf/machine/p5040ds-64b.conf
index 161eb5e9..a6a29393 100644
--- a/bsp/meta-freescale/conf/machine/p5040ds-64b.conf
+++ b/bsp/meta-freescale/conf/machine/p5040ds-64b.conf
@@ -9,16 +9,15 @@ require conf/machine/include/e5500-64b.inc
MACHINEOVERRIDES =. "p5040:"
-UBOOT_CONFIG ??= "nand secure-boot sdcard spi nor"
-UBOOT_CONFIG[nor] = "P5040DS_config"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "P5040DS_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "P5040DS_NAND_config,,u-boot.pbl"
-UBOOT_CONFIG[secure-boot] = "P5040DS_SECURE_BOOT_config"
UBOOT_CONFIG[sdcard] = "P5040DS_SDCARD_config,,u-boot.pbl"
UBOOT_CONFIG[spi] = "P5040DS_SPIFLASH_config,,u-boot.pbl"
HV_CFG_M = "p5040ds"
-KERNEL_DEVICETREE ?= "p5040ds.dtb"
+KERNEL_DEVICETREE ?= "fsl/p5040ds.dtb"
KERNEL_DEFCONFIG ?= "corenet64_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/p5040ds.conf b/bsp/meta-freescale/conf/machine/p5040ds.conf
index af581f49..daa8d4cd 100644
--- a/bsp/meta-freescale/conf/machine/p5040ds.conf
+++ b/bsp/meta-freescale/conf/machine/p5040ds.conf
@@ -7,18 +7,17 @@
require conf/machine/include/e5500.inc
-MACHINEOVERRIDES =. "p5040"
+MACHINEOVERRIDES =. "p5040:"
-UBOOT_CONFIG ??= "nand secure-boot sdcard spi nor"
-UBOOT_CONFIG[nor] = "P5040DS_config"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "P5040DS_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "P5040DS_NAND_config,,u-boot.pbl"
-UBOOT_CONFIG[secure-boot] = "P5040DS_SECURE_BOOT_config"
UBOOT_CONFIG[sdcard] = "P5040DS_SDCARD_config,,u-boot.pbl"
UBOOT_CONFIG[spi] = "P5040DS_SPIFLASH_config,,u-boot.pbl"
HV_CFG_M = "p5040ds"
-KERNEL_DEVICETREE ?= "p5040ds.dtb"
+KERNEL_DEVICETREE ?= "fsl/p5040ds.dtb"
KERNEL_DEFCONFIG ?= "corenet32_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t1024rdb-64b.conf b/bsp/meta-freescale/conf/machine/t1024rdb-64b.conf
index 490c8491..92ccc0e6 100644
--- a/bsp/meta-freescale/conf/machine/t1024rdb-64b.conf
+++ b/bsp/meta-freescale/conf/machine/t1024rdb-64b.conf
@@ -9,16 +9,15 @@ require conf/machine/include/e5500-64b.inc
MACHINEOVERRIDES =. "t1:t1024:"
-UBOOT_CONFIG ??= "nand sdcard spi secure-boot nor"
-UBOOT_CONFIG[nor] = "T1024RDB_config"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "T1024RDB_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "T1024RDB_NAND_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[sdcard] = "T1024RDB_SDCARD_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[spi] = "T1024RDB_SPIFLASH_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[secure-boot] = "T1024RDB_SECURE_BOOT_config"
HV_CFG_M = "t1024rdb"
-KERNEL_DEVICETREE ?= "t1024rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t1024rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet64_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t1024rdb.conf b/bsp/meta-freescale/conf/machine/t1024rdb.conf
index 616ce3f1..9d39958e 100644
--- a/bsp/meta-freescale/conf/machine/t1024rdb.conf
+++ b/bsp/meta-freescale/conf/machine/t1024rdb.conf
@@ -7,18 +7,17 @@
require conf/machine/include/e5500.inc
-MACHINEOVERRIDES =. "t1:t1024"
+MACHINEOVERRIDES =. "t1:t1024:"
-UBOOT_CONFIG ??= "nand sdcard spi secure-boot nor"
-UBOOT_CONFIG[nor] = "T1024RDB_config"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "T1024RDB_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "T1024RDB_NAND_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[sdcard] = "T1024RDB_SDCARD_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[spi] = "T1024RDB_SPIFLASH_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[secure-boot] = "T1024RDB_SECURE_BOOT_config"
HV_CFG_M = "t1024rdb"
-KERNEL_DEVICETREE ?= "t1024rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t1024rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet32_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t1042d4rdb-64b.conf b/bsp/meta-freescale/conf/machine/t1042d4rdb-64b.conf
index 873f206a..dd9acda1 100644
--- a/bsp/meta-freescale/conf/machine/t1042d4rdb-64b.conf
+++ b/bsp/meta-freescale/conf/machine/t1042d4rdb-64b.conf
@@ -9,16 +9,15 @@ require conf/machine/include/e5500-64b.inc
MACHINEOVERRIDES =. "t1:t1042:"
-UBOOT_CONFIG ??= "nand sdcard spi secure-boot nor"
-UBOOT_CONFIG[nor] = "T1042D4RDB_config,,u-boot.bin"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "T1042D4RDB_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "T1042D4RDB_NAND_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[sdcard] = "T1042D4RDB_SDCARD_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[spi] = "T1042D4RDB_SPIFLASH_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[secure-boot] = "T1042D4RDB_SECURE_BOOT_config,,u-boot.bin"
HV_CFG_M = "t1040rdb"
-KERNEL_DEVICETREE ?= "t1042d4rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t1042d4rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet64_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t1042d4rdb.conf b/bsp/meta-freescale/conf/machine/t1042d4rdb.conf
index 685b7cb1..52a792c7 100644
--- a/bsp/meta-freescale/conf/machine/t1042d4rdb.conf
+++ b/bsp/meta-freescale/conf/machine/t1042d4rdb.conf
@@ -9,16 +9,15 @@ require conf/machine/include/e5500.inc
MACHINEOVERRIDES =. "t1:t1042:"
-UBOOT_CONFIG ??= "nand sdcard spi secure-boot nor"
-UBOOT_CONFIG[nor] = "T1042D4RDB_config,,u-boot.bin"
+UBOOT_CONFIG ??= "nand sdcard spi nor"
+UBOOT_CONFIG[nor] = "T1042D4RDB_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[nand] = "T1042D4RDB_NAND_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[sdcard] = "T1042D4RDB_SDCARD_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[spi] = "T1042D4RDB_SPIFLASH_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[secure-boot] = "T1042D4RDB_SECURE_BOOT_config,,u-boot.bin"
HV_CFG_M = "t1040rdb"
-KERNEL_DEVICETREE ?= "t1042d4rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t1042d4rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet32_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t2080rdb-64b.conf b/bsp/meta-freescale/conf/machine/t2080rdb-64b.conf
index c46d94cf..2da8b3d2 100644
--- a/bsp/meta-freescale/conf/machine/t2080rdb-64b.conf
+++ b/bsp/meta-freescale/conf/machine/t2080rdb-64b.conf
@@ -9,17 +9,15 @@ require conf/machine/include/e6500-64b.inc
MACHINEOVERRIDES =. "t2:t2080:"
-UBOOT_CONFIG ??= "sdcard spi nand srio-pcie-boot secure-boot nor"
-UBOOT_CONFIG[nor] = "T2080RDB_config"
+UBOOT_CONFIG ??= "sdcard spi nand nor"
+UBOOT_CONFIG[nor] = "T2080RDB_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[sdcard] = "T2080RDB_SDCARD_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[spi] = "T2080RDB_SPIFLASH_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[nand] = "T2080RDB_NAND_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[srio-pcie-boot] = "T2080RDB_SRIO_PCIE_BOOT_config"
-UBOOT_CONFIG[secure-boot] = "T2080RDB_SECURE_BOOT_config"
HV_CFG_M = "t2080rdb"
-KERNEL_DEVICETREE ?= "t2080rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t2080rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet64_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t2080rdb.conf b/bsp/meta-freescale/conf/machine/t2080rdb.conf
index bfcb7689..9b6a85ac 100644
--- a/bsp/meta-freescale/conf/machine/t2080rdb.conf
+++ b/bsp/meta-freescale/conf/machine/t2080rdb.conf
@@ -7,19 +7,17 @@
require conf/machine/include/e6500.inc
-MACHINEOVERRIDES =. "t2:t2080"
+MACHINEOVERRIDES =. "t2:t2080:"
-UBOOT_CONFIG ??= "sdcard spi nand srio-pcie-boot secure-boot nor"
-UBOOT_CONFIG[nor] = "T2080RDB_config"
+UBOOT_CONFIG ??= "sdcard spi nand nor"
+UBOOT_CONFIG[nor] = "T2080RDB_config,,u-boot-with-dtb.bin"
UBOOT_CONFIG[sdcard] = "T2080RDB_SDCARD_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[spi] = "T2080RDB_SPIFLASH_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[nand] = "T2080RDB_NAND_config,,u-boot-with-spl-pbl.bin"
-UBOOT_CONFIG[srio-pcie-boot] = "T2080RDB_SRIO_PCIE_BOOT_config"
-UBOOT_CONFIG[secure-boot] = "T2080RDB_SECURE_BOOT_config"
HV_CFG_M = "t2080rdb"
-KERNEL_DEVICETREE ?= "t2080rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t2080rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet64_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t4240rdb-64b.conf b/bsp/meta-freescale/conf/machine/t4240rdb-64b.conf
index 0ccfce7c..7073e2a9 100644
--- a/bsp/meta-freescale/conf/machine/t4240rdb-64b.conf
+++ b/bsp/meta-freescale/conf/machine/t4240rdb-64b.conf
@@ -10,11 +10,11 @@ require conf/machine/include/e6500-64b.inc
MACHINEOVERRIDES =. "t4:t4240:"
UBOOT_CONFIG ??= "nor"
-UBOOT_CONFIG[nor] = "T4240RDB_config"
+UBOOT_CONFIG[nor] = "T4240RDB_config,,u-boot-with-dtb.bin"
HV_CFG_M = "t4240rdb"
-KERNEL_DEVICETREE ?= "t4240rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t4240rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet64_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/conf/machine/t4240rdb.conf b/bsp/meta-freescale/conf/machine/t4240rdb.conf
index 9f86345e..1f8cb83c 100644
--- a/bsp/meta-freescale/conf/machine/t4240rdb.conf
+++ b/bsp/meta-freescale/conf/machine/t4240rdb.conf
@@ -7,14 +7,14 @@
require conf/machine/include/e6500.inc
-MACHINEOVERRIDES =. "t4:t4240"
+MACHINEOVERRIDES =. "t4:t4240:"
UBOOT_CONFIG ??= "nor"
-UBOOT_CONFIG[nor] = "T4240RDB_config"
+UBOOT_CONFIG[nor] = "T4240RDB_config,,u-boot-with-dtb.bin"
HV_CFG_M = "t4240rdb"
-KERNEL_DEVICETREE ?= "t4240rdb.dtb"
+KERNEL_DEVICETREE ?= "fsl/t4240rdb.dtb"
KERNEL_DEFCONFIG ?= "corenet64_smp_defconfig"
JFFS2_ERASEBLOCK = "0x10000"
diff --git a/bsp/meta-freescale/dynamic-layers/aglprofilegraphical/recipes-graphics/wayland/weston-init.bbappend b/bsp/meta-freescale/dynamic-layers/aglprofilegraphical/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 00000000..10b66c0e
--- /dev/null
+++ b/bsp/meta-freescale/dynamic-layers/aglprofilegraphical/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1,3 @@
+do_install_append() {
+ rm -f ${D}${sysconfdir}/xdg/weston/weston.ini
+}
diff --git a/bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init.bbappend b/bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 00000000..72d991c7
--- /dev/null
+++ b/bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init/weston.ini b/bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init/weston.ini
new file mode 100644
index 00000000..6e8e0140
--- /dev/null
+++ b/bsp/meta-freescale/dynamic-layers/ivi/recipes-graphics/wayland/weston-init/weston.ini
@@ -0,0 +1,104 @@
+[core]
+shell=ivi-shell.so
+modules=hmi-controller.so
+#gbm-format=argb8888
+#use-g2d=1
+#xwayland=true
+
+#[shell]
+#size=1920x1080
+
+[ivi-shell]
+ivi-shell-user-interface=weston-ivi-shell-user-interface
+
+#developermode=true
+
+cursor-theme=default
+cursor-size=32
+
+base-layer-id=1000
+base-layer-id-offset=10000
+
+workspace-background-layer-id=2000
+workspace-layer-id=3000
+application-layer-id=4000
+
+transition-duration=300
+
+background-image=/usr/share/weston/background.png
+background-id=1001
+panel-image=/usr/share/weston/panel.png
+panel-id=1002
+surface-id-offset=10
+tiling-image=/usr/share/weston/tiling.png
+tiling-id=1003
+sidebyside-image=/usr/share/weston/sidebyside.png
+sidebyside-id=1004
+fullscreen-image=/usr/share/weston/fullscreen.png
+fullscreen-id=1005
+random-image=/usr/share/weston/random.png
+random-id=1006
+home-image=/usr/share/weston/home.png
+home-id=1007
+workspace-background-color=0x99000000
+workspace-background-id=2001
+
+[ivi-launcher]
+workspace-id=0
+icon-id=4001
+icon=/usr/share/weston/icon_ivi_flower.png
+path=/usr/bin/weston-flower
+
+[ivi-launcher]
+workspace-id=0
+icon-id=4002
+icon=/usr/share/weston/icon_ivi_clickdot.png
+path=/usr/bin/weston-clickdot
+
+[ivi-launcher]
+workspace-id=1
+icon-id=4003
+icon=/usr/share/weston/icon_ivi_simple-egl.png
+path=/usr/bin/weston-simple-egl
+
+[ivi-launcher]
+workspace-id=1
+icon-id=4004
+icon=/usr/share/weston/icon_ivi_simple-shm.png
+path=/usr/bin/weston-simple-shm
+
+[ivi-launcher]
+workspace-id=2
+icon-id=4005
+icon=/usr/share/weston/icon_ivi_smoke.png
+path=/usr/bin/weston-smoke
+
+[ivi-launcher]
+workspace-id=3
+icon-id=4006
+icon=/usr/share/weston/icon_ivi_flower.png
+path=/usr/bin/weston-flower
+
+[ivi-launcher]
+workspace-id=3
+icon-id=4007
+icon=/usr/share/weston/icon_ivi_clickdot.png
+path=/usr/bin/weston-clickdot
+
+[ivi-launcher]
+workspace-id=3
+icon-id=4008
+icon=/usr/share/weston/icon_ivi_simple-egl.png
+path=/usr/bin/weston-simple-egl
+
+[ivi-launcher]
+workspace-id=3
+icon-id=4009
+icon=/usr/share/weston/icon_ivi_simple-shm.png
+path=/usr/bin/weston-simple-shm
+
+[ivi-launcher]
+workspace-id=3
+icon-id=4010
+icon=/usr/share/weston/icon_ivi_smoke.png
+path=/usr/bin/weston-smoke
diff --git a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend
index b579028b..2e648ba3 100644
--- a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend
+++ b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend
@@ -1,4 +1,4 @@
-PACKAGECONFIG_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2', \
- bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gl x11-gles2', '', d), d)}"
-PACKAGECONFIG_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', '', \
- bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gl', '', d), d)}"
+# Only _mx8 machine do provide virtual/libgbm required for any drm* flavour
+DRM-REMOVE_imxgpu = "drm-gl drm-gles2"
+DRM-REMOVE_imxgpu_mx8 = ""
+PACKAGECONFIG_remove = "${DRM-REMOVE}"
diff --git a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-dpaa/fmc/fmc_git.bb b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-dpaa/fmc/fmc_git.bb
index cbf8e24f..2f5f1afa 100644
--- a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-dpaa/fmc/fmc_git.bb
+++ b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-dpaa/fmc/fmc_git.bb
@@ -39,7 +39,7 @@ do_install () {
install -m 755 ${S}/source/fmc ${D}/${bindir}
install -d ${D}${sysconfdir}/fmc/config
- install -m 644 ${S}${sysconfdir}/fmc/config/hxs_pdl_v3.xml ${D}${sysconfdir}/fmc/config
+ install -m 644 ${S}${sysconfdir}/fmc/config/* ${D}${sysconfdir}/fmc/config
install -d ${D}/${includedir}/fmc
install ${S}/source/fmc.h ${D}/${includedir}/fmc
diff --git a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-MGS-515-ccc-Opencv-app-can-t-run-on-imx6sx-with-cam.patch b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-MGS-515-ccc-Opencv-app-can-t-run-on-imx6sx-with-cam.patch
deleted file mode 100644
index 274fbe74..00000000
--- a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-MGS-515-ccc-Opencv-app-can-t-run-on-imx6sx-with-cam.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 90f869763026e8ff18aeecde217d778f00e4f294 Mon Sep 17 00:00:00 2001
-From: Shawn Xiao <b49994@freescale.com>
-Date: Tue, 10 Feb 2015 16:11:59 +0800
-Subject: [PATCH] MGS-515 [#ccc] Opencv app can't run on imx6sx with cam
-
-This issue is caused by the no support of VIDIOC_QUERYCTRL ioctl
-item in latest cam driver.
-
-Modified the errno in check logic to compatible with new driver.
-
-Feb 10, 2015
-
-Upstream-Status: Pending
-
-Signed-off-by: Shawn Xiao <b49994@freescale.com>
----
- modules/highgui/src/cap_v4l.cpp | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/modules/highgui/src/cap_v4l.cpp b/modules/highgui/src/cap_v4l.cpp
-index c9fca05..8c46b6c 100644
---- a/modules/highgui/src/cap_v4l.cpp
-+++ b/modules/highgui/src/cap_v4l.cpp
-@@ -707,7 +707,8 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture)
-
- } else {
-
-- if (errno == EINVAL)
-+ if (errno == ENOTTY ||
-+ errno == EINVAL)
- continue;
-
- perror ("VIDIOC_QUERYCTRL");
-@@ -774,7 +775,8 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture)
-
- } else {
-
-- if (errno == EINVAL)
-+ if (errno == ENOTTY ||
-+ errno == EINVAL)
- break;
-
- perror ("VIDIOC_QUERYCTRL");
---
-2.3.0
-
diff --git a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_3.4.%.bbappend b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_3.4.%.bbappend
deleted file mode 100644
index 3c4c7f5e..00000000
--- a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_3.4.%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI_append_mx6sx = " file://0001-MGS-515-ccc-Opencv-app-can-t-run-on-imx6sx-with-cam.patch"
-
-PACKAGECONFIG_remove_imxgpu2d = "v4l"
diff --git a/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.%.bbappend b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.%.bbappend
new file mode 100644
index 00000000..2bae6470
--- /dev/null
+++ b/bsp/meta-freescale/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PACKAGECONFIG_remove_imxgpu2d = "v4l"
diff --git a/bsp/meta-freescale/dynamic-layers/qt4-layer/recipes-qt4/qt4/qt4-imx-support.inc b/bsp/meta-freescale/dynamic-layers/qt4-layer/recipes-qt4/qt4/qt4-imx-support.inc
index b7171ebc..187681a8 100644
--- a/bsp/meta-freescale/dynamic-layers/qt4-layer/recipes-qt4/qt4/qt4-imx-support.inc
+++ b/bsp/meta-freescale/dynamic-layers/qt4-layer/recipes-qt4/qt4/qt4-imx-support.inc
@@ -2,7 +2,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/qt4:"
python __anonymous () {
families = ['mx6']
- cur_families = (d.getVar('MACHINEOVERRIDES', True) or '').split(':')
+ cur_families = (d.getVar('MACHINEOVERRIDES') or '').split(':')
if any(map(lambda x: x in cur_families,
families)):
d.appendVarFlag('do_configure', 'depends', ' virtual/kernel:do_shared_workdir')
diff --git a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0015-Add-eglfs-to-IMX-GPU.patch b/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0015-Add-eglfs-to-IMX-GPU.patch
deleted file mode 100644
index 8e7129e3..00000000
--- a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0015-Add-eglfs-to-IMX-GPU.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: git/mkspecs/linux-oe-g++/qmake.conf
-===================================================================
---- git.orig/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 17:03:17.000000000 -0600
-+++ git/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 17:06:23.000000000 -0600
-@@ -37,6 +37,8 @@ QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
- # for the SDK
- isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG)
-
-+EGLFS_DEVICE_INTEGRATION = eglfs_viv
-+
- include(../oe-device-extra.pri)
-
- QMAKE_LIBS_EGL += -lEGL
diff --git a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0016-Configure-eglfs-with-egl-pkg-config.patch b/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0016-Configure-eglfs-with-egl-pkg-config.patch
deleted file mode 100644
index a245d79a..00000000
--- a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0016-Configure-eglfs-with-egl-pkg-config.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: git/src/plugins/platforms/eglfs/eglfs-plugin.pro
-===================================================================
---- git.orig/src/plugins/platforms/eglfs/eglfs-plugin.pro 2017-01-04 16:54:05.000000000 -0600
-+++ git/src/plugins/platforms/eglfs/eglfs-plugin.pro 2017-01-04 16:56:25.000000000 -0600
-@@ -2,6 +2,8 @@
-
- QT += platformsupport-private eglfs_device_lib-private
-
-+CONFIG += egl
-+
- SOURCES += $$PWD/qeglfsmain.cpp
-
- OTHER_FILES += $$PWD/eglfs.json
diff --git a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend b/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend
index 08a2cbe3..bf3fb66e 100644
--- a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend
+++ b/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend
@@ -5,22 +5,20 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI_append_imxgpu2d = " \
+SRC_URI_append_imxgpu = " \
file://0014-Add-IMX-GPU-support.patch \
file://0001-egl.prf-Fix-build-error-when-egl-headers-need-platfo.patch \
"
-SRC_URI_APPEND_3D_NOT_X11 = " \
- file://0015-Add-eglfs-to-IMX-GPU.patch \
- file://0016-Configure-eglfs-with-egl-pkg-config.patch \
-"
-SRC_URI_append_imxgpu3d = " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '${SRC_URI_APPEND_3D_NOT_X11}', d)} \
-"
+
+PACKAGECONFIG_GL_IMX_GPU = ""
+PACKAGECONFIG_GL_IMX_GPU_mx8 = "gbm kms"
PACKAGECONFIG_GL_imxpxp = "gles2"
-PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' gl', '', d)}"
-PACKAGECONFIG_GL_imxgpu3d = "gles2"
-PACKAGECONFIG_GL_append_use-mainline-bsp = " gbm kms"
+PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' gl', '', d)} \
+ ${PACKAGECONFIG_GL_IMX_GPU}"
+PACKAGECONFIG_GL_imxgpu3d = "gles2 \
+ ${PACKAGECONFIG_GL_IMX_GPU}"
+PACKAGECONFIG_GL_use-mainline-bsp ?= "gles2 gbm kms"
PACKAGECONFIG_PLATFORM = ""
PACKAGECONFIG_PLATFORM_imxgpu2d = "no-opengl linuxfb"
@@ -30,3 +28,10 @@ PACKAGECONFIG_PLATFORM_imxgpu3d = " \
'eglfs', d), d)}"
PACKAGECONFIG_PLATFORM_use-mainline-bsp = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'eglfs', d)}"
PACKAGECONFIG += "${PACKAGECONFIG_PLATFORM}"
+
+PACKAGECONFIG_VULKAN_IMX_GPU = ""
+PACKAGECONFIG_VULKAN_IMX_GPU_mx8 = "vulkan"
+PACKAGECONFIG_VULKAN_IMX_GPU_mx8mm = ""
+PACKAGECONFIG_VULKAN = ""
+PACKAGECONFIG_VULKAN_imxgpu = "${PACKAGECONFIG_VULKAN_IMX_GPU}"
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', '${PACKAGECONFIG_VULKAN}', '', d)}"
diff --git a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend b/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend
index 7f61dc50..afc728c1 100644
--- a/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend
+++ b/bsp/meta-freescale/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend
@@ -1,2 +1,5 @@
# etnaviv mesa does not have glx
PACKAGECONFIG_remove_use-mainline-bsp = "xcomposite-glx"
+
+# i.MX8 does never provide native x11, so required dependencies are not met
+PACKAGECONFIG_remove_mx8 = "xcomposite-egl xcomposite-glx"
diff --git a/bsp/meta-freescale/recipes-bsp/atf/atf-tools_git.bb b/bsp/meta-freescale/recipes-bsp/atf/atf-tools_git.bb
new file mode 100644
index 00000000..33ec51c2
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/atf/atf-tools_git.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Tools for ARM Trusted Firmware, e.g. FIP image creation tool"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443"
+
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/atf;nobranch=1"
+SRCREV = "7d748e6f0ec652ba7c43733dc67a3d0b0217390a"
+
+S = "${WORKDIR}/git"
+
+DEPENDS += "openssl"
+
+EXTRA_OEMAKE = "fiptool V=1 HOSTCC='${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}'"
+
+do_install () {
+ install -m 0755 -d ${D}/${bindir}
+ install -m 0755 ${S}/tools/fiptool/fiptool ${D}/${bindir}/
+}
+
+BBCLASSEXTEND = "native"
diff --git a/bsp/meta-freescale/recipes-bsp/atf/atf_git.bb b/bsp/meta-freescale/recipes-bsp/atf/atf_git.bb
new file mode 100644
index 00000000..a93cb804
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/atf/atf_git.bb
@@ -0,0 +1,247 @@
+DESCRIPTION = "ARM Trusted Firmware"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443"
+
+inherit deploy
+
+DEPENDS += "u-boot-mkimage-native u-boot openssl openssl-native mbedtls rcw cst-native"
+DEPENDS_append_lx2160a += "ddr-phy"
+do_compile[depends] += "u-boot:do_deploy rcw:do_deploy uefi:do_deploy"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/atf;nobranch=1"
+SRCREV = "7d748e6f0ec652ba7c43733dc67a3d0b0217390a"
+
+COMPATIBLE_MACHINE = "(qoriq)"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+PLATFORM = "${MACHINE}"
+PLATFORM_ls1088ardb-pb = "ls1088ardb"
+PLATFORM_ADDITIONAL_TARGET ??= ""
+PLATFORM_ADDITIONAL_TARGET_ls1012afrwy = "ls1012afrwy_512mb"
+
+RCW_FOLDER ?= "${MACHINE}"
+RCW_FOLDER_ls1088ardb-pb = "ls1088ardb"
+
+# requires CROSS_COMPILE set by hand as there is no configure script
+export CROSS_COMPILE="${TARGET_PREFIX}"
+export ARCH="arm64"
+
+# Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is
+# a standalone application
+CFLAGS[unexport] = "1"
+LDFLAGS[unexport] = "1"
+AS[unexport] = "1"
+LD[unexport] = "1"
+
+EXTRA_OEMAKE += "HOSTCC='${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}'"
+
+BOOTTYPE ?= "nor nand qspi flexspi_nor sd emmc"
+OTABOOTTYPE ?= "nor qspi flexspi_nor"
+BUILD_SECURE = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'true', 'false', d)}"
+BUILD_OPTEE = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', 'true', 'false', d)}"
+BUILD_FUSE = "${@bb.utils.contains('DISTRO_FEATURES', 'fuse', 'true', 'false', d)}"
+BUILD_OTA = "${@bb.utils.contains('DISTRO_FEATURES', 'ota', 'true', 'false', d)}"
+
+PACKAGECONFIG ??= " \
+ ${@bb.utils.filter('COMBINED_FEATURES', 'optee', d)} \
+"
+PACKAGECONFIG[optee] = ",,optee-os-qoriq"
+
+uboot_boot_sec ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa-secure-boot"
+uboot_boot ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa"
+rcw ?= ""
+rcw_ls1012afrwy = "_default"
+rcw_ls1012ardb = "_default"
+rcwsec ?= "_sben"
+
+chassistype ?= "ls2088_1088"
+chassistype_ls1012ardb = "ls104x_1012"
+chassistype_ls1012afrwy = "ls104x_1012"
+chassistype_ls1043ardb = "ls104x_1012"
+chassistype_ls1046ardb = "ls104x_1012"
+chassistype_ls1046afrwy = "ls104x_1012"
+
+ddrphyopt ?= ""
+ddrphyopt_lx2160ardb = "fip_ddr_sec"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+ export LIBPATH="${RECIPE_SYSROOT_NATIVE}"
+ install -d ${S}/include/tools_share/openssl
+ cp -r ${RECIPE_SYSROOT}/usr/include/openssl/* ${S}/include/tools_share/openssl
+ if [ ! -f ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pri ]; then
+ ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_keys 1024
+ else
+ cp ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pri ${S}
+ cp ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pub ${S}
+ fi
+
+ if [ "${BUILD_FUSE}" = "true" ]; then
+ ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_fusescr ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/input_files/gen_fusescr/${chassistype}/input_fuse_file
+ fuseopt="fip_fuse FUSE_PROG=1 FUSE_PROV_FILE=fuse_scr.bin"
+ fi
+ if [ "${BUILD_SECURE}" = "true" ]; then
+ secureopt="TRUSTED_BOARD_BOOT=1 ${ddrphyopt} CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst"
+ secext="_sec"
+ bl33="${uboot_boot_sec}"
+ if [ ${chassistype} = ls104x_1012 ]; then
+ rcwtemp="${rcwsec}"
+ else
+ rcwtemp="${rcw}"
+ fi
+ else
+ bl33="${uboot_boot}"
+ rcwtemp="${rcw}"
+ fi
+
+ if [ "${BUILD_OPTEE}" = "true" ]; then
+ bl32="${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin"
+ bl32opt="BL32=${bl32}"
+ spdopt="SPD=opteed"
+ fi
+
+ if [ "${BUILD_OTA}" = "true" ]; then
+ otaopt="POLICY_OTA=1"
+ btype="${OTABOOTTYPE}"
+ else
+ btype="${BOOTTYPE}"
+ fi
+
+ if [ -f ${DEPLOY_DIR_IMAGE}/ddr-phy/ddr4_pmu_train_dmem.bin ]; then
+ cp ${DEPLOY_DIR_IMAGE}/ddr-phy/*.bin ${S}/
+ fi
+
+ for d in ${btype}; do
+ case $d in
+ nor)
+ rcwimg="${RCWNOR}${rcwtemp}.bin"
+ uefiboot="${UEFI_NORBOOT}"
+ ;;
+ nand)
+ rcwimg="${RCWNAND}${rcwtemp}.bin"
+ ;;
+ qspi)
+ rcwimg="${RCWQSPI}${rcwtemp}.bin"
+ uefiboot="${UEFI_QSPIBOOT}"
+ if [ "${BUILD_SECURE}" = "true" ] && [ ${MACHINE} = ls1046ardb ]; then
+ rcwimg="RR_FFSSPPPH_1133_5559/rcw_1600_qspiboot_sben.bin"
+ fi
+ ;;
+ auto)
+ rcwimg="${RCWAUTO}${rcwtemp}.bin"
+ ;;
+ sd)
+ rcwimg="${RCWSD}${rcwtemp}.bin"
+ ;;
+ emmc)
+ rcwimg="${RCWEMMC}${rcwtemp}.bin"
+ ;;
+ flexspi_nor)
+ rcwimg="${RCWXSPI}${rcwtemp}.bin"
+ uefiboot="${UEFI_XSPIBOOT}"
+ ;;
+ esac
+
+ if [ -f "${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg}" ]; then
+ oe_runmake V=1 -C ${S} realclean
+ oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt}
+ cp -r ${S}/build/${PLATFORM}/release/bl2_${d}*.pbl ${S}
+ cp -r ${S}/build/${PLATFORM}/release/fip.bin ${S}
+ if [ "${BUILD_FUSE}" = "true" ]; then
+ cp -f ${S}/build/${PLATFORM}/release/fuse_fip.bin ${S}
+ fi
+
+ if [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then
+ oe_runmake V=1 -C ${S} realclean
+ oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM_ADDITIONAL_TARGET} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt}
+ cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/bl2_qspi${secext}.pbl ${S}/bl2_${d}${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl
+ cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/fip.bin ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin
+ if [ "${BUILD_FUSE}" = "true" ]; then
+ cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/fuse_fip.bin ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin
+ fi
+ fi
+ if [ -n "${uefiboot}" -a -f "${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot}" ]; then
+ oe_runmake V=1 -C ${S} realclean
+ oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt}
+ cp -r ${S}/build/${PLATFORM}/release/fip.bin ${S}/fip_uefi.bin
+ fi
+ fi
+ rcwimg=""
+ uefiboot=""
+ done
+}
+
+do_install() {
+ install -d ${D}/boot/atf
+ cp -r ${S}/srk.pri ${D}/boot/atf
+ cp -r ${S}/srk.pub ${D}/boot/atf
+ if [ "${BUILD_SECURE}" = "true" ]; then
+ secext="_sec"
+ fi
+ if [ -f "${S}/fip_uefi.bin" ]; then
+ cp -r ${S}/fip_uefi.bin ${D}/boot/atf/fip_uefi.bin
+ fi
+ if [ -f "${S}/fuse_fip.bin" ]; then
+ cp -r ${S}/fuse_fip.bin ${D}/boot/atf/fuse_fip.bin
+ fi
+ if [ -f "${S}/fip.bin" ]; then
+ cp -r ${S}/fip.bin ${D}/boot/atf/fip.bin
+ fi
+ for d in ${BOOTTYPE}; do
+ if [ -e ${S}/bl2_${d}${secext}.pbl ]; then
+ cp -r ${S}/bl2_${d}${secext}.pbl ${D}/boot/atf/bl2_${d}${secext}.pbl
+ fi
+ done
+ if [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then
+ cp -r ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fip_${PLATFORM_ADDITIONAL_TARGET}.bin
+ cp -r ${S}/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl ${D}/boot/atf/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl
+ if [ -f "${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin" ]; then
+ cp -r ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin
+ fi
+ fi
+ chown -R root:root ${D}
+ if [ -f "${S}/fip_ddr_sec.bin" ]; then
+ cp -r ${S}/fip_ddr_sec.bin ${D}/boot/atf/fip_ddr_sec.bin
+ fi
+}
+
+do_deploy() {
+ install -d ${DEPLOYDIR}/atf
+ cp -r ${D}/boot/atf/srk.pri ${DEPLOYDIR}/atf
+ cp -r ${D}/boot/atf/srk.pub ${DEPLOYDIR}/atf
+ if [ "${BUILD_SECURE}" = "true" ]; then
+ secext="_sec"
+ fi
+
+ if [ -f "${S}/fuse_fip.bin" ]; then
+ cp -r ${D}/boot/atf/fuse_fip.bin ${DEPLOYDIR}/atf/fuse_fip${secext}.bin
+ fi
+
+ if [ -e ${D}/boot/atf/fip_uefi.bin ]; then
+ cp -r ${D}/boot/atf/fip_uefi.bin ${DEPLOYDIR}/atf/fip_uefi.bin
+ fi
+ cp -r ${D}/boot/atf/fip.bin ${DEPLOYDIR}/atf/fip_uboot${secext}.bin
+ for d in ${BOOTTYPE}; do
+ if [ -e ${D}/boot/atf/bl2_${d}${secext}.pbl ]; then
+ cp -r ${D}/boot/atf/bl2_${d}${secext}.pbl ${DEPLOYDIR}/atf/bl2_${d}${secext}.pbl
+ fi
+ done
+ if [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then
+ cp -r ${S}/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl ${DEPLOYDIR}/atf/
+ cp -r ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${DEPLOYDIR}/atf/fip_uboot${secext}_${PLATFORM_ADDITIONAL_TARGET}.bin
+ if [ -f "${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin" ]; then
+ cp -r ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}${secext}.bin
+ fi
+ fi
+ if [ -f "${S}/fip_ddr_sec.bin" ]; then
+ cp -r ${D}/boot/atf/fip_ddr_sec.bin ${DEPLOYDIR}/atf/fip_ddr_sec.bin
+ fi
+}
+addtask deploy after do_install
+FILES_${PN} += "/boot"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/bsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess.bb b/bsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess.bb
deleted file mode 100644
index 570ee3f6..00000000
--- a/bsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-DESCRIPTION = "provides the tcl script for endian swap"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-SRC_URI = "file://byte_swap.tcl"
-
-S = "${WORKDIR}"
-
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-
-do_install () {
- install -d ${D}/${bindir}
- install -m 755 ${WORKDIR}/byte_swap.tcl ${D}/${bindir}
-}
-
-RDEPENDS_${PN} += "tcl"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/bsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl b/bsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
deleted file mode 100755
index c6222022..00000000
--- a/bsp/meta-freescale/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
+++ /dev/null
@@ -1,40 +0,0 @@
-puts $argv
-set i_file [lindex $argv 0]
-set o_file [lindex $argv 1]
-set num_b [lindex $argv 2]
-puts ""
-
-set fileid_i [open $i_file "r"]
-set fileid_o [open $o_file "w+"]
-fconfigure $fileid_i -translation {binary binary}
-fconfigure $fileid_o -translation {binary binary}
-
-set old_bin [read $fileid_i]
-set new_bin {}
-set old_length [string length $old_bin]
-set old_rem [expr $old_length % $num_b]
-if {$old_rem != 0} {
- for {set i 0} {$i< [expr $num_b - $old_rem]} {incr i 1} {
- append old_bin y
- }
-}
-for {set i 0} {$i<[expr $old_length-8]} {incr i $num_b} {
- for {set j $num_b} {$j>0} {incr j -1} {
- append new_bin [string index $old_bin [expr $i+($j-1)]]
- }
-}
-
-for {set j 0} {$j<8} {incr j 1} {
- append new_bin [string index $old_bin [expr $i+$j]]
-}
-
-for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
- set binValue [string range $old_bin [expr $i+0] [expr $i+($num_b-1)]]
- binary scan $binValue H[expr $num_b*2] hexValue
-
- set binValue [string range $new_bin [expr $i+0] [expr $i+($num_b-1)]]
- binary scan $binValue H[expr $num_b*2] hexValue
-}
-
-puts -nonewline $fileid_o $new_bin
-close $fileid_o
diff --git a/bsp/meta-freescale/recipes-bsp/ddr-phy/ddr-phy_git.bb b/bsp/meta-freescale/recipes-bsp/ddr-phy/ddr-phy_git.bb
index ebd68c26..31f6c101 100644
--- a/bsp/meta-freescale/recipes-bsp/ddr-phy/ddr-phy_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/ddr-phy/ddr-phy_git.bb
@@ -2,23 +2,38 @@ SUMMARY = "DDR firmware repository"
LICENSE = "NXP-Binary-EULA"
LIC_FILES_CHKSUM = "file://NXP-Binary-EULA.txt;md5=89cc852481956e861228286ac7430d74"
-inherit deploy fsl-eula-unpack
+inherit deploy
-SRC_URI = "git://github.com/nxp/ddr-phy-binary.git;fsl-eula=true;nobranch=1"
-SRCREV = "14d03e6e748ed5ebb9440f264bb374f1280b061c"
+SRC_URI = "git://github.com/nxp/ddr-phy-binary.git;nobranch=1"
+SRCREV = "fbc036b88acb6c06ffed02c898cbae9856ec75ba"
S = "${WORKDIR}/git"
REGLEX_lx2160a = "lx2160a"
+DEPENDS += "atf-tools-native"
+
+do_compile() {
+ cd ${S}/${REGLEX}
+ fiptool create --ddr-immem-udimm-1d ddr4_pmu_train_imem.bin \
+ --ddr-immem-udimm-2d ddr4_2d_pmu_train_imem.bin \
+ --ddr-dmmem-udimm-1d ddr4_pmu_train_dmem.bin \
+ --ddr-dmmem-udimm-2d ddr4_2d_pmu_train_dmem.bin \
+ --ddr-immem-rdimm-1d ddr4_rdimm_pmu_train_imem.bin \
+ --ddr-immem-rdimm-2d ddr4_rdimm2d_pmu_train_imem.bin \
+ --ddr-dmmem-rdimm-1d ddr4_rdimm_pmu_train_dmem.bin \
+ --ddr-dmmem-rdimm-2d ddr4_rdimm2d_pmu_train_dmem.bin \
+ fip_ddr_all.bin
+}
+
do_install () {
install -d ${D}/boot
- install -m 755 ${S}/${REGLEX}/* ${D}/boot
+ install -m 755 ${S}/${REGLEX}/*.bin ${D}/boot
}
do_deploy () {
install -d ${DEPLOYDIR}/ddr-phy
- install -m 755 ${S}/${REGLEX}/* ${DEPLOYDIR}/ddr-phy
+ install -m 755 ${S}/${REGLEX}/*.bin ${DEPLOYDIR}/ddr-phy
}
addtask deploy before do_populate_sysroot after do_install
diff --git a/bsp/meta-freescale/recipes-bsp/dp-firmware-cadence/dp-firmware-cadence_20.04.bb b/bsp/meta-freescale/recipes-bsp/dp-firmware-cadence/dp-firmware-cadence_20.04.bb
new file mode 100644
index 00000000..e8db5456
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/dp-firmware-cadence/dp-firmware-cadence_20.04.bb
@@ -0,0 +1,30 @@
+SUMMARY = "DP firmware"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://COPYING;md5=228c72f2a91452b8a03c4cab30f30ef9"
+
+inherit deploy fsl-eula-unpack
+
+SRC_URI = "https://www.nxp.com/lgfiles/sdk/lsdk2004/firmware-cadence-lsdk2004.bin;fsl-eula=true"
+
+SRC_URI[md5sum] = "d7eb8ef87cae8e4a205c266b3ac6f330"
+SRC_URI[sha256sum] = "bef89a3eceed95e90748a2301d6f6ffbdf1a72237c0045093cb9485b05eb8fbd"
+
+S = "${WORKDIR}/firmware-cadence-lsdk2004"
+
+do_install () {
+ install -d ${D}/boot
+ cp -fr ${S}/dp/*.bin ${D}/boot
+}
+
+do_deploy () {
+ install -d ${DEPLOYDIR}/dp
+ cp -fr ${S}/dp/*.bin ${DEPLOYDIR}/dp
+}
+addtask deploy before do_build after do_install
+
+PACKAGES += "${PN}-image"
+FILES_${PN}-image += "/boot"
+
+COMPATIBLE_MACHINE = "(qoriq-arm64)"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-7.8.inc b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8.5.inc
index 6da6736c..ae6b1d78 100644
--- a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-7.8.inc
+++ b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8.5.inc
@@ -1,17 +1,17 @@
# Copyright (C) 2012-2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
+# Copyright 2017-2019 NXP
# Copyright (C) 2018 O.S. Systems Software LTDA.
SECTION = "base"
LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6c12031a11b81db21cdfe0be88cac4b3"
SRCBRANCH ?= "master"
SRC_URI = " \
${FSL_MIRROR}/firmware-imx-${PV}.bin;fsl-eula=true \
"
-SRC_URI[md5sum] = "0967aa59b3fd8d80fcb98146a9aac91b"
-SRC_URI[sha256sum] = "910fbf866f61185adfd60c1704b2da41030cb175901d06e40402b49f9240bdee"
+SRC_URI[md5sum] = "a6b926d087e1e642580da8a6d982abe6"
+SRC_URI[sha256sum] = "45b0a7392e7a4b2e6c7e1cb988dd660ff3f8cd465afdf796ff840a00db08389d"
S = "${WORKDIR}/firmware-imx-${PV}"
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8_7.8.bb b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8_8.5.bb
index d99aa41b..64fa2885 100644
--- a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8_7.8.bb
+++ b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8_8.5.bb
@@ -13,8 +13,6 @@ do_deploy() {
install -m 0644 ${S}/firmware/hdmi/cadence/hdmitxfw.bin ${DEPLOYDIR}
install -m 0644 ${S}/firmware/hdmi/cadence/hdmirxfw.bin ${DEPLOYDIR}
install -m 0644 ${S}/firmware/hdmi/cadence/dpfw.bin ${DEPLOYDIR}
- # SECO
- install -m 0644 ${S}/firmware/seco/mx8qm-ahab-container.img ${DEPLOYDIR}
}
addtask deploy after do_install before do_build
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8m_7.8.bb b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8m_8.5.bb
index a605d226..a605d226 100644
--- a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8m_7.8.bb
+++ b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8m_8.5.bb
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8x_7.8.bb b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8x_7.8.bb
deleted file mode 100644
index 85d394a0..00000000
--- a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx-8x_7.8.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2018 NXP
-SUMMARY = "Freescale i.MX firmware for 8X family"
-DESCRIPTION = "Freescale i.MX firmware for 8X family"
-
-require firmware-imx-${PV}.inc
-
-inherit deploy
-
-do_install[noexec] = "1"
-
-do_deploy() {
- # SECO
- install -m 0644 ${S}/firmware/seco/mx8qx-ahab-container.img ${DEPLOYDIR}
-}
-
-addtask deploy after do_install before do_build
-
-PACKAGE_ARCH = "${MACHINE_SOCARCH}"
-
-COMPATIBLE_MACHINE = "(mx8x)"
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx_7.8.bb b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx_8.5.bb
index bf0fbc3f..ff623057 100644
--- a/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx_7.8.bb
+++ b/bsp/meta-freescale/recipes-bsp/firmware-imx/firmware-imx_8.5.bb
@@ -1,5 +1,5 @@
# Copyright (C) 2012-2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
+# Copyright 2017-2019 NXP
# Copyright (C) 2018 O.S. Systems Software LTDA.
SUMMARY = "Freescale i.MX firmware"
DESCRIPTION = "Freescale i.MX firmware such as for the VPU"
@@ -17,12 +17,13 @@ inherit allarch
do_install() {
install -d ${D}${base_libdir}/firmware/imx
- install -d ${D}${base_libdir}/firmware/bcm
- install -d ${D}${sysconfdir}/firmware
cd firmware
for d in *; do
case $d in
+ easrc)
+ # excluding as only applies Nano SoC
+ ;;
ddr|hdmi|seco)
# These folders are for i.MX 8 and are included in the boot image via imx-boot
bbnote Excluding folder $d
@@ -34,39 +35,6 @@ do_install() {
done
cd -
- #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/
-
- #1CX_BCM4356
- install -d ${D}${base_libdir}/firmware/bcm/1CX_BCM4356
- cp -rfv git/brcm/1CX_BCM4356/fw_bcmdhd.bin ${D}${base_libdir}/firmware/bcm/1CX_BCM4356
-
- #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/
-
- #1FD_BCM89359
- install -d ${D}${base_libdir}/firmware/bcm/1FD_BCM89359
- cp -rfv git/brcm/1FD_BCM89359/*.bin ${D}${base_libdir}/firmware/bcm/1FD_BCM89359
- cp -rfv git/brcm/1FD_BCM89359/*.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
@@ -74,6 +42,8 @@ do_install() {
find ${D}${base_libdir}/firmware -type f -exec chown root:root '{}' ';'
# Remove files not going to be installed
+ rm ${D}${base_libdir}/firmware/sdma/sdma-imx6q.bin
+ rm ${D}${base_libdir}/firmware/sdma/sdma-imx7d.bin
find ${D}${base_libdir}/firmware/ -name '*.mk' -exec rm '{}' ';'
}
@@ -97,10 +67,10 @@ ALLOW_EMPTY_${PN} = "1"
PACKAGES_DYNAMIC = "${PN}-vpu-* ${PN}-sdma-*"
-PACKAGES =+ "${PN}-epdc ${PN}-brcm ${PN}-scfw"
+PACKAGES =+ "${PN}-epdc ${PN}-scfw ${PN}-sdma"
FILES_${PN}-epdc = "${base_libdir}/firmware/imx/epdc/"
-FILES_${PN}-brcm = "${base_libdir}/firmware/bcm/*/*.bin ${base_libdir}/firmware/bcm/*/*.cal ${sysconfdir}/firmware/"
FILES_${PN}-scfw = "${base_libdir}/firmware/scfw/"
+FILES_${PN}-sdma = " ${base_libdir}/firmware/imx/sdma"
-COMPATIBLE_MACHINE = "(imx)"
+COMPATIBLE_MACHINE = "(imx|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca.inc b/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca.inc
new file mode 100644
index 00000000..bafd0ea8
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca.inc
@@ -0,0 +1,15 @@
+# Copyright 2018-2019 NXP
+
+SUMMARY = "Qualcomm Wi-Fi and Bluetooth firmware"
+SECTION = "base"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6c12031a11b81db21cdfe0be88cac4b3 \
+ file://QUALCOMM_ATHEROS_LICENSE_AGREEMENT.pdf;md5=e629669cf17f6a2a6872e067582986e3 \
+"
+
+SRC_URI = " ${FSL_MIRROR}/firmware-qca-${PV}.bin;fsl-eula=true"
+SRC_URI[md5sum] = "3569cb11300758635d2502322c5bf206"
+SRC_URI[sha256sum] = "ae75308d59390e926244ad2594248c3c835ee780e94e4a92ac536429cccd286b"
+S = "${WORKDIR}/firmware-qca-${PV}"
+
+inherit fsl-eula-unpack
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca6174_3.0.1.bb b/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca6174_3.0.1.bb
new file mode 100644
index 00000000..fd0e24f0
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca6174_3.0.1.bb
@@ -0,0 +1,27 @@
+# Copyright 2019 NXP
+
+require firmware-qca.inc
+
+SUMMARY = "Qualcomm Wi-Fi and Bluetooth firmware"
+DESCRIPTION = "Qualcomm Wi-Fi and Bluetooth firmware for modules such as QCA6174A"
+SECTION = "base"
+LICENSE = "Proprietary"
+
+inherit allarch
+
+do_install () {
+ # Install firmware.conf for QCA modules
+ install -d ${D}${sysconfdir}/bluetooth
+ install -m 644 ${S}/1CQ_QCA6174A_LEA_2.0/etc/bluetooth/firmware.conf ${D}${sysconfdir}/bluetooth
+
+ # Install firmware files
+ install -d ${D}${base_libdir}
+ cp -r ${S}/1CQ_QCA6174A_LEA_2.0/lib/firmware ${D}${base_libdir}
+}
+
+FILES_${PN} = " \
+ ${sysconfdir}/bluetooth/firmware.conf \
+ ${base_libdir}/firmware/qca6174 \
+ ${base_libdir}/firmware/wlan \
+ ${base_libdir}/firmware/* \
+"
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca9377_3.0.1.bb b/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca9377_3.0.1.bb
new file mode 100644
index 00000000..a1d6b0f1
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/firmware-qca/firmware-qca9377_3.0.1.bb
@@ -0,0 +1,27 @@
+# Copyright 2018-2019 NXP
+
+require firmware-qca.inc
+
+SUMMARY = "Qualcomm Wi-Fi and Bluetooth firmware"
+DESCRIPTION = "Qualcomm Wi-Fi and Bluetooth firmware for modules such as QCA9377-3"
+SECTION = "base"
+LICENSE = "Proprietary"
+
+inherit allarch
+
+do_install () {
+ # Install firmware.conf for QCA modules
+ install -d ${D}${sysconfdir}/bluetooth
+ install -m 644 ${S}/1PJ_QCA9377-3_LEA_3.0/etc/bluetooth/firmware.conf ${D}${sysconfdir}/bluetooth
+
+ # Install firmware files
+ install -d ${D}${base_libdir}
+ cp -r ${S}/1PJ_QCA9377-3_LEA_3.0/lib/firmware ${D}${base_libdir}
+}
+
+FILES_${PN} = " \
+ ${sysconfdir}/bluetooth/firmware.conf \
+ ${base_libdir}/firmware/qca \
+ ${base_libdir}/firmware/qca9377 \
+ ${base_libdir}/firmware/wlan \
+"
diff --git a/bsp/meta-freescale/recipes-bsp/firmware-qca/qca-tools_3.0.1.bb b/bsp/meta-freescale/recipes-bsp/firmware-qca/qca-tools_3.0.1.bb
new file mode 100644
index 00000000..b7bf0dff
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/firmware-qca/qca-tools_3.0.1.bb
@@ -0,0 +1,20 @@
+# Copyright 2018 NXP
+
+require firmware-qca.inc
+
+SUMMARY = "Qualcomm Wi-Fi and Bluetooth tools"
+DESCRIPTION = "Qualcomm Wi-Fi and Bluetooth tools for modules such as QCA6174A and QCA9377"
+LICENSE = "Proprietary"
+
+DEPENDS = "libnl zlib"
+
+FCC_TOOLS_FOLDER ?= "qca9377_qca6174_arm32"
+FCC_TOOLS_FOLDER_aarch64 = "qca9377_qca6174_arm64"
+
+do_install() {
+ install -d ${D}${sbindir}/fcc_tools
+ cp -r ${S}/fcc_tools/${FCC_TOOLS_FOLDER} ${D}${sbindir}/fcc_tools
+}
+
+COMPATIBLE_HOST = '(aarch64|arm).*-linux'
+COMPATIBLE_HOST_libc-musl = 'null'
diff --git a/bsp/meta-freescale/recipes-bsp/fsl-tlu/fsl-tlu_1.0.0.bb b/bsp/meta-freescale/recipes-bsp/fsl-tlu/fsl-tlu_1.0.0.bb
index 131bda55..60598ae5 100644
--- a/bsp/meta-freescale/recipes-bsp/fsl-tlu/fsl-tlu_1.0.0.bb
+++ b/bsp/meta-freescale/recipes-bsp/fsl-tlu/fsl-tlu_1.0.0.bb
@@ -5,7 +5,7 @@ and configuration files."
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=8a71d0475d08eee76d8b6d0c6dbec543"
-SRC_URI = "git://git.freescale.com/ppc/sdk/fsl-tlu.git;branch=master"
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-yocto-sdk/fsl-tlu;protocol=https;nobranch=1"
SRCREV = "8837cce3c86b30c0931c319e9e1a8ca622ae5354"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-bsp/imx-atf/imx-atf_1.5.0.bb b/bsp/meta-freescale/recipes-bsp/imx-atf/imx-atf_2.0.bb
index 9d402dba..33ed6c62 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-atf/imx-atf_1.5.0.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-atf/imx-atf_2.0.bb
@@ -1,17 +1,17 @@
-# Copyright 2017-2018 NXP
+# Copyright (C) 2017-2019 NXP
DESCRIPTION = "i.MX ARM Trusted Firmware"
SECTION = "BSP"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9"
-PV = "1.5.0+git${SRCPV}"
+PV .= "+git${SRCPV}"
-SRCBRANCH = "imx_4.9.123_imx8mm_ga"
+SRCBRANCH = "lf-5.4.y"
SRC_URI = "git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https;branch=${SRCBRANCH} \
file://0001-Allow-BUILD_STRING-to-be-set-in-.revision-file.patch \
"
-SRCREV = "af3554fc6ea8c17710ffd37a14a25834fad19271"
+SRCREV = "7b3389d49815f1e3f7942bd312a27ee665bd2e33"
S = "${WORKDIR}/git"
@@ -21,25 +21,35 @@ BOOT_TOOLS = "imx-boot-tools"
PLATFORM ?= "INVALID"
PLATFORM_mx8qm = "imx8qm"
-PLATFORM_mx8qxp = "imx8qxp"
+PLATFORM_mx8qxp = "imx8qx"
PLATFORM_mx8mq = "imx8mq"
PLATFORM_mx8mm = "imx8mm"
+PLATFORM_mx8mn = "imx8mn"
EXTRA_OEMAKE += " \
CROSS_COMPILE="${TARGET_PREFIX}" \
PLAT=${PLATFORM} \
"
+BUILD_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}"
+
do_compile() {
# Clear LDFLAGS to avoid the option -Wl recognize issue
unset LDFLAGS
oe_runmake bl31
+ if ${BUILD_OPTEE}; then
+ oe_runmake clean BUILD_BASE=build-optee
+ oe_runmake BUILD_BASE=build-optee SPD=opteed bl31
+ fi
}
do_install[noexec] = "1"
do_deploy() {
install -Dm 0644 ${S}/build/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${PLATFORM}.bin
+ if ${BUILD_OPTEE}; then
+ install -m 0644 ${S}/build-optee/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${PLATFORM}.bin-optee
+ fi
}
addtask deploy after do_compile
diff --git a/bsp/meta-freescale/recipes-bsp/imx-kobs/imx-kobs_git.bb b/bsp/meta-freescale/recipes-bsp/imx-kobs/imx-kobs_git.bb
index 60fcc25d..b104fafd 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-kobs/imx-kobs_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-kobs/imx-kobs_git.bb
@@ -1,5 +1,5 @@
# Copyright (C) 2013-2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
+# Copyright (C) 2017-2019 NXP
# Copyright 2018 (C) O.S. Systems Software LTDA.
SUMMARY = "Nand boot write source"
@@ -9,11 +9,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
PV = "5.5+git${SRCPV}"
SRC_URI = "git://github.com/NXPmicro/imx-kobs.git;protocol=https \
- file://0001-Add-missing-includes-as-pointed-out-by-musl.patch \
"
-SRCREV = "a0e9adce2fb7fcd57e794d7f9a5deba0f94f521b"
+SRCREV = "cee66d0e956a64d03cc866fa8819da5b798c7f1b"
S = "${WORKDIR}/git"
inherit autotools pkgconfig
-COMPATIBLE_MACHINE = "(imx)"
+COMPATIBLE_MACHINE = "(imx|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-boot_0.2.bb b/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-boot_0.2.bb
index 32d5aa28..0f13a08b 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-boot_0.2.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-boot_0.2.bb
@@ -1,4 +1,4 @@
-# Copyright 2017-2018 NXP
+# Copyright 2017-2019 NXP
require imx-mkimage_git.inc
@@ -7,14 +7,15 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
SECTION = "BSP"
-IMX_EXTRA_FIRMWARE = "firmware-imx-8 imx-sc-firmware"
+IMX_EXTRA_FIRMWARE = "firmware-imx-8 imx-sc-firmware imx-seco"
IMX_EXTRA_FIRMWARE_mx8m = "firmware-imx-8m"
-IMX_EXTRA_FIRMWARE_mx8x = "firmware-imx-8x imx-sc-firmware"
+IMX_EXTRA_FIRMWARE_mx8x = "imx-sc-firmware imx-seco"
DEPENDS += " \
- u-boot \
firmware-imx \
${IMX_EXTRA_FIRMWARE} \
imx-atf \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'optee-os', '', d)} \
+ u-boot-mkimage-native \
"
DEPENDS_append_mx8m = " dtc-native"
BOOT_NAME = "imx-boot"
@@ -31,20 +32,18 @@ do_compile[depends] += " \
virtual/bootloader:do_deploy \
${@' '.join('%s:do_deploy' % r for r in '${IMX_EXTRA_FIRMWARE}'.split() )} \
imx-atf:do_deploy \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'optee-os:do_deploy', '', d)} \
"
SC_FIRMWARE_NAME ?= "scfw_tcm.bin"
ATF_MACHINE_NAME ?= "bl31-imx8qm.bin"
ATF_MACHINE_NAME_mx8qm = "bl31-imx8qm.bin"
-ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qxp.bin"
+ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qx.bin"
ATF_MACHINE_NAME_mx8mq = "bl31-imx8mq.bin"
ATF_MACHINE_NAME_mx8mm = "bl31-imx8mm.bin"
-ATF_MACHINE_NAME_append = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', '-optee', '', d)}"
-
-DCD_NAME ?= "imx8qm_dcd.cfg.tmp"
-DCD_NAME_mx8qm = "imx8qm_dcd.cfg.tmp"
-DCD_NAME_mx8qxp = "imx8qx_dcd.cfg.tmp"
+ATF_MACHINE_NAME_mx8mn = "bl31-imx8mn.bin"
+ATF_MACHINE_NAME_append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', '-optee', '', d)}"
UBOOT_NAME = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}"
BOOT_CONFIG_MACHINE = "${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG}.bin"
@@ -56,22 +55,18 @@ SOC_TARGET_mx8qm = "iMX8QM"
SOC_TARGET_mx8qxp = "iMX8QX"
SOC_TARGET_mx8mq = "iMX8M"
SOC_TARGET_mx8mm = "iMX8MM"
+SOC_TARGET_mx8mn = "iMX8MN"
+
+DEPLOY_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}"
IMXBOOT_TARGETS ?= \
"${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \
bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \
'flash flash_dcd', d), d)}"
-IMXBOOT_TARGETS_mx8qxp = \
- "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \
- bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \
- 'flash', d), d)}"
-IMXBOOT_TARGETS_mx8qxpa0 = \
- "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi_a0', \
- bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand_a0', \
- 'flash_a0 flash_dcd_a0', d), d)}"
BOOT_STAGING = "${S}/${SOC_TARGET}"
BOOT_STAGING_mx8mm = "${S}/iMX8M"
+BOOT_STAGING_mx8mn = "${S}/iMX8M"
SOC_FAMILY = "INVALID"
SOC_FAMILY_mx8 = "mx8"
@@ -79,16 +74,19 @@ SOC_FAMILY_mx8m = "mx8m"
SOC_FAMILY_mx8x = "mx8x"
compile_mx8m() {
- bbnote 8MQ/8MM boot binary build
+ bbnote 8MQ/8MM/8MN boot binary build
for ddr_firmware in ${DDR_FIRMWARE_NAME}; do
bbnote "Copy ddr_firmware: ${ddr_firmware} from ${DEPLOY_DIR_IMAGE} -> ${BOOT_STAGING} "
cp ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${BOOT_STAGING}
done
- cp ${DEPLOY_DIR_IMAGE}/signed_*_imx8m.bin ${BOOT_STAGING}
- cp ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG} ${BOOT_STAGING}/u-boot-spl.bin
+ cp ${DEPLOY_DIR_IMAGE}/signed_dp_imx8m.bin ${BOOT_STAGING}
+ cp ${DEPLOY_DIR_IMAGE}/signed_hdmi_imx8m.bin ${BOOT_STAGING}
+ cp ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG} \
+ ${BOOT_STAGING}/u-boot-spl.bin
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${UBOOT_DTB_NAME} ${BOOT_STAGING}
- cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-nodtb.bin ${BOOT_STAGING}
- cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/mkimage_uboot ${BOOT_STAGING}
+ cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${UBOOT_CONFIG} \
+ ${BOOT_STAGING}/u-boot-nodtb.bin
+ cp ${STAGING_DIR_NATIVE}/${bindir}/mkimage ${BOOT_STAGING}/mkimage_uboot
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${ATF_MACHINE_NAME} ${BOOT_STAGING}/bl31.bin
cp ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${BOOT_STAGING}/u-boot.bin
}
@@ -107,8 +105,13 @@ compile_mx8x() {
cp ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${BOOT_STAGING}/u-boot.bin
}
do_compile() {
+ # mkimage_uboot requires libssl.so.1.1 from ${STAGING_LIBDIR_NATIVE}
+ export LD_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE}:$LD_LIBRARY_PATH
compile_${SOC_FAMILY}
# mkimage for i.MX8
+ if ${DEPLOY_OPTEE}; then
+ cp ${DEPLOY_DIR_IMAGE}/tee.bin ${BOOT_STAGING}
+ fi
for target in ${IMXBOOT_TARGETS}; do
bbnote "building ${SOC_TARGET} - ${target}"
make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${target}
@@ -127,34 +130,38 @@ do_install () {
deploy_mx8m() {
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
- install -m 0644 ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG} ${DEPLOYDIR}/${BOOT_TOOLS}
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG} \
+ ${DEPLOYDIR}/${BOOT_TOOLS}
for ddr_firmware in ${DDR_FIRMWARE_NAME}; do
install -m 0644 ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${DEPLOYDIR}/${BOOT_TOOLS}
done
- install -m 0644 ${DEPLOY_DIR_IMAGE}/signed_hdmi*.bin ${DEPLOYDIR}/${BOOT_TOOLS}
+ install -m 0644 ${BOOT_STAGING}/signed_dp_imx8m.bin ${DEPLOYDIR}/${BOOT_TOOLS}
+ install -m 0644 ${BOOT_STAGING}/signed_hdmi_imx8m.bin ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0755 ${BOOT_STAGING}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0755 ${BOOT_STAGING}/mkimage_fit_atf.sh ${DEPLOYDIR}/${BOOT_TOOLS}
}
deploy_mx8() {
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
- install -m 0644 ${BOOT_STAGING}/${DCD_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0644 ${BOOT_STAGING}/mx8qm-ahab-container.img ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0755 ${S}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
}
deploy_mx8x() {
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
- if [ "${MACHINE}" = "imx8qxpa0mek" ]; then
- install -m 0644 ${BOOT_STAGING}/${DCD_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
- fi
install -m 0644 ${BOOT_STAGING}/mx8qx-ahab-container.img ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0755 ${S}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
}
do_deploy() {
deploy_${SOC_FAMILY}
# copy the tool mkimage to deploy path and sc fw, dcd and uboot
- install -m 0644 ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
+
+ # copy tee.bin to deploy path
+ if ${DEPLOY_OPTEE}; then
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/tee.bin ${DEPLOYDIR}/${BOOT_TOOLS}
+ fi
+
# copy makefile (soc.mak) for reference
- install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS}
+ install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS}
# copy the generated boot image to deploy path
for target in ${IMXBOOT_TARGETS}; do
# Use first "target" as IMAGE_IMXBOOT_TARGET
diff --git a/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-mkimage_git.inc b/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-mkimage_git.inc
index a8cd930b..6e417722 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-mkimage_git.inc
+++ b/bsp/meta-freescale/recipes-bsp/imx-mkimage/imx-mkimage_git.inc
@@ -1,10 +1,10 @@
-# Copyright 2017-2018 NXP
+# Copyright 2017-2019 NXP
DEPENDS = "zlib-native openssl-native"
-SRCBRANCH = "imx_4.9.123_imx8mm_ga"
+SRCBRANCH = "lf-5.4.y"
SRC_URI = "git://source.codeaurora.org/external/imx/imx-mkimage.git;protocol=https;branch=${SRCBRANCH}"
-SRCREV = "9e289f314eddb9d38cab73780b936acb30bb88b4"
+SRCREV = "1c2277b95ce59f5d0265f26fec522e2ac2581e59"
S = "${WORKDIR}/git"
BOOT_TOOLS = "imx-boot-tools"
diff --git a/bsp/meta-freescale/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.9.bb b/bsp/meta-freescale/recipes-bsp/imx-sc-firmware/imx-sc-firmware_1.2.7.1.bb
index 329d4dc1..3bf7024c 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.9.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-sc-firmware/imx-sc-firmware_1.2.7.1.bb
@@ -1,17 +1,17 @@
# Copyright (C) 2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
+# Copyright (C) 2017-2019 NXP
DESCRIPTION = "i.MX System Controller Firmware"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6c12031a11b81db21cdfe0be88cac4b3"
SECTION = "BSP"
inherit fsl-eula-unpack deploy
-SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
-SRC_URI[md5sum] = "3246a44a242b68fae601561a80d5925c"
-SRC_URI[sha256sum] = "00024e0dd332b402df03b62eac9a515fabc903568d0ad7f30fabc7c98b494f15"
+SRC_URI[md5sum] = "b9d81d0c4cb7871e62dfe7b26d203240"
+SRC_URI[sha256sum] = "5a28180217975f3d78fcfac15e46b0a942910fadf078e4af76deb6dc498136ed"
BOARD_TYPE ?= "mek"
SC_FIRMWARE_NAME ?= "mx8qm-mek-scfw-tcm.bin"
diff --git a/bsp/meta-freescale/recipes-bsp/imx-seco/imx-seco_2.3.1.bb b/bsp/meta-freescale/recipes-bsp/imx-seco/imx-seco_2.3.1.bb
new file mode 100644
index 00000000..b86ea0b6
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/imx-seco/imx-seco_2.3.1.bb
@@ -0,0 +1,30 @@
+# Copyright 2019 NXP
+
+SUMMARY = "NXP i.MX SECO firmware"
+DESCRIPTION = "NXP IMX SECO firmware"
+SECTION = "base"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fb0303e4ee8b0e71c094171e2272bd44"
+
+inherit fsl-eula-unpack deploy
+
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true "
+
+SRC_URI[md5sum] = "cf8d6bbf93f0aa6e1049f1098a0f7e0f"
+SRC_URI[sha256sum] = "b429ac58b2ea1771b3fdf7ae87bf1d37ccaf596bde01a5ecccae27b2145f6824"
+
+do_compile[noexec] = "1"
+
+do_install[noexec] = "1"
+
+SECO_FIRMWARE_NAME ?= "mx8qm-ahab-container.img"
+SECO_FIRMWARE_NAME_mx8qm = "mx8qm-ahab-container.img"
+SECO_FIRMWARE_NAME_mx8x = "mx8qx-ahab-container.img"
+
+addtask deploy after do_install
+do_deploy () {
+ # Deploy i.MX8 SECO firmware files
+ install -m 0644 ${S}/firmware/seco/${SECO_FIRMWARE_NAME} ${DEPLOYDIR}
+}
+
+COMPATIBLE_MACHINE = "(mx8qm|mx8x)"
diff --git a/bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-mxc_v4l2_test-fix-compilation-error-produced-by-gcc9.patch b/bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-mxc_v4l2_test-fix-compilation-error-produced-by-gcc9.patch
new file mode 100644
index 00000000..3fb9d4ef
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-mxc_v4l2_test-fix-compilation-error-produced-by-gcc9.patch
@@ -0,0 +1,39 @@
+From d2e35983281a811b38e540ab82e7643322e84aab Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+Date: Wed, 4 Dec 2019 14:17:50 +0000
+Subject: [PATCH] mxc_v4l2_test: fix compilation error produced by gcc9
+
+Fix trivial compilation error when GCC9 is used:
+
+error: call to '__open_missing_mode' declared with attribute error: open
+with O_CREAT or O_TMPFILE in second argument needs 3 arguments
+
+This is now caused by not explicitly supplying the mode when O_CREAT is
+used as disposition.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ test/mxc_v4l2_test/mx8_v4l2_cap_drm.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/test/mxc_v4l2_test/mx8_v4l2_cap_drm.c b/test/mxc_v4l2_test/mx8_v4l2_cap_drm.c
+index 6e10744..d63b2db 100644
+--- a/test/mxc_v4l2_test/mx8_v4l2_cap_drm.c
++++ b/test/mxc_v4l2_test/mx8_v4l2_cap_drm.c
+@@ -561,11 +561,7 @@ static int open_save_file(struct video_channel *video_ch)
+
+ for (i = 0; i < NUM_SENSORS; i++) {
+ if ((g_cam >> i) & 0x01) {
+-#ifdef BUILD_FOR_ANDROID
+ fd = open(video_ch[i].save_file_name, O_RDWR | O_CREAT, 0660);
+-#else
+- fd = open(video_ch[i].save_file_name, O_RDWR | O_CREAT);
+-#endif
+ if (fd < 0) {
+ v4l2_err("Channel[%d] unable to create recording file\n", i);
+ while (i)
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-test-Makefile-Add-include-path-to-CC-command.patch b/bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-test-Makefile-Add-include-path-to-CC-command.patch
deleted file mode 100644
index 8387a17c..00000000
--- a/bsp/meta-freescale/recipes-bsp/imx-test/imx-test/0001-test-Makefile-Add-include-path-to-CC-command.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From d289d905c64882c58e3b99f74f68e72f9100115e Mon Sep 17 00:00:00 2001
-From: Fabio Berton <fabio.berton@ossystems.com.br>
-Date: Tue, 12 Jun 2018 14:58:40 -0300
-Subject: [PATCH] test/Makefile: Add include path to CC command
-Organization: O.S. Systems Software LTDA.
-
-Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
----
- test/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/test/Makefile b/test/Makefile
-index f1cfa2a..4f14d2c 100644
---- a/test/Makefile
-+++ b/test/Makefile
-@@ -12,7 +12,7 @@ ALL_OBJS :=
-
- %.o: %.c
- @echo " CC $@"
-- $(Q)$(CC) -c $(CFLAGS) $< -o $@
-+ $(Q)$(CC) -c $(CFLAGS) $(INC) $< -o $@
-
-
- # This creates the build and copy rules for one executable. Because we
---
-2.17.1
-
diff --git a/bsp/meta-freescale/recipes-bsp/imx-test/imx-test_git.bb b/bsp/meta-freescale/recipes-bsp/imx-test/imx-test_git.bb
index bf55f7df..81bbd3a3 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-test/imx-test_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-test/imx-test_git.bb
@@ -1,6 +1,6 @@
-# Copyright (C) 2012-2018 O.S. Systems Software LTDA.
+# Copyright (C) 2012-2016 O.S. Systems Software LTDA.
# Copyright (C) 2013-2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
+# Copyright (C) 2017-2019 NXP
SUMMARY = "Test programs for i.MX BSP"
DESCRIPTION = "Unit tests for the i.MX BSP"
@@ -16,13 +16,13 @@ DEPENDS_append_imxvpu = " virtual/imxvpu"
PE = "1"
PV = "7.0+${SRCPV}"
-SRCBRANCH = "imx_4.9.123_imx8mm_ga"
+SRCBRANCH = "lf-5.4.y"
SRC_URI = " \
git://source.codeaurora.org/external/imx/imx-test.git;protocol=https;branch=${SRCBRANCH} \
- file://0001-test-Makefile-Add-include-path-to-CC-command.patch \
+ file://0001-mxc_v4l2_test-fix-compilation-error-produced-by-gcc9.patch \
file://memtool_profile \
"
-SRCREV = "2cc785f94e5ee8782083d941e6aef24952cc2a38"
+SRCREV = "6d20e84f2dbe5940fe6d629c2839e1390994ee1f"
S = "${WORKDIR}/git"
inherit module-base use-imx-headers
@@ -30,15 +30,15 @@ inherit module-base use-imx-headers
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-PLATFORM_mx6q = "IMX6Q"
-PLATFORM_mx6dl = "IMX6Q"
-PLATFORM_mx6sl = "IMX6SL"
+PLATFORM_mx6q = "IMX6Q"
+PLATFORM_mx6dl = "IMX6Q"
+PLATFORM_mx6sl = "IMX6SL"
PLATFORM_mx6sll = "IMX6SL"
-PLATFORM_mx6sx = "IMX6SX"
-PLATFORM_mx6ul = "IMX6UL"
-PLATFORM_mx7d = "IMX7D"
+PLATFORM_mx6sx = "IMX6SX"
+PLATFORM_mx6ul = "IMX6UL"
+PLATFORM_mx7d = "IMX7D"
PLATFORM_mx7ulp = "IMX7D"
-PLATFORM_mx8 = "IMX8"
+PLATFORM_mx8 = "IMX8"
PARALLEL_MAKE = "-j 1"
EXTRA_OEMAKE += "${PACKAGECONFIG_CONFARGS}"
@@ -49,9 +49,6 @@ PACKAGECONFIG_append_imxvpu = " vpu"
PACKAGECONFIG[x11] = ",,libx11 libxdamage libxrender libxrandr"
PACKAGECONFIG[vpu] = "HAS_VPU=true,HAS_VPU=false,virtual/imxvpu"
-# FIXME: NXP should fix the possible string flaws from their code.
-SECURITY_STRINGFORMAT = ""
-
do_compile() {
CFLAGS="${TOOLCHAIN_OPTIONS}"
oe_runmake V=1 VERBOSE='' \
@@ -82,5 +79,3 @@ FILES_${PN} += "/unit_tests /home/root/.profile"
RDEPENDS_${PN} = "bash"
FILES_${PN}-dbg += "/unit_tests/.debug"
-
-COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-bsp/imx-uuc/imx-uuc_git.bb b/bsp/meta-freescale/recipes-bsp/imx-uuc/imx-uuc_git.bb
index ddc55db3..9fe9614a 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-uuc/imx-uuc_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-uuc/imx-uuc_git.bb
@@ -1,20 +1,21 @@
# Copyright (C) 2016 Freescale Semiconductor
-
-SUMMARY = "A Daemon wait for Freescale/NXP mfgtools host's command"
+# Copyright (C) 2017-2019 NXP
+SUMMARY = "A Daemon wait for NXP mfgtools host's command"
SECTION = "base"
-DEPENDS = "dosfstools-native"
+DEPENDS = "virtual/kernel dosfstools-native"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
inherit autotools-brokensep
+PR = "r1"
PV = "0.5.1+git${SRCPV}"
SRC_URI = "git://github.com/NXPmicro/imx-uuc.git;protocol=https"
-SRCREV = "e3fbdfef978abd150d9ea71c4d174daded9c8d33"
+SRCREV = "ebb7d34853133d92eff9766e370ea21e6d6d8f2b"
S = "${WORKDIR}/git"
FILES_${PN} += "/linuxrc /fat"
-COMPATIBLE_MACHINE = "(imx)"
+COMPATIBLE_MACHINE = "(imx|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0001-Get-i.MX-custom-headers-from-usr-include-imx.patch b/bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0001-Get-i.MX-custom-headers-from-usr-include-imx.patch
deleted file mode 100644
index a41641df..00000000
--- a/bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro/0001-Get-i.MX-custom-headers-from-usr-include-imx.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a277191d6e7d775b1c081f8b25734f6f962ade14 Mon Sep 17 00:00:00 2001
-From: Tom Hochstein <tom.hochstein@nxp.com>
-Date: Thu, 4 Oct 2018 10:34:00 -0500
-Subject: [PATCH] Get i.MX custom headers from /usr/include/imx
-
-Upstream-Status: Pending
-
-Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
----
- Makefile_G1G2 | 5 ++---
- Makefile_H1 | 3 +--
- 2 files changed, 3 insertions(+), 5 deletions(-)
-
-diff --git a/Makefile_G1G2 b/Makefile_G1G2
-index caab40f..5b55a8b 100755
---- a/Makefile_G1G2
-+++ b/Makefile_G1G2
-@@ -6,12 +6,11 @@ SOURCE_ROOT = decoder_sw/software
- OMX_ROOT = openmax_il
-
- INCLUDE_HEADERS = -I./decoder_sw -I$(SOURCE_ROOT)/source/inc -I$(SOURCE_ROOT)/source/hevc \
-- -I$(SOURCE_ROOT)/source/config -I$(SOURCE_ROOT)/source/dwl -I$(SOURCE_ROOT)/source/common -I$(SOURCE_ROOT)/source/vp9 \
-- -I$(SDKTARGETSYSROOT)/usr/imx/include
-+ -I$(SOURCE_ROOT)/source/config -I$(SOURCE_ROOT)/source/dwl -I$(SOURCE_ROOT)/source/common -I$(SOURCE_ROOT)/source/vp9
-
- INCLUDE_HEADERS += -I$(SOURCE_ROOT)/linux/memalloc
- #INCLUDE_HEADERS += -I$(SOURCE_ROOT)/linux/ldriver
--INCLUDE_HEADERS += -I$(LINUX_KERNEL_ROOT)/include/uapi -I$(LINUX_KERNEL_ROOT)/include
-+INCLUDE_HEADERS += -I$(SDKTARGETSYSROOT)/usr/include/imx
-
- CFLAGS += -DDEC_MODULE_PATH=\"/dev/mxc_hantro\" -DUSE_FAKE_RFC_TABLE -DFIFO_DATATYPE=void* -DNDEBUG -DDOWN_SCALER \
- -DUSE_EXTERNAL_BUFFER -DUSE_FAST_EC -DUSE_VP9_EC -DGET_FREE_BUFFER_NON_BLOCK \
-diff --git a/Makefile_H1 b/Makefile_H1
-index 9ca1aa9..237f53a 100755
---- a/Makefile_H1
-+++ b/Makefile_H1
-@@ -17,8 +17,7 @@ ENV += -DMEMALLOC_MODULE_PATH=\\\"/dev/ion\\\"
- #ENV += -DSDRAM_LM_BASE=0x00000000
- ENV += -DEWL_NO_HW_TIMEOUT
- ENV += -DUSE_ION
--ENV += -I$(LINUX_KERNEL_ROOT)/include/uapi -I$(LINUX_KERNEL_ROOT)/include
--ENV += -I$(SDKTARGETSYSROOT)/usr/imx/include
-+ENV += -I$(SDKTARGETSYSROOT)/usr/include/imx
-
- LIBENCNAME = libcodec_enc
- LIBSENC = -L./ -lhantro_h1 -lpthread
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb b/bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.16.0.bb
index a330c7b0..67dbc8da 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.8.0.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-vpu-hantro/imx-vpu-hantro_1.16.0.bb
@@ -2,16 +2,15 @@
DESCRIPTION = "i.MX Hantro VPU library"
LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd4b227530cd88a82af6a5982cfb724d"
PROVIDES = "virtual/imxvpu"
SRC_URI = " \
- ${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true \
- file://0001-Get-i.MX-custom-headers-from-usr-include-imx.patch \
+ ${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true \
"
-SRC_URI[md5sum] = "140796ddd6f1be47cffb7e5e2bfe0fb6"
-SRC_URI[sha256sum] = "c092a5b0f8897bae54154f58e47b6d2de033da01ee231a8cd779a51bbe962606"
+SRC_URI[md5sum] = "79ca586c67ea9b007fa772df8959c852"
+SRC_URI[sha256sum] = "1f373f5d9a37754f7936f9bf4b134b65afe98459c0383b63c50c1f6ecba49e25"
inherit fsl-eula-unpack use-imx-headers
diff --git a/bsp/meta-freescale/recipes-bsp/imx-vpu/imx-vpu_5.4.38.bb b/bsp/meta-freescale/recipes-bsp/imx-vpu/imx-vpu_5.4.39.2.bb
index 185bb3d1..43377b1e 100644
--- a/bsp/meta-freescale/recipes-bsp/imx-vpu/imx-vpu_5.4.38.bb
+++ b/bsp/meta-freescale/recipes-bsp/imx-vpu/imx-vpu_5.4.39.2.bb
@@ -4,16 +4,16 @@
DESCRIPTION = "Freescale Chips&Media VPU library"
LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://COPYING;md5=75abe2fa1d16ca79f87cde926f05f72d"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6c12031a11b81db21cdfe0be88cac4b3"
PROVIDES = "virtual/imxvpu"
PE = "1"
-SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
-SRC_URI[md5sum] = "521d5f839829f8d1f2a6a0e60270243e"
-SRC_URI[sha256sum] = "34bed0ddf6c797f444bddfa5d5495adc751ff268b6431d8beb48129c89c9e47f"
+SRC_URI[md5sum] = "fb11619e07dafbc46a335c7db4c9b9a2"
+SRC_URI[sha256sum] = "604885463ca7d292ddf376795ee95ae32abcc60512a3378e016b173222362900"
inherit fsl-eula-unpack use-imx-headers
diff --git a/bsp/meta-freescale/recipes-bsp/inphi/inphi_git.bb b/bsp/meta-freescale/recipes-bsp/inphi/inphi_git.bb
index c0c8a776..3f3c5f28 100644
--- a/bsp/meta-freescale/recipes-bsp/inphi/inphi_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/inphi/inphi_git.bb
@@ -2,9 +2,9 @@ SUMMARY = "Firmwares and Standalone Applications"
LICENSE = "NXP-Binary-EULA"
LIC_FILES_CHKSUM = "file://EULA.txt;md5=86d76166990962fa552f840ff08e5798"
-inherit deploy fsl-eula-unpack
+inherit deploy
-SRC_URI = "git://github.com/nxp/qoriq-firmware-inphi.git;fsl-eula=true;nobranch=1"
+SRC_URI = "git://github.com/nxp/qoriq-firmware-inphi.git;nobranch=1"
SRCREV = "f22e9ff3bfed8342da6efb699e473b11fbad5695"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-bsp/libimxdmabuffer/files/run-ptest b/bsp/meta-freescale/recipes-bsp/libimxdmabuffer/files/run-ptest
new file mode 100644
index 00000000..09f69a8d
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/libimxdmabuffer/files/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+./test-alloc >/dev/null 2>&1
+
+if [ $? -eq 0 ]; then
+ echo "PASS: test-alloc"
+else
+ echo "FAIL: test-alloc"
+fi
+
diff --git a/bsp/meta-freescale/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb b/bsp/meta-freescale/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb
new file mode 100644
index 00000000..9b918f2c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/libimxdmabuffer/libimxdmabuffer_1.0.1.bb
@@ -0,0 +1,46 @@
+DESCRIPTION = 'Library for allocating and managing physically contiguous memory \
+ ("DMA memory" or "DMA buffers") on i.MX devices.'
+HOMEPAGE = "https://github.com/Freescale/libimxdmabuffer"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=38fa42a5a6425b26d2919b17b1527324"
+SECTION = "base"
+
+PV .= "+git${SRCPV}"
+
+SRCBRANCH ?= "master"
+SRCREV = "d2058aa404ee1e8e8abd552c6a637787bcdcf514"
+SRC_URI = "git://github.com/Freescale/libimxdmabuffer.git;branch=${SRCBRANCH} \
+ file://run-ptest \
+ "
+
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig waf use-imx-headers ptest
+
+EXTRA_OECONF = "--imx-linux-headers-path=${STAGING_INCDIR_IMX} \
+ --libdir=${libdir} \
+ ${PACKAGECONFIG_CONFARGS}"
+
+PACKAGECONFIG ?= " "
+PACKAGECONFIG_append_imxgpu2d = " g2d"
+PACKAGECONFIG_append_imxipu = " ipu"
+PACKAGECONFIG_append_imxpxp = " pxp"
+PACKAGECONFIG_append_mx8m = " dwl ion"
+
+HANTRO_CONF = "--hantro-headers-path=${STAGING_INCDIR}/hantro_dec --hantro-decoder-version=G2"
+
+PACKAGECONFIG[dwl] = "--with-dwl-allocator=yes ${HANTRO_CONF},--with-dwl-allocator=no,imx-vpu-hantro"
+PACKAGECONFIG[ion] = "--with-ion-allocator=yes, --with-ion-allocator=no,"
+PACKAGECONFIG[ipu] = "--with-ipu-allocator=yes, --with-ipu-allocator=no,"
+PACKAGECONFIG[g2d] = "--with-g2d-allocator=yes, --with-g2d-allocator=no,virtual/libg2d"
+PACKAGECONFIG[pxp] = "--with-pxp-allocator=yes, --with-pxp-allocator=no,"
+
+# Using do_install_ptest_base instead of do_install_ptest, since
+# the default do_install_ptest_base is hardcoded to expect Makefiles.
+do_install_ptest_base() {
+ install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
+ install -m 0755 ${B}/test-alloc ${D}${PTEST_PATH}
+}
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-bsp/ls2-phy/ls2-phy_git.bb b/bsp/meta-freescale/recipes-bsp/ls2-phy/ls2-phy_git.bb
index 18a63b13..a1c412be 100644
--- a/bsp/meta-freescale/recipes-bsp/ls2-phy/ls2-phy_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/ls2-phy/ls2-phy_git.bb
@@ -2,9 +2,9 @@ SUMMARY = "Firmwares and Standalone Applications"
LICENSE = "NXP-Binary-EULA"
LIC_FILES_CHKSUM = "file://EULA.txt;md5=86d76166990962fa552f840ff08e5798"
-inherit deploy fsl-eula-unpack
+inherit deploy
-SRC_URI = "git://github.com/nxp/qoriq-firmware-cortina.git;fsl-eula=true;nobranch=1"
+SRC_URI = "git://github.com/nxp/qoriq-firmware-cortina.git;nobranch=1"
SRCREV = "9143c2a3adede595966583c00ca4edc99ec698cf"
S = "${WORKDIR}/git"
@@ -23,6 +23,6 @@ addtask deploy before do_build after do_install
PACKAGES += "${PN}-image"
FILES_${PN}-image += "/boot"
-COMPATIBLE_MACHINE = "(ls2080ardb|ls2088ardb|t2080|t4240|lx2160a)"
+COMPATIBLE_MACHINE = "(qoriq)"
PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/bsp/meta-freescale/recipes-bsp/mc-utils/mc-utils_git.bb b/bsp/meta-freescale/recipes-bsp/mc-utils/mc-utils_git.bb
index 430d6cd8..31645061 100644
--- a/bsp/meta-freescale/recipes-bsp/mc-utils/mc-utils_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/mc-utils/mc-utils_git.bb
@@ -10,7 +10,7 @@ DEPENDS += "dtc-native"
inherit deploy
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils;nobranch=1"
-SRCREV = "6aca560c630dc54afdef382c506f214b28f4985e"
+SRCREV = "8672a5f5abcd3a354dcab07e03f2a8a69b2e962d"
S = "${WORKDIR}/git"
@@ -19,24 +19,28 @@ MC_CFG_ls1088a = "ls1088a"
MC_CFG_ls2088a = "ls2088a"
MC_CFG_lx2160a = "lx2160a"
-do_install () {
+MC_FLAVOUR ?= "RDB"
+
+do_compile () {
oe_runmake -C config
+}
+do_install () {
install -d ${D}/boot/mc-utils
- cp -r ${S}/config/${MC_CFG}/RDB/*.dtb ${D}/boot/mc-utils
- if [ -d ${S}/config/${MC_CFG}/RDB/custom/ ]; then
- install -d ${D}/boot/mc-utils/custom
- cp -r ${S}/config/${MC_CFG}/RDB/custom/*.dtb ${D}/boot/mc-utils/custom
- fi
+ cp -r ${S}/config/${MC_CFG}/${MC_FLAVOUR}/*.dtb ${D}/boot/mc-utils
+ if [ -d ${S}/config/${MC_CFG}/${MC_FLAVOUR}/custom/ ]; then
+ install -d ${D}/boot/mc-utils/custom
+ cp -r ${S}/config/${MC_CFG}/${MC_FLAVOUR}/custom/*.dtb ${D}/boot/mc-utils/custom
+ fi
}
do_deploy () {
install -d ${DEPLOYDIR}/mc-utils
- cp -r ${S}/config/${MC_CFG}/RDB/*.dtb ${DEPLOYDIR}/mc-utils
- if [ -d ${S}/config/${MC_CFG}/RDB/custom/ ]; then
- install -d ${DEPLOYDIR}/mc-utils/custom
- cp -r ${S}/config/${MC_CFG}/RDB/custom/*.dtb ${DEPLOYDIR}/mc-utils/custom
- fi
+ cp -r ${S}/config/${MC_CFG}/${MC_FLAVOUR}/*.dtb ${DEPLOYDIR}/mc-utils
+ if [ -d ${S}/config/${MC_CFG}/${MC_FLAVOUR}/custom/ ]; then
+ install -d ${DEPLOYDIR}/mc-utils/custom
+ cp -r ${S}/config/${MC_CFG}/${MC_FLAVOUR}/custom/*.dtb ${DEPLOYDIR}/mc-utils/custom
+ fi
}
addtask deploy after do_install
diff --git a/bsp/meta-freescale/recipes-bsp/ppfe-firmware/ppfe-firmware_git.bb b/bsp/meta-freescale/recipes-bsp/ppfe-firmware/ppfe-firmware_git.bb
index b94d88c4..fd53807f 100644
--- a/bsp/meta-freescale/recipes-bsp/ppfe-firmware/ppfe-firmware_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/ppfe-firmware/ppfe-firmware_git.bb
@@ -5,10 +5,10 @@ LIC_FILES_CHKSUM = "file://NXP-Binary-EULA.txt;md5=92723670f432558b9e2494ed177d2
INHIBIT_DEFAULT_DEPS = "1"
-inherit deploy fsl-eula-unpack
+inherit deploy
-SRC_URI = "git://github.com/NXP/qoriq-engine-pfe-bin.git;fsl-eula=true;nobranch=1"
-SRCREV = "58aa0cac630528ed91fe5639700d6b571c0c07b5"
+SRC_URI = "git://github.com/NXP/qoriq-engine-pfe-bin.git;nobranch=1"
+SRCREV = "d3a8ef0760c54ddc243039c86389497e37be90ab"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-bsp/qe-ucode/qe-ucode_git.bb b/bsp/meta-freescale/recipes-bsp/qe-ucode/qe-ucode_git.bb
index 1af630a6..cecd5903 100644
--- a/bsp/meta-freescale/recipes-bsp/qe-ucode/qe-ucode_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/qe-ucode/qe-ucode_git.bb
@@ -3,36 +3,27 @@ SECTION = "qe-ucode"
LICENSE = "NXP-Binary-EULA"
LIC_FILES_CHKSUM = "file://NXP-Binary-EULA;md5=c62f8109b4df15ca37ceeb5e4943626c"
-inherit deploy fsl-eula-unpack
+inherit deploy
-SRC_URI = "git://github.com/NXP/qoriq-qe-ucode.git;fsl-eula=true;nobranch=1"
+SRC_URI = "git://github.com/NXP/qoriq-qe-ucode.git;nobranch=1"
SRCREV= "57401f6dff6507055558eaa6838116baa8a2fd46"
S = "${WORKDIR}/git"
-python () {
- if not d.getVar("QE_UCODE", True):
- PN = d.getVar("PN", True)
- FILE = os.path.basename(d.getVar("FILE", True))
- bb.debug(1, "To build %s, see %s for instructions on \
- setting up your qe-ucode" % (PN, FILE))
- raise bb.parse.SkipRecipe("because QE_UCODE is not set")
-}
-
do_install () {
install -d ${D}/boot
- install -m 644 ${B}/${QE_UCODE} ${D}/boot
+ install -m 644 ${B}/*.bin ${D}/boot
}
do_deploy () {
install -d ${DEPLOYDIR}/boot
- install -m 644 ${B}/${QE_UCODE} ${DEPLOYDIR}/boot
+ install -m 644 ${B}/*.bin ${DEPLOYDIR}/boot
}
addtask deploy before do_build after do_install
PACKAGES += "${PN}-image"
FILES_${PN}-image += "/boot/*"
-COMPATIBLE_MACHINE = "(ls1021a|ls1043a|t1042|t1024)"
+COMPATIBLE_MACHINE = "(qoriq)"
PACKAGE_ARCH = "${MACHINE_SOCARCH}"
diff --git a/bsp/meta-freescale/recipes-bsp/rcw/rcw_git.bb b/bsp/meta-freescale/recipes-bsp/rcw/rcw_git.bb
index c6bdad23..e1e63cce 100644
--- a/bsp/meta-freescale/recipes-bsp/rcw/rcw_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/rcw/rcw_git.bb
@@ -1,30 +1,32 @@
SUMMARY = "Reset Configuration Word"
DESCRIPTION = "Reset Configuration Word - hardware boot-time parameters for the QorIQ targets"
LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=45a017ee5f4cfe64b1cddf2eb06cffc7"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=44a0d0fad189770cc022af4ac6262cbe"
-DEPENDS += "change-file-endianess-native tcl-native"
+DEPENDS += "tcl-native"
inherit deploy siteinfo
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/rcw;nobranch=1"
-SRCREV = "17254ac35250197877c6321f9d13e33b1f85388a"
+SRCREV = "e0fab6d9b61003caef577f7474c2fac61e6ba2ff"
S = "${WORKDIR}/git"
-export PYTHON = "${USRBINPATH}/python2"
+export PYTHON = "${USRBINPATH}/python3"
-M="${@d.getVar('MACHINE', True).replace('-64b','').replace('-32b','').replace('-${SITEINFO_ENDIANNESS}','')}"
+M="${@d.getVar('MACHINE').replace('-64b','').replace('-32b','').replace('-${SITEINFO_ENDIANNESS}','')}"
+
+BOARD_TARGETS="${M}"
+BOARD_TARGETS_ls2088ardb="${M} ${M}_rev1.1"
+BOARD_TARGETS_ls1088ardb-pb="ls1088ardb"
+BOARD_TARGETS_lx2160ardb = "${M} ${M}_rev2"
+
+do_compile () {
+ oe_runmake BOARDS="${BOARD_TARGETS}" DESTDIR=${D}/boot/rcw/
+}
do_install () {
- if [ ${M} = ls2088ardb ]; then
- oe_runmake BOARDS=${M} DESTDIR=${D}/boot/rcw/ install
- oe_runmake BOARDS=${M}_rev1.1 DESTDIR=${D}/boot/rcw/ install
- elif [ ${M} = ls1088ardb-pb ]; then
- oe_runmake BOARDS=ls1088ardb DESTDIR=${D}/boot/rcw/ install
- else
- oe_runmake BOARDS=${M} DESTDIR=${D}/boot/rcw/ install
- fi
+ oe_runmake BOARDS="${BOARD_TARGETS}" DESTDIR=${D}/boot/rcw/ install
}
do_deploy () {
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-common_2018.11.inc b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-common_2020.04.inc
index 53496b7b..1ccd0d17 100644
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-common_2018.11.inc
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-common_2020.04.inc
@@ -10,9 +10,10 @@ DEPENDS += "bison-native"
SRC_URI = "git://github.com/Freescale/u-boot-fslc.git;branch=${SRCBRANCH}"
-SRCREV = "6e25ce6f3c8568b9618de6569794a29a05e1b7a4"
-SRCBRANCH = "2018.11+fslc"
+SRCREV = "a266838009e02b369b51f4139c6ac64facb12d34"
+SRCBRANCH = "2020.04+fslc"
-PV = "v2018.11+git${SRCPV}"
+PV = "v2020.04+git${SRCPV}"
S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-fw-utils_2018.11.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-fw-utils_2018.11.bb
deleted file mode 100644
index a809a3f6..00000000
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-fw-utils_2018.11.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-require u-boot-fslc-common_${PV}.inc
-
-SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
-DEPENDS += "mtd-utils"
-
-INSANE_SKIP_${PN} = "already-stripped"
-EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
-EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
-
-inherit uboot-config
-
-do_compile () {
- oe_runmake ${UBOOT_MACHINE}
- oe_runmake envtools
-}
-
-do_install () {
- install -d ${D}${base_sbindir}
- install -d ${D}${sysconfdir}
- install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
- install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
-
- if [ -e ${WORKDIR}/fw_env.config ]; then
- install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
- else
- install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
- fi
-}
-
-do_install_class-cross () {
- install -d ${D}${bindir_cross}
- install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
- install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
-}
-
-SYSROOT_PREPROCESS_FUNCS_class-cross = "uboot_fw_utils_cross"
-uboot_fw_utils_cross() {
- sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
-}
-
-PROVIDES += "u-boot-fw-utils"
-RPROVIDES_${PN} += "u-boot-fw-utils"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-BBCLASSEXTEND = "cross"
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-mxsboot_2018.11.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-mxsboot_2020.04.bb
index 9123b331..2492f450 100644
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-mxsboot_2018.11.bb
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc-mxsboot_2020.04.bb
@@ -12,14 +12,14 @@ EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" H
EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1 CONFIG_MX28=y'
do_compile () {
- oe_runmake sandbox_defconfig
+ oe_runmake -C ${S} O=${B} sandbox_defconfig
# Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
# generating it requires bin2header tool, which for target build
# is built with target tools and thus cannot be executed on host.
sed -i "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" .config
- oe_runmake cross_tools NO_SDL=1
+ oe_runmake -C ${S} O=${B} cross_tools NO_SDL=1
}
do_install () {
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc_2018.11.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc_2020.04.bb
index 5659e16c..64588efc 100644
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc_2018.11.bb
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-fslc_2020.04.bb
@@ -6,10 +6,12 @@ order to provide support for some backported features and fixes, or because it \
was submitted for revision and it takes some time to become part of a stable \
version, or because it is not applicable for upstreaming."
-DEPENDS_append = " dtc-native"
+DEPENDS_append = " bc-native dtc-native lzop-native"
PROVIDES += "u-boot"
+B = "${WORKDIR}/build"
+
# FIXME: Allow linking of 'tools' binaries with native libraries
# used for generating the boot logo and other tools used
# during the build process.
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-common.inc b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-common.inc
new file mode 100644
index 00000000..a2d2ed01
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-common.inc
@@ -0,0 +1,20 @@
+DESCRIPTION = "i.MX U-Boot suppporting i.MX reference boards."
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRCBRANCH = "lf-5.4.y_v2019.04"
+SRC_URI = "git://source.codeaurora.org/external/imx/uboot-imx.git;protocol=https;branch=${SRCBRANCH}"
+SRCREV = "228843cdf5435d4bd69f42a6015f78761ff4cc0d"
+
+DEPENDS += "flex-native bison-native bc-native dtc-native"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+inherit fsl-u-boot-localversion
+
+LOCALVERSION ?= "-${SRCBRANCH}"
+
+BOOT_TOOLS = "imx-boot-tools"
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-mfgtool_2017.03.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb
index d5cb0339..2b296c19 100644
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-mfgtool_2017.03.bb
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb
@@ -1,6 +1,6 @@
# Copyright (C) 2014 O.S. Systems Software LTDA.
# Copyright (C) 2014-2016 Freescale Semiconductor
-# Copyright 2017 NXP
+# Copyright 2017-2019 NXP
FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-imx:"
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-tools_2019.04.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-tools_2019.04.bb
new file mode 100644
index 00000000..12ac72e2
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx-tools_2019.04.bb
@@ -0,0 +1,10 @@
+require recipes-bsp/u-boot/u-boot-tools.inc
+require u-boot-imx-common.inc
+
+PROVIDES_append_class-target = " ${MLPREFIX}u-boot-tools"
+PROVIDES_append_class-native = " u-boot-tools-native"
+PROVIDES_append_class-nativesdk = " nativesdk-u-boot-tools"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
+COMPATIBLE_MACHINE_class-target = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch
new file mode 100644
index 00000000..c717e029
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch
@@ -0,0 +1,49 @@
+From bdaa73a5b3923257add182b4ab8058dbfa33421b Mon Sep 17 00:00:00 2001
+From: Stefano Babic <sbabic@denx.de>
+Date: Wed, 13 Mar 2019 09:46:45 +0100
+Subject: [PATCH] Add target to generate initial environment
+
+The initial environment is linked to the u-boot binary. Modifying the
+environment from User Space with the env tools requires that the tools
+are always built together with the bootloader to be sure that they
+contain the initial environment in case no environment is stored into
+persistent storage or when a board boots with just the default
+environment. This makes difficult for distros to provide a general
+package to access the environment. A simpler way is if the tools are
+generic for all boards and a configuration file is given to provide the
+initial environment.
+
+The patch just generates the initial environment by extracting it from
+the compiled object. This file can then be used for tools in user space
+to initialize the environment.
+
+Signed-off-by: Stefano Babic <sbabic@denx.de>
+
+Upstream-Status: Backport [https://github.com/u-boot/u-boot/commit/bdaa73a5b3923257add182b4ab8058dbfa33421b]
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ Makefile | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 66a09ac900..f2c7bb6041 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1977,6 +1977,13 @@ endif
+ $(build)=$(build-dir) $(@:.ko=.o)
+ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
+
++quiet_cmd_genenv = GENENV $@
++cmd_genenv = $(OBJCOPY) --dump-section .rodata.default_environment=$@ env/common.o; \
++ sed --in-place -e 's/\x00/\x0A/g' $@
++
++u-boot-initial-env: u-boot.bin
++ $(call if_changed,genenv)
++
+ # Consistency checks
+ # ---------------------------------------------------------------------------
+
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-tools-allow-to-override-python.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-tools-allow-to-override-python.patch
deleted file mode 100755
index f96de538..00000000
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx/0001-tools-allow-to-override-python.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From b48bfc74ee410b1e6681c620633ffef32aafaba0 Mon Sep 17 00:00:00 2001
-From: Stefano Babic <sbabic@denx.de>
-Date: Wed, 5 Apr 2017 17:46:41 +0200
-Subject: [PATCH] tools: allow to override python
-
-Not force to use python from PATH. Issue was noted when building with
-Yocto, because python from the distro is always taken instead of
-python-native built during Yocto process.
-
-Signed-off-by: Stefano Babic <sbabic@denx.de>
-CC: Simon Glass <sjg@chromium.org>
-Reviewed-by: Simon Glass <sjg@chromium.org>
----
- Makefile | 2 +-
- tools/Makefile | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 09b597d450..8d4e6050b3 100644
---- a/Makefile
-+++ b/Makefile
-@@ -348,7 +348,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
- OBJDUMP = $(CROSS_COMPILE)objdump
- AWK = awk
- PERL = perl
--PYTHON = python
-+PYTHON ?= python
- DTC = dtc
- CHECK = sparse
-
-diff --git a/tools/Makefile b/tools/Makefile
-index fa1b85bdae..2fc4a583d4 100644
---- a/tools/Makefile
-+++ b/tools/Makefile
-@@ -120,7 +120,7 @@ _libfdt.so-sharedobjs += $(LIBFDT_OBJS)
- libfdt:
-
- tools/_libfdt.so: $(patsubst %.o,%.c,$(LIBFDT_OBJS)) tools/libfdt_wrap.c
-- LDFLAGS="$(HOSTLDFLAGS)" python $(srctree)/lib/libfdt/setup.py \
-+ LDFLAGS="$(HOSTLDFLAGS)" ${PYTHON} $(srctree)/lib/libfdt/setup.py \
- "$(_hostc_flags)" $^
- mv _libfdt.so $@
-
---
-2.17.1
-
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx_2017.03.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx_2019.04.bb
index f85ed994..d37ede83 100644
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx_2017.03.bb
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-imx_2019.04.bb
@@ -1,28 +1,13 @@
# Copyright (C) 2013-2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
# Copyright 2018 (C) O.S. Systems Software LTDA.
+# Copyright 2017-2019 NXP
-DESCRIPTION = "i.MX U-Boot suppporting i.MX reference boards."
require recipes-bsp/u-boot/u-boot.inc
+require u-boot-imx-common.inc
-PROVIDES += "u-boot"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-SRCBRANCH = "imx_v2017.03_4.9.123_imx8mm_ga"
-SRC_URI = "git://source.codeaurora.org/external/imx/uboot-imx.git;protocol=https;branch=${SRCBRANCH} \
- file://0001-tools-allow-to-override-python.patch \
- "
-SRCREV = "8be98e9322040c655b9e5c9fb2c494e002e3fad9"
-
-S = "${WORKDIR}/git"
+SRC_URI += "file://0001-Add-target-to-generate-initial-environment.patch"
-inherit dtc-145 fsl-u-boot-localversion
-
-LOCALVERSION ?= "-${SRCBRANCH}"
-
-BOOT_TOOLS = "imx-boot-tools"
+PROVIDES += "u-boot"
do_deploy_append_mx8m() {
# Deploy the mkimage, u-boot-nodtb.bin and fsl-imx8m*-XX.dtb for mkimage to generate boot binary
@@ -37,7 +22,7 @@ do_deploy_append_mx8m() {
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0777 ${B}/${config}/tools/mkimage ${DEPLOYDIR}/${BOOT_TOOLS}/mkimage_uboot
- install -m 0777 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin
+ install -m 0777 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${UBOOT_CONFIG}
fi
done
unset j
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.03.inc b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.03.inc
deleted file mode 100644
index 5be64e49..00000000
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.03.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-
-inherit fsl-u-boot-localversion
-
-LICENSE = "GPLv2 & BSD-3-Clause & BSD-2-Clause & LGPL-2.0 & LGPL-2.1"
-LIC_FILES_CHKSUM = " \
- file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
- file://Licenses/bsd-2-clause.txt;md5=6a31f076f5773aabd8ff86191ad6fdd5 \
- file://Licenses/bsd-3-clause.txt;md5=4a1190eac56a9db675d58ebe86eaf50c \
- file://Licenses/lgpl-2.0.txt;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
- file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
-"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/u-boot;nobranch=1 \
-"
-SRCREV = "1e96fd8f464dfe23eb692a11018c20d70546783b"
-
-S = "${WORKDIR}/git"
-PV_append = "+fslgit"
-LOCALVERSION = "+fsl" \ No newline at end of file
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.09.inc b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.09.inc
deleted file mode 100644
index a3a554cc..00000000
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-common_2018.09.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-
-inherit fsl-u-boot-localversion
-
-LICENSE = "GPLv2 & BSD-3-Clause & BSD-2-Clause & LGPL-2.0 & LGPL-2.1"
-LIC_FILES_CHKSUM = " \
- file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
- file://Licenses/bsd-2-clause.txt;md5=6a31f076f5773aabd8ff86191ad6fdd5 \
- file://Licenses/bsd-3-clause.txt;md5=4a1190eac56a9db675d58ebe86eaf50c \
- file://Licenses/lgpl-2.0.txt;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
- file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
-"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/u-boot;nobranch=1 \
-"
-SRCREV= "c08de7c3c92d45a824500ad936f4d72465c181ec"
-
-S = "${WORKDIR}/git"
-PV_append = "+fslgit"
-LOCALVERSION = "+fsl"
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-fw-utils_2018.03.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-fw-utils_2018.03.bb
deleted file mode 100644
index ae47cb0d..00000000
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq-fw-utils_2018.03.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-require u-boot-qoriq-common_${PV}.inc
-
-SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
-DEPENDS = "mtd-utils"
-
-INSANE_SKIP_${PN} = "already-stripped"
-EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
-EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
-
-inherit uboot-config
-
-do_compile () {
- oe_runmake ${UBOOT_MACHINE}
- oe_runmake envtools
-}
-
-do_install () {
- install -d ${D}${base_sbindir}
- install -d ${D}${sysconfdir}
- install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
- install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
-
- if [ -e ${WORKDIR}/fw_env.config ]; then
- install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
- else
- install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
- fi
-}
-
-do_install_class-cross () {
- install -d ${D}${bindir_cross}
- install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
- install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
-}
-
-SYSROOT_PREPROCESS_FUNCS_class-cross = "uboot_fw_utils_cross"
-uboot_fw_utils_cross() {
- sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
-}
-
-PROVIDES += "u-boot-fw-utils"
-RPROVIDES_${PN} += "u-boot-fw-utils"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-BBCLASSEXTEND = "cross"
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-Remove-redundant-YYLOC-global-declaration.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-Remove-redundant-YYLOC-global-declaration.patch
new file mode 100644
index 00000000..2609760c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-Remove-redundant-YYLOC-global-declaration.patch
@@ -0,0 +1,29 @@
+From 018921ee79d3f30893614b3b2b63b588d8544f73 Mon Sep 17 00:00:00 2001
+From: Peter Robinson <pbrobinson@gmail.com>
+Date: Thu, 30 Jan 2020 09:37:15 +0000
+Subject: [PATCH] Remove redundant YYLOC global declaration
+
+Same as the upstream fix for building dtc with gcc 10.
+
+Upstream-Status: Backport
+
+Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index fd825ebba69c..24af54997758 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
+--
+2.26.2
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Convert-a-few-tests-to-Python-3.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Convert-a-few-tests-to-Python-3.patch
new file mode 100644
index 00000000..e530b7ca
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Convert-a-few-tests-to-Python-3.patch
@@ -0,0 +1,79 @@
+From b6ee0cf89f9405094cbb6047076a13e14ebc030b Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Thu, 31 Oct 2019 07:43:03 -0600
+Subject: [PATCH] binman: Convert a few tests to Python 3
+
+Some tests have crept in with Python 2 strings and constructs. Convert
+then.
+
+Upstream-Status: Backport
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+---
+ tools/binman/ftest.py | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
+index 93507993a0..80df0e3ca9 100644
+--- a/tools/binman/ftest.py
++++ b/tools/binman/ftest.py
+@@ -2113,7 +2113,7 @@ class TestFunctional(unittest.TestCase):
+ data = self.data = self._DoReadFileRealDtb('115_fdtmap.dts')
+ fdtmap_data = data[len(U_BOOT_DATA):]
+ magic = fdtmap_data[:8]
+- self.assertEqual('_FDTMAP_', magic)
++ self.assertEqual(b'_FDTMAP_', magic)
+ self.assertEqual(tools.GetBytes(0, 8), fdtmap_data[8:16])
+
+ fdt_data = fdtmap_data[16:]
+@@ -2156,7 +2156,7 @@ class TestFunctional(unittest.TestCase):
+ dtb = fdt.Fdt.FromData(fdt_data)
+ fdt_size = dtb.GetFdtObj().totalsize()
+ hdr_data = data[-8:]
+- self.assertEqual('BinM', hdr_data[:4])
++ self.assertEqual(b'BinM', hdr_data[:4])
+ offset = struct.unpack('<I', hdr_data[4:])[0] & 0xffffffff
+ self.assertEqual(fdtmap_pos - 0x400, offset - (1 << 32))
+
+@@ -2165,7 +2165,7 @@ class TestFunctional(unittest.TestCase):
+ data = self.data = self._DoReadFileRealDtb('117_fdtmap_hdr_start.dts')
+ fdtmap_pos = 0x100 + len(U_BOOT_DATA)
+ hdr_data = data[:8]
+- self.assertEqual('BinM', hdr_data[:4])
++ self.assertEqual(b'BinM', hdr_data[:4])
+ offset = struct.unpack('<I', hdr_data[4:])[0]
+ self.assertEqual(fdtmap_pos, offset)
+
+@@ -2174,7 +2174,7 @@ class TestFunctional(unittest.TestCase):
+ data = self.data = self._DoReadFileRealDtb('118_fdtmap_hdr_pos.dts')
+ fdtmap_pos = 0x100 + len(U_BOOT_DATA)
+ hdr_data = data[0x80:0x88]
+- self.assertEqual('BinM', hdr_data[:4])
++ self.assertEqual(b'BinM', hdr_data[:4])
+ offset = struct.unpack('<I', hdr_data[4:])[0]
+ self.assertEqual(fdtmap_pos, offset)
+
+@@ -2435,9 +2435,9 @@ class TestFunctional(unittest.TestCase):
+ ' section 100 %x section 100' % section_size,
+ ' cbfs 100 400 cbfs 0',
+ ' u-boot 138 4 u-boot 38',
+-' u-boot-dtb 180 10f u-boot-dtb 80 3c9',
++' u-boot-dtb 180 105 u-boot-dtb 80 3c9',
+ ' u-boot-dtb 500 %x u-boot-dtb 400 3c9' % fdt_size,
+-' fdtmap %x 3b4 fdtmap %x' %
++' fdtmap %x 3bd fdtmap %x' %
+ (fdtmap_offset, fdtmap_offset),
+ ' image-header bf8 8 image-header bf8',
+ ]
+@@ -2522,7 +2522,7 @@ class TestFunctional(unittest.TestCase):
+ data = self._RunExtractCmd('section')
+ cbfs_data = data[:0x400]
+ cbfs = cbfs_util.CbfsReader(cbfs_data)
+- self.assertEqual(['u-boot', 'u-boot-dtb', ''], cbfs.files.keys())
++ self.assertEqual(['u-boot', 'u-boot-dtb', ''], list(cbfs.files.keys()))
+ dtb_data = data[0x400:]
+ dtb = self._decompress(dtb_data)
+ self.assertEqual(EXTRACT_DTB_SIZE, len(dtb))
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Move-to-use-Python-3.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Move-to-use-Python-3.patch
new file mode 100644
index 00000000..c1a05b32
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-binman-Move-to-use-Python-3.patch
@@ -0,0 +1,30 @@
+From 388560134b99dc4cc752627d3a7e9f8c8c2a89a7 Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Thu, 31 Oct 2019 07:43:05 -0600
+Subject: [PATCH] binman: Move to use Python 3
+
+Update this tool to use Python 3 to meet the 2020 deadline.
+
+Unfortunately this introduces a test failure due to a problem in pylibfdt
+on Python 3. I will investigate.
+
+Upstream-Status: Backport
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+---
+ tools/binman/binman.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/binman/binman.py b/tools/binman/binman.py
+index 8bd5868df2..9e6fd72117 100755
+--- a/tools/binman/binman.py
++++ b/tools/binman/binman.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: GPL-2.0+
+
+ # Copyright (c) 2016 Google, Inc
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-buildman-Convert-to-Python-3.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-buildman-Convert-to-Python-3.patch
new file mode 100644
index 00000000..5d7ec42f
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-buildman-Convert-to-Python-3.patch
@@ -0,0 +1,928 @@
+From c05aa0364280803d8274e260a739553d588ea052 Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Thu, 31 Oct 2019 07:42:53 -0600
+Subject: [PATCH] buildman: Convert to Python 3
+
+Convert buildman to Python 3 and make it use that, to meet the 2020
+deadline.
+
+Upstream-Status: Backport
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+---
+ tools/buildman/board.py | 9 +--
+ tools/buildman/bsettings.py | 20 +++----
+ tools/buildman/builder.py | 47 ++++++++--------
+ tools/buildman/builderthread.py | 24 ++++----
+ tools/buildman/buildman.py | 10 ++--
+ tools/buildman/control.py | 44 +++++++--------
+ tools/buildman/func_test.py | 16 +++---
+ tools/buildman/test.py | 22 ++++----
+ tools/buildman/toolchain.py | 99 +++++++++++++++++----------------
+ 9 files changed, 146 insertions(+), 145 deletions(-)
+
+diff --git a/tools/buildman/board.py b/tools/buildman/board.py
+index 2a1d021574..447aaabea8 100644
+--- a/tools/buildman/board.py
++++ b/tools/buildman/board.py
+@@ -1,6 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0+
+ # Copyright (c) 2012 The Chromium OS Authors.
+
++from collections import OrderedDict
+ import re
+
+ class Expr:
+@@ -120,7 +121,7 @@ class Boards:
+ Args:
+ fname: Filename of boards.cfg file
+ """
+- with open(fname, 'r') as fd:
++ with open(fname, 'r', encoding='utf-8') as fd:
+ for line in fd:
+ if line[0] == '#':
+ continue
+@@ -155,7 +156,7 @@ class Boards:
+ key is board.target
+ value is board
+ """
+- board_dict = {}
++ board_dict = OrderedDict()
+ for board in self._boards:
+ board_dict[board.target] = board
+ return board_dict
+@@ -166,7 +167,7 @@ class Boards:
+ Returns:
+ List of Board objects that are marked selected
+ """
+- board_dict = {}
++ board_dict = OrderedDict()
+ for board in self._boards:
+ if board.build_it:
+ board_dict[board.target] = board
+@@ -259,7 +260,7 @@ class Boards:
+ due to each argument, arranged by argument.
+ List of errors found
+ """
+- result = {}
++ result = OrderedDict()
+ warnings = []
+ terms = self._BuildTerms(args)
+
+diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py
+index 03d7439aa5..0b7208da37 100644
+--- a/tools/buildman/bsettings.py
++++ b/tools/buildman/bsettings.py
+@@ -1,9 +1,9 @@
+ # SPDX-License-Identifier: GPL-2.0+
+ # Copyright (c) 2012 The Chromium OS Authors.
+
+-import ConfigParser
++import configparser
+ import os
+-import StringIO
++import io
+
+
+ def Setup(fname=''):
+@@ -15,20 +15,20 @@ def Setup(fname=''):
+ global settings
+ global config_fname
+
+- settings = ConfigParser.SafeConfigParser()
++ settings = configparser.SafeConfigParser()
+ if fname is not None:
+ config_fname = fname
+ if config_fname == '':
+ config_fname = '%s/.buildman' % os.getenv('HOME')
+ if not os.path.exists(config_fname):
+- print 'No config file found ~/.buildman\nCreating one...\n'
++ print('No config file found ~/.buildman\nCreating one...\n')
+ CreateBuildmanConfigFile(config_fname)
+- print 'To install tool chains, please use the --fetch-arch option'
++ print('To install tool chains, please use the --fetch-arch option')
+ if config_fname:
+ settings.read(config_fname)
+
+ def AddFile(data):
+- settings.readfp(StringIO.StringIO(data))
++ settings.readfp(io.StringIO(data))
+
+ def GetItems(section):
+ """Get the items from a section of the config.
+@@ -41,7 +41,7 @@ def GetItems(section):
+ """
+ try:
+ return settings.items(section)
+- except ConfigParser.NoSectionError as e:
++ except configparser.NoSectionError as e:
+ return []
+ except:
+ raise
+@@ -68,10 +68,10 @@ def CreateBuildmanConfigFile(config_fname):
+ try:
+ f = open(config_fname, 'w')
+ except IOError:
+- print "Couldn't create buildman config file '%s'\n" % config_fname
++ print("Couldn't create buildman config file '%s'\n" % config_fname)
+ raise
+
+- print >>f, '''[toolchain]
++ print('''[toolchain]
+ # name = path
+ # e.g. x86 = /opt/gcc-4.6.3-nolibc/x86_64-linux
+
+@@ -93,5 +93,5 @@ openrisc = or1k
+ # snapper-boards=ENABLE_AT91_TEST=1
+ # snapper9260=${snapper-boards} BUILD_TAG=442
+ # snapper9g45=${snapper-boards} BUILD_TAG=443
+-'''
++''', file=f)
+ f.close();
+diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
+index fbb236676c..cfbe4c26b1 100644
+--- a/tools/buildman/builder.py
++++ b/tools/buildman/builder.py
+@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
+ import glob
+ import os
+ import re
+-import Queue
++import queue
+ import shutil
+ import signal
+ import string
+@@ -92,11 +92,10 @@ u-boot/ source directory
+ """
+
+ # Possible build outcomes
+-OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = range(4)
++OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = list(range(4))
+
+ # Translate a commit subject into a valid filename (and handle unicode)
+-trans_valid_chars = string.maketrans('/: ', '---')
+-trans_valid_chars = trans_valid_chars.decode('latin-1')
++trans_valid_chars = str.maketrans('/: ', '---')
+
+ BASE_CONFIG_FILENAMES = [
+ 'u-boot.cfg', 'u-boot-spl.cfg', 'u-boot-tpl.cfg'
+@@ -122,8 +121,8 @@ class Config:
+ def __hash__(self):
+ val = 0
+ for fname in self.config:
+- for key, value in self.config[fname].iteritems():
+- print key, value
++ for key, value in self.config[fname].items():
++ print(key, value)
+ val = val ^ hash(key) & hash(value)
+ return val
+
+@@ -293,8 +292,8 @@ class Builder:
+ self._re_dtb_warning = re.compile('(.*): Warning .*')
+ self._re_note = re.compile('(.*):(\d*):(\d*): note: this is the location of the previous.*')
+
+- self.queue = Queue.Queue()
+- self.out_queue = Queue.Queue()
++ self.queue = queue.Queue()
++ self.out_queue = queue.Queue()
+ for i in range(self.num_threads):
+ t = builderthread.BuilderThread(self, i, incremental,
+ per_board_out_dir)
+@@ -781,7 +780,7 @@ class Builder:
+ config = {}
+ environment = {}
+
+- for board in boards_selected.itervalues():
++ for board in boards_selected.values():
+ outcome = self.GetBuildOutcome(commit_upto, board.target,
+ read_func_sizes, read_config,
+ read_environment)
+@@ -814,13 +813,13 @@ class Builder:
+ tconfig = Config(self.config_filenames, board.target)
+ for fname in self.config_filenames:
+ if outcome.config:
+- for key, value in outcome.config[fname].iteritems():
++ for key, value in outcome.config[fname].items():
+ tconfig.Add(fname, key, value)
+ config[board.target] = tconfig
+
+ tenvironment = Environment(board.target)
+ if outcome.environment:
+- for key, value in outcome.environment.iteritems():
++ for key, value in outcome.environment.items():
+ tenvironment.Add(key, value)
+ environment[board.target] = tenvironment
+
+@@ -1040,12 +1039,12 @@ class Builder:
+
+ # We now have a list of image size changes sorted by arch
+ # Print out a summary of these
+- for arch, target_list in arch_list.iteritems():
++ for arch, target_list in arch_list.items():
+ # Get total difference for each type
+ totals = {}
+ for result in target_list:
+ total = 0
+- for name, diff in result.iteritems():
++ for name, diff in result.items():
+ if name.startswith('_'):
+ continue
+ total += diff
+@@ -1250,7 +1249,7 @@ class Builder:
+ if self._show_unknown:
+ self.AddOutcome(board_selected, arch_list, unknown_boards, '?',
+ self.col.MAGENTA)
+- for arch, target_list in arch_list.iteritems():
++ for arch, target_list in arch_list.items():
+ Print('%10s: %s' % (arch, target_list))
+ self._error_lines += 1
+ if better_err:
+@@ -1283,13 +1282,13 @@ class Builder:
+ environment_minus = {}
+ environment_change = {}
+ base = tbase.environment
+- for key, value in tenvironment.environment.iteritems():
++ for key, value in tenvironment.environment.items():
+ if key not in base:
+ environment_plus[key] = value
+- for key, value in base.iteritems():
++ for key, value in base.items():
+ if key not in tenvironment.environment:
+ environment_minus[key] = value
+- for key, value in base.iteritems():
++ for key, value in base.items():
+ new_value = tenvironment.environment.get(key)
+ if new_value and value != new_value:
+ desc = '%s -> %s' % (value, new_value)
+@@ -1342,15 +1341,15 @@ class Builder:
+ config_minus = {}
+ config_change = {}
+ base = tbase.config[name]
+- for key, value in tconfig.config[name].iteritems():
++ for key, value in tconfig.config[name].items():
+ if key not in base:
+ config_plus[key] = value
+ all_config_plus[key] = value
+- for key, value in base.iteritems():
++ for key, value in base.items():
+ if key not in tconfig.config[name]:
+ config_minus[key] = value
+ all_config_minus[key] = value
+- for key, value in base.iteritems():
++ for key, value in base.items():
+ new_value = tconfig.config.get(key)
+ if new_value and value != new_value:
+ desc = '%s -> %s' % (value, new_value)
+@@ -1368,7 +1367,7 @@ class Builder:
+ summary[target] = '\n'.join(lines)
+
+ lines_by_target = {}
+- for target, lines in summary.iteritems():
++ for target, lines in summary.items():
+ if lines in lines_by_target:
+ lines_by_target[lines].append(target)
+ else:
+@@ -1392,7 +1391,7 @@ class Builder:
+ Print('%s:' % arch)
+ _OutputConfigInfo(lines)
+
+- for lines, targets in lines_by_target.iteritems():
++ for lines, targets in lines_by_target.items():
+ if not lines:
+ continue
+ Print('%s :' % ' '.join(sorted(targets)))
+@@ -1463,7 +1462,7 @@ class Builder:
+ commits: Selected commits to build
+ """
+ # First work out how many commits we will build
+- count = (self.commit_count + self._step - 1) / self._step
++ count = (self.commit_count + self._step - 1) // self._step
+ self.count = len(board_selected) * count
+ self.upto = self.warned = self.fail = 0
+ self._timestamps = collections.deque()
+@@ -1566,7 +1565,7 @@ class Builder:
+ self.ProcessResult(None)
+
+ # Create jobs to build all commits for each board
+- for brd in board_selected.itervalues():
++ for brd in board_selected.values():
+ job = builderthread.BuilderJob()
+ job.board = brd
+ job.commits = commits
+diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
+index 8a9d47cd5e..570c1f6595 100644
+--- a/tools/buildman/builderthread.py
++++ b/tools/buildman/builderthread.py
+@@ -28,7 +28,7 @@ def Mkdir(dirname, parents = False):
+ except OSError as err:
+ if err.errno == errno.EEXIST:
+ if os.path.realpath('.') == os.path.realpath(dirname):
+- print "Cannot create the current working directory '%s'!" % dirname
++ print("Cannot create the current working directory '%s'!" % dirname)
+ sys.exit(1)
+ pass
+ else:
+@@ -291,15 +291,13 @@ class BuilderThread(threading.Thread):
+ outfile = os.path.join(build_dir, 'log')
+ with open(outfile, 'w') as fd:
+ if result.stdout:
+- # We don't want unicode characters in log files
+- fd.write(result.stdout.decode('UTF-8').encode('ASCII', 'replace'))
++ fd.write(result.stdout)
+
+ errfile = self.builder.GetErrFile(result.commit_upto,
+ result.brd.target)
+ if result.stderr:
+ with open(errfile, 'w') as fd:
+- # We don't want unicode characters in log files
+- fd.write(result.stderr.decode('UTF-8').encode('ASCII', 'replace'))
++ fd.write(result.stderr)
+ elif os.path.exists(errfile):
+ os.remove(errfile)
+
+@@ -314,17 +312,17 @@ class BuilderThread(threading.Thread):
+ else:
+ fd.write('%s' % result.return_code)
+ with open(os.path.join(build_dir, 'toolchain'), 'w') as fd:
+- print >>fd, 'gcc', result.toolchain.gcc
+- print >>fd, 'path', result.toolchain.path
+- print >>fd, 'cross', result.toolchain.cross
+- print >>fd, 'arch', result.toolchain.arch
++ print('gcc', result.toolchain.gcc, file=fd)
++ print('path', result.toolchain.path, file=fd)
++ print('cross', result.toolchain.cross, file=fd)
++ print('arch', result.toolchain.arch, file=fd)
+ fd.write('%s' % result.return_code)
+
+ # Write out the image and function size information and an objdump
+ env = result.toolchain.MakeEnvironment(self.builder.full_path)
+ with open(os.path.join(build_dir, 'env'), 'w') as fd:
+ for var in sorted(env.keys()):
+- print >>fd, '%s="%s"' % (var, env[var])
++ print('%s="%s"' % (var, env[var]), file=fd)
+ lines = []
+ for fname in ['u-boot', 'spl/u-boot-spl']:
+ cmd = ['%snm' % self.toolchain.cross, '--size-sort', fname]
+@@ -335,7 +333,7 @@ class BuilderThread(threading.Thread):
+ nm = self.builder.GetFuncSizesFile(result.commit_upto,
+ result.brd.target, fname)
+ with open(nm, 'w') as fd:
+- print >>fd, nm_result.stdout,
++ print(nm_result.stdout, end=' ', file=fd)
+
+ cmd = ['%sobjdump' % self.toolchain.cross, '-h', fname]
+ dump_result = command.RunPipe([cmd], capture=True,
+@@ -346,7 +344,7 @@ class BuilderThread(threading.Thread):
+ objdump = self.builder.GetObjdumpFile(result.commit_upto,
+ result.brd.target, fname)
+ with open(objdump, 'w') as fd:
+- print >>fd, dump_result.stdout,
++ print(dump_result.stdout, end=' ', file=fd)
+ for line in dump_result.stdout.splitlines():
+ fields = line.split()
+ if len(fields) > 5 and fields[1] == '.rodata':
+@@ -378,7 +376,7 @@ class BuilderThread(threading.Thread):
+ sizes = self.builder.GetSizesFile(result.commit_upto,
+ result.brd.target)
+ with open(sizes, 'w') as fd:
+- print >>fd, '\n'.join(lines)
++ print('\n'.join(lines), file=fd)
+
+ # Write out the configuration files, with a special case for SPL
+ for dirname in ['', 'spl', 'tpl']:
+diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
+index f17aa15e7c..30a8690f93 100755
+--- a/tools/buildman/buildman.py
++++ b/tools/buildman/buildman.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: GPL-2.0+
+ #
+ # Copyright (c) 2012 The Chromium OS Authors.
+@@ -6,6 +6,8 @@
+
+ """See README for more information"""
+
++from __future__ import print_function
++
+ import multiprocessing
+ import os
+ import re
+@@ -46,11 +48,11 @@ def RunTests(skip_net_tests):
+ suite = unittest.TestLoader().loadTestsFromTestCase(module)
+ suite.run(result)
+
+- print result
++ print(result)
+ for test, err in result.errors:
+- print err
++ print(err)
+ for test, err in result.failures:
+- print err
++ print(err)
+
+
+ options, args = cmdline.ParseArgs()
+diff --git a/tools/buildman/control.py b/tools/buildman/control.py
+index 9787b86747..216012d001 100644
+--- a/tools/buildman/control.py
++++ b/tools/buildman/control.py
+@@ -30,7 +30,7 @@ def GetActionSummary(is_summary, commits, selected, options):
+ """
+ if commits:
+ count = len(commits)
+- count = (count + options.step - 1) / options.step
++ count = (count + options.step - 1) // options.step
+ commit_str = '%d commit%s' % (count, GetPlural(count))
+ else:
+ commit_str = 'current source'
+@@ -59,31 +59,31 @@ def ShowActions(series, why_selected, boards_selected, builder, options,
+ board_warnings: List of warnings obtained from board selected
+ """
+ col = terminal.Color()
+- print 'Dry run, so not doing much. But I would do this:'
+- print
++ print('Dry run, so not doing much. But I would do this:')
++ print()
+ if series:
+ commits = series.commits
+ else:
+ commits = None
+- print GetActionSummary(False, commits, boards_selected,
+- options)
+- print 'Build directory: %s' % builder.base_dir
++ print(GetActionSummary(False, commits, boards_selected,
++ options))
++ print('Build directory: %s' % builder.base_dir)
+ if commits:
+ for upto in range(0, len(series.commits), options.step):
+ commit = series.commits[upto]
+- print ' ', col.Color(col.YELLOW, commit.hash[:8], bright=False),
+- print commit.subject
+- print
++ print(' ', col.Color(col.YELLOW, commit.hash[:8], bright=False), end=' ')
++ print(commit.subject)
++ print()
+ for arg in why_selected:
+ if arg != 'all':
+- print arg, ': %d boards' % len(why_selected[arg])
++ print(arg, ': %d boards' % len(why_selected[arg]))
+ if options.verbose:
+- print ' %s' % ' '.join(why_selected[arg])
+- print ('Total boards to build for each commit: %d\n' %
+- len(why_selected['all']))
++ print(' %s' % ' '.join(why_selected[arg]))
++ print(('Total boards to build for each commit: %d\n' %
++ len(why_selected['all'])))
+ if board_warnings:
+ for warning in board_warnings:
+- print col.Color(col.YELLOW, warning)
++ print(col.Color(col.YELLOW, warning))
+
+ def CheckOutputDir(output_dir):
+ """Make sure that the output directory is not within the current directory
+@@ -146,17 +146,17 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
+ if options.fetch_arch:
+ if options.fetch_arch == 'list':
+ sorted_list = toolchains.ListArchs()
+- print col.Color(col.BLUE, 'Available architectures: %s\n' %
+- ' '.join(sorted_list))
++ print(col.Color(col.BLUE, 'Available architectures: %s\n' %
++ ' '.join(sorted_list)))
+ return 0
+ else:
+ fetch_arch = options.fetch_arch
+ if fetch_arch == 'all':
+ fetch_arch = ','.join(toolchains.ListArchs())
+- print col.Color(col.CYAN, '\nDownloading toolchains: %s' %
+- fetch_arch)
++ print(col.Color(col.CYAN, '\nDownloading toolchains: %s' %
++ fetch_arch))
+ for arch in fetch_arch.split(','):
+- print
++ print()
+ ret = toolchains.FetchAndInstall(arch)
+ if ret:
+ return ret
+@@ -167,7 +167,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
+ toolchains.Scan(options.list_tool_chains and options.verbose)
+ if options.list_tool_chains:
+ toolchains.List()
+- print
++ print()
+ return 0
+
+ # Work out how many commits to build. We want to build everything on the
+@@ -191,7 +191,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
+ sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
+ options.branch))
+ if msg:
+- print col.Color(col.YELLOW, msg)
++ print(col.Color(col.YELLOW, msg))
+ count += 1 # Build upstream commit also
+
+ if not count:
+@@ -268,7 +268,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
+ options.threads = min(multiprocessing.cpu_count(), len(selected))
+ if not options.jobs:
+ options.jobs = max(1, (multiprocessing.cpu_count() +
+- len(selected) - 1) / len(selected))
++ len(selected) - 1) // len(selected))
+
+ if not options.step:
+ options.step = len(series.commits) - 1
+diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
+index f90b8ea7f5..4c3d497294 100644
+--- a/tools/buildman/func_test.py
++++ b/tools/buildman/func_test.py
+@@ -270,7 +270,7 @@ class TestFunctional(unittest.TestCase):
+ stdout=''.join(commit_log[:count]))
+
+ # Not handled, so abort
+- print 'git log', args
++ print('git log', args)
+ sys.exit(1)
+
+ def _HandleCommandGitConfig(self, args):
+@@ -286,7 +286,7 @@ class TestFunctional(unittest.TestCase):
+ stdout='refs/heads/master\n')
+
+ # Not handled, so abort
+- print 'git config', args
++ print('git config', args)
+ sys.exit(1)
+
+ def _HandleCommandGit(self, in_args):
+@@ -320,7 +320,7 @@ class TestFunctional(unittest.TestCase):
+ return command.CommandResult(return_code=0)
+
+ # Not handled, so abort
+- print 'git', git_args, sub_cmd, args
++ print('git', git_args, sub_cmd, args)
+ sys.exit(1)
+
+ def _HandleCommandNm(self, args):
+@@ -351,7 +351,7 @@ class TestFunctional(unittest.TestCase):
+ if pipe_list[1] == ['wc', '-l']:
+ wc = True
+ else:
+- print 'invalid pipe', kwargs
++ print('invalid pipe', kwargs)
+ sys.exit(1)
+ cmd = pipe_list[0][0]
+ args = pipe_list[0][1:]
+@@ -371,7 +371,7 @@ class TestFunctional(unittest.TestCase):
+
+ if not result:
+ # Not handled, so abort
+- print 'unknown command', kwargs
++ print('unknown command', kwargs)
+ sys.exit(1)
+
+ if wc:
+@@ -404,14 +404,14 @@ class TestFunctional(unittest.TestCase):
+ return command.CommandResult(return_code=0)
+
+ # Not handled, so abort
+- print 'make', stage
++ print('make', stage)
+ sys.exit(1)
+
+ # Example function to print output lines
+ def print_lines(self, lines):
+- print len(lines)
++ print(len(lines))
+ for line in lines:
+- print line
++ print(line)
+ #self.print_lines(terminal.GetPrintTestLines())
+
+ def testNoBoards(self):
+diff --git a/tools/buildman/test.py b/tools/buildman/test.py
+index ed99b9375c..b4e28d6867 100644
+--- a/tools/buildman/test.py
++++ b/tools/buildman/test.py
+@@ -212,11 +212,11 @@ class TestBuild(unittest.TestCase):
+ self.assertEqual(lines[1].text, '02: %s' % commits[1][1])
+
+ col = terminal.Color()
+- self.assertSummary(lines[2].text, 'sandbox', 'w+', ['board4'],
++ self.assertSummary(lines[2].text, 'arm', 'w+', ['board1'],
+ outcome=OUTCOME_WARN)
+- self.assertSummary(lines[3].text, 'arm', 'w+', ['board1'],
++ self.assertSummary(lines[3].text, 'powerpc', 'w+', ['board2', 'board3'],
+ outcome=OUTCOME_WARN)
+- self.assertSummary(lines[4].text, 'powerpc', 'w+', ['board2', 'board3'],
++ self.assertSummary(lines[4].text, 'sandbox', 'w+', ['board4'],
+ outcome=OUTCOME_WARN)
+
+ # Second commit: The warnings should be listed
+@@ -226,10 +226,10 @@ class TestBuild(unittest.TestCase):
+
+ # Third commit: Still fails
+ self.assertEqual(lines[6].text, '03: %s' % commits[2][1])
+- self.assertSummary(lines[7].text, 'sandbox', '+', ['board4'])
+- self.assertSummary(lines[8].text, 'arm', '', ['board1'],
++ self.assertSummary(lines[7].text, 'arm', '', ['board1'],
+ outcome=OUTCOME_OK)
+- self.assertSummary(lines[9].text, 'powerpc', '+', ['board2', 'board3'])
++ self.assertSummary(lines[8].text, 'powerpc', '+', ['board2', 'board3'])
++ self.assertSummary(lines[9].text, 'sandbox', '+', ['board4'])
+
+ # Expect a compiler error
+ self.assertEqual(lines[10].text, '+%s' %
+@@ -237,8 +237,6 @@ class TestBuild(unittest.TestCase):
+
+ # Fourth commit: Compile errors are fixed, just have warning for board3
+ self.assertEqual(lines[11].text, '04: %s' % commits[3][1])
+- self.assertSummary(lines[12].text, 'sandbox', 'w+', ['board4'],
+- outcome=OUTCOME_WARN)
+ expect = '%10s: ' % 'powerpc'
+ expect += ' ' + col.Color(col.GREEN, '')
+ expect += ' '
+@@ -246,7 +244,9 @@ class TestBuild(unittest.TestCase):
+ expect += ' ' + col.Color(col.YELLOW, 'w+')
+ expect += ' '
+ expect += col.Color(col.YELLOW, ' %s' % 'board3')
+- self.assertEqual(lines[13].text, expect)
++ self.assertEqual(lines[12].text, expect)
++ self.assertSummary(lines[13].text, 'sandbox', 'w+', ['board4'],
++ outcome=OUTCOME_WARN)
+
+ # Compile error fixed
+ self.assertEqual(lines[14].text, '-%s' %
+@@ -259,9 +259,9 @@ class TestBuild(unittest.TestCase):
+
+ # Fifth commit
+ self.assertEqual(lines[16].text, '05: %s' % commits[4][1])
+- self.assertSummary(lines[17].text, 'sandbox', '+', ['board4'])
+- self.assertSummary(lines[18].text, 'powerpc', '', ['board3'],
++ self.assertSummary(lines[17].text, 'powerpc', '', ['board3'],
+ outcome=OUTCOME_OK)
++ self.assertSummary(lines[18].text, 'sandbox', '+', ['board4'])
+
+ # The second line of errors[3] is a duplicate, so buildman will drop it
+ expect = errors[3].rstrip().split('\n')
+diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
+index a65737fdf8..cc26e2ede5 100644
+--- a/tools/buildman/toolchain.py
++++ b/tools/buildman/toolchain.py
+@@ -4,18 +4,19 @@
+
+ import re
+ import glob
+-from HTMLParser import HTMLParser
++from html.parser import HTMLParser
+ import os
+ import sys
+ import tempfile
+-import urllib2
++import urllib.request, urllib.error, urllib.parse
+
+ import bsettings
+ import command
+ import terminal
++import tools
+
+ (PRIORITY_FULL_PREFIX, PRIORITY_PREFIX_GCC, PRIORITY_PREFIX_GCC_PATH,
+- PRIORITY_CALC) = range(4)
++ PRIORITY_CALC) = list(range(4))
+
+ # Simple class to collect links from a page
+ class MyHTMLParser(HTMLParser):
+@@ -100,15 +101,15 @@ class Toolchain:
+ raise_on_error=False)
+ self.ok = result.return_code == 0
+ if verbose:
+- print 'Tool chain test: ',
++ print('Tool chain test: ', end=' ')
+ if self.ok:
+- print "OK, arch='%s', priority %d" % (self.arch,
+- self.priority)
++ print("OK, arch='%s', priority %d" % (self.arch,
++ self.priority))
+ else:
+- print 'BAD'
+- print 'Command: ', cmd
+- print result.stdout
+- print result.stderr
++ print('BAD')
++ print('Command: ', cmd)
++ print(result.stdout)
++ print(result.stderr)
+ else:
+ self.ok = True
+
+@@ -138,7 +139,7 @@ class Toolchain:
+ value = ''
+ for name, value in bsettings.GetItems('toolchain-wrapper'):
+ if not value:
+- print "Warning: Wrapper not found"
++ print("Warning: Wrapper not found")
+ if value:
+ value = value + ' '
+
+@@ -227,11 +228,11 @@ class Toolchains:
+ """
+ toolchains = bsettings.GetItems('toolchain')
+ if show_warning and not toolchains:
+- print ("Warning: No tool chains. Please run 'buildman "
++ print(("Warning: No tool chains. Please run 'buildman "
+ "--fetch-arch all' to download all available toolchains, or "
+ "add a [toolchain] section to your buildman config file "
+ "%s. See README for details" %
+- bsettings.config_fname)
++ bsettings.config_fname))
+
+ paths = []
+ for name, value in toolchains:
+@@ -272,10 +273,10 @@ class Toolchains:
+ if add_it:
+ self.toolchains[toolchain.arch] = toolchain
+ elif verbose:
+- print ("Toolchain '%s' at priority %d will be ignored because "
++ print(("Toolchain '%s' at priority %d will be ignored because "
+ "another toolchain for arch '%s' has priority %d" %
+ (toolchain.gcc, toolchain.priority, toolchain.arch,
+- self.toolchains[toolchain.arch].priority))
++ self.toolchains[toolchain.arch].priority)))
+
+ def ScanPath(self, path, verbose):
+ """Scan a path for a valid toolchain
+@@ -289,9 +290,9 @@ class Toolchains:
+ fnames = []
+ for subdir in ['.', 'bin', 'usr/bin']:
+ dirname = os.path.join(path, subdir)
+- if verbose: print " - looking in '%s'" % dirname
++ if verbose: print(" - looking in '%s'" % dirname)
+ for fname in glob.glob(dirname + '/*gcc'):
+- if verbose: print " - found '%s'" % fname
++ if verbose: print(" - found '%s'" % fname)
+ fnames.append(fname)
+ return fnames
+
+@@ -321,9 +322,9 @@ class Toolchains:
+ Args:
+ verbose: True to print out progress information
+ """
+- if verbose: print 'Scanning for tool chains'
++ if verbose: print('Scanning for tool chains')
+ for name, value in self.prefixes:
+- if verbose: print " - scanning prefix '%s'" % value
++ if verbose: print(" - scanning prefix '%s'" % value)
+ if os.path.exists(value):
+ self.Add(value, True, verbose, PRIORITY_FULL_PREFIX, name)
+ continue
+@@ -335,10 +336,10 @@ class Toolchains:
+ for f in fname_list:
+ self.Add(f, True, verbose, PRIORITY_PREFIX_GCC_PATH, name)
+ if not fname_list:
+- raise ValueError, ("No tool chain found for prefix '%s'" %
++ raise ValueError("No tool chain found for prefix '%s'" %
+ value)
+ for path in self.paths:
+- if verbose: print " - scanning path '%s'" % path
++ if verbose: print(" - scanning path '%s'" % path)
+ fnames = self.ScanPath(path, verbose)
+ for fname in fnames:
+ self.Add(fname, True, verbose)
+@@ -346,13 +347,13 @@ class Toolchains:
+ def List(self):
+ """List out the selected toolchains for each architecture"""
+ col = terminal.Color()
+- print col.Color(col.BLUE, 'List of available toolchains (%d):' %
+- len(self.toolchains))
++ print(col.Color(col.BLUE, 'List of available toolchains (%d):' %
++ len(self.toolchains)))
+ if len(self.toolchains):
+- for key, value in sorted(self.toolchains.iteritems()):
+- print '%-10s: %s' % (key, value.gcc)
++ for key, value in sorted(self.toolchains.items()):
++ print('%-10s: %s' % (key, value.gcc))
+ else:
+- print 'None'
++ print('None')
+
+ def Select(self, arch):
+ """Returns the toolchain for a given architecture
+@@ -370,7 +371,7 @@ class Toolchains:
+ return self.toolchains[alias]
+
+ if not arch in self.toolchains:
+- raise ValueError, ("No tool chain found for arch '%s'" % arch)
++ raise ValueError("No tool chain found for arch '%s'" % arch)
+ return self.toolchains[arch]
+
+ def ResolveReferences(self, var_dict, args):
+@@ -464,9 +465,9 @@ class Toolchains:
+ links = []
+ for version in versions:
+ url = '%s/%s/%s/' % (base, arch, version)
+- print 'Checking: %s' % url
+- response = urllib2.urlopen(url)
+- html = response.read()
++ print('Checking: %s' % url)
++ response = urllib.request.urlopen(url)
++ html = tools.ToString(response.read())
+ parser = MyHTMLParser(fetch_arch)
+ parser.feed(html)
+ if fetch_arch == 'list':
+@@ -488,14 +489,14 @@ class Toolchains:
+ Full path to the downloaded archive file in that directory,
+ or None if there was an error while downloading
+ """
+- print 'Downloading: %s' % url
++ print('Downloading: %s' % url)
+ leaf = url.split('/')[-1]
+ tmpdir = tempfile.mkdtemp('.buildman')
+- response = urllib2.urlopen(url)
++ response = urllib.request.urlopen(url)
+ fname = os.path.join(tmpdir, leaf)
+ fd = open(fname, 'wb')
+ meta = response.info()
+- size = int(meta.getheaders('Content-Length')[0])
++ size = int(meta.get('Content-Length'))
+ done = 0
+ block_size = 1 << 16
+ status = ''
+@@ -504,19 +505,19 @@ class Toolchains:
+ while True:
+ buffer = response.read(block_size)
+ if not buffer:
+- print chr(8) * (len(status) + 1), '\r',
++ print(chr(8) * (len(status) + 1), '\r', end=' ')
+ break
+
+ done += len(buffer)
+ fd.write(buffer)
+- status = r'%10d MiB [%3d%%]' % (done / 1024 / 1024,
+- done * 100 / size)
++ status = r'%10d MiB [%3d%%]' % (done // 1024 // 1024,
++ done * 100 // size)
+ status = status + chr(8) * (len(status) + 1)
+- print status,
++ print(status, end=' ')
+ sys.stdout.flush()
+ fd.close()
+ if done != size:
+- print 'Error, failed to download'
++ print('Error, failed to download')
+ os.remove(fname)
+ fname = None
+ return tmpdir, fname
+@@ -565,11 +566,11 @@ class Toolchains:
+ """
+ # Fist get the URL for this architecture
+ col = terminal.Color()
+- print col.Color(col.BLUE, "Downloading toolchain for arch '%s'" % arch)
++ print(col.Color(col.BLUE, "Downloading toolchain for arch '%s'" % arch))
+ url = self.LocateArchUrl(arch)
+ if not url:
+- print ("Cannot find toolchain for arch '%s' - use 'list' to list" %
+- arch)
++ print(("Cannot find toolchain for arch '%s' - use 'list' to list" %
++ arch))
+ return 2
+ home = os.environ['HOME']
+ dest = os.path.join(home, '.buildman-toolchains')
+@@ -580,28 +581,28 @@ class Toolchains:
+ tmpdir, tarfile = self.Download(url)
+ if not tarfile:
+ return 1
+- print col.Color(col.GREEN, 'Unpacking to: %s' % dest),
++ print(col.Color(col.GREEN, 'Unpacking to: %s' % dest), end=' ')
+ sys.stdout.flush()
+ path = self.Unpack(tarfile, dest)
+ os.remove(tarfile)
+ os.rmdir(tmpdir)
+- print
++ print()
+
+ # Check that the toolchain works
+- print col.Color(col.GREEN, 'Testing')
++ print(col.Color(col.GREEN, 'Testing'))
+ dirpath = os.path.join(dest, path)
+ compiler_fname_list = self.ScanPath(dirpath, True)
+ if not compiler_fname_list:
+- print 'Could not locate C compiler - fetch failed.'
++ print('Could not locate C compiler - fetch failed.')
+ return 1
+ if len(compiler_fname_list) != 1:
+- print col.Color(col.RED, 'Warning, ambiguous toolchains: %s' %
+- ', '.join(compiler_fname_list))
++ print(col.Color(col.RED, 'Warning, ambiguous toolchains: %s' %
++ ', '.join(compiler_fname_list)))
+ toolchain = Toolchain(compiler_fname_list[0], True, True)
+
+ # Make sure that it will be found by buildman
+ if not self.TestSettingsHasPath(dirpath):
+- print ("Adding 'download' to config file '%s'" %
+- bsettings.config_fname)
++ print(("Adding 'download' to config file '%s'" %
++ bsettings.config_fname))
+ bsettings.SetItem('toolchain', 'download', '%s/*/*' % dest)
+ return 0
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Adjust-command-to-return-strings-instead-of-b.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Adjust-command-to-return-strings-instead-of-b.patch
new file mode 100644
index 00000000..4c4f7acb
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Adjust-command-to-return-strings-instead-of-b.patch
@@ -0,0 +1,228 @@
+From 3b3e3c0f6c261a8c9f989d437dc261ba84467d4f Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Thu, 31 Oct 2019 07:42:50 -0600
+Subject: [PATCH] patman: Adjust 'command' to return strings instead of bytes
+
+At present all the 'command' methods return bytes. Most of the time we
+actually want strings, so change this. We still need to keep the internal
+representation as bytes since otherwise unicode strings might break over
+a read() boundary (e.g. 4KB), causing errors. But we can convert the end
+result to strings.
+
+Add a 'binary' parameter to cover the few cases where bytes are needed.
+
+Upstream-Status: Backport
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+---
+ tools/binman/cbfs_util_test.py | 2 +-
+ tools/binman/ftest.py | 2 +-
+ tools/patman/command.py | 31 +++++++++++++++++++++++--------
+ tools/patman/tools.py | 29 +++++++++++++++++++++--------
+ 4 files changed, 46 insertions(+), 18 deletions(-)
+
+diff --git a/tools/binman/cbfs_util_test.py b/tools/binman/cbfs_util_test.py
+index 772c794ece..ddc2e09e35 100755
+--- a/tools/binman/cbfs_util_test.py
++++ b/tools/binman/cbfs_util_test.py
+@@ -56,7 +56,7 @@ class TestCbfs(unittest.TestCase):
+ cls.have_lz4 = True
+ try:
+ tools.Run('lz4', '--no-frame-crc', '-c',
+- tools.GetInputFilename('u-boot.bin'))
++ tools.GetInputFilename('u-boot.bin'), binary=True)
+ except:
+ cls.have_lz4 = False
+
+--- a/tools/binman/ftest.py
++++ b/tools/binman/ftest.py
+@@ -151,7 +151,7 @@ class TestFunctional(unittest.TestCase):
+ self.have_lz4 = True
+ try:
+ tools.Run('lz4', '--no-frame-crc', '-c',
+- os.path.join(self._indir, 'u-boot.bin'))
++ os.path.join(self._indir, 'u-boot.bin'), binary=True)
+ except:
+ self.have_lz4 = False
+
+diff --git a/tools/patman/command.py b/tools/patman/command.py
+index 16299f3f5b..5fbd2c4a3e 100644
+--- a/tools/patman/command.py
++++ b/tools/patman/command.py
+@@ -4,6 +4,7 @@
+
+ import os
+ import cros_subprocess
++import tools
+
+ """Shell command ease-ups for Python."""
+
+@@ -31,6 +32,13 @@ class CommandResult:
+ self.return_code = return_code
+ self.exception = exception
+
++ def ToOutput(self, binary):
++ if not binary:
++ self.stdout = tools.ToString(self.stdout)
++ self.stderr = tools.ToString(self.stderr)
++ self.combined = tools.ToString(self.combined)
++ return self
++
+
+ # This permits interception of RunPipe for test purposes. If it is set to
+ # a function, then that function is called with the pipe list being
+@@ -41,7 +49,7 @@ test_result = None
+
+ def RunPipe(pipe_list, infile=None, outfile=None,
+ capture=False, capture_stderr=False, oneline=False,
+- raise_on_error=True, cwd=None, **kwargs):
++ raise_on_error=True, cwd=None, binary=False, **kwargs):
+ """
+ Perform a command pipeline, with optional input/output filenames.
+
+@@ -67,7 +75,7 @@ def RunPipe(pipe_list, infile=None, outfile=None,
+ else:
+ return test_result
+ # No result: fall through to normal processing
+- result = CommandResult()
++ result = CommandResult(b'', b'', b'')
+ last_pipe = None
+ pipeline = list(pipe_list)
+ user_pipestr = '|'.join([' '.join(pipe) for pipe in pipe_list])
+@@ -93,29 +101,36 @@ def RunPipe(pipe_list, infile=None, outfile=None,
+ if raise_on_error:
+ raise Exception("Error running '%s': %s" % (user_pipestr, str))
+ result.return_code = 255
+- return result
++ return result.ToOutput(binary)
+
+ if capture:
+ result.stdout, result.stderr, result.combined = (
+ last_pipe.CommunicateFilter(None))
+ if result.stdout and oneline:
+- result.output = result.stdout.rstrip('\r\n')
++ result.output = result.stdout.rstrip(b'\r\n')
+ result.return_code = last_pipe.wait()
+ else:
+ result.return_code = os.waitpid(last_pipe.pid, 0)[1]
+ if raise_on_error and result.return_code:
+ raise Exception("Error running '%s'" % user_pipestr)
+- return result
++ return result.ToOutput(binary)
+
+ def Output(*cmd, **kwargs):
+ kwargs['raise_on_error'] = kwargs.get('raise_on_error', True)
+ return RunPipe([cmd], capture=True, **kwargs).stdout
+
+ def OutputOneLine(*cmd, **kwargs):
++ """Run a command and output it as a single-line string
++
++ The command us expected to produce a single line of output
++
++ Returns:
++ String containing output of command
++ """
+ raise_on_error = kwargs.pop('raise_on_error', True)
+- return (RunPipe([cmd], capture=True, oneline=True,
+- raise_on_error=raise_on_error,
+- **kwargs).stdout.strip())
++ result = RunPipe([cmd], capture=True, oneline=True,
++ raise_on_error=raise_on_error, **kwargs).stdout.strip()
++ return result
+
+ def Run(*cmd, **kwargs):
+ return RunPipe([cmd], **kwargs).stdout
+diff --git a/tools/patman/tools.py b/tools/patman/tools.py
+index 4a7fcdad21..3feddb292f 100644
+--- a/tools/patman/tools.py
++++ b/tools/patman/tools.py
+@@ -186,7 +186,7 @@ def PathHasFile(path_spec, fname):
+ return True
+ return False
+
+-def Run(name, *args):
++def Run(name, *args, **kwargs):
+ """Run a tool with some arguments
+
+ This runs a 'tool', which is a program used by binman to process files and
+@@ -201,13 +201,14 @@ def Run(name, *args):
+ CommandResult object
+ """
+ try:
++ binary = kwargs.get('binary')
+ env = None
+ if tool_search_paths:
+ env = dict(os.environ)
+ env['PATH'] = ':'.join(tool_search_paths) + ':' + env['PATH']
+ all_args = (name,) + args
+ result = command.RunPipe([all_args], capture=True, capture_stderr=True,
+- env=env, raise_on_error=False)
++ env=env, raise_on_error=False, binary=binary)
+ if result.return_code:
+ raise Exception("Error %d running '%s': %s" %
+ (result.return_code,' '.join(all_args),
+@@ -375,7 +376,7 @@ def ToBytes(string):
+ """Convert a str type into a bytes type
+
+ Args:
+- string: string to convert value
++ string: string to convert
+
+ Returns:
+ Python 3: A bytes type
+@@ -385,6 +386,18 @@ def ToBytes(string):
+ return string.encode('utf-8')
+ return string
+
++def ToString(bval):
++ """Convert a bytes type into a str type
++
++ Args:
++ bval: bytes value to convert
++
++ Returns:
++ Python 3: A bytes type
++ Python 2: A string type
++ """
++ return bval.decode('utf-8')
++
+ def Compress(indata, algo, with_header=True):
+ """Compress some data using a given algorithm
+
+@@ -406,14 +419,14 @@ def Compress(indata, algo, with_header=True):
+ fname = GetOutputFilename('%s.comp.tmp' % algo)
+ WriteFile(fname, indata)
+ if algo == 'lz4':
+- data = Run('lz4', '--no-frame-crc', '-c', fname)
++ data = Run('lz4', '--no-frame-crc', '-c', fname, binary=True)
+ # cbfstool uses a very old version of lzma
+ elif algo == 'lzma':
+ outfname = GetOutputFilename('%s.comp.otmp' % algo)
+ Run('lzma_alone', 'e', fname, outfname, '-lc1', '-lp0', '-pb0', '-d8')
+ data = ReadFile(outfname)
+ elif algo == 'gzip':
+- data = Run('gzip', '-c', fname)
++ data = Run('gzip', '-c', fname, binary=True)
+ else:
+ raise ValueError("Unknown algorithm '%s'" % algo)
+ if with_header:
+@@ -446,13 +459,13 @@ def Decompress(indata, algo, with_header=True):
+ with open(fname, 'wb') as fd:
+ fd.write(indata)
+ if algo == 'lz4':
+- data = Run('lz4', '-dc', fname)
++ data = Run('lz4', '-dc', fname, binary=True)
+ elif algo == 'lzma':
+ outfname = GetOutputFilename('%s.decomp.otmp' % algo)
+ Run('lzma_alone', 'd', fname, outfname)
+- data = ReadFile(outfname)
++ data = ReadFile(outfname, binary=True)
+ elif algo == 'gzip':
+- data = Run('gzip', '-cd', fname)
++ data = Run('gzip', '-cd', fname, binary=True)
+ else:
+ raise ValueError("Unknown algorithm '%s'" % algo)
+ return data
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Drop-binary-parameter.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Drop-binary-parameter.patch
new file mode 100644
index 00000000..cee88472
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Drop-binary-parameter.patch
@@ -0,0 +1,105 @@
+From 3b1c0b09c99bfd30355a6ba87a15e9d408a51109 Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Sat, 24 Aug 2019 07:22:41 -0600
+Subject: [PATCH] patman: Drop binary parameter
+
+Since cros_subprocess use bytestrings now, this feature not needed. Drop
+it.
+
+Upstream-Status: Backport
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+---
+ tools/patman/cros_subprocess.py | 3 +--
+ tools/patman/tools.py | 15 +++++++--------
+ 2 files changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py
+index 06be64cc2c..0f0d60dfb7 100644
+--- a/tools/patman/cros_subprocess.py
++++ b/tools/patman/cros_subprocess.py
+@@ -54,7 +54,7 @@ class Popen(subprocess.Popen):
+ """
+
+ def __init__(self, args, stdin=None, stdout=PIPE_PTY, stderr=PIPE_PTY,
+- shell=False, cwd=None, env=None, binary=False, **kwargs):
++ shell=False, cwd=None, env=None, **kwargs):
+ """Cut-down constructor
+
+ Args:
+@@ -72,7 +72,6 @@ class Popen(subprocess.Popen):
+ """
+ stdout_pty = None
+ stderr_pty = None
+- self.binary = binary
+
+ if stdout == PIPE_PTY:
+ stdout_pty = pty.openpty()
+diff --git a/tools/patman/tools.py b/tools/patman/tools.py
+index 0d4705db76..97441ca796 100644
+--- a/tools/patman/tools.py
++++ b/tools/patman/tools.py
+@@ -186,7 +186,7 @@ def PathHasFile(path_spec, fname):
+ return True
+ return False
+
+-def Run(name, *args, **kwargs):
++def Run(name, *args):
+ """Run a tool with some arguments
+
+ This runs a 'tool', which is a program used by binman to process files and
+@@ -196,7 +196,6 @@ def Run(name, *args, **kwargs):
+ Args:
+ name: Command name to run
+ args: Arguments to the tool
+- kwargs: Options to pass to command.run()
+
+ Returns:
+ CommandResult object
+@@ -206,8 +205,8 @@ def Run(name, *args, **kwargs):
+ if tool_search_paths:
+ env = dict(os.environ)
+ env['PATH'] = ':'.join(tool_search_paths) + ':' + env['PATH']
+- return command.Run(name, *args, capture=True,
+- capture_stderr=True, env=env, **kwargs)
++ return command.Run(name, *args, capture=True, capture_stderr=True,
++ env=env)
+ except:
+ if env and not PathHasFile(env['PATH'], name):
+ msg = "Please install tool '%s'" % name
+@@ -401,14 +400,14 @@ def Compress(indata, algo, with_header=True):
+ fname = GetOutputFilename('%s.comp.tmp' % algo)
+ WriteFile(fname, indata)
+ if algo == 'lz4':
+- data = Run('lz4', '--no-frame-crc', '-c', fname, binary=True)
++ data = Run('lz4', '--no-frame-crc', '-c', fname)
+ # cbfstool uses a very old version of lzma
+ elif algo == 'lzma':
+ outfname = GetOutputFilename('%s.comp.otmp' % algo)
+ Run('lzma_alone', 'e', fname, outfname, '-lc1', '-lp0', '-pb0', '-d8')
+ data = ReadFile(outfname)
+ elif algo == 'gzip':
+- data = Run('gzip', '-c', fname, binary=True)
++ data = Run('gzip', '-c', fname)
+ else:
+ raise ValueError("Unknown algorithm '%s'" % algo)
+ if with_header:
+@@ -441,13 +440,13 @@ def Decompress(indata, algo, with_header=True):
+ with open(fname, 'wb') as fd:
+ fd.write(indata)
+ if algo == 'lz4':
+- data = Run('lz4', '-dc', fname, binary=True)
++ data = Run('lz4', '-dc', fname)
+ elif algo == 'lzma':
+ outfname = GetOutputFilename('%s.decomp.otmp' % algo)
+ Run('lzma_alone', 'd', fname, outfname)
+ data = ReadFile(outfname)
+ elif algo == 'gzip':
+- data = Run('gzip', '-cd', fname, binary=True)
++ data = Run('gzip', '-cd', fname)
+ else:
+ raise ValueError("Unknown algorithm '%s'" % algo)
+ return data
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Update-command.Run-to-handle-failure-better.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Update-command.Run-to-handle-failure-better.patch
new file mode 100644
index 00000000..bd23c458
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-patman-Update-command.Run-to-handle-failure-better.patch
@@ -0,0 +1,42 @@
+From 6eace398072a62e74f10f412ffadfe51b7402395 Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Sat, 24 Aug 2019 07:22:42 -0600
+Subject: [PATCH] patman: Update command.Run() to handle failure better
+
+At present tools are not expected to fail. If they do an exception is
+raised but there is no detail about what went wrong. This makes it hard
+to debug if something does actually go wrong.
+
+Fix this by outputting both stderr and stdout on failure.
+
+Upstream-Status: Backport
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+---
+ tools/patman/tools.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/patman/tools.py b/tools/patman/tools.py
+index 97441ca796..0952681579 100644
+--- a/tools/patman/tools.py
++++ b/tools/patman/tools.py
+@@ -205,8 +205,14 @@ def Run(name, *args):
+ if tool_search_paths:
+ env = dict(os.environ)
+ env['PATH'] = ':'.join(tool_search_paths) + ':' + env['PATH']
+- return command.Run(name, *args, capture=True, capture_stderr=True,
+- env=env)
++ all_args = (name,) + args
++ result = command.RunPipe([all_args], capture=True, capture_stderr=True,
++ env=env, raise_on_error=False)
++ if result.return_code:
++ raise Exception("Error %d running '%s': %s" %
++ (result.return_code,' '.join(all_args),
++ result.stderr))
++ return result.stdout
+ except:
+ if env and not PathHasFile(env['PATH'], name):
+ msg = "Please install tool '%s'" % name
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch
new file mode 100644
index 00000000..e74609de
--- /dev/null
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq/0001-pylibfdt-Convert-to-Python-3.patch
@@ -0,0 +1,117 @@
+From b4cf5f1df741e8781bed6149291823cd1a4b8baa Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Thu, 31 Oct 2019 07:42:59 -0600
+Subject: [PATCH] pylibfdt: Convert to Python 3
+
+Build this swig module with Python 3.
+
+Upstream-Status: Backport
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+---
+ scripts/dtc/pylibfdt/Makefile | 2 +-
+ scripts/dtc/pylibfdt/libfdt.i_shipped | 2 +-
+ scripts/dtc/pylibfdt/setup.py | 2 +-
+ tools/binman/entry.py | 16 ++--------------
+ tools/binman/entry_test.py | 15 ---------------
+ 5 files changed, 5 insertions(+), 32 deletions(-)
+
+diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile
+index 15e66ad44d..42342c75bb 100644
+--- a/scripts/dtc/pylibfdt/Makefile
++++ b/scripts/dtc/pylibfdt/Makefile
+@@ -21,7 +21,7 @@ quiet_cmd_pymod = PYMOD $@
+ CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir)" OBJDIR=$(obj) \
+ SOURCES="$(PYLIBFDT_srcs)" \
+ SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \
+- $(PYTHON2) $< --quiet build_ext --inplace
++ $(PYTHON3) $< --quiet build_ext --inplace
+
+ $(obj)/_libfdt.so: $(src)/setup.py $(PYLIBFDT_srcs) FORCE
+ $(call if_changed,pymod)
+diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
+index 76e61e98bd..53b70f8f5e 100644
+--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
+@@ -624,7 +624,7 @@ class Fdt(FdtRo):
+ Raises:
+ FdtException if no parent found or other error occurs
+ """
+- val = val.encode('utf-8') + '\0'
++ val = val.encode('utf-8') + b'\0'
+ return check_err(fdt_setprop(self._fdt, nodeoffset, prop_name,
+ val, len(val)), quiet)
+
+diff --git a/scripts/dtc/pylibfdt/setup.py b/scripts/dtc/pylibfdt/setup.py
+index 4f7cf042bf..992cdec30f 100755
+--- a/scripts/dtc/pylibfdt/setup.py
++++ b/scripts/dtc/pylibfdt/setup.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+
+ """
+ setup.py file for SWIG libfdt
+diff --git a/tools/binman/entry.py b/tools/binman/entry.py
+index 409c0dca93..5bf5be4794 100644
+--- a/tools/binman/entry.py
++++ b/tools/binman/entry.py
+@@ -7,16 +7,7 @@
+ from __future__ import print_function
+
+ from collections import namedtuple
+-
+-# importlib was introduced in Python 2.7 but there was a report of it not
+-# working in 2.7.12, so we work around this:
+-# http://lists.denx.de/pipermail/u-boot/2016-October/269729.html
+-try:
+- import importlib
+- have_importlib = True
+-except:
+- have_importlib = False
+-
++import importlib
+ import os
+ import sys
+
+@@ -119,10 +110,7 @@ class Entry(object):
+ old_path = sys.path
+ sys.path.insert(0, os.path.join(our_path, 'etype'))
+ try:
+- if have_importlib:
+- module = importlib.import_module(module_name)
+- else:
+- module = __import__(module_name)
++ module = importlib.import_module(module_name)
+ except ImportError as e:
+ raise ValueError("Unknown entry type '%s' in node '%s' (expected etype/%s.py, error '%s'" %
+ (etype, node_path, module_name, e))
+diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
+index 13f5864516..277e10b585 100644
+--- a/tools/binman/entry_test.py
++++ b/tools/binman/entry_test.py
+@@ -39,21 +39,6 @@ class TestEntry(unittest.TestCase):
+ else:
+ import entry
+
+- def test1EntryNoImportLib(self):
+- """Test that we can import Entry subclassess successfully"""
+- sys.modules['importlib'] = None
+- global entry
+- self._ReloadEntry()
+- entry.Entry.Create(None, self.GetNode(), 'u-boot')
+- self.assertFalse(entry.have_importlib)
+-
+- def test2EntryImportLib(self):
+- del sys.modules['importlib']
+- global entry
+- self._ReloadEntry()
+- entry.Entry.Create(None, self.GetNode(), 'u-boot-spl')
+- self.assertTrue(entry.have_importlib)
+-
+ def testEntryContents(self):
+ """Test the Entry bass class"""
+ import entry
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq_2018.09.bb b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq_2019.10.bb
index 8438134d..571fadb7 100644
--- a/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq_2018.09.bb
+++ b/bsp/meta-freescale/recipes-bsp/u-boot/u-boot-qoriq_2019.10.bb
@@ -1,21 +1,48 @@
require recipes-bsp/u-boot/u-boot.inc
-require u-boot-qoriq-common_${PV}.inc
DESCRIPTION = "U-Boot provided by Freescale with focus on QorIQ boards"
PROVIDES += "u-boot"
+inherit fsl-u-boot-localversion
+
+LICENSE = "GPLv2 & BSD-3-Clause & BSD-2-Clause & LGPL-2.0 & LGPL-2.1"
+LIC_FILES_CHKSUM = " \
+ file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://Licenses/bsd-2-clause.txt;md5=6a31f076f5773aabd8ff86191ad6fdd5 \
+ file://Licenses/bsd-3-clause.txt;md5=4a1190eac56a9db675d58ebe86eaf50c \
+ file://Licenses/lgpl-2.0.txt;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+ file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
+"
+
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/u-boot;nobranch=1 \
+ file://0001-patman-Drop-binary-parameter.patch \
+ file://0001-patman-Update-command.Run-to-handle-failure-better.patch \
+ file://0001-patman-Adjust-command-to-return-strings-instead-of-b.patch \
+ file://0001-pylibfdt-Convert-to-Python-3.patch \
+ file://0001-binman-Convert-a-few-tests-to-Python-3.patch \
+ file://0001-binman-Move-to-use-Python-3.patch \
+ file://0001-buildman-Convert-to-Python-3.patch \
+ file://0001-Remove-redundant-YYLOC-global-declaration.patch \
+"
+SRCREV= "1e55b2f9e7f56b76569089b9e950f49c1579580e"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+PV_append = "+fslgit"
+LOCALVERSION = "+fsl"
+
INHIBIT_DEFAULT_DEPS = "1"
-DEPENDS = "libgcc virtual/${TARGET_PREFIX}gcc bison-native bc-native swig-native python-native"
-DEPENDS_append_qoriq-arm64 = " change-file-endianess-native dtc-native tcl-native"
-DEPENDS_append_qoriq-arm = " change-file-endianess-native dtc-native tcl-native"
+DEPENDS = "libgcc virtual/${TARGET_PREFIX}gcc bison-native bc-native swig-native python3-native"
+DEPENDS_append_qoriq-arm64 = " dtc-native"
+DEPENDS_append_qoriq-arm = " dtc-native"
DEPENDS_append_qoriq-ppc = " boot-format-native"
python () {
- if d.getVar("TCMODE", True) == "external-fsl":
+ if d.getVar("TCMODE") == "external-fsl":
return
- ml = d.getVar("MULTILIB_VARIANTS", True)
- arch = d.getVar("OVERRIDES", True)
+ ml = d.getVar("MULTILIB_VARIANTS")
+ arch = d.getVar("OVERRIDES")
if "e5500-64b:" in arch or "e6500-64b:" in arch:
if not "lib32" in ml:
@@ -46,6 +73,7 @@ ENDIANNESS_LD = "${@bb.utils.contains("LE_UBOOT_FOR_ARMBE_TARGET", "1", "-EL", "
WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${ENDIANNESS_GCC}" LD="${WRAP_TARGET_PREFIX}ld ${ENDIANNESS_LD}" V=1'
EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
do_compile_append_qoriq() {
unset i j k
diff --git a/bsp/meta-freescale/recipes-bsp/uefi/uefi_git.bb b/bsp/meta-freescale/recipes-bsp/uefi/uefi_git.bb
index 8b63f501..f94a67e2 100644
--- a/bsp/meta-freescale/recipes-bsp/uefi/uefi_git.bb
+++ b/bsp/meta-freescale/recipes-bsp/uefi/uefi_git.bb
@@ -3,10 +3,10 @@ SECTION = "bootloaders"
LICENSE = "NXP-Binary-EULA"
LIC_FILES_CHKSUM = "file://NXP-Binary-EULA;md5=343ec8f06efc37467a6de53686fa6315"
-inherit deploy fsl-eula-unpack
+inherit deploy
-SRC_URI = "git://github.com/NXP/qoriq-uefi-binary.git;fsl-eula=true;nobranch=1"
-SRCREV= "5b259f75decbc478bcab0612d79a58562bef1838"
+SRC_URI = "git://github.com/NXP/qoriq-uefi-binary.git;nobranch=1"
+SRCREV= "e95ed52322f15437f98dee2b27de45a7495d648c"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch
deleted file mode 100644
index 736bb39a..00000000
--- a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Remove-test-that-requires-running-as-non-root.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 3fdb1e2a16ea405c6731447a8994f222808ef7e6 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Fri, 7 Apr 2017 18:01:52 +0300
-Subject: [PATCH] Remove test that requires running as non-root
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- test/recipes/40-test_rehash.t | 17 +----------------
- 1 file changed, 1 insertion(+), 16 deletions(-)
-
-diff --git a/test/recipes/40-test_rehash.t b/test/recipes/40-test_rehash.t
-index f902c23..c7567c1 100644
---- a/test/recipes/40-test_rehash.t
-+++ b/test/recipes/40-test_rehash.t
-@@ -23,7 +23,7 @@ setup("test_rehash");
- plan skip_all => "test_rehash is not available on this platform"
- unless run(app(["openssl", "rehash", "-help"]));
-
--plan tests => 5;
-+plan tests => 3;
-
- indir "rehash.$$" => sub {
- prepare();
-@@ -42,21 +42,6 @@ indir "rehash.$$" => sub {
- 'Testing rehash operations on empty directory');
- }, create => 1, cleanup => 1;
-
--indir "rehash.$$" => sub {
-- prepare();
-- chmod 0500, curdir();
-- SKIP: {
-- if (!ok(!open(FOO, ">unwritable.txt"),
-- "Testing that we aren't running as a privileged user, such as root")) {
-- close FOO;
-- skip "It's pointless to run the next test as root", 1;
-- }
-- isnt(run(app(["openssl", "rehash", curdir()])), 1,
-- 'Testing rehash operations on readonly directory');
-- }
-- chmod 0700, curdir(); # make it writable again, so cleanup works
--}, create => 1, cleanup => 1;
--
- sub prepare {
- my @pemsourcefiles = sort glob(srctop_file('test', "*.pem"));
- my @destfiles = ();
---
-2.11.0
-
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch
deleted file mode 100644
index 6ce4e47d..00000000
--- a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-Take-linking-flags-from-LDFLAGS-env-var.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 08face4353d80111973aba9c1304c92158cfad0e Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Tue, 28 Mar 2017 16:40:12 +0300
-Subject: [PATCH] Take linking flags from LDFLAGS env var
-
-This fixes "No GNU_HASH in the elf binary" issues.
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- Configurations/unix-Makefile.tmpl | 2 +-
- Configure | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
-index c029817..43b769b 100644
---- a/Configurations/unix-Makefile.tmpl
-+++ b/Configurations/unix-Makefile.tmpl
-@@ -173,7 +173,7 @@ CROSS_COMPILE= {- $config{cross_compile_prefix} -}
- CC= $(CROSS_COMPILE){- $target{cc} -}
- CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -}
- CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
--LDFLAGS= {- $target{lflags} -}
-+LDFLAGS= {- $target{lflags}." ".$ENV{'LDFLAGS'} -}
- PLIB_LDFLAGS= {- $target{plib_lflags} -}
- EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
- LIB_CFLAGS={- $target{shared_cflag} || "" -}
-diff --git a/Configure b/Configure
-index aee7cc3..274d236 100755
---- a/Configure
-+++ b/Configure
-@@ -979,7 +979,7 @@ $config{build_file} = $target{build_file};
- $config{defines} = [];
- $config{cflags} = "";
- $config{ex_libs} = "";
--$config{shared_ldflag} = "";
-+$config{shared_ldflag} = $ENV{'LDFLAGS'};
-
- # Make sure build_scheme is consistent.
- $target{build_scheme} = [ $target{build_scheme} ]
---
-2.11.0
-
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch
deleted file mode 100644
index bb0a1689..00000000
--- a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From bcc096a50811bf0f0c4fd34b2993fed7a7015972 Mon Sep 17 00:00:00 2001
-From: Andy Polyakov <appro@openssl.org>
-Date: Fri, 3 Nov 2017 23:30:01 +0100
-Subject: [PATCH] aes/asm/{aes-armv4|bsaes-armv7}.pl: make it work with
- binutils-2.29.
-
-It's not clear if it's a feature or bug, but binutils-2.29[.1]
-interprets 'adr' instruction with Thumb2 code reference differently,
-in a way that affects calculation of addresses of constants' tables.
-
-Upstream-Status: Backport
-
-Reviewed-by: Tim Hudson <tjh@openssl.org>
-Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
-Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-(Merged from https://github.com/openssl/openssl/pull/4669)
-
-(cherry picked from commit b82acc3c1a7f304c9df31841753a0fa76b5b3cda)
----
- crypto/aes/asm/aes-armv4.pl | 6 +++---
- crypto/aes/asm/bsaes-armv7.pl | 6 +++---
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl
-index 16d79aae53..c6474b8aad 100644
---- a/crypto/aes/asm/aes-armv4.pl
-+++ b/crypto/aes/asm/aes-armv4.pl
-@@ -200,7 +200,7 @@ AES_encrypt:
- #ifndef __thumb2__
- sub r3,pc,#8 @ AES_encrypt
- #else
-- adr r3,AES_encrypt
-+ adr r3,.
- #endif
- stmdb sp!,{r1,r4-r12,lr}
- #ifdef __APPLE__
-@@ -450,7 +450,7 @@ _armv4_AES_set_encrypt_key:
- #ifndef __thumb2__
- sub r3,pc,#8 @ AES_set_encrypt_key
- #else
-- adr r3,AES_set_encrypt_key
-+ adr r3,.
- #endif
- teq r0,#0
- #ifdef __thumb2__
-@@ -976,7 +976,7 @@ AES_decrypt:
- #ifndef __thumb2__
- sub r3,pc,#8 @ AES_decrypt
- #else
-- adr r3,AES_decrypt
-+ adr r3,.
- #endif
- stmdb sp!,{r1,r4-r12,lr}
- #ifdef __APPLE__
-diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl
-index 9f288660ef..a27bb4a179 100644
---- a/crypto/aes/asm/bsaes-armv7.pl
-+++ b/crypto/aes/asm/bsaes-armv7.pl
-@@ -744,7 +744,7 @@ $code.=<<___;
- .type _bsaes_decrypt8,%function
- .align 4
- _bsaes_decrypt8:
-- adr $const,_bsaes_decrypt8
-+ adr $const,.
- vldmia $key!, {@XMM[9]} @ round 0 key
- #ifdef __APPLE__
- adr $const,.LM0ISR
-@@ -843,7 +843,7 @@ _bsaes_const:
- .type _bsaes_encrypt8,%function
- .align 4
- _bsaes_encrypt8:
-- adr $const,_bsaes_encrypt8
-+ adr $const,.
- vldmia $key!, {@XMM[9]} @ round 0 key
- #ifdef __APPLE__
- adr $const,.LM0SR
-@@ -951,7 +951,7 @@ $code.=<<___;
- .type _bsaes_key_convert,%function
- .align 4
- _bsaes_key_convert:
-- adr $const,_bsaes_key_convert
-+ adr $const,.
- vld1.8 {@XMM[7]}, [$inp]! @ load round 0 key
- #ifdef __APPLE__
- adr $const,.LM0
---
-2.15.0
-
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-eng_devcrypto-add-support-for-TLS-algorithms-offload.patch b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-eng_devcrypto-add-support-for-TLS-algorithms-offload.patch
new file mode 100644
index 00000000..499df59b
--- /dev/null
+++ b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0001-eng_devcrypto-add-support-for-TLS-algorithms-offload.patch
@@ -0,0 +1,389 @@
+From 501988587567b996c9c4a14239f575e77ed27791 Mon Sep 17 00:00:00 2001
+From: Pankaj Gupta <pankaj.gupta@nxp.com>
+Date: Fri, 20 Sep 2019 12:18:16 +0530
+Subject: [PATCH 1/2] eng_devcrypto: add support for TLS algorithms offload
+
+ - aes-128-cbc-hmac-sha1
+ - aes-256-cbc-hmac-sha1
+
+Requires TLS patches on cryptodev and TLS algorithm support in Linux
+kernel driver.
+
+Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
+---
+ crypto/engine/eng_devcrypto.c | 265 +++++++++++++++++++++++++++++-----
+ 1 file changed, 231 insertions(+), 34 deletions(-)
+
+diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
+index 49e9ce1af3..727a660e75 100644
+--- a/crypto/engine/eng_devcrypto.c
++++ b/crypto/engine/eng_devcrypto.c
+@@ -60,6 +60,9 @@ struct cipher_ctx {
+ struct session_op sess;
+ int op; /* COP_ENCRYPT or COP_DECRYPT */
+ unsigned long mode; /* EVP_CIPH_*_MODE */
++ unsigned char *aad;
++ unsigned int aad_len;
++ unsigned int len;
+
+ /* to handle ctr mode being a stream cipher */
+ unsigned char partial[EVP_MAX_BLOCK_LENGTH];
+@@ -73,49 +76,62 @@ static const struct cipher_data_st {
+ int ivlen;
+ int flags;
+ int devcryptoid;
++ int mackeylen;
+ } cipher_data[] = {
+ #ifndef OPENSSL_NO_DES
+- { NID_des_cbc, 8, 8, 8, EVP_CIPH_CBC_MODE, CRYPTO_DES_CBC },
+- { NID_des_ede3_cbc, 8, 24, 8, EVP_CIPH_CBC_MODE, CRYPTO_3DES_CBC },
++ { NID_des_cbc, 8, 8, 8, EVP_CIPH_CBC_MODE, CRYPTO_DES_CBC, 0 },
++ { NID_des_ede3_cbc, 8, 24, 8, EVP_CIPH_CBC_MODE, CRYPTO_3DES_CBC, 0 },
+ #endif
+ #ifndef OPENSSL_NO_BF
+- { NID_bf_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_BLF_CBC },
++ { NID_bf_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_BLF_CBC, 0 },
+ #endif
+ #ifndef OPENSSL_NO_CAST
+- { NID_cast5_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_CAST_CBC },
++ { NID_cast5_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_CAST_CBC, 0 },
+ #endif
+- { NID_aes_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
+- { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
+- { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
++ { NID_aes_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC, 0 },
++ { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC, 0 },
++ { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC, 0 },
++ { NID_aes_128_cbc_hmac_sha1, 16, 16, 16,
++ EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
++ CRYPTO_TLS10_AES_CBC_HMAC_SHA1, 20 },
++ { NID_aes_256_cbc_hmac_sha1, 16, 32, 16,
++ EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
++ CRYPTO_TLS10_AES_CBC_HMAC_SHA1, 20 },
+ #ifndef OPENSSL_NO_RC4
+- { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 },
++ { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4, 0 },
+ #endif
+ #if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_CTR)
+- { NID_aes_128_ctr, 16, 128 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
+- { NID_aes_192_ctr, 16, 192 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
+- { NID_aes_256_ctr, 16, 256 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
++ { NID_aes_128_ctr, 16, 128 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR, 0 },
++ { NID_aes_192_ctr, 16, 192 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR, 0 },
++ { NID_aes_256_ctr, 16, 256 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR, 0 },
+ #endif
+ #if 0 /* Not yet supported */
+- { NID_aes_128_xts, 16, 128 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
+- { NID_aes_256_xts, 16, 256 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
++ { NID_aes_128_xts, 16, 128 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS,
++ 0 },
++ { NID_aes_256_xts, 16, 256 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS,
++ 0 },
+ #endif
+ #if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_ECB)
+- { NID_aes_128_ecb, 16, 128 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
+- { NID_aes_192_ecb, 16, 192 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
+- { NID_aes_256_ecb, 16, 256 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
++ { NID_aes_128_ecb, 16, 128 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB, 0 },
++ { NID_aes_192_ecb, 16, 192 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB, 0 },
++ { NID_aes_256_ecb, 16, 256 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB, 0 },
+ #endif
+ #if 0 /* Not yet supported */
+- { NID_aes_128_gcm, 16, 128 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
+- { NID_aes_192_gcm, 16, 192 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
+- { NID_aes_256_gcm, 16, 256 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
++ { NID_aes_128_gcm, 16, 128 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM, 0 },
++ { NID_aes_192_gcm, 16, 192 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM, 0 },
++ { NID_aes_256_gcm, 16, 256 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM, 0 },
++#endif
++#ifdef OPENSSL_NXP_CAAM
++ { NID_aes_128_gcm, 16, 128 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM, 0 },
++ { NID_aes_192_gcm, 16, 192 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM, 0 },
+ #endif
+ #ifndef OPENSSL_NO_CAMELLIA
+ { NID_camellia_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE,
+- CRYPTO_CAMELLIA_CBC },
++ CRYPTO_CAMELLIA_CBC, 0 },
+ { NID_camellia_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE,
+- CRYPTO_CAMELLIA_CBC },
++ CRYPTO_CAMELLIA_CBC, 0 },
+ { NID_camellia_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE,
+- CRYPTO_CAMELLIA_CBC },
++ CRYPTO_CAMELLIA_CBC, 0 },
+ #endif
+ };
+
+@@ -141,6 +157,158 @@ static const struct cipher_data_st *get_cipher_data(int nid)
+ return &cipher_data[get_cipher_data_index(nid)];
+ }
+
++/*
++ * Save the encryption key provided by upper layers. This function is called
++ * by EVP_CipherInit_ex to initialize the algorithm's extra data. We can't do
++ * much here because the mac key is not available. The next call should/will
++ * be to cryptodev_cbc_hmac_sha1_ctrl with parameter
++ * EVP_CTRL_AEAD_SET_MAC_KEY, to set the hmac key. There we call CIOCGSESSION
++ * with both the crypto and hmac keys.
++ */
++static int cryptodev_init_aead_key(EVP_CIPHER_CTX *ctx,
++ const unsigned char *key, const unsigned char *iv, int enc)
++{
++ struct cipher_ctx *state = EVP_CIPHER_CTX_get_cipher_data(ctx);
++ struct session_op *sess = &state->sess;
++ int cipher = -1, i;
++
++ for (i = 0; cipher_data[i].devcryptoid; i++) {
++ if (EVP_CIPHER_CTX_nid(ctx) == cipher_data[i].nid &&
++ EVP_CIPHER_CTX_iv_length(ctx) <= cipher_data[i].ivlen &&
++ EVP_CIPHER_CTX_key_length(ctx) == cipher_data[i].keylen) {
++ cipher = cipher_data[i].devcryptoid;
++ break;
++ }
++ }
++
++ if (!cipher_data[i].devcryptoid)
++ return (0);
++
++ memset(sess, 0, sizeof(*sess));
++
++ sess->key = (void *) key;
++ sess->keylen = EVP_CIPHER_CTX_key_length(ctx);
++ sess->cipher = cipher;
++
++ /* for whatever reason, (1) means success */
++ return 1;
++}
++
++static int cryptodev_aead_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
++ const unsigned char *in, size_t len)
++{
++ struct crypt_auth_op cryp;
++ struct cipher_ctx *state = EVP_CIPHER_CTX_get_cipher_data(ctx);
++ struct session_op *sess = &state->sess;
++ const void *iiv;
++ unsigned char save_iv[EVP_MAX_IV_LENGTH];
++
++ if (cfd < 0)
++ return (0);
++ if (!len)
++ return (1);
++ if ((len % EVP_CIPHER_CTX_block_size(ctx)) != 0)
++ return (0);
++
++ memset(&cryp, 0, sizeof(cryp));
++
++ /* TODO: make a seamless integration with cryptodev flags */
++ switch (EVP_CIPHER_CTX_nid(ctx)) {
++ case NID_aes_128_cbc_hmac_sha1:
++ case NID_aes_256_cbc_hmac_sha1:
++ cryp.flags = COP_FLAG_AEAD_TLS_TYPE;
++ }
++ cryp.ses = sess->ses;
++ cryp.len = state->len;
++ cryp.src = (void *) in;
++ cryp.dst = (void *) out;
++ cryp.auth_src = state->aad;
++ cryp.auth_len = state->aad_len;
++
++ cryp.op = EVP_CIPHER_CTX_encrypting(ctx) ? COP_ENCRYPT : COP_DECRYPT;
++
++ if (EVP_CIPHER_CTX_iv_length(ctx) > 0) {
++ cryp.iv = (void *) EVP_CIPHER_CTX_iv(ctx);
++ if (!EVP_CIPHER_CTX_encrypting(ctx)) {
++ iiv = in + len - EVP_CIPHER_CTX_iv_length(ctx);
++ memcpy(save_iv, iiv, EVP_CIPHER_CTX_iv_length(ctx));
++ }
++ } else
++ cryp.iv = NULL;
++
++ if (ioctl(cfd, CIOCAUTHCRYPT, &cryp) == -1) {
++ /*
++ * XXX need better errror handling this can fail for a number of
++ * different reasons.
++ */
++ return 0;
++ }
++
++ if (EVP_CIPHER_CTX_iv_length(ctx) > 0) {
++ if (EVP_CIPHER_CTX_encrypting(ctx))
++ iiv = out + len - EVP_CIPHER_CTX_iv_length(ctx);
++ else
++ iiv = save_iv;
++
++ memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), iiv,
++ EVP_CIPHER_CTX_iv_length(ctx));
++ }
++ return 1;
++}
++
++static int cryptodev_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
++ int arg, void *ptr)
++{
++ switch (type) {
++ case EVP_CTRL_AEAD_SET_MAC_KEY:
++ {
++ /* TODO: what happens with hmac keys larger than 64 bytes? */
++ struct cipher_ctx *state =
++ EVP_CIPHER_CTX_get_cipher_data(ctx);
++ struct session_op *sess = &state->sess;
++
++ /* the rest should have been set in cryptodev_init_aead_key */
++ sess->mackey = ptr;
++ sess->mackeylen = arg;
++ if (ioctl(cfd, CIOCGSESSION, sess) == -1)
++ return 0;
++
++ return 1;
++ }
++ case EVP_CTRL_AEAD_TLS1_AAD:
++ {
++ /* ptr points to the associated data buffer of 13 bytes */
++ struct cipher_ctx *state =
++ EVP_CIPHER_CTX_get_cipher_data(ctx);
++ unsigned char *p = ptr;
++ unsigned int cryptlen = p[arg - 2] << 8 | p[arg - 1];
++ unsigned int maclen, padlen;
++ unsigned int bs = EVP_CIPHER_CTX_block_size(ctx);
++
++ state->aad = ptr;
++ state->aad_len = arg;
++ state->len = cryptlen;
++
++ /* TODO: this should be an extension of EVP_CIPHER struct */
++ switch (EVP_CIPHER_CTX_nid(ctx)) {
++ case NID_aes_128_cbc_hmac_sha1:
++ case NID_aes_256_cbc_hmac_sha1:
++ maclen = SHA_DIGEST_LENGTH;
++ }
++
++ /* space required for encryption (not only TLS padding) */
++ padlen = maclen;
++ if (EVP_CIPHER_CTX_encrypting(ctx)) {
++ cryptlen += maclen;
++ padlen += bs - (cryptlen % bs);
++ }
++ return padlen;
++ }
++ default:
++ return -1;
++ }
++}
++
+ /*
+ * Following are the three necessary functions to map OpenSSL functionality
+ * with cryptodev.
+@@ -165,6 +333,7 @@ static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
+ cipher_ctx->op = enc ? COP_ENCRYPT : COP_DECRYPT;
+ cipher_ctx->mode = cipher_d->flags & EVP_CIPH_MODE;
+ cipher_ctx->blocksize = cipher_d->blocksize;
++
+ if (ioctl(cfd, CIOCGSESSION, &cipher_ctx->sess) < 0) {
+ SYSerr(SYS_F_IOCTL, errno);
+ return 0;
+@@ -180,6 +349,7 @@ static int cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
+ struct crypt_op cryp;
+ unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx);
++
+ #if !defined(COP_FLAG_WRITE_IV)
+ unsigned char saved_iv[EVP_MAX_IV_LENGTH];
+ const unsigned char *ivptr;
+@@ -340,32 +510,59 @@ static int cipher_cleanup(EVP_CIPHER_CTX *ctx)
+ static int known_cipher_nids[OSSL_NELEM(cipher_data)];
+ static int known_cipher_nids_amount = -1; /* -1 indicates not yet initialised */
+ static EVP_CIPHER *known_cipher_methods[OSSL_NELEM(cipher_data)] = { NULL, };
++int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,
++ const unsigned char *iv, int enc);
++int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,
++ const unsigned char *in, size_t inl);
++int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);
+
+ static void prepare_cipher_methods(void)
+ {
+ size_t i;
+ struct session_op sess;
+ unsigned long cipher_mode;
++ unsigned long flags;
+
+ memset(&sess, 0, sizeof(sess));
+ sess.key = (void *)"01234567890123456789012345678901234567890123456789";
++ sess.mackey = (void *)"123456789ABCDEFGHIJKLMNO";
+
+ for (i = 0, known_cipher_nids_amount = 0;
+ i < OSSL_NELEM(cipher_data); i++) {
+
++ init = cipher_init;
++ ctrl = cipher_ctrl;
++ flags = cipher_data[i].flags
++ | EVP_CIPH_CUSTOM_COPY
++ | EVP_CIPH_CTRL_INIT
++ | EVP_CIPH_FLAG_DEFAULT_ASN1;
++
+ /*
+ * Check that the algo is really availably by trying to open and close
+ * a session.
+ */
+ sess.cipher = cipher_data[i].devcryptoid;
+ sess.keylen = cipher_data[i].keylen;
++ sess.mackeylen = cipher_data[i].mackeylen;
++
++ cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE;
++
++ do_cipher = (cipher_mode == EVP_CIPH_CTR_MODE ?
++ ctr_do_cipher :
++ cipher_do_cipher);
++ if (cipher_data[i].nid == NID_aes_128_cbc_hmac_sha1
++ || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha1) {
++ init = cryptodev_init_aead_key;
++ do_cipher = cryptodev_aead_cipher;
++ ctrl = cryptodev_cbc_hmac_sha1_ctrl;
++ flags = cipher_data[i].flags;
++ }
++
+ if (ioctl(cfd, CIOCGSESSION, &sess) < 0
+ || ioctl(cfd, CIOCFSESSION, &sess.ses) < 0)
+ continue;
+
+- cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE;
+-
+- if ((known_cipher_methods[i] =
++ if ((known_cipher_methods[i] =
+ EVP_CIPHER_meth_new(cipher_data[i].nid,
+ cipher_mode == EVP_CIPH_CTR_MODE ? 1 :
+ cipher_data[i].blocksize,
+@@ -373,16 +570,12 @@ static void prepare_cipher_methods(void)
+ || !EVP_CIPHER_meth_set_iv_length(known_cipher_methods[i],
+ cipher_data[i].ivlen)
+ || !EVP_CIPHER_meth_set_flags(known_cipher_methods[i],
+- cipher_data[i].flags
+- | EVP_CIPH_CUSTOM_COPY
+- | EVP_CIPH_CTRL_INIT
+- | EVP_CIPH_FLAG_DEFAULT_ASN1)
+- || !EVP_CIPHER_meth_set_init(known_cipher_methods[i], cipher_init)
++ flags)
++ || !EVP_CIPHER_meth_set_init(known_cipher_methods[i], init)
+ || !EVP_CIPHER_meth_set_do_cipher(known_cipher_methods[i],
+- cipher_mode == EVP_CIPH_CTR_MODE ?
+- ctr_do_cipher :
+- cipher_do_cipher)
+- || !EVP_CIPHER_meth_set_ctrl(known_cipher_methods[i], cipher_ctrl)
++ do_cipher)
++ /* AEAD Support to be added. */
++ || !EVP_CIPHER_meth_set_ctrl(known_cipher_methods[i], ctrl)
+ || !EVP_CIPHER_meth_set_cleanup(known_cipher_methods[i],
+ cipher_cleanup)
+ || !EVP_CIPHER_meth_set_impl_ctx_size(known_cipher_methods[i],
+@@ -393,6 +586,10 @@ static void prepare_cipher_methods(void)
+ known_cipher_nids[known_cipher_nids_amount++] =
+ cipher_data[i].nid;
+ }
++
++ if (cipher_data[i].nid == NID_aes_128_cbc_hmac_sha1
++ || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha1)
++ EVP_add_cipher(known_cipher_methods[i]);
+ }
+ }
+
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0002-eng_devcrypto-add-support-for-TLS1.2-algorithms-offl.patch b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0002-eng_devcrypto-add-support-for-TLS1.2-algorithms-offl.patch
new file mode 100644
index 00000000..b12af56e
--- /dev/null
+++ b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/0002-eng_devcrypto-add-support-for-TLS1.2-algorithms-offl.patch
@@ -0,0 +1,285 @@
+From db9d8be9d0d81bdb2ddb78f8616243593a3d24c5 Mon Sep 17 00:00:00 2001
+From: Pankaj Gupta <pankaj.gupta@nxp.com>
+Date: Fri, 10 Jan 2020 15:38:38 +0530
+Subject: [PATCH 2/2] eng_devcrypto: add support for TLS1.2 algorithms offload
+
+ - aes-128-cbc-hmac-sha256
+ - aes-256-cbc-hmac-sha256
+
+Enabled the support of TLS1.1 algorithms offload
+
+ - aes-128-cbc-hmac-sha1
+ - aes-256-cbc-hmac-sha1
+
+Requires TLS patches on cryptodev and TLS algorithm support in Linux
+kernel driver.
+
+Fix: Remove the support for TLS1.0.
+
+Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
+Signed-off-by: Arun Pathak <arun.pathak@nxp.com>
+---
+ crypto/engine/eng_devcrypto.c | 133 +++++++++++++++++++++++-----------
+ 1 file changed, 90 insertions(+), 43 deletions(-)
+
+diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
+index 727a660e75..be63f65e04 100644
+--- a/crypto/engine/eng_devcrypto.c
++++ b/crypto/engine/eng_devcrypto.c
+@@ -25,6 +25,7 @@
+ #include "crypto/engine.h"
+
+ /* #define ENGINE_DEVCRYPTO_DEBUG */
++#define TLS1_1_VERSION 0x0302
+
+ #if CRYPTO_ALGORITHM_MIN < CRYPTO_ALGORITHM_MAX
+ # define CHECK_BSD_STYLE_MACROS
+@@ -67,6 +68,7 @@ struct cipher_ctx {
+ /* to handle ctr mode being a stream cipher */
+ unsigned char partial[EVP_MAX_BLOCK_LENGTH];
+ unsigned int blocksize, num;
++ unsigned int tls_ver;
+ };
+
+ static const struct cipher_data_st {
+@@ -92,11 +94,17 @@ static const struct cipher_data_st {
+ { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC, 0 },
+ { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC, 0 },
+ { NID_aes_128_cbc_hmac_sha1, 16, 16, 16,
+- EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
+- CRYPTO_TLS10_AES_CBC_HMAC_SHA1, 20 },
++ EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
++ CRYPTO_TLS11_AES_CBC_HMAC_SHA1, 20 },
+ { NID_aes_256_cbc_hmac_sha1, 16, 32, 16,
+- EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
+- CRYPTO_TLS10_AES_CBC_HMAC_SHA1, 20 },
++ EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
++ CRYPTO_TLS11_AES_CBC_HMAC_SHA1, 20 },
++ { NID_aes_128_cbc_hmac_sha256, 16, 16, 16,
++ EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
++ CRYPTO_TLS12_AES_CBC_HMAC_SHA256, 32 },
++ { NID_aes_256_cbc_hmac_sha256, 16, 32, 16,
++ EVP_CIPH_CBC_MODE | EVP_CIPH_FLAG_AEAD_CIPHER,
++ CRYPTO_TLS12_AES_CBC_HMAC_SHA256, 32 },
+ #ifndef OPENSSL_NO_RC4
+ { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4, 0 },
+ #endif
+@@ -107,9 +115,9 @@ static const struct cipher_data_st {
+ #endif
+ #if 0 /* Not yet supported */
+ { NID_aes_128_xts, 16, 128 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS,
+- 0 },
++ 0 },
+ { NID_aes_256_xts, 16, 256 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS,
+- 0 },
++ 0 },
+ #endif
+ #if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_ECB)
+ { NID_aes_128_ecb, 16, 128 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB, 0 },
+@@ -166,7 +174,7 @@ static const struct cipher_data_st *get_cipher_data(int nid)
+ * with both the crypto and hmac keys.
+ */
+ static int cryptodev_init_aead_key(EVP_CIPHER_CTX *ctx,
+- const unsigned char *key, const unsigned char *iv, int enc)
++ const unsigned char *key, const unsigned char *iv, int enc)
+ {
+ struct cipher_ctx *state = EVP_CIPHER_CTX_get_cipher_data(ctx);
+ struct session_op *sess = &state->sess;
+@@ -212,10 +220,29 @@ static int cryptodev_aead_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+
+ memset(&cryp, 0, sizeof(cryp));
+
++ if (EVP_CIPHER_CTX_iv_length(ctx) > 0) {
++ if (!EVP_CIPHER_CTX_encrypting(ctx)) {
++ iiv = in + len - EVP_CIPHER_CTX_iv_length(ctx);
++ memcpy(save_iv, iiv, EVP_CIPHER_CTX_iv_length(ctx));
++
++ if (state->tls_ver >= TLS1_1_VERSION) {
++ memcpy(EVP_CIPHER_CTX_iv_noconst(ctx), in,
++ EVP_CIPHER_CTX_iv_length(ctx));
++ in += EVP_CIPHER_CTX_iv_length(ctx);
++ out += EVP_CIPHER_CTX_iv_length(ctx);
++ len -= EVP_CIPHER_CTX_iv_length(ctx);
++ }
++ }
++ cryp.iv = (void *) EVP_CIPHER_CTX_iv(ctx);
++ } else
++ cryp.iv = NULL;
++
+ /* TODO: make a seamless integration with cryptodev flags */
+ switch (EVP_CIPHER_CTX_nid(ctx)) {
+ case NID_aes_128_cbc_hmac_sha1:
+ case NID_aes_256_cbc_hmac_sha1:
++ case NID_aes_128_cbc_hmac_sha256:
++ case NID_aes_256_cbc_hmac_sha256:
+ cryp.flags = COP_FLAG_AEAD_TLS_TYPE;
+ }
+ cryp.ses = sess->ses;
+@@ -227,15 +254,6 @@ static int cryptodev_aead_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+
+ cryp.op = EVP_CIPHER_CTX_encrypting(ctx) ? COP_ENCRYPT : COP_DECRYPT;
+
+- if (EVP_CIPHER_CTX_iv_length(ctx) > 0) {
+- cryp.iv = (void *) EVP_CIPHER_CTX_iv(ctx);
+- if (!EVP_CIPHER_CTX_encrypting(ctx)) {
+- iiv = in + len - EVP_CIPHER_CTX_iv_length(ctx);
+- memcpy(save_iv, iiv, EVP_CIPHER_CTX_iv_length(ctx));
+- }
+- } else
+- cryp.iv = NULL;
+-
+ if (ioctl(cfd, CIOCAUTHCRYPT, &cryp) == -1) {
+ /*
+ * XXX need better errror handling this can fail for a number of
+@@ -262,7 +280,7 @@ static int cryptodev_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
+ switch (type) {
+ case EVP_CTRL_AEAD_SET_MAC_KEY:
+ {
+- /* TODO: what happens with hmac keys larger than 64 bytes? */
++ /* TODO: what happens with hmac keys larger than 64 bytes? */
+ struct cipher_ctx *state =
+ EVP_CIPHER_CTX_get_cipher_data(ctx);
+ struct session_op *sess = &state->sess;
+@@ -282,27 +300,52 @@ static int cryptodev_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type,
+ EVP_CIPHER_CTX_get_cipher_data(ctx);
+ unsigned char *p = ptr;
+ unsigned int cryptlen = p[arg - 2] << 8 | p[arg - 1];
+- unsigned int maclen, padlen;
+- unsigned int bs = EVP_CIPHER_CTX_block_size(ctx);
++ unsigned int maclen;
++ unsigned int blocksize = EVP_CIPHER_CTX_block_size(ctx);
++ int ret;
+
++ state->tls_ver = p[arg - 4] << 8 | p[arg - 3];
+ state->aad = ptr;
+ state->aad_len = arg;
+- state->len = cryptlen;
+
+ /* TODO: this should be an extension of EVP_CIPHER struct */
+ switch (EVP_CIPHER_CTX_nid(ctx)) {
+ case NID_aes_128_cbc_hmac_sha1:
+ case NID_aes_256_cbc_hmac_sha1:
+ maclen = SHA_DIGEST_LENGTH;
++ break;
++ case NID_aes_128_cbc_hmac_sha256:
++ case NID_aes_256_cbc_hmac_sha256:
++ maclen = SHA256_DIGEST_LENGTH;
++ break;
++ default:
++ /*
++ * Only above 4 supported NIDs are used to enter to this
++ * function. If any other NID reaches this function,
++ * there's a grave coding error further down.
++ */
++ assert("Code that never should be reached" == NULL);
++ return -1;
+ }
+
+ /* space required for encryption (not only TLS padding) */
+- padlen = maclen;
+ if (EVP_CIPHER_CTX_encrypting(ctx)) {
+- cryptlen += maclen;
+- padlen += bs - (cryptlen % bs);
++ if (state->tls_ver >= TLS1_1_VERSION) {
++ p[arg - 2] = (cryptlen - blocksize) >> 8;
++ p[arg - 1] = (cryptlen - blocksize);
++ }
++ ret = (int)(((cryptlen + maclen +
++ blocksize) & -blocksize) - cryptlen);
++ } else {
++ if (state->tls_ver >= TLS1_1_VERSION) {
++ cryptlen -= blocksize;
++ p[arg - 2] = cryptlen >> 8;
++ p[arg - 1] = cryptlen;
++ }
++ ret = maclen;
+ }
+- return padlen;
++ state->len = cryptlen;
++ return ret;
+ }
+ default:
+ return -1;
+@@ -510,11 +553,11 @@ static int cipher_cleanup(EVP_CIPHER_CTX *ctx)
+ static int known_cipher_nids[OSSL_NELEM(cipher_data)];
+ static int known_cipher_nids_amount = -1; /* -1 indicates not yet initialised */
+ static EVP_CIPHER *known_cipher_methods[OSSL_NELEM(cipher_data)] = { NULL, };
+-int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,
+- const unsigned char *iv, int enc);
+-int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,
+- const unsigned char *in, size_t inl);
+-int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);
++int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
++ const unsigned char *iv, int enc);
++int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
++ const unsigned char *in, size_t inl);
++int (*ctrl)(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
+
+ static void prepare_cipher_methods(void)
+ {
+@@ -543,26 +586,28 @@ static void prepare_cipher_methods(void)
+ */
+ sess.cipher = cipher_data[i].devcryptoid;
+ sess.keylen = cipher_data[i].keylen;
+- sess.mackeylen = cipher_data[i].mackeylen;
++ sess.mackeylen = cipher_data[i].mackeylen;
+
+ cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE;
+
+- do_cipher = (cipher_mode == EVP_CIPH_CTR_MODE ?
++ do_cipher = (cipher_mode == EVP_CIPH_CTR_MODE ?
+ ctr_do_cipher :
+ cipher_do_cipher);
+- if (cipher_data[i].nid == NID_aes_128_cbc_hmac_sha1
+- || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha1) {
+- init = cryptodev_init_aead_key;
+- do_cipher = cryptodev_aead_cipher;
+- ctrl = cryptodev_cbc_hmac_sha1_ctrl;
+- flags = cipher_data[i].flags;
+- }
++ if (cipher_data[i].nid == NID_aes_128_cbc_hmac_sha1
++ || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha1
++ || cipher_data[i].nid == NID_aes_128_cbc_hmac_sha256
++ || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha256) {
++ init = cryptodev_init_aead_key;
++ do_cipher = cryptodev_aead_cipher;
++ ctrl = cryptodev_cbc_hmac_sha1_ctrl;
++ flags = cipher_data[i].flags;
++ }
+
+ if (ioctl(cfd, CIOCGSESSION, &sess) < 0
+ || ioctl(cfd, CIOCFSESSION, &sess.ses) < 0)
+ continue;
+
+- if ((known_cipher_methods[i] =
++ if ((known_cipher_methods[i] =
+ EVP_CIPHER_meth_new(cipher_data[i].nid,
+ cipher_mode == EVP_CIPH_CTR_MODE ? 1 :
+ cipher_data[i].blocksize,
+@@ -574,7 +619,7 @@ static void prepare_cipher_methods(void)
+ || !EVP_CIPHER_meth_set_init(known_cipher_methods[i], init)
+ || !EVP_CIPHER_meth_set_do_cipher(known_cipher_methods[i],
+ do_cipher)
+- /* AEAD Support to be added. */
++ /* AEAD Support to be added. */
+ || !EVP_CIPHER_meth_set_ctrl(known_cipher_methods[i], ctrl)
+ || !EVP_CIPHER_meth_set_cleanup(known_cipher_methods[i],
+ cipher_cleanup)
+@@ -587,9 +632,11 @@ static void prepare_cipher_methods(void)
+ cipher_data[i].nid;
+ }
+
+- if (cipher_data[i].nid == NID_aes_128_cbc_hmac_sha1
+- || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha1)
+- EVP_add_cipher(known_cipher_methods[i]);
++ if (cipher_data[i].nid == NID_aes_128_cbc_hmac_sha1
++ || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha1
++ || cipher_data[i].nid == NID_aes_128_cbc_hmac_sha256
++ || cipher_data[i].nid == NID_aes_256_cbc_hmac_sha256)
++ EVP_add_cipher(known_cipher_methods[i]);
+ }
+ }
+
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh
deleted file mode 100644
index 6620fdcb..00000000
--- a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/openssl-c_rehash.sh
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/bin/sh
-#
-# Ben Secrest <blsecres@gmail.com>
-#
-# sh c_rehash script, scan all files in a directory
-# and add symbolic links to their hash values.
-#
-# based on the c_rehash perl script distributed with openssl
-#
-# LICENSE: See OpenSSL license
-# ^^acceptable?^^
-#
-
-# default certificate location
-DIR=/etc/openssl
-
-# for filetype bitfield
-IS_CERT=$(( 1 << 0 ))
-IS_CRL=$(( 1 << 1 ))
-
-
-# check to see if a file is a certificate file or a CRL file
-# arguments:
-# 1. the filename to be scanned
-# returns:
-# bitfield of file type; uses ${IS_CERT} and ${IS_CRL}
-#
-check_file()
-{
- local IS_TYPE=0
-
- # make IFS a newline so we can process grep output line by line
- local OLDIFS=${IFS}
- IFS=$( printf "\n" )
-
- # XXX: could be more efficient to have two 'grep -m' but is -m portable?
- for LINE in $( grep '^-----BEGIN .*-----' ${1} )
- do
- if echo ${LINE} \
- | grep -q -E '^-----BEGIN (X509 |TRUSTED )?CERTIFICATE-----'
- then
- IS_TYPE=$(( ${IS_TYPE} | ${IS_CERT} ))
-
- if [ $(( ${IS_TYPE} & ${IS_CRL} )) -ne 0 ]
- then
- break
- fi
- elif echo ${LINE} | grep -q '^-----BEGIN X509 CRL-----'
- then
- IS_TYPE=$(( ${IS_TYPE} | ${IS_CRL} ))
-
- if [ $(( ${IS_TYPE} & ${IS_CERT} )) -ne 0 ]
- then
- break
- fi
- fi
- done
-
- # restore IFS
- IFS=${OLDIFS}
-
- return ${IS_TYPE}
-}
-
-
-#
-# use openssl to fingerprint a file
-# arguments:
-# 1. the filename to fingerprint
-# 2. the method to use (x509, crl)
-# returns:
-# none
-# assumptions:
-# user will capture output from last stage of pipeline
-#
-fingerprint()
-{
- ${SSL_CMD} ${2} -fingerprint -noout -in ${1} | sed 's/^.*=//' | tr -d ':'
-}
-
-
-#
-# link_hash - create links to certificate files
-# arguments:
-# 1. the filename to create a link for
-# 2. the type of certificate being linked (x509, crl)
-# returns:
-# 0 on success, 1 otherwise
-#
-link_hash()
-{
- local FINGERPRINT=$( fingerprint ${1} ${2} )
- local HASH=$( ${SSL_CMD} ${2} -hash -noout -in ${1} )
- local SUFFIX=0
- local LINKFILE=''
- local TAG=''
-
- if [ ${2} = "crl" ]
- then
- TAG='r'
- fi
-
- LINKFILE=${HASH}.${TAG}${SUFFIX}
-
- while [ -f ${LINKFILE} ]
- do
- if [ ${FINGERPRINT} = $( fingerprint ${LINKFILE} ${2} ) ]
- then
- echo "NOTE: Skipping duplicate file ${1}" >&2
- return 1
- fi
-
- SUFFIX=$(( ${SUFFIX} + 1 ))
- LINKFILE=${HASH}.${TAG}${SUFFIX}
- done
-
- echo "${3} => ${LINKFILE}"
-
- # assume any system with a POSIX shell will either support symlinks or
- # do something to handle this gracefully
- ln -s ${3} ${LINKFILE}
-
- return 0
-}
-
-
-# hash_dir create hash links in a given directory
-hash_dir()
-{
- echo "Doing ${1}"
-
- cd ${1}
-
- ls -1 * 2>/dev/null | while read FILE
- do
- if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \
- && [ -h "${FILE}" ]
- then
- rm ${FILE}
- fi
- done
-
- ls -1 *.pem *.cer *.crt *.crl 2>/dev/null | while read FILE
- do
- REAL_FILE=${FILE}
- # if we run on build host then get to the real files in rootfs
- if [ -n "${SYSROOT}" -a -h ${FILE} ]
- then
- FILE=$( readlink ${FILE} )
- # check the symlink is absolute (or dangling in other word)
- if [ "x/" = "x$( echo ${FILE} | cut -c1 -)" ]
- then
- REAL_FILE=${SYSROOT}/${FILE}
- fi
- fi
-
- check_file ${REAL_FILE}
- local FILE_TYPE=${?}
- local TYPE_STR=''
-
- if [ $(( ${FILE_TYPE} & ${IS_CERT} )) -ne 0 ]
- then
- TYPE_STR='x509'
- elif [ $(( ${FILE_TYPE} & ${IS_CRL} )) -ne 0 ]
- then
- TYPE_STR='crl'
- else
- echo "NOTE: ${FILE} does not contain a certificate or CRL: skipping" >&2
- continue
- fi
-
- link_hash ${REAL_FILE} ${TYPE_STR} ${FILE}
- done
-}
-
-
-# choose the name of an ssl application
-if [ -n "${OPENSSL}" ]
-then
- SSL_CMD=$(which ${OPENSSL} 2>/dev/null)
-else
- SSL_CMD=/usr/bin/openssl
- OPENSSL=${SSL_CMD}
- export OPENSSL
-fi
-
-# fix paths
-PATH=${PATH}:${DIR}/bin
-export PATH
-
-# confirm existance/executability of ssl command
-if ! [ -x ${SSL_CMD} ]
-then
- echo "${0}: rehashing skipped ('openssl' program not available)" >&2
- exit 0
-fi
-
-# determine which directories to process
-old_IFS=$IFS
-if [ ${#} -gt 0 ]
-then
- IFS=':'
- DIRLIST=${*}
-elif [ -n "${SSL_CERT_DIR}" ]
-then
- DIRLIST=$SSL_CERT_DIR
-else
- DIRLIST=${DIR}/certs
-fi
-
-IFS=':'
-
-# process directories
-for CERT_DIR in ${DIRLIST}
-do
- if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ]
- then
- IFS=$old_IFS
- hash_dir ${CERT_DIR}
- IFS=':'
- fi
-done
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/run-ptest b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/run-ptest
index 65c6cc7b..3fb22471 100644
--- a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/run-ptest
+++ b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq/run-ptest
@@ -1,4 +1,12 @@
#!/bin/sh
-cd test
-OPENSSL_ENGINES=../engines BLDTOP=.. SRCTOP=.. perl run_tests.pl
-cd ..
+
+set -e
+
+# Optional arguments are 'list' to lists all tests, or the test name (base name
+# ie test_evp, not 03_test_evp.t).
+
+export TOP=.
+# OPENSSL_ENGINES is relative from the test binaries
+export OPENSSL_ENGINES=../engines
+
+perl ./test/run_tests.pl $* | perl -0pe 's#(.*) \.*.ok#PASS: \1#g; s#(.*) \.*.skipped: (.*)#SKIP: \1 (\2)#g; s#(.*) \.*.\nDubious#FAIL: \1#;'
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb b/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb
deleted file mode 100644
index 7a4897fd..00000000
--- a/bsp/meta-freescale/recipes-connectivity/openssl/openssl-qoriq_1.1.0g.bb
+++ /dev/null
@@ -1,186 +0,0 @@
-SUMMARY = "Secure Socket Layer"
-DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
-HOMEPAGE = "http://www.openssl.org/"
-BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
-SECTION = "libs/network"
-
-DISABLE_STATIC = ""
-
-# "openssl | SSLeay" dual license
-LICENSE = "openssl"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=cae6da10f4ffd9703214776d2aabce32"
-
-DEPENDS += "cryptodev-linux"
-DEPENDS_append_class-target = " openssl-native"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/openssl;nobranch=1 \
- file://run-ptest \
- file://openssl-c_rehash.sh \
- file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \
- file://0001-Remove-test-that-requires-running-as-non-root.patch \
- file://0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch \
- "
-
-SRCREV = "c2300d1fdb30a439f555b07f228d3bce498238d5"
-
-PROVIDES = "openssl"
-
-python() {
- pkgs = d.getVar('PACKAGES', True).split()
- for p in pkgs:
- if 'openssl-qoriq' in p:
- d.appendVar("RPROVIDES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
- d.appendVar("RCONFLICTS_%s" % p, p.replace('openssl-qoriq', 'openssl'))
- d.appendVar("RREPLACES_%s" % p, p.replace('openssl-qoriq', 'openssl'))
-}
-
-S = "${WORKDIR}/git"
-
-inherit lib_package multilib_header ptest
-
-do_configure () {
- os=${HOST_OS}
- case $os in
- linux-uclibc |\
- linux-uclibceabi |\
- linux-gnueabi |\
- linux-uclibcspe |\
- linux-gnuspe |\
- linux-musl*)
- os=linux
- ;;
- *)
- ;;
- esac
- target="$os-${HOST_ARCH}"
- case $target in
- linux-arm)
- target=linux-armv4
- ;;
- linux-armeb)
- target=linux-armv4
- ;;
- linux-aarch64*)
- target=linux-aarch64
- ;;
- linux-sh3)
- target=linux-generic32
- ;;
- linux-sh4)
- target=linux-generic32
- ;;
- linux-i486)
- target=linux-elf
- ;;
- linux-i586 | linux-viac3)
- target=linux-elf
- ;;
- linux-i686)
- target=linux-elf
- ;;
- linux-gnux32-x86_64)
- target=linux-x32
- ;;
- linux-gnu64-x86_64)
- target=linux-x86_64
- ;;
- linux-mips)
- # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
- target="linux-mips32 ${TARGET_CC_ARCH}"
- ;;
- linux-mipsel)
- target="linux-mips32 ${TARGET_CC_ARCH}"
- ;;
- linux-gnun32-mips*)
- target=linux-mips64
- ;;
- linux-*-mips64 | linux-mips64)
- target=linux64-mips64
- ;;
- linux-*-mips64el | linux-mips64el)
- target=linux64-mips64
- ;;
- linux-microblaze*|linux-nios2*)
- target=linux-generic32
- ;;
- linux-powerpc)
- target=linux-ppc
- ;;
- linux-powerpc64)
- target=linux-ppc64
- ;;
- linux-riscv64)
- target=linux-generic64
- ;;
- linux-riscv32)
- target=linux-generic32
- ;;
- linux-supersparc)
- target=linux-sparcv9
- ;;
- linux-sparc)
- target=linux-sparcv9
- ;;
- darwin-i386)
- target=darwin-i386-cc
- ;;
- esac
- useprefix=${prefix}
- if [ "x$useprefix" = "x" ]; then
- useprefix=/
- fi
- libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
- perl ./Configure -DHAVE_CRYPTODEV ${EXTRA_OECONF} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdirleaf} $target
-}
-
-#| engines/afalg/e_afalg.c: In function 'eventfd':
-#| engines/afalg/e_afalg.c:110:20: error: '__NR_eventfd' undeclared (first use in this function)
-#| return syscall(__NR_eventfd, n);
-#| ^~~~~~~~~~~~
-EXTRA_OECONF_aarch64 += "no-afalgeng"
-
-#| ./libcrypto.so: undefined reference to `getcontext'
-#| ./libcrypto.so: undefined reference to `setcontext'
-#| ./libcrypto.so: undefined reference to `makecontext'
-EXTRA_OECONF_libc-musl += "-DOPENSSL_NO_ASYNC"
-
-do_install () {
- oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
- oe_multilib_header openssl/opensslconf.h
-}
-
-do_install_append_class-native () {
- # Install a custom version of c_rehash that can handle sysroots properly.
- # This version is used for example when installing ca-certificates during
- # image creation.
- install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
- sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
-}
-
-do_install_ptest() {
- cp -r * ${D}${PTEST_PATH}
-
- # Putting .so files in ptest package will mess up the dependencies of the main openssl package
- # so we rename them to .so.ptest and patch the test accordingly
- mv ${D}${PTEST_PATH}/libcrypto.so ${D}${PTEST_PATH}/libcrypto.so.ptest
- mv ${D}${PTEST_PATH}/libssl.so ${D}${PTEST_PATH}/libssl.so.ptest
- sed -i 's/$target{shared_extension_simple}/".so.ptest"/' ${D}${PTEST_PATH}/test/recipes/90-test_shlibload.t
-}
-
-RDEPENDS_${PN}-ptest += "perl-module-file-spec-functions bash python"
-RRECOMMENDS_libcrypto += "openssl-conf"
-RDEPENDS_${PN}-bin = "perl"
-RDEPENDS_${PN}-misc = "perl"
-
-FILES_${PN} =+ " ${libdir}/ssl-1.1/*"
-
-PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc"
-FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
-FILES_libssl = "${libdir}/libssl${SOLIBS}"
-FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
-FILES_${PN}-engines = "${libdir}/engines-1.1"
-FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
-
-RPROVIDES_openssl-conf = "openssl10-conf"
-RREPLACES_openssl-conf = "openssl10-conf"
-RCONFLICTS_openssl-conf = "openssl10-conf"
diff --git a/bsp/meta-freescale/recipes-connectivity/openssl/openssl_%.bbappend b/bsp/meta-freescale/recipes-connectivity/openssl/openssl_%.bbappend
new file mode 100644
index 00000000..182925e0
--- /dev/null
+++ b/bsp/meta-freescale/recipes-connectivity/openssl/openssl_%.bbappend
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS_append := "${THISDIR}/${PN}-qoriq:"
+
+SRC_URI_append_qoriq = " \
+ file://0001-eng_devcrypto-add-support-for-TLS-algorithms-offload.patch \
+ file://0002-eng_devcrypto-add-support-for-TLS1.2-algorithms-offl.patch \
+"
diff --git a/bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq.bb b/bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq.bb
index deeedab8..c328f4cc 100644
--- a/bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq.bb
+++ b/bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq.bb
@@ -7,6 +7,7 @@ SRC_URI = "\
file://72-fsl-dpaa-persistent-networking.rules \
file://73-fsl-dpaa-persistent-networking.rules \
file://74-ls1046a-xfi2-networking.rules \
+ file://73-fsl-enetc-networking.rules \
"
S = "${WORKDIR}"
@@ -14,7 +15,9 @@ RULE = "71-fsl-dpaa-persistent-networking.rules"
RULE_e6500 = "72-fsl-dpaa-persistent-networking.rules"
RULE_e6500-64b = "72-fsl-dpaa-persistent-networking.rules"
RULE_t1024 = "72-fsl-dpaa-persistent-networking.rules"
-RULE_ls1043a = "73-fsl-dpaa-persistent-networking.rules"
+RULE_qoriq-arm64 = "73-fsl-dpaa-persistent-networking.rules \
+ 73-fsl-enetc-networking.rules \
+"
RULE_ls1046a = "73-fsl-dpaa-persistent-networking.rules \
74-ls1046a-xfi2-networking.rules \
"
diff --git a/bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq/73-fsl-enetc-networking.rules b/bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq/73-fsl-enetc-networking.rules
new file mode 100644
index 00000000..19f41634
--- /dev/null
+++ b/bsp/meta-freescale/recipes-core/udev/udev-rules-qoriq/73-fsl-enetc-networking.rules
@@ -0,0 +1,16 @@
+# ENETC rules
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0", DRIVERS=="fsl_enetc", NAME:="eno0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", NAME:="eno1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.2", DRIVERS=="fsl_enetc", NAME:="eno2"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.6", DRIVERS=="fsl_enetc", NAME:="eno3"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.0", DRIVERS=="fsl_enetc_vf", NAME:="eno0vf0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.1", DRIVERS=="fsl_enetc_vf", NAME:="eno0vf1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.2", DRIVERS=="fsl_enetc_vf", NAME:="eno1vf0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.3", DRIVERS=="fsl_enetc_vf", NAME:="eno1vf1"
+# LS1028 switch rules
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p0", NAME="swp0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p1", NAME="swp1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p2", NAME="swp2"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p3", NAME="swp3"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p4", NAME="swp4"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p5", NAME="swp5"
diff --git a/bsp/meta-freescale/recipes-daemons/ptpd/ptpd-qoriq.bb b/bsp/meta-freescale/recipes-daemons/ptpd/ptpd-qoriq.bb
index cb047fd2..569deed5 100644
--- a/bsp/meta-freescale/recipes-daemons/ptpd/ptpd-qoriq.bb
+++ b/bsp/meta-freescale/recipes-daemons/ptpd/ptpd-qoriq.bb
@@ -17,7 +17,7 @@ PROVIDES = "ptpd"
inherit autotools pkgconfig systemd
python() {
- pkgs = d.getVar('PACKAGES', True).split()
+ pkgs = d.getVar('PACKAGES').split()
for p in pkgs:
if 'ptpd-qoriq' in p:
d.appendVar("RPROVIDES_%s" % p, p.replace('ptpd-qoriq', 'ptpd'))
diff --git a/bsp/meta-freescale/recipes-devtools/cst/cst/0001-tools-Mark-struct-input_field-file_field-extern.patch b/bsp/meta-freescale/recipes-devtools/cst/cst/0001-tools-Mark-struct-input_field-file_field-extern.patch
new file mode 100644
index 00000000..d25675aa
--- /dev/null
+++ b/bsp/meta-freescale/recipes-devtools/cst/cst/0001-tools-Mark-struct-input_field-file_field-extern.patch
@@ -0,0 +1,43 @@
+From 81ec65e72f357fb2c395e40c5195434bbaddf7f7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 16 May 2020 08:21:52 -0700
+Subject: [PATCH] tools: Mark struct input_field file_field extern
+
+This struct is already defined in common/parse_utils.c
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/header_generation/create_hdr_common.c | 2 +-
+ tools/pbi_creation/create_pbi_common.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/header_generation/create_hdr_common.c b/tools/header_generation/create_hdr_common.c
+index bfa90a3..edf632c 100644
+--- a/tools/header_generation/create_hdr_common.c
++++ b/tools/header_generation/create_hdr_common.c
+@@ -39,7 +39,7 @@
+ #include <crypto_utils.h>
+
+ extern struct g_data_t gd;
+-struct input_field file_field;
++extern struct input_field file_field;
+
+ extern char line_data[];
+ static struct option long_options[] = {
+diff --git a/tools/pbi_creation/create_pbi_common.c b/tools/pbi_creation/create_pbi_common.c
+index ff2ed84..bd976da 100644
+--- a/tools/pbi_creation/create_pbi_common.c
++++ b/tools/pbi_creation/create_pbi_common.c
+@@ -57,7 +57,7 @@ static char *parse_list[] = {
+
+ extern struct g_data_t gd;
+ extern char line_data[];
+-struct input_field file_field;
++extern struct input_field file_field;
+
+ #define NUM_PARSE_LIST (sizeof(parse_list) / sizeof(char *))
+
+--
+2.26.2
+
diff --git a/bsp/meta-freescale/recipes-devtools/cst/cst_git.bb b/bsp/meta-freescale/recipes-devtools/cst/cst_git.bb
index 05d2d4c7..fef0fbcf 100644
--- a/bsp/meta-freescale/recipes-devtools/cst/cst_git.bb
+++ b/bsp/meta-freescale/recipes-devtools/cst/cst_git.bb
@@ -4,14 +4,22 @@ LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=e959d5d617e33779d0e90ce1d9043eff"
-DEPENDS += "openssl"
+DEPENDS += "openssl cst-native"
RDEPENDS_${PN} = "bash"
+GENKEYS ?= "${STAGING_BINDIR_NATIVE}/cst/gen_keys"
+GENKEYS_class-native = "./gen_keys"
+
inherit kernel-arch
+# specify the non default keys pair for secure boot if needed
+#SECURE_PRI_KEY = "/path/srk.pri"
+#SECURE_PUB_KEY = "/path/srk.pub"
+
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/cst;nobranch=1 \
+ file://0001-tools-Mark-struct-input_field-file_field-extern.patch \
"
-SRCREV = "f599f6126ae1a382a581dcd75e9ad2e34c79a183"
+SRCREV = "9aafbdf2441858ceca2779279b6876c6bdc2d3ed"
S = "${WORKDIR}/git"
@@ -21,6 +29,13 @@ PARALLEL_MAKE = ""
do_install () {
oe_runmake install DESTDIR=${D} BIN_DEST_DIR=${bindir}
+
+ if [ -n "${SECURE_PRI_KEY}" ]; then
+ cp -f ${SECURE_PRI_KEY} ${D}/${bindir}/cst/srk.pri
+ cp -f ${SECURE_PUB_KEY} ${D}/${bindir}/cst/srk.pub
+ elif [ ! -f ${D}/${bindir}/cst/srk.pri -o ! ${D}/${bindir}/cst/srk.pub ]; then
+ cd ${D}/${bindir}/cst && ${GENKEYS} 1024
+ fi
}
FILES_${PN}-dbg += "${bindir}/cst/.debug"
diff --git a/bsp/meta-freescale/recipes-devtools/devregs/devregs_git.bb b/bsp/meta-freescale/recipes-devtools/devregs/devregs_git.bb
index 3bac55a4..7f158fd8 100644
--- a/bsp/meta-freescale/recipes-devtools/devregs/devregs_git.bb
+++ b/bsp/meta-freescale/recipes-devtools/devregs/devregs_git.bb
@@ -3,7 +3,7 @@ SECTION = "devel"
LICENSE = "GPL-1"
LIC_FILES_CHKSUM = "file://COPYING;md5=5003fa041d799dd5dd5f646b74e36924"
-SRCREV = "34ed402b92920864b89e0fd1e76bae3aa340baaa"
+SRCREV = "d5f6223027f4d6ae71bd5d432f5611486e0e6074"
SRC_URI = "git://github.com/boundarydevices/devregs.git;protocol=http"
PV = "1.0+${SRCPV}"
diff --git a/bsp/meta-freescale/recipes-devtools/imx-usb-loader/imx-usb-loader_git.bb b/bsp/meta-freescale/recipes-devtools/imx-usb-loader/imx-usb-loader_git.bb
index a1f9c4d8..c5f51983 100644
--- a/bsp/meta-freescale/recipes-devtools/imx-usb-loader/imx-usb-loader_git.bb
+++ b/bsp/meta-freescale/recipes-devtools/imx-usb-loader/imx-usb-loader_git.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
DEPENDS = "libusb1"
-SRCREV = "e5394615dd413c3823d5bd1de340933e16a8c07c"
+SRCREV = "f009770d841468204ab104bf7d3b0c5bc8425dbb"
SRC_URI = "git://github.com/boundarydevices/imx_usb_loader.git;protocol=http"
PV = "1.0+${SRCPV}"
diff --git a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch
new file mode 100644
index 00000000..2d3bd7e0
--- /dev/null
+++ b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0001-linux-user-remove-host-stime-syscall.patch
@@ -0,0 +1,67 @@
+From 0f1f2d4596aee037d3ccbcf10592466daa54107f Mon Sep 17 00:00:00 2001
+From: Laurent Vivier <laurent@vivier.eu>
+Date: Tue, 12 Nov 2019 15:25:56 +0100
+Subject: [PATCH] linux-user: remove host stime() syscall
+
+stime() has been withdrawn from glibc
+(12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.")
+
+Implement the target stime() syscall using host
+clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc.
+
+Tested qemu-ppc/x86_64 with:
+
+ #include <time.h>
+ #include <stdio.h>
+
+ int main(void)
+ {
+ time_t t;
+ int ret;
+
+ /* date -u -d"2019-11-12T15:11:00" "+%s" */
+ t = 1573571460;
+ ret = stime(&t);
+ printf("ret %d\n", ret);
+ return 0;
+ }
+
+ # date; ./stime; date
+ Tue Nov 12 14:18:32 UTC 2019
+ ret 0
+ Tue Nov 12 15:11:00 UTC 2019
+
+Upstream-Status: Backport
+
+Buglink: https://bugs.launchpad.net/qemu/+bug/1852115
+Reported-by: Cole Robinson <crobinso@redhat.com>
+Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
+Message-Id: <20191112142556.6335-1-laurent@vivier.eu>
+---
+ linux-user/syscall.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index 4e97bcf1e5..ce399a55f0 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -7764,10 +7764,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
+ #ifdef TARGET_NR_stime /* not on alpha */
+ case TARGET_NR_stime:
+ {
+- time_t host_time;
+- if (get_user_sal(host_time, arg1))
++ struct timespec ts;
++ ts.tv_nsec = 0;
++ if (get_user_sal(ts.tv_sec, arg1)) {
+ return -TARGET_EFAULT;
+- return get_errno(stime(&host_time));
++ }
++ return get_errno(clock_settime(CLOCK_REALTIME, &ts));
+ }
+ #endif
+ #ifdef TARGET_NR_alarm /* not on alpha */
+--
+2.24.0
+
diff --git a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch
new file mode 100644
index 00000000..7f7da510
--- /dev/null
+++ b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch
@@ -0,0 +1,33 @@
+From 8ee6281516bd9210e75e91d705da8916bab3bf51 Mon Sep 17 00:00:00 2001
+From: Juro Bystricky <juro.bystricky@intel.com>
+Date: Thu, 31 Aug 2017 11:06:56 -0700
+Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for
+ qemu.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+---
+ tests/Makefile.include | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/tests/Makefile.include b/tests/Makefile.include
+index 8566f5f1..52d0320b 100644
+--- a/tests/Makefile.include
++++ b/tests/Makefile.include
+@@ -1210,4 +1210,12 @@ all: $(QEMU_IOTESTS_HELPERS-y)
+ -include $(wildcard tests/*.d)
+ -include $(wildcard tests/libqos/*.d)
+
++buildtest-TESTS: $(check-unit-y)
++
++runtest-TESTS:
++ for f in $(check-unit-y); do \
++ nf=$$(echo $$f | sed 's/tests\//\.\//g'); \
++ $$nf; \
++ done
++
+ endif
diff --git a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/memfd.patch b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/memfd.patch
deleted file mode 100644
index d9e7a455..00000000
--- a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/memfd.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From d60ecdd94f4054aa0ec615824d5efdb4cebc7db9 Mon Sep 17 00:00:00 2001
-From: Ting Liu <ting.liu@nxp.com>
-Date: Thu, 19 Apr 2018 11:47:16 +0800
-Subject: [PATCH] memfd
-
----
- configure | 2 +-
- util/memfd.c | 4 +---
- 2 files changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/configure b/configure
-index be4d326..cb5197c 100755
---- a/configure
-+++ b/configure
-@@ -3735,7 +3735,7 @@ fi
- # check if memfd is supported
- memfd=no
- cat > $TMPC << EOF
--#include <sys/memfd.h>
-+#include <sys/mman.h>
-
- int main(void)
- {
-diff --git a/util/memfd.c b/util/memfd.c
-index 4571d1a..412e94a 100644
---- a/util/memfd.c
-+++ b/util/memfd.c
-@@ -31,9 +31,7 @@
-
- #include "qemu/memfd.h"
-
--#ifdef CONFIG_MEMFD
--#include <sys/memfd.h>
--#elif defined CONFIG_LINUX
-+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
- #include <sys/syscall.h>
- #include <asm/unistd.h>
-
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/run-ptest b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/run-ptest
index 2206b319..b25a792d 100644
--- a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/run-ptest
+++ b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq/run-ptest
@@ -7,4 +7,4 @@ ptestdir=$(dirname "$(readlink -f "$0")")
export SRC_PATH=$ptestdir
cd $ptestdir/tests
-make -f Makefile.include -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'
+make -f Makefile.include -k runtest-TESTS | sed '/^ok /s/ok /PASS: /g'
diff --git a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_4.1.0.bb b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_4.1.0.bb
new file mode 100644
index 00000000..a281170c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_4.1.0.bb
@@ -0,0 +1,53 @@
+BBCLASSEXTEND = ""
+
+require recipes-devtools/qemu/qemu.inc
+
+COMPATIBLE_MACHINE = "(qoriq)"
+
+DEPENDS = "glib-2.0 zlib pixman bison-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
+ file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
+
+SRC_URI = "gitsm://source.codeaurora.org/external/qoriq/qoriq-components/qemu;nobranch=1 \
+ file://powerpc_rom.bin \
+ file://run-ptest \
+ file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \
+ file://0001-linux-user-remove-host-stime-syscall.patch \
+ "
+
+SRCREV = "521a0dcf59f1ca11e7d9e2f4e1ef3d2dfaebc0e4"
+
+S = "${WORKDIR}/git"
+
+python() {
+ d.appendVar('PROVIDES', ' ' + d.getVar('BPN').replace('-qoriq', ''))
+ pkgs = d.getVar('PACKAGES').split()
+ for p in pkgs:
+ if '-qoriq' in p:
+ d.appendVar('RPROVIDES_' + p, ' ' + p.replace('-qoriq', ''))
+ d.appendVar('RCONFLICTS_' + p, ' ' + p.replace('-qoriq', ''))
+ d.appendVar('RREPLACES_' + p, ' ' + p.replace('-qoriq', ''))
+}
+
+RDEPENDS_${PN}_class-target += "bash"
+
+EXTRA_OECONF_append_class-target = " --target-list=${@get_qemu_target_list(d)}"
+EXTRA_OECONF_append_class-target_mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
+EXTRA_OECONF_append_class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"
+
+do_install_append_class-nativesdk() {
+ ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
+}
+
+PACKAGECONFIG ??= " \
+ fdt sdl kvm aio libusb \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
+"
+PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm"
+
+PACKAGECONFIG[xkbcommon] = ",,"
+PACKAGECONFIG[libudev] = ",,"
+
+DISABLE_STATIC = ""
+
diff --git a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_git.bb b/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_git.bb
deleted file mode 100644
index 7423b542..00000000
--- a/bsp/meta-freescale/recipes-devtools/qemu/qemu-qoriq_git.bb
+++ /dev/null
@@ -1,72 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-require recipes-devtools/qemu/qemu.inc
-
-inherit ptest
-
-RDEPENDS_${PN}-ptest = "bash make"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
- file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/qemu;nobranch=1 \
- file://powerpc_rom.bin \
- file://run-ptest \
- file://memfd.patch \
- "
-
-SRCREV = "6c297a7ddd355d499ddd31353a763d57a092f851"
-
-S = "${WORKDIR}/git"
-
-COMPATIBLE_HOST_mipsarchn32 = "null"
-COMPATIBLE_HOST_mipsarchn64 = "null"
-
-PROVIDES = "qemu"
-
-python() {
- pkgs = d.getVar('PACKAGES', True).split()
- for p in pkgs:
- if 'qemu-qoriq' in p:
- d.appendVar("RPROVIDES_%s" % p, p.replace('qemu-qoriq', 'qemu'))
- d.appendVar("RCONFLICTS_%s" % p, p.replace('qemu-qoriq', 'qemu'))
- d.appendVar("RREPLACES_%s" % p, p.replace('qemu-qoriq', 'qemu'))
-}
-
-PPC_OECONF = '--enable-fdt --enable-kvm --with-system-pixman --disable-werror'
-EXTRA_OECONF_qoriq-arm64 = "--prefix=${prefix} --target-list=aarch64-softmmu --enable-fdt --enable-kvm --with-system-pixman --disable-werror"
-EXTRA_OECONF_qoriq-arm = "--prefix=${prefix} --target-list=arm-softmmu --enable-fdt --enable-kvm --with-system-pixman --disable-werror"
-EXTRA_OECONF_e5500-64b = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
-EXTRA_OECONF_e6500-64b = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
-EXTRA_OECONF_e6500 = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
-EXTRA_OECONF_e5500 = "--prefix=${prefix} --target-list=ppc64-softmmu ${PPC_OECONF}"
-EXTRA_OECONF_e500v2 = "--prefix=${prefix} --target-list=ppc-softmmu ${PPC_OECONF}"
-EXTRA_OECONF_e500mc = "--prefix=${prefix} --target-list=ppc-softmmu ${PPC_OECONF}"
-
-DISABLE_STATIC = ""
-
-do_install_append() {
- # Prevent QA warnings about installed ${localstatedir}/run
- if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
- install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
-}
-
-do_compile_ptest() {
- make buildtest-TESTS
-}
-
-do_install_ptest() {
- cp -rL ${B}/tests ${D}${PTEST_PATH}
- find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
-
- cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
- # Don't check the file genreated by configure
- sed -i -e '/wildcard config-host.mak/d' \
- -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include
-}
-
-INSANE_SKIP_${PN} += "already-stripped"
-FILES_${PN} += "/usr/share/qemu/* /usr/var/*"
-
-# FIXME: Avoid WARNING due missing patch for native/nativesdk
-BBCLASSEXTEND = ""
diff --git a/bsp/meta-freescale/recipes-dpaa/eth-config/eth-config_git.bb b/bsp/meta-freescale/recipes-dpaa/eth-config/eth-config_git.bb
index 5255bd02..cfeae114 100644
--- a/bsp/meta-freescale/recipes-dpaa/eth-config/eth-config_git.bb
+++ b/bsp/meta-freescale/recipes-dpaa/eth-config/eth-config_git.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=47716bd5b656aa5e298a132a64d2d1e4"
PR = "r2"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/eth-config;nobranch=1"
-SRCREV = "eefb06353c8c3db34d22c26825b66e921bce617d"
+SRCREV = "6164664070e45810c793f112781ebcedc979e132"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-dpaa/fm-ucode/fm-ucode_git.bb b/bsp/meta-freescale/recipes-dpaa/fm-ucode/fm-ucode_git.bb
index 1db1acd0..39e4f9d0 100644
--- a/bsp/meta-freescale/recipes-dpaa/fm-ucode/fm-ucode_git.bb
+++ b/bsp/meta-freescale/recipes-dpaa/fm-ucode/fm-ucode_git.bb
@@ -5,9 +5,9 @@ LIC_FILES_CHKSUM = "file://Freescale-Binary-EULA;md5=b784c031868ba1bd5ebc5de372c
PR = "r1"
-inherit deploy fsl-eula-unpack
+inherit deploy
-SRC_URI = "git://github.com/NXP/qoriq-fm-ucode.git;fsl-eula=true;nobranch=1"
+SRC_URI = "git://github.com/NXP/qoriq-fm-ucode.git;nobranch=1"
SRCREV = "c275e91392e2adab1ed22f3867b8269ca3c54014"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-dpaa/fmlib/fmlib_git.bb b/bsp/meta-freescale/recipes-dpaa/fmlib/fmlib_git.bb
index 69768130..880d768b 100644
--- a/bsp/meta-freescale/recipes-dpaa/fmlib/fmlib_git.bb
+++ b/bsp/meta-freescale/recipes-dpaa/fmlib/fmlib_git.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=9c7bd5e45d066db084bdb3543d55b1ac"
PR = "r1"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/fmlib;nobranch=1"
-SRCREV = "82d89adae917397324c5d74108305f6c9bae8d00"
+SRCREV = "69a70474cd8411d5a099c34f40760b6567d781d6"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-dpaa2/aiopsl/aiopsl_git.bb b/bsp/meta-freescale/recipes-dpaa2/aiopsl/aiopsl_git.bb
index 9ba12816..a1b00289 100644
--- a/bsp/meta-freescale/recipes-dpaa2/aiopsl/aiopsl_git.bb
+++ b/bsp/meta-freescale/recipes-dpaa2/aiopsl/aiopsl_git.bb
@@ -8,7 +8,7 @@ BASEDEPENDS = ""
S = "${WORKDIR}/git"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/aiopsl;nobranch=1"
-SRCREV = "ec0e50b9bfe794b78bf0d91789f2a77dc4e8ceb4"
+SRCREV = "87d83d8e99770325cc7ad9e10965c9959e7cb828"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
@@ -18,11 +18,10 @@ DEMOS_PATH_ls1088a = "LS1088A"
do_install () {
install -d ${D}/usr/aiop/bin
- install -d ${D}/usr/aiop/scripts
- install -d ${D}/usr/aiop/traffic_files
- install -m 755 ${S}/demos/images/${DEMOS_PATH}/*.elf ${D}/usr/aiop/bin
- install -m 755 ${S}/misc/setup/scripts/dynamic_aiop_*.sh ${D}/usr/aiop/scripts
- install -m 644 ${S}/misc/setup/traffic_files/classifier.pcap ${D}/usr/aiop/traffic_files
+ install -d ${D}/usr/aiop/
+ cp -rf ${S}/demos/images/* ${D}/usr/aiop/bin
+ cp -rf ${S}/misc/setup/scripts ${D}/usr/aiop/
+ cp -rf ${S}/misc/setup/traffic_files/ ${D}/usr/aiop/
}
FILES_${PN} += "/usr/aiop/*"
diff --git a/bsp/meta-freescale/recipes-dpaa2/dce/dce_git.bb b/bsp/meta-freescale/recipes-dpaa2/dce/dce_git.bb
index 7313ca73..0e31a3c4 100644
--- a/bsp/meta-freescale/recipes-dpaa2/dce/dce_git.bb
+++ b/bsp/meta-freescale/recipes-dpaa2/dce/dce_git.bb
@@ -1,13 +1,13 @@
DESCRIPTION = "Decompression Compression Engine Userspace Utils"
SECTION = "dpaa2"
LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=338308e2a663929309c9929ab9495bb5"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=956df5ea6cfe0a1dcf2dee7ca37c0cdf"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/dce;nobranch=1 \
git://source.codeaurora.org/external/qoriq/qoriq-components/qbman_userspace;nobranch=1;name=qbman;destsuffix=git/lib/qbman_userspace \
"
-SRCREV = "49389aa57cc94e0503f53c6b33e4b358ccf42eb5"
-SRCREV_qbman = "383ceac0c09b1e38f2a8b1cf42822686b4cf15f3"
+SRCREV = "0ec35ad12ad04b5dadfa9f8c8a718c715bde41db"
+SRCREV_qbman = "a1af1e1528fe2e1ce0df1e6d9170b6c239c8ab4f"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-dpaa2/dpl-examples/dpl-examples_git.bb b/bsp/meta-freescale/recipes-dpaa2/dpl-examples/dpl-examples_git.bb
deleted file mode 100644
index aca35a84..00000000
--- a/bsp/meta-freescale/recipes-dpaa2/dpl-examples/dpl-examples_git.bb
+++ /dev/null
@@ -1,35 +0,0 @@
-SUMMARY = "Datapath layout examples"
-LICENSE = "Freescale-EULA"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=386a6287daa6504b7e7e5014ddfb3987"
-
-DEPENDS = "dtc-native"
-
-inherit deploy fsl-eula-unpack
-
-SRC_URI = "git://github.com/qoriq-open-source/dpl-examples.git;fsl-eula=true;nobranch=1"
-SRCREV = "a6c83759c0d9c02822eec89e86357a0998ef51d4"
-
-S = "${WORKDIR}/git"
-
-REGLEX_ls2088a = "ls2088a"
-REGLEX_ls1088a = "ls1088a"
-
-do_install () {
- install -d ${D}/boot
- install -m 644 ${S}/${REGLEX}/RDB/*.dtb ${D}/boot
- install -m 644 ${S}/${REGLEX}/RDB/custom/*.dtb ${D}/boot
-}
-
-do_deploy () {
- install -d ${DEPLOYDIR}/dpl-examples
- install -m 644 ${S}/${REGLEX}/RDB/*.dtb ${DEPLOYDIR}/dpl-examples
- install -m 644 ${S}/${REGLEX}/RDB/custom/*.dtb ${DEPLOYDIR}/dpl-examples
-}
-addtask deploy before do_build after do_install
-
-PACKAGES += "${PN}-image"
-FILES_${PN}-image += "/boot"
-
-COMPATIBLE_MACHINE = "(ls2080ardb|ls2088a|ls1088a)"
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
diff --git a/bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.12.0.bb b/bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.14.1.bb
index 6b5d0a87..ddb305c1 100644
--- a/bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.12.0.bb
+++ b/bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.14.1.bb
@@ -2,16 +2,17 @@ SUMMARY = "DPAA2 Management Complex Firmware"
LICENSE = "NXP-Binary-EULA"
LIC_FILES_CHKSUM = "file://NXP-Binary-EULA.txt;md5=afcb1213054384820390d410ab62105f"
-inherit deploy fsl-eula-unpack
+inherit deploy
INHIBIT_DEFAULT_DEPS = "1"
-SRC_URI = "git://github.com/nxp/qoriq-mc-binary;fsl-eula=true;nobranch=1"
-SRCREV = "cdb5af4b25ec1ee3e9d26ece41efaa1556b28bac"
+SRC_URI = "git://github.com/nxp/qoriq-mc-binary;nobranch=1"
+SRCREV = "408110ee632f6291545b0b156cd74e7e3b4612cc"
S = "${WORKDIR}/git"
REGLEX_ls2088a = "ls2088a"
+REGLEX_ls2080a = "ls2080a"
REGLEX_ls1088a = "ls1088a"
REGLEX_lx2160a = "lx2160a"
@@ -24,7 +25,7 @@ do_deploy () {
install -d ${DEPLOYDIR}/mc_app
install -m 755 ${S}/${REGLEX}/*.itb ${DEPLOYDIR}/mc_app
# make a symlink to the latest binary
- for mc_binary in `ls ${DEPLOYDIR}/mc_app |sort`;do
+ for mc_binary in `find ${DEPLOYDIR}/mc_app -type f -printf "%f\n" |sort`;do
ln -sfT ${mc_binary} ${DEPLOYDIR}/mc_app/mc.itb
done
}
diff --git a/bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.20.4.bb b/bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.20.4.bb
new file mode 100644
index 00000000..3e14a26e
--- /dev/null
+++ b/bsp/meta-freescale/recipes-dpaa2/management-complex/management-complex_10.20.4.bb
@@ -0,0 +1,41 @@
+SUMMARY = "DPAA2 Management Complex Firmware"
+LICENSE = "NXP-Binary-EULA"
+LIC_FILES_CHKSUM = "file://NXP-Binary-EULA.txt;md5=73d4b970c18882e229e4bf1ada5bb8d6"
+
+inherit deploy
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "git://github.com/nxp/qoriq-mc-binary;nobranch=1"
+SRCREV = "f73683596a7b72124d67b62e64f3dc2bb36b9321"
+
+S = "${WORKDIR}/git"
+
+REGLEX_ls2088a = "ls2088a"
+REGLEX_ls2080a = "ls2080a"
+REGLEX_ls1088a = "ls1088a"
+REGLEX_lx2160a = "lx2160a"
+
+do_install () {
+ install -d ${D}/boot
+ install -m 755 ${S}/${REGLEX}/*.itb ${D}/boot
+}
+
+do_deploy () {
+ install -d ${DEPLOYDIR}/mc_app
+ install -m 755 ${S}/${REGLEX}/*.itb ${DEPLOYDIR}/mc_app
+ # make a symlink to the latest binary
+ for mc_binary in `find ${DEPLOYDIR}/mc_app -type f -printf "%f\n" |sort`;do
+ ln -sfT ${mc_binary} ${DEPLOYDIR}/mc_app/mc.itb
+ done
+}
+addtask deploy before do_build after do_install
+
+PACKAGES += "${PN}-image"
+FILES_${PN}-image += "/boot"
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+COMPATIBLE_MACHINE = "(qoriq-arm64)"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
diff --git a/bsp/meta-freescale/recipes-dpaa2/restool/restool_git.bb b/bsp/meta-freescale/recipes-dpaa2/restool/restool_git.bb
index 382e3144..0211c779 100644
--- a/bsp/meta-freescale/recipes-dpaa2/restool/restool_git.bb
+++ b/bsp/meta-freescale/recipes-dpaa2/restool/restool_git.bb
@@ -7,7 +7,7 @@ RDEPENDS_${PN} += "bash dtc"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/restool;nobranch=1 \
file://0001-restool-fix-build-error-with-gcc7.patch"
-SRCREV = "2b4dd211d5c584d5f81cfa530a3a93854dc1d490"
+SRCREV = "f0cec094e4c6d1c975b377203a3bf994ba9325a9"
S = "${WORKDIR}/git"
@@ -17,6 +17,6 @@ do_install () {
oe_runmake install DESTDIR=${D}
}
-COMPATIBLE_MACHINE = "(ls2080ardb|ls2088ardb|ls1088ardb|ls1043ardb|ls1046ardb)"
+COMPATIBLE_MACHINE = "(qoriq-arm64)"
PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/bsp/meta-freescale/recipes-dpaa2/spc/spc_git.bb b/bsp/meta-freescale/recipes-dpaa2/spc/spc_git.bb
index eceabf91..e9bf1427 100644
--- a/bsp/meta-freescale/recipes-dpaa2/spc/spc_git.bb
+++ b/bsp/meta-freescale/recipes-dpaa2/spc/spc_git.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=163b09a1c249a6ff2b28da1ceca2e0a8"
DEPENDS = "libxml2 fmlib tclap"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/spc;nobranch=1"
-SRCREV = "1a414247ad3228bf60bfb53995a28930a8a29acc"
+SRCREV = "be7dd8e346a934aae1e4bdd6b579f2aa4bb5cd86"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-extended/crconf/crconf/0001-Modify-the-Makefile-for-cross-compile.patch b/bsp/meta-freescale/recipes-extended/crconf/crconf/0001-Modify-the-Makefile-for-cross-compile.patch
new file mode 100644
index 00000000..4459c370
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/crconf/crconf/0001-Modify-the-Makefile-for-cross-compile.patch
@@ -0,0 +1,30 @@
+From 2c260c8c437c7f72f093b6c157a38b93443bde1d Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Mon, 11 Dec 2017 15:45:05 +0800
+Subject: [PATCH] Modify the Makefile for cross compile
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c7bfee2..d6421f3 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,8 +4,8 @@ LIBDIR=/usr/lib
+ SBINDIR=/sbin
+ MANDIR=/share/man
+
+-CC = gcc
+-HOSTCC = gcc
++CC ?= gcc
++HOSTCC ?= gcc
+ CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
+ CFLAGS = $(CCOPTS) -I../include
+
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-extended/crconf/crconf_git.bb b/bsp/meta-freescale/recipes-extended/crconf/crconf_git.bb
new file mode 100644
index 00000000..7dc92776
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/crconf/crconf_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "crconf -Linux crypto layer configuraton tool"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://Makefile;beginline=1;endline=5;md5=0f77fc44eb5911007ae4ac9f6736e111"
+
+SRC_URI = "git://github.com/Thermi/crconf.git;protocol=https;nobranch=1"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'HOSTCC=${CC}'"
+
+SRCREV = "7b5819e7638e471d41dd2dca71f012d5a022f014"
+
+S = "${WORKDIR}/git"
+
+do_install () {
+ oe_runmake install DESTDIR=${D}
+}
+
+FILES_${PN} += "/share/man/* ${libdir}/* ${sbindir}/*"
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk.inc b/bsp/meta-freescale/recipes-extended/dpdk/dpdk.inc
new file mode 100644
index 00000000..f5793a19
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/dpdk/dpdk.inc
@@ -0,0 +1,119 @@
+DESCRIPTION = "Data Plane Development Kit"
+HOMEPAGE = "http://dpdk.org"
+LICENSE = "BSD-3-Clause & LGPLv2 & GPLv2"
+
+DEPENDS = "virtual/kernel openssl"
+DEPENDS_append_x86-64 = " numactl"
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+inherit module
+
+COMPATIBLE_HOST = '(aarch64|arm|i.86|x86_64).*-linux'
+COMPATIBLE_HOST_libc-musl = 'null'
+COMPATIBLE_HOST_armv4 = 'null'
+COMPATIBLE_HOST_armv5 = 'null'
+COMPATIBLE_HOST_armv6 = 'null'
+
+COMPATIBLE_MACHINE = "(imx|qoriq)"
+
+DPDK_RTE_TARGET_x86-64 = "x86_64-native-linuxapp-gcc"
+DPDK_RTE_TARGET_x86 = "i686-native-linuxapp-gcc"
+DPDK_RTE_TARGET_armv7a = "${ARCH}-armv7a-linuxapp-gcc"
+DPDK_RTE_TARGET_armv7ve = "${ARCH}-armv7a-linuxapp-gcc"
+DPDK_RTE_TARGET ?= "${ARCH}-dpaa-linuxapp-gcc"
+
+export RTE_TARGET = "${DPDK_RTE_TARGET}"
+export RTE_OUTPUT = "${S}/${RTE_TARGET}"
+export MODULE_DIR = "/lib/modules/${KERNEL_VERSION}/kernel/drivers/net"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE += 'ETHTOOL_LIB_PATH="${S}/examples/ethtool/lib/${RTE_TARGET}" RTE_SDK="${S}" \
+ OPENSSL_PATH="${STAGING_DIR_HOST}" RTE_KERNELDIR="${STAGING_KERNEL_DIR}" \
+ RTE_KERNELDIR_OUT="${STAGING_KERNEL_BUILDDIR}" EXAMPLES_BUILD_DIR="${RTE_TARGET}" \
+'
+do_configure () {
+ #############################################################
+ ### default value for prefix is "usr", unsetting it, so it
+ ### will not be concatenated in ${RTE_TARGET}/Makefile
+ ### which will cause compilation failure
+ #############################################################
+ unset prefix
+ oe_runmake O=$RTE_TARGET T=$RTE_TARGET config
+}
+
+do_compile () {
+ unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
+
+ cd ${S}/${RTE_TARGET}
+ oe_runmake CONFIG_RTE_EAL_IGB_UIO=n CONFIG_RTE_KNI_KMOD=y \
+ CONFIG_RTE_LIBRTE_PMD_OPENSSL=y \
+ EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" \
+ EXTRA_CFLAGS="${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -I${STAGING_INCDIR}" \
+ CROSS="${TARGET_PREFIX}" \
+ prefix="" LDFLAGS="${TUNE_LDARGS}" WERROR_FLAGS="-w" V=1
+
+ cd ${S}/examples/
+ for APP in l2fwd l3fwd cmdif l2fwd-qdma l2fwd-crypto ipsec-secgw vhost kni ip_fragmentation ip_reassembly; do
+ temp=`basename ${APP}`
+ if [ ${temp} = "ipsec-secgw" ] || [ ${temp} = "l2fwd-crypto" ]; then
+ oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu -fuse-ld=bfd" \
+ EXTRA_CFLAGS="${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -I${STAGING_INCDIR}" \
+ CROSS="${TARGET_PREFIX}" -C ${APP} CONFIG_RTE_LIBRTE_PMD_OPENSSL=y O="${S}/examples/${temp}"
+ else
+ oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu -fuse-ld=bfd" \
+ EXTRA_CFLAGS="${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -I${STAGING_INCDIR}" \
+ CROSS="${TARGET_PREFIX}" -C ${APP} CONFIG_RTE_LIBRTE_PMD_OPENSSL=y O="${S}/examples/${temp}/"
+ fi
+ done
+
+}
+
+do_install () {
+ oe_runmake O=${RTE_OUTPUT} T= install-runtime DESTDIR=${D}
+ oe_runmake O=${RTE_OUTPUT} T= install-kmod DESTDIR=${D} kerneldir=${MODULE_DIR}
+ oe_runmake O=${RTE_OUTPUT} T= install-sdk DESTDIR=${D}
+
+ # Install examples
+ install -d 0644 ${D}/${datadir}/dpdk/cmdif/include
+ install -d 0644 ${D}/${datadir}/dpdk/cmdif/lib
+ install -d 0644 ${D}/${datadir}/dpdk/examples
+ cp examples/cmdif/lib/client/fsl_cmdif_client.h examples/cmdif/lib/server/fsl_cmdif_server.h \
+ examples/cmdif/lib/shbp/fsl_shbp.h ${D}/${datadir}/dpdk/cmdif/include
+ cp examples/cmdif/lib/${RTE_TARGET}/librte_cmdif.a ${D}/${datadir}/dpdk/cmdif/lib
+ install -d 0644 ${D}/${datadir}/dpdk/examples/ipsec_secgw
+ cp -r ${S}/examples/ipsec-secgw/*.cfg ${D}/${datadir}/dpdk/examples/ipsec_secgw
+ cp -rf ${S}/nxp/* ${D}/${datadir}/dpdk
+ cp -r ${S}/examples/cmdif/cmdif_demo/${DPDK_RTE_TARGET}/cmdif_demo ${D}/${datadir}/dpdk/examples
+ cp -r ${S}/examples/vhost/vhost-switch ${D}/${datadir}/dpdk/examples
+ for APP in l2fwd l3fwd l2fwd-qdma l2fwd-crypto ipsec-secgw kni ip_fragmentation ip_reassembly; do
+ cp -r ${S}/examples/${APP}/${APP} ${D}/${datadir}/dpdk/examples
+ done
+}
+
+PACKAGES += "${PN}-examples"
+
+FILES_${PN}-dbg += " \
+ ${datadir}/dpdk/.debug \
+ ${datadir}/dpdk/examples/*/.debug \
+ "
+FILES_${PN}-staticdev += "${datadir}/dpdk/cmdif/lib/*.a \
+"
+FILES_${PN}-dev += " \
+ ${datadir}/dpdk/${RTE_TARGET}/.config \
+ ${includedir} \
+ ${includedir}/exec-env \
+ ${datadir}/dpdk/buildtools/ \
+ ${datadir}/dpdk/${RTE_TARGET}/include \
+ ${datadir}/dpdk/${RTE_TARGET}/lib \
+ ${datadir}/dpdk/mk \
+ "
+
+FILES_${PN} += " ${datadir}/ \
+ ${prefix}/sbin/ \
+ ${prefix}/bin/ \
+ ${libdir}/ \
+ "
+FILES_${PN}-examples += " \
+ ${datadir}/examples/* \
+ "
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-Add-RTE_KERNELDIR_OUT.patch b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-Add-RTE_KERNELDIR_OUT.patch
new file mode 100644
index 00000000..5ee48a59
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-Add-RTE_KERNELDIR_OUT.patch
@@ -0,0 +1,26 @@
+From 9c2b840a1c8ac0fbb638b5cd481909a3f832eed4 Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Wed, 3 Jul 2019 08:50:45 +0200
+Subject: [PATCH] Add RTE_KERNELDIR_OUT
+
+Signed-off-by: C.r. Guo <nxa13725@lsv07004.swis.us-cdc01.nxp.com>
+---
+ kernel/linux/kni/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/linux/kni/Makefile b/kernel/linux/kni/Makefile
+index 595bac261..28a31f36a 100644
+--- a/kernel/linux/kni/Makefile
++++ b/kernel/linux/kni/Makefile
+@@ -20,7 +20,7 @@ MODULE_CFLAGS += -Wall -Werror
+
+ ifeq ($(DISTRIB_ID),Ubuntu)
+ MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(DISTRIB_RELEASE))
+-UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR)/include/generated/utsrelease.h \
++UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR_OUT)/include/generated/utsrelease.h \
+ | cut -d '"' -f2 | cut -d- -f1,2 | tr .- ,`,1)
+ MODULE_CFLAGS += -D"UBUNTU_KERNEL_CODE=UBUNTU_KERNEL_VERSION($(UBUNTU_KERNEL_CODE))"
+ endif
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-add-Wno-cast-function-type.patch b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-add-Wno-cast-function-type.patch
new file mode 100644
index 00000000..fa0eda87
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-add-Wno-cast-function-type.patch
@@ -0,0 +1,26 @@
+From 354c2d1570ddf83a99c4ac711c884644c6dd1cef Mon Sep 17 00:00:00 2001
+From: "C.r. Guo" <nxa13725@lsv07005.swis.us-cdc01.nxp.com>
+Date: Wed, 27 Mar 2019 09:35:43 +0100
+Subject: [PATCH] add -Wno-cast-function-type
+
+Upstream-Status: Inappropriate [configuration]
+---
+ examples/cmdif/lib/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/examples/cmdif/lib/Makefile b/examples/cmdif/lib/Makefile
+index 235c3adbf..230f17b0a 100644
+--- a/examples/cmdif/lib/Makefile
++++ b/examples/cmdif/lib/Makefile
+@@ -28,7 +28,7 @@ SRCS-y += server/cmdif_srv_gpp.c
+ SRCS-y += shbp/shbp.c
+
+ CFLAGS += -O3
+-CFLAGS += $(WERROR_FLAGS)
++CFLAGS += $(WERROR_FLAGS) -Wno-cast-function-type -Wno-missing-attributes
+ CFLAGS += -I$(RTE_SDK)/examples/cmdif/lib
+ CFLAGS += -I$(RTE_SDK)/examples/cmdif/lib/client
+ CFLAGS += -I$(RTE_SDK)/examples/cmdif/lib/server
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-examples-ipsec-gw-fix-gcc-10-maybe-uninitialized-war.patch b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-examples-ipsec-gw-fix-gcc-10-maybe-uninitialized-war.patch
new file mode 100644
index 00000000..3b5a2b3a
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-examples-ipsec-gw-fix-gcc-10-maybe-uninitialized-war.patch
@@ -0,0 +1,53 @@
+From 6fe3e96ab6e92f8faca9784a46bc33d92790c2b8 Mon Sep 17 00:00:00 2001
+From: Kevin Traynor <ktraynor@redhat.com>
+Date: Wed, 11 Mar 2020 11:33:00 +0000
+Subject: [PATCH] examples/ipsec-gw: fix gcc 10 maybe-uninitialized warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+gcc 10.0.1 reports:
+
+../examples/ipsec-secgw/ipsec_process.c: In function ‘ipsec_process’:
+../examples/ipsec-secgw/ipsec_process.c:132:34:
+error: ‘grp.m’ may be used uninitialized in this function
+ [-Werror=maybe-uninitialized]
+ 132 | grp[n].cnt = pkts + i - grp[n].m;
+ | ~~~~~~^~
+
+This is a correct warning for the initial execution of the statement.
+However, it is the design of the loop that grp[0].cnt will later be
+written with the correct value using an initialized grp[0].m before it
+is used.
+
+In order to remove the warning, initialize grp[0].m for the initial and
+unused calculation of grp[0].cnt.
+
+Fixes: 3e5f4625dc17 ("examples/ipsec-secgw: make data-path to use IPsec library")
+Cc: stable@dpdk.org
+
+Upstream-Status: Backport
+
+Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
+Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
+Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
+Signed-off-by: Jens Rehsack <jens.rehsack.ext@safrangroup.com>
+---
+ examples/ipsec-secgw/ipsec_process.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/examples/ipsec-secgw/ipsec_process.c b/examples/ipsec-secgw/ipsec_process.c
+index 2eb5c8b34..37f406d46 100644
+--- a/examples/ipsec-secgw/ipsec_process.c
++++ b/examples/ipsec-secgw/ipsec_process.c
+@@ -125,6 +125,7 @@ sa_group(void *sa_ptr[], struct rte_mbuf *pkts[],
+ void * const nosa = &spi;
+
+ sa = nosa;
++ grp[0].m = pkts;
+ for (i = 0, n = 0; i != num; i++) {
+
+ if (sa != sa_ptr[i]) {
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-fix-gcc-8-build-error.patch b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-fix-gcc-8-build-error.patch
deleted file mode 100644
index 51987b53..00000000
--- a/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0001-fix-gcc-8-build-error.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 7409d0b89f80a72d91e02dc9ec688a01723c3c66 Mon Sep 17 00:00:00 2001
-From: Chunrong Guo <chunrong.guo@nxp.com>
-Date: Wed, 4 Jul 2018 17:12:39 +0800
-Subject: [PATCH] fix gcc-8 build error
-
-Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
----
- examples/ipsec-secgw/parser.c | 6 ++----
- mk/toolchain/gcc/rte.vars.mk | 2 +-
- 2 files changed, 3 insertions(+), 5 deletions(-)
-
-diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c
-index 9d0ea46..b2b30e4 100644
---- a/examples/ipsec-secgw/parser.c
-+++ b/examples/ipsec-secgw/parser.c
-@@ -544,8 +544,7 @@ parse_cfg_file(const char *cfg_filename)
- goto error_exit;
- }
-
-- strncpy(str + strlen(str), oneline,
-- strlen(oneline));
-+ strcpy(str + strlen(str), oneline);
-
- continue;
- }
-@@ -557,8 +556,7 @@ parse_cfg_file(const char *cfg_filename)
- cfg_filename, line_num);
- goto error_exit;
- }
-- strncpy(str + strlen(str), oneline,
-- strlen(oneline));
-+ strcpy(str + strlen(str), oneline);
-
- str[strlen(str)] = '\n';
- if (cmdline_parse(cl, str) < 0) {
-diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
-index 3b907e2..cc63da8 100644
---- a/mk/toolchain/gcc/rte.vars.mk
-+++ b/mk/toolchain/gcc/rte.vars.mk
-@@ -75,7 +75,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
- WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
- WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
- WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
--WERROR_FLAGS += -Wundef -Wwrite-strings
-+WERROR_FLAGS += -Wundef -Wwrite-strings -Wno-cast-function-type
-
- ifeq ($(RTE_DEVEL_BUILD),y)
- WERROR_FLAGS += -Werror
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0004-update-WERROR_FLAGS.patch b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0004-update-WERROR_FLAGS.patch
new file mode 100644
index 00000000..61467377
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/dpdk/dpdk/0004-update-WERROR_FLAGS.patch
@@ -0,0 +1,39 @@
+From aa97b9162b68780ca912a226b5045a3ddab41d3c Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Thu, 4 Jul 2019 08:03:56 +0200
+Subject: [PATCH] update WERROR_FLAGS
+
+Signed-off-by: C.r. Guo <nxa13725@lsv07004.swis.us-cdc01.nxp.com>
+---
+ kernel/linux/kni/Makefile | 2 +-
+ mk/toolchain/gcc/rte.vars.mk | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/linux/kni/Makefile b/kernel/linux/kni/Makefile
+index 595bac261..a17939996 100644
+--- a/kernel/linux/kni/Makefile
++++ b/kernel/linux/kni/Makefile
+@@ -14,7 +14,7 @@ MODULE = rte_kni
+ MODULE_CFLAGS += -I$(SRCDIR) --param max-inline-insns-single=50
+ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include
+ MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
+-MODULE_CFLAGS += -Wall -Werror
++MODULE_CFLAGS += -Wall -Werror -Wno-missing-attributes
+
+ -include /etc/lsb-release
+
+diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
+index de5e0d24d..ca2cb5fcd 100644
+--- a/mk/toolchain/gcc/rte.vars.mk
++++ b/mk/toolchain/gcc/rte.vars.mk
+@@ -49,6 +49,7 @@ WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
+ WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
+ WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
+ WERROR_FLAGS += -Wno-error=pedantic
++WERROR_FLAGS += -Wno-address-of-packed-member
+
+ ifeq ($(RTE_DEVEL_BUILD),y)
+ WERROR_FLAGS += -Werror
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk_17.11.bb b/bsp/meta-freescale/recipes-extended/dpdk/dpdk_17.11.bb
deleted file mode 100644
index f9fe91e8..00000000
--- a/bsp/meta-freescale/recipes-extended/dpdk/dpdk_17.11.bb
+++ /dev/null
@@ -1,104 +0,0 @@
-DESCRIPTION = "Data Plane Development Kit"
-HOMEPAGE = "http://dpdk.org"
-LICENSE = "BSD-3-Clause & LGPLv2 & GPLv2"
-LIC_FILES_CHKSUM = "file://license/README;md5=3383def2d4c82237df281174e981a492"
-
-DEPENDS += "virtual/kernel openssl"
-RDEPENDS_${PN} = "bash python"
-RDEPENDS_${PN}-examples = "bash python-core"
-
-inherit module
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/dpdk;nobranch=1 \
- file://add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \
- file://0001-fix-gcc-8-build-error.patch \
-"
-SRCREV = "f451d2beff458833f4da6682694ebc5c03d595c6"
-
-S = "${WORKDIR}/git"
-
-DPAA_VER ?= "dpaa"
-export RTE_TARGET = "${ARCH}-${DPAA_VER}-linuxapp-gcc"
-export ETHTOOL_LIB_PATH = "${S}/examples/ethtool/lib/${RTE_TARGET}/"
-
-EXTRA_OEMAKE += 'ARCH="${ARCH}" CROSS="${TARGET_PREFIX}" \
- CPU_CFLAGS="-fPIC --sysroot=${STAGING_DIR_HOST}" RTE_SDK="${S}" \
- OPENSSL_PATH="${STAGING_DIR_HOST}" RTE_KERNELDIR="${STAGING_KERNEL_DIR}" \
- RTE_KERNELDIR_OUT="${STAGING_KERNEL_BUILDDIR}" \
-'
-
-do_configure[noexec] = "1"
-
-do_compile[depends] += "virtual/kernel:do_shared_workdir"
-do_compile() {
- oe_runmake O="${RTE_TARGET}" T="${RTE_TARGET}" config
-}
-
-do_install() {
- unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
-
- oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" WERROR_FLAGS="-w" V=1 T="${RTE_TARGET}" DESTDIR="${D}" install CONFIG_RTE_EAL_IGB_UIO=n CONFIG_RTE_KNI_KMOD=y CONFIG_RTE_LIBRTE_PMD_OPENSSL=y
-
- # Build and install the DPDK examples
- for APP in examples/l2fwd examples/l3fwd examples/l2fwd-qdma examples/l2fwd-crypto examples/ipsec-secgw examples/kni examples/ip_fragmentation examples/ip_reassembly; do
- temp=`basename ${APP}`
- if [ ${temp} = "ipsec-secgw" ] || [ ${temp} = "l2fwd-crypto" ]; then
- oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C ${APP} CONFIG_RTE_LIBRTE_PMD_OPENSSL=y
- else
- oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" EXTRA_CFLAGS="--sysroot=${STAGING_DIR_HOST} -I${STAGING_INCDIR}" -C ${APP}
- fi
-
- [ ! -d ${D}/${bindir}/dpdk-example ] && install -d 0644 ${D}/${bindir}/dpdk-example
- install -m 0755 ${S}/examples/`basename ${APP}`/build/`basename ${APP}` \
- ${D}/${bindir}/dpdk-example/
- done
- oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C examples/vhost
- install -m 0755 ${S}/examples/vhost/build/vhost-switch ${D}/${bindir}/dpdk-example/
- oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C examples/cmdif
-
- install -d 0644 ${D}/usr/share/dpdk/cmdif/include
- install -d 0644 ${D}/usr/share/dpdk/cmdif/lib
- cp examples/cmdif/lib/client/fsl_cmdif_client.h examples/cmdif/lib/server/fsl_cmdif_server.h \
- examples/cmdif/lib/shbp/fsl_shbp.h ${D}/usr/share/dpdk/cmdif/include
- cp examples/cmdif/lib/${RTE_TARGET}/librte_cmdif.a ${D}/usr/share/dpdk/cmdif/lib
-
- install -m 0755 ${S}/${RTE_TARGET}/app/testpmd ${D}/${bindir}/dpdk-example/
- rm -fr ${D}/lib/modules/*
- install -d ${D}/lib/modules/${KERNEL_VERSION}/dpdk
- install -m 0755 ${S}/${RTE_TARGET}/kmod/rte_kni.ko ${D}/lib/modules/${KERNEL_VERSION}/dpdk/
- install -d ${D}/${bindir}/dpdk-example/extras
- cp -rf ${S}/nxp/* ${D}/${bindir}/dpdk-example/extras/
- rm ${D}/${datadir}/${RTE_TARGET}/app/dpdk-pmdinfogen
-
- chown root:root -R ${D}
-}
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-PACKAGES += "${PN}-examples"
-
-FILES_${PN} += "${datadir}/* ${bindir}/* ${sbindir}/* /usr/share/dpdk/cmdif/include/*"
-FILES_${PN}-dbg += "${bindir}/dpdk-example/.debug \
- ${datadir}/examples/kni/build/.debug \
- ${datadir}/examples/kni/build/app/.debug \
- ${datadir}/examples/l2fwd/build/.debug \
- ${datadir}/examples/l2fwd/build/app/.debug \
- ${datadir}/examples/l2fwd-crypto/build/.debug \
- ${datadir}/examples/l2fwd-crypto/build/app/.debug \
- ${datadir}/examples/l3fwd/build/.debug \
- ${datadir}/examples/l3fwd/build/app/.debug \
- ${datadir}/examples/ipsec-secgw/build/.debug \
- ${datadir}/examples/ipsec-secgw/build/app/.debug \
- ${datadir}/examples/ip_fragmentation/build/.debug \
- ${datadir}/examples/ip_fragmentation/build/app/.debug \
- ${datadir}/examples/ip_reassembly/build/.debug \
- ${datadir}/examples/ip_reassembly/build/app/.debug \
-"
-FILES_${PN}-dev += "${datadir}/mk ${datadir}/scripts \
- ${datadir}/${RTE_TARGET} \
- ${includedir} \
-"
-FILES_${PN}-examples += "${datadir}/examples"
-
-FILES_${PN}-staticdev += "/usr/share/dpdk/cmdif/lib/*.a"
-COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-extended/dpdk/dpdk_19.11-20.04.bb b/bsp/meta-freescale/recipes-extended/dpdk/dpdk_19.11-20.04.bb
new file mode 100644
index 00000000..398d2ec4
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/dpdk/dpdk_19.11-20.04.bb
@@ -0,0 +1,19 @@
+LIC_FILES_CHKSUM = "file://license/README;md5=3383def2d4c82237df281174e981a492"
+
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/dpdk;nobranch=1 \
+ file://add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \
+ file://0001-add-Wno-cast-function-type.patch \
+ file://0001-Add-RTE_KERNELDIR_OUT.patch \
+ file://0004-update-WERROR_FLAGS.patch \
+ file://0001-examples-ipsec-gw-fix-gcc-10-maybe-uninitialized-war.patch \
+"
+SRCREV = "4110a5fed09fa034963cfc246a6285911ecbd540"
+
+include dpdk.inc
+
+
+do_install_append () {
+ # Remove the unneeded dir
+ rm -rf ${D}/${datadir}/${RTE_TARGET}/app
+}
+
diff --git a/bsp/meta-freescale/recipes-extended/hyperrelay/hyperrelay_git.bb b/bsp/meta-freescale/recipes-extended/hyperrelay/hyperrelay_git.bb
deleted file mode 100644
index 29056c55..00000000
--- a/bsp/meta-freescale/recipes-extended/hyperrelay/hyperrelay_git.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-DESCRIPTION = "Userspace proxy agent for Code Warrrior HyperTrk"
-LICENSE = "Freescale-EULA"
-LIC_FILES_CHKSUM = "file://EULA;md5=c9ae442cf1f9dd6c13dfad64b0ffe73f"
-
-inherit fsl-eula-unpack
-
-SRC_URI = "git://git.freescale.com/ppc/sdk/hyperrelay.git;fsl-eula=true;branch=sdk-v2.0.x"
-SRCREV = "925af97359c2b86399561f1f97f2cb6ca0ccd344"
-
-S = "${WORKDIR}/git"
-
-CFLAGS += "\
- -Wall \
- -Wundef \
- -Wstrict-prototypes \
- -Wno-trigraphs \
- -fno-strict-aliasing \
- -fno-common \
- -O2 \
- -g \
- -fmessage-length=0 \
- -MMD \
- -MP \
- -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" \
-"
-
-LDFLAGS_prepend = " -lpthread "
-
-do_install() {
- install -d ${D}${bindir}
- oe_runmake install DESTDIR=${D}
-}
-
-COMPATIBLE_MACHINE = "(qoriq-ppc)"
-PACKAGE_ARCH = "${MACHINE_SOCARCH}"
-INSANE_SKIP_${PN} = "ldflags"
diff --git a/bsp/meta-freescale/recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch b/bsp/meta-freescale/recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch
new file mode 100644
index 00000000..df2f37ad
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch
@@ -0,0 +1,69 @@
+From f07cd0e5f32a00a4091fa964d0dae0cd46c17554 Mon Sep 17 00:00:00 2001
+From: Cristinel Panfir <cristinel.panfir@nxp.com>
+Date: Sat, 23 May 2020 08:51:31 +0000
+Subject: [PATCH] tools/scripts: update shebang to python3
+
+Upstream-Status: Pending
+
+Signed-off-by: Cristinel Panfir <cristinel.panfir@nxp.com>
+---
+ scripts/arm64-parsedump.py | 2 +-
+ tools/jailhouse-cell-linux | 2 +-
+ tools/jailhouse-cell-stats | 2 +-
+ tools/jailhouse-config-create | 2 +-
+ tools/jailhouse-hardware-check | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/scripts/arm64-parsedump.py b/scripts/arm64-parsedump.py
+index 9519eb5..c695706 100755
+--- a/scripts/arm64-parsedump.py
++++ b/scripts/arm64-parsedump.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
+index 215932a..bcbb902 100755
+--- a/tools/jailhouse-cell-linux
++++ b/tools/jailhouse-cell-linux
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-cell-stats b/tools/jailhouse-cell-stats
+index 2f7e966..4c5289f 100755
+--- a/tools/jailhouse-cell-stats
++++ b/tools/jailhouse-cell-stats
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
+index 55601a6..9869b94 100755
+--- a/tools/jailhouse-config-create
++++ b/tools/jailhouse-config-create
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-hardware-check b/tools/jailhouse-hardware-check
+index b86756a..0c8fb42 100755
+--- a/tools/jailhouse-hardware-check
++++ b/tools/jailhouse-hardware-check
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-extended/jailhouse/jailhouse_0.11.bb b/bsp/meta-freescale/recipes-extended/jailhouse/jailhouse_0.11.bb
new file mode 100644
index 00000000..32a4f92f
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/jailhouse/jailhouse_0.11.bb
@@ -0,0 +1,122 @@
+SUMMARY = "Jailhouse, i.MX fork"
+HOMEPAGE = "https://github.com/siemens/jailhouse"
+SECTION = "jailhouse"
+LICENSE = "GPL-2.0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \
+ file://tools/root-cell-config.c.tmpl;beginline=6;endline=33;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/jailhouse/hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/jailhouse/cell-config.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/arch/arm/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/arch/arm64/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/arch/x86/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://driver/jailhouse.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+"
+
+SRCBRANCH = "lf-5.4.y"
+SRCREV = "82d5698945eafaffa58bab3b4d6da320bf56289c"
+
+SRC_URI = "git://source.codeaurora.org/external/imx/imx-jailhouse.git;protocol=ssh;branch=${SRCBRANCH} \
+ file://0001-tools-scripts-update-shebang-to-python3.patch \
+"
+
+DEPENDS = " \
+ make-native \
+ python3-mako-native \
+ python3-mako \
+ dtc-native \
+"
+
+inherit module python3native bash-completion deploy setuptools3
+
+S = "${WORKDIR}/git"
+B = "${S}"
+
+JH_ARCH = "arm64"
+JH_DATADIR ?= "${datadir}/jailhouse"
+CELL_DIR ?= "${JH_DATADIR}/cells"
+CELLCONF_DIR ?= "${JH_DATADIR}/configs"
+INMATES_DIR ?= "${JH_DATADIR}/inmates"
+
+JH_CONFIG ?= "${S}/ci/jailhouse-config-x86.h"
+JH_CONFIG_x86 ?= "${S}/ci/jailhouse-config-x86.h"
+JH_CONFIG_x86-64 ?= "${S}/ci/jailhouse-config-x86.h"
+JH_CONFIG_arm ?= "${S}/ci/jailhouse-config-banana-pi.h"
+
+do_configure() {
+ if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
+ then
+ cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/"*.c ${S}/configs/${ARCH}/
+ fi
+}
+
+USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
+ -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
+ -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
+ -I../driver'
+
+TOOLS_SRC_DIR = "${S}/tools"
+TOOLS_OBJ_DIR = "${S}/tools"
+
+do_compile() {
+ unset LDFLAGS
+ oe_runmake V=1 CC="${CC}" \
+ ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \
+ KDIR=${STAGING_KERNEL_BUILDDIR}
+
+ cd ${TOOLS_SRC_DIR}
+ export JAILHOUSE_VERSION=$(cat ../VERSION)
+ oe_runmake V=1 \
+ CFLAGS="${USER_SPACE_CFLAGS}" \
+ src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \
+ ${TOOLS_OBJ_DIR}/jailhouse-config-collect ${TOOLS_OBJ_DIR}/jailhouse
+}
+
+do_install() {
+ oe_runmake \
+ PYTHON=python3 \
+ V=1 \
+ LDFLAGS="" \
+ CC="${CC}" \
+ ARCH=${JH_ARCH} \
+ CROSS_COMPILE=${TARGET_PREFIX} \
+ KDIR=${STAGING_KERNEL_BUILDDIR} \
+ DESTDIR=${D} install
+
+ install -d ${D}${CELL_DIR}
+ install ${B}/configs/${JH_ARCH}/*.cell ${D}${CELL_DIR}/
+
+ install -d ${D}${INMATES_DIR}/tools/${JH_ARCH}
+ install ${B}/inmates/demos/${JH_ARCH}/*.bin ${D}${INMATES_DIR}
+
+ install -d ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-cell-linux ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-cell-stats ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-config-collect ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-config-create ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-gcov-extract ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-hardware-check ${D}${JH_DATADIR}/tools
+ install ${B}/inmates/tools/${JH_ARCH}/linux-loader.bin ${D}${INMATES_DIR}/tools/${JH_ARCH}
+}
+
+PACKAGE_BEFORE_PN = "kernel-module-jailhouse pyjailhouse"
+
+FILES_${PN} += "${base_libdir}/firmware ${libexecdir} ${sbindir} ${JH_DATADIR}"
+FILES_pyjailhouse = "${PYTHON_SITEPACKAGES_DIR}"
+
+RDEPENDS_${PN} += " \
+ python3-curses \
+ python3-datetime \
+ python3-mmap \
+"
+
+RDEPENDS_pyjailhouse = " \
+ python3-core \
+ python3-ctypes \
+ python3-fcntl \
+ python3-shell \
+"
+
+INSANE_SKIP_${PN} = "ldflags"
+
+COMPATIBLE_MACHINE = "(mx8m)"
diff --git a/bsp/meta-freescale/recipes-extended/libpkcs11/libpkcs11_git.bb b/bsp/meta-freescale/recipes-extended/libpkcs11/libpkcs11_git.bb
index 2a579c7b..33c27ecd 100644
--- a/bsp/meta-freescale/recipes-extended/libpkcs11/libpkcs11_git.bb
+++ b/bsp/meta-freescale/recipes-extended/libpkcs11/libpkcs11_git.bb
@@ -3,7 +3,7 @@ LICENSE = "GPLv2 & BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=803852533e29eb1d6d5e55ad3078b625"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/libpkcs11;nobranch=1"
-SRCREV = "efd15b9fb6ecc453eb933ac28ef1741b989f842d"
+SRCREV = "a243fb21772f1bd434d8bc1ac45feb36571afadb"
DEPENDS = "openssl secure-obj"
@@ -28,7 +28,7 @@ do_install(){
mkdir -p ${D}/${includedir} ${D}/${bindir}
cp ${S}/out/export/lib/libpkcs11.so ${D}/${libdir}
cp ${S}/out/export/include/*.h ${D}/${includedir}
- cp ${S}/out/export/app/pkcs11_app ${D}/${bindir}
+ cp ${S}/out/export/app/* ${D}/${bindir}
}
PARALLEL_MAKE = ""
diff --git a/bsp/meta-freescale/recipes-extended/ovs-dpdk/files/0001-netdev-dpdk-have-env-based-configurable-number-of-pa.patch b/bsp/meta-freescale/recipes-extended/ovs-dpdk/files/0001-netdev-dpdk-have-env-based-configurable-number-of-pa.patch
new file mode 100644
index 00000000..71b2b58c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/ovs-dpdk/files/0001-netdev-dpdk-have-env-based-configurable-number-of-pa.patch
@@ -0,0 +1,34 @@
+From 95c5c42b9581f595881df11ca8393dc6925f7d7d Mon Sep 17 00:00:00 2001
+From: Nipun Gupta <nipun.gupta@nxp.com>
+Date: Thu, 14 Feb 2019 17:57:14 +0530
+Subject: [PATCH] netdev-dpdk: have env based configurable number of packet
+ buffers
+
+use $export DPDK_NUM_MBUF=number
+
+Upstream-Status: Pending
+
+Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
+---
+ lib/netdev-dpdk.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
+index 6187129c0..1f456a63f 100644
+--- a/lib/netdev-dpdk.c
++++ b/lib/netdev-dpdk.c
+@@ -656,6 +656,11 @@ dpdk_calculate_mbufs(struct netdev_dpdk *dev, int mtu, bool per_port_mp)
+ {
+ uint32_t n_mbufs;
+
++ if (getenv("DPDK_NUM_MBUF")) {
++ n_mbufs = atoi(getenv("DPDK_NUM_MBUF"));
++ return n_mbufs;
++ }
++
+ if (!per_port_mp) {
+ /* Shared memory are being used.
+ * XXX: this is a really rough method of provisioning memory.
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-extended/ovs-dpdk/ovs-dpdk_2.9.bb b/bsp/meta-freescale/recipes-extended/ovs-dpdk/ovs-dpdk_2.13.0.bb
index ab351f6c..9b5d2516 100644
--- a/bsp/meta-freescale/recipes-extended/ovs-dpdk/ovs-dpdk_2.9.bb
+++ b/bsp/meta-freescale/recipes-extended/ovs-dpdk/ovs-dpdk_2.13.0.bb
@@ -1,14 +1,16 @@
DESCRIPTION = "OVS DPDK"
LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=17b2c9d4c70853a09c0e143137754b35"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab"
-DEPENDS = "dpdk python-six-native coreutils-native"
-RDEPENDS_${PN} = "bash libcrypto libssl python"
+DEPENDS = "dpdk python3-six-native coreutils-native"
+RDEPENDS_${PN} = "bash libcrypto libssl python3"
-inherit pythonnative
+inherit python3native
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/ovs-dpdk;nobranch=1"
-SRCREV = "24eec4133f03b0a5a8f903577bc87603577150c0"
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/ovs-dpdk;nobranch=1 \
+ file://0001-netdev-dpdk-have-env-based-configurable-number-of-pa.patch \
+"
+SRCREV = "71d553b995d0bd527d3ab1e9fbaf5a2ae34de2f3"
S = "${WORKDIR}/git"
@@ -45,4 +47,4 @@ do_install() {
ALLOW_EMPTY_${PN} = "1"
INHIBIT_PACKAGE_STRIP = "1"
PACKAGE_ARCH = "${MACHINE_ARCH}"
-COMPATIBLE_MACHINE = "(ls2080ardb|ls2084ardb|ls2088a|ls1043a|ls1046a|ls1088a)"
+COMPATIBLE_MACHINE = "(qoriq-arm64)"
diff --git a/bsp/meta-freescale/recipes-extended/pktgen-dpdk/pktgen-dpdk_git.bb b/bsp/meta-freescale/recipes-extended/pktgen-dpdk/pktgen-dpdk_19.12.0.bb
index 0a6d97de..f3a73c35 100644
--- a/bsp/meta-freescale/recipes-extended/pktgen-dpdk/pktgen-dpdk_git.bb
+++ b/bsp/meta-freescale/recipes-extended/pktgen-dpdk/pktgen-dpdk_19.12.0.bb
@@ -1,22 +1,22 @@
DESCRIPTION = "PKTGEN DPDK"
LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8120b89a783571da3cb492c35ac6b1f9"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=30ac8fa65a07ea7cc1c7ee84e1c80294"
-DEPENDS += "libpcap dpdk"
+DEPENDS += "libpcap dpdk lua lua-native"
-SRC_URI = "git://dpdk.org/git/apps/pktgen-dpdk;protocol=http;nobranch=1"
-SRCREV = "ffbe7becf8dd75fd7d46b97b10374531878cb9c5"
+SRC_URI = "git://dpdk.org/git/apps/pktgen-dpdk;protocol=https;nobranch=1 \
+"
+SRCREV = "7a61e4dfcdf037c31460b6c9bcb301797813036a"
S = "${WORKDIR}/git"
DPAA_VER ?= "dpaa"
export RTE_TARGET = "arm64-${DPAA_VER}-linuxapp-gcc"
-export RTE_SDK = "${RECIPE_SYSROOT}/usr/share"
+export RTE_SDK = "${RECIPE_SYSROOT}/usr/share/"
-EXTRA_OEMAKE += 'CC="${CC}" LD="${LD}" RTE_SDK="${RECIPE_SYSROOT}/usr/share" RTE_TARGET="arm64-${DPAA_VER}-linuxapp-gcc"'
+EXTRA_OEMAKE += 'CC="${CC}" LD="${LD}" RTE_SDK="${RECIPE_SYSROOT}/usr/share/" RTE_TARGET="arm64-${DPAA_VER}-linuxapp-gcc"'
do_compile() {
- unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
oe_runmake
}
diff --git a/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj.inc b/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj.inc
index 20341261..617601ac 100644
--- a/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj.inc
+++ b/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj.inc
@@ -2,17 +2,17 @@ DESCRIPTION = "Secure Object"
LICENSE = "BSD"
DEPENDS = "openssl optee-os-qoriq optee-client-qoriq"
-RDEPENDS_${PN} = "bash libcrypto libssl python"
+RDEPENDS_${PN} = "bash libcrypto libssl"
-DEPENDS += "python-pycrypto-native"
+DEPENDS += "python3-pycrypto-native"
-inherit pythonnative
+inherit python3native
LDFLAGS += "${TOOLCHAIN_OPTIONS}"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/secure_obj;nobranch=1 \
"
-SRCREV = "bc0553a3c7a02555eb6bf46803854f6b49227a26"
+SRCREV = "fb179a861e8e9bfed85ac5ef8387bdd30de48db9"
WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
export SECURE_STORAGE_PATH = "${S}/secure_storage_ta/ta/"
diff --git a/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj_git.bb b/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj_git.bb
index d85d7298..2d723738 100644
--- a/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj_git.bb
+++ b/bsp/meta-freescale/recipes-extended/secure-obj/secure-obj_git.bb
@@ -34,9 +34,11 @@ do_install() {
cp ${S}/secure_storage_ta/ta/b05bcf48-9732-4efa-a9e0-141c7c888c34.ta ${D}${base_libdir}/optee_armtz
cp ${S}/securekey_lib/out/export/lib/libsecure_obj.so ${D}${libdir}
cp ${S}/secure_obj-openssl-engine/libeng_secure_obj.so ${D}${libdir}/${ARCH}-linux-gnu/openssl-1.0.0/engines
- cp ${S}/securekey_lib/out/export/app/* ${D}${bindir}
+ cp ${S}/securekey_lib/out/export/app/*_app ${D}${bindir}
+ cp ${S}/securekey_lib/out/export/app/mp_verify ${D}${bindir}
cp ${S}/secure_obj-openssl-engine/app/sobj_eng_app ${D}${bindir}
cp ${S}/securekey_lib/out/export/include/* ${D}${includedir}
+ rm -rf ${D}${bindir}/test
}
FILES_${PN} += "${base_libdir}/optee_armtz ${libdir}/${ARCH}-linux-gnu/openssl-1.0.0/engines"
diff --git a/bsp/meta-freescale/recipes-extended/skmm-ep/skmm-ep_git.bb b/bsp/meta-freescale/recipes-extended/skmm-ep/skmm-ep_git.bb
index 94649477..b75c0feb 100644
--- a/bsp/meta-freescale/recipes-extended/skmm-ep/skmm-ep_git.bb
+++ b/bsp/meta-freescale/recipes-extended/skmm-ep/skmm-ep_git.bb
@@ -7,7 +7,7 @@ DEPENDS = "libedit openssl virtual/kernel"
PACKAGE_ARCH = "${MACHINE_ARCH}"
-SRC_URI = "git://git.freescale.com/ppc/sdk/skmm-ep.git;branch=sdk-v2.0.x \
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-yocto-sdk/skmm-ep;protocol=https;nobranch=1 \
file://add-two-missing-header-files.patch \
"
SRCREV = "de6816c7d66129683bc62229b482ac3cf585d896"
diff --git a/bsp/meta-freescale/recipes-extended/tsntool/tsntool_git.bb b/bsp/meta-freescale/recipes-extended/tsntool/tsntool_git.bb
new file mode 100644
index 00000000..5694e91c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-extended/tsntool/tsntool_git.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Configure TSN funtionalitie"
+DESCRIPTION = "A tool to configure TSN funtionalities in user space"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ef58f855337069acd375717db0dbbb6d"
+
+DEPENDS = "cjson libnl readline"
+
+inherit pkgconfig
+
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/tsntool;protocol=https;nobranch=1"
+SRCREV = "ca2d8fb348bb54960d706177108c43ae213e0063"
+
+S = "${WORKDIR}/git"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+do_compile_prepend() {
+ mkdir -p ${S}/include/linux
+ cp -r ${STAGING_KERNEL_DIR}/include/uapi/linux/tsn.h ${S}/include/linux
+}
+do_install() {
+ install -d ${D}${bindir} ${D}${libdir}
+ install -m 0755 ${S}/tsntool ${D}${bindir}
+ install -m 0755 ${S}/libtsn.so ${D}${libdir}
+}
+
+PACKAGES = "${PN}-dbg ${PN}"
+FILES_${PN} = "${libdir}/libtsn.so ${bindir}/*"
+INSANE_SKIP_${PN} += "file-rdeps rpaths dev-so"
+COMPATIBLE_MACHINE = "(qoriq)"
+PARALLEL_MAKE = ""
diff --git a/bsp/meta-freescale/recipes-extended/vpp-core/files/0001-GCC-above-5.4-fails-when-we-specify-arch-funattribut.patch b/bsp/meta-freescale/recipes-extended/vpp-core/files/0001-GCC-above-5.4-fails-when-we-specify-arch-funattribut.patch
deleted file mode 100644
index 7f838476..00000000
--- a/bsp/meta-freescale/recipes-extended/vpp-core/files/0001-GCC-above-5.4-fails-when-we-specify-arch-funattribut.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 6dab3ad3f91ebcdb16eb9bbb37383718793b675a Mon Sep 17 00:00:00 2001
-From: babak sarashki <babak.sarashki@windriver.com>
-Date: Sat, 29 Sep 2018 09:57:05 -0700
-Subject: [PATCH] GCC above 5.4 fails when we specify arch funattribute.
-
-Here we are as a workaround setting target.
----
- src/vppinfra/cpu.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/vppinfra/cpu.h b/src/vppinfra/cpu.h
-index 110815c..618276c 100644
---- a/src/vppinfra/cpu.h
-+++ b/src/vppinfra/cpu.h
-@@ -27,7 +27,7 @@
-
- #if __x86_64__ && CLIB_DEBUG == 0
- #define foreach_march_variant(macro, x) \
-- macro(avx2, x, "arch=core-avx2")
-+ macro(avx2, x, "avx2")
- #else
- #define foreach_march_variant(macro, x)
- #endif
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-extended/vpp-core/files/0001-Link-vpp-api-with-shared-libs-if-static-is-disabled.patch b/bsp/meta-freescale/recipes-extended/vpp-core/files/0001-Link-vpp-api-with-shared-libs-if-static-is-disabled.patch
deleted file mode 100644
index ae1c9cbc..00000000
--- a/bsp/meta-freescale/recipes-extended/vpp-core/files/0001-Link-vpp-api-with-shared-libs-if-static-is-disabled.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 7005c075cab39c8018d224c2fe56ad2e4f2db340 Mon Sep 17 00:00:00 2001
-From: babak sarashki <babak.sarashki@windriver.com>
-Date: Tue, 11 Sep 2018 14:08:51 -0700
-Subject: [PATCH] Link vpp-api with shared libs if static is disabled
-
-TODO: this is not complete
----
- src/vpp-api.am | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/vpp-api.am b/src/vpp-api.am
-index 553eafa..30dfe9d 100644
---- a/src/vpp-api.am
-+++ b/src/vpp-api.am
-@@ -23,8 +23,8 @@ libvppapiclient_la_LIBADD = \
- -lpthread -lm -lrt
-
- libvppapiclient_la_LDFLAGS = \
-- -Wl,-L$(top_builddir)/.libs,--whole-archive,-l:libsvm.a,-l:libvppinfra.a,-l:libvlibmemoryclient.a,--no-whole-archive \
-- -Wl,--version-script=$(srcdir)/vpp-api/client/libvppapiclient.map,-lrt
-+ -L$(top_builddir)/.libs -lsvm -lvppinfra -lvlibmemoryclient \
-+ -Wl,--version-script=$(srcdir)/vpp-api/client/libvppapiclient.map,-lrt
-
- libvppapiclient_la_DEPENDENCIES = libvppinfra.la libvlibmemoryclient.la libsvm.la
-
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-extended/vpp-core/files/config.h b/bsp/meta-freescale/recipes-extended/vpp-core/files/config.h
deleted file mode 100644
index 2d617618..00000000
--- a/bsp/meta-freescale/recipes-extended/vpp-core/files/config.h
+++ /dev/null
@@ -1 +0,0 @@
-#define __PRE_DATA_SIZE 128
diff --git a/bsp/meta-freescale/recipes-extended/vpp-core/vpp-core.bb b/bsp/meta-freescale/recipes-extended/vpp-core/vpp-core.bb
deleted file mode 100644
index 2bfbba88..00000000
--- a/bsp/meta-freescale/recipes-extended/vpp-core/vpp-core.bb
+++ /dev/null
@@ -1,65 +0,0 @@
-DESCRIPTION = "Vector Packet Processing"
-
-S = "${WORKDIR}/git"
-PV = "18.01"
-
-LICENSE = "Apache-2.0"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=175792518e4ac015ab6696d16c4f607e"
-
-AUTOTOOLS_SCRIPT_PATH = "${S}/src"
-
-SRCREV = "d3111f07682585079069b91666afffbc73c79cd8"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/vpp;nobranch=1 \
- file://0001-Link-vpp-api-with-shared-libs-if-static-is-disabled.patch \
- file://0001-GCC-above-5.4-fails-when-we-specify-arch-funattribut.patch \
- file://config.h \
- "
-DEPENDS = "dpdk openssl numactl bison-native vpp-core-native"
-DEPENDS_class-native = "bison-native openssl-native"
-
-inherit autotools
-inherit pkgconfig
-inherit python-dir
-
-export ARCH="arm64"
-
-EXTRA_OECONF = " \
- --disable-dependency-tracking \
- --with-libtool-sysroot=${SYSROOT} \
- --srcdir=${S}/src \
- --enable-perftool \
- --disable-papi \
- --disable-japi \
- --disable-static \
- --with-pre-data=128 \
- --disable-flowprobe-plugin --disable-ixge-plugin \
- --disable-memif-plugin --disable-sixrd-plugin --disable-gtpu-plugin \
- --disable-ioam-plugin --disable-lb-plugin --disable-ila-plugin \
- --disable-nat-plugin --disable-l2e-plugin --disable-stn-plugin \
- --disable-pppoe-plugin --disable-kubeproxy-plugin \
- --disable-vom --disable-dpdk-plugin \
-"
-
-EXTRA_OECONF_append_class-native = " --disable-vlib"
-
-
-include vpp-pkgs.inc
-
-
-do_configure_append () {
- ( cd ${B} && mkdir -p vppinfra vpp/app )
- cp ${WORKDIR}/config.h ${S}/src/vlib/config.h
-}
-
-do_install_append() {
- mkdir -p ${D}/etc/vpp
- cp ${S}/src/vpp/conf/startup.conf ${D}/etc/vpp/startup.conf
-}
-
-
-BBCLASSEXTEND = "native nativesdk"
-
-COMPATIBLE_MACHINE_class-target = "(qoriq)"
-
diff --git a/bsp/meta-freescale/recipes-extended/vpp-core/vpp-pkgs.inc b/bsp/meta-freescale/recipes-extended/vpp-core/vpp-pkgs.inc
deleted file mode 100644
index 0dc76092..00000000
--- a/bsp/meta-freescale/recipes-extended/vpp-core/vpp-pkgs.inc
+++ /dev/null
@@ -1,227 +0,0 @@
-
-PACKAGES += "vpp-core-data vpp-core-plugin-igmp vpp-core-plugin-gtpu vpp-core-plugin-gbp \
- vpp-core-plugin-lb vpp-core-plugin-avf vpp-core-plugin-cdp vpp-core-plugin-map vpp-core-plugin-srv6as \
- vpp-core-plugin-l2e vpp-core-plugin-acl vpp-core-plugin-flowprobe vpp-core-plugin-abf \
- vpp-core-plugin-pppoe vpp-core-plugin-lacp vpp-core-plugin-ioam vpp-core-plugin-memif \
- vpp-core-plugin-stn vpp-core-plugin-srv6ad vpp-core-plugin-mactime vpp-core-plugin-unittest \
- vpp-core-plugin-nat vpp-core-plugin-srv6am vpp-core-plugin-lb_test \
- vpp-core-plugin-ioam_vxlan_gpe_test vpp-core-plugin-map_test vpp-core-plugin-avf_test \
- vpp-core-plugin-mactime_test vpp-core-plugin-udp_ping_test vpp-core-plugin-ioam_trace_test \
- vpp-core-plugin-lacp_test vpp-core-plugin-stn_test vpp-core-plugin-memif_test \
- vpp-core-plugin-nat_test vpp-core-plugin-acl_test vpp-core-plugin-ioam_export_test \
- vpp-core-plugin-flowprobe_test vpp-core-plugin-ioam_pot_test \
- vpp-core-plugin-vxlan_gpe_ioam_export_test vpp-core-plugin-pppoe_test vpp-core-plugin-gtpu_test \
- vpp-core-plugin-cdp_test vpp-core-plugin-dpdk vpp-core-plugin-dpdk_test vpp-core-test \
- vpp-core-plugin-tlsopenssl vpp-core-plugin-ixge vpp-core-plugin-ila vpp-core-plugin-data \
- "
-
-#vpp-core-python
-#FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR} \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg-info \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg-info/requires.txt \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg-info/PKG-INFO \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg-info/top_level.txt \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg-info/dependency_links.txt \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg-info/zip-safe \
-# ${PYTHON_SITEPACKAGES_DIR}/vpp_papi-1.6.1-py2.7.egg-info/SOURCES.txt \
-# "
-
-FILES_${PN}-test = " ${bindir}/vpp_json_test "
-FILES_${PN}-plugin-igmp = " ${libdir}/vpp_plugins/igmp_plugin.so "
-FILES_${PN}-plugin-gtpu = " ${libdir}/vpp_plugins/gtpu_plugin.so "
-FILES_${PN}-plugin-gbp = " ${libdir}/vpp_plugins/gbp_plugin.so "
-FILES_${PN}-plugin-lb = " ${libdir}/vpp_plugins/lb_plugin.so "
-FILES_${PN}-plugin-avf = " ${libdir}/vpp_plugins/avf_plugin.so "
-FILES_${PN}-plugin-cdp = " ${libdir}/vpp_plugins/cdp_plugin.so "
-FILES_${PN}-plugin-map = " ${libdir}/vpp_plugins/map_plugin.so "
-FILES_${PN}-plugin-srv6as = " ${libdir}/vpp_plugins/srv6as_plugin.so "
-FILES_${PN}-plugin-tlsopenssl = " ${libdir}/vpp_plugins/tlsopenssl_plugin.so "
-FILES_${PN}-plugin-ixge = " ${libdir}/vpp_plugins/ixge_plugin.so "
-FILES_${PN}-plugin-l2e = " ${libdir}/vpp_plugins/l2e_plugin.so "
-FILES_${PN}-plugin-acl = " ${libdir}/vpp_plugins/acl_plugin.so "
-FILES_${PN}-plugin-flowprobe = " ${libdir}/vpp_plugins/flowprobe_plugin.so "
-FILES_${PN}-plugin-abf = " ${libdir}/vpp_plugins/abf_plugin.so "
-FILES_${PN}-plugin-pppoe = " ${libdir}/vpp_plugins/pppoe_plugin.so "
-FILES_${PN}-plugin-lacp = " ${libdir}/vpp_plugins/lacp_plugin.so "
-FILES_${PN}-plugin-ioam = " ${libdir}/vpp_plugins/ioam_plugin.so "
-FILES_${PN}-plugin-memif = " ${libdir}/vpp_plugins/memif_plugin.so "
-FILES_${PN}-plugin-stn = " ${libdir}/vpp_plugins/stn_plugin.so "
-FILES_${PN}-plugin-srv6ad = " ${libdir}/vpp_plugins/srv6ad_plugin.so "
-FILES_${PN}-plugin-mactime = " ${libdir}/vpp_plugins/mactime_plugin.so "
-FILES_${PN}-plugin-unittest = " ${libdir}/vpp_plugins/unittest_plugin.so "
-FILES_${PN}-plugin-nat = " ${libdir}/vpp_plugins/nat_plugin.so "
-FILES_${PN}-plugin-srv6am = " ${libdir}/vpp_plugins/srv6am_plugin.so "
-FILES_${PN}-plugin-dpdk = " ${libdir}/vpp_plugins/dpdk_plugin.so "
-FILES_${PN}-plugin-ila = " ${libdir}/vpp_plugins/ila_plugin.so "
-
-FILES_${PN}-plugin-lb_test = " ${libdir}/vpp_api_test_plugins/lb_test_plugin.so "
-FILES_${PN}-plugin-ioam_vxlan_gpe_test = " ${libdir}/vpp_api_test_plugins/ioam_vxlan_gpe_test_plugin.so "
-FILES_${PN}-plugin-map_test = " ${libdir}/vpp_api_test_plugins/map_test_plugin.so "
-FILES_${PN}-plugin-avf_test = " ${libdir}/vpp_api_test_plugins/avf_test_plugin.so "
-FILES_${PN}-plugin-mactime_test = " ${libdir}/vpp_api_test_plugins/mactime_test_plugin.so "
-FILES_${PN}-plugin-udp_ping_test = " ${libdir}/vpp_api_test_plugins/udp_ping_test_plugin.so "
-FILES_${PN}-plugin-ioam_trace_test = " ${libdir}/vpp_api_test_plugins/ioam_trace_test_plugin.so "
-FILES_${PN}-plugin-lacp_test = " ${libdir}/vpp_api_test_plugins/lacp_test_plugin.so "
-FILES_${PN}-plugin-stn_test = " ${libdir}/vpp_api_test_plugins/stn_test_plugin.so "
-FILES_${PN}-plugin-memif_test = " ${libdir}/vpp_api_test_plugins/memif_test_plugin.so "
-FILES_${PN}-plugin-nat_test = " ${libdir}/vpp_api_test_plugins/nat_test_plugin.so "
-FILES_${PN}-plugin-acl_test = " ${libdir}/vpp_api_test_plugins/acl_test_plugin.so "
-FILES_${PN}-plugin-ioam_export_test = " ${libdir}/vpp_api_test_plugins/ioam_export_test_plugin.so "
-FILES_${PN}-plugin-flowprobe_test = " ${libdir}/vpp_api_test_plugins/flowprobe_test_plugin.so "
-FILES_${PN}-plugin-ioam_pot_test = " ${libdir}/vpp_api_test_plugins/ioam_pot_test_plugin.so "
-FILES_${PN}-plugin-vxlan_gpe_ioam_export_test = " ${libdir}/vpp_api_test_plugins/vxlan_gpe_ioam_export_test_plugin.so "
-FILES_${PN}-plugin-pppoe_test = " ${libdir}/vpp_api_test_plugins/pppoe_test_plugin.so "
-FILES_${PN}-plugin-gtpu_test = " ${libdir}/vpp_api_test_plugins/gtpu_test_plugin.so "
-FILES_${PN}-plugin-cdp_test = " ${libdir}/vpp_api_test_plugins/cdp_test_plugin.so "
-FILES_${PN}-plugin-dpdk_test = " ${libdir}/vpp_api_test_plugins/dpdk_test_plugin.so "
-
-FILES_${PN}-data = " \
- ${datadir}/vpp/api/core/sctp.api.json \
- ${datadir}/vpp/api/core/sr.api.json \
- ${datadir}/vpp/api/core/gre.api.json \
- ${datadir}/vpp/api/core/lisp.api.json \
- ${datadir}/vpp/api/core/netmap.api.json \
- ${datadir}/vpp/api/core/tcp.api.json \
- ${datadir}/vpp/api/core/ipsec_gre.api.json \
- ${datadir}/vpp/api/core/bfd.api.json \
- ${datadir}/vpp/api/core/tap.api.json \
- ${datadir}/vpp/api/core/oam.api.json \
- ${datadir}/vpp/api/core/vpe.api.json \
- ${datadir}/vpp/api/core/bier.api.json \
- ${datadir}/vpp/api/core/ipsec.api.json \
- ${datadir}/vpp/api/core/af_packet.api.json \
- ${datadir}/vpp/api/core/vxlan_gpe.api.json \
- ${datadir}/vpp/api/core/session.api.json \
- ${datadir}/vpp/api/core/one.api.json \
- ${datadir}/vpp/api/core/sr_mpls.api.json \
- ${datadir}/vpp/api/core/feature.api.json \
- ${datadir}/vpp/api/core/p2p_ethernet.api.json \
- ${datadir}/vpp/api/core/memclnt.api.json \
- ${datadir}/vpp/api/core/pg.api.json \
- ${datadir}/vpp/api/core/l2.api.json \
- ${datadir}/vpp/api/core/punt.api.json \
- ${datadir}/vpp/api/core/classify.api.json \
- ${datadir}/vpp/api/core/policer.api.json \
- ${datadir}/vpp/api/core/span.api.json \
- ${datadir}/vpp/api/core/udp.api.json \
- ${datadir}/vpp/api/core/vxlan.api.json \
- ${datadir}/vpp/api/core/mpls.api.json \
- ${datadir}/vpp/api/core/qos.api.json \
- ${datadir}/vpp/api/core/ip.api.json \
- ${datadir}/vpp/api/core/ipip.api.json \
- ${datadir}/vpp/api/core/bond.api.json \
- ${datadir}/vpp/api/core/dns.api.json \
- ${datadir}/vpp/api/core/tapv2.api.json \
- ${datadir}/vpp/api/core/pipe.api.json \
- ${datadir}/vpp/api/core/dhcp6_pd_client_cp.api.json \
- ${datadir}/vpp/api/core/l2tp.api.json \
- ${datadir}/vpp/api/core/lisp_gpe.api.json \
- ${datadir}/vpp/api/core/cop.api.json \
- ${datadir}/vpp/api/core/geneve.api.json \
- ${datadir}/vpp/api/core/stats.api.json \
- ${datadir}/vpp/api/core/rd_cp.api.json \
- ${datadir}/vpp/api/core/dhcp.api.json \
- ${datadir}/vpp/api/core/lldp.api.json \
- ${datadir}/vpp/api/core/dhcp6_ia_na_client_cp.api.json \
- ${datadir}/vpp/api/core/ipfix_export.api.json \
- ${datadir}/vpp/api/core/vhost_user.api.json \
- ${datadir}/vpp/api/core/interface.api.json \
- ${datadir}/vpp/C.py \
- ${datadir}/vpp/api/core/flow.api.json \
- ${datadir}/vpp/api/core/map.api.json \
- ${datadir}/vpp/api/core/dpdk.api.json \
- ${datadir}/vpp/JSON.py "
-
-
-FILES_${PN} = " \
- ${sysconfdir}/vpp \
- ${sysconfdir}/vpp/startup.conf \
- ${sysconfdir}/vpp/startup.conf.dflt \
- ${sysconfdir}/rc.local \
- ${bindir}/svmdbtool \
- ${bindir}/svmtool \
- ${bindir}/vppapigen \
- ${bindir}/elftool \
- ${bindir}/cpelatency \
- ${bindir}/cpelinreg \
- ${bindir}/elog_merge \
- ${bindir}/c2cpel \
- ${bindir}/cpelstate \
- ${bindir}/cpeldump \
- ${bindir}/vpp \
- ${bindir}/vpp_api_test \
- ${bindir}/vpp_get_metrics \
- ${bindir}/vpp_restart \
- ${bindir}/vppctl \
- ${libdir}/libcperf.so.0.0.0 \
- ${libdir}/libcperf.so.0 \
- ${libdir}/libsvm.so.0 \
- ${libdir}/libsvm.so.0.0.0 \
- ${libdir}/libsvmdb.so.0 \
- ${libdir}/libsvmdb.so.0.0.0 \
- ${libdir}/libvapiclient.so.0 \
- ${libdir}/libvapiclient.so.0.0.0 \
- ${libdir}/libvatplugin.so.0 \
- ${libdir}/libvatplugin.so.0.0.0 \
- ${libdir}/libvcl_ldpreload.so.0 \
- ${libdir}/libvcl_ldpreload.so.0.0.0 \
- ${libdir}/libvlib.so.0 \
- ${libdir}/libvlib.so.0.0.0 \
- ${libdir}/libvlibmemory.so.0 \
- ${libdir}/libvlibmemory.so.0.0.0 \
- ${libdir}/libvlibmemoryclient.so.0 \
- ${libdir}/libvlibmemoryclient.so.0.0.0 \
- ${libdir}/libvnet.so.0 \
- ${libdir}/libvnet.so.0.0.0 \
- ${libdir}/libvppapiclient.so.0 \
- ${libdir}/libvppapiclient.so.0.0.0 \
- ${libdir}/libvppcom.so.0 \
- ${libdir}/libvppcom.so.0.0.0 \
- ${libdir}/libvppinfra.so.0 \
- ${libdir}/libvppinfra.so.0.0.0 \
- "
-
-FILES_${PN}-plugin-data = " \
- ${datadir}/vpp/api/plugins/pot.api.json \
- ${datadir}/vpp/api/plugins/pppoe.api.json \
- ${datadir}/vpp/api/plugins/igmp.api.json \
- ${datadir}/vpp/api/plugins/avf.api.json \
- ${datadir}/vpp/api/plugins/mactime.api.json \
- ${datadir}/vpp/api/plugins/gbp.api.json \
- ${datadir}/vpp/api/plugins/map.api.json \
- ${datadir}/vpp/api/plugins/udp_ping.api.json \
- ${datadir}/vpp/api/plugins/l2e.api.json \
- ${datadir}/vpp/api/plugins/ioam_export.api.json \
- ${datadir}/vpp/api/plugins/lb.api.json \
- ${datadir}/vpp/api/plugins/vxlan_gpe_ioam_export.api.json \
- ${datadir}/vpp/api/plugins/ioam_vxlan_gpe.api.json \
- ${datadir}/vpp/api/plugins/acl.api.json \
- ${datadir}/vpp/api/plugins/ioam_cache.api.json \
- ${datadir}/vpp/api/plugins/stn.api.json \
- ${datadir}/vpp/api/plugins/abf.api.json \
- ${datadir}/vpp/api/plugins/nat.api.json \
- ${datadir}/vpp/api/plugins/flowprobe.api.json \
- ${datadir}/vpp/api/plugins/memif.api.json \
- ${datadir}/vpp/api/plugins/lacp.api.json \
- ${datadir}/vpp/api/plugins/gtpu.api.json \
- ${datadir}/vpp/api/plugins/trace.api.json \
- ${datadir}/vpp/api/plugins/dpdk.api.json \
- ${datadir}/vpp/api/plugins/cdp.api.json "
-
-FILES_${PN}-dev = " \
- ${includedir}/* \
- ${libdir}/libvcl_ldpreload.so \
- ${libdir}/libvppapiclient.so \
- ${libdir}/libvppcom.so \
- ${libdir}/libvlib.so \
- ${libdir}/libsvm.so \
- ${libdir}/libsvmdb.so \
- ${libdir}/libvatplugin.so \
- ${libdir}/libvlibmemory.so \
- ${libdir}/libvapiclient.so \
- ${libdir}/libvnet.so \
- ${libdir}/libvppinfra.so \
- ${libdir}/libcperf.so \
- ${libdir}/libvlibmemoryclient.so "
-
diff --git a/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-mfgtool.bb b/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-mfgtool.bb
index ab378cf5..968642bf 100644
--- a/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-mfgtool.bb
+++ b/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-mfgtool.bb
@@ -46,4 +46,4 @@ RDEPENDS_${PN}-extfs = " \
e2fsprogs-mke2fs \
e2fsprogs-e2fsck \
"
-COMPATIBLE_MACHINE = "(imx)"
+COMPATIBLE_MACHINE = "(imx|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca6174.bb b/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca6174.bb
new file mode 100644
index 00000000..aeba7623
--- /dev/null
+++ b/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca6174.bb
@@ -0,0 +1,13 @@
+# Copyright 2019 NXP
+
+SUMMARY = "Qualcomm Wi-Fi support"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = " \
+ kernel-module-qca6174 \
+ firmware-qca6174 \
+"
+
+COMPATIBLE_HOST = '(aarch64|arm).*-linux'
+COMPATIBLE_HOST_libc-musl = 'null'
diff --git a/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca9377.bb b/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca9377.bb
new file mode 100644
index 00000000..43df5a70
--- /dev/null
+++ b/bsp/meta-freescale/recipes-fsl/packagegroups/packagegroup-fsl-qca9377.bb
@@ -0,0 +1,12 @@
+# Copyright 2019 NXP
+
+SUMMARY = "Qualcomm Wi-Fi support"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = " \
+ kernel-module-qca9377 \
+ firmware-qca9377 \
+"
+COMPATIBLE_HOST = '(aarch64|arm).*-linux'
+COMPATIBLE_HOST_libc-musl = 'null'
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm-armada_git.bb b/bsp/meta-freescale/recipes-graphics/drm/libdrm-armada_git.bb
index 0a14e371..a47987a5 100644
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm-armada_git.bb
+++ b/bsp/meta-freescale/recipes-graphics/drm/libdrm-armada_git.bb
@@ -14,4 +14,4 @@ inherit autotools pkgconfig
S = "${WORKDIR}/git"
-COMPATIBLE_MACHINE ?= "(imx)"
+COMPATIBLE_MACHINE ?= "(imx|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch b/bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch
deleted file mode 100644
index fa7b218e..00000000
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 9be904a70e6b7e6b3cc4e1b270bca02d14a4179b Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Mon, 5 Sep 2016 14:41:37 +0300
-Subject: [PATCH] configure.ac: Allow explicit enabling of cunit tests
-
-Add --with-cunit to make it easier to do reproducible builds. Default
-is still to probe cunit and build opportunistically.
-
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Upstream-Status: Submitted [mailing list]
-
----
- configure.ac | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 1341f51..bef46e0 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -168,6 +168,12 @@ AC_ARG_ENABLE(install-test-programs,
- [Install test programs (default: no)]),
- [INSTALL_TESTS=$enableval], [INSTALL_TESTS=no])
-
-+AC_ARG_WITH([cunit],
-+ [AS_HELP_STRING([--with-cunit],
-+ [Build tests that use cunit (default: auto)])],
-+ [],
-+ [with_cunit=auto])
-+
- dnl ===========================================================================
- dnl check compiler flags
- AC_DEFUN([LIBDRM_CC_TRY_FLAG], [
-@@ -416,7 +422,7 @@ else
- AC_DEFINE(HAVE_RADEON, 0)
- fi
-
--if test "x$AMDGPU" != xno; then
-+if test "x$with_cunit" != xno -a "x$AMDGPU" != xno; then
- # Detect cunit library
- PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
- # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
-@@ -441,7 +447,11 @@ if test "x$AMDGPU" = xyes; then
- AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support])
-
- if test "x$have_cunit" = "xno"; then
-- AC_MSG_WARN([Could not find cunit library. Disabling amdgpu tests])
-+ if test "x$with_cunit" = "xyes"; then
-+ AC_MSG_ERROR([Could not find cunit library but --with-cunit was given])
-+ elif test "x$with_cunit" = "xauto"; then
-+ AC_MSG_WARN([Could not find cunit library. Disabling amdgpu tests])
-+ fi
- fi
- else
- AC_DEFINE(HAVE_AMDGPU, 0)
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch b/bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch
new file mode 100644
index 00000000..ae6b0ab7
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/drm/libdrm/0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch
@@ -0,0 +1,140 @@
+From 45f48f8a5de59c04b0510c23853772bc970f411e Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Thu, 9 Jan 2020 01:01:35 +0000
+Subject: [PATCH] meson: add libdrm-vivante to the meson meta data
+
+Upstream libdrm added the option to use meason as the buildsystem.
+Integrate Vivante into the relevant meson build information.
+
+Upstream-Status: Pending
+
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ meson.build | 14 +++++++++++++
+ meson_options.txt | 7 +++++++
+ vivante/meson.build | 50 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 71 insertions(+)
+ create mode 100644 vivante/meson.build
+
+diff --git a/meson.build b/meson.build
+index e292554a..f4740634 100644
+--- a/meson.build
++++ b/meson.build
+@@ -157,6 +157,15 @@ if _vc4 != 'false'
+ with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
+ endif
+
++with_vivante = false
++_vivante = get_option('vivante')
++if _vivante == 'true'
++ if not with_atomics
++ error('libdrm_vivante requires atomics.')
++ endif
++ with_vivante = true
++endif
++
+ # XXX: Apparently only freebsd and dragonfly bsd actually need this (and
+ # gnu/kfreebsd), not openbsd and netbsd
+ with_libkms = false
+@@ -312,6 +321,7 @@ install_headers(
+ 'include/drm/savage_drm.h', 'include/drm/sis_drm.h',
+ 'include/drm/tegra_drm.h', 'include/drm/vc4_drm.h',
+ 'include/drm/via_drm.h', 'include/drm/virtgpu_drm.h',
++ 'include/drm/vivante_drm.h',
+ subdir : 'libdrm',
+ )
+ if with_vmwgfx
+@@ -362,6 +372,9 @@ endif
+ if with_etnaviv
+ subdir('etnaviv')
+ endif
++if with_vivante
++ subdir('vivante')
++endif
+ if with_man_pages
+ subdir('man')
+ endif
+@@ -382,5 +395,6 @@ message(' EXYNOS API @0@'.format(with_exynos))
+ message(' Freedreno API @0@ (kgsl: @1@)'.format(with_freedreno, with_freedreno_kgsl))
+ message(' Tegra API @0@'.format(with_tegra))
+ message(' VC4 API @0@'.format(with_vc4))
++message(' Vivante API @0@'.format(with_etnaviv))
+ message(' Etnaviv API @0@'.format(with_etnaviv))
+ message('')
+diff --git a/meson_options.txt b/meson_options.txt
+index 8af33f1c..dc69563d 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -95,6 +95,13 @@ option(
+ choices : ['true', 'false', 'auto'],
+ description : '''Enable support for vc4's KMS API.''',
+ )
++option(
++ 'vivante',
++ type : 'combo',
++ value : 'false',
++ choices : ['true', 'false', 'auto'],
++ description : '''Enable support for vivante's propriatary experimental KMS API.''',
++)
+ option(
+ 'etnaviv',
+ type : 'combo',
+diff --git a/vivante/meson.build b/vivante/meson.build
+new file mode 100644
+index 00000000..f6adb598
+--- /dev/null
++++ b/vivante/meson.build
+@@ -0,0 +1,50 @@
++# Copyright © 2017-2018 Intel Corporation
++
++# Permission is hereby granted, free of charge, to any person obtaining a copy
++# of this software and associated documentation files (the "Software"), to deal
++# in the Software without restriction, including without limitation the rights
++# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++# copies of the Software, and to permit persons to whom the Software is
++# furnished to do so, subject to the following conditions:
++
++# The above copyright notice and this permission notice shall be included in
++# all copies or substantial portions of the Software.
++
++# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++# SOFTWARE.
++
++
++libdrm_vivante = shared_library(
++ 'drm_vivante',
++ [
++ files(
++ 'vivante_bo.c',
++ ),
++ config_file
++ ],
++ include_directories : [inc_root, inc_drm],
++ link_with : libdrm,
++ c_args : libdrm_c_args,
++ dependencies : [dep_pthread_stubs, dep_rt, dep_atomic_ops],
++ version : '1.0.0',
++ install : true,
++)
++
++pkg.generate(
++ name : 'libdrm_vivante',
++ libraries : libdrm_vivante,
++ subdirs : ['.', 'libdrm'],
++ version : meson.project_version(),
++ requires_private : 'libdrm',
++ description : 'Userspace interface to Vivante kernel DRM services',
++)
++
++ext_libdrm_vivante = declare_dependency(
++ link_with : [libdrm, libdrm_vivante],
++ include_directories : [inc_drm, include_directories('.')],
++)
+--
+2.20.1
+
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch b/bsp/meta-freescale/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
deleted file mode 100644
index 4708bf1e..00000000
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-drmdevice.c: define _GNU_SOURCE
-
-Include config.h to fix this build error with uclibc:
-
-libdrm-2.4.66/tests/drmdevice.c: In function 'main':
-libdrm-2.4.66/tests/drmdevice.c:96:60: error:
-'O_CLOEXEC' undeclared (first use in this function)
-fd = open(devices[i]->nodes[j],O_RDONLY | O_CLOEXEC, 0);
-
-Upstream-Status: Pending
-
-Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
-diff -Naur libdrm-2.4.66-orig/tests/drmdevice.c libdrm-2.4.66/tests/drmdevice.c
---- libdrm-2.4.66-orig/tests/drmdevice.c 2016-02-23 11:34:02.054904502 +0200
-+++ libdrm-2.4.66/tests/drmdevice.c 2016-02-23 11:35:34.371750383 +0200
-@@ -21,6 +21,7 @@
- *
- */
-
-+#include <config.h>
- #include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm/installtests.patch b/bsp/meta-freescale/recipes-graphics/drm/libdrm/installtests.patch
deleted file mode 100644
index ec1fb023..00000000
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm/installtests.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 5c6eb43c2f6e7f2ee7c25c92e42f4e4403fa0527 Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Tue, 21 Feb 2017 14:37:52 +0200
-Subject: [PATCH] tests: also install test apps
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Yu Ke <ke.yu@intel.com>
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- tests/Makefile.am | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 0355a92..b4882cd 100644
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -45,3 +45,4 @@ TESTS = \
- check_PROGRAMS = \
- $(TESTS) \
- drmdevice
-+bin_PROGRAMS = $(check_PROGRAMS)
---
-2.1.4
-
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm/musl-ioctl.patch b/bsp/meta-freescale/recipes-graphics/drm/libdrm/musl-ioctl.patch
new file mode 100644
index 00000000..e3d6c5b8
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/drm/libdrm/musl-ioctl.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 46c0fd6c827a8cb4d04e067bf04fab579ac4712e Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 18 Jun 2018 15:07:03 +0100
+Subject: [PATCH] tests/nouveau/threaded: adapt ioctl signature
+
+POSIX says ioctl() has the signature (int, int, ...) but glibc has decided to
+use (int, unsigned long int, ...) instead.
+
+Use a #ifdef to adapt the replacement function as appropriate.
+---
+ tests/nouveau/threaded.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/nouveau/threaded.c b/tests/nouveau/threaded.c
+index 3669bcd3..e1c27c01 100644
+--- a/tests/nouveau/threaded.c
++++ b/tests/nouveau/threaded.c
+@@ -36,7 +36,11 @@ static int failed;
+
+ static int import_fd;
+
++#ifdef __GLIBC__
+ int ioctl(int fd, unsigned long request, ...)
++#else
++int ioctl(int fd, int request, ...)
++#endif
+ {
+ va_list va;
+ int ret;
+--
+2.11.0
+
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch b/bsp/meta-freescale/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch
deleted file mode 100644
index 1160cd10..00000000
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Add ARM support into xf86arm.h. This provides support for Xorg interface.
-Without this the vivante samples will hang during close requiring a reboot
-
-Upstream-Status: Pending
-
-Signed-off-by: Lauren Post <lauren.post@freescale.com>
-Signed-off-by: Evan Kotara <evan.kotara@freescale.com>
-
-diff --git a/xf86drm.h b/xf86drm.h
---- a/xf86drm.h
-+++ b/xf86drm.h
-@@ -461,6 +461,23 @@ do { register unsigned int __old __asm("
- : "cr0", "memory"); \
- } while (0)
-
-+#elif defined(__arm__)
-+ #undef DRM_DEV_MODE
-+ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
-+
-+ #define DRM_CAS(lock,old,new,__ret) \
-+ do { \
-+ __asm__ __volatile__ ( \
-+ "1: ldrex %0, [%1]\n" \
-+ " teq %0, %2\n" \
-+ " ite eq\n" \
-+ " strexeq %0, %3, [%1]\n" \
-+ " movne %0, #1\n" \
-+ : "=&r" (__ret) \
-+ : "r" (lock), "r" (old), "r" (new) \
-+ : "cc","memory"); \
-+ } while (0)
-+
- #endif /* architecture */
- #endif /* __GNUC__ >= 2 */
-
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm/mx7/drm-update-arm.patch b/bsp/meta-freescale/recipes-graphics/drm/libdrm/mx7/drm-update-arm.patch
deleted file mode 100644
index 1160cd10..00000000
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm/mx7/drm-update-arm.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Add ARM support into xf86arm.h. This provides support for Xorg interface.
-Without this the vivante samples will hang during close requiring a reboot
-
-Upstream-Status: Pending
-
-Signed-off-by: Lauren Post <lauren.post@freescale.com>
-Signed-off-by: Evan Kotara <evan.kotara@freescale.com>
-
-diff --git a/xf86drm.h b/xf86drm.h
---- a/xf86drm.h
-+++ b/xf86drm.h
-@@ -461,6 +461,23 @@ do { register unsigned int __old __asm("
- : "cr0", "memory"); \
- } while (0)
-
-+#elif defined(__arm__)
-+ #undef DRM_DEV_MODE
-+ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
-+
-+ #define DRM_CAS(lock,old,new,__ret) \
-+ do { \
-+ __asm__ __volatile__ ( \
-+ "1: ldrex %0, [%1]\n" \
-+ " teq %0, %2\n" \
-+ " ite eq\n" \
-+ " strexeq %0, %3, [%1]\n" \
-+ " movne %0, #1\n" \
-+ : "=&r" (__ret) \
-+ : "r" (lock), "r" (old), "r" (new) \
-+ : "cc","memory"); \
-+ } while (0)
-+
- #endif /* architecture */
- #endif /* __GNUC__ >= 2 */
-
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm_%.bbappend b/bsp/meta-freescale/recipes-graphics/drm/libdrm_%.bbappend
deleted file mode 100644
index 97b6df92..00000000
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI_append_imxgpu2d = " file://drm-update-arm.patch"
-
-PACKAGE_ARCH_imxgpu2d = "${MACHINE_SOCARCH}"
diff --git a/bsp/meta-freescale/recipes-graphics/drm/libdrm_2.4.91.imx.bb b/bsp/meta-freescale/recipes-graphics/drm/libdrm_2.4.99.imx.bb
index 31f24d32..dc2aa8a9 100644
--- a/bsp/meta-freescale/recipes-graphics/drm/libdrm_2.4.91.imx.bb
+++ b/bsp/meta-freescale/recipes-graphics/drm/libdrm_2.4.99.imx.bb
@@ -8,31 +8,39 @@ SECTION = "x11/base"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
PROVIDES = "drm"
-DEPENDS = "libpthread-stubs libpciaccess"
+DEPENDS = "libpthread-stubs"
IMX_LIBDRM_SRC ?= "git://source.codeaurora.org/external/imx/libdrm-imx.git;protocol=https;nobranch=1"
-IMX_LIBDRM_BRANCH = "libdrm-imx-2.4.91"
+IMX_LIBDRM_BRANCH ?= "libdrm-imx-2.4.99"
SRC_URI = "${IMX_LIBDRM_SRC};branch=${IMX_LIBDRM_BRANCH} \
- file://installtests.patch \
- file://fix_O_CLOEXEC_undeclared.patch \
- file://0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch \
- "
-SRC_URI_remove = "file://drm-update-arm.patch"
-SRCREV = "e8e9cf8a66be11508c39f1cc31b8a5e7eb758875"
+ file://musl-ioctl.patch \
+ file://0001-meson-add-libdrm-vivante-to-the-meson-meta-data.patch "
+SRCREV = "f421c9c8c4b8fe48d9e6ef43910e98569c94a4b2"
S = "${WORKDIR}/git"
DEFAULT_PREFERENCE = "-1"
-inherit autotools pkgconfig manpages
+inherit meson pkgconfig manpages
-EXTRA_OECONF += "--disable-cairo-tests \
- --without-cunit \
- --enable-omap-experimental-api \
- --enable-etnaviv-experimental-api \
- --enable-install-test-programs \
- --disable-valgrind \
- "
-PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
+PACKAGECONFIG ??= "libkms intel radeon amdgpu nouveau vmwgfx omap freedreno vc4 etnaviv install-test-programs"
+PACKAGECONFIG[libkms] = "-Dlibkms=true,-Dlibkms=false"
+PACKAGECONFIG[intel] = "-Dintel=true,-Dintel=false,libpciaccess"
+PACKAGECONFIG[radeon] = "-Dradeon=true,-Dradeon=false"
+PACKAGECONFIG[amdgpu] = "-Damdgpu=true,-Damdgpu=false"
+PACKAGECONFIG[nouveau] = "-Dnouveau=true,-Dnouveau=false"
+PACKAGECONFIG[vmwgfx] = "-Dvmwgfx=true,-Dvmwgfx=false"
+PACKAGECONFIG[omap] = "-Domap=true,-Domap=false"
+PACKAGECONFIG[exynos] = "-Dexynos=true,-Dexynos=false"
+PACKAGECONFIG[freedreno] = "-Dfreedreno=true,-Dfreedreno=false"
+PACKAGECONFIG[tegra] = "-Dtegra=true,-Dtegra=false"
+PACKAGECONFIG[vc4] = "-Dvc4=true,-Dvc4=false"
+PACKAGECONFIG[etnaviv] = "-Detnaviv=true,-Detnaviv=false"
+PACKAGECONFIG[freedreno-kgsl] = "-Dfreedreno-kgsl=true,-Dfreedreno-kgsl=false"
+PACKAGECONFIG[valgrind] = "-Dvalgrind=true,-Dvalgrind=false,valgrind"
+PACKAGECONFIG[install-test-programs] = "-Dinstall-test-programs=true,-Dinstall-test-programs=false"
+PACKAGECONFIG[cairo-tests] = "-Dcairo-tests=true,-Dcairo-tests=false"
+PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev"
+PACKAGECONFIG[manpages] = "-Dman-pages=true,-Dman-pages=false,libxslt-native xmlto-native"
ALLOW_EMPTY_${PN}-drivers = "1"
PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \
@@ -51,15 +59,15 @@ FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
FILES_${PN}-exynos = "${libdir}/libdrm_exynos.so.*"
FILES_${PN}-kms = "${libdir}/libkms*.so.*"
FILES_${PN}-freedreno = "${libdir}/libdrm_freedreno.so.*"
-FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.*"
+FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.* ${datadir}/${PN}/amdgpu.ids"
FILES_${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*"
-EXTRA_OECONF_append_imxgpu = " --enable-vivante-experimental-api"
+BBCLASSEXTEND = "native nativesdk"
PACKAGES_prepend_imxgpu = "${PN}-vivante "
-
RRECOMMENDS_${PN}-drivers_append_imxgpu = " ${PN}-vivante"
-
FILES_${PN}-vivante = "${libdir}/libdrm_vivante.so.*"
+PACKAGECONFIG_append_imxgpu = " vivante"
+PACKAGECONFIG[vivante] = "-Dvivante=true,-Dvivante=false"
PACKAGE_ARCH = "${MACHINE_SOCARCH}"
diff --git a/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb/0001-Replace-vendor-specific-header-with-generic.patch b/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb/0001-Replace-vendor-specific-header-with-generic.patch
deleted file mode 100644
index 7c315c83..00000000
--- a/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb/0001-Replace-vendor-specific-header-with-generic.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From fdb3add3dfd53c539c3c79e4fbf9eedb1dc1e440 Mon Sep 17 00:00:00 2001
-From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
-Date: Fri, 26 Feb 2016 11:29:54 -0600
-Subject: [PATCH] Use generic eglplatform.h rather than vendor specifc
- (eglvivante.h) EGL headers.
-
-Upstream-Status: Pending
-
----
- wscript | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/wscript b/wscript
-index 195e247..d08bc29 100644
---- a/wscript
-+++ b/wscript
-@@ -219,7 +219,7 @@ def check_vivante_egl(conf, egl_extra_defines):
- extra_defines += egl_extra_defines
- extra_cxxflags = map(lambda x: conf.env['DEFINES_ST'] % x, extra_defines)
- conf.env['CXXFLAGS'] += extra_cxxflags
-- conf.check_cxx(mandatory = 1, header_name = 'EGL/eglvivante.h', uselib_store = 'EGL')
-+ conf.check_cxx(mandatory = 1, header_name = 'EGL/eglplatform.h', uselib_store = 'EGL')
- conf.check_cxx(mandatory = 1, header_name = 'EGL/egl.h', uselib_store = 'EGL')
- conf.env['CXXFLAGS_EGL'] += extra_cxxflags
- conf.env['CXXFLAGS'] = old_cxxflags
---
-2.7.0
-
diff --git a/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend b/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
deleted file mode 100644
index f130d23c..00000000
--- a/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI_append_imxgpu3d = " \
- file://0001-Replace-vendor-specific-header-with-generic.patch \
-"
-
-# Set i.MX specific dependencies and device type
-EGLINFO_DEVICE_imxgpu3d = "imx6"
diff --git a/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend b/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
deleted file mode 100644
index 7aa0e50f..00000000
--- a/bsp/meta-freescale/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-# Set i.MX specific dependencies and device type
-EGLINFO_DEVICE_imxgpu3d = "imx6"
diff --git a/bsp/meta-freescale/recipes-graphics/imx-dpu-g2d/imx-dpu-g2d_1.4.8.bb b/bsp/meta-freescale/recipes-graphics/imx-dpu-g2d/imx-dpu-g2d_1.8.3.bb
index 1e204b00..4465ee7e 100644
--- a/bsp/meta-freescale/recipes-graphics/imx-dpu-g2d/imx-dpu-g2d_1.4.8.bb
+++ b/bsp/meta-freescale/recipes-graphics/imx-dpu-g2d/imx-dpu-g2d_1.8.3.bb
@@ -1,37 +1,30 @@
# Copyright (C) 2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
+# Copyright 2017-2019 NXP
# Released under the MIT license (see COPYING.MIT for the terms)
DESCRIPTION = "GPU G2D library and apps for i.MX with 2D GPU and DPU"
LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
-
-RDEPENDS_${PN} = "libgal-imx libdrm"
-
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd4b227530cd88a82af6a5982cfb724d"
PROVIDES += "virtual/libg2d"
-SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
-
-S="${WORKDIR}/${PN}-${PV}"
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
+SRC_URI[md5sum] = "57a0a0a7d20e4ea1a0d2dcd162abfa79"
+SRC_URI[sha256sum] = "f8bc83e23263e179bd66492dafaeb104a3967337d76325d0ec97993ae846fb13"
inherit fsl-eula-unpack
-SRC_URI[md5sum] = "5a14e335d329dbc33edb89f675821d5a"
-SRC_URI[sha256sum] = "e8f27247b068f4f31e235e98f0eacf11eb0bb25cc6b710e5ca7f8f96d323004f"
-
do_install () {
-
install -d ${D}${libdir}
install -d ${D}${includedir}
-
cp -r ${S}/g2d/usr/lib/*.so* ${D}${libdir}
cp -Pr ${S}/g2d/usr/include/* ${D}${includedir}
cp -r ${S}/gpu-demos/opt ${D}
}
-INSANE_SKIP_${PN} += "ldflags"
-
FILES_${PN} = "${libdir}/libg2d* /opt"
FILES_${PN}-dev = "${libdir}/libg2d${SOLIBSDEV} ${includedir}"
+INSANE_SKIP_${PN} += "ldflags"
+
+RDEPENDS_${PN} = "libgal-imx libdrm"
COMPATIBLE_MACHINE = "(imxdpu)"
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0001-switch-from-python2-to-python3.patch b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0001-switch-from-python2-to-python3.patch
new file mode 100644
index 00000000..27382c34
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0001-switch-from-python2-to-python3.patch
@@ -0,0 +1,10004 @@
+From bfa1b7c7e675f198f4573325f1252e91f80f0b4d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Piotr=20Podsiad=C5=82y?= <ppodsiadly@mykolab.com>
+Date: Thu, 3 Jan 2019 20:39:55 +0100
+Subject: [PATCH 1/4] switch from python2 to python3
+
+Upstream-Status: Backport [https://github.com/apitrace/apitrace/commit/0b8b019952f2668a5e8786cc2d331062b958f02e]
+
+(cherry picked from commit 0b8b019952f2668a5e8786cc2d331062b958f02e)
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ CMakeLists.txt | 7 +-
+ cli/CMakeLists.txt | 2 +-
+ dispatch/CMakeLists.txt | 2 +-
+ dispatch/__init__.py | 2 +-
+ dispatch/dispatch.py | 56 +-
+ dispatch/glproc.py | 204 +++----
+ retrace/CMakeLists.txt | 14 +-
+ retrace/d3d9retrace.py | 248 ++++----
+ retrace/ddrawretrace.py | 102 ++--
+ retrace/dllretrace.py | 46 +-
+ retrace/dxgiretrace.py | 370 +++++------
+ retrace/dxgistate_so.py | 98 +--
+ retrace/glretrace.py | 660 ++++++++++----------
+ retrace/glstate_params.py | 556 ++++++++---------
+ retrace/retrace.py | 300 ++++-----
+ scripts/convert.py | 4 +-
+ scripts/jsondiff.py | 16 +-
+ scripts/jsonextractimages.py | 2 +-
+ scripts/leaks.py | 163 +++++
+ scripts/profileshader.py | 18 +-
+ scripts/retracediff.py | 6 +-
+ scripts/snapdiff.py | 7 +-
+ scripts/tracediff.py | 16 +-
+ scripts/unpickle.py | 16 +-
+ specs/cglapi.py | 6 +-
+ specs/d2d1.py | 6 +-
+ specs/d3d.py | 8 +-
+ specs/d3d10.py | 4 +-
+ specs/d3d10sdklayers.py | 2 +-
+ specs/d3d11.py | 4 +-
+ specs/d3d11sdklayers.py | 2 +-
+ specs/d3d8.py | 6 +-
+ specs/d3d8caps.py | 4 +-
+ specs/d3d8types.py | 2 +-
+ specs/d3d9.py | 6 +-
+ specs/d3d9caps.py | 4 +-
+ specs/d3d9types.py | 2 +-
+ specs/d3dcaps.py | 4 +-
+ specs/d3dtypes.py | 2 +-
+ specs/dcommon.py | 2 +-
+ specs/dcomp.py | 303 +++++++++
+ specs/ddraw.py | 2 +-
+ specs/debug.py | 2 +-
+ specs/dwrite.py | 4 +-
+ specs/dxgi.py | 2 +-
+ specs/dxva2.py | 2 +-
+ specs/eglapi.py | 6 +-
+ specs/eglenum.py | 2 +-
+ specs/glapi.py | 6 +-
+ specs/glparams.py | 4 +-
+ specs/gltypes.py | 2 +-
+ specs/glxapi.py | 4 +-
+ specs/scripts/c2api.py | 40 +-
+ specs/scripts/cxx2api.py | 488 +++++++++++++++
+ specs/scripts/spec2api.py | 6 +-
+ specs/scripts/txt2api.py | 8 +-
+ specs/scripts/xml2api.py | 6 +-
+ specs/scripts/xml2enum.py | 4 +-
+ specs/scripts/xml2glparams.py | 4 +-
+ specs/stdapi.py | 43 +-
+ specs/wglapi.py | 6 +-
+ specs/wglenum.py | 2 +-
+ specs/winapi.py | 2 +-
+ wrappers/CMakeLists.txt | 18 +-
+ wrappers/cgltrace.py | 74 +--
+ wrappers/d2d1trace.py | 18 +-
+ wrappers/d3d8trace.py | 36 +-
+ wrappers/d3d9trace.py | 62 +-
+ wrappers/ddrawtrace.py | 12 +-
+ wrappers/dlltrace.py | 36 +-
+ wrappers/dxgitrace.py | 98 +--
+ wrappers/egltrace.py | 420 ++++++-------
+ wrappers/gltrace.py | 1080 ++++++++++++++++-----------------
+ wrappers/glxtrace.py | 54 +-
+ wrappers/trace.py | 707 ++++++++++-----------
+ wrappers/wgltrace.py | 86 +--
+ 76 files changed, 3803 insertions(+), 2825 deletions(-)
+ create mode 100755 scripts/leaks.py
+ create mode 100644 specs/dcomp.py
+ create mode 100755 specs/scripts/cxx2api.py
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 900028c6..03ffd07c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -104,10 +104,7 @@ else ()
+ endmacro()
+ endif ()
+
+-find_host_package (PythonInterp 2.7 REQUIRED)
+-if (NOT PYTHON_VERSION_MAJOR EQUAL 2)
+- message (FATAL_ERROR "Python 2.x required and requested, but Python ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} found.")
+-endif ()
++find_host_package(Python3 COMPONENTS Interpreter REQUIRED)
+
+ find_package (Threads)
+
+@@ -591,7 +588,7 @@ set (CPACK_PACKAGE_VERSION_MINOR "0")
+
+ # Use current date in YYYYMMDD format as patch number
+ execute_process (
+- COMMAND ${PYTHON_EXECUTABLE} -c "import time, sys; sys.stdout.write(time.strftime('%Y%m%d'))"
++ COMMAND ${Python3_EXECUTABLE} -c "import time, sys; sys.stdout.write(time.strftime('%Y%m%d'))"
+ OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
+ )
+
+diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
+index 9b621bb1..eb5d485d 100644
+--- a/cli/CMakeLists.txt
++++ b/cli/CMakeLists.txt
+@@ -13,7 +13,7 @@ add_definitions(
+ if (WIN32)
+ add_definitions (-DAPITRACE_PYTHON_EXECUTABLE="python")
+ else ()
+- add_definitions (-DAPITRACE_PYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}")
++ add_definitions (-DAPITRACE_PYTHON_EXECUTABLE="${Python3_EXECUTABLE}")
+ endif ()
+
+ add_executable (apitrace
+diff --git a/dispatch/CMakeLists.txt b/dispatch/CMakeLists.txt
+index d023e6e9..e51eec48 100644
+--- a/dispatch/CMakeLists.txt
++++ b/dispatch/CMakeLists.txt
+@@ -7,7 +7,7 @@ add_custom_command (
+ OUTPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
+ ${CMAKE_CURRENT_BINARY_DIR}/glproc.cpp
+- COMMAND ${PYTHON_EXECUTABLE}
++ COMMAND ${Python3_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py
+ ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
+ ${CMAKE_CURRENT_BINARY_DIR}/glproc.cpp
+diff --git a/dispatch/__init__.py b/dispatch/__init__.py
+index b872135e..d8e8596e 100644
+--- a/dispatch/__init__.py
++++ b/dispatch/__init__.py
+@@ -1 +1 @@
+-from dispatch import *
++from .dispatch import *
+diff --git a/dispatch/dispatch.py b/dispatch/dispatch.py
+index 9e778561..e1dd8bc9 100644
+--- a/dispatch/dispatch.py
++++ b/dispatch/dispatch.py
+@@ -58,18 +58,18 @@ class Dispatcher:
+ # define standard name aliases for convenience, but only when not
+ # tracing, as that would cause symbol clashing with the tracing
+ # functions
+- print '#ifdef RETRACE'
++ print('#ifdef RETRACE')
+ for function in module.functions:
+- print '#define %s _%s' % (function.name, function.name)
+- print '#endif /* RETRACE */'
+- print
++ print('#define %s _%s' % (function.name, function.name))
++ print('#endif /* RETRACE */')
++ print()
+
+ def dispatchFunctionDecl(self, module, function):
+ ptype = function_pointer_type(function)
+ pvalue = function_pointer_value(function)
+- print 'typedef ' + function.prototype('* %s' % ptype) + ';'
+- print 'extern %s %s;' % (ptype, pvalue)
+- print
++ print('typedef ' + function.prototype('* %s' % ptype) + ';')
++ print('extern %s %s;' % (ptype, pvalue))
++ print()
+
+ def dispatchModuleImpl(self, module):
+ for function in module.functions:
+@@ -84,19 +84,19 @@ class Dispatcher:
+ else:
+ ret = 'return '
+
+- print 'static ' + function.prototype('_fail_' + function.name) + ' {'
++ print('static ' + function.prototype('_fail_' + function.name) + ' {')
+ self.failFunction(function)
+- print '}'
+- print
++ print('}')
++ print()
+
+- print 'static ' + function.prototype('_get_' + function.name) + ' {'
++ print('static ' + function.prototype('_get_' + function.name) + ' {')
+ self.invokeGetProcAddress(module, function)
+- print ' %s%s(%s);' % (ret, pvalue, ', '.join([str(arg.name) for arg in function.args]))
+- print '}'
+- print
++ print(' %s%s(%s);' % (ret, pvalue, ', '.join([str(arg.name) for arg in function.args])))
++ print('}')
++ print()
+
+- print '%s %s = &%s;' % (ptype, pvalue, '_get_' + function.name)
+- print
++ print('%s %s = &%s;' % (ptype, pvalue, '_get_' + function.name))
++ print()
+
+ def getProcAddressName(self, module, function):
+ raise NotImplementedError
+@@ -105,25 +105,25 @@ class Dispatcher:
+ ptype = function_pointer_type(function)
+ pvalue = function_pointer_value(function)
+ getProcAddressName = self.getProcAddressName(module, function)
+- print ' %s _ptr;' % (ptype,)
+- print ' _ptr = (%s)%s("%s");' % (ptype, getProcAddressName, function.name)
+- print ' if (!_ptr) {'
+- print ' _ptr = &%s;' % ('_fail_' + function.name)
+- print ' }'
+- print ' %s = _ptr;' % (pvalue,)
++ print(' %s _ptr;' % (ptype,))
++ print(' _ptr = (%s)%s("%s");' % (ptype, getProcAddressName, function.name))
++ print(' if (!_ptr) {')
++ print(' _ptr = &%s;' % ('_fail_' + function.name))
++ print(' }')
++ print(' %s = _ptr;' % (pvalue,))
+
+ def failFunction(self, function):
+- print r' const char *_name = "%s";' % function.name
++ print(r' const char *_name = "%s";' % function.name)
+ if function.type is stdapi.Void or function.fail is not None:
+- print r' os::log("warning: ignoring call to unavailable function %s\n", _name);'
++ print(r' os::log("warning: ignoring call to unavailable function %s\n", _name);')
+ if function.type is stdapi.Void:
+ assert function.fail is None
+- print ' return;'
++ print(' return;')
+ else:
+ assert function.fail is not None
+- print ' return %s;' % function.fail
++ print(' return %s;' % function.fail)
+ else:
+- print r' os::log("error: unavailable function %s\n", _name);'
+- print r' os::abort();'
++ print(r' os::log("error: unavailable function %s\n", _name);')
++ print(r' os::abort();')
+
+
+diff --git a/dispatch/glproc.py b/dispatch/glproc.py
+index f26a4f7d..93bba232 100644
+--- a/dispatch/glproc.py
++++ b/dispatch/glproc.py
+@@ -506,15 +506,15 @@ class GlDispatcher(Dispatcher):
+ if sys.platform == 'darwin':
+ # Fallback to EXT_debug_label on MacOSX, some enums need to be translated.
+ if function.name in ('glObjectLabel', 'glObjectLabelKHR'):
+- print r' if (translateDebugLabelIdentifier(identifier)) {'
+- print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);'
+- print r' return;'
+- print r' }'
++ print(r' if (translateDebugLabelIdentifier(identifier)) {')
++ print(r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);')
++ print(r' return;')
++ print(r' }')
+ if function.name in ('glGetObjectLabel', 'glGetObjectLabelKHR'):
+- print r' if (translateDebugLabelIdentifier(identifier)) {'
+- print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);'
+- print r' return;'
+- print r' }'
++ print(r' if (translateDebugLabelIdentifier(identifier)) {')
++ print(r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);')
++ print(r' return;')
++ print(r' }')
+ if function.name in (
+ # GL_KHR_debug
+ 'glDebugMessageControl',
+@@ -549,25 +549,25 @@ class GlDispatcher(Dispatcher):
+ ):
+ return
+ if function.name.startswith('glGetObjectLabel'):
+- print r' if (length != 0) *length = 0;'
+- print r' if (label != 0 && bufSize > 0) *label = 0;'
++ print(r' if (length != 0) *length = 0;')
++ print(r' if (label != 0 && bufSize > 0) *label = 0;')
+ return
+ if function.name == 'glGetDebugMessageLogAMD':
+- print r' if (categories != 0) *categories = 0;'
+- print r' if (ids != 0) *ids = 0;'
+- print r' if (severities != 0) *severities = 0;'
+- print r' if (lengths != 0) *lengths = 0;'
+- print r' if (message != 0 && bufsize > 0) *message = 0;'
+- print r' return 0;'
++ print(r' if (categories != 0) *categories = 0;')
++ print(r' if (ids != 0) *ids = 0;')
++ print(r' if (severities != 0) *severities = 0;')
++ print(r' if (lengths != 0) *lengths = 0;')
++ print(r' if (message != 0 && bufsize > 0) *message = 0;')
++ print(r' return 0;')
+ return
+ if function.name.startswith('glGetDebugMessageLog'):
+- print r' if (sources != 0) *sources = 0;'
+- print r' if (types != 0) *types = 0;'
+- print r' if (ids != 0) *ids = 0;'
+- print r' if (severities != 0) *severities = 0;'
+- print r' if (lengths != 0) *lengths = 0;'
+- print r' if (messageLog != 0 && bufsize > 0) *messageLog = 0;'
+- print r' return 0;'
++ print(r' if (sources != 0) *sources = 0;')
++ print(r' if (types != 0) *types = 0;')
++ print(r' if (ids != 0) *ids = 0;')
++ print(r' if (severities != 0) *severities = 0;')
++ print(r' if (lengths != 0) *lengths = 0;')
++ print(r' if (messageLog != 0 && bufsize > 0) *messageLog = 0;')
++ print(r' return 0;')
+ return
+
+ Dispatcher.failFunction(self, function)
+@@ -577,96 +577,96 @@ if __name__ == '__main__':
+ decl, impl = sys.argv[1:]
+
+ sys.stdout = open(decl, 'wt')
+- print
+- print '#pragma once'
+- print
+- print '#include "glimports.hpp"'
+- print
+- print '#if defined(_WIN32)'
+- print 'extern HMODULE _libGlHandle;'
+- print '#else'
+- print 'extern void * _libGlHandle;'
+- print '#endif'
+- print
+- print 'void * _getPublicProcAddress(const char *procName);'
+- print 'void * _getPrivateProcAddress(const char *procName);'
+- print
++ print()
++ print('#pragma once')
++ print()
++ print('#include "glimports.hpp"')
++ print()
++ print('#if defined(_WIN32)')
++ print('extern HMODULE _libGlHandle;')
++ print('#else')
++ print('extern void * _libGlHandle;')
++ print('#endif')
++ print()
++ print('void * _getPublicProcAddress(const char *procName);')
++ print('void * _getPrivateProcAddress(const char *procName);')
++ print()
+ dispatcher = GlDispatcher()
+- print
++ print()
+ dispatcher.dispatchModuleDecl(eglapi)
+- print
+- print '#if defined(_WIN32)'
+- print
++ print()
++ print('#if defined(_WIN32)')
++ print()
+ dispatcher.dispatchModuleDecl(wglapi)
+- print
+- print '#elif defined(__APPLE__)'
+- print
++ print()
++ print('#elif defined(__APPLE__)')
++ print()
+ dispatcher.dispatchModuleDecl(cglapi)
+- print
+- print '#elif defined(HAVE_X11)'
+- print
++ print()
++ print('#elif defined(HAVE_X11)')
++ print()
+ dispatcher.dispatchModuleDecl(glxapi)
+- print
+- print '#endif'
+- print
++ print()
++ print('#endif')
++ print()
+ dispatcher.dispatchModuleDecl(glapi)
+- print
++ print()
+
+ sys.stdout = open(impl, 'wt')
+- print
+- print '#include "glproc.hpp"'
+- print '#include "os.hpp"'
+- print
++ print()
++ print('#include "glproc.hpp"')
++ print('#include "os.hpp"')
++ print()
+ dispatcher = GlDispatcher()
+- print
++ print()
+ dispatcher.dispatchModuleImpl(eglapi)
+- print
+- print '#if defined(_WIN32)'
+- print
++ print()
++ print('#if defined(_WIN32)')
++ print()
+ dispatcher.dispatchModuleImpl(wglapi)
+- print
+- print '#elif defined(__APPLE__)'
+- print
+- print 'static inline bool'
+- print 'translateDebugLabelIdentifier(GLenum & identifier)'
+- print '{'
+- print ' switch (identifier) {'
+- print ' case GL_TEXTURE:'
+- print ' case GL_FRAMEBUFFER:'
+- print ' case GL_RENDERBUFFER:'
+- print ' case GL_SAMPLER:'
+- print ' case GL_TRANSFORM_FEEDBACK:'
+- print ' return true;'
+- print ' case GL_BUFFER:'
+- print ' identifier = GL_BUFFER_OBJECT_EXT;'
+- print ' return true;'
+- print ' case GL_SHADER:'
+- print ' identifier = GL_SHADER_OBJECT_EXT;'
+- print ' return true;'
+- print ' case GL_PROGRAM:'
+- print ' identifier = GL_PROGRAM_OBJECT_EXT;'
+- print ' return true;'
+- print ' case GL_VERTEX_ARRAY:'
+- print ' identifier = GL_VERTEX_ARRAY_OBJECT_EXT;'
+- print ' return true;'
+- print ' case GL_QUERY:'
+- print ' identifier = GL_QUERY_OBJECT_EXT;'
+- print ' return true;'
+- print ' case GL_PROGRAM_PIPELINE:'
+- print ' identifier = GL_PROGRAM_PIPELINE_OBJECT_EXT;'
+- print ' return true;'
+- print ' default:'
+- print ' return false;'
+- print ' }'
+- print '}'
+- print
++ print()
++ print('#elif defined(__APPLE__)')
++ print()
++ print('static inline bool')
++ print('translateDebugLabelIdentifier(GLenum & identifier)')
++ print('{')
++ print(' switch (identifier) {')
++ print(' case GL_TEXTURE:')
++ print(' case GL_FRAMEBUFFER:')
++ print(' case GL_RENDERBUFFER:')
++ print(' case GL_SAMPLER:')
++ print(' case GL_TRANSFORM_FEEDBACK:')
++ print(' return true;')
++ print(' case GL_BUFFER:')
++ print(' identifier = GL_BUFFER_OBJECT_EXT;')
++ print(' return true;')
++ print(' case GL_SHADER:')
++ print(' identifier = GL_SHADER_OBJECT_EXT;')
++ print(' return true;')
++ print(' case GL_PROGRAM:')
++ print(' identifier = GL_PROGRAM_OBJECT_EXT;')
++ print(' return true;')
++ print(' case GL_VERTEX_ARRAY:')
++ print(' identifier = GL_VERTEX_ARRAY_OBJECT_EXT;')
++ print(' return true;')
++ print(' case GL_QUERY:')
++ print(' identifier = GL_QUERY_OBJECT_EXT;')
++ print(' return true;')
++ print(' case GL_PROGRAM_PIPELINE:')
++ print(' identifier = GL_PROGRAM_PIPELINE_OBJECT_EXT;')
++ print(' return true;')
++ print(' default:')
++ print(' return false;')
++ print(' }')
++ print('}')
++ print()
+ dispatcher.dispatchModuleImpl(cglapi)
+- print
+- print '#elif defined(HAVE_X11)'
+- print
++ print()
++ print('#elif defined(HAVE_X11)')
++ print()
+ dispatcher.dispatchModuleImpl(glxapi)
+- print
+- print '#endif'
+- print
++ print()
++ print('#endif')
++ print()
+ dispatcher.dispatchModuleImpl(glapi)
+- print
++ print()
+diff --git a/retrace/CMakeLists.txt b/retrace/CMakeLists.txt
+index c0c4f316..2475abb8 100644
+--- a/retrace/CMakeLists.txt
++++ b/retrace/CMakeLists.txt
+@@ -14,7 +14,7 @@ add_definitions (-DRETRACE)
+
+ add_custom_command (
+ OUTPUT glretrace_gl.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
+ DEPENDS
+ glretrace.py
+ retrace.py
+@@ -25,7 +25,7 @@ add_custom_command (
+
+ add_custom_command (
+ OUTPUT glstate_params.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate_params.py > ${CMAKE_CURRENT_BINARY_DIR}/glstate_params.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate_params.py > ${CMAKE_CURRENT_BINARY_DIR}/glstate_params.cpp
+ DEPENDS
+ glstate_params.py
+ ${CMAKE_SOURCE_DIR}/specs/glparams.py
+@@ -273,7 +273,7 @@ if (WIN32)
+ include_directories (BEFORE SYSTEM ${DirectX_D3D_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3dretrace_ddraw.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_ddraw.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_ddraw.cpp
+ DEPENDS
+ ddrawretrace.py
+ dllretrace.py
+@@ -306,7 +306,7 @@ if (WIN32)
+ endif ()
+ add_custom_command (
+ OUTPUT d3dretrace_d3d8.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9retrace.py d3d8 ${HAVE_D3D8} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d8.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9retrace.py d3d8 ${HAVE_D3D8} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d8.cpp
+ DEPENDS
+ d3d9retrace.py
+ dllretrace.py
+@@ -327,7 +327,7 @@ if (WIN32)
+ endif ()
+ add_custom_command (
+ OUTPUT d3dretrace_d3d9.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9retrace.py d3d9 ${HAVE_D3D9} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9retrace.py d3d9 ${HAVE_D3D9} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d9.cpp
+ DEPENDS
+ d3d9retrace.py
+ dllretrace.py
+@@ -359,7 +359,7 @@ if (WIN32)
+ )
+ add_custom_command (
+ OUTPUT dxgistate_so.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgistate_so.py > ${CMAKE_CURRENT_BINARY_DIR}/dxgistate_so.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgistate_so.py > ${CMAKE_CURRENT_BINARY_DIR}/dxgistate_so.cpp
+ DEPENDS
+ ${CMAKE_CURRENT_SOURCE_DIR}/dxgistate_so.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d11.py
+@@ -372,7 +372,7 @@ if (WIN32)
+ )
+ add_custom_command (
+ OUTPUT d3dretrace_dxgi.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgiretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_dxgi.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgiretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_dxgi.cpp
+ DEPENDS
+ dxgiretrace.py
+ dllretrace.py
+diff --git a/retrace/d3d9retrace.py b/retrace/d3d9retrace.py
+index 7313acc9..22364476 100644
+--- a/retrace/d3d9retrace.py
++++ b/retrace/d3d9retrace.py
+@@ -35,32 +35,32 @@ from specs.stdapi import API
+ class D3DRetracer(Retracer):
+
+ def retraceApi(self, api):
+- print '// Swizzling mapping for lock addresses'
+- print 'typedef std::pair<void *, UINT> MappingKey;'
+- print 'static std::map<MappingKey, void *> _maps;'
+- print
++ print('// Swizzling mapping for lock addresses')
++ print('typedef std::pair<void *, UINT> MappingKey;')
++ print('static std::map<MappingKey, void *> _maps;')
++ print()
+
+ Retracer.retraceApi(self, api)
+
+ def invokeFunction(self, function):
+ if function.name in ('Direct3DCreate9', 'Direct3DCreate9Ex'):
+- print 'if (retrace::debug >= 2 && !g_szD3D9DllName && LoadLibraryA("d3d9d.dll")) {'
+- print ' /*'
+- print ' * D3D9D only works for simple applications, it will often report bogus errors'
+- print ' * on complex traces, or traces which use unofficial D3D9 features.'
+- print ' */'
+- print ' g_szD3D9DllName = "d3d9d.dll";'
+- print ' SDKVersion |= 0x80000000;'
+- print '} else {'
+- print ' SDKVersion &= ~0x80000000;'
+- print '}'
++ print('if (retrace::debug >= 2 && !g_szD3D9DllName && LoadLibraryA("d3d9d.dll")) {')
++ print(' /*')
++ print(' * D3D9D only works for simple applications, it will often report bogus errors')
++ print(' * on complex traces, or traces which use unofficial D3D9 features.')
++ print(' */')
++ print(' g_szD3D9DllName = "d3d9d.dll";')
++ print(' SDKVersion |= 0x80000000;')
++ print('} else {')
++ print(' SDKVersion &= ~0x80000000;')
++ print('}')
+
+ # d3d8d.dll can be found in the Aug 2007 DXSDK. It works on XP, but
+ # not on Windows 7.
+ if function.name in ('Direct3DCreate8'):
+- print 'if (retrace::debug >= 2 && !g_szD3D8DllName && LoadLibraryA("d3d8d.dll")) {'
+- print ' g_szD3D8DllName = "d3d8d.dll";'
+- print '}'
++ print('if (retrace::debug >= 2 && !g_szD3D8DllName && LoadLibraryA("d3d8d.dll")) {')
++ print(' g_szD3D8DllName = "d3d8d.dll";')
++ print('}')
+
+ Retracer.invokeFunction(self, function)
+
+@@ -73,37 +73,37 @@ class D3DRetracer(Retracer):
+ # keep track of the last used device for state dumping
+ if interface.name in ('IDirect3DDevice9', 'IDirect3DDevice9Ex'):
+ if method.name == 'Release':
+- print r' if (call.ret->toUInt() == 0) {'
+- print r' d3d9Dumper.unbindDevice(_this);'
+- print r' }'
++ print(r' if (call.ret->toUInt() == 0) {')
++ print(r' d3d9Dumper.unbindDevice(_this);')
++ print(r' }')
+ else:
+- print r' d3d9Dumper.bindDevice(_this);'
++ print(r' d3d9Dumper.bindDevice(_this);')
+ if interface.name in ('IDirect3DDevice8', 'IDirect3DDevice8Ex'):
+ if method.name == 'Release':
+- print r' if (call.ret->toUInt() == 0) {'
+- print r' d3d8Dumper.unbindDevice(_this);'
+- print r' }'
++ print(r' if (call.ret->toUInt() == 0) {')
++ print(r' d3d8Dumper.unbindDevice(_this);')
++ print(r' }')
+ else:
+- print r' d3d8Dumper.bindDevice(_this);'
++ print(r' d3d8Dumper.bindDevice(_this);')
+
+ # create windows as neccessary
+ if method.name in ('CreateDevice', 'CreateDeviceEx', 'CreateAdditionalSwapChain'):
+- print r' HWND hWnd = d3dretrace::createWindow(pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);'
+- print r' pPresentationParameters->hDeviceWindow = hWnd;'
++ print(r' HWND hWnd = d3dretrace::createWindow(pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);')
++ print(r' pPresentationParameters->hDeviceWindow = hWnd;')
+ if 'hFocusWindow' in method.argNames():
+- print r' hFocusWindow = hWnd;'
++ print(r' hFocusWindow = hWnd;')
+
+ # force windowed mode
+- print r' if (retrace::forceWindowed) {'
+- print r' pPresentationParameters->Windowed = TRUE;'
+- print r' pPresentationParameters->FullScreen_RefreshRateInHz = 0;'
++ print(r' if (retrace::forceWindowed) {')
++ print(r' pPresentationParameters->Windowed = TRUE;')
++ print(r' pPresentationParameters->FullScreen_RefreshRateInHz = 0;')
+ if interface.name.startswith('IDirect3D8'):
+- print r' pPresentationParameters->FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;'
+- print r' }'
++ print(r' pPresentationParameters->FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;')
++ print(r' }')
+ if 'BehaviorFlags' in method.argNames():
+- print r' if (retrace::dumpingState) {'
+- print r' BehaviorFlags &= ~D3DCREATE_PUREDEVICE;'
+- print r' }'
++ print(r' if (retrace::dumpingState) {')
++ print(r' BehaviorFlags &= ~D3DCREATE_PUREDEVICE;')
++ print(r' }')
+
+ # On D3D8, ensure we use BackBufferFormat compatible with the
+ # current DisplayFormat.
+@@ -113,76 +113,76 @@ class D3DRetracer(Retracer):
+ # valid values for BackBufferFormat include D3DFMT_X1R5G5B5 and
+ # D3DFMT_A1R5G5B5, but exclude D3DFMT_R5G6B5.
+ if interface.name.startswith('IDirect3D8'):
+- print r' if (pPresentationParameters->Windowed) {'
+- print r' D3DDISPLAYMODE Mode;'
+- print r' HRESULT hr;'
+- print r' hr = _this->GetAdapterDisplayMode(Adapter, &Mode);'
+- print r' assert(SUCCEEDED(hr));'
+- print r' hr = _this->CheckDeviceType(Adapter, DeviceType, Mode.Format, pPresentationParameters->BackBufferFormat, pPresentationParameters->Windowed);'
+- print r' if (hr == D3DERR_NOTAVAILABLE) {'
+- print r' retrace::warning(call) << "forcing back buffer format to match display mode format\n";'
+- print r' pPresentationParameters->BackBufferFormat = Mode.Format;'
+- print r' }'
+- print r' }'
++ print(r' if (pPresentationParameters->Windowed) {')
++ print(r' D3DDISPLAYMODE Mode;')
++ print(r' HRESULT hr;')
++ print(r' hr = _this->GetAdapterDisplayMode(Adapter, &Mode);')
++ print(r' assert(SUCCEEDED(hr));')
++ print(r' hr = _this->CheckDeviceType(Adapter, DeviceType, Mode.Format, pPresentationParameters->BackBufferFormat, pPresentationParameters->Windowed);')
++ print(r' if (hr == D3DERR_NOTAVAILABLE) {')
++ print(r' retrace::warning(call) << "forcing back buffer format to match display mode format\n";')
++ print(r' pPresentationParameters->BackBufferFormat = Mode.Format;')
++ print(r' }')
++ print(r' }')
+
+ if method.name in self.createDeviceMethodNames:
+ # override the device type
+- print r' switch (retrace::driver) {'
+- print r' case retrace::DRIVER_HARDWARE:'
+- print r' DeviceType = D3DDEVTYPE_HAL;'
+- print r' break;'
+- print r' case retrace::DRIVER_SOFTWARE:'
+- print r' case retrace::DRIVER_REFERENCE:'
+- print r' DeviceType = D3DDEVTYPE_REF;'
+- print r' break;'
+- print r' case retrace::DRIVER_NULL:'
++ print(r' switch (retrace::driver) {')
++ print(r' case retrace::DRIVER_HARDWARE:')
++ print(r' DeviceType = D3DDEVTYPE_HAL;')
++ print(r' break;')
++ print(r' case retrace::DRIVER_SOFTWARE:')
++ print(r' case retrace::DRIVER_REFERENCE:')
++ print(r' DeviceType = D3DDEVTYPE_REF;')
++ print(r' break;')
++ print(r' case retrace::DRIVER_NULL:')
+ if interface.name.startswith('IDirect3D9'):
+- print r' DeviceType = D3DDEVTYPE_NULLREF;'
++ print(r' DeviceType = D3DDEVTYPE_NULLREF;')
+ else:
+- print r' retrace::warning(call) << "null driver not supported\n";'
+- print r' break;'
+- print r' case retrace::DRIVER_MODULE:'
+- print r' retrace::warning(call) << "driver module not supported\n";'
+- print r' break;'
+- print r' default:'
+- print r' assert(0);'
+- print r' /* fall-through */'
+- print r' case retrace::DRIVER_DEFAULT:'
+- print r' break;'
+- print r' }'
++ print(r' retrace::warning(call) << "null driver not supported\n";')
++ print(r' break;')
++ print(r' case retrace::DRIVER_MODULE:')
++ print(r' retrace::warning(call) << "driver module not supported\n";')
++ print(r' break;')
++ print(r' default:')
++ print(r' assert(0);')
++ print(r' /* fall-through */')
++ print(r' case retrace::DRIVER_DEFAULT:')
++ print(r' break;')
++ print(r' }')
+
+ if method.name in ('Reset', 'ResetEx'):
+ # force windowed mode
+- print r' if (retrace::forceWindowed) {'
+- print r' pPresentationParameters->Windowed = TRUE;'
+- print r' pPresentationParameters->FullScreen_RefreshRateInHz = 0;'
+- print r' }'
++ print(r' if (retrace::forceWindowed) {')
++ print(r' pPresentationParameters->Windowed = TRUE;')
++ print(r' pPresentationParameters->FullScreen_RefreshRateInHz = 0;')
++ print(r' }')
+ # resize window
+- print r' if (pPresentationParameters->Windowed) {'
+- print r' d3dretrace::resizeWindow(pPresentationParameters->hDeviceWindow, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);'
+- print r' }'
++ print(r' if (pPresentationParameters->Windowed) {')
++ print(r' d3dretrace::resizeWindow(pPresentationParameters->hDeviceWindow, pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight);')
++ print(r' }')
+
+ # notify frame has been completed
+ if method.name in ('Present', 'PresentEx'):
+ if interface.name.startswith('IDirect3DSwapChain9'):
+- print r' d3d9scDumper.bindDevice(_this);'
+- print r' retrace::frameComplete(call);'
+- print r' hDestWindowOverride = NULL;'
++ print(r' d3d9scDumper.bindDevice(_this);')
++ print(r' retrace::frameComplete(call);')
++ print(r' hDestWindowOverride = NULL;')
+
+ # Ensure textures can be locked when dumping
+ # TODO: Pre-check with CheckDeviceFormat
+ if method.name in ('CreateTexture', 'CreateCubeTexture', 'CreateVolumeTexture'):
+- print r' if (retrace::dumpingState &&'
+- print r' Pool == D3DPOOL_DEFAULT &&'
+- print r' !(Usage & (D3DUSAGE_RENDERTARGET|D3DUSAGE_DEPTHSTENCIL))) {'
+- print r' Usage |= D3DUSAGE_DYNAMIC;'
+- print r' }'
++ print(r' if (retrace::dumpingState &&')
++ print(r' Pool == D3DPOOL_DEFAULT &&')
++ print(r' !(Usage & (D3DUSAGE_RENDERTARGET|D3DUSAGE_DEPTHSTENCIL))) {')
++ print(r' Usage |= D3DUSAGE_DYNAMIC;')
++ print(r' }')
+
+ if 'pSharedHandle' in method.argNames():
+- print r' if (pSharedHandle) {'
+- print r' retrace::warning(call) << "shared surfaces unsupported\n";'
+- print r' pSharedHandle = NULL;'
+- print r' }'
++ print(r' if (pSharedHandle) {')
++ print(r' retrace::warning(call) << "shared surfaces unsupported\n";')
++ print(r' pSharedHandle = NULL;')
++ print(r' }')
+
+ if method.name in ('Lock', 'LockRect', 'LockBox'):
+ # Reset _DONOTWAIT flags. Otherwise they may fail, and we have no
+@@ -190,7 +190,7 @@ class D3DRetracer(Retracer):
+ mapFlagsArg = method.getArgByName('Flags')
+ for flag in mapFlagsArg.type.values:
+ if flag.endswith('_DONOTWAIT'):
+- print r' Flags &= ~%s;' % flag
++ print(r' Flags &= ~%s;' % flag)
+
+ Retracer.invokeInterfaceMethod(self, interface, method)
+
+@@ -201,7 +201,7 @@ class D3DRetracer(Retracer):
+
+ # process events after presents
+ if method.name == 'Present':
+- print r' d3dretrace::processEvents();'
++ print(r' d3dretrace::processEvents();')
+
+ def mapping_subkey():
+ if 'Level' in method.argNames():
+@@ -210,35 +210,35 @@ class D3DRetracer(Retracer):
+ return ('0',)
+
+ if method.name in ('Lock', 'LockRect', 'LockBox'):
+- print ' VOID *_pbData = NULL;'
+- print ' size_t _MappedSize = 0;'
+- print ' if (!(Flags & D3DLOCK_READONLY)) {'
+- print ' _getMapInfo(_this, %s, _pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])
+- print ' }'
+- print ' if (_MappedSize) {'
+- print ' _maps[MappingKey(_this, %s)] = _pbData;' % mapping_subkey()
++ print(' VOID *_pbData = NULL;')
++ print(' size_t _MappedSize = 0;')
++ print(' if (!(Flags & D3DLOCK_READONLY)) {')
++ print(' _getMapInfo(_this, %s, _pbData, _MappedSize);' % ', '.join(method.argNames()[:-1]))
++ print(' }')
++ print(' if (_MappedSize) {')
++ print(' _maps[MappingKey(_this, %s)] = _pbData;' % mapping_subkey())
+ self.checkPitchMismatch(method)
+- print ' } else {'
+- print ' return;'
+- print ' }'
++ print(' } else {')
++ print(' return;')
++ print(' }')
+
+ if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
+- print ' VOID *_pbData = 0;'
+- print ' MappingKey _mappingKey(_this, %s);' % mapping_subkey()
+- print ' _pbData = _maps[_mappingKey];'
+- print ' if (_pbData) {'
+- print ' retrace::delRegionByPointer(_pbData);'
+- print ' _maps[_mappingKey] = 0;'
+- print ' }'
++ print(' VOID *_pbData = 0;')
++ print(' MappingKey _mappingKey(_this, %s);' % mapping_subkey())
++ print(' _pbData = _maps[_mappingKey];')
++ print(' if (_pbData) {')
++ print(' retrace::delRegionByPointer(_pbData);')
++ print(' _maps[_mappingKey] = 0;')
++ print(' }')
+
+
+ def main():
+- print r'#include <string.h>'
+- print
+- print r'#include <iostream>'
+- print
+- print r'#include "d3dretrace.hpp"'
+- print
++ print(r'#include <string.h>')
++ print()
++ print(r'#include <iostream>')
++ print()
++ print(r'#include "d3dretrace.hpp"')
++ print()
+
+ moduleName = sys.argv[1]
+ support = int(sys.argv[2])
+@@ -249,24 +249,24 @@ def main():
+ if moduleName == 'd3d9':
+ from specs.d3d9 import d3d9, d3dperf
+ from specs.dxva2 import dxva2
+- print r'#include "d3d9imports.hpp"'
+- print r'#include "d3d9size.hpp"'
+- print r'#include "dxva2imports.hpp"'
++ print(r'#include "d3d9imports.hpp"')
++ print(r'#include "d3d9size.hpp"')
++ print(r'#include "dxva2imports.hpp"')
+ d3d9.mergeModule(d3dperf)
+ api.addModule(d3d9)
+ api.addModule(dxva2)
+- print
+- print '''static d3dretrace::D3DDumper<IDirect3DDevice9> d3d9Dumper;'''
+- print '''static d3dretrace::D3DDumper<IDirect3DSwapChain9> d3d9scDumper;'''
+- print
++ print()
++ print('''static d3dretrace::D3DDumper<IDirect3DDevice9> d3d9Dumper;''')
++ print('''static d3dretrace::D3DDumper<IDirect3DSwapChain9> d3d9scDumper;''')
++ print()
+ elif moduleName == 'd3d8':
+ from specs.d3d8 import d3d8
+- print r'#include "d3d8imports.hpp"'
+- print r'#include "d3d8size.hpp"'
++ print(r'#include "d3d8imports.hpp"')
++ print(r'#include "d3d8size.hpp"')
+ api.addModule(d3d8)
+- print
+- print '''static d3dretrace::D3DDumper<IDirect3DDevice8> d3d8Dumper;'''
+- print
++ print()
++ print('''static d3dretrace::D3DDumper<IDirect3DDevice8> d3d8Dumper;''')
++ print()
+ else:
+ assert False
+
+diff --git a/retrace/ddrawretrace.py b/retrace/ddrawretrace.py
+index 4f2ff944..863283fd 100644
+--- a/retrace/ddrawretrace.py
++++ b/retrace/ddrawretrace.py
+@@ -37,12 +37,12 @@ from specs.ddraw import DDCREATE_LPGUID
+ class D3DRetracer(Retracer):
+
+ def retraceApi(self, api):
+- print '// Swizzling mapping for lock addresses'
+- print 'static std::map<void *, void *> _maps;'
+- print
++ print('// Swizzling mapping for lock addresses')
++ print('static std::map<void *, void *> _maps;')
++ print()
+ # TODO: Keep a table of windows
+- print 'static HWND g_hWnd;'
+- print
++ print('static HWND g_hWnd;')
++ print()
+
+ Retracer.retraceApi(self, api)
+
+@@ -50,20 +50,20 @@ class D3DRetracer(Retracer):
+ # keep track of the last used device for state dumping
+ if interface.name in ('IDirect3DDevice7',):
+ if method.name == 'Release':
+- print r' if (call.ret->toUInt() == 0) {'
+- print r' d3d7Dumper.unbindDevice(_this);'
+- print r' }'
++ print(r' if (call.ret->toUInt() == 0) {')
++ print(r' d3d7Dumper.unbindDevice(_this);')
++ print(r' }')
+ else:
+- print r' d3d7Dumper.bindDevice(_this);'
++ print(r' d3d7Dumper.bindDevice(_this);')
+
+ # create windows as neccessary
+ hWndArg = method.getArgByType(HWND)
+ if hWndArg is not None:
+ # FIXME: Try to guess the window size (e.g., from IDirectDrawSurface7::Blt)
+- print r' if (!g_hWnd) {'
+- print r' g_hWnd = d3dretrace::createWindow(512, 512);'
+- print r' }'
+- print r' %s = g_hWnd;' % hWndArg.name
++ print(r' if (!g_hWnd) {')
++ print(r' g_hWnd = d3dretrace::createWindow(512, 512);')
++ print(r' }')
++ print(r' %s = g_hWnd;' % hWndArg.name)
+
+
+ if method.name == 'Lock':
+@@ -71,74 +71,74 @@ class D3DRetracer(Retracer):
+ # way to cope with it (other than retry).
+ mapFlagsArg = method.getArgByName('dwFlags')
+ if mapFlagsArg is not None:
+- print r' dwFlags &= DDLOCK_DONOTWAIT;'
+- print r' dwFlags |= DDLOCK_WAIT;'
++ print(r' dwFlags &= DDLOCK_DONOTWAIT;')
++ print(r' dwFlags |= DDLOCK_WAIT;')
+
+ Retracer.invokeInterfaceMethod(self, interface, method)
+
+ if method.name == 'CreateDevice':
+- print r' if (FAILED(_result)) {'
+- print r' exit(1);'
+- print r' }'
++ print(r' if (FAILED(_result)) {')
++ print(r' exit(1);')
++ print(r' }')
+
+ # notify frame has been completed
+ # process events after presents
+ if interface.name == 'IDirectDrawSurface7' and method.name == 'Blt':
+- print r' DDSCAPS2 ddsCaps;'
+- print r' if (SUCCEEDED(_this->GetCaps(&ddsCaps)) &&'
+- print r' (ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) {'
+- print r' retrace::frameComplete(call);'
+- print r' d3dretrace::processEvents();'
+- print r' }'
++ print(r' DDSCAPS2 ddsCaps;')
++ print(r' if (SUCCEEDED(_this->GetCaps(&ddsCaps)) &&')
++ print(r' (ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) {')
++ print(r' retrace::frameComplete(call);')
++ print(r' d3dretrace::processEvents();')
++ print(r' }')
+
+ if method.name == 'Lock':
+- print ' VOID *_pbData = NULL;'
+- print ' size_t _MappedSize = 0;'
++ print(' VOID *_pbData = NULL;')
++ print(' size_t _MappedSize = 0;')
+ # FIXME: determine the mapping size
+ #print ' _getMapInfo(_this, %s, _pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])
+- print ' if (_MappedSize) {'
+- print ' _maps[_this] = _pbData;'
++ print(' if (_MappedSize) {')
++ print(' _maps[_this] = _pbData;')
+ # TODO: check pitches match
+- print ' } else {'
+- print ' return;'
+- print ' }'
++ print(' } else {')
++ print(' return;')
++ print(' }')
+
+ if method.name == 'Unlock':
+- print ' VOID *_pbData = 0;'
+- print ' _pbData = _maps[_this];'
+- print ' if (_pbData) {'
+- print ' retrace::delRegionByPointer(_pbData);'
+- print ' _maps[_this] = 0;'
+- print ' }'
++ print(' VOID *_pbData = 0;')
++ print(' _pbData = _maps[_this];')
++ print(' if (_pbData) {')
++ print(' retrace::delRegionByPointer(_pbData);')
++ print(' _maps[_this] = 0;')
++ print(' }')
+
+ def extractArg(self, function, arg, arg_type, lvalue, rvalue):
+ # Handle DDCREATE_* flags
+ if arg.type is DDCREATE_LPGUID:
+- print ' if (%s.toArray()) {' % rvalue
++ print(' if (%s.toArray()) {' % rvalue)
+ Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
+- print ' } else {'
+- print ' %s = static_cast<%s>(%s.toPointer());' % (lvalue, arg_type, rvalue)
+- print ' }'
++ print(' } else {')
++ print(' %s = static_cast<%s>(%s.toPointer());' % (lvalue, arg_type, rvalue))
++ print(' }')
+ return
+
+ Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
+
+
+ def main():
+- print r'#include <string.h>'
+- print
+- print r'#include <iostream>'
+- print
+- print r'#include "d3dretrace.hpp"'
+- print
++ print(r'#include <string.h>')
++ print()
++ print(r'#include <iostream>')
++ print()
++ print(r'#include "d3dretrace.hpp"')
++ print()
+
+ api = API()
+
+- print r'#include "d3dimports.hpp"'
++ print(r'#include "d3dimports.hpp"')
+ api.addModule(ddraw)
+- print
+- print '''static d3dretrace::D3DDumper<IDirect3DDevice7> d3d7Dumper;'''
+- print
++ print()
++ print('''static d3dretrace::D3DDumper<IDirect3DDevice7> d3d7Dumper;''')
++ print()
+
+ retracer = D3DRetracer()
+ retracer.table_name = 'd3dretrace::ddraw_callbacks'
+diff --git a/retrace/dllretrace.py b/retrace/dllretrace.py
+index c818b0a9..ad9db9a4 100644
+--- a/retrace/dllretrace.py
++++ b/retrace/dllretrace.py
+@@ -33,29 +33,29 @@ class DllDispatcher(Dispatcher):
+
+ def dispatchModule(self, module):
+ tag = module.name.upper()
+- print r'const char *g_sz%sDllName = NULL;' % (tag,)
+- print r'HMODULE g_h%sModule = NULL;' % (tag,)
+- print r''
+- print r'static PROC'
+- print r'_get%sProcAddress(LPCSTR lpProcName) {' % tag
+- print r' if (!g_h%sModule) {' % tag
+- print r' if (g_sz%sDllName) {' % tag
+- print r' g_h%sModule = LoadLibraryA(g_sz%sDllName);' % (tag, tag)
+- print r' if (!g_h%sModule) {' % tag
+- print r' os::log("warning: failed to load %%s\n", g_sz%sDllName);' % tag
+- print r' }'
+- print r' }'
+- print r' if (!g_h%sModule) {' % tag
+- print r' g_h%sModule = LoadLibraryA("%s.dll");' % (tag, module.name)
+- print r' }'
+- print r' if (!g_h%sModule) {' % tag
+- print r' os::log("error: failed to load %s.dll\n");' % module.name
+- print r' exit(1);'
+- print r' }'
+- print r' }'
+- print r' return GetProcAddress(g_h%sModule, lpProcName);' % tag
+- print r'}'
+- print r''
++ print(r'const char *g_sz%sDllName = NULL;' % (tag,))
++ print(r'HMODULE g_h%sModule = NULL;' % (tag,))
++ print(r'')
++ print(r'static PROC')
++ print(r'_get%sProcAddress(LPCSTR lpProcName) {' % tag)
++ print(r' if (!g_h%sModule) {' % tag)
++ print(r' if (g_sz%sDllName) {' % tag)
++ print(r' g_h%sModule = LoadLibraryA(g_sz%sDllName);' % (tag, tag))
++ print(r' if (!g_h%sModule) {' % tag)
++ print(r' os::log("warning: failed to load %%s\n", g_sz%sDllName);' % tag)
++ print(r' }')
++ print(r' }')
++ print(r' if (!g_h%sModule) {' % tag)
++ print(r' g_h%sModule = LoadLibraryA("%s.dll");' % (tag, module.name))
++ print(r' }')
++ print(r' if (!g_h%sModule) {' % tag)
++ print(r' os::log("error: failed to load %s.dll\n");' % module.name)
++ print(r' exit(1);')
++ print(r' }')
++ print(r' }')
++ print(r' return GetProcAddress(g_h%sModule, lpProcName);' % tag)
++ print(r'}')
++ print(r'')
+
+ Dispatcher.dispatchModule(self, module)
+
+diff --git a/retrace/dxgiretrace.py b/retrace/dxgiretrace.py
+index 799e3df9..8986a767 100755
+--- a/retrace/dxgiretrace.py
++++ b/retrace/dxgiretrace.py
+@@ -40,10 +40,10 @@ from specs.d3d11 import d3d11
+ class D3DRetracer(Retracer):
+
+ def retraceApi(self, api):
+- print '// Swizzling mapping for lock addresses, mapping a (pDeviceContext, pResource, Subresource) -> void *'
+- print 'typedef std::pair< IUnknown *, UINT > SubresourceKey;'
+- print 'static std::map< IUnknown *, std::map< SubresourceKey, void * > > g_Maps;'
+- print
++ print('// Swizzling mapping for lock addresses, mapping a (pDeviceContext, pResource, Subresource) -> void *')
++ print('typedef std::pair< IUnknown *, UINT > SubresourceKey;')
++ print('static std::map< IUnknown *, std::map< SubresourceKey, void * > > g_Maps;')
++ print()
+ self.table_name = 'd3dretrace::dxgi_callbacks'
+
+ Retracer.retraceApi(self, api)
+@@ -61,41 +61,41 @@ class D3DRetracer(Retracer):
+ if function.name in self.createDeviceFunctionNames:
+ # create windows as neccessary
+ if 'pSwapChainDesc' in function.argNames():
+- print r' d3dretrace::createWindowForSwapChain(pSwapChainDesc);'
++ print(r' d3dretrace::createWindowForSwapChain(pSwapChainDesc);')
+
+ # Compensate for the fact we don't trace DXGI object creation
+ if function.name.startswith('D3D11CreateDevice'):
+- print r' if (DriverType == D3D_DRIVER_TYPE_UNKNOWN && !pAdapter) {'
+- print r' DriverType = D3D_DRIVER_TYPE_HARDWARE;'
+- print r' }'
++ print(r' if (DriverType == D3D_DRIVER_TYPE_UNKNOWN && !pAdapter) {')
++ print(r' DriverType = D3D_DRIVER_TYPE_HARDWARE;')
++ print(r' }')
+
+ if function.name.startswith('D3D10CreateDevice'):
+ # Toggle debugging
+- print r' Flags &= ~D3D10_CREATE_DEVICE_DEBUG;'
+- print r' if (retrace::debug) {'
+- print r' HMODULE hD3d10SdkLayers = LoadLibraryA("d3d10sdklayers");'
+- print r' if (hD3d10SdkLayers) {'
+- print r' FreeLibrary(hD3d10SdkLayers);'
+- print r' Flags |= D3D10_CREATE_DEVICE_DEBUG;'
+- print r' } else {'
+- print r' retrace::warning(call) << "Direct3D 10.x SDK Debug Layer (d3d10sdklayers.dll) not available, continuing without debug output\n";'
+- print r' }'
+- print r' }'
++ print(r' Flags &= ~D3D10_CREATE_DEVICE_DEBUG;')
++ print(r' if (retrace::debug) {')
++ print(r' HMODULE hD3d10SdkLayers = LoadLibraryA("d3d10sdklayers");')
++ print(r' if (hD3d10SdkLayers) {')
++ print(r' FreeLibrary(hD3d10SdkLayers);')
++ print(r' Flags |= D3D10_CREATE_DEVICE_DEBUG;')
++ print(r' } else {')
++ print(r' retrace::warning(call) << "Direct3D 10.x SDK Debug Layer (d3d10sdklayers.dll) not available, continuing without debug output\n";')
++ print(r' }')
++ print(r' }')
+
+ # Force driver
+ self.forceDriver('D3D10_DRIVER_TYPE')
+
+ if function.name.startswith('D3D11CreateDevice'):
+ # Toggle debugging
+- print r' Flags &= ~D3D11_CREATE_DEVICE_DEBUG;'
+- print r' if (retrace::debug) {'
+- print r' HRESULT hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_NULL, 0, D3D11_CREATE_DEVICE_DEBUG, NULL, 0, D3D11_SDK_VERSION, NULL, NULL, NULL);'
+- print r' if (SUCCEEDED(hr)) {'
+- print r' Flags |= D3D11_CREATE_DEVICE_DEBUG;'
+- print r' } else {'
+- print r' retrace::warning(call) << "Direct3D 11.x SDK Debug Layer (d3d11*sdklayers.dll) not available, continuing without debug output\n";'
+- print r' }'
+- print r' }'
++ print(r' Flags &= ~D3D11_CREATE_DEVICE_DEBUG;')
++ print(r' if (retrace::debug) {')
++ print(r' HRESULT hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_NULL, 0, D3D11_CREATE_DEVICE_DEBUG, NULL, 0, D3D11_SDK_VERSION, NULL, NULL, NULL);')
++ print(r' if (SUCCEEDED(hr)) {')
++ print(r' Flags |= D3D11_CREATE_DEVICE_DEBUG;')
++ print(r' } else {')
++ print(r' retrace::warning(call) << "Direct3D 11.x SDK Debug Layer (d3d11*sdklayers.dll) not available, continuing without debug output\n";')
++ print(r' }')
++ print(r' }')
+
+ # Force driver
+ self.forceDriver('D3D_DRIVER_TYPE')
+@@ -108,15 +108,15 @@ class D3DRetracer(Retracer):
+ if interface is not None:
+ getDeviceRemovedReasonMethod = interface.getMethodByName("GetDeviceRemovedReason")
+ if getDeviceRemovedReasonMethod is not None:
+- print r' if (FAILED(_result)) {'
+- print r' retrace::failed(call, _result);'
+- print r' if (_result == DXGI_ERROR_DEVICE_REMOVED) {'
+- print r' HRESULT _reason = _this->GetDeviceRemovedReason();'
+- print r' retrace::failed(call, _reason);'
+- print r' exit(1);'
+- print r' }'
+- print r' return;'
+- print r' }'
++ print(r' if (FAILED(_result)) {')
++ print(r' retrace::failed(call, _result);')
++ print(r' if (_result == DXGI_ERROR_DEVICE_REMOVED) {')
++ print(r' HRESULT _reason = _this->GetDeviceRemovedReason();')
++ print(r' retrace::failed(call, _reason);')
++ print(r' exit(1);')
++ print(r' }')
++ print(r' return;')
++ print(r' }')
+ return
+
+ Retracer.checkResult(self, interface, methodOrFunction)
+@@ -124,112 +124,112 @@ class D3DRetracer(Retracer):
+ def forceDriver(self, enum):
+ # This can only work when pAdapter is NULL. For non-NULL pAdapter we
+ # need to override inside the EnumAdapters call below
+- print r' if (pAdapter == NULL) {'
+- print r' switch (retrace::driver) {'
+- print r' case retrace::DRIVER_HARDWARE:'
+- print r' DriverType = %s_HARDWARE;' % enum
+- print r' Software = NULL;'
+- print r' break;'
+- print r' case retrace::DRIVER_SOFTWARE:'
+- print r' DriverType = %s_WARP;' % enum
+- print r' Software = NULL;'
+- print r' break;'
+- print r' case retrace::DRIVER_REFERENCE:'
+- print r' DriverType = %s_REFERENCE;' % enum
+- print r' Software = NULL;'
+- print r' break;'
+- print r' case retrace::DRIVER_NULL:'
+- print r' DriverType = %s_NULL;' % enum
+- print r' Software = NULL;'
+- print r' break;'
+- print r' case retrace::DRIVER_MODULE:'
+- print r' DriverType = %s_SOFTWARE;' % enum
+- print r' Software = LoadLibraryA(retrace::driverModule);'
+- print r' if (!Software) {'
+- print r' retrace::warning(call) << "failed to load " << retrace::driverModule << "\n";'
+- print r' }'
+- print r' break;'
+- print r' default:'
+- print r' assert(0);'
+- print r' /* fall-through */'
+- print r' case retrace::DRIVER_DEFAULT:'
+- print r' if (DriverType == %s_SOFTWARE) {' % enum
+- print r' Software = LoadLibraryA("d3d10warp");'
+- print r' if (!Software) {'
+- print r' retrace::warning(call) << "failed to load d3d10warp.dll\n";'
+- print r' }'
+- print r' }'
+- print r' break;'
+- print r' }'
+- print r' } else {'
+- print r' Software = NULL;'
+- print r' }'
++ print(r' if (pAdapter == NULL) {')
++ print(r' switch (retrace::driver) {')
++ print(r' case retrace::DRIVER_HARDWARE:')
++ print(r' DriverType = %s_HARDWARE;' % enum)
++ print(r' Software = NULL;')
++ print(r' break;')
++ print(r' case retrace::DRIVER_SOFTWARE:')
++ print(r' DriverType = %s_WARP;' % enum)
++ print(r' Software = NULL;')
++ print(r' break;')
++ print(r' case retrace::DRIVER_REFERENCE:')
++ print(r' DriverType = %s_REFERENCE;' % enum)
++ print(r' Software = NULL;')
++ print(r' break;')
++ print(r' case retrace::DRIVER_NULL:')
++ print(r' DriverType = %s_NULL;' % enum)
++ print(r' Software = NULL;')
++ print(r' break;')
++ print(r' case retrace::DRIVER_MODULE:')
++ print(r' DriverType = %s_SOFTWARE;' % enum)
++ print(r' Software = LoadLibraryA(retrace::driverModule);')
++ print(r' if (!Software) {')
++ print(r' retrace::warning(call) << "failed to load " << retrace::driverModule << "\n";')
++ print(r' }')
++ print(r' break;')
++ print(r' default:')
++ print(r' assert(0);')
++ print(r' /* fall-through */')
++ print(r' case retrace::DRIVER_DEFAULT:')
++ print(r' if (DriverType == %s_SOFTWARE) {' % enum)
++ print(r' Software = LoadLibraryA("d3d10warp");')
++ print(r' if (!Software) {')
++ print(r' retrace::warning(call) << "failed to load d3d10warp.dll\n";')
++ print(r' }')
++ print(r' }')
++ print(r' break;')
++ print(r' }')
++ print(r' } else {')
++ print(r' Software = NULL;')
++ print(r' }')
+
+ def invokeInterfaceMethod(self, interface, method):
+ # keep track of the last used device for state dumping
+ if interface.name in ('ID3D10Device', 'ID3D10Device1'):
+ if method.name == 'Release':
+- print r' if (call.ret->toUInt() == 0) {'
+- print r' d3d10Dumper.unbindDevice(_this);'
+- print r' }'
++ print(r' if (call.ret->toUInt() == 0) {')
++ print(r' d3d10Dumper.unbindDevice(_this);')
++ print(r' }')
+ else:
+- print r' d3d10Dumper.bindDevice(_this);'
++ print(r' d3d10Dumper.bindDevice(_this);')
+ if interface.name.startswith('ID3D11DeviceContext'):
+ if method.name == 'Release':
+- print r' if (call.ret->toUInt() == 0) {'
+- print r' d3d11Dumper.unbindDevice(_this);'
+- print r' }'
++ print(r' if (call.ret->toUInt() == 0) {')
++ print(r' d3d11Dumper.unbindDevice(_this);')
++ print(r' }')
+ else:
+- print r' if (_this->GetType() == D3D11_DEVICE_CONTEXT_IMMEDIATE) {'
+- print r' d3d11Dumper.bindDevice(_this);'
+- print r' }'
++ print(r' if (_this->GetType() == D3D11_DEVICE_CONTEXT_IMMEDIATE) {')
++ print(r' d3d11Dumper.bindDevice(_this);')
++ print(r' }')
+
+ # intercept private interfaces
+ if method.name == 'QueryInterface':
+- print r' if (!d3dretrace::overrideQueryInterface(_this, riid, ppvObj, &_result)) {'
++ print(r' if (!d3dretrace::overrideQueryInterface(_this, riid, ppvObj, &_result)) {')
+ Retracer.invokeInterfaceMethod(self, interface, method)
+- print r' }'
++ print(r' }')
+ return
+
+ # create windows as neccessary
+ if method.name == 'CreateSwapChain':
+- print r' d3dretrace::createWindowForSwapChain(pDesc);'
++ print(r' d3dretrace::createWindowForSwapChain(pDesc);')
+ if method.name == 'CreateSwapChainForHwnd':
+- print r' WindowHandle = d3dretrace::createWindow(pDesc->Width, pDesc->Height);'
+- print r' // DXGI_SCALING_NONE is only supported on Win8 and beyond'
+- print r' if (pDesc->Scaling == DXGI_SCALING_NONE && !IsWindows8OrGreater()) {'
+- print r' pDesc->Scaling = DXGI_SCALING_STRETCH;'
+- print r' }'
++ print(r' WindowHandle = d3dretrace::createWindow(pDesc->Width, pDesc->Height);')
++ print(r' // DXGI_SCALING_NONE is only supported on Win8 and beyond')
++ print(r' if (pDesc->Scaling == DXGI_SCALING_NONE && !IsWindows8OrGreater()) {')
++ print(r' pDesc->Scaling = DXGI_SCALING_STRETCH;')
++ print(r' }')
+ if method.name == 'CreateSwapChainForComposition':
+- print r' HWND hWnd = d3dretrace::createWindow(pDesc->Width, pDesc->Height);'
+- print r' _result = _this->CreateSwapChainForHwnd(pDevice, hWnd, pDesc, NULL, pRestrictToOutput, ppSwapChain);'
++ print(r' HWND hWnd = d3dretrace::createWindow(pDesc->Width, pDesc->Height);')
++ print(r' _result = _this->CreateSwapChainForHwnd(pDevice, hWnd, pDesc, NULL, pRestrictToOutput, ppSwapChain);')
+ self.checkResult(interface, method)
+ return
+
+ if method.name == 'SetFullscreenState':
+- print r' if (retrace::forceWindowed) {'
+- print r' Fullscreen = FALSE;'
+- print r' pTarget = NULL;'
+- print r' }'
++ print(r' if (retrace::forceWindowed) {')
++ print(r' Fullscreen = FALSE;')
++ print(r' pTarget = NULL;')
++ print(r' }')
+
+ # notify frame has been completed
+ if interface.name.startswith('IDXGISwapChain') and method.name.startswith('Present'):
+ if interface.name.startswith('IDXGISwapChainDWM'):
+- print r' com_ptr<IDXGISwapChain> pSwapChain;'
+- print r' if (SUCCEEDED(_this->QueryInterface(IID_IDXGISwapChain, (void **) &pSwapChain))) {'
+- print r' dxgiDumper.bindDevice(pSwapChain);'
+- print r' } else {'
+- print r' assert(0);'
+- print r' }'
++ print(r' com_ptr<IDXGISwapChain> pSwapChain;')
++ print(r' if (SUCCEEDED(_this->QueryInterface(IID_IDXGISwapChain, (void **) &pSwapChain))) {')
++ print(r' dxgiDumper.bindDevice(pSwapChain);')
++ print(r' } else {')
++ print(r' assert(0);')
++ print(r' }')
+ else:
+- print r' dxgiDumper.bindDevice(_this);'
+- print r' retrace::frameComplete(call);'
++ print(r' dxgiDumper.bindDevice(_this);')
++ print(r' retrace::frameComplete(call);')
+
+ if 'pSharedResource' in method.argNames():
+- print r' if (pSharedResource) {'
+- print r' retrace::warning(call) << "shared surfaces unsupported\n";'
+- print r' pSharedResource = NULL;'
+- print r' }'
++ print(r' if (pSharedResource) {')
++ print(r' retrace::warning(call) << "shared surfaces unsupported\n";')
++ print(r' pSharedResource = NULL;')
++ print(r' }')
+
+ # Force driver
+ if interface.name.startswith('IDXGIFactory') and method.name.startswith('EnumAdapters'):
+@@ -260,31 +260,31 @@ class D3DRetracer(Retracer):
+ return
+
+ if interface.name.startswith('ID3D10Device') and method.name.startswith('OpenSharedResource'):
+- print r' retrace::warning(call) << "replacing shared resource with checker pattern\n";'
+- print r' _result = d3dretrace::createSharedResource(_this, ReturnedInterface, ppResource);'
++ print(r' retrace::warning(call) << "replacing shared resource with checker pattern\n";')
++ print(r' _result = d3dretrace::createSharedResource(_this, ReturnedInterface, ppResource);')
+ self.checkResult(interface, method)
+ return
+ if interface.name.startswith('ID3D11Device') and method.name == 'OpenSharedResource':
+ # Some applications (e.g., video playing in IE11) create shared resources within the same process.
+ # TODO: Generalize to other OpenSharedResource variants
+- print r' retrace::map<HANDLE>::const_iterator it = _shared_handle_map.find(hResource);'
+- print r' if (it == _shared_handle_map.end()) {'
+- print r' retrace::warning(call) << "replacing shared resource with checker pattern\n";'
+- print r' _result = d3dretrace::createSharedResource(_this, ReturnedInterface, ppResource);'
++ print(r' retrace::map<HANDLE>::const_iterator it = _shared_handle_map.find(hResource);')
++ print(r' if (it == _shared_handle_map.end()) {')
++ print(r' retrace::warning(call) << "replacing shared resource with checker pattern\n";')
++ print(r' _result = d3dretrace::createSharedResource(_this, ReturnedInterface, ppResource);')
+ self.checkResult(interface, method)
+- print r' } else {'
+- print r' hResource = it->second;'
++ print(r' } else {')
++ print(r' hResource = it->second;')
+ Retracer.invokeInterfaceMethod(self, interface, method)
+- print r' }'
++ print(r' }')
+ return
+ if interface.name.startswith('ID3D11Device') and method.name.startswith('OpenSharedResource'):
+- print r' retrace::warning(call) << "replacing shared resource with checker pattern\n";'
+- print r' _result = d3dretrace::createSharedResource(_this, ReturnedInterface, ppResource);'
++ print(r' retrace::warning(call) << "replacing shared resource with checker pattern\n";')
++ print(r' _result = d3dretrace::createSharedResource(_this, ReturnedInterface, ppResource);')
+ if method.name == 'OpenSharedResourceByName':
+- print r' (void)lpName;'
+- print r' (void)dwDesiredAccess;'
++ print(r' (void)lpName;')
++ print(r' (void)dwDesiredAccess;')
+ else:
+- print r' (void)hResource;'
++ print(r' (void)hResource;')
+ self.checkResult(interface, method)
+ return
+
+@@ -294,7 +294,7 @@ class D3DRetracer(Retracer):
+ mapFlagsArg = method.getArgByName('MapFlags')
+ for flag in mapFlagsArg.type.values:
+ if flag.endswith('_MAP_FLAG_DO_NOT_WAIT'):
+- print r' MapFlags &= ~%s;' % flag
++ print(r' MapFlags &= ~%s;' % flag)
+
+ if method.name.startswith('UpdateSubresource'):
+ # The D3D10 debug layer is buggy (or at least inconsistent with the
+@@ -303,108 +303,108 @@ class D3DRetracer(Retracer):
+ # SrcDepthPitch is garbagge for non 3D textures.
+ # XXX: It also seems to expect padding bytes at the end of the last
+ # row, but we never record (or allocate) those...
+- print r' if (retrace::debug && pDstBox && pDstBox->front == 0 && pDstBox->back == 1) {'
+- print r' SrcDepthPitch = 0;'
+- print r' }'
++ print(r' if (retrace::debug && pDstBox && pDstBox->front == 0 && pDstBox->back == 1) {')
++ print(r' SrcDepthPitch = 0;')
++ print(r' }')
+
+ if method.name == 'SetGammaControl':
+ # This method is only supported while in full-screen mode
+- print r' if (retrace::forceWindowed) {'
+- print r' return;'
+- print r' }'
++ print(r' if (retrace::forceWindowed) {')
++ print(r' return;')
++ print(r' }')
+
+ Retracer.invokeInterfaceMethod(self, interface, method)
+
+ if method.name in ('AcquireSync', 'ReleaseSync'):
+- print r' if (SUCCEEDED(_result) && _result != S_OK) {'
+- print r' retrace::warning(call) << " returned " << _result << "\n";'
+- print r' }'
++ print(r' if (SUCCEEDED(_result) && _result != S_OK) {')
++ print(r' retrace::warning(call) << " returned " << _result << "\n";')
++ print(r' }')
+
+ # process events after presents
+ if interface.name.startswith('IDXGISwapChain') and method.name.startswith('Present'):
+- print r' d3dretrace::processEvents();'
++ print(r' d3dretrace::processEvents();')
+
+ if method.name in ('Map', 'Unmap'):
+ if interface.name.startswith('ID3D11DeviceContext'):
+- print ' void * & _pbData = g_Maps[_this][SubresourceKey(pResource, Subresource)];'
++ print(' void * & _pbData = g_Maps[_this][SubresourceKey(pResource, Subresource)];')
+ else:
+ subresourceArg = method.getArgByName('Subresource')
+ if subresourceArg is None:
+- print ' UINT Subresource = 0;'
+- print ' void * & _pbData = g_Maps[0][SubresourceKey(_this, Subresource)];'
++ print(' UINT Subresource = 0;')
++ print(' void * & _pbData = g_Maps[0][SubresourceKey(_this, Subresource)];')
+
+ if method.name == 'Map':
+- print ' _MAP_DESC _MapDesc;'
+- print ' _getMapDesc(_this, %s, _MapDesc);' % ', '.join(method.argNames())
+- print ' size_t _MappedSize = _MapDesc.Size;'
+- print ' if (_MapDesc.Size) {'
+- print ' _pbData = _MapDesc.pData;'
++ print(' _MAP_DESC _MapDesc;')
++ print(' _getMapDesc(_this, %s, _MapDesc);' % ', '.join(method.argNames()))
++ print(' size_t _MappedSize = _MapDesc.Size;')
++ print(' if (_MapDesc.Size) {')
++ print(' _pbData = _MapDesc.pData;')
+ if interface.name.startswith('ID3D11DeviceContext'):
+ # Prevent false warnings on 1D and 2D resources, since the
+ # pitches are often junk there...
+- print ' _normalizeMap(pResource, pMappedResource);'
++ print(' _normalizeMap(pResource, pMappedResource);')
+ self.checkPitchMismatch(method)
+ else:
+- print ' _pbData = _MapDesc.pData;'
++ print(' _pbData = _MapDesc.pData;')
+ self.checkPitchMismatch(method)
+- print ' } else {'
+- print ' return;'
+- print ' }'
++ print(' } else {')
++ print(' return;')
++ print(' }')
+
+ if method.name == 'Unmap':
+- print ' if (_pbData) {'
+- print ' retrace::delRegionByPointer(_pbData);'
+- print ' _pbData = 0;'
+- print ' }'
++ print(' if (_pbData) {')
++ print(' retrace::delRegionByPointer(_pbData);')
++ print(' _pbData = 0;')
++ print(' }')
+
+ # Attach shader byte code for lookup
+ if 'pShaderBytecode' in method.argNames():
+ ppShader = method.args[-1]
+ assert ppShader.output
+- print r' if (retrace::dumpingState && SUCCEEDED(_result)) {'
+- print r' (*%s)->SetPrivateData(d3dstate::GUID_D3DSTATE, BytecodeLength, pShaderBytecode);' % ppShader.name
+- print r' }'
++ print(r' if (retrace::dumpingState && SUCCEEDED(_result)) {')
++ print(r' (*%s)->SetPrivateData(d3dstate::GUID_D3DSTATE, BytecodeLength, pShaderBytecode);' % ppShader.name)
++ print(r' }')
+
+ def extractArg(self, function, arg, arg_type, lvalue, rvalue):
+ # Set object names
+ if function.name == 'SetPrivateData' and arg.name == 'pData':
+ iid = function.args[0].name
+- print r' if (%s != WKPDID_D3DDebugObjectName) {' % iid
+- print r' return;'
+- print r' }'
++ print(r' if (%s != WKPDID_D3DDebugObjectName) {' % iid)
++ print(r' return;')
++ print(r' }')
+ # Interpret argument as string
+ Retracer.extractArg(self, function, arg, LPCSTR, lvalue, rvalue)
+- print r' assert(pData);'
+- print r' assert(DataSize >= strlen((const char *)pData));'
+- print r' // Some applications include the trailing zero terminator in the data'
+- print r' DataSize = strlen((const char *)pData);'
++ print(r' assert(pData);')
++ print(r' assert(DataSize >= strlen((const char *)pData));')
++ print(r' // Some applications include the trailing zero terminator in the data')
++ print(r' DataSize = strlen((const char *)pData);')
+ return
+
+ Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
+
+
+ def main():
+- print r'#define INITGUID'
+- print
+- print r'#include <string.h>'
+- print
+- print r'#include <iostream>'
+- print
+- print r'#include "d3dretrace.hpp"'
+- print r'#include "os_version.hpp"'
+- print
+- print r'#include "d3dretrace_dxgi.hpp"'
+- print r'#include "d3d10imports.hpp"'
+- print r'#include "d3d10size.hpp"'
+- print r'#include "d3d10state.hpp"'
+- print r'#include "d3d11imports.hpp"'
+- print r'#include "d3d11size.hpp"'
+- print r'#include "d3dstate.hpp"'
+- print
+- print '''static d3dretrace::D3DDumper<IDXGISwapChain> dxgiDumper;'''
+- print '''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;'''
+- print '''static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;'''
+- print
++ print(r'#define INITGUID')
++ print()
++ print(r'#include <string.h>')
++ print()
++ print(r'#include <iostream>')
++ print()
++ print(r'#include "d3dretrace.hpp"')
++ print(r'#include "os_version.hpp"')
++ print()
++ print(r'#include "d3dretrace_dxgi.hpp"')
++ print(r'#include "d3d10imports.hpp"')
++ print(r'#include "d3d10size.hpp"')
++ print(r'#include "d3d10state.hpp"')
++ print(r'#include "d3d11imports.hpp"')
++ print(r'#include "d3d11size.hpp"')
++ print(r'#include "d3dstate.hpp"')
++ print()
++ print('''static d3dretrace::D3DDumper<IDXGISwapChain> dxgiDumper;''')
++ print('''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;''')
++ print('''static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;''')
++ print()
+
+ api = API()
+ api.addModule(dxgi)
+diff --git a/retrace/dxgistate_so.py b/retrace/dxgistate_so.py
+index 86f6db57..33745c8f 100644
+--- a/retrace/dxgistate_so.py
++++ b/retrace/dxgistate_so.py
+@@ -48,9 +48,9 @@ class ValueDumper(stdapi.Visitor, stdapi.ExpanderMixin):
+
+ def visitLiteral(self, literal, instance):
+ if literal.kind in ('SInt', 'UInt'):
+- print ' writer.writeInt(%s);' % (instance)
++ print(' writer.writeInt(%s);' % (instance))
+ elif literal.kind in ('Float',):
+- print ' writer.writeFloat(%s);' % (instance)
++ print(' writer.writeFloat(%s);' % (instance))
+ else:
+ raise NotImplementedError
+
+@@ -66,36 +66,36 @@ class ValueDumper(stdapi.Visitor, stdapi.ExpanderMixin):
+ # reinterpret_cast is necessary for GLubyte * <=> char *
+ instance = 'reinterpret_cast<%s>(%s)' % (cast, instance)
+ assert string.length is None
+- print ' writer.write%s(%s);' % (suffix, instance)
++ print(' writer.write%s(%s);' % (suffix, instance))
+
+ def visitConst(self, const, instance):
+ self.visit(const.type, instance)
+
+ def visitStruct(self, struct, instance):
+- print ' writer.beginObject();'
++ print(' writer.beginObject();')
+ for member in struct.members:
+ memberType, memberName = member
+ if memberName is not None:
+- print ' writer.beginMember("%s");' % memberName
++ print(' writer.beginMember("%s");' % memberName)
+ self.visitMember(member, instance)
+ if memberName is not None:
+- print ' writer.endMember(); // %s' % memberName
+- print ' writer.endObject();'
++ print(' writer.endMember(); // %s' % memberName)
++ print(' writer.endObject();')
+
+ def visitArray(self, array, instance):
+ length = '_c' + array.type.tag
+ index = '_i' + array.type.tag
+ array_length = self.expand(array.length)
+- print ' if (%s) {' % instance
+- print ' size_t %s = %s > 0 ? %s : 0;' % (length, array_length, array_length)
+- print ' writer.beginArray();'
+- print ' for (size_t %s = 0; %s < %s; ++%s) {' % (index, index, length, index)
++ print(' if (%s) {' % instance)
++ print(' size_t %s = %s > 0 ? %s : 0;' % (length, array_length, array_length))
++ print(' writer.beginArray();')
++ print(' for (size_t %s = 0; %s < %s; ++%s) {' % (index, index, length, index))
+ self.visitElement(index, array.type, '(%s)[%s]' % (instance, index))
+- print ' }'
+- print ' writer.endArray();'
+- print ' } else {'
+- print ' writer.writeNull();'
+- print ' }'
++ print(' }')
++ print(' writer.endArray();')
++ print(' } else {')
++ print(' writer.writeNull();')
++ print(' }')
+
+ def visitAttribArray(self, array, instance):
+ raise NotImplementedError
+@@ -104,37 +104,37 @@ class ValueDumper(stdapi.Visitor, stdapi.ExpanderMixin):
+ raise NotImplementedError
+
+ def visitEnum(self, enum, instance):
+- print ' switch (%s) {' % instance
++ print(' switch (%s) {' % instance)
+ for value in enum.values:
+- print ' case %s:' % value
+- print ' writer.writeString("%s");' % value
+- print ' break;'
+- print ' default:'
+- print ' writer.writeInt(%s);' % instance
+- print ' break;'
+- print ' }'
++ print(' case %s:' % value)
++ print(' writer.writeString("%s");' % value)
++ print(' break;')
++ print(' default:')
++ print(' writer.writeInt(%s);' % instance)
++ print(' break;')
++ print(' }')
+
+ def visitBitmask(self, bitmask, instance):
+ # TODO
+ self.visit(bitmask.type, instance)
+
+ def visitPointer(self, pointer, instance):
+- print ' if (%s) {' % instance
+- print ' writer.beginArray();'
++ print(' if (%s) {' % instance)
++ print(' writer.beginArray();')
+ self.visit(pointer.type, "*" + instance)
+- print ' writer.endArray();'
+- print ' } else {'
+- print ' writer.writeNull();'
+- print ' }'
++ print(' writer.endArray();')
++ print(' } else {')
++ print(' writer.writeNull();')
++ print(' }')
+
+ def visitIntPointer(self, pointer, instance):
+- print ' writer.writeInt((uintptr_t)%s);' % instance
++ print(' writer.writeInt((uintptr_t)%s);' % instance)
+
+ def visitObjPointer(self, pointer, instance):
+- print ' writer.writeInt((uintptr_t)%s);' % instance
++ print(' writer.writeInt((uintptr_t)%s);' % instance)
+
+ def visitLinearPointer(self, pointer, instance):
+- print ' writer.writeInt((uintptr_t)%s);' % instance
++ print(' writer.writeInt((uintptr_t)%s);' % instance)
+
+ def visitReference(self, reference, instance):
+ self.visit(reference.type, instance)
+@@ -146,23 +146,23 @@ class ValueDumper(stdapi.Visitor, stdapi.ExpanderMixin):
+ self.visit(alias.type, instance)
+
+ def visitOpaque(self, opaque, instance):
+- print ' writer.writeInt((uintptr_t)%s);' % instance
++ print(' writer.writeInt((uintptr_t)%s);' % instance)
+
+ def visitInterface(self, interface, instance):
+ assert False
+
+ def visitPolymorphic(self, polymorphic, instance):
+ switchExpr = self.expand(polymorphic.switchExpr)
+- print ' switch (static_cast<int>(%s)) {' % switchExpr
++ print(' switch (static_cast<int>(%s)) {' % switchExpr)
+ for cases, type in polymorphic.iterSwitch():
+ for case in cases:
+- print ' %s:' % case
++ print(' %s:' % case)
+ caseInstance = instance
+ if type.expr is not None:
+ caseInstance = 'static_cast<%s>(%s)' % (type, caseInstance)
+ self.visit(type, caseInstance)
+- print ' break;'
+- print ' }'
++ print(' break;')
++ print(' }')
+
+
+ class Dumper:
+@@ -187,8 +187,8 @@ class Dumper:
+ # Includes
+ for module in api.modules:
+ for header in module.headers:
+- print header
+- print
++ print(header)
++ print()
+
+ # Generate the dumper functions
+ types = api.getAllTypes()
+@@ -196,13 +196,13 @@ class Dumper:
+ self.dumpType(type)
+
+ def dumpType(self, type):
+- print r'void'
+- print r'dumpStateObject(StateWriter &writer, const %s & so)' % type
+- print r'{'
++ print(r'void')
++ print(r'dumpStateObject(StateWriter &writer, const %s & so)' % type)
++ print(r'{')
+ visitor = self.dumperFactory()
+ visitor.visit(type, 'so')
+- print r'}'
+- print
++ print(r'}')
++ print()
+
+ def header(self):
+ pass
+@@ -212,10 +212,10 @@ class Dumper:
+
+
+ if __name__ == '__main__':
+- print r'#include "dxgistate_so.hpp"'
+- print
+- print r'#include "state_writer.hpp"'
+- print
++ print(r'#include "dxgistate_so.hpp"')
++ print()
++ print(r'#include "state_writer.hpp"')
++ print()
+
+ api = stdapi.API()
+ api.addModule(dxgi.dxgi)
+diff --git a/retrace/glretrace.py b/retrace/glretrace.py
+index 2ead195d..0dfe5c5b 100644
+--- a/retrace/glretrace.py
++++ b/retrace/glretrace.py
+@@ -127,190 +127,190 @@ class GlRetracer(Retracer):
+
+ # For backwards compatibility with old traces where non VBO drawing was supported
+ if (is_array_pointer or is_draw_arrays or is_draw_elements) and not is_draw_indirect:
+- print ' if (retrace::parser->getVersion() < 1) {'
++ print(' if (retrace::parser->getVersion() < 1) {')
+
+ if is_array_pointer or is_draw_arrays:
+- print ' GLint _array_buffer = 0;'
+- print ' glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &_array_buffer);'
+- print ' if (!_array_buffer) {'
++ print(' GLint _array_buffer = 0;')
++ print(' glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &_array_buffer);')
++ print(' if (!_array_buffer) {')
+ self.failFunction(function)
+- print ' }'
++ print(' }')
+
+ if is_draw_elements:
+- print ' GLint _element_array_buffer = 0;'
+- print ' glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &_element_array_buffer);'
+- print ' if (!_element_array_buffer) {'
++ print(' GLint _element_array_buffer = 0;')
++ print(' glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &_element_array_buffer);')
++ print(' if (!_element_array_buffer) {')
+ self.failFunction(function)
+- print ' }'
++ print(' }')
+
+- print ' }'
++ print(' }')
+
+ # When no pack buffer object is bound, the pack functions are no-ops.
+ if self.pack_function_regex.match(function.name):
+- print ' GLint _pack_buffer = 0;'
+- print ' glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &_pack_buffer);'
+- print ' if (!_pack_buffer) {'
+- print ' return;'
+- print ' }'
++ print(' GLint _pack_buffer = 0;')
++ print(' glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &_pack_buffer);')
++ print(' if (!_pack_buffer) {')
++ print(' return;')
++ print(' }')
+
+ # Pre-snapshots
+ if self.bind_framebuffer_function_regex.match(function.name):
+- print ' assert(call.flags & trace::CALL_FLAG_SWAP_RENDERTARGET);'
++ print(' assert(call.flags & trace::CALL_FLAG_SWAP_RENDERTARGET);')
+ if function.name == 'glStringMarkerGREMEDY':
+ return
+ if function.name == 'glFrameTerminatorGREMEDY':
+- print ' glretrace::frame_complete(call);'
++ print(' glretrace::frame_complete(call);')
+ return
+
+ Retracer.retraceFunctionBody(self, function)
+
+ # Post-snapshots
+ if function.name in ('glFlush', 'glFinish'):
+- print ' if (!retrace::doubleBuffer) {'
+- print ' glretrace::frame_complete(call);'
+- print ' }'
++ print(' if (!retrace::doubleBuffer) {')
++ print(' glretrace::frame_complete(call);')
++ print(' }')
+ if is_draw_arrays or is_draw_elements or is_misc_draw:
+- print ' assert(call.flags & trace::CALL_FLAG_RENDER);'
++ print(' assert(call.flags & trace::CALL_FLAG_RENDER);')
+
+
+ def invokeFunction(self, function):
+ if function.name == "glTexDirectVIVMap" or function.name == "glTexDirectMapVIV" or function.name == "glTexDirectTiledMapVIV":
+- print '#if defined(HAVE_VIVANTE_G2D)'
+- print ' GLint tex;'
+- print ' glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);'
+- print ' int32_t size = 0;'
+- print ' switch(format){'
+- print ' case GL_VIV_YV12:'
+- print ' case GL_VIV_I420:'
+- print ' case GL_VIV_NV12:'
+- print ' case GL_VIV_NV21:'
+- print ' size=width * height * 3 / 2;'
+- print ' break;'
+- print ' case GL_RGBA:'
+- print ' case GL_BGRA_EXT:'
+- print ' size=width * height * 4;'
+- print ' break;'
+- print ' case GL_RGB:'
+- print ' size=width * height *3;'
+- print ' break;'
+- print ' case GL_VIV_YUY2:'
+- print ' case GL_VIV_UYVY:'
+- print ' case GL_RGB565_OES:'
+- print ' case GL_LUMINANCE8_ALPHA8_EXT:'
+- print ' size=width * height *2;'
+- print ' break;'
+- print ' case GL_ALPHA:'
+- print ' size=width * height;'
+- print ' break;'
+- print ' default:'
+- print ' break;'
+- print ' }'
+- print ' if(tex != 0)'
+- print ' {'
+- print ' GLuint pindex = *(GLuint*)Logical;'
+- print ' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];'
+- print ' if(data.privateData == 0) // new entry'
+- print ' {'
+- print ' data.privateData = alloc_dma_buffer(size, (uintptr_t*)&data.logical, &data.physical);'
+- print ' data.index = pindex;'
+- print ' data.size = size;'
+- print ' retrace::addRegion(call,data.index,data.logical,size);'
+- print ' }'
+- print ' else // already have one; check size and index'
+- print ' {'
+- print ' if((size!=data.size)||(pindex!=data.index))'
+- print ' {'
+- print ' retrace::delRegionByPointer(data.logical);'
+- print ' free_dma_buffer(data.privateData);'
+- print ' data.privateData = alloc_dma_buffer(size, (uintptr_t*)&data.logical, &data.physical);'
+- print ' data.index = pindex;'
+- print ' data.size = size;'
+- print ' retrace::addRegion(call,data.index,data.logical,size);'
+- print ' }'
+- print ' }'
+- print ' *Logical = data.logical;'
+- print ' *Physical = data.physical;'
+- print ' }'
+- print '#endif /* HAVE_VIVANTE_G2D */'
++ print('#if defined(HAVE_VIVANTE_G2D)')
++ print(' GLint tex;')
++ print(' glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);')
++ print(' int32_t size = 0;')
++ print(' switch(format){')
++ print(' case GL_VIV_YV12:')
++ print(' case GL_VIV_I420:')
++ print(' case GL_VIV_NV12:')
++ print(' case GL_VIV_NV21:')
++ print(' size=width * height * 3 / 2;')
++ print(' break;')
++ print(' case GL_RGBA:')
++ print(' case GL_BGRA_EXT:')
++ print(' size=width * height * 4;')
++ print(' break;')
++ print(' case GL_RGB:')
++ print(' size=width * height *3;')
++ print(' break;')
++ print(' case GL_VIV_YUY2:')
++ print(' case GL_VIV_UYVY:')
++ print(' case GL_RGB565_OES:')
++ print(' case GL_LUMINANCE8_ALPHA8_EXT:')
++ print(' size=width * height *2;')
++ print(' break;')
++ print(' case GL_ALPHA:')
++ print(' size=width * height;')
++ print(' break;')
++ print(' default:')
++ print(' break;')
++ print(' }')
++ print(' if(tex != 0)')
++ print(' {')
++ print(' GLuint pindex = *(GLuint*)Logical;')
++ print(' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];')
++ print(' if(data.privateData == 0) // new entry')
++ print(' {')
++ print(' data.privateData = alloc_dma_buffer(size, (uintptr_t*)&data.logical, &data.physical);')
++ print(' data.index = pindex;')
++ print(' data.size = size;')
++ print(' retrace::addRegion(call,data.index,data.logical,size);')
++ print(' }')
++ print(' else // already have one; check size and index')
++ print(' {')
++ print(' if((size!=data.size)||(pindex!=data.index))')
++ print(' {')
++ print(' retrace::delRegionByPointer(data.logical);')
++ print(' free_dma_buffer(data.privateData);')
++ print(' data.privateData = alloc_dma_buffer(size, (uintptr_t*)&data.logical, &data.physical);')
++ print(' data.index = pindex;')
++ print(' data.size = size;')
++ print(' retrace::addRegion(call,data.index,data.logical,size);')
++ print(' }')
++ print(' }')
++ print(' *Logical = data.logical;')
++ print(' *Physical = data.physical;')
++ print(' }')
++ print('#endif /* HAVE_VIVANTE_G2D */')
+ # Infer the drawable size from GL calls
+ if function.name == "glViewport":
+- print ' glretrace::updateDrawable(x + width, y + height);'
++ print(' glretrace::updateDrawable(x + width, y + height);')
+ if function.name == "glViewportArray":
+ # We are concerned about drawables so only care for the first viewport
+- print ' if (first == 0 && count > 0) {'
+- print ' GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
+- print ' glretrace::updateDrawable(x + w, y + h);'
+- print ' }'
++ print(' if (first == 0 && count > 0) {')
++ print(' GLfloat x = v[0], y = v[1], w = v[2], h = v[3];')
++ print(' glretrace::updateDrawable(x + w, y + h);')
++ print(' }')
+ if function.name == "glViewportIndexedf":
+- print ' if (index == 0) {'
+- print ' glretrace::updateDrawable(x + w, y + h);'
+- print ' }'
++ print(' if (index == 0) {')
++ print(' glretrace::updateDrawable(x + w, y + h);')
++ print(' }')
+ if function.name == "glViewportIndexedfv":
+- print ' if (index == 0) {'
+- print ' GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
+- print ' glretrace::updateDrawable(x + w, y + h);'
+- print ' }'
++ print(' if (index == 0) {')
++ print(' GLfloat x = v[0], y = v[1], w = v[2], h = v[3];')
++ print(' glretrace::updateDrawable(x + w, y + h);')
++ print(' }')
+ if function.name in ('glBlitFramebuffer', 'glBlitFramebufferEXT'):
+ # Some applications do all their rendering in a framebuffer, and
+ # then just blit to the drawable without ever calling glViewport.
+- print ' glretrace::updateDrawable(std::max(dstX0, dstX1), std::max(dstY0, dstY1));'
++ print(' glretrace::updateDrawable(std::max(dstX0, dstX1), std::max(dstY0, dstY1));')
+
+ if function.name.startswith('gl') and not function.name.startswith('glX'):
+ # The Windows OpenGL runtime will skip calls when there's no
+ # context bound to the current context, but this might cause
+ # crashes on other systems, particularly with NVIDIA Linux drivers.
+- print r' glretrace::Context *currentContext = glretrace::getCurrentContext();'
+- print r' if (!currentContext) {'
+- print r' if (retrace::debug) {'
+- print r' retrace::warning(call) << "no current context\n";'
+- print r' }'
+- print r'#ifndef _WIN32'
+- print r' return;'
+- print r'#endif'
+- print r' }'
++ print(r' glretrace::Context *currentContext = glretrace::getCurrentContext();')
++ print(r' if (!currentContext) {')
++ print(r' if (retrace::debug) {')
++ print(r' retrace::warning(call) << "no current context\n";')
++ print(r' }')
++ print(r'#ifndef _WIN32')
++ print(r' return;')
++ print(r'#endif')
++ print(r' }')
+
+ if function.name == "glEnd":
+- print r' if (currentContext) {'
+- print r' currentContext->insideBeginEnd = false;'
+- print r' }'
++ print(r' if (currentContext) {')
++ print(r' currentContext->insideBeginEnd = false;')
++ print(r' }')
+
+ if function.name == 'memcpy':
+- print ' if (!dest || !src || !n) return;'
++ print(' if (!dest || !src || !n) return;')
+
+ # Skip glEnable/Disable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB) as we don't
+ # faithfully set the CONTEXT_DEBUG_BIT_ARB flags on context creation.
+ if function.name in ('glEnable', 'glDisable'):
+- print ' if (cap == GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB) return;'
++ print(' if (cap == GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB) return;')
+
+ # Destroy the buffer mapping
+ if self.unmap_function_regex.match(function.name):
+- print r' GLvoid *ptr = NULL;'
++ print(r' GLvoid *ptr = NULL;')
+ if function.name == 'glUnmapBuffer':
+- print r' glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &ptr);'
++ print(r' glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &ptr);')
+ elif function.name == 'glUnmapBufferARB':
+- print r' glGetBufferPointervARB(target, GL_BUFFER_MAP_POINTER_ARB, &ptr);'
++ print(r' glGetBufferPointervARB(target, GL_BUFFER_MAP_POINTER_ARB, &ptr);')
+ elif function.name == 'glUnmapBufferOES':
+- print r' glGetBufferPointervOES(target, GL_BUFFER_MAP_POINTER_OES, &ptr);'
++ print(r' glGetBufferPointervOES(target, GL_BUFFER_MAP_POINTER_OES, &ptr);')
+ elif function.name == 'glUnmapNamedBuffer':
+- print r' glGetNamedBufferPointerv(buffer, GL_BUFFER_MAP_POINTER, &ptr);'
++ print(r' glGetNamedBufferPointerv(buffer, GL_BUFFER_MAP_POINTER, &ptr);')
+ elif function.name == 'glUnmapNamedBufferEXT':
+- print r' glGetNamedBufferPointervEXT(buffer, GL_BUFFER_MAP_POINTER, &ptr);'
++ print(r' glGetNamedBufferPointervEXT(buffer, GL_BUFFER_MAP_POINTER, &ptr);')
+ elif function.name == 'glUnmapObjectBufferATI':
+ # TODO
+ pass
+ else:
+ assert False
+- print r' if (ptr) {'
+- print r' retrace::delRegionByPointer(ptr);'
+- print r' } else {'
+- print r' retrace::warning(call) << "failed to get mapped pointer\n";'
+- print r' }'
++ print(r' if (ptr) {')
++ print(r' retrace::delRegionByPointer(ptr);')
++ print(r' } else {')
++ print(r' retrace::warning(call) << "failed to get mapped pointer\n";')
++ print(r' }')
+
+ if function.name in ('glBindProgramPipeline', 'glBindProgramPipelineEXT'):
+ # Note if glBindProgramPipeline has ever been called
+- print r' if (pipeline) {'
+- print r' _pipelineHasBeenBound = true;'
+- print r' }'
++ print(r' if (pipeline) {')
++ print(r' _pipelineHasBeenBound = true;')
++ print(r' }')
+
+ is_draw_arrays = self.draw_arrays_function_regex.match(function.name) is not None
+ is_draw_elements = self.draw_elements_function_regex.match(function.name) is not None
+@@ -325,240 +325,240 @@ class GlRetracer(Retracer):
+
+ # Keep track of active program for call lists
+ if function.name in ('glUseProgram', 'glUseProgramObjectARB'):
+- print r' if (currentContext) {'
+- print r' currentContext->activeProgram = call.arg(0).toUInt();'
+- print r' }'
++ print(r' if (currentContext) {')
++ print(r' currentContext->activeProgram = call.arg(0).toUInt();')
++ print(r' }')
+
+ # Only profile if not inside a list as the queries get inserted into list
+ if function.name == 'glNewList':
+- print r' if (currentContext) {'
+- print r' currentContext->insideList = true;'
+- print r' }'
++ print(r' if (currentContext) {')
++ print(r' currentContext->insideList = true;')
++ print(r' }')
+
+ if function.name == 'glEndList':
+- print r' if (currentContext) {'
+- print r' currentContext->insideList = false;'
+- print r' }'
++ print(r' if (currentContext) {')
++ print(r' currentContext->insideList = false;')
++ print(r' }')
+
+ if function.name == 'glBegin' or \
+ is_draw_arrays or \
+ is_draw_elements or \
+ function.name.startswith('glBeginTransformFeedback'):
+- print r' if (retrace::debug) {'
+- print r' _validateActiveProgram(call);'
+- print r' }'
++ print(r' if (retrace::debug) {')
++ print(r' _validateActiveProgram(call);')
++ print(r' }')
+
+ if function.name != 'glEnd':
+- print r' if (currentContext && !currentContext->insideList && !currentContext->insideBeginEnd && retrace::profiling) {'
++ print(r' if (currentContext && !currentContext->insideList && !currentContext->insideBeginEnd && retrace::profiling) {')
+ if profileDraw:
+- print r' glretrace::beginProfile(call, true);'
++ print(r' glretrace::beginProfile(call, true);')
+ else:
+- print r' glretrace::beginProfile(call, false);'
+- print r' }'
++ print(r' glretrace::beginProfile(call, false);')
++ print(r' }')
+
+ if function.name in ('glCreateShaderProgramv', 'glCreateShaderProgramEXT', 'glCreateShaderProgramvEXT'):
+ # When dumping state, break down glCreateShaderProgram* so that the
+ # shader source can be recovered.
+- print r' if (retrace::dumpingState) {'
+- print r' GLuint _shader = glCreateShader(type);'
+- print r' if (_shader) {'
++ print(r' if (retrace::dumpingState) {')
++ print(r' GLuint _shader = glCreateShader(type);')
++ print(r' if (_shader) {')
+ if not function.name.startswith('glCreateShaderProgramv'):
+- print r' GLsizei count = 1;'
+- print r' const GLchar **strings = &string;'
+- print r' glShaderSource(_shader, count, strings, NULL);'
+- print r' glCompileShader(_shader);'
+- print r' const GLuint _program = glCreateProgram();'
+- print r' if (_program) {'
+- print r' GLint compiled = GL_FALSE;'
+- print r' glGetShaderiv(_shader, GL_COMPILE_STATUS, &compiled);'
++ print(r' GLsizei count = 1;')
++ print(r' const GLchar **strings = &string;')
++ print(r' glShaderSource(_shader, count, strings, NULL);')
++ print(r' glCompileShader(_shader);')
++ print(r' const GLuint _program = glCreateProgram();')
++ print(r' if (_program) {')
++ print(r' GLint compiled = GL_FALSE;')
++ print(r' glGetShaderiv(_shader, GL_COMPILE_STATUS, &compiled);')
+ if function.name == 'glCreateShaderProgramvEXT':
+- print r' glProgramParameteriEXT(_program, GL_PROGRAM_SEPARABLE, GL_TRUE);'
++ print(r' glProgramParameteriEXT(_program, GL_PROGRAM_SEPARABLE, GL_TRUE);')
+ else:
+- print r' glProgramParameteri(_program, GL_PROGRAM_SEPARABLE, GL_TRUE);'
+- print r' if (compiled) {'
+- print r' glAttachShader(_program, _shader);'
+- print r' glLinkProgram(_program);'
+- print r' if (false) glDetachShader(_program, _shader);'
+- print r' }'
+- print r' // TODO: append shader info log to program info log'
+- print r' }'
+- print r' glDeleteShader(_shader);'
+- print r' _result = _program;'
+- print r' } else {'
+- print r' _result = 0;'
+- print r' }'
+- print r' } else {'
++ print(r' glProgramParameteri(_program, GL_PROGRAM_SEPARABLE, GL_TRUE);')
++ print(r' if (compiled) {')
++ print(r' glAttachShader(_program, _shader);')
++ print(r' glLinkProgram(_program);')
++ print(r' if (false) glDetachShader(_program, _shader);')
++ print(r' }')
++ print(r' // TODO: append shader info log to program info log')
++ print(r' }')
++ print(r' glDeleteShader(_shader);')
++ print(r' _result = _program;')
++ print(r' } else {')
++ print(r' _result = 0;')
++ print(r' }')
++ print(r' } else {')
+ Retracer.invokeFunction(self, function)
+- print r' }'
++ print(r' }')
+ elif function.name in ('glDetachShader', 'glDetachObjectARB'):
+- print r' if (!retrace::dumpingState) {'
++ print(r' if (!retrace::dumpingState) {')
+ Retracer.invokeFunction(self, function)
+- print r' }'
++ print(r' }')
+ elif function.name == 'glClientWaitSync':
+- print r' _result = glretrace::clientWaitSync(call, sync, flags, timeout);'
+- print r' (void)_result;'
++ print(r' _result = glretrace::clientWaitSync(call, sync, flags, timeout);')
++ print(r' (void)_result;')
+ elif function.name == 'glGetSynciv':
+- print r' if (pname == GL_SYNC_STATUS &&'
+- print r' bufSize >= 1 &&'
+- print r' values != NULL &&'
+- print r' call.arg(4)[0].toSInt() == GL_SIGNALED) {'
+- print r' // Fence was signalled, so ensure it happened here'
+- print r' glretrace::blockOnFence(call, sync, GL_SYNC_FLUSH_COMMANDS_BIT);'
+- print r' (void)length;'
+- print r' }'
++ print(r' if (pname == GL_SYNC_STATUS &&')
++ print(r' bufSize >= 1 &&')
++ print(r' values != NULL &&')
++ print(r' call.arg(4)[0].toSInt() == GL_SIGNALED) {')
++ print(r' // Fence was signalled, so ensure it happened here')
++ print(r' glretrace::blockOnFence(call, sync, GL_SYNC_FLUSH_COMMANDS_BIT);')
++ print(r' (void)length;')
++ print(r' }')
+ else:
+ Retracer.invokeFunction(self, function)
+
+ if function.name == "glBegin":
+- print ' if (currentContext) {'
+- print ' currentContext->insideBeginEnd = true;'
+- print ' }'
++ print(' if (currentContext) {')
++ print(' currentContext->insideBeginEnd = true;')
++ print(' }')
+
+ if function.name == "glTexDirectVIV":
+- print '#if defined(HAVE_VIVANTE_G2D)'
+- print ' int32_t ysize = 0;'
+- print ' int32_t usize = 0;'
+- print ' int32_t vsize = 0;'
+- print ' switch(format){'
+- print ' case GL_VIV_YV12:'
+- print ' case GL_VIV_I420:'
+- print ' ysize=width * height;'
+- print ' usize=ysize/4;'
+- print ' vsize=usize;'
+- print ' break;'
+- print ' case GL_VIV_NV12:'
+- print ' case GL_VIV_NV21:'
+- print ' ysize=width * height;'
+- print ' usize=ysize/2;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' case GL_RGBA:'
+- print ' case GL_BGRA_EXT:'
+- print ' ysize=width * height *4;'
+- print ' usize=0;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' case GL_RGB:'
+- print ' ysize=width * height *3;'
+- print ' usize=0;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' case GL_VIV_YUY2:'
+- print ' case GL_VIV_UYVY:'
+- print ' case GL_RGB565_OES:'
+- print ' ysize=width * height *2;'
+- print ' usize=0;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' default:'
+- print ' break;'
+- print ' }'
+- print ' const trace::Array * arrayGLvoid = (call.arg(4)).toArray();'
+- print ' if(ysize > 0)'
+- print ' retrace::addRegion(call,(*arrayGLvoid->values[0]).toUInt(),(GLvoid*)pixels[0], ysize);'
+- print ' if(usize > 0)'
+- print ' retrace::addRegion(call,(*arrayGLvoid->values[1]).toUInt(),(GLvoid*)pixels[1], usize);'
+- print ' if(vsize > 0)'
+- print ' retrace::addRegion(call,(*arrayGLvoid->values[2]).toUInt(),(GLvoid*)pixels[2], vsize);'
+- print '#endif /* HAVE_VIVANTE_G2D */'
+-
+- print r' if (currentContext && !currentContext->insideList && !currentContext->insideBeginEnd && retrace::profiling) {'
++ print('#if defined(HAVE_VIVANTE_G2D)')
++ print(' int32_t ysize = 0;')
++ print(' int32_t usize = 0;')
++ print(' int32_t vsize = 0;')
++ print(' switch(format){')
++ print(' case GL_VIV_YV12:')
++ print(' case GL_VIV_I420:')
++ print(' ysize=width * height;')
++ print(' usize=ysize/4;')
++ print(' vsize=usize;')
++ print(' break;')
++ print(' case GL_VIV_NV12:')
++ print(' case GL_VIV_NV21:')
++ print(' ysize=width * height;')
++ print(' usize=ysize/2;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' case GL_RGBA:')
++ print(' case GL_BGRA_EXT:')
++ print(' ysize=width * height *4;')
++ print(' usize=0;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' case GL_RGB:')
++ print(' ysize=width * height *3;')
++ print(' usize=0;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' case GL_VIV_YUY2:')
++ print(' case GL_VIV_UYVY:')
++ print(' case GL_RGB565_OES:')
++ print(' ysize=width * height *2;')
++ print(' usize=0;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' default:')
++ print(' break;')
++ print(' }')
++ print(' const trace::Array * arrayGLvoid = (call.arg(4)).toArray();')
++ print(' if(ysize > 0)')
++ print(' retrace::addRegion(call,(*arrayGLvoid->values[0]).toUInt(),(GLvoid*)pixels[0], ysize);')
++ print(' if(usize > 0)')
++ print(' retrace::addRegion(call,(*arrayGLvoid->values[1]).toUInt(),(GLvoid*)pixels[1], usize);')
++ print(' if(vsize > 0)')
++ print(' retrace::addRegion(call,(*arrayGLvoid->values[2]).toUInt(),(GLvoid*)pixels[2], vsize);')
++ print('#endif /* HAVE_VIVANTE_G2D */')
++
++ print(r' if (currentContext && !currentContext->insideList && !currentContext->insideBeginEnd && retrace::profiling) {')
+ if profileDraw:
+- print r' glretrace::endProfile(call, true);'
++ print(r' glretrace::endProfile(call, true);')
+ else:
+- print r' glretrace::endProfile(call, false);'
+- print r' }'
++ print(r' glretrace::endProfile(call, false);')
++ print(r' }')
+
+ # Error checking
+ if function.name.startswith('gl'):
+ # glGetError is not allowed inside glBegin/glEnd
+- print ' if (retrace::debug && currentContext && !currentContext->insideBeginEnd) {'
+- print ' glretrace::checkGlError(call);'
++ print(' if (retrace::debug && currentContext && !currentContext->insideBeginEnd) {')
++ print(' glretrace::checkGlError(call);')
+ if function.name in ('glProgramStringARB', 'glLoadProgramNV'):
+- print r' GLint error_position = -1;'
+- print r' glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &error_position);'
+- print r' if (error_position != -1) {'
+- print r' const char *error_string = (const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB);'
+- print r' retrace::warning(call) << "error in position " << error_position << ": " << error_string << "\n";'
+- print r' }'
++ print(r' GLint error_position = -1;')
++ print(r' glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &error_position);')
++ print(r' if (error_position != -1) {')
++ print(r' const char *error_string = (const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB);')
++ print(r' retrace::warning(call) << "error in position " << error_position << ": " << error_string << "\n";')
++ print(r' }')
+ if function.name == 'glCompileShader':
+- print r' GLint compile_status = 0;'
+- print r' glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status);'
+- print r' if (!compile_status) {'
+- print r' retrace::warning(call) << "compilation failed\n";'
+- print r' }'
+- print r' GLint info_log_length = 0;'
+- print r' glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &info_log_length);'
+- print r' if (info_log_length > 1) {'
+- print r' GLchar *infoLog = new GLchar[info_log_length];'
+- print r' glGetShaderInfoLog(shader, info_log_length, NULL, infoLog);'
+- print r' retrace::warning(call) << infoLog << "\n";'
+- print r' delete [] infoLog;'
+- print r' }'
++ print(r' GLint compile_status = 0;')
++ print(r' glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status);')
++ print(r' if (!compile_status) {')
++ print(r' retrace::warning(call) << "compilation failed\n";')
++ print(r' }')
++ print(r' GLint info_log_length = 0;')
++ print(r' glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &info_log_length);')
++ print(r' if (info_log_length > 1) {')
++ print(r' GLchar *infoLog = new GLchar[info_log_length];')
++ print(r' glGetShaderInfoLog(shader, info_log_length, NULL, infoLog);')
++ print(r' retrace::warning(call) << infoLog << "\n";')
++ print(r' delete [] infoLog;')
++ print(r' }')
+ if function.name in ('glLinkProgram', 'glCreateShaderProgramv', 'glCreateShaderProgramEXT', 'glCreateShaderProgramvEXT', 'glProgramBinary', 'glProgramBinaryOES'):
+ if function.name.startswith('glCreateShaderProgram'):
+- print r' GLuint program = _result;'
+- print r' GLint link_status = 0;'
+- print r' glGetProgramiv(program, GL_LINK_STATUS, &link_status);'
+- print r' if (!link_status) {'
+- print r' retrace::warning(call) << "link failed\n";'
+- print r' }'
+- print r' GLint info_log_length = 0;'
+- print r' glGetProgramiv(program, GL_INFO_LOG_LENGTH, &info_log_length);'
+- print r' if (info_log_length > 1) {'
+- print r' GLchar *infoLog = new GLchar[info_log_length];'
+- print r' glGetProgramInfoLog(program, info_log_length, NULL, infoLog);'
+- print r' retrace::warning(call) << infoLog << "\n";'
+- print r' delete [] infoLog;'
+- print r' }'
++ print(r' GLuint program = _result;')
++ print(r' GLint link_status = 0;')
++ print(r' glGetProgramiv(program, GL_LINK_STATUS, &link_status);')
++ print(r' if (!link_status) {')
++ print(r' retrace::warning(call) << "link failed\n";')
++ print(r' }')
++ print(r' GLint info_log_length = 0;')
++ print(r' glGetProgramiv(program, GL_INFO_LOG_LENGTH, &info_log_length);')
++ print(r' if (info_log_length > 1) {')
++ print(r' GLchar *infoLog = new GLchar[info_log_length];')
++ print(r' glGetProgramInfoLog(program, info_log_length, NULL, infoLog);')
++ print(r' retrace::warning(call) << infoLog << "\n";')
++ print(r' delete [] infoLog;')
++ print(r' }')
+ if function.name == 'glCompileShaderARB':
+- print r' GLint compile_status = 0;'
+- print r' glGetObjectParameterivARB(shaderObj, GL_OBJECT_COMPILE_STATUS_ARB, &compile_status);'
+- print r' if (!compile_status) {'
+- print r' retrace::warning(call) << "compilation failed\n";'
+- print r' }'
+- print r' GLint info_log_length = 0;'
+- print r' glGetObjectParameterivARB(shaderObj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_log_length);'
+- print r' if (info_log_length > 1) {'
+- print r' GLchar *infoLog = new GLchar[info_log_length];'
+- print r' glGetInfoLogARB(shaderObj, info_log_length, NULL, infoLog);'
+- print r' retrace::warning(call) << infoLog << "\n";'
+- print r' delete [] infoLog;'
+- print r' }'
++ print(r' GLint compile_status = 0;')
++ print(r' glGetObjectParameterivARB(shaderObj, GL_OBJECT_COMPILE_STATUS_ARB, &compile_status);')
++ print(r' if (!compile_status) {')
++ print(r' retrace::warning(call) << "compilation failed\n";')
++ print(r' }')
++ print(r' GLint info_log_length = 0;')
++ print(r' glGetObjectParameterivARB(shaderObj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_log_length);')
++ print(r' if (info_log_length > 1) {')
++ print(r' GLchar *infoLog = new GLchar[info_log_length];')
++ print(r' glGetInfoLogARB(shaderObj, info_log_length, NULL, infoLog);')
++ print(r' retrace::warning(call) << infoLog << "\n";')
++ print(r' delete [] infoLog;')
++ print(r' }')
+ if function.name == 'glLinkProgramARB':
+- print r' GLint link_status = 0;'
+- print r' glGetObjectParameterivARB(programObj, GL_OBJECT_LINK_STATUS_ARB, &link_status);'
+- print r' if (!link_status) {'
+- print r' retrace::warning(call) << "link failed\n";'
+- print r' }'
+- print r' GLint info_log_length = 0;'
+- print r' glGetObjectParameterivARB(programObj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_log_length);'
+- print r' if (info_log_length > 1) {'
+- print r' GLchar *infoLog = new GLchar[info_log_length];'
+- print r' glGetInfoLogARB(programObj, info_log_length, NULL, infoLog);'
+- print r' retrace::warning(call) << infoLog << "\n";'
+- print r' delete [] infoLog;'
+- print r' }'
++ print(r' GLint link_status = 0;')
++ print(r' glGetObjectParameterivARB(programObj, GL_OBJECT_LINK_STATUS_ARB, &link_status);')
++ print(r' if (!link_status) {')
++ print(r' retrace::warning(call) << "link failed\n";')
++ print(r' }')
++ print(r' GLint info_log_length = 0;')
++ print(r' glGetObjectParameterivARB(programObj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &info_log_length);')
++ print(r' if (info_log_length > 1) {')
++ print(r' GLchar *infoLog = new GLchar[info_log_length];')
++ print(r' glGetInfoLogARB(programObj, info_log_length, NULL, infoLog);')
++ print(r' retrace::warning(call) << infoLog << "\n";')
++ print(r' delete [] infoLog;')
++ print(r' }')
+ if self.map_function_regex.match(function.name):
+- print r' if (!_result) {'
+- print r' retrace::warning(call) << "failed to map buffer\n";'
+- print r' }'
++ print(r' if (!_result) {')
++ print(r' retrace::warning(call) << "failed to map buffer\n";')
++ print(r' }')
+ if self.unmap_function_regex.match(function.name) and function.type is not stdapi.Void:
+- print r' if (!_result) {'
+- print r' retrace::warning(call) << "failed to unmap buffer\n";'
+- print r' }'
++ print(r' if (!_result) {')
++ print(r' retrace::warning(call) << "failed to unmap buffer\n";')
++ print(r' }')
+ if function.name in ('glGetAttribLocation', 'glGetAttribLocationARB'):
+- print r' GLint _origResult = call.ret->toSInt();'
+- print r' if (_result != _origResult) {'
+- print r' retrace::warning(call) << "vertex attrib location mismatch " << _origResult << " -> " << _result << "\n";'
+- print r' }'
++ print(r' GLint _origResult = call.ret->toSInt();')
++ print(r' if (_result != _origResult) {')
++ print(r' retrace::warning(call) << "vertex attrib location mismatch " << _origResult << " -> " << _result << "\n";')
++ print(r' }')
+ if function.name in ('glCheckFramebufferStatus', 'glCheckFramebufferStatusEXT', 'glCheckNamedFramebufferStatus', 'glCheckNamedFramebufferStatusEXT'):
+- print r' GLint _origResult = call.ret->toSInt();'
+- print r' if (_origResult == GL_FRAMEBUFFER_COMPLETE &&'
+- print r' _result != GL_FRAMEBUFFER_COMPLETE) {'
+- print r' retrace::warning(call) << "incomplete framebuffer (" << glstate::enumToString(_result) << ")\n";'
+- print r' }'
+- print ' }'
++ print(r' GLint _origResult = call.ret->toSInt();')
++ print(r' if (_origResult == GL_FRAMEBUFFER_COMPLETE &&')
++ print(r' _result != GL_FRAMEBUFFER_COMPLETE) {')
++ print(r' retrace::warning(call) << "incomplete framebuffer (" << glstate::enumToString(_result) << ")\n";')
++ print(r' }')
++ print(' }')
+
+ # Query the buffer length for whole buffer mappings
+ if self.map_function_regex.match(function.name):
+@@ -566,23 +566,23 @@ class GlRetracer(Retracer):
+ assert 'BufferRange' in function.name
+ else:
+ assert 'BufferRange' not in function.name
+- print r' GLint length = 0;'
++ print(r' GLint length = 0;')
+ if function.name in ('glMapBuffer', 'glMapBufferOES'):
+- print r' glGetBufferParameteriv(target, GL_BUFFER_SIZE, &length);'
++ print(r' glGetBufferParameteriv(target, GL_BUFFER_SIZE, &length);')
+ elif function.name == 'glMapBufferARB':
+- print r' glGetBufferParameterivARB(target, GL_BUFFER_SIZE_ARB, &length);'
++ print(r' glGetBufferParameterivARB(target, GL_BUFFER_SIZE_ARB, &length);')
+ elif function.name == 'glMapNamedBuffer':
+- print r' glGetNamedBufferParameteriv(buffer, GL_BUFFER_SIZE, &length);'
++ print(r' glGetNamedBufferParameteriv(buffer, GL_BUFFER_SIZE, &length);')
+ elif function.name == 'glMapNamedBufferEXT':
+- print r' glGetNamedBufferParameterivEXT(buffer, GL_BUFFER_SIZE, &length);'
++ print(r' glGetNamedBufferParameterivEXT(buffer, GL_BUFFER_SIZE, &length);')
+ elif function.name == 'glMapObjectBufferATI':
+- print r' glGetObjectBufferivATI(buffer, GL_OBJECT_BUFFER_SIZE_ATI, &length);'
++ print(r' glGetObjectBufferivATI(buffer, GL_OBJECT_BUFFER_SIZE_ATI, &length);')
+ else:
+ assert False
+
+ def extractArg(self, function, arg, arg_type, lvalue, rvalue):
+ if function.name in self.array_pointer_function_names and arg.name == 'pointer':
+- print ' %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
++ print(' %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue))
+ return
+
+ if self.draw_elements_function_regex.match(function.name) and arg.name == 'indices' or\
+@@ -594,18 +594,18 @@ class GlRetracer(Retracer):
+ # object.
+ if self.pack_function_regex.match(function.name) and arg.output:
+ assert isinstance(arg_type, (stdapi.Pointer, stdapi.Array, stdapi.Blob, stdapi.Opaque))
+- print ' %s = static_cast<%s>((%s).toPointer());' % (lvalue, arg_type, rvalue)
++ print(' %s = static_cast<%s>((%s).toPointer());' % (lvalue, arg_type, rvalue))
+ return
+
+ if (arg.type.depends(glapi.GLlocation) or \
+ arg.type.depends(glapi.GLsubroutine)) \
+ and 'program' not in function.argNames():
+ # Determine the active program for uniforms swizzling
+- print ' GLint program = _getActiveProgram();'
++ print(' GLint program = _getActiveProgram();')
+
+ if arg.type is glapi.GLlocationARB \
+ and 'programObj' not in function.argNames():
+- print ' GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'
++ print(' GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);')
+
+ Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
+
+@@ -613,28 +613,28 @@ class GlRetracer(Retracer):
+ if arg.name == 'samples':
+ if function.name == 'glRasterSamplesEXT':
+ assert arg.type is glapi.GLuint
+- print ' GLint max_samples = 0;'
+- print ' glGetIntegerv(GL_MAX_RASTER_SAMPLES_EXT, &max_samples);'
+- print ' if (samples > static_cast<GLuint>(max_samples)) {'
+- print ' samples = static_cast<GLuint>(max_samples);'
+- print ' }'
++ print(' GLint max_samples = 0;')
++ print(' glGetIntegerv(GL_MAX_RASTER_SAMPLES_EXT, &max_samples);')
++ print(' if (samples > static_cast<GLuint>(max_samples)) {')
++ print(' samples = static_cast<GLuint>(max_samples);')
++ print(' }')
+ else:
+ assert arg.type is glapi.GLsizei
+- print ' GLint max_samples = 0;'
+- print ' glGetIntegerv(GL_MAX_SAMPLES, &max_samples);'
+- print ' if (samples > max_samples) {'
+- print ' samples = max_samples;'
+- print ' }'
++ print(' GLint max_samples = 0;')
++ print(' glGetIntegerv(GL_MAX_SAMPLES, &max_samples);')
++ print(' if (samples > max_samples) {')
++ print(' samples = max_samples;')
++ print(' }')
+
+ # These parameters are referred beyond the call life-time
+ # TODO: Replace ad-hoc solution for bindable parameters with general one
+ if function.name in ('glFeedbackBuffer', 'glSelectBuffer') and arg.output:
+- print ' _allocator.bind(%s);' % arg.name
++ print(' _allocator.bind(%s);' % arg.name)
+
+
+
+ if __name__ == '__main__':
+- print r'''
++ print(r'''
+ #include <string.h>
+
+ #include "glproc.hpp"
+@@ -692,13 +692,13 @@ static void free_dma_buffer(void *buf)
+
+ #endif /* HAVE_VIVANTE_G2D */
+
+-'''
++''')
+ api = stdapi.API()
+ api.addModule(glapi.glapi)
+ retracer = GlRetracer()
+ retracer.retraceApi(api)
+
+- print r'''
++ print(r'''
+ static GLint
+ _getActiveProgram(void)
+ {
+@@ -771,4 +771,4 @@ _validateActiveProgram(trace::Call &call)
+ }
+ }
+
+-'''
++''')
+diff --git a/retrace/glstate_params.py b/retrace/glstate_params.py
+index fb49ff9a..bc90f66b 100755
+--- a/retrace/glstate_params.py
++++ b/retrace/glstate_params.py
+@@ -134,17 +134,17 @@ class StateGetter(Visitor):
+ elem_type = self.inflector.reduced_type(type)
+ inflection = self.inflector.inflect(type)
+ if inflection.endswith('v' + self.inflector.suffix):
+- print ' %s %s = 0;' % (elem_type, temp_name)
+- print ' %s(%s, &%s);' % (inflection, ', '.join(args), temp_name)
++ print(' %s %s = 0;' % (elem_type, temp_name))
++ print(' %s(%s, &%s);' % (inflection, ', '.join(args), temp_name))
+ else:
+- print ' %s %s = %s(%s);' % (elem_type, temp_name, inflection, ', '.join(args))
++ print(' %s %s = %s(%s);' % (elem_type, temp_name, inflection, ', '.join(args)))
+ return temp_name
+
+ def visitString(self, string, args):
+ temp_name = self.temp_name(args)
+ inflection = self.inflector.inflect(string)
+ assert not inflection.endswith('v' + self.inflector.suffix)
+- print ' %s %s = (%s)%s(%s);' % (string, temp_name, string, inflection, ', '.join(args))
++ print(' %s %s = (%s)%s(%s);' % (string, temp_name, string, inflection, ', '.join(args)))
+ return temp_name
+
+ def visitAlias(self, alias, args):
+@@ -166,28 +166,28 @@ class StateGetter(Visitor):
+ array_length = array.length
+ if isinstance(array_length, int):
+ # Static integer length
+- print ' %s %s[%s + 1];' % (elem_type, temp_name, array_length)
++ print(' %s %s[%s + 1];' % (elem_type, temp_name, array_length))
+ else:
+ # Put the length in a variable to avoid recomputing it every time
+- print ' size_t _%s_length = %s;' % (temp_name, array_length)
++ print(' size_t _%s_length = %s;' % (temp_name, array_length))
+ array_length = '_%s_length' % temp_name
+ # Allocate a dynamic sized array
+- print ' %s *%s = _allocator.alloc<%s>(%s + 1);' % (elem_type, temp_name, elem_type, array_length)
+- print ' memset(%s, 0, %s * sizeof *%s);' % (temp_name, array_length, temp_name)
+- print ' %s[%s] = (%s)0xdeadc0de;' % (temp_name, array_length, elem_type)
+- print ' if (%s) {' % array_length
+- print ' %s(%s, %s);' % (inflection, ', '.join(args), temp_name)
+- print ' }'
++ print(' %s *%s = _allocator.alloc<%s>(%s + 1);' % (elem_type, temp_name, elem_type, array_length))
++ print(' memset(%s, 0, %s * sizeof *%s);' % (temp_name, array_length, temp_name))
++ print(' %s[%s] = (%s)0xdeadc0de;' % (temp_name, array_length, elem_type))
++ print(' if (%s) {' % array_length)
++ print(' %s(%s, %s);' % (inflection, ', '.join(args), temp_name))
++ print(' }')
+ # Simple buffer overflow detection
+- print ' assert(%s[%s] == (%s)0xdeadc0de);' % (temp_name, array_length, elem_type)
++ print(' assert(%s[%s] == (%s)0xdeadc0de);' % (temp_name, array_length, elem_type))
+ return temp_name
+
+ def visitOpaque(self, pointer, args):
+ temp_name = self.temp_name(args)
+ inflection = self.inflector.inflect(pointer)
+ assert inflection.endswith('v' + self.inflector.suffix)
+- print ' GLvoid *%s;' % temp_name
+- print ' %s(%s, &%s);' % (inflection, ', '.join(args), temp_name)
++ print(' GLvoid *%s;' % temp_name)
++ print(' %s(%s, &%s);' % (inflection, ', '.join(args), temp_name))
+ return temp_name
+
+
+@@ -236,26 +236,26 @@ class JsonWriter(Visitor):
+
+ def visitLiteral(self, literal, instance):
+ if literal.kind == 'Bool':
+- print ' writer.writeBool(%s);' % instance
++ print(' writer.writeBool(%s);' % instance)
+ elif literal.kind in ('SInt', 'Uint'):
+- print ' writer.writeInt(%s);' % instance
++ print(' writer.writeInt(%s);' % instance)
+ elif literal.kind in ('Float', 'Double'):
+- print ' writer.writeFloat(%s);' % instance
++ print(' writer.writeFloat(%s);' % instance)
+ else:
+ raise NotImplementedError
+
+ def visitString(self, string, instance):
+ assert string.length is None
+- print ' writer.writeString((const char *)%s);' % instance
++ print(' writer.writeString((const char *)%s);' % instance)
+
+ def visitEnum(self, enum, instance):
+ if enum is GLboolean:
+- print ' dumpBoolean(writer, %s);' % instance
++ print(' dumpBoolean(writer, %s);' % instance)
+ elif enum is GLenum:
+- print ' dumpEnum(writer, %s);' % instance
++ print(' dumpEnum(writer, %s);' % instance)
+ else:
+ assert False
+- print ' writer.writeInt(%s);' % instance
++ print(' writer.writeInt(%s);' % instance)
+
+ def visitBitmask(self, bitmask, instance):
+ raise NotImplementedError
+@@ -264,18 +264,18 @@ class JsonWriter(Visitor):
+ self.visit(alias.type, instance)
+
+ def visitOpaque(self, opaque, instance):
+- print ' writer.writeInt((size_t)%s);' % instance
++ print(' writer.writeInt((size_t)%s);' % instance)
+
+ __index = 0
+
+ def visitArray(self, array, instance):
+ index = '_i%u' % JsonWriter.__index
+ JsonWriter.__index += 1
+- print ' writer.beginArray();'
+- print ' for (unsigned %s = 0; %s < %s; ++%s) {' % (index, index, array.length, index)
++ print(' writer.beginArray();')
++ print(' for (unsigned %s = 0; %s < %s; ++%s) {' % (index, index, array.length, index))
+ self.visit(array.type, '%s[%s]' % (instance, index))
+- print ' }'
+- print ' writer.endArray();'
++ print(' }')
++ print(' writer.endArray();')
+
+
+
+@@ -287,75 +287,75 @@ class StateDumper:
+ pass
+
+ def dump(self):
+- print '#include <assert.h>'
+- print '#include <string.h>'
+- print
+- print '#include "state_writer.hpp"'
+- print '#include "scoped_allocator.hpp"'
+- print '#include "glproc.hpp"'
+- print '#include "glsize.hpp"'
+- print '#include "glstate.hpp"'
+- print '#include "glstate_internal.hpp"'
+- print
+- print 'namespace glstate {'
+- print
+-
+- print 'const char *'
+- print 'enumToString(GLenum pname)'
+- print '{'
+- print ' switch (pname) {'
++ print('#include <assert.h>')
++ print('#include <string.h>')
++ print()
++ print('#include "state_writer.hpp"')
++ print('#include "scoped_allocator.hpp"')
++ print('#include "glproc.hpp"')
++ print('#include "glsize.hpp"')
++ print('#include "glstate.hpp"')
++ print('#include "glstate_internal.hpp"')
++ print()
++ print('namespace glstate {')
++ print()
++
++ print('const char *')
++ print('enumToString(GLenum pname)')
++ print('{')
++ print(' switch (pname) {')
+ for name in GLenum.values:
+- print ' case %s:' % name
+- print ' return "%s";' % name
+- print ' default:'
+- print ' return NULL;'
+- print ' }'
+- print '}'
+- print
+-
+- print 'static void'
+- print 'dumpTextureTargetParameters(StateWriter &writer, Context &context, GLenum target, GLuint texture)'
+- print '{'
+- print ' writer.beginMember(enumToString(target));'
+- print ' writer.beginObject();'
+- print ' dumpObjectLabel(writer, context, GL_TEXTURE, texture, "GL_TEXTURE_LABEL");'
++ print(' case %s:' % name)
++ print(' return "%s";' % name)
++ print(' default:')
++ print(' return NULL;')
++ print(' }')
++ print('}')
++ print()
++
++ print('static void')
++ print('dumpTextureTargetParameters(StateWriter &writer, Context &context, GLenum target, GLuint texture)')
++ print('{')
++ print(' writer.beginMember(enumToString(target));')
++ print(' writer.beginObject();')
++ print(' dumpObjectLabel(writer, context, GL_TEXTURE, texture, "GL_TEXTURE_LABEL");')
+ # ARB_texture_buffer forbids glGetTexParameter and
+ # glGetTexLevelParameter for TEXTURE_BUFFER, but
+ # ARB_texture_buffer_range introduced parameters which can be queries
+ # with glGetTexLevelParameter...
+- print ' if (target != GL_TEXTURE_BUFFER) {'
++ print(' if (target != GL_TEXTURE_BUFFER) {')
+ self.dump_atoms(glGetTexParameter, 'target')
+- print ' }'
+- print ' if (!context.ES) {'
+- print ' GLenum levelTarget;'
+- print ' if (target == GL_TEXTURE_CUBE_MAP ||'
+- print ' target == GL_TEXTURE_CUBE_MAP_ARRAY) {'
+- print ' // Must pick a face'
+- print ' levelTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X;'
+- print ' } else {'
+- print ' levelTarget = target;'
+- print ' }'
++ print(' }')
++ print(' if (!context.ES) {')
++ print(' GLenum levelTarget;')
++ print(' if (target == GL_TEXTURE_CUBE_MAP ||')
++ print(' target == GL_TEXTURE_CUBE_MAP_ARRAY) {')
++ print(' // Must pick a face')
++ print(' levelTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X;')
++ print(' } else {')
++ print(' levelTarget = target;')
++ print(' }')
+ self.dump_atoms(glGetTexLevelParameter, 'levelTarget', '0')
+- print ' }'
+- print ' writer.endObject();'
+- print ' writer.endMember(); // target'
+- print '}'
+- print
+-
+- print 'static void'
+- print 'dumpFramebufferAttachementParameters(StateWriter &writer, Context &context, GLenum target, GLenum attachment)'
+- print '{'
++ print(' }')
++ print(' writer.endObject();')
++ print(' writer.endMember(); // target')
++ print('}')
++ print()
++
++ print('static void')
++ print('dumpFramebufferAttachementParameters(StateWriter &writer, Context &context, GLenum target, GLenum attachment)')
++ print('{')
+ self.dump_attachment_parameters('target', 'attachment')
+- print '}'
+- print
+-
+- print 'void dumpParameters(StateWriter &writer, Context &context)'
+- print '{'
+- print ' ScopedAllocator _allocator;'
+- print ' (void)_allocator;'
+- print
+- print ' writer.beginMember("parameters");'
+- print ' writer.beginObject();'
++ print('}')
++ print()
++
++ print('void dumpParameters(StateWriter &writer, Context &context)')
++ print('{')
++ print(' ScopedAllocator _allocator;')
++ print(' (void)_allocator;')
++ print()
++ print(' writer.beginMember("parameters");')
++ print(' writer.beginObject();')
+
+ self.dump_atoms(glGet)
+
+@@ -368,58 +368,58 @@ class StateDumper:
+ self.dump_framebuffer_parameters()
+ self.dump_labels()
+
+- print ' writer.endObject();'
+- print ' writer.endMember(); // parameters'
+- print '}'
+- print
++ print(' writer.endObject();')
++ print(' writer.endMember(); // parameters')
++ print('}')
++ print()
+
+- print '} /*namespace glstate */'
++ print('} /*namespace glstate */')
+
+ def dump_material_params(self):
+- print ' if (!context.ES) {'
++ print(' if (!context.ES) {')
+ for face in ['GL_FRONT', 'GL_BACK']:
+- print ' writer.beginMember("%s");' % face
+- print ' writer.beginObject();'
++ print(' writer.beginMember("%s");' % face)
++ print(' writer.beginObject();')
+ self.dump_atoms(glGetMaterial, face)
+- print ' writer.endObject();'
+- print ' }'
+- print
++ print(' writer.endObject();')
++ print(' }')
++ print()
+
+ def dump_light_params(self):
+- print ' GLint max_lights = 0;'
+- print ' _glGetIntegerv(GL_MAX_LIGHTS, &max_lights);'
+- print ' for (GLint index = 0; index < max_lights; ++index) {'
+- print ' GLenum light = GL_LIGHT0 + index;'
+- print ' if (glIsEnabled(light)) {'
+- print ' char name[32];'
+- print ' snprintf(name, sizeof name, "GL_LIGHT%i", index);'
+- print ' writer.beginMember(name);'
+- print ' writer.beginObject();'
++ print(' GLint max_lights = 0;')
++ print(' _glGetIntegerv(GL_MAX_LIGHTS, &max_lights);')
++ print(' for (GLint index = 0; index < max_lights; ++index) {')
++ print(' GLenum light = GL_LIGHT0 + index;')
++ print(' if (glIsEnabled(light)) {')
++ print(' char name[32];')
++ print(' snprintf(name, sizeof name, "GL_LIGHT%i", index);')
++ print(' writer.beginMember(name);')
++ print(' writer.beginObject();')
+ self.dump_atoms(glGetLight, ' GL_LIGHT0 + index')
+- print ' writer.endObject();'
+- print ' writer.endMember(); // GL_LIGHTi'
+- print ' }'
+- print ' }'
+- print
++ print(' writer.endObject();')
++ print(' writer.endMember(); // GL_LIGHTi')
++ print(' }')
++ print(' }')
++ print()
+
+ def dump_sampler_params(self):
+- print ' // GL_SAMPLER_BINDING'
+- print ' if (context.ARB_sampler_objects) {'
+- print ' GLint sampler_binding = 0;'
+- print ' glGetIntegerv(GL_SAMPLER_BINDING, &sampler_binding);'
+- print ' writer.beginMember("GL_SAMPLER_BINDING");'
+- print ' writer.writeInt(sampler_binding);'
+- print ' writer.endMember();'
+- print ' if (sampler_binding) {'
+- print ' writer.beginMember("GL_SAMPLER");'
+- print ' writer.beginObject();'
+- print ' dumpObjectLabel(writer, context, GL_SAMPLER, sampler_binding, "GL_SAMPLER_LABEL");'
++ print(' // GL_SAMPLER_BINDING')
++ print(' if (context.ARB_sampler_objects) {')
++ print(' GLint sampler_binding = 0;')
++ print(' glGetIntegerv(GL_SAMPLER_BINDING, &sampler_binding);')
++ print(' writer.beginMember("GL_SAMPLER_BINDING");')
++ print(' writer.writeInt(sampler_binding);')
++ print(' writer.endMember();')
++ print(' if (sampler_binding) {')
++ print(' writer.beginMember("GL_SAMPLER");')
++ print(' writer.beginObject();')
++ print(' dumpObjectLabel(writer, context, GL_SAMPLER, sampler_binding, "GL_SAMPLER_LABEL");')
+ for _, _, name in glGetSamplerParameter.iter():
+ self.dump_atom(glGetSamplerParameter, 'sampler_binding', name)
+- print ' writer.endObject();'
+- print ' writer.endMember(); // GL_SAMPLER'
+- print ' }'
+- print ' }'
++ print(' writer.endObject();')
++ print(' writer.endMember(); // GL_SAMPLER')
++ print(' }')
++ print(' }')
+
+ def texenv_param_target(self, name):
+ if name == 'GL_TEXTURE_LOD_BIAS':
+@@ -431,34 +431,34 @@ class StateDumper:
+
+ def dump_texenv_params(self):
+ for target in ['GL_TEXTURE_ENV', 'GL_TEXTURE_FILTER_CONTROL', 'GL_POINT_SPRITE']:
+- print ' if (!context.ES) {'
+- print ' writer.beginMember("%s");' % target
+- print ' writer.beginObject();'
++ print(' if (!context.ES) {')
++ print(' writer.beginMember("%s");' % target)
++ print(' writer.beginObject();')
+ for _, _, name in glGetTexEnv.iter():
+ if self.texenv_param_target(name) == target:
+ self.dump_atom(glGetTexEnv, target, name)
+- print ' writer.endObject();'
+- print ' }'
++ print(' writer.endObject();')
++ print(' }')
+
+ def dump_vertex_attribs(self):
+- print ' GLint max_vertex_attribs = 0;'
+- print ' _glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_vertex_attribs);'
+- print ' for (GLint index = 0; index < max_vertex_attribs; ++index) {'
+- print ' char name[32];'
+- print ' snprintf(name, sizeof name, "GL_VERTEX_ATTRIB_ARRAY%i", index);'
+- print ' writer.beginMember(name);'
+- print ' writer.beginObject();'
++ print(' GLint max_vertex_attribs = 0;')
++ print(' _glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_vertex_attribs);')
++ print(' for (GLint index = 0; index < max_vertex_attribs; ++index) {')
++ print(' char name[32];')
++ print(' snprintf(name, sizeof name, "GL_VERTEX_ATTRIB_ARRAY%i", index);')
++ print(' writer.beginMember(name);')
++ print(' writer.beginObject();')
+ self.dump_atoms(glGetVertexAttrib, 'index')
+
+ # Dump vertex attrib buffer label
+- print ' GLint buffer_binding = 0;'
+- print ' glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &buffer_binding);'
+- print ' dumpObjectLabel(writer, context, GL_BUFFER, buffer_binding, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_LABEL");'
++ print(' GLint buffer_binding = 0;')
++ print(' glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &buffer_binding);')
++ print(' dumpObjectLabel(writer, context, GL_BUFFER, buffer_binding, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_LABEL");')
+
+- print ' writer.endObject();'
+- print ' writer.endMember(); // GL_VERTEX_ATTRIB_ARRAYi'
+- print ' }'
+- print
++ print(' writer.endObject();')
++ print(' writer.endMember(); // GL_VERTEX_ATTRIB_ARRAYi')
++ print(' }')
++ print()
+
+ object_bindings = [
+ ('GL_BUFFER', 'GL_ARRAY_BUFFER_BINDING'),
+@@ -488,11 +488,11 @@ class StateDumper:
+ member_name = object_binding.replace('BINDING', 'LABEL')
+ if member_name == object_binding:
+ member_name += '_LABEL'
+- print ' {'
+- print ' GLint binding = 0;'
+- print ' glGetIntegerv(%s, &binding);' % object_binding
+- print ' dumpObjectLabel(writer, context, %s, binding, "%s");' % (object_type, member_name)
+- print ' }'
++ print(' {')
++ print(' GLint binding = 0;')
++ print(' glGetIntegerv(%s, &binding);' % object_binding)
++ print(' dumpObjectLabel(writer, context, %s, binding, "%s");' % (object_type, member_name))
++ print(' }')
+
+ program_targets = [
+ 'GL_FRAGMENT_PROGRAM_ARB',
+@@ -501,12 +501,12 @@ class StateDumper:
+
+ def dump_program_params(self):
+ for target in self.program_targets:
+- print ' if (glIsEnabled(%s)) {' % target
+- print ' writer.beginMember("%s");' % target
+- print ' writer.beginObject();'
++ print(' if (glIsEnabled(%s)) {' % target)
++ print(' writer.beginMember("%s");' % target)
++ print(' writer.beginObject();')
+ self.dump_atoms(glGetProgramARB, target)
+- print ' writer.endObject();'
+- print ' }'
++ print(' writer.endObject();')
++ print(' }')
+
+ buffer_targets = [
+ ('GL_ARRAY_BUFFER', 'GL_ARRAY_BUFFER_BINDING', None),
+@@ -529,135 +529,135 @@ class StateDumper:
+ def dump_buffer_parameters(self):
+ # general binding points
+ for target, binding, max_bindings in self.buffer_targets:
+- print ' // %s' % target
+- print ' {'
+- print ' writer.beginMember("%s");' % target
+- print ' writer.beginObject();'
+- print ' GLint buffer = 0;'
+- print ' glGetIntegerv(%s, &buffer);' % binding
+- print ' if (buffer) {'
++ print(' // %s' % target)
++ print(' {')
++ print(' writer.beginMember("%s");' % target)
++ print(' writer.beginObject();')
++ print(' GLint buffer = 0;')
++ print(' glGetIntegerv(%s, &buffer);' % binding)
++ print(' if (buffer) {')
+ self.dump_atoms(glGetBufferParameter, target)
+- print ' }'
++ print(' }')
+ if max_bindings is not None:
+ # indexed binding points
+ start = target + '_START'
+ size = target + '_SIZE'
+- print ' GLint max_bindings = 0;'
+- print ' glGetIntegerv(%s, &max_bindings);' % max_bindings
+- print ' if (max_bindings) {'
+- print ' writer.beginMember("i");'
+- print ' writer.beginArray();'
+- print ' for (GLint i = 0; i < max_bindings; ++i) {'
+- print ' writer.beginObject();'
++ print(' GLint max_bindings = 0;')
++ print(' glGetIntegerv(%s, &max_bindings);' % max_bindings)
++ print(' if (max_bindings) {')
++ print(' writer.beginMember("i");')
++ print(' writer.beginArray();')
++ print(' for (GLint i = 0; i < max_bindings; ++i) {')
++ print(' writer.beginObject();')
+ for pname in [binding, start, size]:
+ self.dump_atom(glGet_i, pname, 'i')
+- print ' writer.endObject();'
+- print ' }'
+- print ' writer.endArray();'
+- print ' writer.endMember();'
+- print ' }'
++ print(' writer.endObject();')
++ print(' }')
++ print(' writer.endArray();')
++ print(' writer.endMember();')
++ print(' }')
+
+- print ' writer.endObject();'
+- print ' writer.endMember();'
+- print ' }'
+- print
++ print(' writer.endObject();')
++ print(' writer.endMember();')
++ print(' }')
++ print()
+
+ def dump_texture_parameters(self):
+- print ' {'
+- print ' GLint active_texture = GL_TEXTURE0;'
+- print ' glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture);'
+- print ' GLint max_texture_coords = 0;'
+- print ' if (!context.core) {'
+- print ' glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_texture_coords);'
+- print ' }'
+- print ' GLint max_combined_texture_image_units = 0;'
+- print ' glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max_combined_texture_image_units);'
+- print ' max_combined_texture_image_units = std::max(max_combined_texture_image_units, 2);'
+- print ' GLint max_units = std::max(max_combined_texture_image_units, max_texture_coords);'
+- print ' for (GLint unit = 0; unit < max_units; ++unit) {'
+- print ' char name[32];'
+- print ' snprintf(name, sizeof name, "GL_TEXTURE%i", unit);'
+- print ' writer.beginMember(name);'
+- print ' glActiveTexture(GL_TEXTURE0 + unit);'
+- print ' writer.beginObject();'
+- print
++ print(' {')
++ print(' GLint active_texture = GL_TEXTURE0;')
++ print(' glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture);')
++ print(' GLint max_texture_coords = 0;')
++ print(' if (!context.core) {')
++ print(' glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_texture_coords);')
++ print(' }')
++ print(' GLint max_combined_texture_image_units = 0;')
++ print(' glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &max_combined_texture_image_units);')
++ print(' max_combined_texture_image_units = std::max(max_combined_texture_image_units, 2);')
++ print(' GLint max_units = std::max(max_combined_texture_image_units, max_texture_coords);')
++ print(' for (GLint unit = 0; unit < max_units; ++unit) {')
++ print(' char name[32];')
++ print(' snprintf(name, sizeof name, "GL_TEXTURE%i", unit);')
++ print(' writer.beginMember(name);')
++ print(' glActiveTexture(GL_TEXTURE0 + unit);')
++ print(' writer.beginObject();')
++ print()
+ self.dump_atoms(glGet_texture)
+- print
+- print ' for (unsigned i = 0; i < numTextureTargets; ++i) {'
+- print ' GLenum target = textureTargets[i];'
+- print ' GLboolean enabled = GL_FALSE;'
+- print ' if (unit < max_texture_coords &&'
+- print ' (target == GL_TEXTURE_1D ||'
+- print ' target == GL_TEXTURE_2D ||'
+- print ' target == GL_TEXTURE_3D ||'
+- print ' target == GL_TEXTURE_CUBE_MAP ||'
+- print ' target == GL_TEXTURE_RECTANGLE)) {'
+- print ' glGetBooleanv(target, &enabled);'
+- print ' writer.beginMember(enumToString(target));'
+- print ' dumpBoolean(writer, enabled);'
+- print ' writer.endMember();'
+- print ' }'
+- print ' GLint texture = 0;'
+- print ' GLenum binding = getTextureBinding(target);'
+- print ' glGetIntegerv(binding, &texture);'
+- print ' if (enabled || texture) {'
+- print ' dumpTextureTargetParameters(writer, context, target, texture);'
+- print ' }'
+- print ' }'
+- print
++ print()
++ print(' for (unsigned i = 0; i < numTextureTargets; ++i) {')
++ print(' GLenum target = textureTargets[i];')
++ print(' GLboolean enabled = GL_FALSE;')
++ print(' if (unit < max_texture_coords &&')
++ print(' (target == GL_TEXTURE_1D ||')
++ print(' target == GL_TEXTURE_2D ||')
++ print(' target == GL_TEXTURE_3D ||')
++ print(' target == GL_TEXTURE_CUBE_MAP ||')
++ print(' target == GL_TEXTURE_RECTANGLE)) {')
++ print(' glGetBooleanv(target, &enabled);')
++ print(' writer.beginMember(enumToString(target));')
++ print(' dumpBoolean(writer, enabled);')
++ print(' writer.endMember();')
++ print(' }')
++ print(' GLint texture = 0;')
++ print(' GLenum binding = getTextureBinding(target);')
++ print(' glGetIntegerv(binding, &texture);')
++ print(' if (enabled || texture) {')
++ print(' dumpTextureTargetParameters(writer, context, target, texture);')
++ print(' }')
++ print(' }')
++ print()
+ self.dump_sampler_params()
+- print
+- print ' if (unit < max_texture_coords) {'
++ print()
++ print(' if (unit < max_texture_coords) {')
+ self.dump_texenv_params()
+- print ' }'
+- print ' writer.endObject();'
+- print ' writer.endMember(); // GL_TEXTUREi'
+- print ' }'
+- print ' glActiveTexture(active_texture);'
+- print ' }'
+- print
++ print(' }')
++ print(' writer.endObject();')
++ print(' writer.endMember(); // GL_TEXTUREi')
++ print(' }')
++ print(' glActiveTexture(active_texture);')
++ print(' }')
++ print()
+
+ def dump_framebuffer_parameters(self):
+- print ' {'
+- print ' GLint max_color_attachments = 0;'
+- print ' glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &max_color_attachments);'
+- print ' GLint framebuffer;'
++ print(' {')
++ print(' GLint max_color_attachments = 0;')
++ print(' glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &max_color_attachments);')
++ print(' GLint framebuffer;')
+ for target, binding in framebuffer_targets:
+- print ' // %s' % target
+- print ' framebuffer = 0;'
+- print ' glGetIntegerv(%s, &framebuffer);' % binding
+- print ' if (framebuffer) {'
+- print ' writer.beginMember("%s");' % target
+- print ' writer.beginObject();'
+- print ' dumpObjectLabel(writer, context, GL_FRAMEBUFFER, framebuffer, "GL_FRAMEBUFFER_LABEL");'
+- print ' for (GLint i = 0; i < max_color_attachments; ++i) {'
+- print ' GLint color_attachment = GL_COLOR_ATTACHMENT0 + i;'
+- print ' dumpFramebufferAttachementParameters(writer, context, %s, color_attachment);' % target
+- print ' }'
+- print ' dumpFramebufferAttachementParameters(writer, context, %s, GL_DEPTH_ATTACHMENT);' % target
+- print ' dumpFramebufferAttachementParameters(writer, context, %s, GL_STENCIL_ATTACHMENT);' % target
+- print ' writer.endObject();'
+- print ' writer.endMember(); // %s' % target
+- print ' }'
+- print
+- print ' }'
+- print
++ print(' // %s' % target)
++ print(' framebuffer = 0;')
++ print(' glGetIntegerv(%s, &framebuffer);' % binding)
++ print(' if (framebuffer) {')
++ print(' writer.beginMember("%s");' % target)
++ print(' writer.beginObject();')
++ print(' dumpObjectLabel(writer, context, GL_FRAMEBUFFER, framebuffer, "GL_FRAMEBUFFER_LABEL");')
++ print(' for (GLint i = 0; i < max_color_attachments; ++i) {')
++ print(' GLint color_attachment = GL_COLOR_ATTACHMENT0 + i;')
++ print(' dumpFramebufferAttachementParameters(writer, context, %s, color_attachment);' % target)
++ print(' }')
++ print(' dumpFramebufferAttachementParameters(writer, context, %s, GL_DEPTH_ATTACHMENT);' % target)
++ print(' dumpFramebufferAttachementParameters(writer, context, %s, GL_STENCIL_ATTACHMENT);' % target)
++ print(' writer.endObject();')
++ print(' writer.endMember(); // %s' % target)
++ print(' }')
++ print()
++ print(' }')
++ print()
+
+ def dump_attachment_parameters(self, target, attachment):
+- print ' {'
+- print ' GLint object_type = GL_NONE;'
+- print ' glGetFramebufferAttachmentParameteriv(%s, %s, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &object_type);' % (target, attachment)
+- print ' if (object_type != GL_NONE) {'
+- print ' writer.beginMember(enumToString(%s));' % attachment
+- print ' writer.beginObject();'
++ print(' {')
++ print(' GLint object_type = GL_NONE;')
++ print(' glGetFramebufferAttachmentParameteriv(%s, %s, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &object_type);' % (target, attachment))
++ print(' if (object_type != GL_NONE) {')
++ print(' writer.beginMember(enumToString(%s));' % attachment)
++ print(' writer.beginObject();')
+ self.dump_atoms(glGetFramebufferAttachmentParameter, target, attachment)
+- print ' GLint object_name = 0;'
+- print ' glGetFramebufferAttachmentParameteriv(%s, %s, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &object_name);' % (target, attachment)
+- print ' dumpObjectLabel(writer, context, object_type, object_name, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_LABEL");'
+- print ' writer.endObject();'
+- print ' writer.endMember(); // GL_x_ATTACHMENT'
+- print ' }'
+- print ' }'
++ print(' GLint object_name = 0;')
++ print(' glGetFramebufferAttachmentParameteriv(%s, %s, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &object_name);' % (target, attachment))
++ print(' dumpObjectLabel(writer, context, object_type, object_name, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_LABEL");')
++ print(' writer.endObject();')
++ print(' writer.endMember(); // GL_x_ATTACHMENT')
++ print(' }')
++ print(' }')
+
+ def dump_atoms(self, getter, *args):
+ for _, _, name in getter.iter():
+@@ -666,20 +666,20 @@ class StateDumper:
+ def dump_atom(self, getter, *args):
+ name = args[getter.pnameIdx]
+
+- print ' // %s' % name
+- print ' {'
+- print ' flushErrors();'
++ print(' // %s' % name)
++ print(' {')
++ print(' flushErrors();')
+ type, value = getter(*args)
+- print ' if (glGetError() != GL_NO_ERROR) {'
++ print(' if (glGetError() != GL_NO_ERROR) {')
+ #print ' std::cerr << "warning: %s(%s) failed\\n";' % (inflection, name)
+- print ' flushErrors();'
+- print ' } else {'
+- print ' writer.beginMember("%s");' % name
++ print(' flushErrors();')
++ print(' } else {')
++ print(' writer.beginMember("%s");' % name)
+ JsonWriter().visit(type, value)
+- print ' writer.endMember();'
+- print ' }'
+- print ' }'
+- print
++ print(' writer.endMember();')
++ print(' }')
++ print(' }')
++ print()
+
+
+ if __name__ == '__main__':
+diff --git a/retrace/retrace.py b/retrace/retrace.py
+index 164944ed..0149817c 100644
+--- a/retrace/retrace.py
++++ b/retrace/retrace.py
+@@ -69,10 +69,10 @@ class ValueAllocator(stdapi.Visitor):
+ pass
+
+ def visitArray(self, array, lvalue, rvalue):
+- print ' %s = _allocator.allocArray<%s>(&%s);' % (lvalue, array.type, rvalue)
++ print(' %s = _allocator.allocArray<%s>(&%s);' % (lvalue, array.type, rvalue))
+
+ def visitPointer(self, pointer, lvalue, rvalue):
+- print ' %s = _allocator.allocArray<%s>(&%s);' % (lvalue, pointer.type, rvalue)
++ print(' %s = _allocator.allocArray<%s>(&%s);' % (lvalue, pointer.type, rvalue))
+
+ def visitIntPointer(self, pointer, lvalue, rvalue):
+ pass
+@@ -109,7 +109,7 @@ class ValueAllocator(stdapi.Visitor):
+ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
+
+ def visitLiteral(self, literal, lvalue, rvalue):
+- print ' %s = (%s).to%s();' % (lvalue, rvalue, literal.kind)
++ print(' %s = (%s).to%s();' % (lvalue, rvalue, literal.kind))
+
+ def visitConst(self, const, lvalue, rvalue):
+ self.visit(const.type, lvalue, rvalue)
+@@ -118,7 +118,7 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
+ self.visit(alias.type, lvalue, rvalue)
+
+ def visitEnum(self, enum, lvalue, rvalue):
+- print ' %s = static_cast<%s>((%s).toSInt());' % (lvalue, enum, rvalue)
++ print(' %s = static_cast<%s>((%s).toSInt());' % (lvalue, enum, rvalue))
+
+ def visitBitmask(self, bitmask, lvalue, rvalue):
+ self.visit(bitmask.type, lvalue, rvalue)
+@@ -127,50 +127,50 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
+ tmp = '_a_' + array.tag + '_' + str(self.seq)
+ self.seq += 1
+
+- print ' const trace::Array *%s = (%s).toArray();' % (tmp, rvalue)
+- print ' if (%s) {' % (tmp,)
++ print(' const trace::Array *%s = (%s).toArray();' % (tmp, rvalue))
++ print(' if (%s) {' % (tmp,))
+
+ length = '%s->values.size()' % (tmp,)
+ if self.insideStruct:
+ if isinstance(array.length, int):
+ # Member is an array
+- print r' static_assert( std::is_array< std::remove_reference< decltype( %s ) >::type >::value , "lvalue must be an array" );' % lvalue
+- print r' static_assert( std::extent< std::remove_reference< decltype( %s ) >::type >::value == %s, "array size mismatch" );' % (lvalue, array.length)
+- print r' assert( %s );' % (tmp,)
+- print r' assert( %s->size() == %s );' % (tmp, array.length)
++ print(r' static_assert( std::is_array< std::remove_reference< decltype( %s ) >::type >::value , "lvalue must be an array" );' % lvalue)
++ print(r' static_assert( std::extent< std::remove_reference< decltype( %s ) >::type >::value == %s, "array size mismatch" );' % (lvalue, array.length))
++ print(r' assert( %s );' % (tmp,))
++ print(r' assert( %s->size() == %s );' % (tmp, array.length))
+ length = str(array.length)
+ else:
+ # Member is a pointer to an array, hence must be allocated
+- print r' static_assert( std::is_pointer< std::remove_reference< decltype( %s ) >::type >::value , "lvalue must be a pointer" );' % lvalue
+- print r' %s = _allocator.allocArray<%s>(&%s);' % (lvalue, array.type, rvalue)
++ print(r' static_assert( std::is_pointer< std::remove_reference< decltype( %s ) >::type >::value , "lvalue must be a pointer" );' % lvalue)
++ print(r' %s = _allocator.allocArray<%s>(&%s);' % (lvalue, array.type, rvalue))
+
+ index = '_j' + array.tag
+- print ' for (size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length)
++ print(' for (size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length))
+ try:
+ self.visit(array.type, '%s[%s]' % (lvalue, index), '*%s->values[%s]' % (tmp, index))
+ finally:
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
+
+ def visitPointer(self, pointer, lvalue, rvalue):
+ tmp = '_a_' + pointer.tag + '_' + str(self.seq)
+ self.seq += 1
+
+- print ' if (%s) {' % (lvalue,)
+- print ' const trace::Array *%s = (%s).toArray();' % (tmp, rvalue)
++ print(' if (%s) {' % (lvalue,))
++ print(' const trace::Array *%s = (%s).toArray();' % (tmp, rvalue))
+ try:
+ self.visit(pointer.type, '%s[0]' % (lvalue,), '*%s->values[0]' % (tmp,))
+ finally:
+- print ' }'
++ print(' }')
+
+ def visitIntPointer(self, pointer, lvalue, rvalue):
+- print ' %s = static_cast<%s>((%s).toPointer());' % (lvalue, pointer, rvalue)
++ print(' %s = static_cast<%s>((%s).toPointer());' % (lvalue, pointer, rvalue))
+
+ def visitObjPointer(self, pointer, lvalue, rvalue):
+- print ' %s = retrace::asObjPointer<%s>(call, %s);' % (lvalue, pointer.type, rvalue)
++ print(' %s = retrace::asObjPointer<%s>(call, %s);' % (lvalue, pointer.type, rvalue))
+
+ def visitLinearPointer(self, pointer, lvalue, rvalue):
+- print ' %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, pointer, rvalue)
++ print(' %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, pointer, rvalue))
+
+ def visitReference(self, reference, lvalue, rvalue):
+ self.visit(reference.type, lvalue, rvalue);
+@@ -179,23 +179,23 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
+ #OpaqueValueDeserializer().visit(handle.type, lvalue, rvalue);
+ self.visit(handle.type, lvalue, rvalue);
+ new_lvalue = lookupHandle(handle, lvalue)
+- print ' if (retrace::verbosity >= 2) {'
+- print ' std::cout << "%s " << size_t(%s) << " <- " << size_t(%s) << "\\n";' % (handle.name, lvalue, new_lvalue)
+- print ' }'
++ print(' if (retrace::verbosity >= 2) {')
++ print(' std::cout << "%s " << size_t(%s) << " <- " << size_t(%s) << "\\n";' % (handle.name, lvalue, new_lvalue))
++ print(' }')
+ if (new_lvalue.startswith('_program_map') or new_lvalue.startswith('_shader_map')):
+- print 'if (glretrace::supportsARBShaderObjects) {'
+- print ' %s = _handleARB_map[%s];' % (lvalue, lvalue)
+- print '} else {'
+- print ' %s = %s;' % (lvalue, new_lvalue)
+- print '}'
++ print('if (glretrace::supportsARBShaderObjects) {')
++ print(' %s = _handleARB_map[%s];' % (lvalue, lvalue))
++ print('} else {')
++ print(' %s = %s;' % (lvalue, new_lvalue))
++ print('}')
+ else:
+- print ' %s = %s;' % (lvalue, new_lvalue)
++ print(' %s = %s;' % (lvalue, new_lvalue))
+
+ def visitBlob(self, blob, lvalue, rvalue):
+- print ' %s = static_cast<%s>((%s).toPointer());' % (lvalue, blob, rvalue)
++ print(' %s = static_cast<%s>((%s).toPointer());' % (lvalue, blob, rvalue))
+
+ def visitString(self, string, lvalue, rvalue):
+- print ' %s = (%s)((%s).toString());' % (lvalue, string.expr, rvalue)
++ print(' %s = (%s)((%s).toString());' % (lvalue, string.expr, rvalue))
+
+ seq = 0
+
+@@ -207,8 +207,8 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
+
+ self.insideStruct += 1
+
+- print ' const trace::Struct *%s = (%s).toStruct();' % (tmp, rvalue)
+- print ' assert(%s);' % (tmp)
++ print(' const trace::Struct *%s = (%s).toStruct();' % (tmp, rvalue))
++ print(' assert(%s);' % (tmp))
+ for i in range(len(struct.members)):
+ member = struct.members[i]
+ self.visitMember(member, lvalue, '*%s->members[%s]' % (tmp, i))
+@@ -218,24 +218,24 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
+ def visitPolymorphic(self, polymorphic, lvalue, rvalue):
+ if polymorphic.defaultType is None:
+ switchExpr = self.expand(polymorphic.switchExpr)
+- print r' switch (%s) {' % switchExpr
++ print(r' switch (%s) {' % switchExpr)
+ for cases, type in polymorphic.iterSwitch():
+ for case in cases:
+- print r' %s:' % case
++ print(r' %s:' % case)
+ caseLvalue = lvalue
+ if type.expr is not None:
+ caseLvalue = 'static_cast<%s>(%s)' % (type, caseLvalue)
+- print r' {'
++ print(r' {')
+ try:
+ self.visit(type, caseLvalue, rvalue)
+ finally:
+- print r' }'
+- print r' break;'
++ print(r' }')
++ print(r' break;')
+ if polymorphic.defaultType is None:
+- print r' default:'
+- print r' retrace::warning(call) << "unexpected polymorphic case" << %s << "\n";' % (switchExpr,)
+- print r' break;'
+- print r' }'
++ print(r' default:')
++ print(r' retrace::warning(call) << "unexpected polymorphic case" << %s << "\n";' % (switchExpr,))
++ print(r' break;')
++ print(r' }')
+ else:
+ self.visit(polymorphic.defaultType, lvalue, rvalue)
+
+@@ -250,7 +250,7 @@ class OpaqueValueDeserializer(ValueDeserializer):
+ in the context of handles.'''
+
+ def visitOpaque(self, opaque, lvalue, rvalue):
+- print ' %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, opaque, rvalue)
++ print(' %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, opaque, rvalue))
+
+
+ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
+@@ -270,67 +270,67 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
+ pass
+
+ def visitArray(self, array, lvalue, rvalue):
+- print ' const trace::Array *_a%s = (%s).toArray();' % (array.tag, rvalue)
+- print ' if (_a%s) {' % (array.tag)
++ print(' const trace::Array *_a%s = (%s).toArray();' % (array.tag, rvalue))
++ print(' if (_a%s) {' % (array.tag))
+ length = '_a%s->values.size()' % array.tag
+ index = '_j' + array.tag
+- print ' for (size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length)
++ print(' for (size_t {i} = 0; {i} < {length}; ++{i}) {{'.format(i = index, length = length))
+ try:
+ self.visit(array.type, '%s[%s]' % (lvalue, index), '*_a%s->values[%s]' % (array.tag, index))
+ finally:
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
+
+ def visitPointer(self, pointer, lvalue, rvalue):
+- print ' const trace::Array *_a%s = (%s).toArray();' % (pointer.tag, rvalue)
+- print ' if (_a%s) {' % (pointer.tag)
++ print(' const trace::Array *_a%s = (%s).toArray();' % (pointer.tag, rvalue))
++ print(' if (_a%s) {' % (pointer.tag))
+ try:
+ self.visit(pointer.type, '%s[0]' % (lvalue,), '*_a%s->values[0]' % (pointer.tag,))
+ finally:
+- print ' }'
++ print(' }')
+
+ def visitIntPointer(self, pointer, lvalue, rvalue):
+ pass
+
+ def visitObjPointer(self, pointer, lvalue, rvalue):
+- print r' retrace::addObj(call, %s, %s);' % (rvalue, lvalue)
++ print(r' retrace::addObj(call, %s, %s);' % (rvalue, lvalue))
+
+ def visitLinearPointer(self, pointer, lvalue, rvalue):
+ assert pointer.size is not None
+ if pointer.size is not None:
+- print r' retrace::addRegion(call, (%s).toUIntPtr(), %s, %s);' % (rvalue, lvalue, pointer.size)
++ print(r' retrace::addRegion(call, (%s).toUIntPtr(), %s, %s);' % (rvalue, lvalue, pointer.size))
+
+ def visitReference(self, reference, lvalue, rvalue):
+ pass
+
+ def visitHandle(self, handle, lvalue, rvalue):
+- print ' %s _origResult;' % handle.type
++ print(' %s _origResult;' % handle.type)
+ OpaqueValueDeserializer().visit(handle.type, '_origResult', rvalue);
+ if handle.range is None:
+ rvalue = "_origResult"
+ entry = lookupHandle(handle, rvalue, True)
+ if (entry.startswith('_program_map') or entry.startswith('_shader_map')):
+- print 'if (glretrace::supportsARBShaderObjects) {'
+- print ' _handleARB_map[%s] = %s;' % (rvalue, lvalue)
+- print '} else {'
+- print ' %s = %s;' % (entry, lvalue)
+- print '}'
++ print('if (glretrace::supportsARBShaderObjects) {')
++ print(' _handleARB_map[%s] = %s;' % (rvalue, lvalue))
++ print('} else {')
++ print(' %s = %s;' % (entry, lvalue))
++ print('}')
+ else:
+- print " %s = %s;" % (entry, lvalue)
+- print ' if (retrace::verbosity >= 2) {'
+- print ' std::cout << "{handle.name} " << {rvalue} << " -> " << {lvalue} << "\\n";'.format(**locals())
+- print ' }'
++ print(" %s = %s;" % (entry, lvalue))
++ print(' if (retrace::verbosity >= 2) {')
++ print(' std::cout << "{handle.name} " << {rvalue} << " -> " << {lvalue} << "\\n";'.format(**locals()))
++ print(' }')
+ else:
+ i = '_h' + handle.tag
+ lvalue = "%s + %s" % (lvalue, i)
+ rvalue = "_origResult + %s" % (i,)
+ entry = lookupHandle(handle, rvalue)
+- print ' for ({handle.type} {i} = 0; {i} < {handle.range}; ++{i}) {{'.format(**locals())
+- print ' {entry} = {lvalue};'.format(**locals())
+- print ' if (retrace::verbosity >= 2) {'
+- print ' std::cout << "{handle.name} " << ({rvalue}) << " -> " << ({lvalue}) << "\\n";'.format(**locals())
+- print ' }'
+- print ' }'
++ print(' for ({handle.type} {i} = 0; {i} < {handle.range}; ++{i}) {{'.format(**locals()))
++ print(' {entry} = {lvalue};'.format(**locals()))
++ print(' if (retrace::verbosity >= 2) {')
++ print(' std::cout << "{handle.name} " << ({rvalue}) << " -> " << ({lvalue}) << "\\n";'.format(**locals()))
++ print(' }')
++ print(' }')
+
+ def visitBlob(self, blob, lvalue, rvalue):
+ pass
+@@ -344,9 +344,9 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
+ tmp = '_s_' + struct.tag + '_' + str(self.seq)
+ self.seq += 1
+
+- print ' const trace::Struct *%s = (%s).toStruct();' % (tmp, rvalue)
+- print ' assert(%s);' % (tmp,)
+- print ' (void)%s;' % (tmp,)
++ print(' const trace::Struct *%s = (%s).toStruct();' % (tmp, rvalue))
++ print(' assert(%s);' % (tmp,))
++ print(' (void)%s;' % (tmp,))
+ for i in range(len(struct.members)):
+ member = struct.members[i]
+ self.visitMember(member, lvalue, '*%s->members[%s]' % (tmp, i))
+@@ -362,16 +362,16 @@ class SwizzledValueRegistrator(stdapi.Visitor, stdapi.ExpanderMixin):
+ class Retracer:
+
+ def retraceFunction(self, function):
+- print 'static void retrace_%s(trace::Call &call) {' % function.name
++ print('static void retrace_%s(trace::Call &call) {' % function.name)
+ self.retraceFunctionBody(function)
+- print '}'
+- print
++ print('}')
++ print()
+
+ def retraceInterfaceMethod(self, interface, method):
+- print 'static void retrace_%s__%s(trace::Call &call) {' % (interface.name, method.name)
++ print('static void retrace_%s__%s(trace::Call &call) {' % (interface.name, method.name))
+ self.retraceInterfaceMethodBody(interface, method)
+- print '}'
+- print
++ print('}')
++ print()
+
+ def retraceFunctionBody(self, function):
+ assert function.sideeffects
+@@ -409,38 +409,38 @@ class Retracer:
+ assert function.type is not stdapi.Void
+
+ if str(function.type) == 'HRESULT':
+- print r' if (call.ret && FAILED(call.ret->toSInt())) {'
+- print r' return;'
+- print r' }'
++ print(r' if (call.ret && FAILED(call.ret->toSInt())) {')
++ print(r' return;')
++ print(r' }')
+
+ def deserializeThisPointer(self, interface):
+- print r' %s *_this;' % (interface.name,)
+- print r' _this = retrace::asObjPointer<%s>(call, call.arg(0));' % (interface.name,)
+- print r' if (!_this) {'
+- print r' return;'
+- print r' }'
++ print(r' %s *_this;' % (interface.name,))
++ print(r' _this = retrace::asObjPointer<%s>(call, call.arg(0));' % (interface.name,))
++ print(r' if (!_this) {')
++ print(r' return;')
++ print(r' }')
+
+ def deserializeArgs(self, function):
+- print ' retrace::ScopedAllocator _allocator;'
+- print ' (void)_allocator;'
++ print(' retrace::ScopedAllocator _allocator;')
++ print(' (void)_allocator;')
+ success = True
+ for arg in function.args:
+ arg_type = arg.type.mutable()
+- print ' %s %s;' % (arg_type, arg.name)
++ print(' %s %s;' % (arg_type, arg.name))
+ rvalue = 'call.arg(%u)' % (arg.index,)
+ lvalue = arg.name
+ try:
+ self.extractArg(function, arg, arg_type, lvalue, rvalue)
+ except UnsupportedType:
+ success = False
+- print ' memset(&%s, 0, sizeof %s); // FIXME' % (arg.name, arg.name)
+- print
++ print(' memset(&%s, 0, sizeof %s); // FIXME' % (arg.name, arg.name))
++ print()
+
+ if not success:
+- print ' if (1) {'
++ print(' if (1) {')
+ self.failFunction(function)
+ sys.stderr.write('warning: unsupported %s call\n' % function.name)
+- print ' }'
++ print(' }')
+
+ def swizzleValues(self, function):
+ for arg in function.args:
+@@ -451,7 +451,7 @@ class Retracer:
+ try:
+ self.regiterSwizzledValue(arg_type, lvalue, rvalue)
+ except UnsupportedType:
+- print ' // XXX: %s' % arg.name
++ print(' // XXX: %s' % arg.name)
+ if function.type is not stdapi.Void:
+ rvalue = '*call.ret'
+ lvalue = '_result'
+@@ -459,15 +459,15 @@ class Retracer:
+ self.regiterSwizzledValue(function.type, lvalue, rvalue)
+ except UnsupportedType:
+ raise
+- print ' // XXX: result'
++ print(' // XXX: result')
+
+ def failFunction(self, function):
+- print ' if (retrace::verbosity >= 0) {'
+- print ' retrace::unsupported(call);'
+- print ' }'
++ print(' if (retrace::verbosity >= 0) {')
++ print(' retrace::unsupported(call);')
++ print(' }')
+ # MGS-469: GPU hangs when retracing OGLESParticles on mx6sx
+ # Workaround: do not `return`
+- #print ' return;'
++ #print(' return;')
+
+ def extractArg(self, function, arg, arg_type, lvalue, rvalue):
+ ValueAllocator().visit(arg_type, lvalue, rvalue)
+@@ -487,22 +487,22 @@ class Retracer:
+
+ def declareRet(self, function):
+ if function.type is not stdapi.Void:
+- print ' %s _result;' % (function.type)
++ print(' %s _result;' % (function.type))
+
+ def invokeFunction(self, function):
+ arg_names = ", ".join(function.argNames())
+ if function.type is not stdapi.Void:
+- print ' _result = %s(%s);' % (function.name, arg_names)
++ print(' _result = %s(%s);' % (function.name, arg_names))
+ self.checkResult(None, function)
+ else:
+- print ' %s(%s);' % (function.name, arg_names)
++ print(' %s(%s);' % (function.name, arg_names))
+
+ def invokeInterfaceMethod(self, interface, method):
+ arg_names = ", ".join(method.argNames())
+ if method.type is not stdapi.Void:
+- print ' _result = _this->%s(%s);' % (method.name, arg_names)
++ print(' _result = _this->%s(%s);' % (method.name, arg_names))
+ else:
+- print ' _this->%s(%s);' % (method.name, arg_names)
++ print(' _this->%s(%s);' % (method.name, arg_names))
+
+ # Adjust reference count when QueryInterface fails. This is
+ # particularly useful when replaying traces on older Direct3D runtimes
+@@ -511,12 +511,12 @@ class Retracer:
+ #
+ # TODO: Generalize to other methods that return interfaces
+ if method.name == 'QueryInterface':
+- print r' if (FAILED(_result)) {'
+- print r' IUnknown *pObj = retrace::asObjPointer<IUnknown>(call, *call.arg(2).toArray()->values[0]);'
+- print r' if (pObj) {'
+- print r' pObj->AddRef();'
+- print r' }'
+- print r' }'
++ print(r' if (FAILED(_result)) {')
++ print(r' IUnknown *pObj = retrace::asObjPointer<IUnknown>(call, *call.arg(2).toArray()->values[0]);')
++ print(r' if (pObj) {')
++ print(r' pObj->AddRef();')
++ print(r' }')
++ print(r' }')
+
+ if method.type is not stdapi.Void:
+ self.checkResult(interface, method)
+@@ -524,28 +524,28 @@ class Retracer:
+ # Debug COM reference counting. Disabled by default as reported
+ # reference counts depend on internal implementation details.
+ if method.name in ('AddRef', 'Release'):
+- print r' if (0) retrace::checkMismatch(call, "cRef", call.ret, _result);'
++ print(r' if (0) retrace::checkMismatch(call, "cRef", call.ret, _result);')
+
+ # On release our reference when we reach Release() == 0 call in the
+ # trace.
+ if method.name == 'Release':
+- print r' ULONG _orig_result = call.ret->toUInt();'
+- print r' if (_orig_result == 0 || _result == 0) {'
+- print r' if (_orig_result != 0) {'
+- print r' retrace::warning(call) << "unexpected object destruction\n";'
+- print r' }'
+- print r' retrace::delObj(call.arg(0));'
+- print r' }'
++ print(r' ULONG _orig_result = call.ret->toUInt();')
++ print(r' if (_orig_result == 0 || _result == 0) {')
++ print(r' if (_orig_result != 0) {')
++ print(r' retrace::warning(call) << "unexpected object destruction\n";')
++ print(r' }')
++ print(r' retrace::delObj(call.arg(0));')
++ print(r' }')
+
+ def checkResult(self, interface, methodOrFunction):
+ assert methodOrFunction.type is not stdapi.Void
+ if str(methodOrFunction.type) == 'HRESULT':
+- print r' if (FAILED(_result)) {'
+- print r' retrace::failed(call, _result);'
+- print r' return;'
+- print r' }'
++ print(r' if (FAILED(_result)) {')
++ print(r' retrace::failed(call, _result);')
++ print(r' return;')
++ print(r' }')
+ else:
+- print r' (void)_result;'
++ print(r' (void)_result;')
+
+ def checkPitchMismatch(self, method):
+ # Warn for mismatches in 2D/3D mappings.
+@@ -554,19 +554,19 @@ class Retracer:
+ if outArg.output \
+ and isinstance(outArg.type, stdapi.Pointer) \
+ and isinstance(outArg.type.type, stdapi.Struct):
+- print r' const trace::Array *_%s = call.arg(%u).toArray();' % (outArg.name, outArg.index)
+- print r' if (%s) {' % outArg.name
+- print r' const trace::Struct *_struct = _%s->values[0]->toStruct();' % (outArg.name)
+- print r' if (_struct) {'
++ print(r' const trace::Array *_%s = call.arg(%u).toArray();' % (outArg.name, outArg.index))
++ print(r' if (%s) {' % outArg.name)
++ print(r' const trace::Struct *_struct = _%s->values[0]->toStruct();' % (outArg.name))
++ print(r' if (_struct) {')
+ struct = outArg.type.type
+ for memberIndex in range(len(struct.members)):
+ memberType, memberName = struct.members[memberIndex]
+ if memberName.endswith('Pitch'):
+- print r' if (%s->%s) {' % (outArg.name, memberName)
+- print r' retrace::checkMismatch(call, "%s", _struct->members[%u], %s->%s);' % (memberName, memberIndex, outArg.name, memberName)
+- print r' }'
+- print r' }'
+- print r' }'
++ print(r' if (%s->%s) {' % (outArg.name, memberName))
++ print(r' retrace::checkMismatch(call, "%s", _struct->members[%u], %s->%s);' % (memberName, memberIndex, outArg.name, memberName))
++ print(r' }')
++ print(r' }')
++ print(r' }')
+
+ def filterFunction(self, function):
+ return True
+@@ -575,11 +575,11 @@ class Retracer:
+
+ def retraceApi(self, api):
+
+- print '#include "os_time.hpp"'
+- print '#include "trace_parser.hpp"'
+- print '#include "retrace.hpp"'
+- print '#include "retrace_swizzle.hpp"'
+- print
++ print('#include "os_time.hpp"')
++ print('#include "trace_parser.hpp"')
++ print('#include "retrace.hpp"')
++ print('#include "retrace_swizzle.hpp"')
++ print()
+
+ types = api.getAllTypes()
+ handles = [type for type in types if isinstance(type, stdapi.Handle)]
+@@ -587,14 +587,14 @@ class Retracer:
+ for handle in handles:
+ if handle.name not in handle_names:
+ if handle.key is None:
+- print 'static retrace::map<%s> _%s_map;' % (handle.type, handle.name)
++ print('static retrace::map<%s> _%s_map;' % (handle.type, handle.name))
+ else:
+ key_name, key_type = handle.key
+- print 'static std::map<%s, retrace::map<%s> > _%s_map;' % (key_type, handle.type, handle.name)
++ print('static std::map<%s, retrace::map<%s> > _%s_map;' % (key_type, handle.type, handle.name))
+ handle_names.add(handle.name)
+- print
++ print()
+
+- functions = filter(self.filterFunction, api.getAllFunctions())
++ functions = list(filter(self.filterFunction, api.getAllFunctions()))
+ for function in functions:
+ if function.sideeffects and not function.internal:
+ self.retraceFunction(function)
+@@ -604,20 +604,20 @@ class Retracer:
+ if method.sideeffects and not method.internal:
+ self.retraceInterfaceMethod(interface, method)
+
+- print 'const retrace::Entry %s[] = {' % self.table_name
++ print('const retrace::Entry %s[] = {' % self.table_name)
+ for function in functions:
+ if not function.internal:
+ if function.sideeffects:
+- print ' {"%s", &retrace_%s},' % (function.name, function.name)
++ print(' {"%s", &retrace_%s},' % (function.name, function.name))
+ else:
+- print ' {"%s", &retrace::ignore},' % (function.name,)
++ print(' {"%s", &retrace::ignore},' % (function.name,))
+ for interface in interfaces:
+ for base, method in interface.iterBaseMethods():
+ if method.sideeffects:
+- print ' {"%s::%s", &retrace_%s__%s},' % (interface.name, method.name, base.name, method.name)
++ print(' {"%s::%s", &retrace_%s__%s},' % (interface.name, method.name, base.name, method.name))
+ else:
+- print ' {"%s::%s", &retrace::ignore},' % (interface.name, method.name)
+- print ' {NULL, NULL}'
+- print '};'
+- print
++ print(' {"%s::%s", &retrace::ignore},' % (interface.name, method.name))
++ print(' {NULL, NULL}')
++ print('};')
++ print()
+
+diff --git a/scripts/convert.py b/scripts/convert.py
+index 5f338d80..83df70ce 100755
+--- a/scripts/convert.py
++++ b/scripts/convert.py
+@@ -100,9 +100,9 @@ def detectApiFromCsv(inCsv):
+ import csv
+ csvReader = csv.reader(open(inCsv, 'rt'), )
+ for row in csvReader:
+- print row
++ print(row)
+ event = row[2]
+- print event
++ print(event)
+ if event.startswith("Direct3DCreate9"):
+ return "d3d9"
+ if event.startswith("CreateDXGIFactory"):
+diff --git a/scripts/jsondiff.py b/scripts/jsondiff.py
+index 3b1f9110..25c4840e 100755
+--- a/scripts/jsondiff.py
++++ b/scripts/jsondiff.py
+@@ -36,7 +36,7 @@ import sys
+ def strip_object_hook(obj):
+ if '__class__' in obj:
+ return None
+- for name in obj.keys():
++ for name in list(obj.keys()):
+ if name.startswith('__') and name.endswith('__'):
+ del obj[name]
+ return obj
+@@ -80,7 +80,7 @@ class Dumper(Visitor):
+ def visitObject(self, node):
+ self.enter_object()
+
+- members = node.keys()
++ members = list(node.keys())
+ members.sort()
+ for i in range(len(members)):
+ name = members[i]
+@@ -148,8 +148,8 @@ class Comparer(Visitor):
+ return False
+ if len(a) != len(b) and not self.ignore_added:
+ return False
+- ak = a.keys()
+- bk = b.keys()
++ ak = list(a.keys())
++ bk = list(b.keys())
+ ak.sort()
+ bk.sort()
+ if ak != bk and not self.ignore_added:
+@@ -175,8 +175,8 @@ class Comparer(Visitor):
+ return True
+
+ def visitValue(self, a, b):
+- if isinstance(a, float) and isinstance(b, (int, long, float)) or \
+- isinstance(b, float) and isinstance(a, (int, long, float)):
++ if isinstance(a, float) and isinstance(b, (int, float)) or \
++ isinstance(b, float) and isinstance(a, (int, float)):
+ if a is b:
+ # NaNs take this path
+ return True
+@@ -208,7 +208,7 @@ class Differ(Visitor):
+ self.dumper.enter_object()
+ names = set(a.keys())
+ if not self.comparer.ignore_added:
+- names.update(b.keys())
++ names.update(list(b.keys()))
+ names = list(names)
+ names.sort()
+
+@@ -284,7 +284,7 @@ class Differ(Visitor):
+ self.dumper.visit(b)
+
+ def isMultilineString(self, value):
+- return isinstance(value, basestring) and '\n' in value
++ return isinstance(value, str) and '\n' in value
+
+
+ #
+diff --git a/scripts/jsonextractimages.py b/scripts/jsonextractimages.py
+index ea1c927d..917ee7e4 100755
+--- a/scripts/jsonextractimages.py
++++ b/scripts/jsonextractimages.py
+@@ -38,7 +38,7 @@ pngSignature = "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"
+
+
+ def dumpSurfaces(state, memberName):
+- for name, imageObj in state[memberName].iteritems():
++ for name, imageObj in state[memberName].items():
+ data = imageObj['__data__']
+ data = base64.b64decode(data)
+
+diff --git a/scripts/leaks.py b/scripts/leaks.py
+new file mode 100755
+index 00000000..325af1e2
+--- /dev/null
++++ b/scripts/leaks.py
+@@ -0,0 +1,163 @@
++#!/usr/bin/env python
++##########################################################################
++#
++# Copyright 2014-2016 VMware, Inc.
++# All Rights Reserved.
++#
++# Permission is hereby granted, free of charge, to any person obtaining a copy
++# of this software and associated documentation files (the "Software"), to deal
++# in the Software without restriction, including without limitation the rights
++# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++# copies of the Software, and to permit persons to whom the Software is
++# furnished to do so, subject to the following conditions:
++#
++# The above copyright notice and this permission notice shall be included in
++# all copies or substantial portions of the Software.
++#
++# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++# THE SOFTWARE.
++#
++##########################################################################/
++
++
++import subprocess
++import sys
++import os.path
++import optparse
++import re
++
++import unpickle
++
++
++class LeakDetector(unpickle.Unpickler):
++
++ def __init__(self, apitrace, trace):
++
++ cmd = [apitrace, 'pickle', '--symbolic', trace]
++ p = subprocess.Popen(args = cmd, stdout = subprocess.PIPE)
++
++ unpickle.Unpickler.__init__(self, p.stdout)
++
++ self.numContexts = 0
++
++ # a map of maps
++ self.objectDicts = {}
++
++ def parse(self):
++ unpickle.Unpickler.parse(self)
++
++ # Reached the end of the trace -- dump any live objects
++ self.dumpLeaks("<EOF>")
++
++ genDelRegExp = re.compile('^gl(Gen|Delete)(Buffers|Textures|FrameBuffers|RenderBuffers)[A-Z]*$')
++
++ def handleCall(self, call):
++ # Ignore calls without side effects
++ if call.flags & unpickle.CALL_FLAG_NO_SIDE_EFFECTS:
++ return
++
++ # Dump call for debugging:
++ if 0:
++ sys.stderr.write('%s\n' % call)
++
++ mo = self.genDelRegExp.match(call.functionName)
++ if mo:
++ verb = mo.group(1)
++ subject = mo.group(2)
++
++ subject = subject.lower().rstrip('s')
++ objectDict = self.objectDicts.setdefault(subject, {})
++
++ if verb == 'Gen':
++ self.handleGenerate(call, objectDict)
++ elif verb == 'Delete':
++ self.handleDelete(call, objectDict)
++ else:
++ assert 0
++
++ # TODO: Track labels via glObjectLabel* calls
++
++ if call.functionName in [
++ 'CGLCreateContext',
++ 'eglCreateContext',
++ 'glXCreateContext',
++ 'glXCreateNewContext',
++ 'glXCreateContextAttribsARB',
++ 'glXCreateContextWithConfigSGIX',
++ 'wglCreateContext',
++ 'wglCreateContextAttribsARB',
++ ]:
++ # FIXME: Ignore failing context creation calls
++ self.numContexts += 1
++
++ if call.functionName in [
++ 'CGLDestroyContext',
++ 'glXDestroyContext',
++ 'eglDestroyContext',
++ 'wglDeleteContext',
++ ]:
++ assert self.numContexts > 0
++ self.numContexts -= 1
++ if self.numContexts == 0:
++ self.dumpLeaks(call.no)
++
++ def handleGenerate(self, call, objectDict):
++ n, names = call.argValues()
++ for i in range(n):
++ name = names[i]
++ objectDict[name] = call.no
++ # TODO: Keep track of call stack backtrace too
++
++ def handleDelete(self, call, objectDict):
++ n, names = call.argValues()
++ for i in range(n):
++ name = names[i]
++ try:
++ del objectDict[name]
++ except KeyError:
++ # Ignore if texture name was never generated
++ pass
++
++ def dumpLeaks(self, currentCallNo):
++ for kind, objectDict in self.objectDicts.items():
++ self.dumpNamespaceLeaks(currentCallNo, objectDict, kind)
++
++ def dumpNamespaceLeaks(self, currentCallNo, objectDict, kind):
++ for name, creationCallNo in (sorted(iter(objectDict.items()),key=lambda t: t[1])):
++ sys.stderr.write('%u: error: %s %u was not destroyed until %s\n' % (creationCallNo, kind, name, currentCallNo))
++ objectDict.clear()
++
++
++def main():
++ '''Main program.
++ '''
++
++ # Parse command line options
++ optparser = optparse.OptionParser(
++ usage='\n\t%prog [options] TRACE',
++ version='%%prog')
++ optparser.add_option(
++ '-a', '--apitrace', metavar='PROGRAM',
++ type='string', dest='apitrace', default='apitrace',
++ help='apitrace command [default: %default]')
++
++ options, args = optparser.parse_args(sys.argv[1:])
++ if len(args) != 1:
++ optparser.error("incorrect number of arguments")
++
++ inTrace = args[0]
++ if not os.path.isfile(inTrace):
++ sys.stderr.write("error: `%s` does not exist\n" % inTrace)
++ sys.exit(1)
++
++ detector = LeakDetector(options.apitrace, inTrace)
++ detector.parse()
++
++
++if __name__ == '__main__':
++ main()
+diff --git a/scripts/profileshader.py b/scripts/profileshader.py
+index 3c490a0e..5c2a58fb 100755
+--- a/scripts/profileshader.py
++++ b/scripts/profileshader.py
+@@ -58,13 +58,13 @@ def process(stream, groupField):
+ continue
+
+ if fields[callCol] == 'call':
+- callId = long(fields[callIdCol])
+- duration = long(fields[gpuDuraCol])
++ callId = int(fields[callIdCol])
++ duration = int(fields[gpuDuraCol])
+ group = fields[groupCol]
+
+ maxGroupLen = max(maxGroupLen, len(group))
+
+- if times.has_key(group):
++ if group in times:
+ times[group]['draws'] += 1
+ times[group]['duration'] += duration
+
+@@ -74,7 +74,7 @@ def process(stream, groupField):
+ else:
+ times[group] = {'draws': 1, 'duration': duration, 'longest': callId, 'longestDuration': duration}
+
+- times = sorted(times.items(), key=lambda x: x[1]['duration'], reverse=True)
++ times = sorted(list(times.items()), key=lambda x: x[1]['duration'], reverse=True)
+
+ if groupField == 'program':
+ groupTitle = 'Shader[id]'
+@@ -84,9 +84,9 @@ def process(stream, groupField):
+ groupTitle = groupField.center(maxGroupLen)
+ groupLine = '-' * maxGroupLen
+
+- print '+-%s-+--------------+--------------------+--------------+-------------+' % groupLine
+- print '| %s | Draws [#] | Duration [ns] v | Per Call[ns] | Longest[id] |' % groupTitle
+- print '+-%s-+--------------+--------------------+--------------+-------------+' % groupLine
++ print('+-%s-+--------------+--------------------+--------------+-------------+' % groupLine)
++ print('| %s | Draws [#] | Duration [ns] v | Per Call[ns] | Longest[id] |' % groupTitle)
++ print('+-%s-+--------------+--------------------+--------------+-------------+' % groupLine)
+
+ for group in times:
+ id = str(group[0]).rjust(maxGroupLen)
+@@ -94,9 +94,9 @@ def process(stream, groupField):
+ dura = str(group[1]['duration']).rjust(18)
+ perCall = str(group[1]['duration'] / group[1]['draws']).rjust(12)
+ longest = str(group[1]['longest']).rjust(11)
+- print "| %s | %s | %s | %s | %s |" % (id, draw, dura, perCall, longest)
++ print("| %s | %s | %s | %s | %s |" % (id, draw, dura, perCall, longest))
+
+- print '+-%s-+--------------+--------------------+--------------+-------------+' % groupLine
++ print('+-%s-+--------------+--------------------+--------------+-------------+' % groupLine)
+
+
+ def main():
+diff --git a/scripts/retracediff.py b/scripts/retracediff.py
+index bb5aa7f5..8105f536 100755
+--- a/scripts/retracediff.py
++++ b/scripts/retracediff.py
+@@ -83,12 +83,12 @@ class Retracer:
+ self.retraceExe,
+ ] + args + self.args
+ if self.env:
+- for name, value in self.env.iteritems():
++ for name, value in self.env.items():
+ sys.stderr.write('%s=%s ' % (name, value))
+ sys.stderr.write(' '.join(cmd) + '\n')
+ try:
+ return subprocess.Popen(cmd, env=self.env, stdout=stdout, stderr=NULL)
+- except OSError, ex:
++ except OSError as ex:
+ sys.stderr.write('error: failed to execute %s: %s\n' % (cmd[0], ex.strerror))
+ sys.exit(1)
+
+@@ -160,7 +160,7 @@ def read_pnm(stream):
+ while line.startswith('#'):
+ comment += line[1:]
+ line = stream.readline()
+- width, height = map(int, line.strip().split())
++ width, height = list(map(int, line.strip().split()))
+ maximum = int(stream.readline().strip())
+ if bytesPerChannel == 1:
+ assert maximum == 255
+diff --git a/scripts/snapdiff.py b/scripts/snapdiff.py
+index 59ec870e..b0d5f757 100755
+--- a/scripts/snapdiff.py
++++ b/scripts/snapdiff.py
+@@ -40,6 +40,7 @@ from PIL import Image
+ from PIL import ImageChops
+ from PIL import ImageEnhance
+ from PIL import ImageFilter
++from functools import reduce
+
+
+ thumbSize = 320
+@@ -50,12 +51,12 @@ class Comparer:
+ '''Image comparer.'''
+
+ def __init__(self, ref_image, src_image, alpha = False):
+- if isinstance(ref_image, basestring):
++ if isinstance(ref_image, str):
+ self.ref_im = Image.open(ref_image)
+ else:
+ self.ref_im = ref_image
+
+- if isinstance(src_image, basestring):
++ if isinstance(src_image, str):
+ self.src_im = Image.open(src_image)
+ else:
+ self.src_im = src_image
+@@ -106,7 +107,7 @@ class Comparer:
+ # Compute absolute error
+
+ if self.size_mismatch():
+- return sys.maxint
++ return sys.maxsize
+
+ # TODO: this is approximate due to the grayscale conversion
+ h = self.diff.convert('L').histogram()
+diff --git a/scripts/tracediff.py b/scripts/tracediff.py
+index f111322a..0cd9c8c6 100755
+--- a/scripts/tracediff.py
++++ b/scripts/tracediff.py
+@@ -237,7 +237,7 @@ class BlobReplacer(Rebuilder):
+ return Blob(len(obj), hash(str(obj)))
+
+ def visitCall(self, call):
+- call.args = map(self.visit, call.args)
++ call.args = list(map(self.visit, call.args))
+ call.ret = self.visit(call.ret)
+
+
+@@ -312,7 +312,7 @@ class PythonDiffer(Differ):
+ elif tag == 'equal':
+ self.equal(alo, ahi, blo, bhi)
+ else:
+- raise ValueError, 'unknown tag %s' % (tag,)
++ raise ValueError('unknown tag %s' % (tag,))
+
+ def isjunk(self, call):
+ return call.functionName == 'glGetError' and call.ret in ('GL_NO_ERROR', 0)
+@@ -338,12 +338,12 @@ class PythonDiffer(Differ):
+ elif tag == 'equal':
+ self.replace_similar(_alo, _ahi, _blo, _bhi)
+ else:
+- raise ValueError, 'unknown tag %s' % (tag,)
++ raise ValueError('unknown tag %s' % (tag,))
+
+ def replace_similar(self, alo, ahi, blo, bhi):
+ assert alo < ahi and blo < bhi
+ assert ahi - alo == bhi - blo
+- for i in xrange(0, bhi - blo):
++ for i in range(0, bhi - blo):
+ self.highlighter.write('| ')
+ a_call = self.a[alo + i]
+ b_call = self.b[blo + i]
+@@ -355,7 +355,7 @@ class PythonDiffer(Differ):
+ self.highlighter.write('(')
+ sep = ''
+ numArgs = max(len(a_call.args), len(b_call.args))
+- for j in xrange(numArgs):
++ for j in range(numArgs):
+ self.highlighter.write(sep)
+ try:
+ a_argName, a_argVal = a_call.args[j]
+@@ -402,7 +402,7 @@ class PythonDiffer(Differ):
+ def delete(self, alo, ahi, blo, bhi):
+ assert alo < ahi
+ assert blo == bhi
+- for i in xrange(alo, ahi):
++ for i in range(alo, ahi):
+ call = self.a[i]
+ self.highlighter.write('- ')
+ self.dumpCallNos(call.no, None)
+@@ -413,7 +413,7 @@ class PythonDiffer(Differ):
+ def insert(self, alo, ahi, blo, bhi):
+ assert alo == ahi
+ assert blo < bhi
+- for i in xrange(blo, bhi):
++ for i in range(blo, bhi):
+ call = self.b[i]
+ self.highlighter.write('+ ')
+ self.dumpCallNos(None, call.no)
+@@ -425,7 +425,7 @@ class PythonDiffer(Differ):
+ return
+ assert alo < ahi and blo < bhi
+ assert ahi - alo == bhi - blo
+- for i in xrange(0, bhi - blo):
++ for i in range(0, bhi - blo):
+ self.highlighter.write(' ')
+ a_call = self.a[alo + i]
+ b_call = self.b[blo + i]
+diff --git a/scripts/unpickle.py b/scripts/unpickle.py
+index 334c1a01..86891d29 100755
+--- a/scripts/unpickle.py
++++ b/scripts/unpickle.py
+@@ -38,7 +38,7 @@ import optparse
+ import sys
+ import time
+ import re
+-import cPickle as pickle
++import pickle as pickle
+
+
+ # Same as trace_model.hpp's call flags
+@@ -58,7 +58,7 @@ CALL_FLAG_MARKER_POP = (1 << 10)
+ class Pointer(long):
+
+ def __str__(self):
+- if self == 0L:
++ if self == 0:
+ return 'NULL'
+ else:
+ return hex(self).rstrip('L')
+@@ -73,7 +73,7 @@ class Visitor:
+ self.dispatch[type(None)] = self.visitNone
+ self.dispatch[bool] = self.visitBool
+ self.dispatch[int] = self.visitInt
+- self.dispatch[long] = self.visitInt
++ self.dispatch[int] = self.visitInt
+ self.dispatch[float] = self.visitFloat
+ self.dispatch[str] = self.visitStr
+ self.dispatch[tuple] = self.visitTuple
+@@ -140,18 +140,18 @@ class Dumper(Visitor):
+ return repr(obj)
+
+ def visitTuple(self, obj):
+- return '(' + ', '.join(itertools.imap(self.visit, obj)) + ')'
++ return '(' + ', '.join(map(self.visit, obj)) + ')'
+
+ def visitList(self, obj):
+ if len(obj) == 1:
+ return '&' + self.visit(obj[0])
+- return '{' + ', '.join(itertools.imap(self.visit, obj)) + '}'
++ return '{' + ', '.join(map(self.visit, obj)) + '}'
+
+ def visitItems(self, items):
+ return ', '.join(['%s = %s' % (name, self.visit(value)) for name, value in items])
+
+ def visitDict(self, obj):
+- return '{' + self.visitItems(obj.iteritems()) + '}'
++ return '{' + self.visitItems(iter(obj.items())) + '}'
+
+ def visitByteArray(self, obj):
+ return 'blob(%u)' % len(obj)
+@@ -167,7 +167,7 @@ class Hasher(Visitor):
+ return obj
+
+ def visitIterable(self, obj):
+- return tuple(itertools.imap(self.visit, obj))
++ return tuple(map(self.visit, obj))
+
+ def visitByteArray(self, obj):
+ return str(obj)
+@@ -268,7 +268,7 @@ class Counter(Unpickler):
+ def parse(self):
+ Unpickler.parse(self)
+
+- functionFrequencies = self.functionFrequencies.items()
++ functionFrequencies = list(self.functionFrequencies.items())
+ functionFrequencies.sort(lambda (name1, freq1), (name2, freq2): cmp(freq1, freq2))
+ for name, frequency in functionFrequencies:
+ sys.stdout.write('%8u %s\n' % (frequency, name))
+diff --git a/specs/cglapi.py b/specs/cglapi.py
+index 69faeeb4..5d61886f 100644
+--- a/specs/cglapi.py
++++ b/specs/cglapi.py
+@@ -29,9 +29,9 @@ http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/
+ """
+
+
+-from stdapi import *
+-from glapi import *
+-from glapi import glapi
++from .stdapi import *
++from .glapi import *
++from .glapi import glapi
+
+ IOSurfaceRef = Opaque("IOSurfaceRef")
+ CGLContextObj = Opaque("CGLContextObj")
+diff --git a/specs/d2d1.py b/specs/d2d1.py
+index dacbea69..9bae43c5 100644
+--- a/specs/d2d1.py
++++ b/specs/d2d1.py
+@@ -25,9 +25,9 @@
+ ##########################################################################/
+
+
+-from winapi import *
+-from dxgi import DXGI_FORMAT, IDXGISurface
+-from dwrite import *
++from .winapi import *
++from .dxgi import DXGI_FORMAT, IDXGISurface
++from .dwrite import *
+
+
+
+diff --git a/specs/d3d.py b/specs/d3d.py
+index 0dde09f4..4b7244b2 100644
+--- a/specs/d3d.py
++++ b/specs/d3d.py
+@@ -25,10 +25,10 @@
+
+ """d3d.h"""
+
+-from winapi import *
+-from ddraw import *
+-from d3dtypes import *
+-from d3dcaps import *
++from .winapi import *
++from .ddraw import *
++from .d3dtypes import *
++from .d3dcaps import *
+
+ d3dnextFlags = Flags(DWORD, [
+ "D3DNEXT_NEXT",
+diff --git a/specs/d3d10.py b/specs/d3d10.py
+index 2161a5fd..e22bc230 100644
+--- a/specs/d3d10.py
++++ b/specs/d3d10.py
+@@ -24,8 +24,8 @@
+ ##########################################################################/
+
+
+-from dxgi import *
+-from d3d10sdklayers import *
++from .dxgi import *
++from .d3d10sdklayers import *
+
+
+ HRESULT = MAKE_HRESULT([
+diff --git a/specs/d3d10sdklayers.py b/specs/d3d10sdklayers.py
+index aad53f04..82beb721 100644
+--- a/specs/d3d10sdklayers.py
++++ b/specs/d3d10sdklayers.py
+@@ -24,7 +24,7 @@
+ ##########################################################################/
+
+
+-from dxgi import *
++from .dxgi import *
+
+
+ D3D10_DEBUG_FEATURE = Flags(UINT, [
+diff --git a/specs/d3d11.py b/specs/d3d11.py
+index f704b062..0a28caa3 100644
+--- a/specs/d3d11.py
++++ b/specs/d3d11.py
+@@ -24,8 +24,8 @@
+ ##########################################################################/
+
+
+-from dxgi import *
+-from d3d11sdklayers import *
++from .dxgi import *
++from .d3d11sdklayers import *
+
+
+ HRESULT = MAKE_HRESULT([
+diff --git a/specs/d3d11sdklayers.py b/specs/d3d11sdklayers.py
+index 907c4b09..97d07750 100644
+--- a/specs/d3d11sdklayers.py
++++ b/specs/d3d11sdklayers.py
+@@ -24,7 +24,7 @@
+ ##########################################################################/
+
+
+-from dxgi import *
++from .dxgi import *
+
+
+ ID3D11DeviceChild = Interface("ID3D11DeviceChild", IUnknown)
+diff --git a/specs/d3d8.py b/specs/d3d8.py
+index 2dbf1140..400af498 100644
+--- a/specs/d3d8.py
++++ b/specs/d3d8.py
+@@ -25,9 +25,9 @@
+
+ """d3d8.h"""
+
+-from winapi import *
+-from d3d8types import *
+-from d3d8caps import *
++from .winapi import *
++from .d3d8types import *
++from .d3d8caps import *
+
+
+ D3DSHADER8 = Blob(Const(DWORD), "_shaderSize(pFunction)")
+diff --git a/specs/d3d8caps.py b/specs/d3d8caps.py
+index 1af1a19f..b7ee5873 100644
+--- a/specs/d3d8caps.py
++++ b/specs/d3d8caps.py
+@@ -25,8 +25,8 @@
+
+ """d3d8caps.h"""
+
+-from winapi import *
+-from d3d8types import *
++from .winapi import *
++from .d3d8types import *
+
+ D3DCAPS = Flags(DWORD, [
+ "D3DCAPS_READ_SCANLINE",
+diff --git a/specs/d3d8types.py b/specs/d3d8types.py
+index fe58a0cd..a2482328 100644
+--- a/specs/d3d8types.py
++++ b/specs/d3d8types.py
+@@ -25,7 +25,7 @@
+
+ """d3d8types.h"""
+
+-from winapi import *
++from .winapi import *
+
+ D3DCOLOR = Alias("D3DCOLOR", DWORD)
+
+diff --git a/specs/d3d9.py b/specs/d3d9.py
+index 21015149..68dcaca2 100644
+--- a/specs/d3d9.py
++++ b/specs/d3d9.py
+@@ -25,9 +25,9 @@
+
+ """d3d9.h"""
+
+-from winapi import *
+-from d3d9types import *
+-from d3d9caps import *
++from .winapi import *
++from .d3d9types import *
++from .d3d9caps import *
+
+
+ D3DSHADER9 = Blob(Const(DWORD), "_shaderSize(pFunction)")
+diff --git a/specs/d3d9caps.py b/specs/d3d9caps.py
+index b3582879..541263b6 100644
+--- a/specs/d3d9caps.py
++++ b/specs/d3d9caps.py
+@@ -25,8 +25,8 @@
+
+ """d3d9caps.h"""
+
+-from winapi import *
+-from d3d9types import *
++from .winapi import *
++from .d3d9types import *
+
+ D3DVS20CAPS = Flags(DWORD, [
+ "D3DVS20CAPS_PREDICATION",
+diff --git a/specs/d3d9types.py b/specs/d3d9types.py
+index 2545a767..c9847030 100644
+--- a/specs/d3d9types.py
++++ b/specs/d3d9types.py
+@@ -26,7 +26,7 @@
+
+ """d3d9types.h"""
+
+-from winapi import *
++from .winapi import *
+
+ D3DCOLOR = Alias("D3DCOLOR", DWORD)
+
+diff --git a/specs/d3dcaps.py b/specs/d3dcaps.py
+index 0fa9f1cc..88725067 100644
+--- a/specs/d3dcaps.py
++++ b/specs/d3dcaps.py
+@@ -25,8 +25,8 @@
+
+ """d3dcaps.h"""
+
+-from winapi import *
+-from d3dtypes import *
++from .winapi import *
++from .d3dtypes import *
+
+ D3DTRANSFORMCAPS = Flags(DWORD, [
+ "D3DTRANSFORMCAPS_CLIP",
+diff --git a/specs/d3dtypes.py b/specs/d3dtypes.py
+index e1507975..ba460022 100644
+--- a/specs/d3dtypes.py
++++ b/specs/d3dtypes.py
+@@ -25,7 +25,7 @@
+
+ """d3dtypes.h"""
+
+-from winapi import *
++from .winapi import *
+
+ D3DVALUE = Float
+ LPD3DVALUE = Pointer(D3DVALUE)
+diff --git a/specs/dcommon.py b/specs/dcommon.py
+index 21659a5e..6324db3a 100644
+--- a/specs/dcommon.py
++++ b/specs/dcommon.py
+@@ -24,7 +24,7 @@
+ ##########################################################################/
+
+
+-from winapi import *
++from .winapi import *
+
+
+ DWRITE_MEASURING_MODE = Enum("DWRITE_MEASURING_MODE", [
+diff --git a/specs/dcomp.py b/specs/dcomp.py
+new file mode 100644
+index 00000000..b139a89e
+--- /dev/null
++++ b/specs/dcomp.py
+@@ -0,0 +1,303 @@
++##########################################################################
++#
++# Copyright 2009-2016 VMware, Inc.
++# All Rights Reserved.
++#
++# Permission is hereby granted, free of charge, to any person obtaining a copy
++# of this software and associated documentation files (the "Software"), to deal
++# in the Software without restriction, including without limitation the rights
++# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++# copies of the Software, and to permit persons to whom the Software is
++# furnished to do so, subject to the following conditions:
++#
++# The above copyright notice and this permission notice shall be included in
++# all copies or substantial portions of the Software.
++#
++# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++# THE SOFTWARE.
++#
++##########################################################################/
++
++
++from .dxgi import *
++from .d2d1 import D2D_MATRIX_3X2_F, D2D_RECT_F
++from .d3d9types import D3DMATRIX
++from .d2d1 import D2D1_COMPOSITE_MODE
++
++DCOMPOSITION_BITMAP_INTERPOLATION_MODE = Enum('DCOMPOSITION_BITMAP_INTERPOLATION_MODE', [
++ 'DCOMPOSITION_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR',
++ 'DCOMPOSITION_BITMAP_INTERPOLATION_MODE_LINEAR',
++ 'DCOMPOSITION_BITMAP_INTERPOLATION_MODE_INHERIT',
++])
++
++DCOMPOSITION_BORDER_MODE = Enum('DCOMPOSITION_BORDER_MODE', [
++ 'DCOMPOSITION_BORDER_MODE_SOFT',
++ 'DCOMPOSITION_BORDER_MODE_HARD',
++ 'DCOMPOSITION_BORDER_MODE_INHERIT',
++])
++
++DCOMPOSITION_COMPOSITE_MODE = Enum('DCOMPOSITION_COMPOSITE_MODE', [
++ 'DCOMPOSITION_COMPOSITE_MODE_SOURCE_OVER',
++ 'DCOMPOSITION_COMPOSITE_MODE_DESTINATION_INVERT',
++ 'DCOMPOSITION_COMPOSITE_MODE_INHERIT',
++])
++
++DCOMPOSITION_FRAME_STATISTICS = Struct('DCOMPOSITION_FRAME_STATISTICS', [
++ (LARGE_INTEGER, 'lastFrameTime'),
++ (DXGI_RATIONAL, 'currentCompositionRate'),
++ (LARGE_INTEGER, 'currentTime'),
++ (LARGE_INTEGER, 'timeFrequency'),
++ (LARGE_INTEGER, 'nextEstimatedFrameTime'),
++])
++
++COMPOSITIONOBJECT = Flags(DWORD, [
++ 'COMPOSITIONOBJECT_ALL_ACCESS', # 0x0003
++ 'COMPOSITIONOBJECT_READ', # 0x0001
++ 'COMPOSITIONOBJECT_WRITE', # 0x0002
++])
++
++IDCompositionAnimation = Interface('IDCompositionAnimation', IUnknown)
++IDCompositionDevice = Interface('IDCompositionDevice', IUnknown)
++IDCompositionTarget = Interface('IDCompositionTarget', IUnknown)
++IDCompositionVisual = Interface('IDCompositionVisual', IUnknown)
++IDCompositionEffect = Interface('IDCompositionEffect', IUnknown)
++IDCompositionEffectGroup = Interface('IDCompositionEffectGroup', IDCompositionEffect)
++IDCompositionTransform3D = Interface('IDCompositionTransform3D', IDCompositionEffect)
++IDCompositionTransform = Interface('IDCompositionTransform', IDCompositionTransform3D)
++IDCompositionTranslateTransform = Interface('IDCompositionTranslateTransform', IDCompositionTransform)
++IDCompositionTranslateTransform3D = Interface('IDCompositionTranslateTransform3D', IDCompositionTransform3D)
++IDCompositionScaleTransform = Interface('IDCompositionScaleTransform', IDCompositionTransform)
++IDCompositionScaleTransform3D = Interface('IDCompositionScaleTransform3D', IDCompositionTransform3D)
++IDCompositionRotateTransform = Interface('IDCompositionRotateTransform', IDCompositionTransform)
++IDCompositionRotateTransform3D = Interface('IDCompositionRotateTransform3D', IDCompositionTransform3D)
++IDCompositionSkewTransform = Interface('IDCompositionSkewTransform', IDCompositionTransform)
++IDCompositionMatrixTransform = Interface('IDCompositionMatrixTransform', IDCompositionTransform)
++IDCompositionMatrixTransform3D = Interface('IDCompositionMatrixTransform3D', IDCompositionTransform3D)
++IDCompositionClip = Interface('IDCompositionClip', IUnknown)
++IDCompositionRectangleClip = Interface('IDCompositionRectangleClip', IDCompositionClip)
++IDCompositionSurface = Interface('IDCompositionSurface', IUnknown)
++IDCompositionVirtualSurface = Interface('IDCompositionVirtualSurface', IDCompositionSurface)
++
++IDCompositionAnimation.methods += [
++ StdMethod(HRESULT, 'Reset', []),
++ StdMethod(HRESULT, 'SetAbsoluteBeginTime', [(LARGE_INTEGER, 'beginTime')]),
++ StdMethod(HRESULT, 'AddCubic', [(Double, 'beginOffset'), (Float, 'constantCoefficient'), (Float, 'linearCoefficient'), (Float, 'quadraticCoefficient'), (Float, 'cubicCoefficient')]),
++ StdMethod(HRESULT, 'AddSinusoidal', [(Double, 'beginOffset'), (Float, 'bias'), (Float, 'amplitude'), (Float, 'frequency'), (Float, 'phase')]),
++ StdMethod(HRESULT, 'AddRepeat', [(Double, 'beginOffset'), (Double, 'durationToRepeat')]),
++ StdMethod(HRESULT, 'End', [(Double, 'endOffset'), (Float, 'endValue')]),
++]
++
++IDCompositionDevice.methods += [
++ StdMethod(HRESULT, 'Commit', []),
++ StdMethod(HRESULT, 'WaitForCommitCompletion', []),
++ StdMethod(HRESULT, 'GetFrameStatistics', [Out(Pointer(DCOMPOSITION_FRAME_STATISTICS), 'statistics')]),
++ StdMethod(HRESULT, 'CreateTargetForHwnd', [(HWND, 'hwnd'), (BOOL, 'topmost'), Out(Pointer(ObjPointer(IDCompositionTarget)), 'target')]),
++ StdMethod(HRESULT, 'CreateVisual', [Out(Pointer(ObjPointer(IDCompositionVisual)), 'visual')]),
++ StdMethod(HRESULT, 'CreateSurface', [(UINT, 'width'), (UINT, 'height'), (DXGI_FORMAT, 'pixelFormat'), (DXGI_ALPHA_MODE, 'alphaMode'), Out(Pointer(ObjPointer(IDCompositionSurface)), 'surface')]),
++ StdMethod(HRESULT, 'CreateVirtualSurface', [(UINT, 'initialWidth'), (UINT, 'initialHeight'), (DXGI_FORMAT, 'pixelFormat'), (DXGI_ALPHA_MODE, 'alphaMode'), Out(Pointer(ObjPointer(IDCompositionVirtualSurface)), 'virtualSurface')]),
++ StdMethod(HRESULT, 'CreateSurfaceFromHandle', [(HANDLE, 'handle'), Out(Pointer(ObjPointer(IUnknown)), 'surface')]),
++ StdMethod(HRESULT, 'CreateSurfaceFromHwnd', [(HWND, 'hwnd'), Out(Pointer(ObjPointer(IUnknown)), 'surface')]),
++ StdMethod(HRESULT, 'CreateTranslateTransform', [Out(Pointer(ObjPointer(IDCompositionTranslateTransform)), 'translateTransform')]),
++ StdMethod(HRESULT, 'CreateScaleTransform', [Out(Pointer(ObjPointer(IDCompositionScaleTransform)), 'scaleTransform')]),
++ StdMethod(HRESULT, 'CreateRotateTransform', [Out(Pointer(ObjPointer(IDCompositionRotateTransform)), 'rotateTransform')]),
++ StdMethod(HRESULT, 'CreateSkewTransform', [Out(Pointer(ObjPointer(IDCompositionSkewTransform)), 'skewTransform')]),
++ StdMethod(HRESULT, 'CreateMatrixTransform', [Out(Pointer(ObjPointer(IDCompositionMatrixTransform)), 'matrixTransform')]),
++ StdMethod(HRESULT, 'CreateTransformGroup', [(Array(ObjPointer(IDCompositionTransform), 'elements'), 'transforms'), (UINT, 'elements'), Out(Pointer(ObjPointer(IDCompositionTransform)), 'transformGroup')]),
++ StdMethod(HRESULT, 'CreateTranslateTransform3D', [Out(Pointer(ObjPointer(IDCompositionTranslateTransform3D)), 'translateTransform3D')]),
++ StdMethod(HRESULT, 'CreateScaleTransform3D', [Out(Pointer(ObjPointer(IDCompositionScaleTransform3D)), 'scaleTransform3D')]),
++ StdMethod(HRESULT, 'CreateRotateTransform3D', [Out(Pointer(ObjPointer(IDCompositionRotateTransform3D)), 'rotateTransform3D')]),
++ StdMethod(HRESULT, 'CreateMatrixTransform3D', [Out(Pointer(ObjPointer(IDCompositionMatrixTransform3D)), 'matrixTransform3D')]),
++ StdMethod(HRESULT, 'CreateTransform3DGroup', [(Array(ObjPointer(IDCompositionTransform3D), 'elements'), 'transforms3D'), (UINT, 'elements'), Out(Pointer(ObjPointer(IDCompositionTransform3D)), 'transform3DGroup')]),
++ StdMethod(HRESULT, 'CreateEffectGroup', [Out(Pointer(ObjPointer(IDCompositionEffectGroup)), 'effectGroup')]),
++ StdMethod(HRESULT, 'CreateRectangleClip', [Out(Pointer(ObjPointer(IDCompositionRectangleClip)), 'clip')]),
++ StdMethod(HRESULT, 'CreateAnimation', [Out(Pointer(ObjPointer(IDCompositionAnimation)), 'animation')]),
++ StdMethod(HRESULT, 'CheckDeviceState', [Out(Pointer(BOOL), 'pfValid')]),
++]
++
++IDCompositionTarget.methods += [
++ StdMethod(HRESULT, 'SetRoot', [(ObjPointer(IDCompositionVisual), 'visual')]),
++]
++
++IDCompositionVisual.methods += [
++ StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetTransform', [(Reference(Const(D2D_MATRIX_3X2_F)), 'matrix')], overloaded=True),
++ StdMethod(HRESULT, 'SetTransform', [(ObjPointer(IDCompositionTransform), 'transform')], overloaded=True),
++ StdMethod(HRESULT, 'SetTransformParent', [(ObjPointer(IDCompositionVisual), 'visual')]),
++ StdMethod(HRESULT, 'SetEffect', [(ObjPointer(IDCompositionEffect), 'effect')]),
++ StdMethod(HRESULT, 'SetBitmapInterpolationMode', [(DCOMPOSITION_BITMAP_INTERPOLATION_MODE, 'interpolationMode')]),
++ StdMethod(HRESULT, 'SetBorderMode', [(DCOMPOSITION_BORDER_MODE, 'borderMode')]),
++ StdMethod(HRESULT, 'SetClip', [(Reference(Const(D2D_RECT_F)), 'rect')], overloaded=True),
++ StdMethod(HRESULT, 'SetClip', [(ObjPointer(IDCompositionClip), 'clip')], overloaded=True),
++ StdMethod(HRESULT, 'SetContent', [(ObjPointer(IUnknown), 'content')]),
++ StdMethod(HRESULT, 'AddVisual', [(ObjPointer(IDCompositionVisual), 'visual'), (BOOL, 'insertAbove'), (ObjPointer(IDCompositionVisual), 'referenceVisual')]),
++ StdMethod(HRESULT, 'RemoveVisual', [(ObjPointer(IDCompositionVisual), 'visual')]),
++ StdMethod(HRESULT, 'RemoveAllVisuals', []),
++ StdMethod(HRESULT, 'SetCompositeMode', [(DCOMPOSITION_COMPOSITE_MODE, 'compositeMode')]),
++]
++
++IDCompositionTransform.methods += [
++]
++
++IDCompositionTransform3D.methods += [
++]
++
++IDCompositionTranslateTransform.methods += [
++ StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionTranslateTransform3D.methods += [
++ StdMethod(HRESULT, 'SetOffsetX', [(Float, 'offsetX')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetY', [(Float, 'offsetY')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetZ', [(Float, 'offsetZ')], overloaded=True),
++ StdMethod(HRESULT, 'SetOffsetZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionScaleTransform.methods += [
++ StdMethod(HRESULT, 'SetScaleX', [(Float, 'scaleX')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleY', [(Float, 'scaleY')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionScaleTransform3D.methods += [
++ StdMethod(HRESULT, 'SetScaleX', [(Float, 'scaleX')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleY', [(Float, 'scaleY')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleZ', [(Float, 'scaleZ')], overloaded=True),
++ StdMethod(HRESULT, 'SetScaleZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterZ', [(Float, 'centerZ')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionRotateTransform.methods += [
++ StdMethod(HRESULT, 'SetAngle', [(Float, 'angle')], overloaded=True),
++ StdMethod(HRESULT, 'SetAngle', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionRotateTransform3D.methods += [
++ StdMethod(HRESULT, 'SetAngle', [(Float, 'angle')], overloaded=True),
++ StdMethod(HRESULT, 'SetAngle', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetAxisX', [(Float, 'axisX')], overloaded=True),
++ StdMethod(HRESULT, 'SetAxisX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetAxisY', [(Float, 'axisY')], overloaded=True),
++ StdMethod(HRESULT, 'SetAxisY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetAxisZ', [(Float, 'axisZ')], overloaded=True),
++ StdMethod(HRESULT, 'SetAxisZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterZ', [(Float, 'centerZ')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterZ', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionSkewTransform.methods += [
++ StdMethod(HRESULT, 'SetAngleX', [(Float, 'angleX')], overloaded=True),
++ StdMethod(HRESULT, 'SetAngleX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetAngleY', [(Float, 'angleY')], overloaded=True),
++ StdMethod(HRESULT, 'SetAngleY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(Float, 'centerX')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(Float, 'centerY')], overloaded=True),
++ StdMethod(HRESULT, 'SetCenterY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionMatrixTransform.methods += [
++ StdMethod(HRESULT, 'SetMatrix', [(Reference(Const(D2D_MATRIX_3X2_F)), 'matrix')]),
++ StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (Float, 'value')], overloaded=True),
++ StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionMatrixTransform3D.methods += [
++ StdMethod(HRESULT, 'SetMatrix', [(Reference(Const(D3DMATRIX)), 'matrix')]),
++ StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (Float, 'value')], overloaded=True),
++ StdMethod(HRESULT, 'SetMatrixElement', [(Int, 'row'), (Int, 'column'), (ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionEffect.methods += [
++]
++
++IDCompositionEffectGroup.methods += [
++ StdMethod(HRESULT, 'SetOpacity', [(Float, 'opacity')], overloaded=True),
++ StdMethod(HRESULT, 'SetOpacity', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetTransform3D', [(ObjPointer(IDCompositionTransform3D), 'transform3D')]),
++]
++
++IDCompositionClip.methods += [
++]
++
++IDCompositionRectangleClip.methods += [
++ StdMethod(HRESULT, 'SetLeft', [(Float, 'left')], overloaded=True),
++ StdMethod(HRESULT, 'SetLeft', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetTop', [(Float, 'top')], overloaded=True),
++ StdMethod(HRESULT, 'SetTop', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetRight', [(Float, 'right')], overloaded=True),
++ StdMethod(HRESULT, 'SetRight', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottom', [(Float, 'bottom')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottom', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopLeftRadiusX', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopLeftRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopLeftRadiusY', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopLeftRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopRightRadiusX', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopRightRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopRightRadiusY', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetTopRightRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomLeftRadiusX', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomLeftRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomLeftRadiusY', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomLeftRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomRightRadiusX', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomRightRadiusX', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomRightRadiusY', [(Float, 'radius')], overloaded=True),
++ StdMethod(HRESULT, 'SetBottomRightRadiusY', [(ObjPointer(IDCompositionAnimation), 'animation')], overloaded=True),
++]
++
++IDCompositionSurface.methods += [
++ # XXX: riid might be ID2D1DeviceContext
++ StdMethod(HRESULT, 'BeginDraw', [(Pointer(Const(RECT)), 'updateRect'), (REFIID, 'iid'), Out(Pointer(ObjPointer(Void)), 'updateObject'), Out(Pointer(POINT), 'updateOffset')]),
++ StdMethod(HRESULT, 'EndDraw', []),
++ StdMethod(HRESULT, 'SuspendDraw', []),
++ StdMethod(HRESULT, 'ResumeDraw', []),
++ StdMethod(HRESULT, 'Scroll', [(Pointer(Const(RECT)), 'scrollRect'), (Pointer(Const(RECT)), 'clipRect'), (Int, 'offsetX'), (Int, 'offsetY')]),
++]
++
++IDCompositionVirtualSurface.methods += [
++ StdMethod(HRESULT, 'Resize', [(UINT, 'width'), (UINT, 'height')]),
++ StdMethod(HRESULT, 'Trim', [(Array(Const(RECT), 'count'), 'rectangles'), (UINT, 'count')]),
++]
++
++dcomp = Module('dcomp')
++dcomp.addFunctions([
++ StdFunction(HRESULT, 'DCompositionCreateDevice', [(ObjPointer(IDXGIDevice), 'dxgiDevice'), (REFIID, 'iid'), Out(Pointer(ObjPointer(Void)), 'dcompositionDevice')]),
++ StdFunction(HRESULT, 'DCompositionCreateSurfaceHandle', [(COMPOSITIONOBJECT, 'desiredAccess'), (Pointer(SECURITY_ATTRIBUTES), 'securityAttributes'), Out(Pointer(HANDLE), 'surfaceHandle')]),
++])
++dcomp.addInterfaces([
++ IDCompositionDevice,
++])
+diff --git a/specs/ddraw.py b/specs/ddraw.py
+index 99f542fe..5df48be0 100644
+--- a/specs/ddraw.py
++++ b/specs/ddraw.py
+@@ -25,7 +25,7 @@
+
+ """ddraw.h"""
+
+-from winapi import *
++from .winapi import *
+
+ DirectDrawOptSurfaceDescFlags = Flags(DWORD, [
+ "DDOSD_GUID",
+diff --git a/specs/debug.py b/specs/debug.py
+index 0a004741..6ef80f64 100644
+--- a/specs/debug.py
++++ b/specs/debug.py
+@@ -49,7 +49,7 @@ def excepthook(type, value, tb):
+ import traceback, pdb
+ # we are NOT in interactive mode, print the exception...
+ traceback.print_exception(type, value, tb)
+- print
++ print()
+ # ...then start the debugger in post-mortem mode.
+ pdb.pm()
+
+diff --git a/specs/dwrite.py b/specs/dwrite.py
+index 60e5034c..be273f81 100644
+--- a/specs/dwrite.py
++++ b/specs/dwrite.py
+@@ -24,8 +24,8 @@
+ ##########################################################################/
+
+
+-from winapi import *
+-from dcommon import *
++from .winapi import *
++from .dcommon import *
+
+
+ ID2D1SimplifiedGeometrySink = Interface("ID2D1SimplifiedGeometrySink", IUnknown)
+diff --git a/specs/dxgi.py b/specs/dxgi.py
+index 0e880548..040f3bc4 100644
+--- a/specs/dxgi.py
++++ b/specs/dxgi.py
+@@ -25,7 +25,7 @@
+ ##########################################################################/
+
+
+-from winapi import *
++from .winapi import *
+
+
+ DXGI_FORMAT = Enum("DXGI_FORMAT", [
+diff --git a/specs/dxva2.py b/specs/dxva2.py
+index 3936afac..65f5f0c0 100644
+--- a/specs/dxva2.py
++++ b/specs/dxva2.py
+@@ -24,7 +24,7 @@
+ ##########################################################################/
+
+
+-from d3d9 import *
++from .d3d9 import *
+
+
+ HRESULT = MAKE_HRESULT(errors = [
+diff --git a/specs/eglapi.py b/specs/eglapi.py
+index 8379e45e..e1edff06 100644
+--- a/specs/eglapi.py
++++ b/specs/eglapi.py
+@@ -26,9 +26,9 @@
+ """EGL API description."""
+
+
+-from stdapi import *
+-from gltypes import *
+-from eglenum import *
++from .stdapi import *
++from .gltypes import *
++from .eglenum import *
+
+ EGLNativeDisplayType = Opaque("EGLNativeDisplayType")
+ EGLNativeWindowType = Opaque("EGLNativeWindowType")
+diff --git a/specs/eglenum.py b/specs/eglenum.py
+index 8b10868d..e6290fb2 100644
+--- a/specs/eglenum.py
++++ b/specs/eglenum.py
+@@ -28,7 +28,7 @@
+ """EGL enum description"""
+
+
+-from stdapi import *
++from .stdapi import *
+
+ # Most of the following content was produced in a semi-automated fashion by
+ # the scripts/eglenum.sed sed script.
+diff --git a/specs/glapi.py b/specs/glapi.py
+index c0e92b3c..8d20052e 100644
+--- a/specs/glapi.py
++++ b/specs/glapi.py
+@@ -34,9 +34,9 @@ corner cases correctly.
+ """
+
+
+-from stdapi import *
+-from gltypes import *
+-import glparams
++from .stdapi import *
++from .gltypes import *
++from . import glparams
+
+
+ def GlFunction(*args, **kwargs):
+diff --git a/specs/glparams.py b/specs/glparams.py
+index 1bed8a6b..5a036975 100644
+--- a/specs/glparams.py
++++ b/specs/glparams.py
+@@ -27,9 +27,9 @@
+ '''Describe GL parameters.'''
+
+
+-from stdapi import *
++from .stdapi import *
+
+-from gltypes import *
++from .gltypes import *
+
+
+ # Shorthands for the types
+diff --git a/specs/gltypes.py b/specs/gltypes.py
+index a9ffc4a1..631eb868 100644
+--- a/specs/gltypes.py
++++ b/specs/gltypes.py
+@@ -29,7 +29,7 @@
+
+ import platform
+
+-from stdapi import *
++from .stdapi import *
+
+
+ GLboolean = Enum("GLboolean", [
+diff --git a/specs/glxapi.py b/specs/glxapi.py
+index 0d3cd969..f4182799 100644
+--- a/specs/glxapi.py
++++ b/specs/glxapi.py
+@@ -26,8 +26,8 @@
+ """GLX API description."""
+
+
+-from stdapi import *
+-from glapi import *
++from .stdapi import *
++from .glapi import *
+
+ VisualID = Alias("VisualID", UInt32)
+ Display = Opaque("Display *")
+diff --git a/specs/scripts/c2api.py b/specs/scripts/c2api.py
+index 7deb2955..b8aaa81d 100755
+--- a/specs/scripts/c2api.py
++++ b/specs/scripts/c2api.py
+@@ -122,7 +122,7 @@ class DeclParser:
+ self.consume()
+ type = 'Pointer(%s)' % type
+ name = self.consume()
+- print '%s = Alias("%s", %s)' % (name, name, type)
++ print('%s = Alias("%s", %s)' % (name, name, type))
+ if self.match(','):
+ self.consume()
+ else:
+@@ -136,7 +136,7 @@ class DeclParser:
+ name = self.consume()
+ self.consume('{')
+
+- print '%s = Enum("%s", [' % (name, name)
++ print('%s = Enum("%s", [' % (name, name))
+
+ #value = 0
+ while self.lookahead() != '}':
+@@ -148,12 +148,12 @@ class DeclParser:
+ self.consume(',')
+ tags = self.parse_tags()
+ #print ' "%s",\t# %s' % (name, value)
+- print ' "%s",' % (name,)
++ print(' "%s",' % (name,))
+ #value += 1
+ self.consume('}')
+
+- print '])'
+- print
++ print('])')
++ print()
+
+ def parse_value(self, ref_token, constructor):
+ self.consume(ref_token)
+@@ -161,14 +161,14 @@ class DeclParser:
+ name = self.consume()
+ self.consume('{')
+
+- print '%s = %s(%s, [' % (name, constructor, type)
++ print('%s = %s(%s, [' % (name, constructor, type))
+
+ while self.lookahead() != '}':
+ name, value = self.parse_define()
+ self.consume('}')
+
+- print '])'
+- print
++ print('])')
++ print()
+
+ def parse_define(self):
+ self.consume('#')
+@@ -176,18 +176,18 @@ class DeclParser:
+ name = self.consume()
+ value = self.consume()
+ #print ' "%s",\t# %s' % (name, value)
+- print ' "%s",' % (name,)
++ print(' "%s",' % (name,))
+ return name, value
+
+ def parse_struct(self):
+ self.consume('struct')
+ name = self.consume()
+
+- print '%s = Struct("%s", [' % (name, name)
++ print('%s = Struct("%s", [' % (name, name))
+ for type, name in self.parse_members():
+- print ' (%s, "%s"),' % (type, name)
+- print '])'
+- print
++ print(' (%s, "%s"),' % (type, name))
++ print('])')
++ print()
+
+ def parse_union(self):
+ self.consume('union')
+@@ -226,8 +226,8 @@ class DeclParser:
+ base = self.consume()
+ self.consume('{')
+
+- print '%s = Interface("%s", %s)' % (name, name, base)
+- print '%s.methods += [' % (name,)
++ print('%s = Interface("%s", %s)' % (name, name, base))
++ print('%s.methods += [' % (name,))
+
+ while self.lookahead() != '}':
+ if self.lookahead() in ('public', 'private'):
+@@ -238,8 +238,8 @@ class DeclParser:
+ self.consume(';')
+ self.consume('}')
+
+- print ']'
+- print
++ print(']')
++ print()
+
+ def parse_prototype(self, creator = 'Function'):
+ if self.match('extern', 'virtual'):
+@@ -275,7 +275,7 @@ class DeclParser:
+ self.consume()
+ self.consume('0')
+
+- print ' %s(%s, "%s", [%s]%s),' % (creator, ret, name, ', '.join(args), extra)
++ print(' %s(%s, "%s", [%s]%s),' % (creator, ret, name, ', '.join(args), extra))
+
+ def parse_arg(self):
+ tags = self.parse_tags()
+@@ -404,8 +404,8 @@ class DeclParser:
+ type = 'S' + type
+ elif short:
+ type = 'Short'
+- elif long:
+- type = 'Long' * long
++ elif int:
++ type = 'Long' * int
+ else:
+ type = 'Int'
+ if unsigned:
+diff --git a/specs/scripts/cxx2api.py b/specs/scripts/cxx2api.py
+new file mode 100755
+index 00000000..9720615d
+--- /dev/null
++++ b/specs/scripts/cxx2api.py
+@@ -0,0 +1,488 @@
++#!/usr/bin/env python
++
++
++
++copyright = '''
++##########################################################################
++#
++# Copyright 2009-2016 VMware, Inc.
++# All Rights Reserved.
++#
++# Permission is hereby granted, free of charge, to any person obtaining a copy
++# of this software and associated documentation files (the "Software"), to deal
++# in the Software without restriction, including without limitation the rights
++# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++# copies of the Software, and to permit persons to whom the Software is
++# furnished to do so, subject to the following conditions:
++#
++# The above copyright notice and this permission notice shall be included in
++# all copies or substantial portions of the Software.
++#
++# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++# THE SOFTWARE.
++#
++##########################################################################/
++'''
++
++
++#
++# Generates API specs from headers using castxml/pygccxml.
++#
++# Usage:
++#
++# sudo apt-get install castxml mingw-w64-i686-dev
++# pip install 'pygccxml==1.9.1'
++# python specs/scripts/cxx2api.py -Idxsdk/Include -DD2D_USE_C_DEFINITIONS dcomp.h dcomptypes.h dcompanimation.h
++#
++# See also:
++# - http://pygccxml.readthedocs.org/en/develop/index.html
++# - https://github.com/CastXML/CastXML/blob/master/doc/manual/castxml.1.rst
++#
++
++import os.path
++import sys
++import io as StringIO
++import subprocess
++
++from pygccxml import utils
++from pygccxml import parser
++from pygccxml import declarations
++
++from pygccxml.declarations import algorithm
++from pygccxml.declarations import decl_visitor
++from pygccxml.declarations import type_traits
++from pygccxml.declarations import type_visitor
++
++
++class decl_dumper_t(decl_visitor.decl_visitor_t):
++
++ def __init__(self, decl = None):
++ decl_visitor.decl_visitor_t.__init__(self)
++ self.decl = decl
++ self.result = None
++
++ def clone(self):
++ return decl_dumper_t(self.decl)
++
++ def visit_class(self):
++ class_ = self.decl
++ assert class_.class_type in ('struct', 'union')
++ self.result = class_.name
++
++ def visit_class_declaration(self):
++ class_ = self.decl
++ self.result = class_.name
++
++ def visit_typedef(self):
++ typedef = self.decl
++ self.result = typedef.name
++
++ def visit_enumeration(self):
++ self.result = self.decl.name
++
++
++def dump_decl(decl):
++ visitor = decl_dumper_t(decl)
++ algorithm.apply_visitor(visitor, decl)
++ return visitor.result
++
++
++class type_dumper_t(type_visitor.type_visitor_t):
++
++ def __init__(self, type):
++ type_visitor.type_visitor_t.__init__(self)
++ self.type = type
++ self.result = None
++
++ def clone(self):
++ return type_dumper_t(self.type)
++
++ def visit_void(self):
++ self.result = 'Void'
++
++ def visit_char(self):
++ self.result = 'Char'
++
++ def visit_unsigned_char(self):
++ self.result = 'UChar'
++
++ def visit_signed_char(self):
++ self.result = 'SChar'
++
++ def visit_wchar(self):
++ raise NotImplementedError
++
++ def visit_short_int(self):
++ self.result = 'Short'
++
++ def visit_short_unsigned_int(self):
++ self.result = 'UShort'
++
++ def visit_bool(self):
++ raise NotImplementedError
++
++ def visit_int(self):
++ self.result = 'Int'
++
++ def visit_unsigned_int(self):
++ self.result = 'UInt'
++
++ def visit_long_int(self):
++ self.result = 'Long'
++
++ def visit_long_unsigned_int(self):
++ self.result = 'ULong'
++
++ def visit_long_long_int(self):
++ self.result = 'LongLong'
++
++ def visit_long_long_unsigned_int(self):
++ self.result = 'ULongLong'
++
++ def visit_float(self):
++ self.result = "Float"
++
++ def visit_double(self):
++ self.result = "Double"
++
++ def visit_array(self):
++ base_type = dump_type(self.type.base)
++ length = self.type.size
++ try:
++ int(length)
++ except ValueError:
++ length = '"%s"' % length
++ self.result = 'Array(%s, %s)' % (base_type, length)
++
++ def visit_pointer(self):
++ base_type = dump_type(self.type.base)
++ # TODO: Use ObjPointer where appropriate
++ #if isinstance(self.type.base, declarations.cpptypes.declarated_t):
++ # decl = self.type.base.declaration
++ # if isinstance(decl, declarations.typedef.typedef_t):
++ # print(decl.type, type(decl.type))
++ # if isinstance(decl, declarations.class_declaration.class_t):
++ # if decl.public_members:
++ # self.result = 'ObjPointer(%s)' % decl.name
++ # return
++ # if isinstance(decl, declarations.class_declaration.class_declaration_t):
++ # if decl.public_members:
++ # self.result = 'ObjPointer(%s)' % decl.name
++ # return
++ if base_type.startswith('IDComposition') or \
++ base_type.startswith('IDXGI') or \
++ base_type == 'IUnknown':
++ self.result = 'ObjPointer(%s)' % base_type
++ return
++ self.result = 'Pointer(%s)' % base_type
++
++ def visit_reference(self):
++ base_type = dump_type(self.type.base)
++ if base_type == 'Const(IID)':
++ self.result = 'REFIID'
++ elif base_type == 'Const(GUID)':
++ self.result = 'REFGUID'
++ else:
++ self.result = 'Reference(%s)' % base_type
++
++ def visit_const(self):
++ self.result = 'Const(%s)' % dump_type(self.type.base)
++
++ def visit_declarated(self):
++ decl = self.type.declaration
++ self.result = dump_decl(decl)
++
++ def visit_free_function_type(self):
++ self.result = 'Opaque("%s")' % self.type
++
++
++def dump_type(type):
++ visitor = type_dumper_t(type)
++ algorithm.apply_visitor(visitor, type)
++ # XXX: RECT becomes tagRECT somehow
++ if visitor.result == 'tagRECT':
++ return 'RECT'
++ return visitor.result
++
++
++def is_interface(class_):
++ if not class_.name.startswith('I'):
++ return
++ if len(class_.bases) != 1:
++ return False
++ # TODO: Ensure interface derives from IUnknown
++ return True
++
++
++class decl2_dumper_t(decl_visitor.decl_visitor_t):
++
++ def __init__(self, name):
++ decl_visitor.decl_visitor_t.__init__(self)
++
++ self.name = name
++
++ # The current declaration
++ self.decl = None
++
++ self.interfaces = StringIO.StringIO()
++ self.methods = StringIO.StringIO()
++ self.functions = StringIO.StringIO()
++
++ def start(self):
++ print(copyright.strip())
++ print()
++ print()
++ print(r'from winapi import *')
++ print()
++
++ def finish(self):
++ sys.stdout.write(self.interfaces.getvalue())
++ sys.stdout.write('\n')
++ sys.stdout.write(self.methods.getvalue())
++
++ name = self.name
++ sys.stdout.write('%s = Module(%r)\n' % (name, name))
++ sys.stdout.write('%s.addFunctions([\n' % (name,))
++ sys.stdout.write(self.functions.getvalue())
++ sys.stdout.write('])\n\n')
++
++ def clone(self):
++ return decl_dumper_t(self.decl)
++
++ def visit_class(self):
++ class_ = self.decl
++ assert class_.class_type in ('struct', 'union')
++
++ if is_interface(class_):
++ self.visit_interface()
++ elif class_.name != '':
++ self.visit_struct(class_.name, class_)
++
++ def visit_struct(self, decl_name, decl):
++ struct = decl
++ print(r'%s = Struct(%r, [' % (decl_name, decl_name))
++ for variable in struct.variables(allow_empty=True):
++ var_type = dump_type(variable.decl_type)
++ print(r' (%s, %r),' % (var_type, variable.name))
++ print(r'])')
++ print()
++
++ def visit_interface(self):
++ class_ = self.decl
++ assert len(class_.bases) == 1
++ base = class_.bases[0]
++
++ s = self.interfaces
++ s.write('%s = Interface(%r, %s)\n' % (class_.name, class_.name, base.related_class.name))
++
++ s = self.methods
++ s.write('%s.methods += [\n' % (class_.name,))
++ for member in class_.public_members:
++ if member.virtuality != 'pure virtual':
++ continue
++ ret_type = dump_type(member.return_type)
++ arg_types = self.convert_args(member.arguments)
++ s.write(' StdMethod(%s, %r, [%s]),\n' % (ret_type, member.name, arg_types))
++ s.write(']\n\n')
++
++ def convert_args(self, args):
++ # TODO: use __attribute__ ((annotate ("out")))
++ # See also:
++ # - https://github.com/CastXML/CastXML/issues/25
++ # XXX: Requires a castxml version newer than the one in Ubuntu 15.10
++ arg_types = []
++ for arg in args:
++ if arg.attributes is not None:
++ sys.stderr.write('warning: found %s attribute %r\n' % (arg.name, arg.attributes))
++ res_arg_type = dump_type(arg.decl_type)
++ res_arg = '(%s, %r)' % (res_arg_type, arg.name)
++
++ # Infer output arguments
++ if res_arg_type.startswith('Pointer(') and \
++ not res_arg_type.startswith('Pointer(Const('):
++ res_arg = 'Out' + res_arg
++
++ arg_types.append(res_arg)
++
++ arg_types = ', '.join(arg_types)
++ return arg_types
++
++ def visit_class_declaration(self):
++ pass
++
++ def visit_typedef(self):
++ typedef = self.decl
++ base_type = dump_type(typedef.decl_type)
++ if base_type == typedef.name:
++ # Ignore `typedef struct Foo Foo;`
++ return
++ if base_type == '':
++ if isinstance(typedef.decl_type, declarations.cpptypes.declarated_t):
++ base_decl = typedef.decl_type.declaration
++ self.visit_struct(typedef.name, base_decl)
++ return
++ print(r'%s = Alias(%r, %s)' % (typedef.name, typedef.name, base_type))
++ print()
++
++ def visit_enumeration(self):
++ enum = self.decl
++ print(r'%s = Enum(%r, [' % (enum.name, enum.name))
++ for name, value in enum.values:
++ print(r' %r,' % (name,))
++ print(r'])')
++ print()
++
++ def visit_variable(self):
++ pass
++
++ def visit_free_function(self):
++ function = self.decl
++ if function.has_inline:
++ return
++
++ s = self.functions
++ ret_type = dump_type(function.return_type)
++ arg_types = self.convert_args(function.arguments)
++ s.write(' StdFunction(%s, %r, [%s]),\n' % (ret_type, function.name, arg_types))
++
++ def visit_free_operator(self):
++ pass
++
++
++def main():
++ defines = []
++ includes = []
++ cxxflags = [
++ '-Wno-unknown-attributes',
++ '-Wno-unused-value',
++ '-Wno-macro-redefined',
++ ]
++ compiler = 'g++'
++
++ args = sys.argv[1:]
++ while args and args[0].startswith('-'):
++ arg = args.pop(0)
++ if arg.startswith('-I'):
++ include = arg[2:]
++ includes.append(include)
++ elif arg.startswith('-D'):
++ define = arg[2:]
++ defines.append(define)
++ else:
++ sys.stderr.write('error: unknown option %r\n' % arg)
++ sys.exit(1)
++
++ winsdk = True
++ if winsdk:
++ # Set up Clang compiler flags to use MinGW runtime
++ # http://stackoverflow.com/a/19839946
++ p = subprocess.Popen(
++ ["x86_64-w64-mingw32-g++", "-x", "c++", "-E", "-Wp,-v", '-', '-fsyntax-only'],
++ stdin=open(os.devnull, 'rt'),
++ stdout=open(os.devnull, 'wt'),
++ stderr=subprocess.PIPE)
++ includes.append('/usr/share/castxml/clang/include')
++ for line in p.stderr:
++ if line.startswith(' '):
++ include = line.strip()
++ if os.path.isdir(include):
++ if os.path.exists(os.path.join(include, 'ia32intrin.h')):
++ # XXX: We must use Clang's intrinsic headers
++ continue
++ includes.append(os.path.normpath(include))
++
++ winver = 0x0602
++
++ defines += [
++ # emulate MinGW
++ '__MINGW32__',
++ '_WIN32',
++ '_WIN64',
++ '__declspec(x)=',
++ # Avoid namespace pollution when including windows.h
++ # http://support.microsoft.com/kb/166474
++ 'WIN32_LEAN_AND_MEAN',
++ # Set Windows version to 8.1
++ '_WIN32_WINNT=0x%04X' % winver,
++ 'WINVER=0x%04X' % winver,
++ 'NTDDI_VERSION=0x%04X0000' % winver,
++ # Prevent headers from requiring a rpcndr.h version beyond MinGW's
++ '__REQUIRED_RPCNDR_H_VERSION__=475',
++ # Avoid C++ helper classes
++ 'D3D10_NO_HELPERS',
++ 'D3D11_NO_HELPERS',
++ 'D3D11_VIDEO_NO_HELPERS',
++ ]
++
++ # XXX: Change compiler?
++ #compiler = 'cl'
++
++ # XXX: This doesn't seem to work well
++ cxxflags += [
++ #'-m32',
++ #'-target', 'x86_64-pc-mingw32',
++ ]
++
++ sys.stderr.write('Include path:\n')
++ for include in includes:
++ sys.stderr.write(' %s\n' % include)
++ sys.stderr.write('Definitions:\n')
++ for define in defines:
++ sys.stderr.write(' %s\n' % define)
++
++ import logging
++ utils.loggers.set_level(logging.DEBUG)
++
++ # Find the location of the xml generator (castxml or gccxml)
++ generator_path, generator_name = utils.find_xml_generator("castxml")
++
++ # Configure the xml generator
++ config = parser.xml_generator_configuration_t(
++ xml_generator_path=generator_path,
++ xml_generator=generator_name,
++ define_symbols = defines,
++ include_paths = includes,
++ cflags = ' '.join(cxxflags),
++ compiler = compiler,
++ #keep_xml = True,
++ )
++
++ script_dir = os.path.dirname(__file__)
++ headers = [
++ os.path.join(script_dir, '..', '..', 'compat', 'winsdk_compat.h'),
++ os.path.join(script_dir, 'cxx2api.h'),
++ ]
++ main_header = args[0]
++ headers.append(main_header)
++
++ decls = parser.parse(headers, config, parser.COMPILATION_MODE.ALL_AT_ONCE)
++ global_ns = declarations.get_global_namespace(decls)
++
++ def decl_filter(decl):
++ location = decl.location
++ if location is None:
++ return False
++ return os.path.basename(location.file_name) in list(map(os.path.basename, args))
++
++ module, _ = os.path.splitext(main_header)
++ visitor = decl2_dumper_t(module)
++ visitor.start()
++ for decl in global_ns.declarations:
++ if not decl_filter(decl):
++ continue
++
++ if sys.stdout.isatty():
++ print('# ' + str(decl))
++
++ visitor.decl = decl
++ algorithm.apply_visitor(visitor, decl)
++ visitor.finish()
++
++
++if __name__ == '__main__':
++ main()
+diff --git a/specs/scripts/spec2api.py b/specs/scripts/spec2api.py
+index f21b08d5..7fb395a4 100755
+--- a/specs/scripts/spec2api.py
++++ b/specs/scripts/spec2api.py
+@@ -181,8 +181,8 @@ class SpecParser(LineParser):
+ category = self.prefix.upper() + '_' + category
+ if category != self.category:
+ if self.category is not None:
+- print
+- print ' # %s' % category
++ print()
++ print(' # %s' % category)
+ self.category = category
+
+ if self.prefix == 'wgl':
+@@ -190,7 +190,7 @@ class SpecParser(LineParser):
+ else:
+ constructor = 'GlFunction'
+
+- print ' %s(%s, "%s", [%s]%s),' % (constructor, ret_type, function_name, ', '.join(args), extra)
++ print(' %s(%s, "%s", [%s]%s),' % (constructor, ret_type, function_name, ', '.join(args), extra))
+
+ array_re = re.compile(r'^array\s+\[(.*)\]$')
+
+diff --git a/specs/scripts/txt2api.py b/specs/scripts/txt2api.py
+index 6cd99dd9..e9469d3c 100755
+--- a/specs/scripts/txt2api.py
++++ b/specs/scripts/txt2api.py
+@@ -31,7 +31,7 @@
+ import sys
+ import re
+ import optparse
+-from urllib2 import urlopen
++from urllib.request import urlopen
+
+
+ def stderr(x):
+@@ -116,7 +116,7 @@ class TxtParser(LineParser):
+ self.consume()
+ line = self.consume()
+ self.parse_section(line)
+- print
++ print()
+
+ def parse_section(self, name):
+ if name == 'Name Strings':
+@@ -136,7 +136,7 @@ class TxtParser(LineParser):
+ name = line.strip()
+ if name.startswith('EGL_'):
+ self.prefix = ''
+- print ' # %s' % name
++ print(' # %s' % name)
+
+ def skip_c_comments(self):
+ while not self.eof():
+@@ -192,7 +192,7 @@ class TxtParser(LineParser):
+ args.append(arg)
+ if self.tokens[0] == ',':
+ self.tokens.pop(0)
+- print ' GlFunction(%s, "%s", [%s]%s),' % (ret, name, ', '.join(args), extra)
++ print(' GlFunction(%s, "%s", [%s]%s),' % (ret, name, ', '.join(args), extra))
+
+ def parse_arg(self):
+ type = self.parse_type()
+diff --git a/specs/scripts/xml2api.py b/specs/scripts/xml2api.py
+index e3820e09..f09fe0bf 100755
+--- a/specs/scripts/xml2api.py
++++ b/specs/scripts/xml2api.py
+@@ -126,7 +126,7 @@ def processRequire(node, filterName):
+
+
+ def printPrototypes(prototypes, extensionName, functionNames, skip=set()):
+- print ' # %s' % extensionName
++ print(' # %s' % extensionName)
+
+ if extensionName == 'GL_EXT_direct_state_access':
+ functionNames.sort()
+@@ -134,9 +134,9 @@ def printPrototypes(prototypes, extensionName, functionNames, skip=set()):
+ for functionName in functionNames:
+ if functionName not in skip:
+ prototype = prototypes[functionName]
+- print ' %s,' % prototype
++ print(' %s,' % prototype)
+
+- print
++ print()
+
+
+ def main():
+diff --git a/specs/scripts/xml2enum.py b/specs/scripts/xml2enum.py
+index 6d49e11c..cb2c4ae9 100755
+--- a/specs/scripts/xml2enum.py
++++ b/specs/scripts/xml2enum.py
+@@ -58,8 +58,8 @@ for arg in sys.argv[1:]:
+ params.setdefault(value, name)
+
+
+- values = params.keys()
++ values = list(params.keys())
+ values.sort()
+ for value in values:
+ name = params[value]
+- print ' "%s",\t\t# 0x%04X' % (name, value)
++ print(' "%s",\t\t# 0x%04X' % (name, value))
+diff --git a/specs/scripts/xml2glparams.py b/specs/scripts/xml2glparams.py
+index 7e2bc351..805aac86 100755
+--- a/specs/scripts/xml2glparams.py
++++ b/specs/scripts/xml2glparams.py
+@@ -58,8 +58,8 @@ for arg in sys.argv[1:]:
+ params.setdefault(value, name)
+
+
+- values = params.keys()
++ values = list(params.keys())
+ values.sort()
+ for value in values:
+ name = params[value]
+- print ' ("",\tX,\t1,\t"%s"),\t# 0x%04X' % (name, value)
++ print(' ("",\tX,\t1,\t"%s"),\t# 0x%04X' % (name, value))
+diff --git a/specs/stdapi.py b/specs/stdapi.py
+index c72c264b..487b6c1e 100644
+--- a/specs/stdapi.py
++++ b/specs/stdapi.py
+@@ -26,7 +26,9 @@
+ """C basic types"""
+
+
+-import debug
++import sys
++
++from . import debug
+
+
+ class Type:
+@@ -266,6 +268,10 @@ class Bitmask(Type):
+ Flags = Bitmask
+
+
++def EnumFlags(name, values):
++ return Flags(Alias(name, UInt), values)
++
++
+ class Array(Type):
+
+ def __init__(self, type_, length):
+@@ -273,7 +279,7 @@ class Array(Type):
+ self.type = type_
+ self.length = length
+ if not isinstance(length, int):
+- assert isinstance(length, basestring)
++ assert isinstance(length, str)
+ # Check if length is actually a valid constant expression
+ try:
+ eval(length, {}, {})
+@@ -329,6 +335,10 @@ class Struct(Type):
+ def visit(self, visitor, *args, **kwargs):
+ return visitor.visitStruct(self, *args, **kwargs)
+
++ def getMemberByName(self, name):
++ memberNames = [memberName for memberType, memberName in self.members]
++ return memberNames.index(name)
++
+
+ def Union(kindExpr, kindTypes, contextLess=True):
+ switchTypes = []
+@@ -372,7 +382,7 @@ def InOut(type, name):
+
+ class Function:
+
+- def __init__(self, type, name, args, call = '', fail = None, sideeffects=True, internal=False):
++ def __init__(self, type, name, args, call = '', fail = None, sideeffects=True, internal=False, overloaded=False):
+ self.type = type
+ self.name = name
+
+@@ -394,6 +404,7 @@ class Function:
+ self.fail = fail
+ self.sideeffects = sideeffects
+ self.internal = internal
++ self.overloaded = overloaded
+
+ def prototype(self, name=None):
+ if name is not None:
+@@ -414,6 +425,17 @@ class Function:
+ s += ")"
+ return s
+
++ def sigName(self):
++ name = self.name
++ if self.overloaded:
++ # suffix used to make overloaded functions/methods unique
++ suffix = ','.join([str(arg.type) for arg in self.args])
++ suffix = suffix.replace(' *', '*')
++ suffix = suffix.replace(' &', '&')
++ suffix = '(' + suffix + ')'
++ name += suffix
++ return name
++
+ def argNames(self):
+ return [arg.name for arg in self.args]
+
+@@ -463,14 +485,12 @@ class Interface(Type):
+ yield method
+ for method in self.methods:
+ yield method
+- raise StopIteration
+
+ def iterBases(self):
+ iface = self
+ while iface is not None:
+ yield iface
+ iface = iface.base
+- raise StopIteration
+
+ def hasBase(self, *bases):
+ for iface in self.iterBases():
+@@ -484,14 +504,13 @@ class Interface(Type):
+ yield iface, method
+ for method in self.methods:
+ yield self, method
+- raise StopIteration
+
+
+ class Method(Function):
+
+- def __init__(self, type, name, args, call = '', const=False, sideeffects=True):
++ def __init__(self, type, name, args, call = '', const=False, sideeffects=True, overloaded=False):
+ assert call == '__stdcall'
+- Function.__init__(self, type, name, args, call = call, sideeffects=sideeffects)
++ Function.__init__(self, type, name, args, call = call, sideeffects=sideeffects, overloaded=overloaded)
+ for index in range(len(self.args)):
+ self.args[index].index = index + 1
+ self.const = const
+@@ -576,7 +595,7 @@ class Polymorphic(Type):
+ else:
+ cases[i].append(case)
+
+- return zip(cases, types)
++ return list(zip(cases, types))
+
+
+ def EnumPolymorphic(enumName, switchExpr, switchTypes, defaultType, contextLess=True):
+@@ -734,7 +753,7 @@ class Rebuilder(Visitor):
+ if pointer_type is pointer.type:
+ return pointer
+ else:
+- return LinearPointer(pointer_type)
++ return LinearPointer(pointer_type, self.size)
+
+ def visitReference(self, reference):
+ reference_type = self.visit(reference.type)
+@@ -792,7 +811,7 @@ class MutableRebuilder(Rebuilder):
+
+ def visitReference(self, reference):
+ # Strip out references
+- return reference.type
++ return self.visit(reference.type)
+
+
+ class Traverser(Visitor):
+@@ -894,7 +913,7 @@ class ExpanderMixin:
+
+ def expand(self, expr):
+ # Expand a C expression, replacing certain variables
+- if not isinstance(expr, basestring):
++ if not isinstance(expr, str):
+ return expr
+ variables = {}
+
+diff --git a/specs/wglapi.py b/specs/wglapi.py
+index f24a8d21..563f0269 100644
+--- a/specs/wglapi.py
++++ b/specs/wglapi.py
+@@ -27,9 +27,9 @@
+ """WGL API description"""
+
+
+-from glapi import *
+-from winapi import *
+-from wglenum import *
++from .glapi import *
++from .winapi import *
++from .wglenum import *
+
+
+ wglapi = Module("WGL")
+diff --git a/specs/wglenum.py b/specs/wglenum.py
+index ad9bbccf..6bc4e74d 100644
+--- a/specs/wglenum.py
++++ b/specs/wglenum.py
+@@ -27,7 +27,7 @@
+ """WGL enum description"""
+
+
+-from stdapi import *
++from .stdapi import *
+
+ WGLenum = FakeEnum(Int, [
+ "WGL_GPU_VENDOR_AMD", # 0x1F00
+diff --git a/specs/winapi.py b/specs/winapi.py
+index 445039ff..e66d063a 100644
+--- a/specs/winapi.py
++++ b/specs/winapi.py
+@@ -26,7 +26,7 @@
+ """Win32 API type description."""
+
+
+-from stdapi import *
++from .stdapi import *
+
+
+ SHORT = Alias("SHORT", Short)
+diff --git a/wrappers/CMakeLists.txt b/wrappers/CMakeLists.txt
+index 2ceac332..7a452ed4 100644
+--- a/wrappers/CMakeLists.txt
++++ b/wrappers/CMakeLists.txt
+@@ -79,7 +79,7 @@ if (WIN32)
+ include_directories (BEFORE SYSTEM ${DirectX_D3D_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT ddrawtrace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
+ DEPENDS
+ ddrawtrace.py
+ dlltrace.py
+@@ -109,7 +109,7 @@ if (WIN32)
+ include_directories (BEFORE SYSTEM ${DirectX_D3D9_INCLUDE_DIR} ${DirectX_D3D8_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3d8trace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
+ DEPENDS
+ d3d8trace.py
+ dlltrace.py
+@@ -143,7 +143,7 @@ if (WIN32)
+ include_directories (BEFORE SYSTEM ${DirectX_D3D9_INCLUDE_DIR})
+ add_custom_command (
+ OUTPUT d3d9trace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
+ DEPENDS
+ d3d9trace.py
+ dlltrace.py
+@@ -179,7 +179,7 @@ if (WIN32)
+
+ add_custom_command (
+ OUTPUT dxgitrace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgitrace.py > ${CMAKE_CURRENT_BINARY_DIR}/dxgitrace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dxgitrace.py > ${CMAKE_CURRENT_BINARY_DIR}/dxgitrace.cpp
+ DEPENDS
+ dxgitrace.py
+ dlltrace.py
+@@ -216,7 +216,7 @@ if (WIN32)
+
+ add_custom_command (
+ OUTPUT d2d1trace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d2d1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d2d1trace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d2d1trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d2d1trace.cpp
+ DEPENDS
+ d2d1trace.py
+ trace.py
+@@ -241,7 +241,7 @@ if (WIN32)
+ # opengl32.dll
+ add_custom_command (
+ OUTPUT wgltrace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
+ DEPENDS
+ wgltrace.py
+ gltrace.py
+@@ -278,7 +278,7 @@ elseif (APPLE)
+ # OpenGL framework
+ add_custom_command (
+ OUTPUT cgltrace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
+ DEPENDS
+ cgltrace.py
+ gltrace.py
+@@ -322,7 +322,7 @@ elseif (X11_FOUND)
+ # libGL.so
+ add_custom_command (
+ OUTPUT glxtrace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
+ DEPENDS
+ glxtrace.py
+ gltrace.py
+@@ -372,7 +372,7 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
+ # libEGL.so/libGL.so
+ add_custom_command (
+ OUTPUT egltrace.cpp
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
++ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
+ DEPENDS
+ egltrace.py
+ gltrace.py
+diff --git a/wrappers/cgltrace.py b/wrappers/cgltrace.py
+index 6c72f696..02b3c518 100644
+--- a/wrappers/cgltrace.py
++++ b/wrappers/cgltrace.py
+@@ -43,55 +43,55 @@ class CglTracer(GlTracer):
+ if function.name == 'CGLReleaseContext':
+ # Unlike other GL APIs like EGL or GLX, CGL will make the context
+ # not current if it's the current context.
+- print ' if (_CGLGetContextRetainCount(ctx) == 1) {'
+- print ' if (gltrace::releaseContext((uintptr_t)ctx)) {'
+- print ' if (_CGLGetCurrentContext() == ctx) {'
+- print ' gltrace::clearContext();'
+- print ' }'
+- print ' }'
+- print ' }'
++ print(' if (_CGLGetContextRetainCount(ctx) == 1) {')
++ print(' if (gltrace::releaseContext((uintptr_t)ctx)) {')
++ print(' if (_CGLGetCurrentContext() == ctx) {')
++ print(' gltrace::clearContext();')
++ print(' }')
++ print(' }')
++ print(' }')
+
+ if function.name == 'CGLDestroyContext':
+ # The same rule applies here about the as for CGLReleaseContext.
+- print ' if (gltrace::releaseContext((uintptr_t)ctx)) {'
+- print ' if (_CGLGetCurrentContext() == ctx) {'
+- print ' gltrace::clearContext();'
+- print ' }'
+- print ' }'
++ print(' if (gltrace::releaseContext((uintptr_t)ctx)) {')
++ print(' if (_CGLGetCurrentContext() == ctx) {')
++ print(' gltrace::clearContext();')
++ print(' }')
++ print(' }')
+
+ GlTracer.traceFunctionImplBody(self, function)
+
+ if function.name == 'CGLCreateContext':
+- print ' if (_result == kCGLNoError) {'
+- print ' gltrace::createContext((uintptr_t)*ctx);'
+- print ' }'
++ print(' if (_result == kCGLNoError) {')
++ print(' gltrace::createContext((uintptr_t)*ctx);')
++ print(' }')
+
+ if function.name == 'CGLSetCurrentContext':
+- print ' if (_result == kCGLNoError) {'
+- print ' if (ctx != NULL) {'
+- print ' gltrace::setContext((uintptr_t)ctx);'
+- print ' } else {'
+- print ' gltrace::clearContext();'
+- print ' }'
+- print ' }'
++ print(' if (_result == kCGLNoError) {')
++ print(' if (ctx != NULL) {')
++ print(' gltrace::setContext((uintptr_t)ctx);')
++ print(' } else {')
++ print(' gltrace::clearContext();')
++ print(' }')
++ print(' }')
+
+ if function.name == 'CGLRetainContext':
+- print ' gltrace::retainContext((uintptr_t)ctx);'
++ print(' gltrace::retainContext((uintptr_t)ctx);')
+
+
+ if __name__ == '__main__':
+- print
+- print '#include <stdlib.h>'
+- print '#include <string.h>'
+- print
+- print '#include "trace_writer_local.hpp"'
+- print
+- print '// To validate our prototypes'
+- print '#define GL_GLEXT_PROTOTYPES'
+- print
+- print '#include "glproc.hpp"'
+- print '#include "glsize.hpp"'
+- print
++ print()
++ print('#include <stdlib.h>')
++ print('#include <string.h>')
++ print()
++ print('#include "trace_writer_local.hpp"')
++ print()
++ print('// To validate our prototypes')
++ print('#define GL_GLEXT_PROTOTYPES')
++ print()
++ print('#include "glproc.hpp"')
++ print('#include "glsize.hpp"')
++ print()
+
+ module = Module()
+ module.mergeModule(cglapi)
+@@ -101,7 +101,7 @@ if __name__ == '__main__':
+ tracer = CglTracer()
+ tracer.traceApi(api)
+
+- print r'''
++ print(r'''
+
+ PUBLIC
+ void * gll_noop = 0;
+@@ -130,4 +130,4 @@ _init(void) {
+ setenv("SDL_OPENGL_LIBRARY", "/System/Library/Frameworks/OpenGL.framework/OpenGL", 1);
+ }
+
+-'''
++''')
+diff --git a/wrappers/d2d1trace.py b/wrappers/d2d1trace.py
+index 26223005..2176341f 100644
+--- a/wrappers/d2d1trace.py
++++ b/wrappers/d2d1trace.py
+@@ -31,15 +31,15 @@ from specs.d2d1 import d2d1
+
+
+ if __name__ == '__main__':
+- print '#include "guids_defs.hpp"'
+- print
+- print '#include "trace_writer_local.hpp"'
+- print '#include "os.hpp"'
+- print
+- print '#define DWRITE_EXPORT WINAPI'
+- print
+- print '#include "d2dimports.hpp"'
+- print
++ print('#include "guids_defs.hpp"')
++ print()
++ print('#include "trace_writer_local.hpp"')
++ print('#include "os.hpp"')
++ print()
++ print('#define DWRITE_EXPORT WINAPI')
++ print()
++ print('#include "d2dimports.hpp"')
++ print()
+
+ api = API()
+ api.addModule(d2d1)
+diff --git a/wrappers/d3d8trace.py b/wrappers/d3d8trace.py
+index 2903c48f..11afbca5 100644
+--- a/wrappers/d3d8trace.py
++++ b/wrappers/d3d8trace.py
+@@ -34,7 +34,7 @@ class D3D8Tracer(DllTracer):
+ def serializeArgValue(self, function, arg):
+ # Dump shaders as strings
+ if arg.type is D3DSHADER8:
+- print ' DumpShader(trace::localWriter, %s);' % (arg.name)
++ print(' DumpShader(trace::localWriter, %s);' % (arg.name))
+ return
+
+ DllTracer.serializeArgValue(self, function, arg)
+@@ -55,32 +55,32 @@ class D3D8Tracer(DllTracer):
+
+ def implementWrapperInterfaceMethodBody(self, interface, base, method):
+ if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
+- print ' if (_MappedSize && m_pbData) {'
++ print(' if (_MappedSize && m_pbData) {')
+ self.emit_memcpy('(LPBYTE)m_pbData', '_MappedSize')
+- print ' }'
++ print(' }')
+
+ DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
+
+ if method.name in ('Lock', 'LockRect', 'LockBox'):
+ # FIXME: handle recursive locks
+- print ' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {'
+- print ' _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])
+- print ' } else {'
+- print ' m_pbData = NULL;'
+- print ' _MappedSize = 0;'
+- print ' }'
++ print(' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {')
++ print(' _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1]))
++ print(' } else {')
++ print(' m_pbData = NULL;')
++ print(' _MappedSize = 0;')
++ print(' }')
+
+
+ if __name__ == '__main__':
+- print '#define INITGUID'
+- print
+- print '#include "trace_writer_local.hpp"'
+- print '#include "os.hpp"'
+- print
+- print '#include "d3d8imports.hpp"'
+- print '#include "d3d8size.hpp"'
+- print '#include "d3d9shader.hpp"'
+- print
++ print('#define INITGUID')
++ print()
++ print('#include "trace_writer_local.hpp"')
++ print('#include "os.hpp"')
++ print()
++ print('#include "d3d8imports.hpp"')
++ print('#include "d3d8size.hpp"')
++ print('#include "d3d9shader.hpp"')
++ print()
+
+ api = API()
+ api.addModule(d3d8)
+diff --git a/wrappers/d3d9trace.py b/wrappers/d3d9trace.py
+index 0850ba3e..53d5152f 100644
+--- a/wrappers/d3d9trace.py
++++ b/wrappers/d3d9trace.py
+@@ -35,7 +35,7 @@ class D3D9Tracer(DllTracer):
+ def serializeArgValue(self, function, arg):
+ # Dump shaders as strings
+ if arg.type is D3DSHADER9:
+- print ' DumpShader(trace::localWriter, %s);' % (arg.name)
++ print(' DumpShader(trace::localWriter, %s);' % (arg.name))
+ return
+
+ DllTracer.serializeArgValue(self, function, arg)
+@@ -72,49 +72,49 @@ class D3D9Tracer(DllTracer):
+ def implementWrapperInterfaceMethodBody(self, interface, base, method):
+ if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
+ if interface.name in ['IDirect3DTexture9']:
+- print ' std::map<UINT, std::pair<size_t, VOID *> >::iterator it = _MappedData.find(Level);'
+- print ' if (it != _MappedData.end()) {'
++ print(' std::map<UINT, std::pair<size_t, VOID *> >::iterator it = _MappedData.find(Level);')
++ print(' if (it != _MappedData.end()) {')
+ self.emit_memcpy('(LPBYTE)it->second.second', 'it->second.first')
+- print ' _MappedData.erase(it);'
+- print ' }'
++ print(' _MappedData.erase(it);')
++ print(' }')
+ else:
+- print ' if (_MappedSize && m_pbData) {'
++ print(' if (_MappedSize && m_pbData) {')
+ self.emit_memcpy('(LPBYTE)m_pbData', '_MappedSize')
+- print ' }'
++ print(' }')
+
+ DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
+
+ if method.name in ('Lock', 'LockRect', 'LockBox'):
+ if interface.name in ['IDirect3DTexture9']:
+- print ' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {'
+- print ' size_t mappedSize;'
+- print ' VOID * pbData;'
+- print ' _getMapInfo(_this, %s, pbData, mappedSize);' % ', '.join(method.argNames()[:-1])
+- print ' _MappedData[Level] = std::make_pair(mappedSize, pbData);'
+- print ' } else {'
+- print ' _MappedData.erase(Level);'
+- print ' }'
++ print(' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {')
++ print(' size_t mappedSize;')
++ print(' VOID * pbData;')
++ print(' _getMapInfo(_this, %s, pbData, mappedSize);' % ', '.join(method.argNames()[:-1]))
++ print(' _MappedData[Level] = std::make_pair(mappedSize, pbData);')
++ print(' } else {')
++ print(' _MappedData.erase(Level);')
++ print(' }')
+ else:
+ # FIXME: handle recursive locks
+- print ' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {'
+- print ' _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])
+- print ' } else {'
+- print ' m_pbData = NULL;'
+- print ' _MappedSize = 0;'
+- print ' }'
++ print(' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {')
++ print(' _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1]))
++ print(' } else {')
++ print(' m_pbData = NULL;')
++ print(' _MappedSize = 0;')
++ print(' }')
+
+
+ if __name__ == '__main__':
+- print '#define INITGUID'
+- print
+- print '#include "trace_writer_local.hpp"'
+- print '#include "os.hpp"'
+- print
+- print '#include "d3d9imports.hpp"'
+- print '#include "d3d9size.hpp"'
+- print '#include "d3d9shader.hpp"'
+- print '#include "dxva2imports.hpp"'
+- print
++ print('#define INITGUID')
++ print()
++ print('#include "trace_writer_local.hpp"')
++ print('#include "os.hpp"')
++ print()
++ print('#include "d3d9imports.hpp"')
++ print('#include "d3d9size.hpp"')
++ print('#include "d3d9shader.hpp"')
++ print('#include "dxva2imports.hpp"')
++ print()
+
+ d3d9.mergeModule(d3dperf)
+
+diff --git a/wrappers/ddrawtrace.py b/wrappers/ddrawtrace.py
+index 96602d21..da7ffbe7 100644
+--- a/wrappers/ddrawtrace.py
++++ b/wrappers/ddrawtrace.py
+@@ -41,12 +41,12 @@ class DDrawTracer(DllTracer):
+
+
+ if __name__ == '__main__':
+- print '#define INITGUID'
+- print '#include "d3dimports.hpp"'
+- print '#include "trace_writer_local.hpp"'
+- print '#include "d3d7size.hpp"'
+- print '#include "os.hpp"'
+- print
++ print('#define INITGUID')
++ print('#include "d3dimports.hpp"')
++ print('#include "trace_writer_local.hpp"')
++ print('#include "d3d7size.hpp"')
++ print('#include "os.hpp"')
++ print()
+
+ api = API()
+ api.addModule(ddraw)
+diff --git a/wrappers/dlltrace.py b/wrappers/dlltrace.py
+index 26962216..8ac18b0c 100644
+--- a/wrappers/dlltrace.py
++++ b/wrappers/dlltrace.py
+@@ -37,24 +37,24 @@ class DllDispatcher(Dispatcher):
+
+ def dispatchModule(self, module):
+ tag = module.name.upper()
+- print r'HMODULE g_h%sModule = NULL;' % (tag,)
+- print r''
+- print r'static PROC'
+- print r'_get%sProcAddress(LPCSTR lpProcName) {' % tag
+- print r' if (!g_h%sModule) {' % tag
+- print r' char szDll[MAX_PATH] = {0};'
+- print r' if (!GetSystemDirectoryA(szDll, MAX_PATH)) {'
+- print r' return NULL;'
+- print r' }'
+- print r' strcat(szDll, "\\%s.dll");' % module.name
+- print r' g_h%sModule = LoadLibraryA(szDll);' % tag
+- print r' if (!g_h%sModule) {' % tag
+- print r' return NULL;'
+- print r' }'
+- print r' }'
+- print r' return GetProcAddress(g_h%sModule, lpProcName);' % tag
+- print r'}'
+- print r''
++ print(r'HMODULE g_h%sModule = NULL;' % (tag,))
++ print(r'')
++ print(r'static PROC')
++ print(r'_get%sProcAddress(LPCSTR lpProcName) {' % tag)
++ print(r' if (!g_h%sModule) {' % tag)
++ print(r' char szDll[MAX_PATH] = {0};')
++ print(r' if (!GetSystemDirectoryA(szDll, MAX_PATH)) {')
++ print(r' return NULL;')
++ print(r' }')
++ print(r' strcat(szDll, "\\%s.dll");' % module.name)
++ print(r' g_h%sModule = LoadLibraryA(szDll);' % tag)
++ print(r' if (!g_h%sModule) {' % tag)
++ print(r' return NULL;')
++ print(r' }')
++ print(r' }')
++ print(r' return GetProcAddress(g_h%sModule, lpProcName);' % tag)
++ print(r'}')
++ print(r'')
+
+ Dispatcher.dispatchModule(self, module)
+
+diff --git a/wrappers/dxgitrace.py b/wrappers/dxgitrace.py
+index 3edda2c2..134f45d7 100644
+--- a/wrappers/dxgitrace.py
++++ b/wrappers/dxgitrace.py
+@@ -40,47 +40,47 @@ class D3DCommonTracer(DllTracer):
+ def serializeArgValue(self, function, arg):
+ # Dump shaders as strings
+ if isinstance(arg.type, stdapi.Blob) and arg.name.startswith('pShaderBytecode'):
+- print ' DumpShader(trace::localWriter, %s, %s);' % (arg.name, arg.type.size)
++ print(' DumpShader(trace::localWriter, %s, %s);' % (arg.name, arg.type.size))
+ return
+
+ # Serialize the swapchain dimensions
+ if function.name == 'CreateSwapChain' and arg.name == 'pDesc' \
+ or arg.name == 'pSwapChainDesc':
+- print r' DXGI_SWAP_CHAIN_DESC *_pSwapChainDesc = NULL;'
+- print r' DXGI_SWAP_CHAIN_DESC _SwapChainDesc;'
+- print r' if (%s) {' % arg.name
+- print r' _SwapChainDesc = *%s;' % arg.name
++ print(r' DXGI_SWAP_CHAIN_DESC *_pSwapChainDesc = NULL;')
++ print(r' DXGI_SWAP_CHAIN_DESC _SwapChainDesc;')
++ print(r' if (%s) {' % arg.name)
++ print(r' _SwapChainDesc = *%s;' % arg.name)
+ if function.name != 'CreateSwapChain' or not self.interface.name.endswith('DWM'):
+ # Obtain size from the window
+- print r' RECT _rect;'
+- print r' if (GetClientRect(%s->OutputWindow, &_rect)) {' % arg.name
+- print r' if (%s->BufferDesc.Width == 0) {' % arg.name
+- print r' _SwapChainDesc.BufferDesc.Width = _rect.right - _rect.left;'
+- print r' }'
+- print r' if (%s->BufferDesc.Height == 0) {' % arg.name
+- print r' _SwapChainDesc.BufferDesc.Height = _rect.bottom - _rect.top;'
+- print r' }'
+- print r' }'
++ print(r' RECT _rect;')
++ print(r' if (GetClientRect(%s->OutputWindow, &_rect)) {' % arg.name)
++ print(r' if (%s->BufferDesc.Width == 0) {' % arg.name)
++ print(r' _SwapChainDesc.BufferDesc.Width = _rect.right - _rect.left;')
++ print(r' }')
++ print(r' if (%s->BufferDesc.Height == 0) {' % arg.name)
++ print(r' _SwapChainDesc.BufferDesc.Height = _rect.bottom - _rect.top;')
++ print(r' }')
++ print(r' }')
+ else:
+ # Obtain size from the output
+- print r' DXGI_OUTPUT_DESC _OutputDesc;'
+- print r' if (SUCCEEDED(pOutput->GetDesc(&_OutputDesc))) {'
+- print r' _SwapChainDesc.BufferDesc.Width = _OutputDesc.DesktopCoordinates.right - _OutputDesc.DesktopCoordinates.left;'
+- print r' _SwapChainDesc.BufferDesc.Height = _OutputDesc.DesktopCoordinates.bottom - _OutputDesc.DesktopCoordinates.top;'
+- print r' }'
+- print r' _pSwapChainDesc = &_SwapChainDesc;'
+- print r' }'
++ print(r' DXGI_OUTPUT_DESC _OutputDesc;')
++ print(r' if (SUCCEEDED(pOutput->GetDesc(&_OutputDesc))) {')
++ print(r' _SwapChainDesc.BufferDesc.Width = _OutputDesc.DesktopCoordinates.right - _OutputDesc.DesktopCoordinates.left;')
++ print(r' _SwapChainDesc.BufferDesc.Height = _OutputDesc.DesktopCoordinates.bottom - _OutputDesc.DesktopCoordinates.top;')
++ print(r' }')
++ print(r' _pSwapChainDesc = &_SwapChainDesc;')
++ print(r' }')
+ self.serializeValue(arg.type, '_pSwapChainDesc')
+ return
+
+ # Serialize object names
+ if function.name == 'SetPrivateData' and arg.name == 'pData':
+ iid = function.args[0].name
+- print r' if (%s == WKPDID_D3DDebugObjectName) {' % iid
+- print r' trace::localWriter.writeString(static_cast<const char *>(pData), DataSize);'
+- print r' } else {'
++ print(r' if (%s == WKPDID_D3DDebugObjectName) {' % iid)
++ print(r' trace::localWriter.writeString(static_cast<const char *>(pData), DataSize);')
++ print(r' } else {')
+ DllTracer.serializeArgValue(self, function, arg)
+- print r' }'
++ print(r' }')
+ return
+
+ DllTracer.serializeArgValue(self, function, arg)
+@@ -110,47 +110,47 @@ class D3DCommonTracer(DllTracer):
+ if method.getArgByName('pInitialData'):
+ pDesc1 = method.getArgByName('pDesc1')
+ if pDesc1 is not None:
+- print r' %s pDesc = pDesc1;' % (pDesc1.type,)
++ print(r' %s pDesc = pDesc1;' % (pDesc1.type,))
+
+ if method.name in ('Map', 'Unmap'):
+ # On D3D11 Map/Unmap is not a resource method, but a context method instead.
+ resourceArg = method.getArgByName('pResource')
+ if resourceArg is None:
+- print ' _MAP_DESC & _MapDesc = m_MapDesc;'
++ print(' _MAP_DESC & _MapDesc = m_MapDesc;')
+ else:
+- print ' _MAP_DESC & _MapDesc = m_MapDescs[std::pair<%s, UINT>(pResource, Subresource)];' % resourceArg.type
++ print(' _MAP_DESC & _MapDesc = m_MapDescs[std::pair<%s, UINT>(pResource, Subresource)];' % resourceArg.type)
+
+ if method.name == 'Unmap':
+- print ' if (_MapDesc.Size && _MapDesc.pData) {'
++ print(' if (_MapDesc.Size && _MapDesc.pData) {')
+ self.emit_memcpy('_MapDesc.pData', '_MapDesc.Size')
+- print ' }'
++ print(' }')
+
+ DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
+
+ if method.name == 'Map':
+ # NOTE: recursive locks are explicitely forbidden
+- print ' if (SUCCEEDED(_result)) {'
+- print ' _getMapDesc(_this, %s, _MapDesc);' % ', '.join(method.argNames())
+- print ' } else {'
+- print ' _MapDesc.pData = NULL;'
+- print ' _MapDesc.Size = 0;'
+- print ' }'
++ print(' if (SUCCEEDED(_result)) {')
++ print(' _getMapDesc(_this, %s, _MapDesc);' % ', '.join(method.argNames()))
++ print(' } else {')
++ print(' _MapDesc.pData = NULL;')
++ print(' _MapDesc.Size = 0;')
++ print(' }')
+
+
+ if __name__ == '__main__':
+- print r'#define INITGUID'
+- print
+- print r'#include "trace_writer_local.hpp"'
+- print r'#include "os.hpp"'
+- print
+- print r'#include "d3dcommonshader.hpp"'
+- print
+- print r'#include "d3d10imports.hpp"'
+- print r'#include "d3d10size.hpp"'
+- print r'#include "d3d11imports.hpp"'
+- print r'#include "d3d11size.hpp"'
+- print r'#include "d3d9imports.hpp" // D3DPERF_*'
+- print
++ print(r'#define INITGUID')
++ print()
++ print(r'#include "trace_writer_local.hpp"')
++ print(r'#include "os.hpp"')
++ print()
++ print(r'#include "d3dcommonshader.hpp"')
++ print()
++ print(r'#include "d3d10imports.hpp"')
++ print(r'#include "d3d10size.hpp"')
++ print(r'#include "d3d11imports.hpp"')
++ print(r'#include "d3d11size.hpp"')
++ print(r'#include "d3d9imports.hpp" // D3DPERF_*')
++ print()
+
+ api = API()
+ api.addModule(dxgi.dxgi)
+diff --git a/wrappers/egltrace.py b/wrappers/egltrace.py
+index 1fcb0fd6..f5b61c0c 100644
+--- a/wrappers/egltrace.py
++++ b/wrappers/egltrace.py
+@@ -50,239 +50,239 @@ class EglTracer(GlTracer):
+
+ def traceFunctionImplBody(self, function):
+ if function.name == 'glTexDirectMapVIV':
+- print ' // prevent loop call'
+- print ' glTexDirectVIVMap(target, width, height, format, Logical, Physical);'
++ print(' // prevent loop call')
++ print(' glTexDirectVIVMap(target, width, height, format, Logical, Physical);')
+ return
+
+ if function.name == 'glTexDirectInvalidateVIV':
+- print ' // get current texture'
+- print ' GLint tex = 0;'
+- print ' int32_t size = 0;'
+- print ' int32_t ysize = 0;'
+- print ' int32_t usize = 0;'
+- print ' int32_t vsize = 0;'
+- print ' _glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);'
+- print ' if(tex == 0)'
+- print ' {'
+- print ' return;'
+- print ' }'
+- print ' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];'
+- print ' switch(data.format){'
+- print ' case GL_VIV_YV12:'
+- print ' case GL_VIV_I420:'
+- print ' ysize=data.width * data.height;'
+- print ' usize=ysize/4;'
+- print ' vsize=usize;'
+- print ' break;'
+- print ' case GL_VIV_NV12:'
+- print ' case GL_VIV_NV21:'
+- print ' ysize=data.width * data.height;'
+- print ' usize=ysize/2;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' case GL_RGBA:'
+- print ' case GL_BGRA_EXT:'
+- print ' ysize=data.width * data.height *4;'
+- print ' usize=0;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' case GL_RGB:'
+- print ' ysize=data.width * data.height *3;'
+- print ' usize=0;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' case GL_VIV_YUY2:'
+- print ' case GL_VIV_UYVY:'
+- print ' case GL_RGB565_OES:'
+- print ' case GL_LUMINANCE8_ALPHA8_EXT:'
+- print ' ysize=data.width * data.height *2;'
+- print ' usize=0;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' case GL_ALPHA:'
+- print ' ysize=data.width * data.height;'
+- print ' usize=0;'
+- print ' vsize=0;'
+- print ' break;'
+- print ' default:'
+- print ' return;'
+- print ' }'
+- print ' if (NULL==(GLvoid*)data.logical) {'
+- print ' if (ysize > 0) {'
++ print(' // get current texture')
++ print(' GLint tex = 0;')
++ print(' int32_t size = 0;')
++ print(' int32_t ysize = 0;')
++ print(' int32_t usize = 0;')
++ print(' int32_t vsize = 0;')
++ print(' _glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);')
++ print(' if(tex == 0)')
++ print(' {')
++ print(' return;')
++ print(' }')
++ print(' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];')
++ print(' switch(data.format){')
++ print(' case GL_VIV_YV12:')
++ print(' case GL_VIV_I420:')
++ print(' ysize=data.width * data.height;')
++ print(' usize=ysize/4;')
++ print(' vsize=usize;')
++ print(' break;')
++ print(' case GL_VIV_NV12:')
++ print(' case GL_VIV_NV21:')
++ print(' ysize=data.width * data.height;')
++ print(' usize=ysize/2;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' case GL_RGBA:')
++ print(' case GL_BGRA_EXT:')
++ print(' ysize=data.width * data.height *4;')
++ print(' usize=0;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' case GL_RGB:')
++ print(' ysize=data.width * data.height *3;')
++ print(' usize=0;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' case GL_VIV_YUY2:')
++ print(' case GL_VIV_UYVY:')
++ print(' case GL_RGB565_OES:')
++ print(' case GL_LUMINANCE8_ALPHA8_EXT:')
++ print(' ysize=data.width * data.height *2;')
++ print(' usize=0;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' case GL_ALPHA:')
++ print(' ysize=data.width * data.height;')
++ print(' usize=0;')
++ print(' vsize=0;')
++ print(' break;')
++ print(' default:')
++ print(' return;')
++ print(' }')
++ print(' if (NULL==(GLvoid*)data.logical) {')
++ print(' if (ysize > 0) {')
+ self.emit_memcpy_opt('(GLvoid*)data.planes[0]', 'ysize')
+- print ' }'
+- print ' if (usize > 0) {'
++ print(' }')
++ print(' if (usize > 0) {')
+ self.emit_memcpy_opt('(GLvoid*)data.planes[1]', 'usize')
+- print ' }'
+- print ' if (vsize > 0) {'
++ print(' }')
++ print(' if (vsize > 0) {')
+ self.emit_memcpy_opt('(GLvoid*)data.planes[2]', 'vsize')
+- print ' }'
+- print ' } else {'
+- print ' size = ysize + usize + vsize;'
+- print ' if (size > 0) {'
++ print(' }')
++ print(' } else {')
++ print(' size = ysize + usize + vsize;')
++ print(' if (size > 0) {')
+ self.emit_memcpy_opt('(GLvoid*)data.logical', 'size')
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
+
+ if function.name == 'eglGetProcAddress':
+- print ' procname = __get_alias_func_name(procname);'
++ print(' procname = __get_alias_func_name(procname);')
+
+ GlTracer.traceFunctionImplBody(self, function)
+
+ if function.name == 'glTexDirectVIV':
+- print ' // get current texture'
+- print ' GLint tex = 0;'
+- print ' _glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);'
+- print ' if(tex != 0)'
+- print ' {'
+- print ' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];'
+- print ' data.width = width;'
+- print ' data.height = height;'
+- print ' data.format = format;'
+- print ' data.planes[0] = pixels[0];'
+- print ' data.planes[1] = pixels[1];'
+- print ' data.planes[2] = pixels[2];'
+- print ' }'
++ print(' // get current texture')
++ print(' GLint tex = 0;')
++ print(' _glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);')
++ print(' if(tex != 0)')
++ print(' {')
++ print(' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];')
++ print(' data.width = width;')
++ print(' data.height = height;')
++ print(' data.format = format;')
++ print(' data.planes[0] = pixels[0];')
++ print(' data.planes[1] = pixels[1];')
++ print(' data.planes[2] = pixels[2];')
++ print(' }')
+
+ if function.name == 'glTexDirectVIVMap' or function.name == 'glTexDirectTiledMapVIV':
+- print ' // get current texture'
+- print ' GLint tex = 0;'
+- print ' _glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);'
+- print ' if(tex != 0)'
+- print ' {'
+- print ' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];'
+- print ' data.width = width;'
+- print ' data.height = height;'
+- print ' data.format = format;'
+- print ' data.logical = *Logical; // Logical != NULL'
+- print ' data.physical = *Physical;'
+- print ' }'
++ print(' // get current texture')
++ print(' GLint tex = 0;')
++ print(' _glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);')
++ print(' if(tex != 0)')
++ print(' {')
++ print(' TEXDIRECTVIVDATA &data = _directTextureDataMap[tex];')
++ print(' data.width = width;')
++ print(' data.height = height;')
++ print(' data.format = format;')
++ print(' data.logical = *Logical; // Logical != NULL')
++ print(' data.physical = *Physical;')
++ print(' }')
+
+ if function.name == 'eglCreateContext':
+- print ' if (_result != EGL_NO_CONTEXT)'
+- print ' gltrace::createContext((uintptr_t)_result);'
++ print(' if (_result != EGL_NO_CONTEXT)')
++ print(' gltrace::createContext((uintptr_t)_result);')
+
+ if function.name == 'eglMakeCurrent':
+- print r' if (_result) {'
+- print r' // update the profile'
+- print r' if (ctx != EGL_NO_CONTEXT) {'
+- print r' gltrace::setContext((uintptr_t)ctx);'
+- print r' gltrace::Context *tr = gltrace::getContext();'
+- print r' EGLint api = EGL_OPENGL_ES_API;'
+- print r' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_TYPE, &api);'
+- print r' if (api == EGL_OPENGL_API) {'
+- print r' assert(tr->profile.api == glprofile::API_GL);'
+- print r' } else if (api == EGL_OPENGL_ES_API) {'
+- print r' EGLint client_version = 1;'
+- print r' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &client_version);'
+- print r' if (tr->profile.api != glprofile::API_GLES ||'
+- print r' tr->profile.major < client_version) {'
+- print r' std::string version = tr->profile.str();'
+- print r' os::log("apitrace: warning: eglMakeCurrent: expected OpenGL ES %i.x context, but got %s\n",'
+- print r' client_version, version.c_str());'
+- print r' }'
+- print r' } else {'
+- print r' assert(0);'
+- print r' }'
+- print r' } else {'
+- print r' gltrace::clearContext();'
+- print r' }'
+- print r' }'
++ print(r' if (_result) {')
++ print(r' // update the profile')
++ print(r' if (ctx != EGL_NO_CONTEXT) {')
++ print(r' gltrace::setContext((uintptr_t)ctx);')
++ print(r' gltrace::Context *tr = gltrace::getContext();')
++ print(r' EGLint api = EGL_OPENGL_ES_API;')
++ print(r' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_TYPE, &api);')
++ print(r' if (api == EGL_OPENGL_API) {')
++ print(r' assert(tr->profile.api == glprofile::API_GL);')
++ print(r' } else if (api == EGL_OPENGL_ES_API) {')
++ print(r' EGLint client_version = 1;')
++ print(r' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &client_version);')
++ print(r' if (tr->profile.api != glprofile::API_GLES ||')
++ print(r' tr->profile.major < client_version) {')
++ print(r' std::string version = tr->profile.str();')
++ print(r' os::log("apitrace: warning: eglMakeCurrent: expected OpenGL ES %i.x context, but got %s\n",')
++ print(r' client_version, version.c_str());')
++ print(r' }')
++ print(r' } else {')
++ print(r' assert(0);')
++ print(r' }')
++ print(r' } else {')
++ print(r' gltrace::clearContext();')
++ print(r' }')
++ print(r' }')
+
+ if function.name == 'eglDestroyContext':
+- print ' if (_result) {'
+- print ' gltrace::releaseContext((uintptr_t)ctx);'
+- print ' }'
++ print(' if (_result) {')
++ print(' gltrace::releaseContext((uintptr_t)ctx);')
++ print(' }')
+
+ if function.name == 'glEGLImageTargetTexture2DOES':
+- print ' image_info *info = _EGLImageKHR_get_image_info(target, image);'
+- print ' if (info) {'
+- print ' GLint level = 0;'
+- print ' GLint internalformat = info->internalformat;'
+- print ' GLsizei width = info->width;'
+- print ' GLsizei height = info->height;'
+- print ' GLint border = 0;'
+- print ' GLenum format = info->format;'
+- print ' GLenum type = info->type;'
+- print ' const GLvoid * pixels = info->pixels;'
++ print(' image_info *info = _EGLImageKHR_get_image_info(target, image);')
++ print(' if (info) {')
++ print(' GLint level = 0;')
++ print(' GLint internalformat = info->internalformat;')
++ print(' GLsizei width = info->width;')
++ print(' GLsizei height = info->height;')
++ print(' GLint border = 0;')
++ print(' GLenum format = info->format;')
++ print(' GLenum type = info->type;')
++ print(' const GLvoid * pixels = info->pixels;')
+ self.emitFakeTexture2D()
+- print ' _EGLImageKHR_free_image_info(info);'
+- print ' }'
++ print(' _EGLImageKHR_free_image_info(info);')
++ print(' }')
+
+
+ if __name__ == '__main__':
+- print '#include <stdlib.h>'
+- print '#include <string.h>'
+- print
+- print '#include "trace_writer_local.hpp"'
+- print
+- print '// To validate our prototypes'
+- print '#define GL_GLEXT_PROTOTYPES'
+- print '#define EGL_EGLEXT_PROTOTYPES'
+- print
+- print '#include "dlopen.hpp"'
+- print '#include "glproc.hpp"'
+- print '#include "glsize.hpp"'
+- print '#include "eglsize.hpp"'
+- print
+- print 'static const char *__get_alias_func_name(const char *origFunName)'
+- print '{'
+- print ' /* Vivante driver uses alias name for following OES/EXT functions, that means dlsym for thoese functions will fail */'
+- print ' static const char * __glExtProcAlias[][2] ='
+- print ' {'
+- print ' /* Extension API alias for GL_OES_texture_3D */'
+- print ' {"glTexImage3DOES", "glTexImage3D"},'
+- print ' {"glTexSubImage3DOES", "glTexSubImage3D"},'
+- print ' {"glCopyTexSubImage3DOES", "glCopyTexSubImage3D"},'
+- print ' {"glCompressedTexImage3DOES", "glCompressedTexImage3D"},'
+- print ' {"glCompressedTexSubImage3DOES", "glCompressedTexSubImage3D"},'
+- print
+- print ' /* Extension API alias for GL_OES_get_program_binary */'
+- print ' {"glGetProgramBinaryOES", "glGetProgramBinary"},'
+- print ' {"glProgramBinaryOES", "glProgramBinary"},'
+- print
+- print ' /* Extension API alias for GL_OES_vertex_array_object */'
+- print ' {"glBindVertexArrayOES", "glBindVertexArray"},'
+- print ' {"glDeleteVertexArraysOES", "glDeleteVertexArrays"},'
+- print ' {"glGenVertexArraysOES", "glGenVertexArrays"},'
+- print ' {"glIsVertexArrayOES", "glIsVertexArray"},'
+- print
+- print ' /* Extension API alias for GL_OES_blend_minmax */'
+- print ' {"glBlendEquationEXT", "glBlendEquation"}'
+- print ' };'
+- print
+- print ' int count = sizeof(__glExtProcAlias) / sizeof(__glExtProcAlias[0]);'
+- print ' int i;'
+- print
+- print ' for(i=0; i<count; i++)'
+- print ' {'
+- print ' if(strcmp(__glExtProcAlias[i][0], origFunName) == 0)'
+- print ' return __glExtProcAlias[i][1];'
+- print ' }'
+- print
+- print ' return origFunName;'
+- print '}'
+-
+- print
+- print 'typedef struct TexDirectVivData'
+- print '{'
+- print ' int width;'
+- print ' int height;'
+- print ' GLenum format;'
+- print ' GLvoid*planes[3]; // used for glTexDirectVIV'
+- print ' GLvoid*logical; // used for glTexDirectVIVMap/glTexDirectMapVIV/glTexDirectTiledMapVIV'
+- print ' GLuint physical;'
+- print '}TEXDIRECTVIVDATA;'
+- print
+- print 'static std::map<GLint, TEXDIRECTVIVDATA> _directTextureDataMap;'
+- print
+- print '#define GL_VIV_YV12 0x8FC0'
+- print '#define GL_VIV_NV12 0x8FC1'
+- print '#define GL_VIV_YUY2 0x8FC2'
+- print '#define GL_VIV_UYVY 0x8FC3'
+- print '#define GL_VIV_NV21 0x8FC4'
+- print '#define GL_VIV_I420 0x8FC5'
+- print
++ print('#include <stdlib.h>')
++ print('#include <string.h>')
++ print()
++ print('#include "trace_writer_local.hpp"')
++ print()
++ print('// To validate our prototypes')
++ print('#define GL_GLEXT_PROTOTYPES')
++ print('#define EGL_EGLEXT_PROTOTYPES')
++ print()
++ print('#include "dlopen.hpp"')
++ print('#include "glproc.hpp"')
++ print('#include "glsize.hpp"')
++ print('#include "eglsize.hpp"')
++ print()
++ print('static const char *__get_alias_func_name(const char *origFunName)')
++ print('{')
++ print(' /* Vivante driver uses alias name for following OES/EXT functions, that means dlsym for thoese functions will fail */')
++ print(' static const char * __glExtProcAlias[][2] =')
++ print(' {')
++ print(' /* Extension API alias for GL_OES_texture_3D */')
++ print(' {"glTexImage3DOES", "glTexImage3D"},')
++ print(' {"glTexSubImage3DOES", "glTexSubImage3D"},')
++ print(' {"glCopyTexSubImage3DOES", "glCopyTexSubImage3D"},')
++ print(' {"glCompressedTexImage3DOES", "glCompressedTexImage3D"},')
++ print(' {"glCompressedTexSubImage3DOES", "glCompressedTexSubImage3D"},')
++ print()
++ print(' /* Extension API alias for GL_OES_get_program_binary */')
++ print(' {"glGetProgramBinaryOES", "glGetProgramBinary"},')
++ print(' {"glProgramBinaryOES", "glProgramBinary"},')
++ print()
++ print(' /* Extension API alias for GL_OES_vertex_array_object */')
++ print(' {"glBindVertexArrayOES", "glBindVertexArray"},')
++ print(' {"glDeleteVertexArraysOES", "glDeleteVertexArrays"},')
++ print(' {"glGenVertexArraysOES", "glGenVertexArrays"},')
++ print(' {"glIsVertexArrayOES", "glIsVertexArray"},')
++ print()
++ print(' /* Extension API alias for GL_OES_blend_minmax */')
++ print(' {"glBlendEquationEXT", "glBlendEquation"}')
++ print(' };')
++ print()
++ print(' int count = sizeof(__glExtProcAlias) / sizeof(__glExtProcAlias[0]);')
++ print(' int i;')
++ print()
++ print(' for(i=0; i<count; i++)')
++ print(' {')
++ print(' if(strcmp(__glExtProcAlias[i][0], origFunName) == 0)')
++ print(' return __glExtProcAlias[i][1];')
++ print(' }')
++ print()
++ print(' return origFunName;')
++ print('}')
++
++ print()
++ print('typedef struct TexDirectVivData')
++ print('{')
++ print(' int width;')
++ print(' int height;')
++ print(' GLenum format;')
++ print(' GLvoid*planes[3]; // used for glTexDirectVIV')
++ print(' GLvoid*logical; // used for glTexDirectVIVMap/glTexDirectMapVIV/glTexDirectTiledMapVIV')
++ print(' GLuint physical;')
++ print('}TEXDIRECTVIVDATA;')
++ print()
++ print('static std::map<GLint, TEXDIRECTVIVDATA> _directTextureDataMap;')
++ print()
++ print('#define GL_VIV_YV12 0x8FC0')
++ print('#define GL_VIV_NV12 0x8FC1')
++ print('#define GL_VIV_YUY2 0x8FC2')
++ print('#define GL_VIV_UYVY 0x8FC3')
++ print('#define GL_VIV_NV21 0x8FC4')
++ print('#define GL_VIV_I420 0x8FC5')
++ print()
+
+ module = Module()
+ module.mergeModule(eglapi)
+@@ -292,7 +292,7 @@ if __name__ == '__main__':
+ tracer = EglTracer()
+ tracer.traceApi(api)
+
+- print r'''
++ print(r'''
+
+
+
+@@ -453,8 +453,8 @@ void APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, GLsizei stride,
+ #endif /* ANDROID */
+
+
+-'''
+- print r'''
++''')
++ print(r'''
+ /*
+ * let the GPU driver know that we are in apitrace
+ */
+@@ -464,4 +464,4 @@ int APIENTRY ApiTraceEnabled(void) {
+ return 1;
+ }
+
+-'''
++''')
+diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py
+index cf13ae18..02504148 100644
+--- a/wrappers/gltrace.py
++++ b/wrappers/gltrace.py
+@@ -79,7 +79,7 @@ class TypeGetter(stdapi.Visitor):
+ suffix = 'iv'
+ arg_type = 'GLint'
+ else:
+- print alias.expr
++ print(alias.expr)
+ assert False
+ function_name = self.prefix + suffix + self.ext_suffix
+ return function_name, arg_type
+@@ -114,48 +114,48 @@ class GlTracer(Tracer):
+ def header(self, api):
+ Tracer.header(self, api)
+
+- print '#include <algorithm>'
+- print
+- print '#include "gltrace.hpp"'
+- print
++ print('#include <algorithm>')
++ print()
++ print('#include "gltrace.hpp"')
++ print()
+
+ # Which glVertexAttrib* variant to use
+- print 'enum vertex_attrib {'
+- print ' VERTEX_ATTRIB,'
+- print ' VERTEX_ATTRIB_NV,'
+- print '};'
+- print
+- print 'static vertex_attrib _get_vertex_attrib(void) {'
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' if (ctx->user_arrays_nv) {'
+- print ' GLboolean _vertex_program = GL_FALSE;'
+- print ' _glGetBooleanv(GL_VERTEX_PROGRAM_ARB, &_vertex_program);'
+- print ' if (_vertex_program) {'
+- print ' if (ctx->user_arrays_nv) {'
+- print ' GLint _vertex_program_binding_nv = _glGetInteger(GL_VERTEX_PROGRAM_BINDING_NV);'
+- print ' if (_vertex_program_binding_nv) {'
+- print ' return VERTEX_ATTRIB_NV;'
+- print ' }'
+- print ' }'
+- print ' }'
+- print ' }'
+- print ' return VERTEX_ATTRIB;'
+- print '}'
+- print
++ print('enum vertex_attrib {')
++ print(' VERTEX_ATTRIB,')
++ print(' VERTEX_ATTRIB_NV,')
++ print('};')
++ print()
++ print('static vertex_attrib _get_vertex_attrib(void) {')
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' if (ctx->user_arrays_nv) {')
++ print(' GLboolean _vertex_program = GL_FALSE;')
++ print(' _glGetBooleanv(GL_VERTEX_PROGRAM_ARB, &_vertex_program);')
++ print(' if (_vertex_program) {')
++ print(' if (ctx->user_arrays_nv) {')
++ print(' GLint _vertex_program_binding_nv = _glGetInteger(GL_VERTEX_PROGRAM_BINDING_NV);')
++ print(' if (_vertex_program_binding_nv) {')
++ print(' return VERTEX_ATTRIB_NV;')
++ print(' }')
++ print(' }')
++ print(' }')
++ print(' }')
++ print(' return VERTEX_ATTRIB;')
++ print('}')
++ print()
+
+ self.defineShadowBufferHelper()
+
+ # Whether we need user arrays
+- print 'static inline bool _need_user_arrays(void)'
+- print '{'
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' if (!ctx->user_arrays) {'
+- print ' return false;'
+- print ' }'
+- print
+- print ' glprofile::Profile profile = ctx->profile;'
+- print ' bool es1 = profile.es() && profile.major == 1;'
+- print
++ print('static inline bool _need_user_arrays(void)')
++ print('{')
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' if (!ctx->user_arrays) {')
++ print(' return false;')
++ print(' }')
++ print()
++ print(' glprofile::Profile profile = ctx->profile;')
++ print(' bool es1 = profile.es() && profile.major == 1;')
++ print()
+
+ for camelcase_name, uppercase_name in self.arrays:
+ # in which profile is the array available?
+@@ -166,120 +166,120 @@ class GlTracer(Tracer):
+ function_name = 'gl%sPointer' % camelcase_name
+ enable_name = 'GL_%s_ARRAY' % uppercase_name
+ binding_name = 'GL_%s_ARRAY_BUFFER_BINDING' % uppercase_name
+- print ' // %s' % function_name
+- print ' if (%s) {' % profile_check
++ print(' // %s' % function_name)
++ print(' if (%s) {' % profile_check)
+ self.array_prolog(api, uppercase_name)
+- print ' if (_glIsEnabled(%s) &&' % enable_name
+- print ' _glGetInteger(%s) == 0) {' % binding_name
++ print(' if (_glIsEnabled(%s) &&' % enable_name)
++ print(' _glGetInteger(%s) == 0) {' % binding_name)
+ self.array_cleanup(api, uppercase_name)
+- print ' return true;'
+- print ' }'
++ print(' return true;')
++ print(' }')
+ self.array_epilog(api, uppercase_name)
+- print ' }'
+- print
+-
+- print ' // ES1 does not support generic vertex attributes'
+- print ' if (es1)'
+- print ' return false;'
+- print
+- print ' vertex_attrib _vertex_attrib = _get_vertex_attrib();'
+- print
+- print ' // glVertexAttribPointer'
+- print ' if (_vertex_attrib == VERTEX_ATTRIB) {'
+- print ' GLint _max_vertex_attribs = _glGetInteger(GL_MAX_VERTEX_ATTRIBS);'
+- print ' for (GLint index = 0; index < _max_vertex_attribs; ++index) {'
+- print ' if (_glGetVertexAttribi(index, GL_VERTEX_ATTRIB_ARRAY_ENABLED) &&'
+- print ' _glGetVertexAttribi(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) == 0) {'
+- print ' return true;'
+- print ' }'
+- print ' }'
+- print ' }'
+- print
+- print ' // glVertexAttribPointerNV'
+- print ' if (_vertex_attrib == VERTEX_ATTRIB_NV) {'
+- print ' for (GLint index = 0; index < 16; ++index) {'
+- print ' if (_glIsEnabled(GL_VERTEX_ATTRIB_ARRAY0_NV + index)) {'
+- print ' return true;'
+- print ' }'
+- print ' }'
+- print ' }'
+- print
+-
+- print ' return false;'
+- print '}'
+- print
+-
+- print 'static void _trace_user_arrays(GLuint count);'
+- print
+-
+- print '// whether glLockArraysEXT() has ever been called'
+- print 'static bool _checkLockArraysEXT = false;'
+- print
++ print(' }')
++ print()
++
++ print(' // ES1 does not support generic vertex attributes')
++ print(' if (es1)')
++ print(' return false;')
++ print()
++ print(' vertex_attrib _vertex_attrib = _get_vertex_attrib();')
++ print()
++ print(' // glVertexAttribPointer')
++ print(' if (_vertex_attrib == VERTEX_ATTRIB) {')
++ print(' GLint _max_vertex_attribs = _glGetInteger(GL_MAX_VERTEX_ATTRIBS);')
++ print(' for (GLint index = 0; index < _max_vertex_attribs; ++index) {')
++ print(' if (_glGetVertexAttribi(index, GL_VERTEX_ATTRIB_ARRAY_ENABLED) &&')
++ print(' _glGetVertexAttribi(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) == 0) {')
++ print(' return true;')
++ print(' }')
++ print(' }')
++ print(' }')
++ print()
++ print(' // glVertexAttribPointerNV')
++ print(' if (_vertex_attrib == VERTEX_ATTRIB_NV) {')
++ print(' for (GLint index = 0; index < 16; ++index) {')
++ print(' if (_glIsEnabled(GL_VERTEX_ATTRIB_ARRAY0_NV + index)) {')
++ print(' return true;')
++ print(' }')
++ print(' }')
++ print(' }')
++ print()
++
++ print(' return false;')
++ print('}')
++ print()
++
++ print('static void _trace_user_arrays(GLuint count);')
++ print()
++
++ print('// whether glLockArraysEXT() has ever been called')
++ print('static bool _checkLockArraysEXT = false;')
++ print()
+
+ # Buffer mappings
+- print '// whether glMapBufferRange(GL_MAP_WRITE_BIT) has ever been called'
+- print 'static bool _checkBufferMapRange = false;'
+- print
+- print '// whether glBufferParameteriAPPLE(GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE) has ever been called'
+- print 'static bool _checkBufferFlushingUnmapAPPLE = false;'
+- print
++ print('// whether glMapBufferRange(GL_MAP_WRITE_BIT) has ever been called')
++ print('static bool _checkBufferMapRange = false;')
++ print()
++ print('// whether glBufferParameteriAPPLE(GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE) has ever been called')
++ print('static bool _checkBufferFlushingUnmapAPPLE = false;')
++ print()
+
+ # Generate a helper function to determine whether a parameter name
+ # refers to a symbolic value or not
+- print 'static bool'
+- print 'is_symbolic_pname(GLenum pname) {'
+- print ' switch (pname) {'
++ print('static bool')
++ print('is_symbolic_pname(GLenum pname) {')
++ print(' switch (pname) {')
+ for function, type, count, name in glparams.parameters:
+ if type is glapi.GLenum:
+- print ' case %s:' % name
+- print ' return true;'
+- print ' default:'
+- print ' return false;'
+- print ' }'
+- print '}'
+- print
++ print(' case %s:' % name)
++ print(' return true;')
++ print(' default:')
++ print(' return false;')
++ print(' }')
++ print('}')
++ print()
+
+ # Generate a helper function to determine whether a parameter value is
+ # potentially symbolic or not; i.e., if the value can be represented in
+ # an enum or not
+- print 'template<class T>'
+- print 'static inline bool'
+- print 'is_symbolic_param(T param) {'
+- print ' return static_cast<T>(static_cast<GLenum>(param)) == param;'
+- print '}'
+- print
++ print('template<class T>')
++ print('static inline bool')
++ print('is_symbolic_param(T param) {')
++ print(' return static_cast<T>(static_cast<GLenum>(param)) == param;')
++ print('}')
++ print()
+
+ # Generate a helper function to know how many elements a parameter has
+- print 'static size_t'
+- print '_gl_param_size(GLenum pname) {'
+- print ' switch (pname) {'
++ print('static size_t')
++ print('_gl_param_size(GLenum pname) {')
++ print(' switch (pname) {')
+ for function, type, count, name in glparams.parameters:
+ if name == 'GL_PROGRAM_BINARY_FORMATS':
+ count = 0
+ if type is not None:
+- print ' case %s: return %s;' % (name, count)
+- print ' default:'
+- print r' os::log("apitrace: warning: %s: unknown GLenum 0x%04X\n", __FUNCTION__, pname);'
+- print ' return 1;'
+- print ' }'
+- print '}'
+- print
++ print(' case %s: return %s;' % (name, count))
++ print(' default:')
++ print(r' os::log("apitrace: warning: %s: unknown GLenum 0x%04X\n", __FUNCTION__, pname);')
++ print(' return 1;')
++ print(' }')
++ print('}')
++ print()
+
+ # states such as GL_UNPACK_ROW_LENGTH are not available in GLES
+- print 'static inline bool'
+- print 'can_unpack_subimage(void) {'
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' return ctx->profile.desktop();'
+- print '}'
+- print
++ print('static inline bool')
++ print('can_unpack_subimage(void) {')
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' return ctx->profile.desktop();')
++ print('}')
++ print()
+
+ # VMWX_map_buffer_debug
+- print r'extern "C" PUBLIC'
+- print r'void APIENTRY'
+- print r'glNotifyMappedBufferRangeVMWX(const void * start, GLsizeiptr length) {'
++ print(r'extern "C" PUBLIC')
++ print(r'void APIENTRY')
++ print(r'glNotifyMappedBufferRangeVMWX(const void * start, GLsizeiptr length) {')
+ self.emit_memcpy('start', 'length')
+- print r'}'
+- print
++ print(r'}')
++ print()
+
+ getProcAddressFunctionNames = []
+
+@@ -290,70 +290,70 @@ class GlTracer(Tracer):
+ argType = getProcAddressFunction.args[0].type
+ retType = getProcAddressFunction.type
+
+- print 'static %s _wrapProcAddress(%s procName, %s procPtr);' % (retType, argType, retType)
+- print
++ print('static %s _wrapProcAddress(%s procName, %s procPtr);' % (retType, argType, retType))
++ print()
+
+ Tracer.traceApi(self, api)
+
+- print 'static %s _wrapProcAddress(%s procName, %s procPtr) {' % (retType, argType, retType)
++ print('static %s _wrapProcAddress(%s procName, %s procPtr) {' % (retType, argType, retType))
+
+ # Provide fallback functions to missing debug functions
+- print ' if (!procPtr) {'
++ print(' if (!procPtr) {')
+ else_ = ''
+ for function_name in self.debug_functions:
+ if self.api.getFunctionByName(function_name):
+- print ' %sif (strcmp("%s", (const char *)procName) == 0) {' % (else_, function_name)
+- print ' return (%s)&%s;' % (retType, function_name)
+- print ' }'
++ print(' %sif (strcmp("%s", (const char *)procName) == 0) {' % (else_, function_name))
++ print(' return (%s)&%s;' % (retType, function_name))
++ print(' }')
+ else_ = 'else '
+- print ' %s{' % else_
+- print ' return NULL;'
+- print ' }'
+- print ' }'
++ print(' %s{' % else_)
++ print(' return NULL;')
++ print(' }')
++ print(' }')
+
+ for function in api.getAllFunctions():
+ ptype = function_pointer_type(function)
+ pvalue = function_pointer_value(function)
+- print ' if (strcmp("%s", (const char *)procName) == 0) {' % function.name
+- print ' assert(procPtr != (%s)&%s);' % (retType, function.name)
+- print ' %s = (%s)procPtr;' % (pvalue, ptype)
+- print ' return (%s)&%s;' % (retType, function.name,)
+- print ' }'
+- print ' os::log("apitrace: warning: unknown function \\"%s\\"\\n", (const char *)procName);'
+- print ' return procPtr;'
+- print '}'
+- print
++ print(' if (strcmp("%s", (const char *)procName) == 0) {' % function.name)
++ print(' assert(procPtr != (%s)&%s);' % (retType, function.name))
++ print(' %s = (%s)procPtr;' % (pvalue, ptype))
++ print(' return (%s)&%s;' % (retType, function.name,))
++ print(' }')
++ print(' os::log("apitrace: warning: unknown function \\"%s\\"\\n", (const char *)procName);')
++ print(' return procPtr;')
++ print('}')
++ print()
+ else:
+ Tracer.traceApi(self, api)
+
+ def defineShadowBufferHelper(self):
+- print 'void _shadow_glGetBufferSubData(GLenum target, GLintptr offset,'
+- print ' GLsizeiptr size, GLvoid *data)'
+- print '{'
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' if (!ctx->needsShadowBuffers() || target != GL_ELEMENT_ARRAY_BUFFER) {'
+- print ' _glGetBufferSubData(target, offset, size, data);'
+- print ' return;'
+- print ' }'
+- print
+- print ' GLint buffer_binding = _glGetInteger(GL_ELEMENT_ARRAY_BUFFER_BINDING);'
+- print ' if (buffer_binding > 0) {'
+- print ' gltrace::Buffer & buf = ctx->buffers[buffer_binding];'
+- print ' buf.getSubData(offset, size, data);'
+- print ' }'
+- print '}'
++ print('void _shadow_glGetBufferSubData(GLenum target, GLintptr offset,')
++ print(' GLsizeiptr size, GLvoid *data)')
++ print('{')
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' if (!ctx->needsShadowBuffers() || target != GL_ELEMENT_ARRAY_BUFFER) {')
++ print(' _glGetBufferSubData(target, offset, size, data);')
++ print(' return;')
++ print(' }')
++ print()
++ print(' GLint buffer_binding = _glGetInteger(GL_ELEMENT_ARRAY_BUFFER_BINDING);')
++ print(' if (buffer_binding > 0) {')
++ print(' gltrace::Buffer & buf = ctx->buffers[buffer_binding];')
++ print(' buf.getSubData(offset, size, data);')
++ print(' }')
++ print('}')
+
+ def shadowBufferMethod(self, method):
+ # Emit code to fetch the shadow buffer, and invoke a method
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' if (ctx->needsShadowBuffers() && target == GL_ELEMENT_ARRAY_BUFFER) {'
+- print ' GLint buffer_binding = _glGetInteger(GL_ELEMENT_ARRAY_BUFFER_BINDING);'
+- print ' if (buffer_binding > 0) {'
+- print ' gltrace::Buffer & buf = ctx->buffers[buffer_binding];'
+- print ' buf.' + method + ';'
+- print ' }'
+- print ' }'
+- print
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' if (ctx->needsShadowBuffers() && target == GL_ELEMENT_ARRAY_BUFFER) {')
++ print(' GLint buffer_binding = _glGetInteger(GL_ELEMENT_ARRAY_BUFFER_BINDING);')
++ print(' if (buffer_binding > 0) {')
++ print(' gltrace::Buffer & buf = ctx->buffers[buffer_binding];')
++ print(' buf.' + method + ';')
++ print(' }')
++ print(' }')
++ print()
+
+ def shadowBufferProlog(self, function):
+ if function.name == 'glBufferData':
+@@ -363,12 +363,12 @@ class GlTracer(Tracer):
+ self.shadowBufferMethod('bufferSubData(offset, size, data)')
+
+ if function.name == 'glDeleteBuffers':
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' if (ctx->needsShadowBuffers()) {'
+- print ' for (GLsizei i = 0; i < n; i++) {'
+- print ' ctx->buffers.erase(buffer[i]);'
+- print ' }'
+- print ' }'
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' if (ctx->needsShadowBuffers()) {')
++ print(' for (GLsizei i = 0; i < n; i++) {')
++ print(' ctx->buffers.erase(buffer[i]);')
++ print(' }')
++ print(' }')
+
+ array_pointer_function_names = set((
+ "glVertexPointer",
+@@ -426,42 +426,42 @@ class GlTracer(Tracer):
+ def traceFunctionImplBody(self, function):
+ # Defer tracing of user array pointers...
+ if function.name in self.array_pointer_function_names:
+- print ' GLint _array_buffer = _glGetInteger(GL_ARRAY_BUFFER_BINDING);'
+- print ' if (!_array_buffer) {'
+- print ' static bool warned = false;'
+- print ' if (!warned) {'
+- print ' warned = true;'
+- print ' os::log("apitrace: warning: %s: call will be faked due to pointer to user memory (https://github.com/apitrace/apitrace/blob/master/docs/BUGS.markdown#tracing)\\n", __FUNCTION__);'
+- print ' }'
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' ctx->user_arrays = true;'
++ print(' GLint _array_buffer = _glGetInteger(GL_ARRAY_BUFFER_BINDING);')
++ print(' if (!_array_buffer) {')
++ print(' static bool warned = false;')
++ print(' if (!warned) {')
++ print(' warned = true;')
++ print(' os::log("apitrace: warning: %s: call will be faked due to pointer to user memory (https://github.com/apitrace/apitrace/blob/master/docs/BUGS.markdown#tracing)\\n", __FUNCTION__);')
++ print(' }')
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' ctx->user_arrays = true;')
+ if function.name == "glVertexAttribPointerNV":
+- print ' ctx->user_arrays_nv = true;'
++ print(' ctx->user_arrays_nv = true;')
+ self.invokeFunction(function)
+
+ # And also break down glInterleavedArrays into the individual calls
+ if function.name == 'glInterleavedArrays':
+- print
++ print()
+
+ # Initialize the enable flags
+ for camelcase_name, uppercase_name in self.arrays:
+ flag_name = '_' + uppercase_name.lower()
+- print ' GLboolean %s = GL_FALSE;' % flag_name
+- print
++ print(' GLboolean %s = GL_FALSE;' % flag_name)
++ print()
+
+ # Switch for the interleaved formats
+- print ' switch (format) {'
++ print(' switch (format) {')
+ for format in self.interleaved_formats:
+- print ' case %s:' % format
++ print(' case %s:' % format)
+ for camelcase_name, uppercase_name in self.arrays:
+ flag_name = '_' + uppercase_name.lower()
+ if format.find('_' + uppercase_name[0]) >= 0:
+- print ' %s = GL_TRUE;' % flag_name
+- print ' break;'
+- print ' default:'
+- print ' return;'
+- print ' }'
+- print
++ print(' %s = GL_TRUE;' % flag_name)
++ print(' break;')
++ print(' default:')
++ print(' return;')
++ print(' }')
++ print()
+
+ # Emit fake glEnableClientState/glDisableClientState flags
+ for camelcase_name, uppercase_name in self.arrays:
+@@ -469,16 +469,16 @@ class GlTracer(Tracer):
+ enable_name = 'GL_%s_ARRAY' % uppercase_name
+
+ # Emit a fake function
+- print ' {'
+- print ' static const trace::FunctionSig &_sig = %s ? _glEnableClientState_sig : _glDisableClientState_sig;' % flag_name
+- print ' unsigned _call = trace::localWriter.beginEnter(&_sig, true);'
+- print ' trace::localWriter.beginArg(0);'
++ print(' {')
++ print(' static const trace::FunctionSig &_sig = %s ? _glEnableClientState_sig : _glDisableClientState_sig;' % flag_name)
++ print(' unsigned _call = trace::localWriter.beginEnter(&_sig, true);')
++ print(' trace::localWriter.beginArg(0);')
+ self.serializeValue(glapi.GLenum, enable_name)
+- print ' trace::localWriter.endArg();'
+- print ' trace::localWriter.endEnter();'
+- print ' trace::localWriter.beginLeave(_call);'
+- print ' trace::localWriter.endLeave();'
+- print ' }'
++ print(' trace::localWriter.endArg();')
++ print(' trace::localWriter.endEnter();')
++ print(' trace::localWriter.beginLeave(_call);')
++ print(' trace::localWriter.endLeave();')
++ print(' }')
+
+ # Warn about buggy glGet(GL_*ARRAY_SIZE) not returning GL_BGRA
+ buggyFunctions = {
+@@ -489,224 +489,224 @@ class GlTracer(Tracer):
+ }
+ if function.name in buggyFunctions:
+ getter, extraArg, pname = buggyFunctions[function.name]
+- print r' static bool _checked = false;'
+- print r' if (!_checked && size == GL_BGRA) {'
+- print r' GLint _size = 0;'
+- print r' _%s(%s%s, &_size);' % (getter, extraArg, pname)
+- print r' if (_size != GL_BGRA) {'
+- print r' os::log("apitrace: warning: %s(%s) does not return GL_BGRA; trace will be incorrect (https://github.com/apitrace/apitrace/issues/261)\n");' % (getter, pname)
+- print r' }'
+- print r' _checked = true;'
+- print r' }'
+-
+- print ' return;'
+- print ' }'
++ print(r' static bool _checked = false;')
++ print(r' if (!_checked && size == GL_BGRA) {')
++ print(r' GLint _size = 0;')
++ print(r' _%s(%s%s, &_size);' % (getter, extraArg, pname))
++ print(r' if (_size != GL_BGRA) {')
++ print(r' os::log("apitrace: warning: %s(%s) does not return GL_BGRA; trace will be incorrect (https://github.com/apitrace/apitrace/issues/261)\n");' % (getter, pname))
++ print(r' }')
++ print(r' _checked = true;')
++ print(r' }')
++
++ print(' return;')
++ print(' }')
+
+ # ... to the draw calls
+ if self.draw_function_regex.match(function.name):
+ if not self.multi_draw_function_regex.match(function.name):
+- print ' if (trace::localWriter.isIgnored()) {'
++ print(' if (trace::localWriter.isIgnored()) {')
+ self.invokeFunction(function)
+- print ' return;'
+- print ' }'
+- print ' if (_need_user_arrays()) {'
++ print(' return;')
++ print(' }')
++ print(' if (_need_user_arrays()) {')
+ if 'Indirect' in function.name:
+- print r' os::log("apitrace: warning: %s: indirect user arrays not supported\n");' % (function.name,)
++ print(r' os::log("apitrace: warning: %s: indirect user arrays not supported\n");' % (function.name,))
+ else:
+ arg_names = ', '.join([arg.name for arg in function.args[1:]])
+- print ' GLuint _count = _%s_count(%s);' % (function.name, arg_names)
++ print(' GLuint _count = _%s_count(%s);' % (function.name, arg_names))
+ # Some apps, in particular Quake3, can tell the driver to lock more
+ # vertices than those actually required for the draw call.
+- print ' if (_checkLockArraysEXT) {'
+- print ' GLuint _locked_count = _glGetInteger(GL_ARRAY_ELEMENT_LOCK_FIRST_EXT)'
+- print ' + _glGetInteger(GL_ARRAY_ELEMENT_LOCK_COUNT_EXT);'
+- print ' _count = std::max(_count, _locked_count);'
+- print ' }'
+- print ' _trace_user_arrays(_count);'
+- print ' }'
++ print(' if (_checkLockArraysEXT) {')
++ print(' GLuint _locked_count = _glGetInteger(GL_ARRAY_ELEMENT_LOCK_FIRST_EXT)')
++ print(' + _glGetInteger(GL_ARRAY_ELEMENT_LOCK_COUNT_EXT);')
++ print(' _count = std::max(_count, _locked_count);')
++ print(' }')
++ print(' _trace_user_arrays(_count);')
++ print(' }')
+ if function.name == 'glLockArraysEXT':
+- print ' _checkLockArraysEXT = true;'
++ print(' _checkLockArraysEXT = true;')
+
+ # Warn if user arrays are used with glBegin/glArrayElement/glEnd.
+ if function.name == 'glBegin':
+- print r' gltrace::Context *ctx = gltrace::getContext();'
+- print r' ctx->userArraysOnBegin = _need_user_arrays();'
++ print(r' gltrace::Context *ctx = gltrace::getContext();')
++ print(r' ctx->userArraysOnBegin = _need_user_arrays();')
+ if function.name.startswith('glArrayElement'):
+- print r' gltrace::Context *ctx = gltrace::getContext();'
+- print r' if (ctx->userArraysOnBegin) {'
+- print r' os::log("apitrace: warning: user arrays with glArrayElement not supported (https://github.com/apitrace/apitrace/issues/276)\n");'
+- print r' ctx->userArraysOnBegin = false;'
+- print r' }'
++ print(r' gltrace::Context *ctx = gltrace::getContext();')
++ print(r' if (ctx->userArraysOnBegin) {')
++ print(r' os::log("apitrace: warning: user arrays with glArrayElement not supported (https://github.com/apitrace/apitrace/issues/276)\n");')
++ print(r' ctx->userArraysOnBegin = false;')
++ print(r' }')
+
+ # Emit a fake memcpy on buffer uploads
+ if function.name == 'glBufferParameteriAPPLE':
+- print ' if (pname == GL_BUFFER_FLUSHING_UNMAP_APPLE && param == GL_FALSE) {'
+- print ' _checkBufferFlushingUnmapAPPLE = true;'
+- print ' }'
++ print(' if (pname == GL_BUFFER_FLUSHING_UNMAP_APPLE && param == GL_FALSE) {')
++ print(' _checkBufferFlushingUnmapAPPLE = true;')
++ print(' }')
+ if function.name in ('glUnmapBuffer', 'glUnmapBufferARB'):
+ if function.name.endswith('ARB'):
+ suffix = 'ARB'
+ else:
+ suffix = ''
+- print ' GLint access_flags = 0;'
+- print ' GLint access = 0;'
+- print ' bool flush;'
+- print ' // GLES3 does not have GL_BUFFER_ACCESS;'
+- print ' if (_checkBufferMapRange) {'
+- print ' _glGetBufferParameteriv%s(target, GL_BUFFER_ACCESS_FLAGS, &access_flags);' % suffix
+- print ' flush = (access_flags & GL_MAP_WRITE_BIT) && !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT));'
+- print ' } else {'
+- print ' _glGetBufferParameteriv%s(target, GL_BUFFER_ACCESS, &access);' % suffix
+- print ' flush = access != GL_READ_ONLY;'
+- print ' }'
+- print ' if (flush) {'
+- print ' GLvoid *map = NULL;'
+- print ' _glGetBufferPointerv%s(target, GL_BUFFER_MAP_POINTER, &map);' % suffix
+- print ' if (map) {'
+- print ' GLint length = -1;'
+- print ' if (_checkBufferMapRange) {'
+- print ' _glGetBufferParameteriv%s(target, GL_BUFFER_MAP_LENGTH, &length);' % suffix
+- print ' if (length == -1) {'
+- print ' // Mesa drivers refuse GL_BUFFER_MAP_LENGTH without GL 3.0 up-to'
+- print ' // http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffee498fb848b253a7833373fe5430f8c7ca0c5f'
+- print ' static bool warned = false;'
+- print ' if (!warned) {'
+- print ' os::log("apitrace: warning: glGetBufferParameteriv%s(GL_BUFFER_MAP_LENGTH) failed\\n");' % suffix
+- print ' warned = true;'
+- print ' }'
+- print ' }'
+- print ' } else {'
+- print ' length = 0;'
+- print ' _glGetBufferParameteriv%s(target, GL_BUFFER_SIZE, &length);' % suffix
+- print ' }'
+- print ' if (_checkBufferFlushingUnmapAPPLE) {'
+- print ' GLint flushing_unmap = GL_TRUE;'
+- print ' _glGetBufferParameteriv%s(target, GL_BUFFER_FLUSHING_UNMAP_APPLE, &flushing_unmap);' % suffix
+- print ' flush = flush && flushing_unmap;'
+- print ' }'
+- print ' if (flush && length > 0) {'
++ print(' GLint access_flags = 0;')
++ print(' GLint access = 0;')
++ print(' bool flush;')
++ print(' // GLES3 does not have GL_BUFFER_ACCESS;')
++ print(' if (_checkBufferMapRange) {')
++ print(' _glGetBufferParameteriv%s(target, GL_BUFFER_ACCESS_FLAGS, &access_flags);' % suffix)
++ print(' flush = (access_flags & GL_MAP_WRITE_BIT) && !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT));')
++ print(' } else {')
++ print(' _glGetBufferParameteriv%s(target, GL_BUFFER_ACCESS, &access);' % suffix)
++ print(' flush = access != GL_READ_ONLY;')
++ print(' }')
++ print(' if (flush) {')
++ print(' GLvoid *map = NULL;')
++ print(' _glGetBufferPointerv%s(target, GL_BUFFER_MAP_POINTER, &map);' % suffix)
++ print(' if (map) {')
++ print(' GLint length = -1;')
++ print(' if (_checkBufferMapRange) {')
++ print(' _glGetBufferParameteriv%s(target, GL_BUFFER_MAP_LENGTH, &length);' % suffix)
++ print(' if (length == -1) {')
++ print(' // Mesa drivers refuse GL_BUFFER_MAP_LENGTH without GL 3.0 up-to')
++ print(' // http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffee498fb848b253a7833373fe5430f8c7ca0c5f')
++ print(' static bool warned = false;')
++ print(' if (!warned) {')
++ print(' os::log("apitrace: warning: glGetBufferParameteriv%s(GL_BUFFER_MAP_LENGTH) failed\\n");' % suffix)
++ print(' warned = true;')
++ print(' }')
++ print(' }')
++ print(' } else {')
++ print(' length = 0;')
++ print(' _glGetBufferParameteriv%s(target, GL_BUFFER_SIZE, &length);' % suffix)
++ print(' }')
++ print(' if (_checkBufferFlushingUnmapAPPLE) {')
++ print(' GLint flushing_unmap = GL_TRUE;')
++ print(' _glGetBufferParameteriv%s(target, GL_BUFFER_FLUSHING_UNMAP_APPLE, &flushing_unmap);' % suffix)
++ print(' flush = flush && flushing_unmap;')
++ print(' }')
++ print(' if (flush && length > 0) {')
+ self.emit_memcpy('map', 'length')
+- print ' }'
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
++ print(' }')
+ if function.name == 'glUnmapBufferOES':
+- print ' GLint access_flags = 0;'
+- print ' GLint access = 0;'
+- print ' bool flush;'
+- print ' // GLES3 does not have GL_BUFFER_ACCESS;'
+- print ' if (_checkBufferMapRange) {'
+- print ' _glGetBufferParameteriv(target, GL_BUFFER_ACCESS_FLAGS, &access_flags);'
+- print ' flush = (access_flags & GL_MAP_WRITE_BIT) && !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT));'
+- print ' } else {'
+- print ' _glGetBufferParameteriv(target, GL_BUFFER_ACCESS, &access);'
+- print ' flush = access != GL_READ_ONLY;'
+- print ' }'
+- print ' if (flush) {'
+- print ' GLvoid *map = NULL;'
+- print ' _glGetBufferPointervOES(target, GL_BUFFER_MAP_POINTER, &map);'
+- print ' if (map) {'
+- print ' GLint length = 0;'
+- print ' GLint offset = 0;'
+- print ' if (_checkBufferMapRange) {'
+- print ' _glGetBufferParameteriv(target, GL_BUFFER_MAP_LENGTH, &length);'
+- print ' _glGetBufferParameteriv(target, GL_BUFFER_MAP_OFFSET, &offset);'
+- print ' } else {'
+- print ' _glGetBufferParameteriv(target, GL_BUFFER_SIZE, &length);'
+- print ' }'
+- print ' if (flush && length > 0) {'
++ print(' GLint access_flags = 0;')
++ print(' GLint access = 0;')
++ print(' bool flush;')
++ print(' // GLES3 does not have GL_BUFFER_ACCESS;')
++ print(' if (_checkBufferMapRange) {')
++ print(' _glGetBufferParameteriv(target, GL_BUFFER_ACCESS_FLAGS, &access_flags);')
++ print(' flush = (access_flags & GL_MAP_WRITE_BIT) && !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT));')
++ print(' } else {')
++ print(' _glGetBufferParameteriv(target, GL_BUFFER_ACCESS, &access);')
++ print(' flush = access != GL_READ_ONLY;')
++ print(' }')
++ print(' if (flush) {')
++ print(' GLvoid *map = NULL;')
++ print(' _glGetBufferPointervOES(target, GL_BUFFER_MAP_POINTER, &map);')
++ print(' if (map) {')
++ print(' GLint length = 0;')
++ print(' GLint offset = 0;')
++ print(' if (_checkBufferMapRange) {')
++ print(' _glGetBufferParameteriv(target, GL_BUFFER_MAP_LENGTH, &length);')
++ print(' _glGetBufferParameteriv(target, GL_BUFFER_MAP_OFFSET, &offset);')
++ print(' } else {')
++ print(' _glGetBufferParameteriv(target, GL_BUFFER_SIZE, &length);')
++ print(' }')
++ print(' if (flush && length > 0) {')
+ self.emit_memcpy('map', 'length')
+ self.shadowBufferMethod('bufferSubData(offset, length, map)')
+- print ' }'
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
++ print(' }')
+ if function.name == 'glUnmapNamedBuffer':
+- print ' GLint access_flags = 0;'
+- print ' _glGetNamedBufferParameteriv(buffer, GL_BUFFER_ACCESS_FLAGS, &access_flags);'
+- print ' if ((access_flags & GL_MAP_WRITE_BIT) &&'
+- print ' !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT))) {'
+- print ' GLvoid *map = NULL;'
+- print ' _glGetNamedBufferPointerv(buffer, GL_BUFFER_MAP_POINTER, &map);'
+- print ' GLint length = 0;'
+- print ' _glGetNamedBufferParameteriv(buffer, GL_BUFFER_MAP_LENGTH, &length);'
+- print ' if (map && length > 0) {'
++ print(' GLint access_flags = 0;')
++ print(' _glGetNamedBufferParameteriv(buffer, GL_BUFFER_ACCESS_FLAGS, &access_flags);')
++ print(' if ((access_flags & GL_MAP_WRITE_BIT) &&')
++ print(' !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT))) {')
++ print(' GLvoid *map = NULL;')
++ print(' _glGetNamedBufferPointerv(buffer, GL_BUFFER_MAP_POINTER, &map);')
++ print(' GLint length = 0;')
++ print(' _glGetNamedBufferParameteriv(buffer, GL_BUFFER_MAP_LENGTH, &length);')
++ print(' if (map && length > 0) {')
+ self.emit_memcpy('map', 'length')
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
+ if function.name == 'glUnmapNamedBufferEXT':
+- print ' GLint access_flags = 0;'
+- print ' _glGetNamedBufferParameterivEXT(buffer, GL_BUFFER_ACCESS_FLAGS, &access_flags);'
+- print ' if ((access_flags & GL_MAP_WRITE_BIT) &&'
+- print ' !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT))) {'
+- print ' GLvoid *map = NULL;'
+- print ' _glGetNamedBufferPointervEXT(buffer, GL_BUFFER_MAP_POINTER, &map);'
+- print ' GLint length = 0;'
+- print ' _glGetNamedBufferParameterivEXT(buffer, GL_BUFFER_MAP_LENGTH, &length);'
+- print ' if (map && length > 0) {'
++ print(' GLint access_flags = 0;')
++ print(' _glGetNamedBufferParameterivEXT(buffer, GL_BUFFER_ACCESS_FLAGS, &access_flags);')
++ print(' if ((access_flags & GL_MAP_WRITE_BIT) &&')
++ print(' !(access_flags & (GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_PERSISTENT_BIT))) {')
++ print(' GLvoid *map = NULL;')
++ print(' _glGetNamedBufferPointervEXT(buffer, GL_BUFFER_MAP_POINTER, &map);')
++ print(' GLint length = 0;')
++ print(' _glGetNamedBufferParameterivEXT(buffer, GL_BUFFER_MAP_LENGTH, &length);')
++ print(' if (map && length > 0) {')
+ self.emit_memcpy('map', 'length')
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
+ if function.name == 'glFlushMappedBufferRange':
+- print ' GLvoid *map = NULL;'
+- print ' _glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &map);'
+- print ' if (map && length > 0) {'
++ print(' GLvoid *map = NULL;')
++ print(' _glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &map);')
++ print(' if (map && length > 0) {')
+ self.emit_memcpy('(const char *)map + offset', 'length')
+- print ' }'
++ print(' }')
+ if function.name == 'glFlushMappedBufferRangeEXT':
+- print ' GLvoid *map = NULL;'
+- print ' _glGetBufferPointervOES(target, GL_BUFFER_MAP_POINTER_OES, &map);'
+- print ' if (map && length > 0) {'
++ print(' GLvoid *map = NULL;')
++ print(' _glGetBufferPointervOES(target, GL_BUFFER_MAP_POINTER_OES, &map);')
++ print(' if (map && length > 0) {')
+ self.emit_memcpy('(const char *)map + offset', 'length')
+- print ' }'
++ print(' }')
+ if function.name == 'glFlushMappedBufferRangeAPPLE':
+- print ' GLvoid *map = NULL;'
+- print ' _glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &map);'
+- print ' if (map && size > 0) {'
++ print(' GLvoid *map = NULL;')
++ print(' _glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &map);')
++ print(' if (map && size > 0) {')
+ self.emit_memcpy('(const char *)map + offset', 'size')
+- print ' }'
++ print(' }')
+ if function.name == 'glFlushMappedNamedBufferRange':
+- print ' GLvoid *map = NULL;'
+- print ' _glGetNamedBufferPointerv(buffer, GL_BUFFER_MAP_POINTER, &map);'
+- print ' if (map && length > 0) {'
++ print(' GLvoid *map = NULL;')
++ print(' _glGetNamedBufferPointerv(buffer, GL_BUFFER_MAP_POINTER, &map);')
++ print(' if (map && length > 0) {')
+ self.emit_memcpy('(const char *)map + offset', 'length')
+- print ' }'
++ print(' }')
+ if function.name == 'glFlushMappedNamedBufferRangeEXT':
+- print ' GLvoid *map = NULL;'
+- print ' _glGetNamedBufferPointervEXT(buffer, GL_BUFFER_MAP_POINTER, &map);'
+- print ' if (map && length > 0) {'
++ print(' GLvoid *map = NULL;')
++ print(' _glGetNamedBufferPointervEXT(buffer, GL_BUFFER_MAP_POINTER, &map);')
++ print(' if (map && length > 0) {')
+ self.emit_memcpy('(const char *)map + offset', 'length')
+- print ' }'
++ print(' }')
+
+ # FIXME: We don't support coherent/pinned memory mappings
+ if function.name in ('glBufferStorage', 'glNamedBufferStorage', 'glNamedBufferStorageEXT'):
+- print r' if (!(flags & GL_MAP_PERSISTENT_BIT)) {'
+- print r' os::log("apitrace: warning: %s: MAP_NOTIFY_EXPLICIT_BIT_VMWX set w/o MAP_PERSISTENT_BIT\n", __FUNCTION__);'
+- print r' }'
+- print r' flags &= ~GL_MAP_NOTIFY_EXPLICIT_BIT_VMWX;'
++ print(r' if (!(flags & GL_MAP_PERSISTENT_BIT)) {')
++ print(r' os::log("apitrace: warning: %s: MAP_NOTIFY_EXPLICIT_BIT_VMWX set w/o MAP_PERSISTENT_BIT\n", __FUNCTION__);')
++ print(r' }')
++ print(r' flags &= ~GL_MAP_NOTIFY_EXPLICIT_BIT_VMWX;')
+ if function.name in ('glMapBufferRange', 'glMapBufferRangeEXT', 'glMapNamedBufferRange', 'glMapNamedBufferRangeEXT'):
+- print r' if (access & GL_MAP_NOTIFY_EXPLICIT_BIT_VMWX) {'
+- print r' if (!(access & GL_MAP_PERSISTENT_BIT)) {'
+- print r' os::log("apitrace: warning: %s: MAP_NOTIFY_EXPLICIT_BIT_VMWX set w/o MAP_PERSISTENT_BIT\n", __FUNCTION__);'
+- print r' }'
+- print r' if (access & GL_MAP_FLUSH_EXPLICIT_BIT) {'
+- print r' os::log("apitrace: warning: %s: MAP_NOTIFY_EXPLICIT_BIT_VMWX set w/ MAP_FLUSH_EXPLICIT_BIT\n", __FUNCTION__);'
+- print r' }'
+- print r' access &= ~GL_MAP_NOTIFY_EXPLICIT_BIT_VMWX;'
+- print r' } else if (access & GL_MAP_COHERENT_BIT) {'
+- print r' os::log("apitrace: warning: %s: MAP_COHERENT_BIT unsupported (https://github.com/apitrace/apitrace/issues/232)\n", __FUNCTION__);'
+- print r' } else if ((access & GL_MAP_PERSISTENT_BIT) &&'
+- print r' !(access & GL_MAP_FLUSH_EXPLICIT_BIT)) {'
+- print r' os::log("apitrace: warning: %s: MAP_PERSISTENT_BIT w/o FLUSH_EXPLICIT_BIT unsupported (https://github.com/apitrace/apitrace/issues/232)\n", __FUNCTION__);'
+- print r' }'
++ print(r' if (access & GL_MAP_NOTIFY_EXPLICIT_BIT_VMWX) {')
++ print(r' if (!(access & GL_MAP_PERSISTENT_BIT)) {')
++ print(r' os::log("apitrace: warning: %s: MAP_NOTIFY_EXPLICIT_BIT_VMWX set w/o MAP_PERSISTENT_BIT\n", __FUNCTION__);')
++ print(r' }')
++ print(r' if (access & GL_MAP_FLUSH_EXPLICIT_BIT) {')
++ print(r' os::log("apitrace: warning: %s: MAP_NOTIFY_EXPLICIT_BIT_VMWX set w/ MAP_FLUSH_EXPLICIT_BIT\n", __FUNCTION__);')
++ print(r' }')
++ print(r' access &= ~GL_MAP_NOTIFY_EXPLICIT_BIT_VMWX;')
++ print(r' } else if (access & GL_MAP_COHERENT_BIT) {')
++ print(r' os::log("apitrace: warning: %s: MAP_COHERENT_BIT unsupported (https://github.com/apitrace/apitrace/issues/232)\n", __FUNCTION__);')
++ print(r' } else if ((access & GL_MAP_PERSISTENT_BIT) &&')
++ print(r' !(access & GL_MAP_FLUSH_EXPLICIT_BIT)) {')
++ print(r' os::log("apitrace: warning: %s: MAP_PERSISTENT_BIT w/o FLUSH_EXPLICIT_BIT unsupported (https://github.com/apitrace/apitrace/issues/232)\n", __FUNCTION__);')
++ print(r' }')
+ if function.name in ('glBufferData', 'glBufferDataARB'):
+- print r' if (target == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD) {'
+- print r' os::log("apitrace: warning: GL_AMD_pinned_memory not fully supported\n");'
+- print r' }'
++ print(r' if (target == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD) {')
++ print(r' os::log("apitrace: warning: GL_AMD_pinned_memory not fully supported\n");')
++ print(r' }')
+
+ # TODO: We don't track GL_INTEL_map_texture mappings
+ if function.name == 'glMapTexture2DINTEL':
+- print r' if (access & GL_MAP_WRITE_BIT) {'
+- print r' os::log("apitrace: warning: GL_INTEL_map_texture not fully supported\n");'
+- print r' }'
++ print(r' if (access & GL_MAP_WRITE_BIT) {')
++ print(r' os::log("apitrace: warning: GL_INTEL_map_texture not fully supported\n");')
++ print(r' }')
+
+ # Don't leave vertex attrib locations to chance. Instead emit fake
+ # glBindAttribLocation calls to ensure that the same locations will be
+@@ -715,40 +715,40 @@ class GlTracer(Tracer):
+ # many entry-points, including non-shader related ones.
+ if function.name == 'glLinkProgram':
+ Tracer.invokeFunction(self, function)
+- print ' GLint active_attributes = 0;'
+- print ' _glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &active_attributes);'
+- print ' for (GLint attrib = 0; attrib < active_attributes; ++attrib) {'
+- print ' GLint size = 0;'
+- print ' GLenum type = 0;'
+- print ' GLchar name[256];'
++ print(' GLint active_attributes = 0;')
++ print(' _glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &active_attributes);')
++ print(' for (GLint attrib = 0; attrib < active_attributes; ++attrib) {')
++ print(' GLint size = 0;')
++ print(' GLenum type = 0;')
++ print(' GLchar name[256];')
+ # TODO: Use ACTIVE_ATTRIBUTE_MAX_LENGTH instead of 256
+- print ' _glGetActiveAttrib(program, attrib, sizeof name, NULL, &size, &type, name);'
+- print " if (name[0] != 'g' || name[1] != 'l' || name[2] != '_') {"
+- print ' GLint location = _glGetAttribLocation(program, name);'
+- print ' if (location >= 0) {'
++ print(' _glGetActiveAttrib(program, attrib, sizeof name, NULL, &size, &type, name);')
++ print(" if (name[0] != 'g' || name[1] != 'l' || name[2] != '_') {")
++ print(' GLint location = _glGetAttribLocation(program, name);')
++ print(' if (location >= 0) {')
+ bind_function = glapi.glapi.getFunctionByName('glBindAttribLocation')
+ self.fake_call(bind_function, ['program', 'location', 'name'])
+- print ' }'
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
++ print(' }')
+ if function.name == 'glLinkProgramARB':
+ Tracer.invokeFunction(self, function)
+- print ' GLint active_attributes = 0;'
+- print ' _glGetObjectParameterivARB(programObj, GL_OBJECT_ACTIVE_ATTRIBUTES_ARB, &active_attributes);'
+- print ' for (GLint attrib = 0; attrib < active_attributes; ++attrib) {'
+- print ' GLint size = 0;'
+- print ' GLenum type = 0;'
+- print ' GLcharARB name[256];'
++ print(' GLint active_attributes = 0;')
++ print(' _glGetObjectParameterivARB(programObj, GL_OBJECT_ACTIVE_ATTRIBUTES_ARB, &active_attributes);')
++ print(' for (GLint attrib = 0; attrib < active_attributes; ++attrib) {')
++ print(' GLint size = 0;')
++ print(' GLenum type = 0;')
++ print(' GLcharARB name[256];')
+ # TODO: Use ACTIVE_ATTRIBUTE_MAX_LENGTH instead of 256
+- print ' _glGetActiveAttribARB(programObj, attrib, sizeof name, NULL, &size, &type, name);'
+- print " if (name[0] != 'g' || name[1] != 'l' || name[2] != '_') {"
+- print ' GLint location = _glGetAttribLocationARB(programObj, name);'
+- print ' if (location >= 0) {'
++ print(' _glGetActiveAttribARB(programObj, attrib, sizeof name, NULL, &size, &type, name);')
++ print(" if (name[0] != 'g' || name[1] != 'l' || name[2] != '_') {")
++ print(' GLint location = _glGetAttribLocationARB(programObj, name);')
++ print(' if (location >= 0) {')
+ bind_function = glapi.glapi.getFunctionByName('glBindAttribLocationARB')
+ self.fake_call(bind_function, ['programObj', 'location', 'name'])
+- print ' }'
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
++ print(' }')
+
+ self.shadowBufferProlog(function)
+
+@@ -815,9 +815,9 @@ class GlTracer(Tracer):
+ # Force glProgramBinary to fail. Per ARB_get_program_binary this
+ # should signal the app that it needs to recompile.
+ if function.name in ('glProgramBinary', 'glProgramBinaryOES'):
+- print r' binaryFormat = 0xDEADDEAD;'
+- print r' binary = &binaryFormat;'
+- print r' length = sizeof binaryFormat;'
++ print(r' binaryFormat = 0xDEADDEAD;')
++ print(r' binary = &binaryFormat;')
++ print(r' length = sizeof binaryFormat;')
+
+ Tracer.invokeFunction(self, function)
+
+@@ -838,25 +838,25 @@ class GlTracer(Tracer):
+ # We may be faking KHR_debug, so ensure the pointer queries result is
+ # always zeroed to prevent dereference of unitialized pointers
+ if function.name == 'glGetPointerv':
+- print ' if (params &&'
+- print ' (pname == GL_DEBUG_CALLBACK_FUNCTION ||'
+- print ' pname == GL_DEBUG_CALLBACK_USER_PARAM)) {'
+- print ' *params = NULL;'
+- print ' }'
++ print(' if (params &&')
++ print(' (pname == GL_DEBUG_CALLBACK_FUNCTION ||')
++ print(' pname == GL_DEBUG_CALLBACK_USER_PARAM)) {')
++ print(' *params = NULL;')
++ print(' }')
+
+ if function.name in self.getProcAddressFunctionNames:
+ nameArg = function.args[0].name
+- print ' if (strcmp("glNotifyMappedBufferRangeVMWX", (const char *)%s) == 0) {' % (nameArg,)
+- print ' _result = (%s)&glNotifyMappedBufferRangeVMWX;' % (function.type,)
+- print ' } else if (strcmp("glTexDirectVIV", (const char *)%s) == 0) {' % (nameArg,)
+- print ' _result = (%s)&glTexDirectVIV;' % (function.type,)
+- print ' } else if (strcmp("glTexDirectInvalidateVIV", (const char *)%s) == 0) {' % (nameArg,)
+- print ' _result = (%s)&glTexDirectInvalidateVIV;' % (function.type,)
++ print(' if (strcmp("glNotifyMappedBufferRangeVMWX", (const char *)%s) == 0) {' % (nameArg,))
++ print(' _result = (%s)&glNotifyMappedBufferRangeVMWX;' % (function.type,))
++ print(' } else if (strcmp("glTexDirectVIV", (const char *)%s) == 0) {' % (nameArg,))
++ print(' _result = (%s)&glTexDirectVIV;' % (function.type,))
++ print(' } else if (strcmp("glTexDirectInvalidateVIV", (const char *)%s) == 0) {' % (nameArg,))
++ print(' _result = (%s)&glTexDirectInvalidateVIV;' % (function.type,))
+ for marker_function in self.marker_functions:
+ if self.api.getFunctionByName(marker_function):
+- print ' } else if (strcmp("%s", (const char *)%s) == 0) {' % (marker_function, nameArg)
+- print ' _result = (%s)&%s;' % (function.type, marker_function)
+- print ' } else {'
++ print(' } else if (strcmp("%s", (const char *)%s) == 0) {' % (marker_function, nameArg))
++ print(' _result = (%s)&%s;' % (function.type, marker_function))
++ print(' } else {')
+ Tracer.doInvokeFunction(self, function)
+
+ # Replace function addresses with ours
+@@ -864,24 +864,24 @@ class GlTracer(Tracer):
+ # contain the addresses of the wrapper functions, and not the real
+ # functions, but in practice this should make no difference.
+ if function.name in self.getProcAddressFunctionNames:
+- print ' _result = _wrapProcAddress(%s, _result);' % (nameArg,)
++ print(' _result = _wrapProcAddress(%s, _result);' % (nameArg,))
+
+- print ' }'
++ print(' }')
+ return
+
+ if function.name in ('glGetProgramBinary', 'glGetProgramBinaryOES'):
+- print r' bufSize = 0;'
++ print(r' bufSize = 0;')
+
+ Tracer.doInvokeFunction(self, function)
+
+ if function.name == 'glGetProgramiv':
+- print r' if (params && pname == GL_PROGRAM_BINARY_LENGTH) {'
+- print r' *params = 0;'
+- print r' }'
++ print(r' if (params && pname == GL_PROGRAM_BINARY_LENGTH) {')
++ print(r' *params = 0;')
++ print(r' }')
+ if function.name in ('glGetProgramBinary', 'glGetProgramBinaryOES'):
+- print r' if (length) {'
+- print r' *length = 0;'
+- print r' }'
++ print(r' if (length) {')
++ print(r' *length = 0;')
++ print(r' }')
+
+ buffer_targets = [
+ 'ARRAY_BUFFER',
+@@ -902,9 +902,9 @@ class GlTracer(Tracer):
+
+ # Keep track of buffer mappings
+ if function.name in ('glMapBufferRange', 'glMapBufferRangeEXT'):
+- print ' if (access & GL_MAP_WRITE_BIT) {'
+- print ' _checkBufferMapRange = true;'
+- print ' }'
++ print(' if (access & GL_MAP_WRITE_BIT) {')
++ print(' _checkBufferMapRange = true;')
++ print(' }')
+
+ boolean_names = [
+ 'GL_FALSE',
+@@ -932,17 +932,17 @@ class GlTracer(Tracer):
+ and (isinstance(arg.type, stdapi.Blob) \
+ or (isinstance(arg.type, stdapi.Const) \
+ and isinstance(arg.type.type, stdapi.Blob))):
+- print ' {'
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print ' GLint _unpack_buffer = 0;'
+- print ' if (ctx->profile.desktop())'
+- print ' _glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &_unpack_buffer);'
+- print ' if (_unpack_buffer) {'
+- print ' trace::localWriter.writePointer((uintptr_t)%s);' % arg.name
+- print ' } else {'
++ print(' {')
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print(' GLint _unpack_buffer = 0;')
++ print(' if (ctx->profile.desktop())')
++ print(' _glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &_unpack_buffer);')
++ print(' if (_unpack_buffer) {')
++ print(' trace::localWriter.writePointer((uintptr_t)%s);' % arg.name)
++ print(' } else {')
+ Tracer.serializeArgValue(self, function, arg)
+- print ' }'
+- print ' }'
++ print(' }')
++ print(' }')
+ return
+
+ # Several GL state functions take GLenum symbolic names as
+@@ -953,11 +953,11 @@ class GlTracer(Tracer):
+ assert arg.index > 0
+ assert function.args[arg.index - 1].name == 'pname'
+ assert function.args[arg.index - 1].type == glapi.GLenum
+- print ' if (is_symbolic_pname(pname) && is_symbolic_param(%s)) {' % arg.name
++ print(' if (is_symbolic_pname(pname) && is_symbolic_param(%s)) {' % arg.name)
+ self.serializeValue(glapi.GLenum, arg.name)
+- print ' } else {'
++ print(' } else {')
+ Tracer.serializeArgValue(self, function, arg)
+- print ' }'
++ print(' }')
+ return
+
+ Tracer.serializeArgValue(self, function, arg)
+@@ -967,20 +967,20 @@ class GlTracer(Tracer):
+
+ # A simple state tracker to track the pointer values
+ # update the state
+- print 'static void _trace_user_arrays(GLuint count)'
+- print '{'
+- print ' gltrace::Context *ctx = gltrace::getContext();'
+- print
+- print ' glprofile::Profile profile = ctx->profile;'
+- print ' bool es1 = profile.es() && profile.major == 1;'
+- print
++ print('static void _trace_user_arrays(GLuint count)')
++ print('{')
++ print(' gltrace::Context *ctx = gltrace::getContext();')
++ print()
++ print(' glprofile::Profile profile = ctx->profile;')
++ print(' bool es1 = profile.es() && profile.major == 1;')
++ print()
+
+ # Temporarily unbind the array buffer
+- print ' GLint _array_buffer = _glGetInteger(GL_ARRAY_BUFFER_BINDING);'
+- print ' if (_array_buffer) {'
++ print(' GLint _array_buffer = _glGetInteger(GL_ARRAY_BUFFER_BINDING);')
++ print(' if (_array_buffer) {')
+ self.fake_glBindBuffer(api, 'GL_ARRAY_BUFFER', '0')
+- print ' }'
+- print
++ print(' }')
++ print()
+
+ for camelcase_name, uppercase_name in self.arrays:
+ # in which profile is the array available?
+@@ -993,45 +993,45 @@ class GlTracer(Tracer):
+ binding_name = 'GL_%s_ARRAY_BUFFER_BINDING' % uppercase_name
+ function = api.getFunctionByName(function_name)
+
+- print ' // %s' % function.prototype()
+- print ' if (%s) {' % profile_check
++ print(' // %s' % function.prototype())
++ print(' if (%s) {' % profile_check)
+ self.array_trace_prolog(api, uppercase_name)
+ self.array_prolog(api, uppercase_name)
+- print ' if (_glIsEnabled(%s)) {' % enable_name
+- print ' GLint _binding = _glGetInteger(%s);' % binding_name
+- print ' if (!_binding) {'
++ print(' if (_glIsEnabled(%s)) {' % enable_name)
++ print(' GLint _binding = _glGetInteger(%s);' % binding_name)
++ print(' if (!_binding) {')
+
+ # Get the arguments via glGet*
+ for arg in function.args:
+ arg_get_enum = 'GL_%s_ARRAY_%s' % (uppercase_name, arg.name.upper())
+ arg_get_function, arg_type = TypeGetter().visit(arg.type)
+- print ' %s %s = 0;' % (arg_type, arg.name)
+- print ' _%s(%s, &%s);' % (arg_get_function, arg_get_enum, arg.name)
++ print(' %s %s = 0;' % (arg_type, arg.name))
++ print(' _%s(%s, &%s);' % (arg_get_function, arg_get_enum, arg.name))
+
+ arg_names = ', '.join([arg.name for arg in function.args[:-1]])
+- print ' size_t _size = _%s_size(%s, count);' % (function.name, arg_names)
++ print(' size_t _size = _%s_size(%s, count);' % (function.name, arg_names))
+
+ # Emit a fake function
+ self.array_trace_intermezzo(api, uppercase_name)
+- print ' unsigned _call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,)
++ print(' unsigned _call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,))
+ for arg in function.args:
+ assert not arg.output
+- print ' trace::localWriter.beginArg(%u);' % (arg.index,)
++ print(' trace::localWriter.beginArg(%u);' % (arg.index,))
+ if arg.name != 'pointer':
+ self.serializeValue(arg.type, arg.name)
+ else:
+- print ' trace::localWriter.writeBlob((const void *)%s, _size);' % (arg.name)
+- print ' trace::localWriter.endArg();'
++ print(' trace::localWriter.writeBlob((const void *)%s, _size);' % (arg.name))
++ print(' trace::localWriter.endArg();')
+
+- print ' trace::localWriter.endEnter();'
+- print ' trace::localWriter.beginLeave(_call);'
+- print ' trace::localWriter.endLeave();'
+- print ' }'
+- print ' }'
++ print(' trace::localWriter.endEnter();')
++ print(' trace::localWriter.beginLeave(_call);')
++ print(' trace::localWriter.endLeave();')
++ print(' }')
++ print(' }')
+ self.array_epilog(api, uppercase_name)
+ self.array_trace_epilog(api, uppercase_name)
+- print ' }'
+- print
++ print(' }')
++ print()
+
+ # Samething, but for glVertexAttribPointer*
+ #
+@@ -1043,12 +1043,12 @@ class GlTracer(Tracer):
+ # This means that the implementations of these functions do not always
+ # alias, and they need to be considered independently.
+ #
+- print ' // ES1 does not support generic vertex attributes'
+- print ' if (es1)'
+- print ' return;'
+- print
+- print ' vertex_attrib _vertex_attrib = _get_vertex_attrib();'
+- print
++ print(' // ES1 does not support generic vertex attributes')
++ print(' if (es1)')
++ print(' return;')
++ print()
++ print(' vertex_attrib _vertex_attrib = _get_vertex_attrib();')
++ print()
+ for suffix in ['', 'NV']:
+ if suffix:
+ SUFFIX = '_' + suffix
+@@ -1057,24 +1057,24 @@ class GlTracer(Tracer):
+ function_name = 'glVertexAttribPointer' + suffix
+ function = api.getFunctionByName(function_name)
+
+- print ' // %s' % function.prototype()
+- print ' if (_vertex_attrib == VERTEX_ATTRIB%s) {' % SUFFIX
++ print(' // %s' % function.prototype())
++ print(' if (_vertex_attrib == VERTEX_ATTRIB%s) {' % SUFFIX)
+ if suffix == 'NV':
+- print ' GLint _max_vertex_attribs = 16;'
++ print(' GLint _max_vertex_attribs = 16;')
+ else:
+- print ' GLint _max_vertex_attribs = _glGetInteger(GL_MAX_VERTEX_ATTRIBS);'
+- print ' for (GLint index = 0; index < _max_vertex_attribs; ++index) {'
+- print ' GLint _enabled = 0;'
++ print(' GLint _max_vertex_attribs = _glGetInteger(GL_MAX_VERTEX_ATTRIBS);')
++ print(' for (GLint index = 0; index < _max_vertex_attribs; ++index) {')
++ print(' GLint _enabled = 0;')
+ if suffix == 'NV':
+- print ' _glGetIntegerv(GL_VERTEX_ATTRIB_ARRAY0_NV + index, &_enabled);'
++ print(' _glGetIntegerv(GL_VERTEX_ATTRIB_ARRAY0_NV + index, &_enabled);')
+ else:
+- print ' _glGetVertexAttribiv%s(index, GL_VERTEX_ATTRIB_ARRAY_ENABLED%s, &_enabled);' % (suffix, SUFFIX)
+- print ' if (_enabled) {'
+- print ' GLint _binding = 0;'
++ print(' _glGetVertexAttribiv%s(index, GL_VERTEX_ATTRIB_ARRAY_ENABLED%s, &_enabled);' % (suffix, SUFFIX))
++ print(' if (_enabled) {')
++ print(' GLint _binding = 0;')
+ if suffix != 'NV':
+ # It doesn't seem possible to use VBOs with NV_vertex_program.
+- print ' _glGetVertexAttribiv%s(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING%s, &_binding);' % (suffix, SUFFIX)
+- print ' if (!_binding) {'
++ print(' _glGetVertexAttribiv%s(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING%s, &_binding);' % (suffix, SUFFIX))
++ print(' if (!_binding) {')
+
+ # Get the arguments via glGet*
+ for arg in function.args[1:]:
+@@ -1083,40 +1083,40 @@ class GlTracer(Tracer):
+ else:
+ arg_get_enum = 'GL_VERTEX_ATTRIB_ARRAY_%s%s' % (arg.name.upper(), SUFFIX)
+ arg_get_function, arg_type = TypeGetter('glGetVertexAttrib', False, suffix).visit(arg.type)
+- print ' %s %s = 0;' % (arg_type, arg.name)
+- print ' _%s(index, %s, &%s);' % (arg_get_function, arg_get_enum, arg.name)
++ print(' %s %s = 0;' % (arg_type, arg.name))
++ print(' _%s(index, %s, &%s);' % (arg_get_function, arg_get_enum, arg.name))
+
+ arg_names = ', '.join([arg.name for arg in function.args[1:-1]])
+- print ' size_t _size = _%s_size(%s, count);' % (function.name, arg_names)
++ print(' size_t _size = _%s_size(%s, count);' % (function.name, arg_names))
+
+ # Emit a fake function
+- print ' unsigned _call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,)
++ print(' unsigned _call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,))
+ for arg in function.args:
+ assert not arg.output
+- print ' trace::localWriter.beginArg(%u);' % (arg.index,)
++ print(' trace::localWriter.beginArg(%u);' % (arg.index,))
+ if arg.name != 'pointer':
+ self.serializeValue(arg.type, arg.name)
+ else:
+- print ' trace::localWriter.writeBlob((const void *)%s, _size);' % (arg.name)
+- print ' trace::localWriter.endArg();'
++ print(' trace::localWriter.writeBlob((const void *)%s, _size);' % (arg.name))
++ print(' trace::localWriter.endArg();')
+
+- print ' trace::localWriter.endEnter();'
+- print ' trace::localWriter.beginLeave(_call);'
+- print ' trace::localWriter.endLeave();'
+- print ' }'
+- print ' }'
+- print ' }'
+- print ' }'
+- print
++ print(' trace::localWriter.endEnter();')
++ print(' trace::localWriter.beginLeave(_call);')
++ print(' trace::localWriter.endLeave();')
++ print(' }')
++ print(' }')
++ print(' }')
++ print(' }')
++ print()
+
+ # Restore the original array_buffer
+- print ' if (_array_buffer) {'
++ print(' if (_array_buffer) {')
+ self.fake_glBindBuffer(api, 'GL_ARRAY_BUFFER', '_array_buffer')
+- print ' }'
+- print
++ print(' }')
++ print()
+
+- print '}'
+- print
++ print('}')
++ print()
+
+ #
+ # Hooks for glTexCoordPointer, which is identical to the other array
+@@ -1125,49 +1125,49 @@ class GlTracer(Tracer):
+
+ def array_prolog(self, api, uppercase_name):
+ if uppercase_name == 'TEXTURE_COORD':
+- print ' GLint max_units = 0;'
+- print ' if (ctx->profile.desktop())'
+- print ' _glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_units);'
+- print ' else'
+- print ' _glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_units);'
+- print ' GLint client_active_texture = GL_TEXTURE0;'
+- print ' if (max_units > 0) {'
+- print ' _glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE, &client_active_texture);'
+- print ' }'
+- print ' GLint unit = 0;'
+- print ' do {'
+- print ' GLint texture = GL_TEXTURE0 + unit;'
+- print ' if (max_units > 0) {'
+- print ' _glClientActiveTexture(texture);'
+- print ' }'
++ print(' GLint max_units = 0;')
++ print(' if (ctx->profile.desktop())')
++ print(' _glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_units);')
++ print(' else')
++ print(' _glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_units);')
++ print(' GLint client_active_texture = GL_TEXTURE0;')
++ print(' if (max_units > 0) {')
++ print(' _glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE, &client_active_texture);')
++ print(' }')
++ print(' GLint unit = 0;')
++ print(' do {')
++ print(' GLint texture = GL_TEXTURE0 + unit;')
++ print(' if (max_units > 0) {')
++ print(' _glClientActiveTexture(texture);')
++ print(' }')
+
+ def array_trace_prolog(self, api, uppercase_name):
+ if uppercase_name == 'TEXTURE_COORD':
+- print ' bool client_active_texture_dirty = false;'
++ print(' bool client_active_texture_dirty = false;')
+
+ def array_epilog(self, api, uppercase_name):
+ if uppercase_name == 'TEXTURE_COORD':
+- print ' } while (++unit < max_units);'
++ print(' } while (++unit < max_units);')
+ self.array_cleanup(api, uppercase_name)
+
+ def array_cleanup(self, api, uppercase_name):
+ if uppercase_name == 'TEXTURE_COORD':
+- print ' if (max_units > 0) {'
+- print ' _glClientActiveTexture(client_active_texture);'
+- print ' }'
++ print(' if (max_units > 0) {')
++ print(' _glClientActiveTexture(client_active_texture);')
++ print(' }')
+
+ def array_trace_intermezzo(self, api, uppercase_name):
+ if uppercase_name == 'TEXTURE_COORD':
+- print ' if (texture != client_active_texture || client_active_texture_dirty) {'
+- print ' client_active_texture_dirty = true;'
++ print(' if (texture != client_active_texture || client_active_texture_dirty) {')
++ print(' client_active_texture_dirty = true;')
+ self.fake_glClientActiveTexture_call(api, "texture");
+- print ' }'
++ print(' }')
+
+ def array_trace_epilog(self, api, uppercase_name):
+ if uppercase_name == 'TEXTURE_COORD':
+- print ' if (client_active_texture_dirty) {'
++ print(' if (client_active_texture_dirty) {')
+ self.fake_glClientActiveTexture_call(api, "client_active_texture");
+- print ' }'
++ print(' }')
+
+ def fake_glBindBuffer(self, api, target, buffer):
+ function = api.getFunctionByName('glBindBuffer')
+@@ -1180,13 +1180,13 @@ class GlTracer(Tracer):
+ def emitFakeTexture2D(self):
+ function = glapi.glapi.getFunctionByName('glTexImage2D')
+ instances = function.argNames()
+- print ' unsigned _fake_call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,)
++ print(' unsigned _fake_call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,))
+ for arg in function.args:
+ assert not arg.output
+ self.serializeArg(function, arg)
+- print ' trace::localWriter.endEnter();'
+- print ' trace::localWriter.beginLeave(_fake_call);'
+- print ' trace::localWriter.endLeave();'
++ print(' trace::localWriter.endEnter();')
++ print(' trace::localWriter.beginLeave(_fake_call);')
++ print(' trace::localWriter.endLeave();')
+
+
+
+diff --git a/wrappers/glxtrace.py b/wrappers/glxtrace.py
+index f35d1fe9..b05028e2 100644
+--- a/wrappers/glxtrace.py
++++ b/wrappers/glxtrace.py
+@@ -64,7 +64,7 @@ class GlxTracer(GlTracer):
+
+ def traceFunctionImplBody(self, function):
+ if function.name in self.destroyContextFunctionNames:
+- print ' gltrace::releaseContext((uintptr_t)ctx);'
++ print(' gltrace::releaseContext((uintptr_t)ctx);')
+
+ if function.name == 'glXGetCurrentDisplay':
+ print ' if(_glXGetCurrentDisplay == &glXGetCurrentDisplay ){'
+@@ -74,16 +74,16 @@ class GlxTracer(GlTracer):
+ GlTracer.traceFunctionImplBody(self, function)
+
+ if function.name in self.createContextFunctionNames:
+- print ' if (_result != NULL)'
+- print ' gltrace::createContext((uintptr_t)_result);'
++ print(' if (_result != NULL)')
++ print(' gltrace::createContext((uintptr_t)_result);')
+
+ if function.name in self.makeCurrentFunctionNames:
+- print ' if (_result) {'
+- print ' if (ctx != NULL)'
+- print ' gltrace::setContext((uintptr_t)ctx);'
+- print ' else'
+- print ' gltrace::clearContext();'
+- print ' }'
++ print(' if (_result) {')
++ print(' if (ctx != NULL)')
++ print(' gltrace::setContext((uintptr_t)ctx);')
++ print(' else')
++ print(' gltrace::clearContext();')
++ print(' }')
+
+ if function.name == 'glXBindTexImageEXT':
+ # FIXME: glXBindTexImageEXT gets called frequently, so we should
+@@ -92,7 +92,7 @@ class GlxTracer(GlTracer):
+ # emit emitFakeTexture2D when it changes
+ # - keep a global hash of the pixels
+ # FIXME: Handle mipmaps
+- print r'''
++ print(r'''
+ unsigned glx_target = 0;
+ _glXQueryDrawable(display, drawable, GLX_TEXTURE_TARGET_EXT, &glx_target);
+ GLenum target;
+@@ -152,29 +152,29 @@ class GlxTracer(GlTracer):
+ GLint row_stride = _align(width * 4, alignment);
+ GLvoid * pixels = malloc(height * row_stride);
+ _glGetTexImage(target, level, format, type, pixels);
+- '''
++ ''')
+ self.emitFakeTexture2D()
+- print r'''
++ print(r'''
+ free(pixels);
+ }
+- '''
++ ''')
+
+
+ if __name__ == '__main__':
+- print
+- print '#include <stdlib.h>'
+- print '#include <string.h>'
+- print
+- print '#include "trace_writer_local.hpp"'
+- print
+- print '// To validate our prototypes'
+- print '#define GL_GLEXT_PROTOTYPES'
+- print '#define GLX_GLXEXT_PROTOTYPES'
+- print
+- print '#include "dlopen.hpp"'
+- print '#include "glproc.hpp"'
+- print '#include "glsize.hpp"'
+- print
++ print()
++ print('#include <stdlib.h>')
++ print('#include <string.h>')
++ print()
++ print('#include "trace_writer_local.hpp"')
++ print()
++ print('// To validate our prototypes')
++ print('#define GL_GLEXT_PROTOTYPES')
++ print('#define GLX_GLXEXT_PROTOTYPES')
++ print()
++ print('#include "dlopen.hpp"')
++ print('#include "glproc.hpp"')
++ print('#include "glsize.hpp"')
++ print()
+
+ module = Module()
+ module.mergeModule(glxapi)
+diff --git a/wrappers/trace.py b/wrappers/trace.py
+index 7d1baa10..318f0990 100644
+--- a/wrappers/trace.py
++++ b/wrappers/trace.py
+@@ -69,21 +69,21 @@ class ComplexValueSerializer(stdapi.OnceVisitor):
+
+ def visitStruct(self, struct):
+ # Ensure member array has nonzero length to avoid MSVC error C2466
+- print 'static const char * _struct%s_members[%u] = {' % (struct.tag, max(len(struct.members), 1))
++ print('static const char * _struct%s_members[%u] = {' % (struct.tag, max(len(struct.members), 1)))
+ for type, name, in struct.members:
+ if name is None:
+- print ' "",'
++ print(' "",')
+ else:
+- print ' "%s",' % (name,)
+- print '};'
+- print 'static const trace::StructSig _struct%s_sig = {' % (struct.tag,)
++ print(' "%s",' % (name,))
++ print('};')
++ print('static const trace::StructSig _struct%s_sig = {' % (struct.tag,))
+ if struct.name is None:
+ structName = '""'
+ else:
+ structName = '"%s"' % struct.name
+- print ' %u, %s, %u, _struct%s_members' % (struct.id, structName, len(struct.members), struct.tag)
+- print '};'
+- print
++ print(' %u, %s, %u, _struct%s_members' % (struct.id, structName, len(struct.members), struct.tag))
++ print('};')
++ print()
+
+ def visitArray(self, array):
+ self.visit(array.type)
+@@ -95,26 +95,26 @@ class ComplexValueSerializer(stdapi.OnceVisitor):
+ pass
+
+ def visitEnum(self, enum):
+- print 'static const trace::EnumValue _enum%s_values[] = {' % (enum.tag)
++ print('static const trace::EnumValue _enum%s_values[] = {' % (enum.tag))
+ for value in enum.values:
+- print ' {"%s", %s},' % (value, value)
+- print '};'
+- print
+- print 'static const trace::EnumSig _enum%s_sig = {' % (enum.tag)
+- print ' %u, %u, _enum%s_values' % (enum.id, len(enum.values), enum.tag)
+- print '};'
+- print
++ print(' {"%s", %s},' % (value, value))
++ print('};')
++ print()
++ print('static const trace::EnumSig _enum%s_sig = {' % (enum.tag))
++ print(' %u, %u, _enum%s_values' % (enum.id, len(enum.values), enum.tag))
++ print('};')
++ print()
+
+ def visitBitmask(self, bitmask):
+- print 'static const trace::BitmaskFlag _bitmask%s_flags[] = {' % (bitmask.tag)
++ print('static const trace::BitmaskFlag _bitmask%s_flags[] = {' % (bitmask.tag))
+ for value in bitmask.values:
+- print ' {"%s", %s},' % (value, value)
+- print '};'
+- print
+- print 'static const trace::BitmaskSig _bitmask%s_sig = {' % (bitmask.tag)
+- print ' %u, %u, _bitmask%s_flags' % (bitmask.id, len(bitmask.values), bitmask.tag)
+- print '};'
+- print
++ print(' {"%s", %s},' % (value, value))
++ print('};')
++ print()
++ print('static const trace::BitmaskSig _bitmask%s_sig = {' % (bitmask.tag))
++ print(' %u, %u, _bitmask%s_flags' % (bitmask.id, len(bitmask.values), bitmask.tag))
++ print('};')
++ print()
+
+ def visitPointer(self, pointer):
+ self.visit(pointer.type)
+@@ -146,16 +146,16 @@ class ComplexValueSerializer(stdapi.OnceVisitor):
+ def visitPolymorphic(self, polymorphic):
+ if not polymorphic.contextLess:
+ return
+- print 'static void _write__%s(int selector, %s const & value) {' % (polymorphic.tag, polymorphic.expr)
+- print ' switch (selector) {'
++ print('static void _write__%s(int selector, %s const & value) {' % (polymorphic.tag, polymorphic.expr))
++ print(' switch (selector) {')
+ for cases, type in polymorphic.iterSwitch():
+ for case in cases:
+- print ' %s:' % case
++ print(' %s:' % case)
+ self.serializer.visit(type, '(%s)(value)' % (type,))
+- print ' break;'
+- print ' }'
+- print '}'
+- print
++ print(' break;')
++ print(' }')
++ print('}')
++ print()
+
+
+ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin):
+@@ -167,7 +167,7 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin):
+ '''
+
+ def visitLiteral(self, literal, instance):
+- print ' trace::localWriter.write%s(%s);' % (literal.kind, instance)
++ print(' trace::localWriter.write%s(%s);' % (literal.kind, instance))
+
+ def visitString(self, string, instance):
+ if not string.wide:
+@@ -183,33 +183,33 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin):
+ length = ', %s' % self.expand(string.length)
+ else:
+ length = ''
+- print ' trace::localWriter.write%s(%s%s);' % (suffix, instance, length)
++ print(' trace::localWriter.write%s(%s%s);' % (suffix, instance, length))
+
+ def visitConst(self, const, instance):
+ self.visit(const.type, instance)
+
+ def visitStruct(self, struct, instance):
+- print ' trace::localWriter.beginStruct(&_struct%s_sig);' % (struct.tag,)
++ print(' trace::localWriter.beginStruct(&_struct%s_sig);' % (struct.tag,))
+ for member in struct.members:
+ self.visitMember(member, instance)
+- print ' trace::localWriter.endStruct();'
++ print(' trace::localWriter.endStruct();')
+
+ def visitArray(self, array, instance):
+ length = '_c' + array.type.tag
+ index = '_i' + array.type.tag
+ array_length = self.expand(array.length)
+- print ' if (%s) {' % instance
+- print ' size_t %s = %s > 0 ? %s : 0;' % (length, array_length, array_length)
+- print ' trace::localWriter.beginArray(%s);' % length
+- print ' for (size_t %s = 0; %s < %s; ++%s) {' % (index, index, length, index)
+- print ' trace::localWriter.beginElement();'
++ print(' if (%s) {' % instance)
++ print(' size_t %s = %s > 0 ? %s : 0;' % (length, array_length, array_length))
++ print(' trace::localWriter.beginArray(%s);' % length)
++ print(' for (size_t %s = 0; %s < %s; ++%s) {' % (index, index, length, index))
++ print(' trace::localWriter.beginElement();')
+ self.visitElement(index, array.type, '(%s)[%s]' % (instance, index))
+- print ' trace::localWriter.endElement();'
+- print ' }'
+- print ' trace::localWriter.endArray();'
+- print ' } else {'
+- print ' trace::localWriter.writeNull();'
+- print ' }'
++ print(' trace::localWriter.endElement();')
++ print(' }')
++ print(' trace::localWriter.endArray();')
++ print(' } else {')
++ print(' trace::localWriter.writeNull();')
++ print(' }')
+
+ def visitAttribArray(self, array, instance):
+ # For each element, decide if it is a key or a value (which depends on the previous key).
+@@ -218,90 +218,90 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin):
+
+ # determine the array length which must be passed to writeArray() up front
+ count = '_c' + array.baseType.tag
+- print ' {'
+- print ' int %s;' % count
+- print ' for (%(c)s = 0; %(array)s && %(array)s[%(c)s] != %(terminator)s; %(c)s += 2) {' \
+- % {'c': count, 'array': instance, 'terminator': array.terminator}
++ print(' {')
++ print(' int %s;' % count)
++ print(' for (%(c)s = 0; %(array)s && %(array)s[%(c)s] != %(terminator)s; %(c)s += 2) {' \
++ % {'c': count, 'array': instance, 'terminator': array.terminator})
+ if array.hasKeysWithoutValues:
+- print ' switch (int(%(array)s[%(c)s])) {' % {'array': instance, 'c': count}
++ print(' switch (int(%(array)s[%(c)s])) {' % {'array': instance, 'c': count})
+ for key, valueType in array.valueTypes:
+ if valueType is None:
+- print ' case %s:' % key
+- print ' %s--;' % count # the next value is a key again and checked if it's the terminator
+- print ' break;'
+- print ' }'
+- print ' }'
+- print ' %(c)s += %(array)s ? 1 : 0;' % {'c': count, 'array': instance}
+- print ' trace::localWriter.beginArray(%s);' % count
++ print(' case %s:' % key)
++ print(' %s--;' % count) # the next value is a key again and checked if it's the terminator
++ print(' break;')
++ print(' }')
++ print(' }')
++ print(' %(c)s += %(array)s ? 1 : 0;' % {'c': count, 'array': instance})
++ print(' trace::localWriter.beginArray(%s);' % count)
+
+ # for each key / key-value pair write the key and the value, if the key requires one
+
+ index = '_i' + array.baseType.tag
+- print ' for (int %(i)s = 0; %(i)s < %(count)s; %(i)s++) {' % {'i': index, 'count': count}
+- print ' trace::localWriter.beginElement();'
++ print(' for (int %(i)s = 0; %(i)s < %(count)s; %(i)s++) {' % {'i': index, 'count': count})
++ print(' trace::localWriter.beginElement();')
+ self.visit(array.baseType, "%(array)s[%(i)s]" % {'array': instance, 'i': index})
+- print ' trace::localWriter.endElement();'
+- print ' if (%(i)s + 1 >= %(count)s) {' % {'i': index, 'count': count}
+- print ' break;'
+- print ' }'
+- print ' switch (int(%(array)s[%(i)s++])) {' % {'array': instance, 'i': index}
++ print(' trace::localWriter.endElement();')
++ print(' if (%(i)s + 1 >= %(count)s) {' % {'i': index, 'count': count})
++ print(' break;')
++ print(' }')
++ print(' switch (int(%(array)s[%(i)s++])) {' % {'array': instance, 'i': index})
+ # write generic value the usual way
+ for key, valueType in array.valueTypes:
+ if valueType is not None:
+- print ' case %s:' % key
+- print ' trace::localWriter.beginElement();'
++ print(' case %s:' % key)
++ print(' trace::localWriter.beginElement();')
+ self.visitElement(index, valueType, '(%(array)s)[%(i)s]' % {'array': instance, 'i': index})
+- print ' trace::localWriter.endElement();'
+- print ' break;'
++ print(' trace::localWriter.endElement();')
++ print(' break;')
+ # known key with no value, just decrease the index so we treat the next value as a key
+ if array.hasKeysWithoutValues:
+ for key, valueType in array.valueTypes:
+ if valueType is None:
+- print ' case %s:' % key
+- print ' %s--;' % index
+- print ' break;'
++ print(' case %s:' % key)
++ print(' %s--;' % index)
++ print(' break;')
+ # unknown key, write an int value
+- print ' default:'
+- print ' trace::localWriter.beginElement();'
+- print ' os::log("apitrace: warning: %s: unknown key 0x%04X, interpreting value as int\\n", ' + \
+- '__FUNCTION__, int(%(array)s[%(i)s - 1]));' % {'array': instance, 'i': index}
+- print ' trace::localWriter.writeSInt(%(array)s[%(i)s]);' % {'array': instance, 'i': index}
+- print ' trace::localWriter.endElement();'
+- print ' break;'
+- print ' }'
+- print ' }'
+- print ' trace::localWriter.endArray();'
+- print ' }'
++ print(' default:')
++ print(' trace::localWriter.beginElement();')
++ print(' os::log("apitrace: warning: %s: unknown key 0x%04X, interpreting value as int\\n", ' + \
++ '__FUNCTION__, int(%(array)s[%(i)s - 1]));' % {'array': instance, 'i': index})
++ print(' trace::localWriter.writeSInt(%(array)s[%(i)s]);' % {'array': instance, 'i': index})
++ print(' trace::localWriter.endElement();')
++ print(' break;')
++ print(' }')
++ print(' }')
++ print(' trace::localWriter.endArray();')
++ print(' }')
+
+
+ def visitBlob(self, blob, instance):
+- print ' trace::localWriter.writeBlob(%s, %s);' % (instance, self.expand(blob.size))
++ print(' trace::localWriter.writeBlob(%s, %s);' % (instance, self.expand(blob.size)))
+
+ def visitEnum(self, enum, instance):
+- print ' trace::localWriter.writeEnum(&_enum%s_sig, %s);' % (enum.tag, instance)
++ print(' trace::localWriter.writeEnum(&_enum%s_sig, %s);' % (enum.tag, instance))
+
+ def visitBitmask(self, bitmask, instance):
+- print ' trace::localWriter.writeBitmask(&_bitmask%s_sig, %s);' % (bitmask.tag, instance)
++ print(' trace::localWriter.writeBitmask(&_bitmask%s_sig, %s);' % (bitmask.tag, instance))
+
+ def visitPointer(self, pointer, instance):
+- print ' if (%s) {' % instance
+- print ' trace::localWriter.beginArray(1);'
+- print ' trace::localWriter.beginElement();'
++ print(' if (%s) {' % instance)
++ print(' trace::localWriter.beginArray(1);')
++ print(' trace::localWriter.beginElement();')
+ self.visit(pointer.type, "*" + instance)
+- print ' trace::localWriter.endElement();'
+- print ' trace::localWriter.endArray();'
+- print ' } else {'
+- print ' trace::localWriter.writeNull();'
+- print ' }'
++ print(' trace::localWriter.endElement();')
++ print(' trace::localWriter.endArray();')
++ print(' } else {')
++ print(' trace::localWriter.writeNull();')
++ print(' }')
+
+ def visitIntPointer(self, pointer, instance):
+- print ' trace::localWriter.writePointer((uintptr_t)%s);' % instance
++ print(' trace::localWriter.writePointer((uintptr_t)%s);' % instance)
+
+ def visitObjPointer(self, pointer, instance):
+- print ' trace::localWriter.writePointer((uintptr_t)%s);' % instance
++ print(' trace::localWriter.writePointer((uintptr_t)%s);' % instance)
+
+ def visitLinearPointer(self, pointer, instance):
+- print ' trace::localWriter.writePointer((uintptr_t)%s);' % instance
++ print(' trace::localWriter.writePointer((uintptr_t)%s);' % instance)
+
+ def visitReference(self, reference, instance):
+ self.visit(reference.type, instance)
+@@ -313,31 +313,31 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin):
+ self.visit(alias.type, instance)
+
+ def visitOpaque(self, opaque, instance):
+- print ' trace::localWriter.writePointer((uintptr_t)%s);' % instance
++ print(' trace::localWriter.writePointer((uintptr_t)%s);' % instance)
+
+ def visitInterface(self, interface, instance):
+ assert False
+
+ def visitPolymorphic(self, polymorphic, instance):
+ if polymorphic.contextLess:
+- print ' _write__%s(%s, %s);' % (polymorphic.tag, polymorphic.switchExpr, instance)
++ print(' _write__%s(%s, %s);' % (polymorphic.tag, polymorphic.switchExpr, instance))
+ else:
+ switchExpr = self.expand(polymorphic.switchExpr)
+- print ' switch (%s) {' % switchExpr
++ print(' switch (%s) {' % switchExpr)
+ for cases, type in polymorphic.iterSwitch():
+ for case in cases:
+- print ' %s:' % case
++ print(' %s:' % case)
+ caseInstance = instance
+ if type.expr is not None:
+ caseInstance = 'static_cast<%s>(%s)' % (type, caseInstance)
+ self.visit(type, caseInstance)
+- print ' break;'
++ print(' break;')
+ if polymorphic.defaultType is None:
+- print r' default:'
+- print r' os::log("apitrace: warning: %%s: unexpected polymorphic case %%i\n", __FUNCTION__, (int)%s);' % (switchExpr,)
+- print r' trace::localWriter.writeNull();'
+- print r' break;'
+- print ' }'
++ print(r' default:')
++ print(r' os::log("apitrace: warning: %%s: unexpected polymorphic case %%i\n", __FUNCTION__, (int)%s);' % (switchExpr,))
++ print(r' trace::localWriter.writeNull();')
++ print(r' break;')
++ print(' }')
+
+
+ class WrapDecider(stdapi.Traverser):
+@@ -369,16 +369,16 @@ class ValueWrapper(stdapi.Traverser, stdapi.ExpanderMixin):
+
+ def visitArray(self, array, instance):
+ array_length = self.expand(array.length)
+- print " if (%s) {" % instance
+- print " for (size_t _i = 0, _s = %s; _i < _s; ++_i) {" % array_length
++ print(" if (%s) {" % instance)
++ print(" for (size_t _i = 0, _s = %s; _i < _s; ++_i) {" % array_length)
+ self.visitElement('_i', array.type, instance + "[_i]")
+- print " }"
+- print " }"
++ print(" }")
++ print(" }")
+
+ def visitPointer(self, pointer, instance):
+- print " if (%s) {" % instance
++ print(" if (%s) {" % instance)
+ self.visit(pointer.type, "*" + instance)
+- print " }"
++ print(" }")
+
+ def visitObjPointer(self, pointer, instance):
+ elem_type = pointer.type.mutable()
+@@ -388,13 +388,13 @@ class ValueWrapper(stdapi.Traverser, stdapi.ExpanderMixin):
+ self.visitInterfacePointer(elem_type.type, instance)
+ else:
+ # All interfaces should at least implement IUnknown
+- print " WrapIUnknown::_wrap(__FUNCTION__, (IUnknown **) &%s);" % (instance,)
++ print(" WrapIUnknown::_wrap(__FUNCTION__, (IUnknown **) &%s);" % (instance,))
+
+ def visitInterface(self, interface, instance):
+ raise NotImplementedError
+
+ def visitInterfacePointer(self, interface, instance):
+- print " Wrap%s::_wrap(__FUNCTION__, &%s);" % (interface.name, instance)
++ print(" Wrap%s::_wrap(__FUNCTION__, &%s);" % (interface.name, instance))
+
+ def visitPolymorphic(self, type, instance):
+ # XXX: There might be polymorphic values that need wrapping in the future
+@@ -409,17 +409,17 @@ class ValueUnwrapper(ValueWrapper):
+ def visitStruct(self, struct, instance):
+ if not self.allocated:
+ # Argument is constant. We need to create a non const
+- print ' {'
+- print " %s * _t = static_cast<%s *>(alloca(sizeof *_t));" % (struct, struct)
+- print ' *_t = %s;' % (instance,)
++ print(' {')
++ print(" %s * _t = static_cast<%s *>(alloca(sizeof *_t));" % (struct, struct))
++ print(' *_t = %s;' % (instance,))
+ assert instance.startswith('*')
+- print ' %s = _t;' % (instance[1:],)
++ print(' %s = _t;' % (instance[1:],))
+ instance = '*_t'
+ self.allocated = True
+ try:
+ return ValueWrapper.visitStruct(self, struct, instance)
+ finally:
+- print ' }'
++ print(' }')
+ else:
+ return ValueWrapper.visitStruct(self, struct, instance)
+
+@@ -428,18 +428,18 @@ class ValueUnwrapper(ValueWrapper):
+ return ValueWrapper.visitArray(self, array, instance)
+ array_length = self.expand(array.length)
+ elem_type = array.type.mutable()
+- print " if (%s && %s) {" % (instance, array_length)
+- print " %s * _t = static_cast<%s *>(alloca(%s * sizeof *_t));" % (elem_type, elem_type, array_length)
+- print " for (size_t _i = 0, _s = %s; _i < _s; ++_i) {" % array_length
+- print " _t[_i] = %s[_i];" % instance
++ print(" if (%s && %s) {" % (instance, array_length))
++ print(" %s * _t = static_cast<%s *>(alloca(%s * sizeof *_t));" % (elem_type, elem_type, array_length))
++ print(" for (size_t _i = 0, _s = %s; _i < _s; ++_i) {" % array_length)
++ print(" _t[_i] = %s[_i];" % instance)
+ self.allocated = True
+ self.visit(array.type, "_t[_i]")
+- print " }"
+- print " %s = _t;" % instance
+- print " }"
++ print(" }")
++ print(" %s = _t;" % instance)
++ print(" }")
+
+ def visitInterfacePointer(self, interface, instance):
+- print r' Wrap%s::_unwrap(__FUNCTION__, &%s);' % (interface.name, instance)
++ print(r' Wrap%s::_unwrap(__FUNCTION__, &%s);' % (interface.name, instance))
+
+
+ def _getInterfaceHierarchy(allIfaces, baseIface, result):
+@@ -479,14 +479,17 @@ class Tracer:
+ # Includes
+ for module in api.modules:
+ for header in module.headers:
+- print header
+- print
++ print(header)
++ print()
+
+ # Generate the serializer functions
+ types = api.getAllTypes()
+ visitor = ComplexValueSerializer(self.serializerFactory())
+- map(visitor.visit, types)
+- print
++
++ for tp in types:
++ visitor.visit(tp)
++
++ print()
+
+ # Interfaces wrapers
+ self.traceInterfaces(api)
+@@ -498,22 +501,22 @@ class Tracer:
+ self.traceFunctionDecl(function)
+ for function in api.getAllFunctions():
+ self.traceFunctionImpl(function)
+- print
++ print()
+
+ self.footer(api)
+
+ def header(self, api):
+- print '#ifdef _WIN32'
+- print '# include <malloc.h> // alloca'
+- print '# ifndef alloca'
+- print '# define alloca _alloca'
+- print '# endif'
+- print '#else'
+- print '# include <alloca.h> // alloca'
+- print '#endif'
+- print
+- print
+- print 'static std::map<void *, void *> g_WrappedObjects;'
++ print('#ifdef _WIN32')
++ print('# include <malloc.h> // alloca')
++ print('# ifndef alloca')
++ print('# define alloca _alloca')
++ print('# endif')
++ print('#else')
++ print('# include <alloca.h> // alloca')
++ print('#endif')
++ print()
++ print()
++ print('static std::map<void *, void *> g_WrappedObjects;')
+
+ def footer(self, api):
+ pass
+@@ -523,11 +526,11 @@ class Tracer:
+
+ if not function.internal:
+ if function.args:
+- print 'static const char * _%s_args[%u] = {%s};' % (function.name, len(function.args), ', '.join(['"%s"' % arg.name for arg in function.args]))
++ print('static const char * _%s_args[%u] = {%s};' % (function.name, len(function.args), ', '.join(['"%s"' % arg.name for arg in function.args])))
+ else:
+- print 'static const char ** _%s_args = NULL;' % (function.name,)
+- print 'static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, self.getFunctionSigId(), function.name, len(function.args), function.name)
+- print
++ print('static const char ** _%s_args = NULL;' % (function.name,))
++ print('static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, self.getFunctionSigId(), function.sigName(), len(function.args), function.name))
++ print()
+
+ def getFunctionSigId(self):
+ id = Tracer.__id
+@@ -539,12 +542,12 @@ class Tracer:
+
+ def traceFunctionImpl(self, function):
+ if self.isFunctionPublic(function):
+- print 'extern "C" PUBLIC'
++ print('extern "C" PUBLIC')
+ else:
+- print 'extern "C" PRIVATE'
+- print function.prototype() + ' {'
++ print('extern "C" PRIVATE')
++ print(function.prototype() + ' {')
+ if function.type is not stdapi.Void:
+- print ' %s _result;' % function.type
++ print(' %s _result;' % function.type)
+
+ for arg in function.args:
+ if not arg.output:
+@@ -555,43 +558,43 @@ class Tracer:
+ # XXX: wrapping should go here, but before we can do that we'll need to protect g_WrappedObjects with its own mutex
+
+ if function.type is not stdapi.Void:
+- print ' return _result;'
++ print(' return _result;')
+
+- print '}'
+- print
++ print('}')
++ print()
+
+ def traceFunctionImplBody(self, function):
+ multi_draw_function_regex = re.compile(r'^glMultiDraw(Arrays|Elements)([A-Z][a-zA-Z]*)?$' )
+ if not function.internal:
+- print ' unsigned _call = trace::localWriter.beginEnter(&_%s_sig);' % (function.name,)
++ print(' unsigned _call = trace::localWriter.beginEnter(&_%s_sig);' % (function.name,))
+ for arg in function.args:
+ if not arg.output:
+ self.serializeArg(function, arg)
+- print ' trace::localWriter.endEnter();'
++ print(' trace::localWriter.endEnter();')
+
+ if self.multi_draw_function_regex.match(function.name):
+- print ' trace::localWriter.beginIgnore();'
+- print ' trace::localWriter.endIgnore();'
++ print(' trace::localWriter.beginIgnore();')
++ print(' trace::localWriter.endEnter();')
+
+ self.invokeFunction(function)
+
+ if self.multi_draw_function_regex.match(function.name):
+- print ' trace::localWriter.beginTrace();'
+- print ' trace::localWriter.endTrace();'
++ print(' trace::localWriter.beginTrace();')
++ print(' trace::localWriter.endTrace();')
+
+ if not function.internal:
+- print ' trace::localWriter.beginLeave(_call);'
+- print ' if (%s) {' % self.wasFunctionSuccessful(function)
++ print(' trace::localWriter.beginLeave(_call);')
++ print(' if (%s) {' % self.wasFunctionSuccessful(function))
+ for arg in function.args:
+ if arg.output:
+ self.serializeArg(function, arg)
+ self.wrapArg(function, arg)
+- print ' }'
++ print(' }')
+ if function.type is not stdapi.Void:
+ self.serializeRet(function, "_result")
+ if function.type is not stdapi.Void:
+ self.wrapRet(function, "_result")
+- print ' trace::localWriter.endLeave();'
++ print(' trace::localWriter.endLeave();')
+
+ def invokeFunction(self, function):
+ self.doInvokeFunction(function)
+@@ -603,7 +606,7 @@ class Tracer:
+ else:
+ result = '_result = '
+ dispatch = prefix + function.name + suffix
+- print ' %s%s(%s);' % (result, dispatch, ', '.join([str(arg.name) for arg in function.args]))
++ print(' %s%s(%s);' % (result, dispatch, ', '.join([str(arg.name) for arg in function.args])))
+
+ def wasFunctionSuccessful(self, function):
+ if function.type is stdapi.Void:
+@@ -613,9 +616,9 @@ class Tracer:
+ return 'true'
+
+ def serializeArg(self, function, arg):
+- print ' trace::localWriter.beginArg(%u);' % (arg.index,)
++ print(' trace::localWriter.beginArg(%u);' % (arg.index,))
+ self.serializeArgValue(function, arg)
+- print ' trace::localWriter.endArg();'
++ print(' trace::localWriter.endArg();')
+
+ def serializeArgValue(self, function, arg):
+ self.serializeValue(arg.type, arg.name)
+@@ -641,9 +644,9 @@ class Tracer:
+ self.unwrapValue(arg.type, arg.name)
+
+ def serializeRet(self, function, instance):
+- print ' trace::localWriter.beginReturn();'
++ print(' trace::localWriter.beginReturn();')
+ self.serializeValue(function.type, instance)
+- print ' trace::localWriter.endReturn();'
++ print(' trace::localWriter.endReturn();')
+
+ def serializeValue(self, type, instance):
+ serializer = self.serializerFactory()
+@@ -672,70 +675,72 @@ class Tracer:
+ if not interfaces:
+ return
+
+- print r'#include "guids.hpp"'
+- print
++ print(r'#include "guids.hpp"')
++ print()
+
+ map(self.declareWrapperInterface, interfaces)
+
+ # Helper functions to wrap/unwrap interface pointers
+- print r'static inline bool'
+- print r'hasChildInterface(REFIID riid, IUnknown *pUnknown) {'
+- print r' IUnknown *pObj = NULL;'
+- print r' HRESULT hr = pUnknown->QueryInterface(riid, (VOID **)&pObj);'
+- print r' if (FAILED(hr)) {'
+- print r' return false;'
+- print r' }'
+- print r' assert(pObj);'
+- print r' pObj->Release();'
+- print r' return pUnknown == pObj;'
+- print r'}'
+- print
+- print r'static inline const void *'
+- print r'getVtbl(const void *pvObj) {'
+- print r' return pvObj ? *(const void **)pvObj : NULL;'
+- print r'}'
+- print
++ print(r'static inline bool')
++ print(r'hasChildInterface(REFIID riid, IUnknown *pUnknown) {')
++ print(r' IUnknown *pObj = NULL;')
++ print(r' HRESULT hr = pUnknown->QueryInterface(riid, (VOID **)&pObj);')
++ print(r' if (FAILED(hr)) {')
++ print(r' return false;')
++ print(r' }')
++ print(r' assert(pObj);')
++ print(r' pObj->Release();')
++ print(r' return pUnknown == pObj;')
++ print(r'}')
++ print()
++ print(r'static inline const void *')
++ print(r'getVtbl(const void *pvObj) {')
++ print(r' return pvObj ? *(const void **)pvObj : NULL;')
++ print(r'}')
++ print()
+
+ self.implementIidWrapper(api)
+
+- map(self.implementWrapperInterface, interfaces)
+- print
++ for iface in interfaces:
++ self.implementWrapperInterface(iface)
++
++ print()
+
+ def declareWrapperInterface(self, interface):
+ wrapperInterfaceName = getWrapperInterfaceName(interface)
+- print "class %s : public %s " % (wrapperInterfaceName, interface.name)
+- print "{"
+- print "private:"
+- print " %s(%s * pInstance);" % (wrapperInterfaceName, interface.name)
+- print " virtual ~%s();" % wrapperInterfaceName
+- print "public:"
+- print " static %s* _create(const char *entryName, %s * pInstance);" % (wrapperInterfaceName, interface.name)
+- print " static void _wrap(const char *entryName, %s ** ppInstance);" % (interface.name,)
+- print " static void _unwrap(const char *entryName, %s ** pInstance);" % (interface.name,)
+- print
++ print("class %s : public %s " % (wrapperInterfaceName, interface.name))
++ print("{")
++ print("private:")
++ print(" %s(%s * pInstance);" % (wrapperInterfaceName, interface.name))
++ print(" virtual ~%s();" % wrapperInterfaceName)
++ print("public:")
++ print(" static %s* _create(const char *entryName, %s * pInstance);" % (wrapperInterfaceName, interface.name))
++ print(" static void _wrap(const char *entryName, %s ** ppInstance);" % (interface.name,))
++ print(" static void _unwrap(const char *entryName, %s ** pInstance);" % (interface.name,))
++ print()
+
+ methods = list(interface.iterMethods())
+ for method in methods:
+- print " " + method.prototype() + ";"
++ print(" " + method.prototype() + ";")
+ print
+
+ for type, name, value in self.enumWrapperInterfaceVariables(interface):
+- print ' %s %s;' % (type, name)
+- print
+-
+- print r'private:'
+- print r' void _dummy(unsigned i) const {'
+- print r' os::log("error: %%s: unexpected virtual method %%i of instance pWrapper=%%p pvObj=%%p pVtbl=%%p\n", "%s", i, this, m_pInstance, m_pVtbl);' % interface.name
+- print r' trace::localWriter.flush();'
+- print r' os::abort();'
+- print r' }'
+- print
++ print(' %s %s;' % (type, name))
++ print()
++
++ print(r'private:')
++ print(r' void _dummy(unsigned i) const {')
++ print(r' os::log("error: %%s: unexpected virtual method %%i of instance pWrapper=%%p pvObj=%%p pVtbl=%%p\n", "%s", i, this, m_pInstance, m_pVtbl);' % interface.name)
++ print(r' trace::localWriter.flush();')
++ print(r' os::abort();')
++ print(r' }')
++ print()
+ for i in range(len(methods), 64):
+- print r' virtual void _dummy%i(void) const { _dummy(%i); }' % (i, i)
+- print
++ print(r' virtual void _dummy%i(void) const { _dummy(%i); }' % (i, i))
++ print()
+
+- print "};"
+- print
++ print("};")
++ print()
+
+ def enumWrapperInterfaceVariables(self, interface):
+ return [
+@@ -751,101 +756,101 @@ class Tracer:
+ wrapperInterfaceName = getWrapperInterfaceName(iface)
+
+ # Private constructor
+- print '%s::%s(%s * pInstance) {' % (wrapperInterfaceName, wrapperInterfaceName, iface.name)
++ print('%s::%s(%s * pInstance) {' % (wrapperInterfaceName, wrapperInterfaceName, iface.name))
+ for type, name, value in self.enumWrapperInterfaceVariables(iface):
+ if value is not None:
+- print ' %s = %s;' % (name, value)
+- print '}'
+- print
++ print(' %s = %s;' % (name, value))
++ print('}')
++ print()
+
+ # Public constructor
+- print '%s *%s::_create(const char *entryName, %s * pInstance) {' % (wrapperInterfaceName, wrapperInterfaceName, iface.name)
+- print r' Wrap%s *pWrapper = new Wrap%s(pInstance);' % (iface.name, iface.name)
++ print('%s *%s::_create(const char *entryName, %s * pInstance) {' % (wrapperInterfaceName, wrapperInterfaceName, iface.name))
++ print(r' Wrap%s *pWrapper = new Wrap%s(pInstance);' % (iface.name, iface.name))
+ if debug:
+- print r' os::log("%%s: created %s pvObj=%%p pWrapper=%%p pVtbl=%%p\n", entryName, pInstance, pWrapper, pWrapper->m_pVtbl);' % iface.name
+- print r' g_WrappedObjects[pInstance] = pWrapper;'
+- print r' return pWrapper;'
+- print '}'
+- print
++ print(r' os::log("%%s: created %s pvObj=%%p pWrapper=%%p pVtbl=%%p\n", entryName, pInstance, pWrapper, pWrapper->m_pVtbl);' % iface.name)
++ print(r' g_WrappedObjects[pInstance] = pWrapper;')
++ print(r' return pWrapper;')
++ print('}')
++ print()
+
+ # Destructor
+- print '%s::~%s() {' % (wrapperInterfaceName, wrapperInterfaceName)
++ print('%s::~%s() {' % (wrapperInterfaceName, wrapperInterfaceName))
+ if debug:
+- print r' os::log("%s::Release: deleted pvObj=%%p pWrapper=%%p pVtbl=%%p\n", m_pInstance, this, m_pVtbl);' % iface.name
+- print r' g_WrappedObjects.erase(m_pInstance);'
+- print '}'
+- print
++ print(r' os::log("%s::Release: deleted pvObj=%%p pWrapper=%%p pVtbl=%%p\n", m_pInstance, this, m_pVtbl);' % iface.name)
++ print(r' g_WrappedObjects.erase(m_pInstance);')
++ print('}')
++ print()
+
+ baseMethods = list(iface.iterBaseMethods())
+ for base, method in baseMethods:
+ self.base = base
+ self.implementWrapperInterfaceMethod(iface, base, method)
+
+- print
++ print()
+
+ # Wrap pointer
+ ifaces = self.api.getAllInterfaces()
+- print r'void'
+- print r'%s::_wrap(const char *entryName, %s **ppObj) {' % (wrapperInterfaceName, iface.name)
+- print r' if (!ppObj) {'
+- print r' return;'
+- print r' }'
+- print r' %s *pObj = *ppObj;' % (iface.name,)
+- print r' if (!pObj) {'
+- print r' return;'
+- print r' }'
+- print r' assert(hasChildInterface(IID_%s, pObj));' % iface.name
+- print r' std::map<void *, void *>::const_iterator it = g_WrappedObjects.find(pObj);'
+- print r' if (it != g_WrappedObjects.end()) {'
+- print r' Wrap%s *pWrapper = (Wrap%s *)it->second;' % (iface.name, iface.name)
+- print r' assert(pWrapper);'
+- print r' assert(pWrapper->m_dwMagic == 0xd8365d6c);'
+- print r' assert(pWrapper->m_pInstance == pObj);'
+- print r' if (pWrapper->m_pVtbl == getVtbl(pObj) &&'
+- print r' pWrapper->m_NumMethods >= %s) {' % len(baseMethods)
++ print(r'void')
++ print(r'%s::_wrap(const char *entryName, %s **ppObj) {' % (wrapperInterfaceName, iface.name))
++ print(r' if (!ppObj) {')
++ print(r' return;')
++ print(r' }')
++ print(r' %s *pObj = *ppObj;' % (iface.name,))
++ print(r' if (!pObj) {')
++ print(r' return;')
++ print(r' }')
++ print(r' assert(hasChildInterface(IID_%s, pObj));' % iface.name)
++ print(r' std::map<void *, void *>::const_iterator it = g_WrappedObjects.find(pObj);')
++ print(r' if (it != g_WrappedObjects.end()) {')
++ print(r' Wrap%s *pWrapper = (Wrap%s *)it->second;' % (iface.name, iface.name))
++ print(r' assert(pWrapper);')
++ print(r' assert(pWrapper->m_dwMagic == 0xd8365d6c);')
++ print(r' assert(pWrapper->m_pInstance == pObj);')
++ print(r' if (pWrapper->m_pVtbl == getVtbl(pObj) &&')
++ print(r' pWrapper->m_NumMethods >= %s) {' % len(baseMethods))
+ if debug:
+- print r' os::log("%s: fetched pvObj=%p pWrapper=%p pVtbl=%p\n", entryName, pObj, pWrapper, pWrapper->m_pVtbl);'
+- print r' *ppObj = pWrapper;'
+- print r' return;'
+- print r' }'
+- print r' }'
++ print(r' os::log("%s: fetched pvObj=%p pWrapper=%p pVtbl=%p\n", entryName, pObj, pWrapper, pWrapper->m_pVtbl);')
++ print(r' *ppObj = pWrapper;')
++ print(r' return;')
++ print(r' }')
++ print(r' }')
+ for childIface in getInterfaceHierarchy(ifaces, iface):
+- print r' if (hasChildInterface(IID_%s, pObj)) {' % (childIface.name,)
+- print r' *ppObj = Wrap%s::_create(entryName, static_cast<%s *>(pObj));' % (childIface.name, childIface.name)
+- print r' return;'
+- print r' }'
+- print r' *ppObj = Wrap%s::_create(entryName, pObj);' % iface.name
+- print r'}'
+- print
++ print(r' if (hasChildInterface(IID_%s, pObj)) {' % (childIface.name,))
++ print(r' *ppObj = Wrap%s::_create(entryName, static_cast<%s *>(pObj));' % (childIface.name, childIface.name))
++ print(r' return;')
++ print(r' }')
++ print(r' *ppObj = Wrap%s::_create(entryName, pObj);' % iface.name)
++ print(r'}')
++ print()
+
+ # Unwrap pointer
+- print r'void'
+- print r'%s::_unwrap(const char *entryName, %s **ppObj) {' % (wrapperInterfaceName, iface.name)
+- print r' if (!ppObj || !*ppObj) {'
+- print r' return;'
+- print r' }'
+- print r' const %s *pWrapper = static_cast<const %s*>(*ppObj);' % (wrapperInterfaceName, getWrapperInterfaceName(iface))
+- print r' if (pWrapper && pWrapper->m_dwMagic == 0xd8365d6c) {'
+- print r' *ppObj = pWrapper->m_pInstance;'
+- print r' } else {'
+- print r' os::log("apitrace: warning: %%s: unexpected %%s pointer %%p\n", entryName, "%s", *ppObj);' % iface.name
+- print r' trace::localWriter.flush();'
+- print r' }'
+- print r'}'
+- print
++ print(r'void')
++ print(r'%s::_unwrap(const char *entryName, %s **ppObj) {' % (wrapperInterfaceName, iface.name))
++ print(r' if (!ppObj || !*ppObj) {')
++ print(r' return;')
++ print(r' }')
++ print(r' const %s *pWrapper = static_cast<const %s*>(*ppObj);' % (wrapperInterfaceName, getWrapperInterfaceName(iface)))
++ print(r' if (pWrapper && pWrapper->m_dwMagic == 0xd8365d6c) {')
++ print(r' *ppObj = pWrapper->m_pInstance;')
++ print(r' } else {')
++ print(r' os::log("apitrace: warning: %%s: unexpected %%s pointer %%p\n", entryName, "%s", *ppObj);' % iface.name)
++ print(r' trace::localWriter.flush();')
++ print(r' }')
++ print(r'}')
++ print()
+
+ def implementWrapperInterfaceMethod(self, interface, base, method):
+ wrapperInterfaceName = getWrapperInterfaceName(interface)
+
+- print method.prototype(wrapperInterfaceName + '::' + method.name) + ' {'
++ print(method.prototype(wrapperInterfaceName + '::' + method.name) + ' {')
+
+ if False:
+- print r' os::log("%%s(%%p -> %%p)\n", "%s", this, m_pInstance);' % (wrapperInterfaceName + '::' + method.name)
++ print(r' os::log("%%s(%%p -> %%p)\n", "%s", this, m_pInstance);' % (wrapperInterfaceName + '::' + method.name))
+
+ if method.type is not stdapi.Void:
+- print ' %s _result;' % method.type
++ print(' %s _result;' % method.type)
+
+- print ' %s *_this = static_cast<%s *>(m_pInstance);' % (base, base)
++ print(' %s *_this = static_cast<%s *>(m_pInstance);' % (base, base))
+ for arg in method.args:
+ if not arg.output:
+ self.unwrapArg(method, arg)
+@@ -855,36 +860,36 @@ class Tracer:
+ # XXX: wrapping should go here, but before we can do that we'll need to protect g_WrappedObjects with its own mutex
+
+ if method.type is not stdapi.Void:
+- print ' return _result;'
++ print(' return _result;')
+
+- print '}'
+- print
++ print('}')
++ print()
+
+ def implementWrapperInterfaceMethodBody(self, interface, base, method):
+ assert not method.internal
+
+- print ' static const char * _args[%u] = {%s};' % (len(method.args) + 1, ', '.join(['"this"'] + ['"%s"' % arg.name for arg in method.args]))
+- print ' static const trace::FunctionSig _sig = {%u, "%s", %u, _args};' % (self.getFunctionSigId(), interface.name + '::' + method.name, len(method.args) + 1)
++ print(' static const char * _args[%u] = {%s};' % (len(method.args) + 1, ', '.join(['"this"'] + ['"%s"' % arg.name for arg in method.args])))
++ print(' static const trace::FunctionSig _sig = {%u, "%s", %u, _args};' % (self.getFunctionSigId(), interface.name + '::' + method.name, len(method.args) + 1))
+
+- print ' unsigned _call = trace::localWriter.beginEnter(&_sig);'
+- print ' trace::localWriter.beginArg(0);'
+- print ' trace::localWriter.writePointer((uintptr_t)m_pInstance);'
+- print ' trace::localWriter.endArg();'
++ print(' unsigned _call = trace::localWriter.beginEnter(&_sig);')
++ print(' trace::localWriter.beginArg(0);')
++ print(' trace::localWriter.writePointer((uintptr_t)m_pInstance);')
++ print(' trace::localWriter.endArg();')
+ for arg in method.args:
+ if not arg.output:
+ self.serializeArg(method, arg)
+- print ' trace::localWriter.endEnter();'
++ print(' trace::localWriter.endEnter();')
+
+ self.invokeMethod(interface, base, method)
+
+- print ' trace::localWriter.beginLeave(_call);'
++ print(' trace::localWriter.beginLeave(_call);')
+
+- print ' if (%s) {' % self.wasFunctionSuccessful(method)
++ print(' if (%s) {' % self.wasFunctionSuccessful(method))
+ for arg in method.args:
+ if arg.output:
+ self.serializeArg(method, arg)
+ self.wrapArg(method, arg)
+- print ' }'
++ print(' }')
+
+ if method.type is not stdapi.Void:
+ self.serializeRet(method, '_result')
+@@ -893,51 +898,51 @@ class Tracer:
+
+ if method.name == 'Release':
+ assert method.type is not stdapi.Void
+- print r' if (!_result) {'
+- print r' delete this;'
+- print r' }'
++ print(r' if (!_result) {')
++ print(r' delete this;')
++ print(r' }')
+
+- print ' trace::localWriter.endLeave();'
++ print(' trace::localWriter.endLeave();')
+
+ def implementIidWrapper(self, api):
+ ifaces = api.getAllInterfaces()
+
+- print r'static void'
+- print r'warnIID(const char *entryName, REFIID riid, void *pvObj, const char *reason) {'
+- print r' os::log("apitrace: warning: %s: %s IID %s\n",'
+- print r' entryName, reason,'
+- print r' getGuidName(riid));'
+- print r' void * pVtbl = *(void **)pvObj;'
+- print r' HMODULE hModule = 0;'
+- print r' BOOL bRet = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |'
+- print r' GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,'
+- print r' (LPCTSTR)pVtbl,'
+- print r' &hModule);'
+- print r' assert(bRet);'
+- print r' if (bRet) {'
+- print r' char szModule[MAX_PATH];'
+- print r' DWORD dwRet = GetModuleFileNameA(hModule, szModule, sizeof szModule);'
+- print r' assert(dwRet);'
+- print r' if (dwRet) {'
+- print r' DWORD dwOffset = (UINT_PTR)pVtbl - (UINT_PTR)hModule;'
+- print r' os::log("apitrace: warning: pVtbl = %p (%s!+0x%0lx)\n", pVtbl, szModule, dwOffset);'
+- print r' }'
+- print r' }'
+- print r'}'
+- print
+- print r'static void'
+- print r'wrapIID(const char *entryName, REFIID riid, void * * ppvObj) {'
+- print r' if (!ppvObj || !*ppvObj) {'
+- print r' return;'
+- print r' }'
++ print(r'static void')
++ print(r'warnIID(const char *entryName, REFIID riid, void *pvObj, const char *reason) {')
++ print(r' os::log("apitrace: warning: %s: %s IID %s\n",')
++ print(r' entryName, reason,')
++ print(r' getGuidName(riid));')
++ print(r' void * pVtbl = *(void **)pvObj;')
++ print(r' HMODULE hModule = 0;')
++ print(r' BOOL bRet = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |')
++ print(r' GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,')
++ print(r' (LPCTSTR)pVtbl,')
++ print(r' &hModule);')
++ print(r' assert(bRet);')
++ print(r' if (bRet) {')
++ print(r' char szModule[MAX_PATH];')
++ print(r' DWORD dwRet = GetModuleFileNameA(hModule, szModule, sizeof szModule);')
++ print(r' assert(dwRet);')
++ print(r' if (dwRet) {')
++ print(r' DWORD dwOffset = (UINT_PTR)pVtbl - (UINT_PTR)hModule;')
++ print(r' os::log("apitrace: warning: pVtbl = %p (%s!+0x%0lx)\n", pVtbl, szModule, dwOffset);')
++ print(r' }')
++ print(r' }')
++ print(r'}')
++ print()
++ print(r'static void')
++ print(r'wrapIID(const char *entryName, REFIID riid, void * * ppvObj) {')
++ print(r' if (!ppvObj || !*ppvObj) {')
++ print(r' return;')
++ print(r' }')
+ for iface in ifaces:
+- print r' if (riid == IID_%s) {' % (iface.name,)
+- print r' Wrap%s::_wrap(entryName, (%s **) ppvObj);' % (iface.name, iface.name)
+- print r' return;'
+- print r' }'
+- print r' warnIID(entryName, riid, *ppvObj, "unsupported");'
+- print r'}'
+- print
++ print(r' if (riid == IID_%s) {' % (iface.name,))
++ print(r' Wrap%s::_wrap(entryName, (%s **) ppvObj);' % (iface.name, iface.name))
++ print(r' return;')
++ print(r' }')
++ print(r' warnIID(entryName, riid, *ppvObj, "unsupported");')
++ print(r'}')
++ print()
+
+ def wrapIid(self, function, riid, out):
+ # Cast output arg to `void **` if necessary
+@@ -947,42 +952,42 @@ class Tracer:
+ assert isinstance(obj_type, stdapi.Interface)
+ out_name = 'reinterpret_cast<void * *>(%s)' % out_name
+
+- print r' if (%s && *%s) {' % (out.name, out.name)
++ print(r' if (%s && *%s) {' % (out.name, out.name))
+ functionName = function.name
+ else_ = ''
+ if self.interface is not None:
+ functionName = self.interface.name + '::' + functionName
+- print r' if (*%s == m_pInstance &&' % (out_name,)
+- print r' (%s)) {' % ' || '.join('%s == IID_%s' % (riid.name, iface.name) for iface in self.interface.iterBases())
+- print r' *%s = this;' % (out_name,)
+- print r' }'
++ print(r' if (*%s == m_pInstance &&' % (out_name,))
++ print(r' (%s)) {' % ' || '.join('%s == IID_%s' % (riid.name, iface.name) for iface in self.interface.iterBases()))
++ print(r' *%s = this;' % (out_name,))
++ print(r' }')
+ else_ = 'else '
+- print r' %s{' % else_
+- print r' wrapIID("%s", %s, %s);' % (functionName, riid.name, out_name)
+- print r' }'
+- print r' }'
++ print(r' %s{' % else_)
++ print(r' wrapIID("%s", %s, %s);' % (functionName, riid.name, out_name))
++ print(r' }')
++ print(r' }')
+
+ def invokeMethod(self, interface, base, method):
+ if method.type is stdapi.Void:
+ result = ''
+ else:
+ result = '_result = '
+- print ' %s_this->%s(%s);' % (result, method.name, ', '.join([str(arg.name) for arg in method.args]))
++ print(' %s_this->%s(%s);' % (result, method.name, ', '.join([str(arg.name) for arg in method.args])))
+
+ def emit_memcpy(self, ptr, size):
+- print ' trace::fakeMemcpy(%s, %s);' % (ptr, size)
++ print(' trace::fakeMemcpy(%s, %s);' % (ptr, size))
+
+ def emit_memcpy_opt(self, ptr, size):
+- print ' trace::fakeMemcpyOpt(%s, %s);' % (ptr, size)
++ print(' trace::fakeMemcpyOpt(%s, %s);' % (ptr, size))
+
+ def fake_call(self, function, args):
+- print ' unsigned _fake_call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,)
++ print(' unsigned _fake_call = trace::localWriter.beginEnter(&_%s_sig, true);' % (function.name,))
+ for arg, instance in zip(function.args, args):
+ assert not arg.output
+- print ' trace::localWriter.beginArg(%u);' % (arg.index,)
++ print(' trace::localWriter.beginArg(%u);' % (arg.index,))
+ self.serializeValue(arg.type, instance)
+- print ' trace::localWriter.endArg();'
+- print ' trace::localWriter.endEnter();'
+- print ' trace::localWriter.beginLeave(_fake_call);'
+- print ' trace::localWriter.endLeave();'
++ print(' trace::localWriter.endArg();')
++ print(' trace::localWriter.endEnter();')
++ print(' trace::localWriter.beginLeave(_fake_call);')
++ print(' trace::localWriter.endLeave();')
+
+diff --git a/wrappers/wgltrace.py b/wrappers/wgltrace.py
+index bc79d774..be86c36e 100644
+--- a/wrappers/wgltrace.py
++++ b/wrappers/wgltrace.py
+@@ -66,63 +66,65 @@ class WglTracer(GlTracer):
+ # wglCreateContext/wglCreateLayerContext to obtain a HGLRC that's
+ # recognizable by OPENGL32.DLL. Therefore we need to detect and
+ # dispatch internal calls, without further ado.
+- print r' if (_reentrant) {'
++ print(r' if (_reentrant) {')
+ self.invokeFunction(function)
+ if function.type is not Void:
+- print ' return _result;'
+- print r' }'
+- print r' ReentryScope _reentry;'
+- print r' (void)_reentry;'
+- print
++ print(' return _result;')
++ print(r' }')
++ print(r' ReentryScope _reentry;')
++ print(r' (void)_reentry;')
++ print()
+
+ if function.name in self.destroyContextFunctionNames:
+ # Unlike other GL APIs like EGL or GLX, WGL will make the context
+ # inactive if it's currently the active context.
+- print ' if (_wglGetCurrentContext() == hglrc) {'
+- print ' gltrace::clearContext();'
+- print ' }'
+- print ' gltrace::releaseContext((uintptr_t)hglrc);'
++ print(' if (_wglGetCurrentContext() == hglrc) {')
++ print(' gltrace::clearContext();')
++ print(' }')
++ print(' gltrace::releaseContext((uintptr_t)hglrc);')
+
+ GlTracer.traceFunctionImplBody(self, function)
+
+ if function.name in self.createContextFunctionNames:
+- print ' if (_result)'
+- print ' gltrace::createContext((uintptr_t)_result);'
++ print(' if (_result)')
++ print(' gltrace::createContext((uintptr_t)_result);')
+
+ if function.name in self.makeCurrentFunctionNames:
+- print ' if (_result) {'
+- print ' if (hglrc != NULL)'
+- print ' gltrace::setContext((uintptr_t)hglrc);'
+- print ' else'
+- print ' gltrace::clearContext();'
+- print ' }'
++ print(' if (_result) {')
++ print(' if (hglrc != NULL)')
++ print(' gltrace::setContext((uintptr_t)hglrc);')
++ print(' else')
++ print(' gltrace::clearContext();')
++ print(' }')
+
+
+ if __name__ == '__main__':
+- print
+- print '#define _GDI32_'
+- print
+- print '#include <string.h>'
+- print '#include <windows.h>'
+- print
+- print '#include "trace_writer_local.hpp"'
+- print '#include "os.hpp"'
+- print
+- print '// To validate our prototypes'
+- print '#define GL_GLEXT_PROTOTYPES'
+- print '#define WGL_GLXEXT_PROTOTYPES'
+- print
+- print '#include "glproc.hpp"'
+- print '#include "glsize.hpp"'
+- print
+- print 'static OS_THREAD_SPECIFIC(uintptr_t) _reentrant;'
+- print
+- print '// Helper class to track reentries in function scope.'
+- print 'struct ReentryScope {'
+- print 'inline ReentryScope() { _reentrant = 1; }'
+- print 'inline ~ReentryScope() { _reentrant = 0; }'
+- print '};'
+- print
++ print()
++ print('#define _GDI32_')
++ print()
++ print('#include <string.h>')
++ print('#include <windows.h>')
++ print()
++ print('#include <sstream>')
++ print()
++ print('#include "trace_writer_local.hpp"')
++ print('#include "os.hpp"')
++ print()
++ print('// To validate our prototypes')
++ print('#define GL_GLEXT_PROTOTYPES')
++ print('#define WGL_GLXEXT_PROTOTYPES')
++ print()
++ print('#include "glproc.hpp"')
++ print('#include "glsize.hpp"')
++ print()
++ print('static OS_THREAD_LOCAL uintptr_t _reentrant;')
++ print()
++ print('// Helper class to track reentries in function scope.')
++ print('struct ReentryScope {')
++ print('inline ReentryScope() { _reentrant = 1; }')
++ print('inline ~ReentryScope() { _reentrant = 0; }')
++ print('};')
++ print()
+ module = Module()
+ module.mergeModule(glapi)
+ module.mergeModule(wglapi)
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0002-specs-Tie-Python-2-3-conversion-loose-ends.patch b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0002-specs-Tie-Python-2-3-conversion-loose-ends.patch
new file mode 100644
index 00000000..25141602
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0002-specs-Tie-Python-2-3-conversion-loose-ends.patch
@@ -0,0 +1,169 @@
+From a8791e3dca61500a382be84dc96973639b8bd182 Mon Sep 17 00:00:00 2001
+From: Jose Fonseca <jfonseca@vmware.com>
+Date: Sun, 28 Apr 2019 14:13:01 +0100
+Subject: [PATCH 2/4] specs: Tie Python 2 ->3 conversion loose ends.
+
+Upstream-Status: Backport [https://github.com/apitrace/apitrace/commit/5b3c68cafaddc82c0f34bea8127582eee07ac3be]
+
+(cherry picked from commit 5b3c68cafaddc82c0f34bea8127582eee07ac3be)
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ specs/scripts/Makefile | 16 ++++++++--------
+ specs/scripts/c2api.py | 6 +++---
+ specs/scripts/cxx2api.py | 2 +-
+ specs/scripts/spec2api.py | 2 +-
+ specs/scripts/txt2api.py | 8 +++++---
+ specs/scripts/xml2api.py | 2 +-
+ specs/scripts/xml2enum.py | 2 +-
+ specs/scripts/xml2glparams.py | 2 +-
+ 8 files changed, 21 insertions(+), 19 deletions(-)
+
+diff --git a/specs/scripts/Makefile b/specs/scripts/Makefile
+index 714a3deb..f03f36eb 100644
+--- a/specs/scripts/Makefile
++++ b/specs/scripts/Makefile
+@@ -37,28 +37,28 @@ download: \
+ wget -N https://www.opengl.org/registry/oldspecs/$@
+
+ glapi.py: xml2api.py gl.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ glxapi.py: xml2api.py glx.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ wglapi.py: xml2api.py wgl.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ eglapi.py: xml2api.py egl.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ glparams.py: xml2glparams.py gl.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ glxenum.py: xml2enum.py glx.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ wglenum.py: xml2enum.py wgl.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ eglenum.py: xml2enum.py egl.xml
+- python $^ > $@
++ python3 $^ > $@
+
+ clean:
+ rm -f \
+diff --git a/specs/scripts/c2api.py b/specs/scripts/c2api.py
+index b8aaa81d..208169d2 100755
+--- a/specs/scripts/c2api.py
++++ b/specs/scripts/c2api.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+@@ -404,8 +404,8 @@ class DeclParser:
+ type = 'S' + type
+ elif short:
+ type = 'Short'
+- elif int:
+- type = 'Long' * int
++ elif long:
++ type = 'Long' * long
+ else:
+ type = 'Int'
+ if unsigned:
+diff --git a/specs/scripts/cxx2api.py b/specs/scripts/cxx2api.py
+index 9720615d..8056de47 100755
+--- a/specs/scripts/cxx2api.py
++++ b/specs/scripts/cxx2api.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+
+
+diff --git a/specs/scripts/spec2api.py b/specs/scripts/spec2api.py
+index 7fb395a4..33a8d058 100755
+--- a/specs/scripts/spec2api.py
++++ b/specs/scripts/spec2api.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2010 VMware, Inc.
+diff --git a/specs/scripts/txt2api.py b/specs/scripts/txt2api.py
+index e9469d3c..a32ca658 100755
+--- a/specs/scripts/txt2api.py
++++ b/specs/scripts/txt2api.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2010 VMware, Inc.
+@@ -28,6 +28,7 @@
+ """Parser for OpenGL .txt extensions specification."""
+
+
++import io
+ import sys
+ import re
+ import optparse
+@@ -233,12 +234,13 @@ def main():
+
+ for arg in args:
+ if arg.startswith('http://') or arg.startswith('https://'):
+- stream = urlopen(arg, 'rt')
++ stream = urlopen(arg)
++ stream = io.TextIOWrapper(stream, encoding='ascii')
+ else:
+ stream = open(arg, 'rt')
+ parser = TxtParser(stream, prefix = options.prefix)
+ parser.parse()
+-
++
+
+ if __name__ == '__main__':
+ main()
+diff --git a/specs/scripts/xml2api.py b/specs/scripts/xml2api.py
+index f09fe0bf..6b4ec3b7 100755
+--- a/specs/scripts/xml2api.py
++++ b/specs/scripts/xml2api.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2014 VMware, Inc
+diff --git a/specs/scripts/xml2enum.py b/specs/scripts/xml2enum.py
+index cb2c4ae9..f799b7b5 100755
+--- a/specs/scripts/xml2enum.py
++++ b/specs/scripts/xml2enum.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2014 VMware, Inc
+diff --git a/specs/scripts/xml2glparams.py b/specs/scripts/xml2glparams.py
+index 805aac86..a651d896 100755
+--- a/specs/scripts/xml2glparams.py
++++ b/specs/scripts/xml2glparams.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2014 VMware, Inc
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch
new file mode 100644
index 00000000..e30273d5
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch
@@ -0,0 +1,276 @@
+From 8ba82a1ef77e60bd614cca1e583e1a0c25b4f281 Mon Sep 17 00:00:00 2001
+From: Jose Fonseca <jfonseca@vmware.com>
+Date: Sun, 28 Apr 2019 14:14:44 +0100
+Subject: [PATCH 3/4] scripts: Tie Python 2 -> 3 conversion loose ends.
+
+Upstream-Status: Backport [https://github.com/apitrace/apitrace/commit/247e1fa87f4e87b8914662e44a8ecef4d444cc90]
+
+(cherry picked from commit 247e1fa87f4e87b8914662e44a8ecef4d444cc90)
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ retrace/glstate_params.py | 2 +-
+ scripts/convert.py | 2 +-
+ scripts/highlight.py | 3 ++-
+ scripts/jsondiff.py | 2 +-
+ scripts/jsonextractimages.py | 2 +-
+ scripts/leaks.py | 4 ++--
+ scripts/profileshader.py | 2 +-
+ scripts/retracediff.py | 2 +-
+ scripts/snapdiff.py | 2 +-
+ scripts/tracecheck.py | 2 +-
+ scripts/tracediff.py | 10 +++++-----
+ scripts/unpickle.py | 19 ++++++++++---------
+ 12 files changed, 27 insertions(+), 25 deletions(-)
+
+diff --git a/retrace/glstate_params.py b/retrace/glstate_params.py
+index bc90f66b..55f2dbc9 100755
+--- a/retrace/glstate_params.py
++++ b/retrace/glstate_params.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+diff --git a/scripts/convert.py b/scripts/convert.py
+index 83df70ce..1f285a8c 100755
+--- a/scripts/convert.py
++++ b/scripts/convert.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012 VMware Inc.
+diff --git a/scripts/highlight.py b/scripts/highlight.py
+index ed3b54d4..e494abf4 100644
+--- a/scripts/highlight.py
++++ b/scripts/highlight.py
+@@ -221,7 +221,8 @@ def LessHighlighter():
+ try:
+ less = subprocess.Popen(
+ args = ['less', '-FRXn'],
+- stdin = subprocess.PIPE
++ stdin = subprocess.PIPE,
++ universal_newlines = True
+ )
+ except OSError:
+ return ColorHighlighter()
+diff --git a/scripts/jsondiff.py b/scripts/jsondiff.py
+index 25c4840e..d7a18e21 100755
+--- a/scripts/jsondiff.py
++++ b/scripts/jsondiff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2015 VMware, Inc.
+diff --git a/scripts/jsonextractimages.py b/scripts/jsonextractimages.py
+index 917ee7e4..785e32db 100755
+--- a/scripts/jsonextractimages.py
++++ b/scripts/jsonextractimages.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012 Jose Fonseca
+diff --git a/scripts/leaks.py b/scripts/leaks.py
+index 325af1e2..706e60a9 100755
+--- a/scripts/leaks.py
++++ b/scripts/leaks.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2014-2016 VMware, Inc.
+@@ -39,7 +39,7 @@ class LeakDetector(unpickle.Unpickler):
+ def __init__(self, apitrace, trace):
+
+ cmd = [apitrace, 'pickle', '--symbolic', trace]
+- p = subprocess.Popen(args = cmd, stdout = subprocess.PIPE)
++ p = subprocess.Popen(args = cmd, stdout=subprocess.PIPE)
+
+ unpickle.Unpickler.__init__(self, p.stdout)
+
+diff --git a/scripts/profileshader.py b/scripts/profileshader.py
+index 5c2a58fb..c6c1c935 100755
+--- a/scripts/profileshader.py
++++ b/scripts/profileshader.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012-2013 VMware, Inc.
+diff --git a/scripts/retracediff.py b/scripts/retracediff.py
+index 8105f536..967f3a93 100755
+--- a/scripts/retracediff.py
++++ b/scripts/retracediff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+diff --git a/scripts/snapdiff.py b/scripts/snapdiff.py
+index b0d5f757..58fefe88 100755
+--- a/scripts/snapdiff.py
++++ b/scripts/snapdiff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+diff --git a/scripts/tracecheck.py b/scripts/tracecheck.py
+index 3a2ec452..38167e89 100755
+--- a/scripts/tracecheck.py
++++ b/scripts/tracecheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 VMware, Inc.
+diff --git a/scripts/tracediff.py b/scripts/tracediff.py
+index 0cd9c8c6..88e389a3 100755
+--- a/scripts/tracediff.py
++++ b/scripts/tracediff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+@@ -173,7 +173,7 @@ class ExternalDiffer(Differ):
+ try:
+ less = subprocess.Popen(
+ args = ['less', '-FRXn'],
+- stdin = subprocess.PIPE
++ stdin = subprocess.PIPE,
+ )
+ except OSError:
+ pass
+@@ -214,7 +214,7 @@ ignoredFunctionNames = set([
+
+
+ class Blob:
+- '''Data-less proxy for bytearrays, to save memory.'''
++ '''Data-less proxy for bytes, to save memory.'''
+
+ def __init__(self, size, hash):
+ self.size = size
+@@ -233,7 +233,7 @@ class Blob:
+ class BlobReplacer(Rebuilder):
+ '''Replace blobs with proxys.'''
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return Blob(len(obj), hash(str(obj)))
+
+ def visitCall(self, call):
+@@ -287,7 +287,7 @@ class PythonDiffer(Differ):
+ '--calls=' + calls,
+ trace
+ ],
+- stdout = subprocess.PIPE,
++ stdout=subprocess.PIPE,
+ )
+
+ parser = Loader(p.stdout)
+diff --git a/scripts/unpickle.py b/scripts/unpickle.py
+index 86891d29..822b8ea8 100755
+--- a/scripts/unpickle.py
++++ b/scripts/unpickle.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012 Jose Fonseca
+@@ -34,6 +34,7 @@ Run as:
+
+
+ import itertools
++import operator
+ import optparse
+ import sys
+ import time
+@@ -55,7 +56,7 @@ CALL_FLAG_MARKER_PUSH = (1 << 9)
+ CALL_FLAG_MARKER_POP = (1 << 10)
+
+
+-class Pointer(long):
++class Pointer(int):
+
+ def __str__(self):
+ if self == 0:
+@@ -79,7 +80,7 @@ class Visitor:
+ self.dispatch[tuple] = self.visitTuple
+ self.dispatch[list] = self.visitList
+ self.dispatch[dict] = self.visitDict
+- self.dispatch[bytearray] = self.visitByteArray
++ self.dispatch[bytes] = self.visitBytes
+ self.dispatch[Pointer] = self.visitPointer
+
+ def visit(self, obj):
+@@ -119,7 +120,7 @@ class Visitor:
+ def visitDict(self, obj):
+ return self.visitIterable(obj)
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ raise NotImplementedError
+
+ def visitPointer(self, obj):
+@@ -153,7 +154,7 @@ class Dumper(Visitor):
+ def visitDict(self, obj):
+ return '{' + self.visitItems(iter(obj.items())) + '}'
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return 'blob(%u)' % len(obj)
+
+
+@@ -169,7 +170,7 @@ class Hasher(Visitor):
+ def visitIterable(self, obj):
+ return tuple(map(self.visit, obj))
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return str(obj)
+
+
+@@ -193,7 +194,7 @@ class Rebuilder(Visitor):
+ else:
+ return obj
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return obj
+
+
+@@ -269,7 +270,7 @@ class Counter(Unpickler):
+ Unpickler.parse(self)
+
+ functionFrequencies = list(self.functionFrequencies.items())
+- functionFrequencies.sort(lambda (name1, freq1), (name2, freq2): cmp(freq1, freq2))
++ functionFrequencies.sort(key=operator.itemgetter(1))
+ for name, frequency in functionFrequencies:
+ sys.stdout.write('%8u %s\n' % (frequency, name))
+
+@@ -311,7 +312,7 @@ def main():
+ msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+
+ startTime = time.time()
+- parser = Counter(sys.stdin, options.verbose)
++ parser = Counter(sys.stdin.buffer, options.verbose)
+ parser.parse()
+ stopTime = time.time()
+ duration = stopTime - startTime
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0004-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0004-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch
new file mode 100644
index 00000000..8974e5db
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0004-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch
@@ -0,0 +1,62 @@
+From aa8e341e73c288b77a5187e3676a2bbb6588b705 Mon Sep 17 00:00:00 2001
+From: Jose Fonseca <jfonseca@vmware.com>
+Date: Mon, 29 Apr 2019 06:41:49 +0100
+Subject: [PATCH 4/4] scripts: Tie a few more Python 2 to 3 conversion loose
+ ends.
+
+Upstream-Status: Backport [https://github.com/apitrace/apitrace/commit/f527924cca45591966139eae8c2fefb4a9a0f947]
+
+(cherry picked from commit f527924cca45591966139eae8c2fefb4a9a0f947)
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ scripts/jsonextractimages.py | 10 +++++-----
+ scripts/profileshader.py | 2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/scripts/jsonextractimages.py b/scripts/jsonextractimages.py
+index 785e32db..ac20c23d 100755
+--- a/scripts/jsonextractimages.py
++++ b/scripts/jsonextractimages.py
+@@ -34,7 +34,7 @@ import base64
+ import sys
+
+
+-pngSignature = "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"
++pngSignature = b"\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"
+
+
+ def dumpSurfaces(state, memberName):
+@@ -46,13 +46,13 @@ def dumpSurfaces(state, memberName):
+ extName = 'png'
+ else:
+ magic = data[:2]
+- if magic in ('P1', 'P4'):
++ if magic in (b'P1', b'P4'):
+ extName = 'pbm'
+- elif magic in ('P2', 'P5'):
++ elif magic in (b'P2', b'P5'):
+ extName = 'pgm'
+- elif magic in ('P3', 'P6'):
++ elif magic in (b'P3', b'P6'):
+ extName = 'ppm'
+- elif magic in ('Pf', 'PF'):
++ elif magic in (b'Pf', b'PF'):
+ extName = 'pfm'
+ else:
+ sys.stderr.write('warning: unsupport Netpbm format %s\n' % magic)
+diff --git a/scripts/profileshader.py b/scripts/profileshader.py
+index c6c1c935..7e8637eb 100755
+--- a/scripts/profileshader.py
++++ b/scripts/profileshader.py
+@@ -92,7 +92,7 @@ def process(stream, groupField):
+ id = str(group[0]).rjust(maxGroupLen)
+ draw = str(group[1]['draws']).rjust(12)
+ dura = str(group[1]['duration']).rjust(18)
+- perCall = str(group[1]['duration'] / group[1]['draws']).rjust(12)
++ perCall = str(group[1]['duration'] // group[1]['draws']).rjust(12)
+ longest = str(group[1]['longest']).rjust(11)
+ print("| %s | %s | %s | %s | %s |" % (id, draw, dura, perCall, longest))
+
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0005-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0005-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch
new file mode 100644
index 00000000..6bff7e92
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0005-scripts-Tie-a-few-more-Python-2-to-3-conversion-loos.patch
@@ -0,0 +1,60 @@
+From 8b3afcaeebdd87962f2f3fef36973090621d116b Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Sun, 29 Mar 2020 15:38:31 +0000
+Subject: [PATCH 5/5] scripts: Tie a few more Python 2 to 3 conversion loose
+ ends.
+
+Upstream-Status: pending
+Note: code exists in NXP's fork only.
+
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ wrappers/glxtrace.py | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/wrappers/glxtrace.py b/wrappers/glxtrace.py
+index b05028e2..2472560d 100644
+--- a/wrappers/glxtrace.py
++++ b/wrappers/glxtrace.py
+@@ -67,9 +67,9 @@ class GlxTracer(GlTracer):
+ print(' gltrace::releaseContext((uintptr_t)ctx);')
+
+ if function.name == 'glXGetCurrentDisplay':
+- print ' if(_glXGetCurrentDisplay == &glXGetCurrentDisplay ){'
+- print ' _glXGetCurrentDisplay = (PFN_GLXGETCURRENTDISPLAY)_getPublicProcAddress("glXGetCurrentDisplay");'
+- print ' }'
++ print (' if(_glXGetCurrentDisplay == &glXGetCurrentDisplay ){')
++ print (' _glXGetCurrentDisplay = (PFN_GLXGETCURRENTDISPLAY)_getPublicProcAddress("glXGetCurrentDisplay");')
++ print (' }')
+
+ GlTracer.traceFunctionImplBody(self, function)
+
+@@ -184,7 +184,7 @@ if __name__ == '__main__':
+ tracer = GlxTracer()
+ tracer.traceApi(api)
+
+- print r'''
++ print (r'''
+
+
+ /*
+@@ -247,8 +247,8 @@ void * dlopen(const char *filename, int flag)
+
+
+
+-'''
+- print r'''
++''')
++ print (r'''
+ /*
+ * let the GPU driver know that we are in apitrace
+ */
+@@ -257,4 +257,4 @@ int APIENTRY ApiTraceEnabled(void) {
+ return 1;
+ }
+
+-'''
++''')
+--
+2.20.1
+
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_7.1.0.bb b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_9.0.0.bb
index a5a9cdfe..9461a34d 100644
--- a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_7.1.0.bb
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_9.0.0.bb
@@ -4,34 +4,33 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=aeb969185a143c3c25130bc2c3ef9a50"
DEPENDS = "imx-gpu-viv zlib libpng procps"
-SRC_URI = "git://source.codeaurora.org/external/imx/apitrace-imx.git;protocol=https;branch=imx_7.1"
-SRCREV = "438c29f7b43c8dd82275f2bac00075f77b9e9699"
+SRC_URI = "git://source.codeaurora.org/external/imx/apitrace-imx.git;protocol=https;branch=imx_9.0"
+SRCREV = "8636fa989d8e914a7986916b058878761a981a6f"
S = "${WORKDIR}/git"
-inherit cmake lib_package pkgconfig perlnative pythonnative
+inherit cmake pkgconfig perlnative python3native
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "egl waffle"
PACKAGECONFIG_append = \
"${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', \
bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', \
'', d), d)}"
PACKAGECONFIG_append_imxgpu2d = " vivante"
-# For 8M, which has 3D but no 2D, eglretrace is not available
-# on Wayland except through X11 and waffle.
-PACKAGECONFIG_IMXGPU3D = \
- "${@bb.utils.contains('DISTRO_FEATURES', 'wayland x11', ' waffle x11 x11-egl', '', d)}"
-PACKAGECONFIG_IMXGPU3D_imxgpu2d = ""
-PACKAGECONFIG_append_imxgpu3d = "${PACKAGECONFIG_IMXGPU3D}"
+PACKAGECONFIG[egl] = "-DENABLE_EGL=ON,-DENABLE_EGL=OFF,virtual/egl"
+PACKAGECONFIG[gui] = "-DENABLE_GUI=ON,-DENABLE_GUI=OFF"
PACKAGECONFIG[multiarch] = "-DENABLE_MULTIARCH=ON,-DENABLE_MULTIARCH=OFF"
PACKAGECONFIG[waffle] = "-DENABLE_WAFFLE=ON,-DENABLE_WAFFLE=OFF,waffle"
PACKAGECONFIG[x11] = "-DENABLE_X11=ON,-DENABLE_X11=OFF"
-PACKAGECONFIG[x11-egl] = "-Dwaffle_has_x11_egl=ON,-Dwaffle_has_x11_egl=OFF"
PACKAGECONFIG[vivante] = "-DENABLE_VIVANTE=ON,-DENABLE_VIVANTE=OFF,virtual/libg2d"
-FILES_${PN} = "${bindir} ${libdir}"
-FILES_${PN}-dbg += "${libdir}/*/*/.debug"
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+FILES_${PN} += " \
+ ${libdir}/apitrace/scripts/* \
+ ${libdir}/apitrace/wrappers/* \
+"
PACKAGE_ARCH = "${MACHINE_SOCARCH}"
COMPATIBLE_MACHINE = "(imxgpu)"
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.2.4.p1.8.bb b/bsp/meta-freescale/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.4.0.p2.0.bb
index ab712377..8de2c35f 100644
--- a/bsp/meta-freescale/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.2.4.p1.8.bb
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.4.0.p2.0.bb
@@ -5,20 +5,18 @@
DESCRIPTION = "GPU G2D library and apps for i.MX with 2D GPU and no DPU"
LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd4b227530cd88a82af6a5982cfb724d"
DEPENDS += "libgal-imx"
PROVIDES += "virtual/libg2d"
-# FIXME: arm packages are mis-labeled with aarch32 suffix
FSLBIN_NAME = "${PN}-${PV}-${TARGET_ARCH}"
-FSLBIN_NAME_arm = "${PN}-${PV}-aarch32"
SRC_URI = "${FSL_MIRROR}/${FSLBIN_NAME}.bin;name=${TARGET_ARCH};fsl-eula=true"
-SRC_URI[arm.md5sum] = "ab7e43c997d3a84764fc3cc72d3b397c"
-SRC_URI[arm.sha256sum] = "88b3af3dd109e7c9c457d19441dbb668e7c395d29340d724db3cc42dc04ae87b"
-SRC_URI[aarch64.md5sum] = "287f2de4bd407b2eb484d332ae6de157"
-SRC_URI[aarch64.sha256sum] = "77f191135f2be6052eabc8cca50b4ea7b5eaec015488cc108fb3f9656a3a1367"
+SRC_URI[aarch64.md5sum] = "46a25ffb33312b36b4c1b8dea38c05f4"
+SRC_URI[aarch64.sha256sum] = "3278d4e2bae91e86d148c7e142178d50d4d8eb476fc1ee4a2e265f7e66334741"
+SRC_URI[arm.md5sum] = "69532382092c1a5e754be594d1a486b7"
+SRC_URI[arm.sha256sum] = "c618c3ac6adc5f28439ceb88cb46889b78daaf36655ab82ea2ac6f50a88297f5"
S = "${WORKDIR}/${FSLBIN_NAME}"
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc b/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc
index 45f257e6..5c25eec6 100644
--- a/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc
@@ -1,12 +1,12 @@
# Copyright (C) 2012-2016 Freescale Semiconductor
# Copyright (C) 2012-2018 O.S. Systems Software LTDA.
-# Copyright 2017-2018 NXP
+# Copyright 2017-2020 NXP
# Released under the MIT license (see COPYING.MIT for the terms)
DESCRIPTION = "GPU driver and apps for i.MX"
SECTION = "libs"
LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd4b227530cd88a82af6a5982cfb724d"
DEPENDS += " \
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \
@@ -18,6 +18,7 @@ DEPENDS += " \
'', d)} \
"
DEPENDS_append_imxdrm = " libdrm wayland"
+DEPENDS_append_mx8 = " patchelf-native"
# imx-gpu-viv does not provide everything it needs to for virtual/libgl
# on x11 backend or on Wayland backend with XWayland support.
@@ -26,16 +27,18 @@ DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'mesa', '', d)}"
EXTRA_PROVIDES = ""
EXTRA_PROVIDES_append_imxgpu3d = " \
- virtual/libgl \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'virtual/libgl', \
+ bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libgl', \
+ '', d), d)} \
virtual/libgles1 \
virtual/libgles2 \
"
EXTRA_PROVIDES_append_mx8 = " \
virtual/libgbm \
"
-EXTRA_PROVIDES_append_mx8qm = " \
- virtual/libopenvx \
-"
+PROVIDES_OPENVX = ""
+PROVIDES_OPENVX_mx8 = "virtual/libopenvx"
+PROVIDES_OPENVX_mx8mm = ""
PROVIDES += " \
imx-gpu-viv \
libgal-imx \
@@ -44,6 +47,7 @@ PROVIDES += " \
virtual/libopenvg \
virtual/opencl-headers \
virtual/opencl-icd \
+ ${PROVIDES_OPENVX} \
${EXTRA_PROVIDES} \
"
@@ -51,11 +55,11 @@ RPROVIDES_${PN}_imxgpu3d += "imx-gpu-viv"
PE = "1"
-inherit fsl-eula-unpack distro_features_check
+inherit fsl-eula-unpack features_check
REQUIRED_DISTRO_FEATURES_mx8 = "wayland"
-SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
# Note : If you add a package here, to prevent a naming conflict see the python_anonymous() futher below
IMX_PACKAGES_GBM = ""
@@ -80,9 +84,10 @@ PACKAGES =+ "libclc-imx libclc-imx-dev \
imx-gpu-viv-demos \
libvulkan-imx libvulkan-imx-dev \
libopenvx-imx libopenvx-imx-dev \
+ libnn-imx libnn-imx-dev \
"
python __anonymous () {
- has_vivante_kernel_driver_support = (d.getVar('MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT', True) or '0')
+ has_vivante_kernel_driver_support = (d.getVar('MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT') or '0')
if has_vivante_kernel_driver_support != '1':
raise bb.parse.SkipPackage('The kernel of machine needs to have Vivante kernel driver support for this recipe to be used.')
}
@@ -93,6 +98,7 @@ USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}"
# Inhibit warnings about files being stripped.
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+INSANE_SKIP_${BPN} += "already-stripped"
# FIXME: The provided binary doesn't provide soname. If in future BSP
# release the libraries are fixed, we can drop this hack.
@@ -102,7 +108,7 @@ SOLIBS = "${SOLIBSDEV}"
python __anonymous() {
# FIXME: All binaries lack GNU_HASH in elf binary but as we don't have
# the source we cannot fix it. Disable the insane check for now.
- packages = d.getVar('PACKAGES', True).split()
+ packages = d.getVar('PACKAGES').split()
for p in packages:
d.appendVar("INSANE_SKIP_%s" % p, " ldflags")
@@ -139,8 +145,9 @@ HAS_GBM = "false"
HAS_GBM_mx8 = "true"
GLES3_HEADER_REMOVALS = "gl31.h gl32.h"
-GLES3_HEADER_REMOVALS_mx8mq = "gl32.h"
-GLES3_HEADER_REMOVALS_mx8qxp = "gl32.h"
+GLES3_HEADER_REMOVALS_mx8m = "gl32.h"
+GLES3_HEADER_REMOVALS_mx8mm = "gl31.h gl32.h"
+GLES3_HEADER_REMOVALS_mx8qxp = ""
GLES3_HEADER_REMOVALS_mx8qm = ""
do_install () {
@@ -153,7 +160,7 @@ do_install () {
cp -r ${S}/gpu-demos/opt ${D}
cp -r ${S}/gpu-tools/gmem-info/usr/bin/* ${D}${bindir}
- # Use vulkan header from vulkan recipe to support vkmark
+ # Use vulkan header from vulkan-headers recipe to support vkmark
rm -rf ${D}${includedir}/vulkan/
install -d ${D}${libdir}/pkgconfig
@@ -207,10 +214,12 @@ do_install () {
# We'll only have one backend here so we rename it to generic name
# and avoid rework in other packages, when possible
- mv ${D}${libdir}/libGL.so.1.2 ${D}${libdir}/libGL.so.1.2.0
- ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1.2
- ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1
- ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so
+ if [ "${USE_WL}" = "yes" -o "${USE_X11}" = "yes" ]; then
+ cp ${S}/gpu-core/usr/lib/libGL-${backend}.so ${D}${libdir}/libGL.so.1.2.0
+ ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1.2
+ ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1
+ ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so
+ fi
mv ${D}${libdir}/libEGL-${backend}.so ${D}${libdir}/libEGL.so.1.0
ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so.1
ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so
@@ -233,12 +242,10 @@ do_install () {
ln -sf libGLESv2.so.2.0.0 ${D}${libdir}/libGLESv2.so
if [ "${IS_MX8}" = "1" ]; then
- # Install the vulkan driver in a sub-folder. When installed in the same
- # folder as the vulkan loader layer library, an incorrect linkage is
- # created from libvulkan.so.1 to our library instead of the loader
- # layer library.
- install -d ${D}${libdir}/vulkan
- mv ${D}${libdir}/libvulkan-${backend}.so ${D}${libdir}/vulkan/libvulkan_VSI.so
+ # Change libvulkon.so driver soname, so that it does not clash with the
+ # vulkan-loader libvulkan.so
+ patchelf --set-soname libvulkan_VSI.so.1 ${D}${libdir}/libvulkan-${backend}.so
+ mv ${D}${libdir}/libvulkan-${backend}.so ${D}${libdir}/libvulkan_VSI.so
fi
for header in ${GLES3_HEADER_REMOVALS}; do
rm -f ${D}${includedir}/GLES3/${header}
@@ -283,10 +290,6 @@ do_install () {
ALLOW_EMPTY_${PN} = "1"
-# FIXME: Remove the following lines after adding libopenvx package
-INSANE_SKIP_imx-gpu-viv-dev += "dev-elf"
-INSANE_SKIP_libclc-imx += "dev-deps"
-
FILES_libclc-imx = "${libdir}/libCLC${SOLIBS}"
FILES_libclc-imx-dev = "${includedir}/CL ${libdir}/libCLC${SOLIBSDEV}"
@@ -298,21 +301,26 @@ FILES_libegl-imx-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/
FILES_libgal-imx = "${libdir}/libGAL${SOLIBS} ${libdir}/libGAL_egl${SOLIBS}"
FILES_libgal-imx-dev = "${libdir}/libGAL${SOLIBSDEV} ${includedir}/HAL"
RDEPENDS_libgal-imx += "kernel-module-imx-gpu-viv"
+RSUGGESTS_libgal-imx += "valgrind"
RPROVIDES_libgal-imx += "libgal-imx"
INSANE_SKIP_libgal-imx += "build-deps"
FILES_libvsc-imx = "${libdir}/libVSC${SOLIBS}"
-FILES_libgbm-imx_mx8 = "${libdir}/libgbm${SOLIBS} ${libdir}/gbm_viv${SOLIBS}"
+FILES_libgbm-imx_mx8 = "${libdir}/libgbm*${SOLIBS}"
FILES_libgbm-imx-dev_mx8 = "${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h ${libdir}/libgbm${SOLIBSDEV}"
RDEPENDS_libgbm-imx_append_mx8 = " libdrm"
-FILES_libvulkan-imx = "${libdir}/vulkan/libvulkan_VSI${SOLIBS}"
-FILES_libvulkan-imx-dev = "${includedir}/vulkan ${libdir}/vulkan/libvulkan_VSI${SOLIBSDEV}"
-INSANE_SKIP_libvulkan-imx += "dev-deps dev-so"
+FILES_libvulkan-imx = "${libdir}/libvulkan_VSI${SOLIBS} ${libdir}/libSPIRV_viv${SOLIBS}"
+FILES_libvulkan-imx-dev = "${includedir}/vulkan ${libdir}/libvulkan_VSI${SOLIBSDEV}"
-FILES_libopenvx-imx = "${libdir}/libOpenVX${SOLIBS} ${libdir}/libOpenVXC${SOLIBS} ${libdir}/libOpenVXU${SOLIBS}"
-FILES_libopenvx-imx-dev = "${includedir}/VX ${libdir}/libopenVX${SOLIBSDEV}"
+FILES_libopenvx-imx = " \
+ ${libdir}/libOpenVX*${SOLIBS} \
+ ${libdir}/libOvx*${SOLIBS} \
+ ${libdir}/libovx*${SOLIBS} \
+ "
+FILES_libopenvx-imx-dev = "${includedir}/VX ${includedir}/OVXLIB"
+RDEPENDS_libopenvx-imx = "libnn-imx"
FILES_libgl-imx = "${libdir}/libGL${REALSOLIBS}"
FILES_libgl-imx-dev = "${libdir}/libGL${SOLIBSDEV} ${includedir}/GL"
@@ -340,6 +348,7 @@ FILES_libglslc-imx-dev = "${includedir}/CL ${libdir}/libGLSLC${SOLIBSDEV}"
FILES_libopencl-imx = "${libdir}/libOpenCL${SOLIBS} \
${libdir}/libVivanteOpenCL${SOLIBS} \
+ ${libdir}/libLLVM_viv${SOLIBS} \
${sysconfdir}/OpenCL/vendors/Vivante.icd"
FILES_libopencl-imx-dev = "${includedir}/CL ${libdir}/libOpenCL${SOLIBSDEV}"
RDEPENDS_libopencl-imx= "libclc-imx"
@@ -369,4 +378,7 @@ FILES_imx-gpu-viv-tools = "${bindir}/gmem_info"
FILES_imx-gpu-viv-demos = "/opt"
INSANE_SKIP_imx-gpu-viv-demos += "rpaths dev-deps"
+FILES_libnn-imx = "${libdir}/libNN*${SOLIBS} ${libdir}/libnn*${SOLIBS} ${libdir}/libneuralnetworks${SOLIBS}"
+FILES_libnn-imx-dev = "${includedir}/nnrt"
+
# COMPATIBLE_MACHINE = "(mx6q|mx6dl|mx6sx|mx6sl|mx8)"
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.4.p1.8-aarch64.bb b/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.4.p1.8-aarch64.bb
deleted file mode 100644
index 004cdcb2..00000000
--- a/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.4.p1.8-aarch64.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require imx-gpu-viv-6.inc
-
-SRC_URI[md5sum] = "89cd1ad71128bc1b200c18a5a8db95b0"
-SRC_URI[sha256sum] = "bf27b753b45777e90a158819d80d91f5226b34d71dc4ec4eea40f2c10c46159a"
-
-COMPATIBLE_MACHINE = "(mx8)"
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.4.p1.8-aarch32.bb b/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.0.p2.0-aarch32.bb
index 3564aab0..d1b82f6e 100644
--- a/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.4.p1.8-aarch32.bb
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.0.p2.0-aarch32.bb
@@ -1,11 +1,10 @@
# Copyright (C) 2013-2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
+# Copyright 2017-2020 NXP
# Released under the MIT license (see COPYING.MIT for the terms)
require recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc
-SRC_URI[md5sum] = "ef9e0b5fcb140c72b63dcf8b8da0be6b"
-SRC_URI[sha256sum] = "7c31d1c7b45309ff7ca667b4d69b7c3b5fa320dcdcd90f2eb895f66f826f422b"
-PACKAGE_FP_TYPE = "hardfp"
+SRC_URI[md5sum] = "4544b0c874914dfbc47ec93855bd04a7"
+SRC_URI[sha256sum] = "bae4099119259a303a265eb02d9f0d63348bbf3f8637de6cb892e209171b4c97"
COMPATIBLE_MACHINE = "(mx6q|mx6dl|mx6sx|mx6sl|mx7ulp)"
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.0.p2.0-aarch64.bb b/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.0.p2.0-aarch64.bb
new file mode 100644
index 00000000..b46c6115
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.0.p2.0-aarch64.bb
@@ -0,0 +1,6 @@
+require imx-gpu-viv-6.inc
+
+SRC_URI[md5sum] = "f4005a4a2dba6a79d8f25547612aa3b9"
+SRC_URI[sha256sum] = "148e1b1a9e382a8159d5763dd2b08caad008eb931f3d925ac901c2438440d508"
+
+COMPATIBLE_MACHINE = "(mx8)"
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch
deleted file mode 100644
index 180a9d84..00000000
--- a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 010af1952d935352764389636b7165283e6c9e3f Mon Sep 17 00:00:00 2001
-From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
-Date: Tue, 7 Apr 2015 17:58:45 -0500
-Subject: [PATCH] Additional eglSwapBuffer calling makes wrong throttling
-
-Upstream Status: Pending
-
-Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
----
- src/egl/eglut/eglut_wayland.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/egl/eglut/eglut_wayland.c b/src/egl/eglut/eglut_wayland.c
-index 968b33f..5664d35 100644
---- a/src/egl/eglut/eglut_wayland.c
-+++ b/src/egl/eglut/eglut_wayland.c
-@@ -155,7 +155,7 @@ draw(void *data, struct wl_callback *callback, uint32_t time)
-
- if (win->display_cb)
- win->display_cb();
-- eglSwapBuffers(_eglut->dpy, win->surface);
-+ /*eglSwapBuffers(_eglut->dpy, win->surface);*/
-
- if (callback)
- wl_callback_destroy(callback);
---
-2.3.5
-
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend
index 94db4157..301f1b59 100644
--- a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend
@@ -2,21 +2,25 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append_imxgpu = " file://Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch \
file://fix-clear-build-break.patch \
- file://Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch \
file://Add-OpenVG-demos-to-support-wayland.patch"
-PACKAGECONFIG_IMX_TO_REMOVE_GLES = ""
-PACKAGECONFIG_IMX_TO_REMOVE_GLES_imxgpu2d = "gles1 gles2"
-PACKAGECONFIG_IMX_TO_REMOVE_GLES_imxgpu3d = ""
-PACKAGECONFIG_IMX_TO_REMOVE = "${PACKAGECONFIG_IMX_TO_REMOVE_GLES}"
-PACKAGECONFIG_IMX_TO_REMOVE_append_imxgpu = " \
+PACKAGECONFIG_REMOVE_IF_2D_ONLY = ""
+PACKAGECONFIG_REMOVE_IF_2D_ONLY_imxgpu2d = "gles1 gles2"
+PACKAGECONFIG_REMOVE_IF_2D_ONLY_imxgpu3d = ""
+PACKAGECONFIG_REMOVE_IF_GPU = ""
+PACKAGECONFIG_REMOVE_IF_GPU_imxgpu = " \
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'glu x11', '', d)} \
"
-PACKAGECONFIG_remove = "${PACKAGECONFIG_IMX_TO_REMOVE}"
+PACKAGECONFIG_remove = " \
+ ${PACKAGECONFIG_REMOVE_IF_2D_ONLY} \
+ ${PACKAGECONFIG_REMOVE_IF_GPU} \
+"
-PACKAGECONFIG_IMX_TO_APPEND = ""
-PACKAGECONFIG_IMX_TO_APPEND_append_imxgpu = " \
+PACKAGECONFIG_APPEND_IF_GPU = ""
+PACKAGECONFIG_APPEND_IF_GPU_imxgpu = " \
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland vg', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glut', '', d)} \
"
-PACKAGECONFIG_append = "${PACKAGECONFIG_IMX_TO_APPEND}"
+PACKAGECONFIG_append = " \
+ ${PACKAGECONFIG_APPEND_IF_GPU} \
+"
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend b/bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend
index 465c8932..ca1c8f46 100644
--- a/bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend
@@ -1 +1 @@
-COMPATIBLE_MACHINE_imxgpu2d = "(-)"
+COMPATIBLE_MACHINE_imxgpu = "(-)"
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend b/bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend
index 5ead6251..8d429abf 100644
--- a/bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend
@@ -6,7 +6,7 @@ PACKAGECONFIG_remove_imxgpu3d = "gles"
# FIXME: mesa should support 'x11-no-tls' option
python () {
- overrides = d.getVar("OVERRIDES", True).split(":")
+ overrides = d.getVar("OVERRIDES").split(":")
if "imxgpu2d" not in overrides:
return
@@ -14,9 +14,20 @@ python () {
d.setVarFlag("PACKAGECONFIG", "x11", x11flag.replace("--enable-glx-tls", "--enable-glx"))
}
-# Enable Etnaviv support
-PACKAGECONFIG_append_use-mainline-bsp = " gallium"
-GALLIUMDRIVERS_append_use-mainline-bsp = ",etnaviv,imx"
+# Enable Etnaviv and Freedreno support
+PACKAGECONFIG_append_use-mainline-bsp = " gallium etnaviv kmsro freedreno"
+
+USE_OSMESA_ONLY ?= "no"
+
+# Etnaviv support state for i.MX8 is unknown, therefore only enable OSMesa and
+# disable Gallium for now. If you still want to enable Etnaviv, just set
+# USE_OSMESA_ONLY_mx8 = "no" in your bbappend.
+USE_OSMESA_ONLY_mx8 ?= "yes"
+
+# Enable OSMesa which also requires dri (classic) swrast
+PACKAGECONFIG_append = " ${@oe.utils.conditional('USE_OSMESA_ONLY', 'yes', ' osmesa', '', d)}"
+PACKAGECONFIG_remove = " ${@oe.utils.conditional('USE_OSMESA_ONLY', 'yes', 'gallium', '', d)}"
+DRIDRIVERS_append = "${@oe.utils.conditional('USE_OSMESA_ONLY', 'yes', 'swrast', '', d)}"
BACKEND = \
"${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \
@@ -27,6 +38,7 @@ BACKEND = \
do_install_append_imxgpu3d () {
rm -f ${D}${libdir}/libGL.* \
${D}${includedir}/GL/gl.h \
+ ${D}${includedir}/GL/glcorearb.h \
${D}${includedir}/GL/glext.h \
${D}${includedir}/GL/glx.h \
${D}${includedir}/GL/glxext.h
diff --git a/bsp/meta-freescale/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch b/bsp/meta-freescale/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch
new file mode 100644
index 00000000..b5225693
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch
@@ -0,0 +1,47 @@
+From 87fc7761cff5931a58984c7f7e78f421a0660e0e Mon Sep 17 00:00:00 2001
+From: Tom Hochstein <tom.hochstein@nxp.com>
+Date: Wed, 22 Apr 2020 13:40:04 -0500
+Subject: [PATCH] meson: Add missing wayland dependency on EGL
+
+The build was not finding egl.pc due to this
+missing dependency.
+
+Upstream-Status: Pending
+
+Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
+
+---
+ meson.build | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index ca8b127..efb51f4 100644
+--- a/meson.build
++++ b/meson.build
+@@ -65,6 +65,7 @@ dep_gl = _dep_null
+ dep_egl = _dep_null
+ dep_wayland_client = _dep_null
+ dep_wayland_egl = _dep_null
++dep_wayland_wayland_egl = _dep_null
+ dep_x11_xcb = _dep_null
+ dep_gbm = _dep_null
+ dep_udev = _dep_null
+@@ -90,7 +91,8 @@ else
+ dep_wayland_client = dependency(
+ 'wayland-client', version : '>= 1.10', required : get_option('wayland'),
+ )
+- dep_wayland_egl = dependency(
++ dep_wayland_egl = dependency('egl', required : get_option('wayland'))
++ dep_wayland_wayland_egl = dependency(
+ 'wayland-egl', version : '>= 9.1', required : get_option('wayland'),
+ )
+ dep_x11_xcb = dependency('x11-xcb', required : get_option('glx'))
+@@ -101,7 +103,7 @@ else
+ dep_udev = dependency('libudev', required : get_option('gbm'))
+
+ build_x11_egl = dep_egl.found()
+- build_wayland = dep_wayland_client.found() and dep_wayland_egl.found()
++ build_wayland = dep_wayland_client.found() and dep_wayland_egl.found() and dep_wayland_wayland_egl.found()
+ build_glx = dep_gl.found()
+ build_gbm = dep_gbm.found() and dep_udev.found()
+ build_surfaceless = dep_egl.found()
diff --git a/bsp/meta-freescale/recipes-graphics/waffle/waffle/0002-meson-Separate-surfaceless-option-from-x11.patch b/bsp/meta-freescale/recipes-graphics/waffle/waffle/0002-meson-Separate-surfaceless-option-from-x11.patch
new file mode 100644
index 00000000..9d5003e2
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/waffle/waffle/0002-meson-Separate-surfaceless-option-from-x11.patch
@@ -0,0 +1,44 @@
+From 12ac4372cc6a66e83b61f8510bdaa4f11c72113d Mon Sep 17 00:00:00 2001
+From: Tom Hochstein <tom.hochstein@nxp.com>
+Date: Wed, 22 Apr 2020 14:08:36 -0500
+Subject: [PATCH] meson: Separate surfaceless option from x11
+
+Allow surfaceless build separate from the x11 option.
+Also require gbm for surfaceless build.
+
+Upstream-Status: Pending
+
+Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
+
+---
+ meson.build | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index efb51f4..0ee3ee5 100644
+--- a/meson.build
++++ b/meson.build
+@@ -72,6 +72,7 @@ dep_udev = _dep_null
+ dep_cocoa = _dep_null
+ dep_core_foundation = _dep_null
+ dep_gl_headers = _dep_null
++dep_surfaceless = _dep_null
+
+ # Get dependencies
+ if build_wgl
+@@ -101,12 +102,14 @@ else
+ endif
+ dep_gbm = dependency('gbm', required : get_option('gbm'))
+ dep_udev = dependency('libudev', required : get_option('gbm'))
++ dep_surfaceless_egl = dependency('egl', required : get_option('surfaceless_egl'))
++ dep_surfaceless_gbm = dependency('gbm', required : get_option('surfaceless_egl'))
+
+ build_x11_egl = dep_egl.found()
+ build_wayland = dep_wayland_client.found() and dep_wayland_egl.found() and dep_wayland_wayland_egl.found()
+ build_glx = dep_gl.found()
+ build_gbm = dep_gbm.found() and dep_udev.found()
+- build_surfaceless = dep_egl.found()
++ build_surfaceless = dep_surfaceless_egl.found() and dep_surfaceless_gbm.found()
+ endif
+
+ dep_bash = dependency('bash-completion', required : false)
diff --git a/bsp/meta-freescale/recipes-graphics/waffle/waffle_%.bbappend b/bsp/meta-freescale/recipes-graphics/waffle/waffle_%.bbappend
index 9a9de0ed..9d090bcf 100644
--- a/bsp/meta-freescale/recipes-graphics/waffle/waffle_%.bbappend
+++ b/bsp/meta-freescale/recipes-graphics/waffle/waffle_%.bbappend
@@ -1,7 +1,18 @@
-PACKAGECONFIG_X11 = ""
-PACKAGECONFIG_X11_append_imxgpu3d = " x11-egl glx"
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+ file://0001-meson-Add-missing-wayland-dependency-on-EGL.patch \
+ file://0002-meson-Separate-surfaceless-option-from-x11.patch \
+"
+
+PACKAGECONFIG_IMXGPU_X11 = ""
+PACKAGECONFIG_IMXGPU_X11_imxgpu3d = "x11-egl glx"
+PACKAGECONFIG_IMXGPU_GBM = "gbm"
+PACKAGECONFIG_IMXGPU_GBM_mx6 = ""
+PACKAGECONFIG_IMXGPU_GBM_mx7 = ""
PACKAGECONFIG_imxgpu = " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'gbm', \
- bb.utils.contains('DISTRO_FEATURES', 'x11', '${PACKAGECONFIG_X11}', \
- '', d), d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \
+ bb.utils.contains('DISTRO_FEATURES', 'x11', '${PACKAGECONFIG_IMXGPU_X11}', \
+ '', d), d)} \
+ ${PACKAGECONFIG_IMXGPU_GBM} \
"
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0001-unstable-Add-alpha-compositing-protocol.patch b/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0001-unstable-Add-alpha-compositing-protocol.patch
deleted file mode 100644
index 10dc2198..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0001-unstable-Add-alpha-compositing-protocol.patch
+++ /dev/null
@@ -1,195 +0,0 @@
-From b4be5e338be2301f83f4dfdc0cbb740f0a783464 Mon Sep 17 00:00:00 2001
-From: Haihua Hu <jared.hu@nxp.com>
-Date: Thu, 14 Jun 2018 13:54:08 +0800
-Subject: [PATCH 1/2] unstable: Add alpha-compositing protocol
-
-It's based on the Chromium Wayland protocol of the same name ([1])
-and Alexandros's modified version ([2])with a few changes
-made to the blending_equation enumeration.
-
-Add one more blending_equation "src_alpha / src_alpha"
-
-[1] https://chromium.googlesource.com/chromium/src/+/master/third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml
-[2] https://lists.freedesktop.org/archives/wayland-devel/2017-August/034741.html
-
-Upstream-Status: Inappropriate [i.MX specific]
-
-Signed-off-by: Haihua Hu <jared.hu@nxp.com>
----
- Makefile.am | 1 +
- unstable/alpha-compositing/README | 6 +
- .../alpha-compositing-unstable-v1.xml | 136 +++++++++++++++++++++
- 3 files changed, 143 insertions(+)
- create mode 100644 unstable/alpha-compositing/README
- create mode 100644 unstable/alpha-compositing/alpha-compositing-unstable-v1.xml
-
-diff --git a/Makefile.am b/Makefile.am
-index 4b9a901..e6c44ec 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -17,6 +17,7 @@ unstable_protocols = \
- unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml \
- unstable/xdg-output/xdg-output-unstable-v1.xml \
- unstable/input-timestamps/input-timestamps-unstable-v1.xml \
-+ unstable/alpha-compositing/alpha-compositing-unstable-v1.xml \
- $(NULL)
-
- stable_protocols = \
-diff --git a/unstable/alpha-compositing/README b/unstable/alpha-compositing/README
-new file mode 100644
-index 0000000..d874156
---- /dev/null
-+++ b/unstable/alpha-compositing/README
-@@ -0,0 +1,6 @@
-+Alpha compositing protocol
-+
-+Maintainers:
-+David Reveman <reveman at chromium.org>
-+Alexandros Frantzis <alexandros.frantzis at collabora.com>
-+Jared Hu <Jared Hu at nxp.com>
-diff --git a/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml b/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml
-new file mode 100644
-index 0000000..0844b3f
---- /dev/null
-+++ b/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml
-@@ -0,0 +1,136 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<protocol name="alpha_compositing_unstable_v1">
-+
-+ <copyright>
-+ Copyright 2016 The Chromium Authors.
-+ Copyright 2017 Collabora Ltd
-+ Copyright 2018 NXP
-+
-+ Permission is hereby granted, free of charge, to any person obtaining a
-+ copy of this software and associated documentation files (the "Software"),
-+ to deal in the Software without restriction, including without limitation
-+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ and/or sell copies of the Software, and to permit persons to whom the
-+ Software is furnished to do so, subject to the following conditions:
-+
-+ The above copyright notice and this permission notice (including the next
-+ paragraph) shall be included in all copies or substantial portions of the
-+ Software.
-+
-+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ DEALINGS IN THE SOFTWARE.
-+ </copyright>
-+
-+ <description summary="Protocol for more advanced compositing and blending">
-+ This protocol specifies a set of interfaces used to control the alpha
-+ compositing and blending of surface contents.
-+
-+ Warning! The protocol described in this file is experimental and backward
-+ incompatible changes may be made. Backward compatible changes may be added
-+ together with the corresponding interface version bump. Backward
-+ incompatible changes are done by bumping the version number in the protocol
-+ and interface names and resetting the interface version. Once the protocol
-+ is to be declared stable, the 'z' prefix and the version number in the
-+ protocol and interface names are removed and the interface version number is
-+ reset.
-+ </description>
-+
-+ <interface name="zwp_alpha_compositing_v1" version="1">
-+ <description summary="alpha_compositing">
-+ The global interface exposing compositing and blending capabilities is
-+ used to instantiate an interface extension for a wl_surface object.
-+ This extended interface will then allow the client to specify the
-+ blending equation and alpha value used for compositing the wl_surface.
-+ </description>
-+
-+ <request name="destroy" type="destructor">
-+ <description summary="unbind from the blending interface">
-+ Informs the server that the client will not be using this
-+ protocol object anymore. This does not affect any other objects,
-+ blending objects included.
-+ </description>
-+ </request>
-+
-+ <enum name="error">
-+ <entry name="blending_exists" value="0"
-+ summary="the surface already has a blending object associated"/>
-+ </enum>
-+
-+ <request name="get_blending">
-+ <description summary="extend surface interface for blending">
-+ Instantiate an interface extension for the given wl_surface to
-+ provide surface blending. If the given wl_surface already has
-+ a blending object associated, the blending_exists protocol error
-+ is raised.
-+ </description>
-+
-+ <arg name="id" type="new_id" interface="zwp_blending_v1"
-+ summary="the new blending interface id"/>
-+ <arg name="surface" type="object" interface="wl_surface"
-+ summary="the surface"/>
-+ </request>
-+ </interface>
-+
-+ <interface name="zwp_blending_v1" version="1">
-+ <description summary="blending interface to a wl_surface">
-+ An additional interface to a wl_surface object, which allows the
-+ client to specify the blending equation used for compositing and
-+ an alpha value applied to the whole surface.
-+
-+ When the blending object is created its blending equation is
-+ 'none' and its alpha is 1.0, i.e., it's inactive by default. Clients
-+ can activate it by setting the blending equation and alpha value.
-+
-+ If the wl_surface associated with the blending object is destroyed,
-+ the blending object becomes inert.
-+
-+ If the blending object is destroyed, the blending state is removed
-+ from the wl_surface. The change will be applied on the next
-+ wl_surface.commit.
-+ </description>
-+
-+ <request name="destroy" type="destructor">
-+ <description summary="remove blending from the surface">
-+ The associated wl_surface's blending state is removed.
-+ The change is applied on the next wl_surface.commit.
-+ </description>
-+ </request>
-+
-+ <enum name="blending_equation">
-+ <description summary="different blending equations for compositing">
-+ Blending equations that can be used when compositing a surface.
-+ </description>
-+ <entry name="none" value="0" summary="blending object is inactive"/>
-+ <entry name="opaque" value="1" summary="(one, zero)"/>
-+ <entry name="premultiplied" value="2" summary="(one, one_minus_src_alpha)"/>
-+ <entry name="straight" value="3" summary="(src_alpha, one_minus_src_alpha)" />
-+ <entry name="fromsource" value="4" summary="(src_alpha, src_alpha)" />
-+ </enum>
-+
-+ <request name="set_blending">
-+ <description summary="set the blending equation">
-+ Set the blending equation for compositing the wl_surface.
-+
-+ The blending equation state is double-buffered state,
-+ and will be applied on the next wl_surface.commit.
-+ </description>
-+ <arg name="equation" type="uint" summary="the new blending equation"/>
-+ </request>
-+
-+ <request name="set_alpha">
-+ <description summary="set the alpha value">
-+ Set the alpha value applied to the whole surface for compositing.
-+
-+ The alpha value state is double-buffered state,
-+ and will be applied on the next wl_surface.commit.
-+ </description>
-+ <arg name="value" type="fixed" summary="the new alpha value"/>
-+ </request>
-+ </interface>
-+
-+</protocol>
-\ No newline at end of file
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0002-unstable-Add-hdr10-metadata-protocol.patch b/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0002-unstable-Add-hdr10-metadata-protocol.patch
deleted file mode 100644
index 654e8b09..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols/0002-unstable-Add-hdr10-metadata-protocol.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From 54e847c10a75ec7bd6fbb8fbdd700d085145cdce Mon Sep 17 00:00:00 2001
-From: Haihua Hu <jared.hu@nxp.com>
-Date: Tue, 26 Jun 2018 15:30:18 +0800
-Subject: [PATCH 2/2] unstable: Add hdr10-metadata protocol
-
-this protocol is used to support hdr10 video playback.
-HDR10 metadata is passed to compositor via this interface
-
-Upstream-Status: Inappropriate [i.MX specific]
-
-Signed-off-by: Haihua Hu <jared.hu@nxp.com>
----
- Makefile.am | 1 +
- unstable/hdr10-metadata/README | 4 ++
- .../hdr10-metadata/hdr10-metadata-unstable-v1.xml | 84 ++++++++++++++++++++++
- 3 files changed, 89 insertions(+)
- create mode 100644 unstable/hdr10-metadata/README
- create mode 100644 unstable/hdr10-metadata/hdr10-metadata-unstable-v1.xml
-
-diff --git a/Makefile.am b/Makefile.am
-index e6c44ec..b8206c7 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -18,6 +18,7 @@ unstable_protocols = \
- unstable/xdg-output/xdg-output-unstable-v1.xml \
- unstable/input-timestamps/input-timestamps-unstable-v1.xml \
- unstable/alpha-compositing/alpha-compositing-unstable-v1.xml \
-+ unstable/hdr10-metadata/hdr10-metadata-unstable-v1.xml \
- $(NULL)
-
- stable_protocols = \
-diff --git a/unstable/hdr10-metadata/README b/unstable/hdr10-metadata/README
-new file mode 100644
-index 0000000..58a82f8
---- /dev/null
-+++ b/unstable/hdr10-metadata/README
-@@ -0,0 +1,4 @@
-+hdr10 metadata protocol
-+
-+Maintainers:
-+Jared Hu <Jared Hu at nxp.com>
-diff --git a/unstable/hdr10-metadata/hdr10-metadata-unstable-v1.xml b/unstable/hdr10-metadata/hdr10-metadata-unstable-v1.xml
-new file mode 100644
-index 0000000..5b1bac4
---- /dev/null
-+++ b/unstable/hdr10-metadata/hdr10-metadata-unstable-v1.xml
-@@ -0,0 +1,84 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<protocol name="hdr10_metadata_unstable_v1">
-+
-+ <copyright>
-+ Copyright 2018 NXP
-+
-+ Permission is hereby granted, free of charge, to any person obtaining a
-+ copy of this software and associated documentation files (the "Software"),
-+ to deal in the Software without restriction, including without limitation
-+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ and/or sell copies of the Software, and to permit persons to whom the
-+ Software is furnished to do so, subject to the following conditions:
-+
-+ The above copyright notice and this permission notice (including the next
-+ paragraph) shall be included in all copies or substantial portions of the
-+ Software.
-+
-+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ DEALINGS IN THE SOFTWARE.
-+ </copyright>
-+
-+ <description summary="Protocol for sending hdr10 metadata to compositor">
-+ This protocol specifies a set of interfaces used to set and control
-+ hdr10 metadata of video contents.
-+
-+ Warning! The protocol described in this file is experimental and backward
-+ incompatible changes may be made. Backward compatible changes may be added
-+ together with the corresponding interface version bump. Backward
-+ incompatible changes are done by bumping the version number in the protocol
-+ and interface names and resetting the interface version. Once the protocol
-+ is to be declared stable, the 'z' prefix and the version number in the
-+ protocol and interface names are removed and the interface version number is
-+ reset.
-+ </description>
-+
-+ <interface name="zwp_hdr10_metadata_v1" version="1">
-+ <description summary="hdr10_metadata">
-+ The global interface exposing hdr10 metadata capabilities is
-+ used to instantiate an interface extension for compositor.
-+ This extended interface will then allow the client to pass hdr10 metadata
-+ to compositor and send to display driver if supported.
-+ </description>
-+
-+ <request name="destroy" type="destructor">
-+ <description summary="unbind from the hdr10 metadata interface">
-+ Informs the server that the client will not be using this
-+ protocol object anymore. This does not affect any other objects.
-+ </description>
-+ </request>
-+
-+ <enum name="error">
-+ <entry name="sending_meta_error" value="0"
-+ summary="error occurs when compositor handle metadata"/>
-+ </enum>
-+
-+ <request name="set_metadata">
-+ <description summary="interface of setting and controling hdr10 metadata">
-+ client can use this interface pass hdr10 metadata to server. Server need
-+ use the recived metadata to enable hdr mode.
-+ </description>
-+
-+ <arg name="eotf" type="uint" summary="supported eotf"/>
-+ <arg name="type" type="uint" summary="supported type"/>
-+ <arg name="display_primaries_red" type="uint"
-+ summary="display primaries of red, high 16bits for x, and low 16bits for y"/>
-+ <arg name="display_primaries_green" type="uint"
-+ summary="display primaries of green, high 16bits for x, and low 16bits for y"/>
-+ <arg name="display_primaries_blue" type="uint"
-+ summary="display primaries of blue, high 16bits for x, and low 16bits for y"/>
-+ <arg name="white_point" type="uint"
-+ summary="white point, high 16bits for x, and low 16bits for blue"/>
-+ <arg name="mastering_display_luminance" type="uint"
-+ summary="max and min mastering display luminance, high 16 bits for max, and low 16 bits for min"/>
-+ <arg name="max_cll" type="uint" summary="max content light level"/>
-+ <arg name="max_fall" type="uint" summary="max frame average light level"/>
-+ </request>
-+ </interface>
-+
-+</protocol>
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols_1.13.imx.bb b/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols_1.18.imx.bb
index 9e087432..7f15bdb3 100644
--- a/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols_1.13.imx.bb
+++ b/bsp/meta-freescale/recipes-graphics/wayland/wayland-protocols_1.18.imx.bb
@@ -9,13 +9,9 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \
file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53"
-ARCHIVE_NAME = "${BPN}-1.13"
-SRC_URI = "https://wayland.freedesktop.org/releases/${ARCHIVE_NAME}.tar.xz \
- file://0001-unstable-Add-alpha-compositing-protocol.patch \
- file://0002-unstable-Add-hdr10-metadata-protocol.patch"
-SRC_URI[md5sum] = "29312149dafcd4a0e739ba94995a574d"
-SRC_URI[sha256sum] = "0758bc8008d5332f431b2a84fea7de64d971ce270ed208206a098ff2ebc68f38"
-S = "${WORKDIR}/${ARCHIVE_NAME}"
+SRC_URI = "git://source.codeaurora.org/external/imx/wayland-protocols-imx.git;protocol=https;branch=wayland-protocols-imx-1.18"
+SRCREV = "ee18c1f66877f7fb652467c349108395c20d4f9a"
+S = "${WORKDIR}/git"
inherit autotools pkgconfig
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston-init.bbappend b/bsp/meta-freescale/recipes-graphics/wayland/weston-init.bbappend
index 76aadf94..ba68761f 100644
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston-init.bbappend
+++ b/bsp/meta-freescale/recipes-graphics/wayland/weston-init.bbappend
@@ -6,20 +6,39 @@ IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu2d = "opengl"
IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu3d = ""
REQUIRED_DISTRO_FEATURES_remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}"
-SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd wayland x11', 'file://weston.config', '', d)}"
+SRC_URI_append_mx6sl = " file://weston.config"
-HAS_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
-HAS_XWAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland x11', 'true', 'false', d)}"
+# To customize weston.ini, start by setting the desired assignment in weston.ini,
+# commented out. For example:
+# #xwayland=true
+# Then add the assignment to INI_UNCOMMENT_ASSIGNMENTS.
+INI_UNCOMMENT_ASSIGNMENTS_append_imx = " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland=true', '', d)} \
+"
+INI_UNCOMMENT_ASSIGNMENTS_append_mx7ulp = " \
+ use-g2d=1 \
+"
+INI_UNCOMMENT_ASSIGNMENTS_append_mx8mm = " \
+ use-g2d=1 \
+"
+INI_UNCOMMENT_ASSIGNMENTS_append_mx8mq = " \
+ gbm-format=argb8888 \
+ \\[shell\\] \
+ size=1920x1080 \
+"
+
+uncomment() {
+ if ! (grep "^#$1" $2); then
+ bbfatal "Commented setting '#$1' not found in file $2"
+ fi
+ sed -i -e 's,^#'"$1"','"$1"',g' $2
+}
do_install_append() {
- if ${HAS_SYSTEMD}; then
- sed -i \
- -e 's,/usr/bin,${bindir},g' \
- -e 's,/etc,${sysconfdir},g' \
- -e 's,/var,${localstatedir},g' \
- ${D}${systemd_system_unitdir}/weston.service
- if ${HAS_XWAYLAND}; then
- install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston
- fi
+ if [ -f "${WORKDIR}/weston.config" ]; then
+ install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston
fi
+ for assignment in ${INI_UNCOMMENT_ASSIGNMENTS}; do
+ uncomment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini
+ done
}
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/imxdrm/weston.config b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/imxdrm/weston.config
deleted file mode 100644
index 5693d6cb..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/imxdrm/weston.config
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-OPTARGS="--xwayland"
-DESKTOP_SHELL_WINDOW=1920x1080
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/mx6sl/weston.config b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/mx6sl/weston.config
new file mode 100755
index 00000000..6456cd24
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/mx6sl/weston.config
@@ -0,0 +1 @@
+FB_MULTI_BUFFER=1
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/mx8mm/weston.config b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/mx8mm/weston.config
deleted file mode 100644
index eb990e40..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/mx8mm/weston.config
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-OPTARGS="--xwayland --use-g2d=1"
-DESKTOP_SHELL_WINDOW=1920x1080
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.config b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.config
deleted file mode 100644
index 7c92cf11..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.config
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-OPTARGS="--xwayland"
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.ini b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.ini
new file mode 100644
index 00000000..d9094b1f
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.ini
@@ -0,0 +1,25 @@
+[core]
+#gbm-format=argb8888
+idle-time=0
+#use-g2d=1
+#xwayland=true
+
+#[shell]
+#size=1920x1080
+
+#[output]
+#name=HDMI-A-1
+#mode=1920x1080@60
+#transform=90
+
+#[output]
+#name=HDMI-A-2
+#mode=off
+# WIDTHxHEIGHT Resolution size width and height in pixels
+# off Disables the output
+# preferred Uses the preferred mode
+# current Uses the current crt controller mode
+#transform=90
+
+[screen-share]
+command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.service b/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.service
deleted file mode 100644
index 44c5a82f..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston-init/weston.service
+++ /dev/null
@@ -1,38 +0,0 @@
-[Unit]
-Description=Weston Wayland Compositor (on tty7)
-RequiresMountsFor=/run
-Conflicts=getty@tty7.service plymouth-quit.service
-After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service
-
-[Service]
-User=root
-PermissionsStartOnly=true
-
-# Log us in via PAM so we get our XDG & co. environment and
-# are treated as logged in so we can use the tty:
-PAMName=login
-
-# Grab tty7
-UtmpIdentifier=tty7
-TTYPath=/dev/tty7
-TTYReset=yes
-TTYVHangup=yes
-TTYVTDisallocate=yes
-
-# stderr to journal so our logging doesn't get thrown into /dev/null
-StandardOutput=tty
-StandardInput=tty
-StandardError=journal
-
-EnvironmentFile=-/etc/default/weston
-
-# Weston does not successfully change VT, nor does systemd place us on
-# the VT it just activated for us. Switch manually:
-ExecStartPre=/usr/bin/chvt 7
-ExecStart=/usr/bin/weston-launch -- --log=/var/log/weston.log $OPTARGS
-
-IgnoreSIGPIPE=no
-
-[Install]
-WantedBy=multi-user.target
-
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-g2d-renderer-Fix-open-function-build-break.patch b/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-g2d-renderer-Fix-open-function-build-break.patch
deleted file mode 100644
index 6f676048..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-g2d-renderer-Fix-open-function-build-break.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7857e5aa2459b2746e062ae59ae0240c4af7af5d Mon Sep 17 00:00:00 2001
-From: Tom Hochstein <tom.hochstein@nxp.com>
-Date: Mon, 29 Oct 2018 21:40:32 +0000
-Subject: [PATCH] g2d-renderer: Fix open function build break
-
-| from ../git/libweston/g2d-renderer.c:40:
-| In function 'open',
-| inlined from 'g2d_renderer_create' at ../git/libweston/g2d-renderer.c:1629:2:
-| /home/r60874/upstream/fsl-xwayland/tmp/work/cortexa9t2hf-neon-mx6qdl-fsl-linux-gnueabi/weston/4.0.0.imx-r0/recipe- sysroot/usr/include/bits/fcntl2.h:50:4: error: call to '__open_missing_mode' declared with attribute error: open wit h O_CREAT or O_TMPFILE in second argument needs 3 arguments
-| __open_missing_mode ();
-| ^~~~~~~~~~~~~~~~~~~~~~
-| Makefile:5266: recipe for target 'libweston/g2d_renderer_la-g2d-renderer.lo' failed
-
-Upstream-Status: Inappropriate [i.MX-specific]
-
-Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
----
- libweston/g2d-renderer.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: git/libweston/g2d-renderer.c
-===================================================================
---- git.orig/libweston/g2d-renderer.c
-+++ git/libweston/g2d-renderer.c
-@@ -1626,7 +1626,7 @@ g2d_renderer_create(struct weston_compos
- path = malloc(strlen(dir) + 40);
- strcpy(path, dir);
- strcat(path, "/use-g2d-renderer");
-- close(open(path, O_CREAT | O_RDWR));
-+ close(open(path, O_CREAT | O_RDWR, 0600));
- free(path);
-
- return 0;
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-make-error-portable.patch
deleted file mode 100644
index 09ec1559..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-make-error-portable.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From ad1d2161c811cff25d1684c33611f300adb753bc Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 29 May 2015 20:56:00 -0700
-Subject: [PATCH] make error() portable
-
-error() is not posix but gnu extension so may not be available on all
-kind of systemsi e.g. musl.
-
-Upstream-Status: Submitted
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
- configure.ac | 2 ++
- libweston/weston-error.h | 20 ++++++++++++++++++++
- libweston/weston-launch.c | 2 +-
- 3 files changed, 23 insertions(+), 1 deletion(-)
- create mode 100644 libweston/weston-error.h
-
-diff --git a/configure.ac b/configure.ac
-index 7aebbdb..dc9c802 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -109,6 +109,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
- [[#include <time.h>]])
- AC_CHECK_HEADERS([execinfo.h])
-
-+AC_CHECK_HEADERS([error.h])
-+
- AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
-
- # check for libdrm as a build-time dependency only
-diff --git a/libweston/weston-error.h b/libweston/weston-error.h
-new file mode 100644
-index 0000000..2089d02
---- /dev/null
-+++ b/libweston/weston-error.h
-@@ -0,0 +1,20 @@
-+#ifndef _WESTON_ERROR_H
-+#define _WESTON_ERROR_H
-+
-+#if defined(HAVE_ERROR_H)
-+#include <error.h>
-+#else
-+#include <err.h>
-+#include <string.h>
-+#define _weston_error(S, E, F, ...) do { \
-+ if (E) \
-+ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \
-+ else \
-+ err(S, F, ##__VA_ARGS__); \
-+} while(0)
-+
-+#define error _weston_error
-+#endif
-+
-+#endif
-+
-diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
-index 1adcf21..166bf3b 100644
---- a/libweston/weston-launch.c
-+++ b/libweston/weston-launch.c
-@@ -33,7 +33,6 @@
- #include <poll.h>
- #include <errno.h>
-
--#include <error.h>
- #include <getopt.h>
-
- #include <sys/types.h>
-@@ -59,6 +58,7 @@
- #endif
-
- #include "weston-launch.h"
-+#include "weston-error.h"
-
- #define DRM_MAJOR 226
-
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
index d648538b..62b864c1 100644
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
+++ b/bsp/meta-freescale/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
@@ -1,7 +1,8 @@
-From b98b9dbda902225cdd972b5bff6a641c36cc7e90 Mon Sep 17 00:00:00 2001
+From 5f2d71998eb77068cbaee2d468cbb296a42d5739 Mon Sep 17 00:00:00 2001
From: Tom Hochstein <tom.hochstein@nxp.com>
Date: Wed, 22 Feb 2017 15:53:30 +0200
-Subject: [PATCH] weston-launch: Provide a default version that doesn't require PAM
+Subject: [PATCH] weston-launch: Provide a default version that doesn't require
+ PAM
weston-launch requires PAM for starting weston as a non-root user.
@@ -14,46 +15,49 @@ Upstream-Status: Pending
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+Signed-off-by: Ming Liu <ming.liu@toradex.com>
---
- configure.ac | 9 +++++++--
- libweston/weston-launch.c | 20 ++++++++++++++++++++
- 2 files changed, 27 insertions(+), 2 deletions(-)
+ libweston/meson.build | 16 ++++++++++++----
+ libweston/weston-launch.c | 21 +++++++++++++++++++++
+ meson_options.txt | 7 +++++++
+ 3 files changed, 40 insertions(+), 4 deletions(-)
-diff --git a/configure.ac b/configure.ac
-index dc9c802..48cf5cb 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -451,13 +451,17 @@ AC_ARG_ENABLE(resize-optimization,
- AS_IF([test "x$enable_resize_optimization" = "xyes"],
- [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
-
-+AC_ARG_WITH(pam,
-+ AS_HELP_STRING([--with-pam], [Use PAM]),
-+ [use_pam=$withval], [use_pam=yes])
- AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
- AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
--if test x$enable_weston_launch = xyes; then
-+if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then
- WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
- if test x$have_pam = xno; then
-- AC_ERROR([weston-launch requires pam])
-+ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found])
- fi
-+ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available])
- fi
-
- AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
-@@ -702,6 +706,7 @@ AC_MSG_RESULT([
- Enable developer documentation ${enable_devdocs}
-
- weston-launch utility ${enable_weston_launch}
-+ PAM support ${use_pam}
- systemd-login support ${have_systemd_login}
- systemd notify support ${enable_systemd_notify}
-
+diff --git a/libweston/meson.build b/libweston/meson.build
+index 08d23ec..cb9fd3f 100644
+--- a/libweston/meson.build
++++ b/libweston/meson.build
+@@ -216,16 +216,24 @@ dep_vertex_clipping = declare_dependency(
+ )
+
+ if get_option('weston-launch')
+- dep_pam = cc.find_library('pam')
++ deps_weston_launch = [systemd_dep, dep_libdrm]
+
+- if not cc.has_function('pam_open_session', dependencies: dep_pam)
+- error('pam_open_session not found for weston-launch')
++ if get_option('pam')
++ dep_pam = cc.find_library('pam')
++ if not cc.has_function('pam_open_session', dependencies: dep_pam)
++ error('pam_open_session not found for weston-launch')
++ endif
++
++ if dep_pam.found()
++ deps_weston_launch += dep_pam
++ config_h.set('HAVE_PAM', '1')
++ endif
+ endif
+
+ executable(
+ 'weston-launch',
+ 'weston-launch.c',
+- dependencies: [dep_pam, systemd_dep, dep_libdrm],
++ dependencies: deps_weston_launch,
+ include_directories: common_inc,
+ install: true
+ )
diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
-index 166bf3b..6fb9232 100644
+index 8a711b4..54c567a 100644
--- a/libweston/weston-launch.c
+++ b/libweston/weston-launch.c
@@ -51,7 +51,9 @@
@@ -66,7 +70,7 @@ index 166bf3b..6fb9232 100644
#ifdef HAVE_SYSTEMD_LOGIN
#include <systemd/sd-login.h>
-@@ -101,8 +103,10 @@ drmSetMaster(int drm_fd)
+@@ -100,8 +102,10 @@ drmSetMaster(int drm_fd)
#endif
struct weston_launch {
@@ -77,7 +81,7 @@ index 166bf3b..6fb9232 100644
int tty;
int ttynr;
int sock[2];
-@@ -189,6 +193,7 @@ weston_launch_allowed(struct weston_launch *wl)
+@@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl)
return false;
}
@@ -85,7 +89,7 @@ index 166bf3b..6fb9232 100644
static int
pam_conversation_fn(int msg_count,
const struct pam_message **messages,
-@@ -229,6 +234,7 @@ setup_pam(struct weston_launch *wl)
+@@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl)
return 0;
}
@@ -93,7 +97,7 @@ index 166bf3b..6fb9232 100644
static int
setup_launcher_socket(struct weston_launch *wl)
-@@ -422,6 +428,7 @@ quit(struct weston_launch *wl, int status)
+@@ -431,6 +437,7 @@ quit(struct weston_launch *wl, int status)
close(wl->signalfd);
close(wl->sock[0]);
@@ -101,7 +105,7 @@ index 166bf3b..6fb9232 100644
if (wl->new_user) {
err = pam_close_session(wl->ph, 0);
if (err)
-@@ -429,6 +436,7 @@ quit(struct weston_launch *wl, int status)
+@@ -438,6 +445,7 @@ quit(struct weston_launch *wl, int status)
err, pam_strerror(wl->ph, err));
pam_end(wl->ph, err);
}
@@ -109,7 +113,7 @@ index 166bf3b..6fb9232 100644
if (ioctl(wl->tty, KDSKBMUTE, 0) &&
ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
-@@ -608,6 +616,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
+@@ -666,6 +674,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
setenv("HOME", wl->pw->pw_dir, 1);
setenv("SHELL", wl->pw->pw_shell, 1);
@@ -117,7 +121,7 @@ index 166bf3b..6fb9232 100644
env = pam_getenvlist(wl->ph);
if (env) {
for (i = 0; env[i]; ++i) {
-@@ -616,6 +625,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
+@@ -674,6 +683,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
}
free(env);
}
@@ -125,7 +129,7 @@ index 166bf3b..6fb9232 100644
/*
* We open a new session, so it makes sense
-@@ -683,8 +693,10 @@ static void
+@@ -745,8 +755,10 @@ static void
help(const char *name)
{
fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
@@ -136,7 +140,7 @@ index 166bf3b..6fb9232 100644
fprintf(stderr, " -t, --tty Start session on alternative tty,\n"
" e.g. -t /dev/tty4, requires -u option.\n");
fprintf(stderr, " -v, --verbose Be verbose\n");
-@@ -698,7 +710,9 @@ main(int argc, char *argv[])
+@@ -760,7 +772,9 @@ main(int argc, char *argv[])
int i, c;
char *tty = NULL;
struct option opts[] = {
@@ -146,21 +150,24 @@ index 166bf3b..6fb9232 100644
{ "tty", required_argument, NULL, 't' },
{ "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
-@@ -710,9 +724,13 @@ main(int argc, char *argv[])
+@@ -772,11 +786,16 @@ main(int argc, char *argv[])
while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) {
switch (c) {
case 'u':
+#ifdef HAVE_PAM
wl.new_user = optarg;
- if (getuid() != 0)
- error(1, 0, "Permission denied. -u allowed for root only");
+ if (getuid() != 0) {
+ fprintf(stderr, "weston: Permission denied. -u allowed for root only\n");
+ exit(EXIT_FAILURE);
+ }
+#else
-+ error(1, 0, "-u is unsupported in this weston-launch build");
++ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n");
++ exit(EXIT_FAILURE);
+#endif
break;
case 't':
tty = optarg;
-@@ -753,8 +771,10 @@ main(int argc, char *argv[])
+@@ -828,8 +847,10 @@ main(int argc, char *argv[])
if (setup_tty(&wl, tty) < 0)
exit(EXIT_FAILURE);
@@ -171,3 +178,21 @@ index 166bf3b..6fb9232 100644
if (setup_launcher_socket(&wl) < 0)
exit(EXIT_FAILURE);
+diff --git a/meson_options.txt b/meson_options.txt
+index c862ecc..73ef2c3 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -73,6 +73,13 @@ option(
+ )
+
+ option(
++ 'pam',
++ type: 'boolean',
++ value: true,
++ description: 'Define if PAM is available'
++)
++
++option(
+ 'xwayland',
+ type: 'boolean',
+ value: true,
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston/imx/weston.ini b/bsp/meta-freescale/recipes-graphics/wayland/weston/imx/weston.ini
deleted file mode 100644
index d6ad40df..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston/imx/weston.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-[core]
-# i.MX: Disable idle timeout
-idle-time=0
-
-#[output]
-#name=HDMI-A-1
-#mode=1920x1080@60
-#transform=90
-
-#[output]
-#name=HDMI-A-2
-#mode=off
-# WIDTHxHEIGHT Resolution size width and height in pixels
-# off Disables the output
-# preferred Uses the preferred mode
-# current Uses the current crt controller mode
-#transform=90
-
-[screen-share]
-command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston/mx8mq/weston.ini b/bsp/meta-freescale/recipes-graphics/wayland/weston/mx8mq/weston.ini
deleted file mode 100644
index d1597a42..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston/mx8mq/weston.ini
+++ /dev/null
@@ -1,24 +0,0 @@
-[core]
-# i.MX: Disable idle timeout
-idle-time=0
-gbm-format=argb8888
-
-#[output]
-#name=HDMI-A-1
-#mode=1920x1080@60
-#transform=90
-
-[shell]
-size=1920x1080
-
-#[output]
-#name=HDMI-A-2
-#mode=off
-# WIDTHxHEIGHT Resolution size width and height in pixels
-# off Disables the output
-# preferred Uses the preferred mode
-# current Uses the current crt controller mode
-#transform=90
-
-[screen-share]
-command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston_4.0.0.imx.bb b/bsp/meta-freescale/recipes-graphics/wayland/weston_4.0.0.imx.bb
deleted file mode 100644
index e8d74fd4..00000000
--- a/bsp/meta-freescale/recipes-graphics/wayland/weston_4.0.0.imx.bb
+++ /dev/null
@@ -1,144 +0,0 @@
-SUMMARY = "Weston, a Wayland compositor, i.MX fork"
-DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
-HOMEPAGE = "http://wayland.freedesktop.org"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
- file://libweston/compositor.c;endline=26;md5=e342df749174a8ee11065583157c7a38"
-
-DEFAULT_PREFERENCE = "-1"
-
-SRCBRANCH = "weston-imx-4.0"
-SRC_URI = "git://source.codeaurora.org/external/imx/weston-imx.git;protocol=https;branch=${SRCBRANCH} \
- file://weston.ini \
- file://weston.png \
- file://weston.desktop \
- file://0001-make-error-portable.patch \
- file://xwayland.weston-start \
- file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
- file://0001-g2d-renderer-Fix-open-function-build-break.patch \
-"
-SRCREV = "866072b52751e5023651dd9322baa513e1f74fe6"
-S = "${WORKDIR}/git"
-
-UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
-
-inherit autotools pkgconfig useradd distro_features_check
-
-# Disable OpenGL for parts with GPU support for 2D but not 3D
-REQUIRED_DISTRO_FEATURES = "opengl"
-REQUIRED_DISTRO_FEATURES_imxgpu2d = ""
-REQUIRED_DISTRO_FEATURES_imxgpu3d = "opengl"
-PACKAGECONFIG_OPENGL = "opengl"
-PACKAGECONFIG_OPENGL_imxgpu2d = ""
-PACKAGECONFIG_OPENGL_imxgpu3d = "opengl"
-
-DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
-DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
-
-WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
-
-EXTRA_OECONF = "--enable-setuid-install \
- --disable-rdp-compositor \
- "
-EXTRA_OECONF_append_qemux86 = " \
- WESTON_NATIVE_BACKEND=fbdev-backend.so \
- "
-EXTRA_OECONF_append_qemux86-64 = " \
- WESTON_NATIVE_BACKEND=fbdev-backend.so \
- "
-EXTRA_OECONF_append_imxfbdev = " \
- WESTON_NATIVE_BACKEND=fbdev-backend.so \
- "
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
- ${@bb.utils.filter('DISTRO_FEATURES', '${PACKAGECONFIG_OPENGL} pam systemd x11', d)} \
- clients launch"
-PACKAGECONFIG_remove_imxfbdev = "kms"
-PACKAGECONFIG_append_imxgpu = " imxgpu"
-PACKAGECONFIG_append_imxgpu2d = " imxg2d"
-PACKAGECONFIG_append_imxgpu3d = " cairo-glesv2"
-#
-# Compositor choices
-#
-# Weston on KMS
-PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
-# Weston on Wayland (nested Weston)
-PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
-# Weston on X11
-PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
-# Headless Weston
-PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
-# Weston on framebuffer
-PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
-# weston-launch
-PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
-# VA-API desktop recorder
-PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
-# Weston with EGL support
-PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
-# Weston with cairo glesv2 support
-PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
-# Weston with lcms support
-PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
-# Weston with webp support
-PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp"
-# Weston with systemd-login support
-PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
-# Weston with Xwayland support (requires X11 and Wayland)
-PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland"
-# colord CMS support
-PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
-# Clients support
-PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients"
-# Weston with PAM support
-PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
-# Weston with i.MX GPU support
-PACKAGECONFIG[imxgpu] = "--enable-imxgpu,--disable-imxgpu"
-# Weston with i.MX G2D renderer
-PACKAGECONFIG[imxg2d] = "--enable-imxg2d,--disable-imxg2d,virtual/libg2d"
-# Weston with OpenGL support
-PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl"
-
-do_install_append() {
- # Weston doesn't need the .la files to load modules, so wipe them
- rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la
-
- # If X11, ship a desktop file to launch it
- if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
- install -d ${D}${datadir}/applications
- install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
-
- install -d ${D}${datadir}/icons/hicolor/48x48/apps
- install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
- fi
-
- if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
- install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
- fi
-
- # install default weston.ini
- install -D -m 0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
-}
-
-PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
- libweston-${WESTON_MAJOR_VERSION} ${PN}-examples"
-
-FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir} ${sysconfdir}/xdg/weston"
-
-FILES_libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so"
-SUMMARY_libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'."
-
-FILES_${PN}-examples = "${bindir}/*"
-
-FILES_${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so"
-RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
-
-RDEPENDS_${PN} += "xkeyboard-config"
-RRECOMMENDS_${PN} = "liberation-fonts"
-RRECOMMENDS_${PN}-dev += "wayland-protocols"
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system weston-launch"
-
-PACKAGE_ARCH = "${MACHINE_SOCARCH}"
-COMPATIBLE_MACHINE = "(imxfbdev|imxgpu)"
diff --git a/bsp/meta-freescale/recipes-graphics/wayland/weston_8.0.0.imx.bb b/bsp/meta-freescale/recipes-graphics/wayland/weston_8.0.0.imx.bb
new file mode 100644
index 00000000..a021a54d
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/wayland/weston_8.0.0.imx.bb
@@ -0,0 +1,168 @@
+# This recipe is for the i.MX fork of weston. For ease of
+# maintenance, the top section is a verbatim copy of an OE-core
+# recipe. The second section customizes the recipe for i.MX.
+
+########### OE-core copy ##################
+# Upstream hash: 9b1d30810eeecb46b977c8eed68be69aef891312
+
+SUMMARY = "Weston, a Wayland compositor"
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
+ file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a"
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ file://weston.png \
+ file://weston.desktop \
+ file://xwayland.weston-start \
+ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
+"
+SRC_URI[md5sum] = "53e4810d852df0601d01fd986a5b22b3"
+SRC_URI[sha256sum] = "7518b49b2eaa1c3091f24671bdcc124fd49fc8f1af51161927afa4329c027848"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+
+inherit meson pkgconfig useradd features_check
+# depends on virtual/egl
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
+DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
+
+WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
+
+EXTRA_OEMESON += "-Dbackend-default=auto -Dbackend-rdp=false -Dpipewire=false"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl clients', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
+ ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \
+ launch"
+#
+# Compositor choices
+#
+# Weston on KMS
+PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev"
+# Weston on Wayland (nested Weston)
+PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/egl virtual/libgles2"
+# Weston on X11
+PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo"
+# Headless Weston
+PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false"
+# Weston on framebuffer
+PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev"
+# weston-launch
+PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm"
+# VA-API desktop recorder
+PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva"
+# Weston with EGL support
+PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl"
+# Weston with lcms support
+PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms"
+# Weston with webp support
+PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp"
+# Weston with systemd-login support
+PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus"
+# Weston with Xwayland support (requires X11 and Wayland)
+PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false"
+# colord CMS support
+PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-colord=false,colord"
+# Clients support
+PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false"
+# Virtual remote output with GStreamer on DRM backend
+PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer-1.0"
+# Weston with PAM support
+PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam"
+
+do_install_append() {
+ # Weston doesn't need the .la files to load modules, so wipe them
+ rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la
+
+ # If X11, ship a desktop file to launch it
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
+ install -d ${D}${datadir}/applications
+ install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
+
+ install -d ${D}${datadir}/icons/hicolor/48x48/apps
+ install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
+ install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then
+ chmod u+s ${D}${bindir}/weston-launch
+ fi
+}
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
+ libweston-${WESTON_MAJOR_VERSION} ${PN}-examples"
+
+FILES_${PN}-dev += "${libdir}/${BPN}/libexec_weston.so"
+FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}"
+
+FILES_libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so"
+SUMMARY_libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'."
+
+FILES_${PN}-examples = "${bindir}/*"
+
+FILES_${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so"
+RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
+
+RDEPENDS_${PN} += "xkeyboard-config"
+RRECOMMENDS_${PN} = "weston-init liberation-fonts"
+RRECOMMENDS_${PN}-dev += "wayland-protocols"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system weston-launch"
+
+########### End of OE-core copy ###########
+
+########### i.MX overrides ################
+
+SUMMARY = "Weston, a Wayland compositor, i.MX fork"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRCBRANCH = "weston-imx-8.0"
+SRC_URI = "git://source.codeaurora.org/external/imx/weston-imx.git;protocol=https;branch=${SRCBRANCH} \
+ file://weston.png \
+ file://weston.desktop \
+ file://xwayland.weston-start \
+ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
+"
+SRCREV = "f6a7d35650121fbe7c20d4cbe0eaac730fab3b2a"
+S = "${WORKDIR}/git"
+
+# Disable OpenGL for parts with GPU support for 2D but not 3D
+REQUIRED_DISTRO_FEATURES = "opengl"
+REQUIRED_DISTRO_FEATURES_imxgpu2d = ""
+REQUIRED_DISTRO_FEATURES_imxgpu3d = "opengl"
+PACKAGECONFIG_OPENGL = "opengl"
+PACKAGECONFIG_OPENGL_imxgpu2d = ""
+PACKAGECONFIG_OPENGL_imxgpu3d = "opengl"
+
+PACKAGECONFIG_append = " ${@bb.utils.filter('DISTRO_FEATURES', '${PACKAGECONFIG_OPENGL}', d)}"
+
+PACKAGECONFIG_remove_imxfbdev = "kms"
+PACKAGECONFIG_append_imxfbdev = " fbdev clients"
+PACKAGECONFIG_append_imxgpu = " imxgpu"
+PACKAGECONFIG_append_imxgpu2d = " imxg2d"
+
+# Clients support
+SIMPLE_CLIENTS = "all"
+SIMPLE_CLIENTS_imxfbdev = "damage,im,egl,shm,touch,dmabuf-v4l"
+PACKAGECONFIG[clients] = "-Dsimple-clients=${SIMPLE_CLIENTS} -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false"
+# Weston with i.MX GPU support
+PACKAGECONFIG[imxgpu] = "-Dimxgpu=true,-Dimxgpu=false,virtual/egl"
+# Weston with i.MX G2D renderer
+PACKAGECONFIG[imxg2d] = "-Drenderer-g2d=true,-Drenderer-g2d=false,virtual/libg2d"
+# Weston with OpenGL support
+PACKAGECONFIG[opengl] = "-Dopengl=true,-Dopengl=false"
+
+PACKAGE_ARCH = "${MACHINE_SOCARCH}"
+COMPATIBLE_MACHINE = "(imxfbdev|imxgpu)"
+
+########### End of i.MX overrides #########
diff --git a/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-armada_git.bb b/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-armada_git.bb
index 30372eff..0aba8e5a 100644
--- a/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-armada_git.bb
+++ b/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-armada_git.bb
@@ -45,4 +45,4 @@ EXTRA_OECONF = "--disable-etnaviv \
--with-etnaviv-source=${WORKDIR}/etna_viv \
"
-COMPATIBLE_MACHINE = "(imx)"
+COMPATIBLE_MACHINE = "(imx|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb b/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb
deleted file mode 100644
index 996a9c7f..00000000
--- a/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require recipes-graphics/xorg-driver/xorg-driver-video.inc
-LIC_FILES_CHKSUM = "file://COPYING;md5=d8cbd99fff773f92e844948f74ef0df8"
-
-DESCRIPTION = "X.Org X server -- fbdev display driver"
-PE = "1"
-PR = "${INC_PR}.1"
-
-DEPENDS += "virtual/xserver"
-
-SRC_URI[md5sum] = "53a533d9e0c2da50962282526bace074"
-SRC_URI[sha256sum] = "93b271b4b41d7e5ca108849a583b9523e96c51813d046282285355b7001f82d5"
diff --git a/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-imx-vivante_6.2.4.p1.8.bb b/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-imx-vivante_6.4.0.p0.0.bb
index 670ade64..9268b11e 100644
--- a/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-imx-vivante_6.2.4.p1.8.bb
+++ b/bsp/meta-freescale/recipes-graphics/xorg-driver/xf86-video-imx-vivante_6.4.0.p0.0.bb
@@ -13,7 +13,7 @@ DEPENDS += "virtual/xserver virtual/libx11 libgal-imx imx-gpu-viv virtual/libg2d
LIC_FILES_CHKSUM = "file://COPYING-MIT;md5=b5e9d9f5c02ea831ab3ecf802bb7c4f3"
-SRCREV = "b765c3ffc0dcc4246afa659aa0d59f78a6736b08"
+SRCREV = "c828e8a7c38743e960967e7bb78c134cec31c102"
SRCBRANCH = "imx_exa_viv6_g2d"
SRC_URI = "git://source.codeaurora.org/external/imx/xf86-video-imx-vivante.git;protocol=https;branch=${SRCBRANCH} \
file://rc.autohdmi"
diff --git a/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xf86-config/mx6ull/xorg.conf b/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xf86-config/mx6ull/xorg.conf
new file mode 100644
index 00000000..79b6c0fc
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xf86-config/mx6ull/xorg.conf
@@ -0,0 +1,12 @@
+Section "Device"
+ Identifier "Kernel Framebuffer Device"
+ Driver "fbdev"
+ Option "fbdev" "/dev/fb0"
+EndSection
+
+Section "ServerFlags"
+ Option "BlankTime" "0"
+ Option "StandbyTime" "0"
+ Option "SuspendTime" "0"
+ Option "OffTime" "0"
+EndSection
diff --git a/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch b/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
new file mode 100644
index 00000000..beed6cb4
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
@@ -0,0 +1,47 @@
+From cf407b16cd65ad6e26a9c8e5984e163409a5c0f7 Mon Sep 17 00:00:00 2001
+From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+Date: Mon, 30 Jan 2017 16:32:06 -0600
+Subject: [PATCH] Remove check for useSIGIO option
+
+Commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 removes the configure of useSIGIO
+option.
+
+As the xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO
+and OsReleaseSIGIO.
+
+No longer the check for useSIGIO is needed
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+---
+ hw/xfree86/os-support/shared/sigio.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
+index 884a71c..be76498 100644
+--- a/hw/xfree86/os-support/shared/sigio.c
++++ b/hw/xfree86/os-support/shared/sigio.c
+@@ -185,9 +185,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
+ int i;
+ int installed = FALSE;
+
+- if (!xf86Info.useSIGIO)
+- return 0;
+-
+ for (i = 0; i < MAX_FUNCS; i++) {
+ if (!xf86SigIOFuncs[i].f) {
+ if (xf86IsPipe(fd))
+@@ -256,9 +253,6 @@ xf86RemoveSIGIOHandler(int fd)
+ int max;
+ int ret;
+
+- if (!xf86Info.useSIGIO)
+- return 0;
+-
+ max = 0;
+ ret = 0;
+ for (i = 0; i < MAX_FUNCS; i++) {
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
index e3c59040..84b69075 100644
--- a/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
+++ b/bsp/meta-freescale/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
@@ -3,3 +3,6 @@ IMX_OPENGL_PKGCONFIGS_REMOVE_imxgpu = "glamor"
OPENGL_PKGCONFIGS_remove_mx6 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}"
OPENGL_PKGCONFIGS_remove_mx7 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}"
OPENGL_PKGCONFIGS_remove_mx8 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+SRC_URI_append_imxgpu2d = " file://0003-Remove-check-for-useSIGIO-option.patch"
diff --git a/bsp/meta-freescale/recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch b/bsp/meta-freescale/recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch
new file mode 100644
index 00000000..13697886
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/ceetm/ceetm/0001-Makefile-update-CFLAGS.patch
@@ -0,0 +1,31 @@
+From fb1fe93a2bab083652a65804be5ddd37a7e86a9f Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Wed, 14 Aug 2019 04:05:14 +0200
+Subject: [PATCH] Makefile: update CFLAGS
+
+*fix the below error:
+|error: json_print.h: No such file or directory
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: C.r. Guo <nxa13725@lsv07004.swis.us-cdc01.nxp.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index f89700c..49243d8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,7 +8,7 @@ LDFLAGS += -Wl,-export-dynamic
+ # if you are not using flex-builder. Download the iproute2 sources for the
+ # desired version and point to those instead.
+ ifneq ($(IPROUTE2_DIR),)
+-CFLAGS += -I$(IPROUTE2_DIR) -I$(IPROUTE2_DIR)/include
++CFLAGS += -I$(IPROUTE2_DIR) -I$(IPROUTE2_DIR)/include -I$(IPROUTE2_DIR)/usr/include/ -I$(IPROUTE2_DIR)/usr/include/include
+ endif
+
+ MODDESTDIR := $(DESTDIR)/usr/lib/tc
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-kernel/ceetm/ceetm_git.bb b/bsp/meta-freescale/recipes-kernel/ceetm/ceetm_git.bb
index 57fbbe42..68fb67e0 100644
--- a/bsp/meta-freescale/recipes-kernel/ceetm/ceetm_git.bb
+++ b/bsp/meta-freescale/recipes-kernel/ceetm/ceetm_git.bb
@@ -4,12 +4,17 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=bac620b9883d38a84dfb73ca7122d915"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/ceetm;nobranch=1"
SRCREV = "6a7f2ec2091df2f4380cb8d25a36c399aed5af1b"
-
+SRC_URI_append = " file://0001-Makefile-update-CFLAGS.patch \
+"
DEPENDS = "iproute2"
S = "${WORKDIR}/git"
-EXTRA_OEMAKE = 'CC="${CC}" LD="${CC}" IPROUTE2_DIR="{STAGING_DIR_TARGET}"'
+export IPROUTE2_DIR="${STAGING_DIR_TARGET}"
+WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
+export CROSS_COMPILE="${WRAP_TARGET_PREFIX}"
+
+LDFLAGS += "${TOOLCHAIN_OPTIONS}"
do_install(){
mkdir -p ${D}/${libdir}/tc
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-1.10.inc b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-1.10.inc
new file mode 100644
index 00000000..bb785831
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-1.10.inc
@@ -0,0 +1,21 @@
+HOMEPAGE = "http://cryptodev-linux.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+python() {
+ d.appendVar('PROVIDES', ' ' + d.getVar('BPN').replace('-qoriq', ''))
+ pkgs = d.getVar('PACKAGES').split()
+ for p in pkgs:
+ if '-qoriq' in p:
+ d.appendVar("RPROVIDES_" + p, ' ' + p.replace('-qoriq', ''))
+ d.appendVar("RCONFLICTS_" + p, ' ' + p.replace('-qoriq', ''))
+ d.appendVar("RREPLACES_" + p, ' ' + p.replace('-qoriq', ''))
+}
+
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/cryptodev-linux;protocol=https;nobranch=1"
+SRCREV = "f3007431120a1b4ae983c2b9ea09051311aa5e2f"
+
+S = "${WORKDIR}/git"
+
+CLEANBROKEN = "1"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.10.bb b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.10.bb
new file mode 100644
index 00000000..c2cbc71b
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.10.bb
@@ -0,0 +1,5 @@
+require recipes-kernel/cryptodev/cryptodev-linux_${PV}.bb
+require cryptodev-qoriq-${PV}.inc
+
+BBCLASSEXTEND = ""
+COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.9.bb b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.9.bb
deleted file mode 100644
index 58db5053..00000000
--- a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-linux_1.9.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-require cryptodev-qoriq_${PV}.inc
-
-SUMMARY = "A /dev/crypto device driver header file"
-
-PROVIDES = "cryptodev-linux"
-
-do_compile[noexec] = "1"
-
-# Just install cryptodev.h which is the only header file needed to be exported
-do_install() {
- install -D ${S}/crypto/cryptodev.h ${D}${includedir}/crypto/cryptodev.h
-}
-
-ALLOW_EMPTY_${PN} = "1"
-
-COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.10.bb b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.10.bb
new file mode 100644
index 00000000..86078c57
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.10.bb
@@ -0,0 +1,10 @@
+require recipes-kernel/cryptodev/cryptodev-module_${PV}.bb
+require cryptodev-qoriq-${PV}.inc
+
+inherit qoriq_build_64bit_kernel
+
+SRC_URI += " \
+file://0001-Disable-installing-header-file-provided-by-another-p.patch \
+"
+
+COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.9.bb b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.9.bb
deleted file mode 100644
index 412bb0e5..00000000
--- a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-module_1.9.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-require cryptodev-qoriq_${PV}.inc
-
-SUMMARY = "A /dev/crypto device driver kernel module"
-
-PROVIDES = "cryptodev-module"
-
-inherit module qoriq_build_64bit_kernel
-
-# Header file provided by a separate package
-DEPENDS += "cryptodev-linux"
-
-EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" DESTDIR="${D}"'
-
-SRC_URI_append = " \
-file://0001-Disable-installing-header-file-provided-by-another-p.patch \
-"
-
-RCONFLICTS_${PN} = "ocf-linux"
-RREPLACES_${PN} = "ocf-linux"
-
-COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.10.bb b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.10.bb
new file mode 100644
index 00000000..784c38b7
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.10.bb
@@ -0,0 +1,8 @@
+require recipes-kernel/cryptodev/cryptodev-tests_${PV}.bb
+require cryptodev-qoriq-${PV}.inc
+
+SRC_URI += " \
+file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \
+"
+
+COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.9.bb b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.9.bb
deleted file mode 100644
index f7d0b61b..00000000
--- a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq-tests_1.9.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require cryptodev-qoriq_${PV}.inc
-
-SUMMARY = "A test suite for /dev/crypto device driver"
-
-DEPENDS = "openssl"
-
-PROVIDES = "cryptodev-tests"
-
-EXTRA_OEMAKE='KERNEL_DIR="${STAGING_EXECPREFIXDIR}" DESTDIR="${D}"'
-
-SRC_URI_append = " \
-file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \
-"
-
-do_compile() {
- oe_runmake testprogs
-}
-
-do_install() {
- oe_runmake install_tests
-}
-
-FILES_${PN}-dbg += "${bindir}/tests_cryptodev/.debug"
-FILES_${PN} = "${bindir}/tests_cryptodev/*"
-
-COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq_1.9.inc b/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq_1.9.inc
deleted file mode 100644
index 0d7249fd..00000000
--- a/bsp/meta-freescale/recipes-kernel/cryptodev/cryptodev-qoriq_1.9.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-HOMEPAGE = "http://cryptodev-linux.org/"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-python() {
- pkgs = d.getVar('PACKAGES', True).split()
- for p in pkgs:
- if 'cryptodev-qoriq' in p:
- d.appendVar("RPROVIDES_%s" % p, p.replace('cryptodev-qoriq', 'cryptodev'))
- d.appendVar("RCONFLICTS_%s" % p, p.replace('cryptodev-qoriq', 'cryptodev'))
- d.appendVar("RREPLACES_%s" % p, p.replace('cryptodev-qoriq', 'cryptodev'))
-}
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/yocto_patches:"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/cryptodev-linux;nobranch=1"
-SRCREV = "479e6e7f071e252c0c37ea38d38fdb4cd808f496"
-
-# NOTE: remove this patch and all traces of DISTRO_FEATURE c29x_pkc
-# if pkc-host does not need customized cryptodev patches anymore
-#SRC_URI_append = "${@bb.utils.contains('DISTRO_FEATURES', 'c29x_pkc', ' file://0001-don-t-advertise-RSA-keygen.patch', '', d)}"
-
-S = "${WORKDIR}/git"
-
-CLEANBROKEN = "1"
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
new file mode 100644
index 00000000..84fd27e6
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
@@ -0,0 +1,66 @@
+From 1980a8f4779a955e73285e7a0d86549b69bea5c8 Mon Sep 17 00:00:00 2001
+From: Yu Zongchun <b40527@freescale.com>
+Date: Sun, 28 Apr 2013 14:39:22 +0800
+Subject: [PATCH] Add the compile and install rules for cryptodev tests folder
+
+This is required to install the cryptodev tests folder to rootfs
+
+Signed-off-by: Yu Zongchun <b40527@freescale.com>
+
+Upstream-Status: Pending
+
+---
+ Makefile | 6 ++++++
+ tests/Makefile | 8 ++++++++
+ 2 files changed, 14 insertions(+), 0 deletions(-)
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -35,6 +35,9 @@ modules_install:
+ $(MAKE) $(KERNEL_MAKE_OPTS) modules_install
+ install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h
+
++install_tests:
++ make -C tests install DESTDIR=$(PREFIX)
++
+ clean:
+ $(MAKE) $(KERNEL_MAKE_OPTS) clean
+ rm -f $(hostprogs) *~
+@@ -43,6 +46,9 @@ clean:
+ check:
+ CFLAGS=$(CRYPTODEV_CFLAGS) KERNEL_DIR=$(KERNEL_DIR) $(MAKE) -C tests check
+
++testprogs:
++ KERNEL_DIR=$(KERNEL_DIR) make -C tests testprogs
++
+ CPOPTS =
+ ifneq ($(SHOW_TYPES),)
+ CPOPTS += --show-types
+Index: git/tests/Makefile
+===================================================================
+--- git.orig/tests/Makefile
++++ git/tests/Makefile
+@@ -23,6 +23,12 @@ bindir = $(execprefix)/bin
+
+ all: $(hostprogs)
+
++install:
++ install -d $(DESTDIR)/usr/bin/tests_cryptodev
++ for bin in $(hostprogs); do \
++ install -m 755 $${bin} $(DESTDIR)/usr/bin/tests_cryptodev/; \
++ done
++
+ check: $(hostprogs)
+ ./cipher
+ ./hmac
+@@ -38,6 +44,8 @@ install:
+ install -m 755 $$prog $(DESTDIR)/$(bindir); \
+ done
+
++testprogs: $(hostprogs)
++
+ clean:
+ rm -f *.o *~ $(hostprogs)
+
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch b/bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
new file mode 100644
index 00000000..885b5823
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
@@ -0,0 +1,24 @@
+From 8a884f55bd1527baa82fab68c186ba546273860c Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Sun, 6 Apr 2014 19:51:39 -0400
+Subject: [PATCH] Disable installing header file provided by another package
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+
+Upstream-Status: Inappropriate [ OE specific ]
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 5a080e0..bf02396 100644
+--- a/Makefile
++++ b/Makefile
+@@ -33,7 +33,6 @@ install: modules_install
+
+ modules_install:
+ $(MAKE) $(KERNEL_MAKE_OPTS) modules_install
+- install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h
+
+ clean:
+ $(MAKE) $(KERNEL_MAKE_OPTS) clean
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
deleted file mode 100644
index 1e7f5843..00000000
--- a/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 03257bf2aff37b78496ccc1b58a87e7baaea042a Mon Sep 17 00:00:00 2001
-From: Cristian Stoica <cristian.stoica@nxp.com>
-Date: Mon, 22 Feb 2016 12:17:52 +0200
-Subject: [PATCH 2/2] Add the compile and install rules for cryptodev tests
-
-(original patch Signed-off-by: Yu Zongchun <b40527@freescale.com>)
-Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
-
-Upstream-Status: Inappropriate [ OE specific ]
----
- Makefile | 6 ++++++
- tests/Makefile | 4 ++--
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 06202bd..a598b12 100644
---- a/Makefile
-+++ b/Makefile
-@@ -42,6 +42,12 @@ clean:
- check:
- CFLAGS=$(CRYPTODEV_CFLAGS) KERNEL_DIR=$(KERNEL_DIR) $(MAKE) -C tests check
-
-+testprogs:
-+ KERNEL_DIR=$(KERNEL_DIR) $(MAKE) -C tests all
-+
-+install_tests:
-+ $(MAKE) -C tests install
-+
- CPOPTS =
- ifneq ($(SHOW_TYPES),)
- CPOPTS += --show-types
-diff --git a/tests/Makefile b/tests/Makefile
-index 5e3111d..cda971c 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -35,9 +35,9 @@ check: $(hostprogs)
- ./cipher-aead
-
- install:
-- install -d $(DESTDIR)/$(bindir)
-+ install -d $(DESTDIR)/$(bindir)/tests_cryptodev
- for prog in $(hostprogs); do \
-- install -m 755 $$prog $(DESTDIR)/$(bindir); \
-+ install -m 755 $$prog $(DESTDIR)/$(bindir)/tests_cryptodev/; \
- done
-
- clean:
---
-2.7.0
-
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Disable-installing-header-file-provided-by-another-p.patch b/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Disable-installing-header-file-provided-by-another-p.patch
deleted file mode 100644
index 35aad600..00000000
--- a/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0001-Disable-installing-header-file-provided-by-another-p.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From eedfa57953d2d6255d53cb098c3f81cbde9187f7 Mon Sep 17 00:00:00 2001
-From: Cristian Stoica <cristian.stoica@nxp.com>
-Date: Mon, 22 Feb 2016 11:47:27 +0200
-Subject: [PATCH 1/2] Disable installing header file provided by another
- package
-
-(original patch Signed-off-by: Denys Dmytriyenko <denys@ti.com>)
-Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
-
-Upstream-Status: Inappropriate [ OE specific ]
-
-
---- a/Makefileold 2017-04-18 14:54:40.588438842 +0800
-+++ b/Makefile 2017-04-18 14:55:40.308436774 +0800
-@@ -33,7 +33,6 @@
-
- modules_install:
- $(MAKE) $(KERNEL_MAKE_OPTS) modules_install
-- install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h
-
- clean:
- $(MAKE) $(KERNEL_MAKE_OPTS) clean
diff --git a/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0003-update-the-install-path-for-cryptodev-tests.patch b/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0003-update-the-install-path-for-cryptodev-tests.patch
deleted file mode 100644
index 4f92dbab..00000000
--- a/bsp/meta-freescale/recipes-kernel/cryptodev/yocto_patches/0003-update-the-install-path-for-cryptodev-tests.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 5b0d2cf5abaaa3bffb4a9e874dba88bdab15b69d Mon Sep 17 00:00:00 2001
-From: Ting Liu <ting.liu@nxp.com>
-Date: Mon, 20 Feb 2017 22:43:00 +0800
-Subject: [PATCH] update the install path for cryptodev tests
-
-Signed-off-by: Ting Liu <ting.liu@nxp.com>
----
- tests/Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/Makefile b/tests/Makefile
-index dd7d5ff..e1c5039 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -37,8 +37,8 @@ install:
- for prog in $(hostprogs); do \
- install -m 755 $$prog $(DESTDIR)/$(bindir)/tests_cryptodev/; \
- done
-- install -m 755 speed_multi.sh $(DESTDIR)/$(bindir)
-- install -m 755 run_crypto_tests.sh $(DESTDIR)/$(bindir)
-+ install -m 755 speed_multi.sh $(DESTDIR)/$(bindir)/tests_cryptodev/
-+ install -m 755 run_crypto_tests.sh $(DESTDIR)/$(bindir)/tests_cryptodev/
-
- clean:
- rm -f *.o *~ $(hostprogs)
---
-1.9.2
-
diff --git a/bsp/meta-freescale/recipes-kernel/dtc/dtc-145_git.bb b/bsp/meta-freescale/recipes-kernel/dtc/dtc-145_git.bb
deleted file mode 100644
index 2d4097bb..00000000
--- a/bsp/meta-freescale/recipes-kernel/dtc/dtc-145_git.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-require recipes-kernel/dtc/dtc.inc
-
-LIC_FILES_CHKSUM = " \
- file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
- file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c \
-"
-
-SRCREV = "22a65c5331c22979d416738eb756b9541672e00d"
-
-SRC_URI += "file://0001-Fix-compiler-warnings-seen-with-musl.patch \
- "
-S = "${WORKDIR}/git"
-
-# only install the dtc binary renamed to dtc-145
-do_install () {
- install -d ${D}/${bindir}
- install -m 755 dtc ${D}/${bindir}/dtc-145
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/bsp/meta-freescale/recipes-kernel/dtc/files/0001-Fix-compiler-warnings-seen-with-musl.patch b/bsp/meta-freescale/recipes-kernel/dtc/files/0001-Fix-compiler-warnings-seen-with-musl.patch
deleted file mode 100644
index 418a6498..00000000
--- a/bsp/meta-freescale/recipes-kernel/dtc/files/0001-Fix-compiler-warnings-seen-with-musl.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 50034ca2600ae07203f397af6d78e2e9ff16bc02 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 6 Oct 2018 18:12:23 -0700
-Subject: [PATCH] Fix compiler warnings seen with musl
-
-Fixes
-
-checks.c:975:16: error: format '%ld' expects argument of type 'long
-int', but argument 6 has type 'unsigned int' [-Werror=format=]
- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple
-of %ld in node %s",
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- prop->name, prop->val.len, sizeof(cell_t), node->fullpath);
- ~~~~~~~~~~~~~~
-checks.c:96:23: note: in definition of macro 'FAIL'
- check_msg((c), dti, __VA_ARGS__); \
- ^~~~~~~~~~~
-checks.c: In function 'check_interrupts_property':
-checks.c:1166:16: error: format '%ld' expects argument of type 'long
-int', but argument 6 has type 'unsigned int' [-Werror=format=]
- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple
-of %ld in node %s",
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- irq_prop->name, irq_prop->val.len, sizeof(cell_t),
- ~~~~~~~~~~~~~~
-
-Upstream-Status: Backport [adapted from an upstream fix]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- checks.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/checks.c b/checks.c
-index 902f2e3..08a3a29 100644
---- a/checks.c
-+++ b/checks.c
-@@ -972,7 +972,7 @@ static void check_property_phandle_args(struct check *c,
- int cell, cellsize = 0;
-
- if (prop->val.len % sizeof(cell_t)) {
-- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
-+ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
- prop->name, prop->val.len, sizeof(cell_t), node->fullpath);
- return;
- }
-@@ -1163,7 +1163,7 @@ static void check_interrupts_property(struct check *c,
- return;
-
- if (irq_prop->val.len % sizeof(cell_t))
-- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
-+ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
- irq_prop->name, irq_prop->val.len, sizeof(cell_t),
- node->fullpath);
-
diff --git a/bsp/meta-freescale/recipes-kernel/dtc/files/make_install.patch b/bsp/meta-freescale/recipes-kernel/dtc/files/make_install.patch
deleted file mode 100644
index ccf17b38..00000000
--- a/bsp/meta-freescale/recipes-kernel/dtc/files/make_install.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Upstream-Status: Inappropriate [configuration]
-
-Index: git/Makefile
-===================================================================
---- git.orig/Makefile
-+++ git/Makefile
-@@ -168,8 +168,8 @@ install-bin: all $(SCRIPTS)
- install-lib: all
- @$(VECHO) INSTALL-LIB
- $(INSTALL) -d $(DESTDIR)$(LIBDIR)
-- $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
-- ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
-+ $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
-+ ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/$(notdir $(LIBFDT_lib))
- ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT)
- $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR)
-
diff --git a/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.4.p1.8.bb b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.4.0.p2.0.bb
index 9201dd27..4c9015e9 100644
--- a/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.4.p1.8.bb
+++ b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.4.0.p2.0.bb
@@ -7,14 +7,14 @@ allowing flexibility to use a newer graphics release with an older kernel."
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
-SRCBRANCH = "imx_4.9.123_imx8mm_ga"
+SRCBRANCH = "lf-5.4.y"
LOCALVERSION = "-${SRCBRANCH}"
KERNEL_SRC ?= "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https"
SRC_URI = " \
${KERNEL_SRC};branch=${SRCBRANCH};subpath=drivers/mxc/gpu-viv;destsuffix=git/src \
file://Add-makefile.patch \
"
-SRCREV = "6a71cbc089755afd6a86c005c22a1af6eab24a70"
+SRCREV = "f8118585ee3c7025265b28985fdfe0af96a84466"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-ipc.inc b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-ipc.inc
index e3c92f3a..350ba186 100644
--- a/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-ipc.inc
+++ b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-ipc.inc
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=fa38cd73d71527dc6efb546474f64d10"
inherit module qoriq_build_64bit_kernel
-SRC_URI = "git://git.freescale.com/ppc/sdk/ipc.git;branch=sdk-v2.0.x"
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-yocto-sdk/ipc;protocol=https;nobranch=1"
SRCREV = "74d662707558290f070f9589177db730444bc435"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca6174_3.0.bb b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca6174_3.0.bb
new file mode 100644
index 00000000..f78a4c5b
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca6174_3.0.bb
@@ -0,0 +1,14 @@
+require kernel-module-qcacld-lea.inc
+
+SUMMARY = "Qualcomm WiFi driver for QCA module 6174"
+
+EXTRA_OEMAKE += " \
+ CONFIG_ROME_IF=pci \
+ CONFIG_WLAN_FEATURE_11W=y \
+ CONFIG_WLAN_FEATURE_FILS=y \
+ CONFIG_WLAN_WAPI_MODE_11AC_DISABLE=y \
+ MODNAME=qca6174 \
+ CONFIG_WLAN_FEATURE_DSRC=y \
+"
+
+RDEPENDS_${PN} += "firmware-qca6174"
diff --git a/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca9377_3.0.bb b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca9377_3.0.bb
new file mode 100644
index 00000000..fbc87ea2
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qca9377_3.0.bb
@@ -0,0 +1,17 @@
+require kernel-module-qcacld-lea.inc
+
+SUMMARY = "Qualcomm WiFi driver for QCA module 9377"
+
+EXTRA_OEMAKE += " \
+ CONFIG_CLD_HL_SDIO_CORE=y \
+ CONFIG_FEATURE_COEX_PTA_CONFIG_ENABLE=y \
+ CONFIG_PER_VDEV_TX_DESC_POOL=1 \
+ CONFIG_QCA_LL_TX_FLOW_CT=1 \
+ CONFIG_QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK=y \
+ CONFIG_WLAN_FEATURE_FILS=y \
+ CONFIG_WLAN_WAPI_MODE_11AC_DISABLE=y \
+ MODNAME=qca9377 \
+ SAP_AUTH_OFFLOAD=1 \
+"
+
+RDEPENDS_${PN} += "firmware-qca9377"
diff --git a/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qcacld-lea.inc b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qcacld-lea.inc
new file mode 100644
index 00000000..0b23a47c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/kernel-modules/kernel-module-qcacld-lea.inc
@@ -0,0 +1,23 @@
+SUMMARY = "Qualcomm WiFi driver for QCA module 9377 and 6174"
+LICENSE = "BSD & GPLv2"
+LIC_FILES_CHKSUM = "file://CORE/HDD/src/wlan_hdd_main.c;beginline=1;endline=20;md5=ec8d62116b13db773825ebf7cf91be1d;"
+
+QCACLD_SRC ?= "git://source.codeaurora.org/external/imx/qcacld-2.0-imx.git;protocol=https"
+SRC_URI = "${QCACLD_SRC};branch=IMX_CNSS.LEA.NRT_3.0_KRL5.4"
+SRCREV = "7dc91e5977f31d60741c55682564788c0f930163"
+
+S = "${WORKDIR}/git"
+
+inherit module
+
+EXTRA_OEMAKE += " \
+ CONFIG_CFG80211_INTERNAL_REGDB=y \
+ CONFIG_HDD_WLAN_WAIT_TIME=10000 \
+ CONFIG_LINUX_QCMBR=y \
+ CONFIG_NON_QC_PLATFORM=y \
+ CONFIG_PMF_SUPPORT=y \
+ TARGET_BUILD_VARIANT=user \
+"
+
+COMPATIBLE_MACHINE = "(imx)"
+COMPATIBLE_HOST_libc-musl = 'null'
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0001-fix-build.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0001-fix-build.patch
deleted file mode 100644
index 4be4066d..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0001-fix-build.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-Fix build errors when RT patch is applied
-
-Upstream-Status: Inappropriate [other]
-Freescale does not support the RT patch
-
-Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
-Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de> [updated for 3.14.28]
-
-diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-index 2ec98dc..5d0b7df 100644
---- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-@@ -7344,7 +7344,7 @@ gckOS_WaitSignal(
-
- might_sleep();
-
-- spin_lock_irq(&signal->obj.wait.lock);
-+ raw_spin_lock_irq(&signal->obj.wait.lock);
-
- if (signal->obj.done)
- {
-@@ -7366,9 +7366,8 @@ gckOS_WaitSignal(
- ? MAX_SCHEDULE_TIMEOUT
- : Wait * HZ / 1000;
-
-- DECLARE_WAITQUEUE(wait, current);
-- wait.flags |= WQ_FLAG_EXCLUSIVE;
-- __add_wait_queue_tail(&signal->obj.wait, &wait);
-+ DEFINE_SWAITER(wait);
-+ swait_prepare_locked(&signal->obj.wait, &wait);
-
- while (gcvTRUE)
- {
-@@ -7380,9 +7379,9 @@ gckOS_WaitSignal(
- }
-
- __set_current_state(TASK_INTERRUPTIBLE);
-- spin_unlock_irq(&signal->obj.wait.lock);
-+ raw_spin_unlock_irq(&signal->obj.wait.lock);
- timeout = schedule_timeout(timeout);
-- spin_lock_irq(&signal->obj.wait.lock);
-+ raw_spin_lock_irq(&signal->obj.wait.lock);
-
- if (signal->obj.done)
- {
-@@ -7403,10 +7402,10 @@ gckOS_WaitSignal(
- }
- }
-
-- __remove_wait_queue(&signal->obj.wait, &wait);
-+ swait_finish_locked(&signal->obj.wait, &wait);
- }
-
-- spin_unlock_irq(&signal->obj.wait.lock);
-+ raw_spin_unlock_irq(&signal->obj.wait.lock);
-
- OnError:
- /* Return status. */
-diff --git a/include/linux/imx_sema4.h b/include/linux/imx_sema4.h
-index 9787980..3586199 100644
---- a/include/linux/imx_sema4.h
-+++ b/include/linux/imx_sema4.h
-@@ -9,6 +9,8 @@
- #ifndef __LINUX_IMX_SEMA4_H__
- #define __LINUX_IMX_SEMA4_H__
-
-+#include <linux/wait.h>
-+
- #define SEMA4_NUM_DEVICES 1
- #define SEMA4_NUM_GATES 16
-
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0002-no-split-ptlocks.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0002-no-split-ptlocks.patch
deleted file mode 100644
index 40c012a5..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0002-no-split-ptlocks.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-Work around the oops below by disabling split ptlocks
-
-Upstream-Status: Inappropriate [disable feature]
-
-Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
-Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de> [updated for 3.14.28]
-
-Unable to handle kernel NULL pointer dereference at virtual address 00000000
-pgd = ac5a8000
-[00000000] *pgd=3c8db831, *pte=00000000, *ppte=00000000
-Internal error: Oops: 17 [#1] PREEMPT SMP ARM
-Modules linked in:
-CPU: 1 PID: 277 Comm: test-qt5 Not tainted 3.10.17-rt12-monkey+gec1af9f #2
-task: ac65df80 ti: ac968000 task.ti: ac968000
-PC is at _raw_spin_lock+0x10/0x4c
-LR is at get_parent_ip+0x10/0x2c
-pc : [<80623fd4>] lr : [<8004ef18>] psr: 60010013
-sp : ac969c38 ip : 80c44404 fp : 00000000
-r10: ac65df80 r9 : ac969cd8 r8 : 00000000
-r7 : 00000054 r6 : afffe000 r5 : 00000000 r4 : 00000000
-r3 : ac65df80 r2 : 00000001 r1 : 00000000 r0 : 00000000
-Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
-Control: 10c53c7d Table: 3c5a804a DAC: 00000015
-Process test-qt5 (pid: 277, stack limit = 0xac968238)
-Stack: (0xac969c38 to 0xac96a000)
-9c20: b00549a8 806235e0
-9c40: 00000000 ac968000 812f9a00 80017cec ac969c74 fffffffe 00000000 00005000
-9c60: 00000000 80017e6c ac968000 ac65df80 00000000 00000000 00000001 ac968001
-9c80: ac65df80 b00549a8 00000000 afffe000 00000054 00000000 ac969cd8 afffe150
-9ca0: b0054bf8 8044e540 ac969cd8 b00549a8 ac0b8180 00000230 ac8fd000 00000230
-9cc0: 00000000 8044f6f4 ac155700 ac969cf4 ac155700 804605b8 ac155700 ac969d8c
-9ce0: 00000002 ac969d24 b0054bf8 804607f4 7ef1fcd0 80450078 ac0b8180 ac155700
-9d00: ac969d8c 00000002 ac8fd000 8045f1a0 ac969d24 00000000 ac8fd01c b00549a8
-9d20: b0050000 00000008 ac969d98 ac0b8300 ac969d8c 00000115 ac969d98 ac969e00
-9d40: ac155600 ac3985f0 7ef1fcd0 8045661c 00000115 00000000 00000001 00000000
-9d60: 00007530 80454144 80c32e18 00000001 81518e18 806237dc 00000001 ac968038
-9d80: 00000000 00000000 00000000 00000000 00000115 806237dc ac6f5688 ac968018
-9da0: 812e1640 00000000 00000001 ac968000 ac969dc4 8004efe4 ac968008 ac39a000
-9dc0: ac744400 ac968020 00007530 ac968000 ac968000 ac3985f0 7ef1fcd0 8044d374
-9de0: 7ef1fd20 00000000 000000f8 00000000 7ef1fd20 00000000 000000f8 00000000
-9e00: 00000028 00000002 00000000 6437d1dd 7ef1fddc 76f9c030 7ef1fd88 76fb9abc
-9e20: 00000320 00005007 e02c7eca c1399eff 020fb2db 00000000 00000000 00000000
-9e40: 00000001 00000040 00000400 00000004 00000010 00000400 00000002 00000100
-9e60: 00000100 00000008 00000008 00000000 ffffffff 00000000 7588e180 76fb1000
-9e80: 08000000 00000000 00000000 76fb11b8 000000af 760b6cd8 ffffffff 7431d4c0
-9ea0: 000cb1ac 75889000 00000000 00000001 000000b0 00000000 00000000 76fa0da0
-9ec0: 00000000 00000001 00000001 00000000 00000000 7588cb40 00000001 75957ecc
-9ee0: 00000001 7ef1fe7c 75953e94 7ef1fedc 00000002 76fa789c 00007530 ac6813c0
-9f00: 00000000 7ef1fcd0 ac6813c0 ac968000 ac3985f0 800d68fc 00000001 ac968000
-9f20: ac969f34 8004efe4 ac4f71d4 6c31d000 00000000 80623fd4 00000000 80623578
-9f40: ac4f71d4 800a3d40 00000001 00000000 ac969f5c 00000003 ac6813c8 00000000
-9f60: 00000001 00007530 00000003 00000000 7ef1fcd0 ac6813c0 ac968000 00000000
-9f80: 00000000 800d6afc ac4f7180 00000000 00002710 00007530 75957e40 00000036
-9fa0: 8000e2c4 8000e140 00002710 00007530 00000003 00007530 7ef1fcd0 01bc3008
-9fc0: 00002710 00007530 75957e40 00000036 01bd2e70 00000001 7ef1fd20 00000000
-9fe0: 759540c4 7ef1fcbc 7593f698 760a0ccc 20010010 00000003 00000000 00000000
-[<80623fd4>] (_raw_spin_lock+0x10/0x4c) from [<806235e0>] (rt_spin_lock_slowlock+0x34/0x29c)
-[<806235e0>] (rt_spin_lock_slowlock+0x34/0x29c) from [<8044e540>] (_QueryProcessPageTable+0x8c/0xdc)
-[<8044e540>] (_QueryProcessPageTable+0x8c/0xdc) from [<8044f6f4>] (gckOS_GetPhysicalAddress+0x20/0x58)
-[<8044f6f4>] (gckOS_GetPhysicalAddress+0x20/0x58) from [<804605b8>] (gckHARDWARE_ConvertLogical+0x2c/0x90)
-[<804605b8>] (gckHARDWARE_ConvertLogical+0x2c/0x90) from [<804607f4>] (gckHARDWARE_Link+0x60/0x104)
-[<804607f4>] (gckHARDWARE_Link+0x60/0x104) from [<8045f1a0>] (gckCONTEXT_Construct+0x264/0x2bc)
-[<8045f1a0>] (gckCONTEXT_Construct+0x264/0x2bc) from [<8045661c>] (gckCOMMAND_Attach+0x44/0x88)
-[<8045661c>] (gckCOMMAND_Attach+0x44/0x88) from [<80454144>] (gckKERNEL_Dispatch+0x358/0x12c8)
-[<80454144>] (gckKERNEL_Dispatch+0x358/0x12c8) from [<8044d374>] (drv_ioctl+0x120/0x284)
-[<8044d374>] (drv_ioctl+0x120/0x284) from [<800d68fc>] (do_vfs_ioctl+0x408/0x5d0)
-[<800d68fc>] (do_vfs_ioctl+0x408/0x5d0) from [<800d6afc>] (SyS_ioctl+0x38/0x64)
-[<800d6afc>] (SyS_ioctl+0x38/0x64) from [<8000e140>] (ret_fast_syscall+0x0/0x30)
-Code: e92d4010 e1a04000 e3a00001 ebe8abd7 (e1943f9f)
----[ end trace 0000000000000002 ]---
-note: test-qt5[277] exited with preempt_count 1
-
-diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 6c1dc6c..8c00faf 100644
---- a/include/linux/mm_types.h
-+++ b/include/linux/mm_types.h
-@@ -24,7 +24,7 @@
-
- struct address_space;
-
--#define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
-+#define USE_SPLIT_PTE_PTLOCKS (0)
- #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
- IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
- #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8)
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch
deleted file mode 100644
index 93200c62..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From f7cba8d49a980909cea48c5b9dcfefc6e13fef0b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Dominic=20Sacr=C3=A9?= <dominic.sacre@gmx.de>
-Date: Fri, 29 Apr 2016 15:48:40 +0200
-Subject: [PATCH] Work around CPU stalls in the imx-sdma driver
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Replace spinlocks with raw spinlocks. This prevents preemption during
-the spinlock's critical section, as is the case on non PREEMPT_RT kernels.
-
-Without this patch, the following error can occur, for example when
-using the audio codec on an i.MX6Q SabreSD board:
-
-INFO: rcu_preempt self-detected stall on CPU { 0} (t=2100 jiffies g=106 c=105 q=93)
-CPU: 0 PID: 120 Comm: irq/34-sdma Not tainted 3.14.28-rt25-1.0.0_ga+g91cf351 #1
-[<80014a8c>] (unwind_backtrace) from [<8001173c>] (show_stack+0x10/0x14)
-[<8001173c>] (show_stack) from [<806ee750>] (dump_stack+0x7c/0xc8)
-[<806ee750>] (dump_stack) from [<800771c8>] (rcu_check_callbacks+0x454/0x888)
-[<800771c8>] (rcu_check_callbacks) from [<80037f28>] (update_process_times+0x40/0x5c)
-[<80037f28>] (update_process_times) from [<80082230>] (tick_sched_timer+0x4c/0x78)
-[<80082230>] (tick_sched_timer) from [<8004bf30>] (__run_hrtimer.isra.34+0x74/0x124)
-[<8004bf30>] (__run_hrtimer.isra.34) from [<8004cbb0>] (hrtimer_interrupt+0x154/0x3ac)
-[<8004cbb0>] (hrtimer_interrupt) from [<80014464>] (twd_handler+0x30/0x38)
-[<80014464>] (twd_handler) from [<8006fa2c>] (handle_percpu_devid_irq+0x6c/0x84)
-[<8006fa2c>] (handle_percpu_devid_irq) from [<8006bc64>] (generic_handle_irq+0x2c/0x3c)
-[<8006bc64>] (generic_handle_irq) from [<8000ed8c>] (handle_IRQ+0x40/0x90)
-[<8000ed8c>] (handle_IRQ) from [<8000856c>] (gic_handle_irq+0x2c/0x5c)
-[<8000856c>] (gic_handle_irq) from [<80012240>] (__irq_svc+0x40/0x84)
-Exception stack(0xa840feb8 to 0xa840ff00)
-fea0: a8007a28 00000002
-fec0: 00000001 0000a6a6 a80079c0 a8007a28 a83ea080 00000000 a80079c0 a83ea080
-fee0: 285190f0 00000000 00000000 a840ff00 8006d04c 806f3070 20030113 ffffffff
-[<80012240>] (__irq_svc) from [<806f3070>] (_raw_spin_unlock_irq+0x20/0x60)
-[<806f3070>] (_raw_spin_unlock_irq) from [<8006d04c>] (irq_finalize_oneshot.part.37+0x70/0xcc)
-[<8006d04c>] (irq_finalize_oneshot.part.37) from [<8006d148>] (irq_forced_thread_fn+0x60/0x64)
-[<8006d148>] (irq_forced_thread_fn) from [<8006d3dc>] (irq_thread+0x138/0x1a4)
-[<8006d3dc>] (irq_thread) from [<8004913c>] (kthread+0xbc/0xd4)
-[<8004913c>] (kthread) from [<8000e538>] (ret_from_fork+0x14/0x3c)
-
-Upstream-Status: Pending
-
-Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
----
- drivers/dma/imx-sdma.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
-index 31b7fed..bb7d6aa 100644
---- a/drivers/dma/imx-sdma.c
-+++ b/drivers/dma/imx-sdma.c
-@@ -408,7 +408,7 @@ struct sdma_engine {
- struct dma_device dma_device;
- struct clk *clk_ipg;
- struct clk *clk_ahb;
-- spinlock_t channel_0_lock;
-+ raw_spinlock_t channel_0_lock;
- u32 script_number;
- struct sdma_script_start_addrs *script_addrs;
- const struct sdma_driver_data *drvdata;
-@@ -700,7 +700,7 @@ static int sdma_load_script(struct sdma_engine *sdma, void *buf, int size,
- return -ENOMEM;
- }
-
-- spin_lock_irqsave(&sdma->channel_0_lock, flags);
-+ raw_spin_lock_irqsave(&sdma->channel_0_lock, flags);
-
- bd0->mode.command = C0_SETPM;
- bd0->mode.status = BD_DONE | BD_INTR | BD_WRAP | BD_EXTD;
-@@ -712,7 +712,7 @@ static int sdma_load_script(struct sdma_engine *sdma, void *buf, int size,
-
- ret = sdma_run_channel0(sdma);
-
-- spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
-+ raw_spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
-
- if (use_iram)
- gen_pool_free(sdma->iram_pool, (unsigned long)buf_virt, size);
-@@ -979,7 +979,7 @@ static int sdma_load_context(struct sdma_channel *sdmac)
- dev_dbg(sdma->dev, "event_mask0 = 0x%08x\n", (u32)sdmac->event_mask[0]);
- dev_dbg(sdma->dev, "event_mask1 = 0x%08x\n", (u32)sdmac->event_mask[1]);
-
-- spin_lock_irqsave(&sdma->channel_0_lock, flags);
-+ raw_spin_lock_irqsave(&sdma->channel_0_lock, flags);
-
- memset(context, 0, sizeof(*context));
- context->channel_state.pc = load_address;
-@@ -1005,7 +1005,7 @@ static int sdma_load_context(struct sdma_channel *sdmac)
- bd0->ext_buffer_addr = 2048 + (sizeof(*context) / 4) * channel;
- ret = sdma_run_channel0(sdma);
-
-- spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
-+ raw_spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
-
- sdmac->context_loaded = true;
-
-@@ -1019,7 +1019,7 @@ static int sdma_save_restore_context(struct sdma_engine *sdma, bool save)
- unsigned long flags;
- int ret;
-
-- spin_lock_irqsave(&sdma->channel_0_lock, flags);
-+ raw_spin_lock_irqsave(&sdma->channel_0_lock, flags);
-
- if (save)
- bd0->mode.command = C0_GETDM;
-@@ -1032,7 +1032,7 @@ static int sdma_save_restore_context(struct sdma_engine *sdma, bool save)
- bd0->ext_buffer_addr = 2048;
- ret = sdma_run_channel0(sdma);
-
-- spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
-+ raw_spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
-
- return ret;
- }
-@@ -2152,7 +2152,7 @@ static int sdma_probe(struct platform_device *pdev)
- if (!sdma)
- return -ENOMEM;
-
-- spin_lock_init(&sdma->channel_0_lock);
-+ raw_spin_lock_init(&sdma->channel_0_lock);
-
- sdma->dev = &pdev->dev;
- sdma->drvdata = drvdata;
---
-2.8.1
-
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0004-export-swait-locked-functions.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0004-export-swait-locked-functions.patch
deleted file mode 100644
index 1a616aa3..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/0004-export-swait-locked-functions.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 2460dd985b0cf477f74396de92d1bc5df496abdc Mon Sep 17 00:00:00 2001
-From: Julio Cruz <jcsistemas2001@gmail.com>
-Date: Wed, 20 Jan 2016 19:26:44 +0800
-Subject: [PATCH] Export symbols for iMX-GPU-VIV module
-
----
- kernel/sched/wait-simple.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/kernel/sched/wait-simple.c b/kernel/sched/wait-simple.c
-index 7dfa86d..a3776ee 100644
---- a/kernel/sched/wait-simple.c
-+++ b/kernel/sched/wait-simple.c
-@@ -40,6 +40,7 @@ void swait_prepare_locked(struct swait_head *head, struct swaiter *w)
- if (list_empty(&w->node))
- __swait_enqueue(head, w);
- }
-+EXPORT_SYMBOL(swait_prepare_locked);
-
- void swait_prepare(struct swait_head *head, struct swaiter *w, int state)
- {
-@@ -58,6 +59,7 @@ void swait_finish_locked(struct swait_head *head, struct swaiter *w)
- if (w->task)
- __swait_dequeue(w);
- }
-+EXPORT_SYMBOL(swait_finish_locked);
-
- void swait_finish(struct swait_head *head, struct swaiter *w)
- {
---
-2.1.0
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/defconfig
deleted file mode 100644
index 34ee14d1..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt/defconfig
+++ /dev/null
@@ -1,439 +0,0 @@
-CONFIG_LOCALVERSION="-fslc"
-CONFIG_KERNEL_LZO=y
-CONFIG_SYSVIPC=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=18
-CONFIG_CGROUPS=y
-CONFIG_RELAY=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_EXPERT=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_PERF_EVENTS=y
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_ARCH_MXC=y
-CONFIG_SOC_IMX50=y
-CONFIG_SOC_IMX53=y
-CONFIG_SOC_IMX6Q=y
-CONFIG_SOC_IMX6SL=y
-CONFIG_SOC_IMX6SX=y
-CONFIG_SOC_IMX6ULL=y
-CONFIG_SOC_IMX7D=y
-CONFIG_SOC_VF610=y
-# CONFIG_SWP_EMULATE is not set
-CONFIG_SMP=y
-CONFIG_HAVE_ARM_ARCH_TIMER=y
-CONFIG_VMSPLIT_2G=y
-CONFIG_PREEMPT_RT_FULL=y
-CONFIG_AEABI=y
-CONFIG_HIGHMEM=y
-CONFIG_CMA=y
-CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
-CONFIG_CPU_FREQ=y
-CONFIG_CPU_FREQ_GOV_POWERSAVE=y
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
-CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
-CONFIG_ARM_IMX6Q_CPUFREQ=y
-CONFIG_ARM_IMX7D_CPUFREQ=y
-CONFIG_CPU_IDLE=y
-CONFIG_VFP=y
-CONFIG_NEON=y
-CONFIG_BINFMT_MISC=m
-CONFIG_PM_DEBUG=y
-CONFIG_PM_TEST_SUSPEND=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_LRO is not set
-CONFIG_IPV6=y
-CONFIG_VLAN_8021Q=y
-CONFIG_LLC2=y
-CONFIG_CAN=y
-CONFIG_CAN_FLEXCAN=y
-CONFIG_CAN_M_CAN=y
-CONFIG_BT=y
-CONFIG_BT_RFCOMM=y
-CONFIG_BT_RFCOMM_TTY=y
-CONFIG_BT_BNEP=y
-CONFIG_BT_BNEP_MC_FILTER=y
-CONFIG_BT_BNEP_PROTO_FILTER=y
-CONFIG_BT_HIDP=y
-CONFIG_BT_HCIBTUSB=y
-CONFIG_BT_HCIUART=y
-CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_ATH3K=y
-CONFIG_BT_HCIBCM203X=y
-CONFIG_BT_ATH3K=y
-CONFIG_CFG80211=y
-CONFIG_MAC80211=y
-CONFIG_DEVTMPFS=y
-CONFIG_DEVTMPFS_MOUNT=y
-# CONFIG_STANDALONE is not set
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=0
-CONFIG_IMX_WEIM=y
-CONFIG_CONNECTOR=y
-CONFIG_MTD=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_PHYSMAP_OF=y
-CONFIG_MTD_DATAFLASH=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_SST25L=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_GPMI_NAND=y
-CONFIG_MTD_NAND_MXC=y
-CONFIG_MTD_SPI_NOR=y
-CONFIG_SPI_FSL_QUADSPI=y
-CONFIG_MTD_UBI=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=65536
-CONFIG_SENSORS_FXOS8700=y
-CONFIG_SENSORS_FXAS2100X=y
-CONFIG_EEPROM_AT24=y
-CONFIG_EEPROM_AT25=y
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_BLK_DEV_SD=y
-CONFIG_SCSI_CONSTANTS=y
-CONFIG_SCSI_LOGGING=y
-CONFIG_SCSI_SCAN_ASYNC=y
-# CONFIG_SCSI_LOWLEVEL is not set
-CONFIG_ATA=y
-CONFIG_SATA_AHCI_PLATFORM=y
-CONFIG_AHCI_IMX=y
-CONFIG_PATA_IMX=y
-CONFIG_NETDEVICES=y
-# CONFIG_NET_VENDOR_BROADCOM is not set
-CONFIG_CS89x0=y
-CONFIG_CS89x0_PLATFORM=y
-# CONFIG_NET_VENDOR_FARADAY is not set
-# CONFIG_NET_VENDOR_INTEL is not set
-# CONFIG_NET_VENDOR_MARVELL is not set
-# CONFIG_NET_VENDOR_MICREL is not set
-# CONFIG_NET_VENDOR_MICROCHIP is not set
-# CONFIG_NET_VENDOR_NATSEMI is not set
-# CONFIG_NET_VENDOR_SEEQ is not set
-CONFIG_SMC91X=y
-CONFIG_SMC911X=y
-CONFIG_SMSC911X=y
-# CONFIG_NET_VENDOR_STMICRO is not set
-CONFIG_MICREL_PHY=y
-CONFIG_USB_PEGASUS=m
-CONFIG_USB_RTL8150=m
-CONFIG_USB_RTL8152=m
-CONFIG_USB_USBNET=m
-CONFIG_USB_NET_CDC_EEM=m
-CONFIG_BCMDHD=y
-CONFIG_BCMDHD_SDIO=y
-CONFIG_BCMDHD_FW_PATH="/lib/firmware/bcm/ZP_BCM4339/fw_bcmdhd.bin"
-CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/bcm/ZP_BCM4339/bcmdhd.ZP.OOB.cal"
-# CONFIG_RTL_CARDS is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-CONFIG_INPUT_EVDEV=y
-CONFIG_INPUT_EVBUG=m
-CONFIG_KEYBOARD_GPIO=y
-CONFIG_KEYBOARD_IMX=y
-CONFIG_MOUSE_PS2=m
-CONFIG_MOUSE_PS2_ELANTECH=y
-CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_TOUCHSCREEN_ADS7846=y
-CONFIG_TOUCHSCREEN_EGALAX=y
-CONFIG_TOUCHSCREEN_ELAN_TS=y
-CONFIG_TOUCHSCREEN_MAX11801=y
-CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
-CONFIG_TOUCHSCREEN_MC13783=y
-CONFIG_TOUCHSCREEN_TSC2007=y
-CONFIG_TOUCHSCREEN_STMPE=y
-CONFIG_INPUT_MISC=y
-CONFIG_INPUT_MMA8450=y
-CONFIG_INPUT_MPL3115=y
-CONFIG_SENSOR_FXLS8471=y
-CONFIG_INPUT_ISL29023=y
-CONFIG_SERIO_SERPORT=m
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_DEVKMEM is not set
-CONFIG_SERIAL_IMX=y
-CONFIG_SERIAL_IMX_CONSOLE=y
-CONFIG_SERIAL_FSL_LPUART=y
-CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
-CONFIG_FSL_OTP=y
-CONFIG_HW_RANDOM_IMX_RNG=y
-# CONFIG_I2C_COMPAT is not set
-CONFIG_I2C_CHARDEV=y
-# CONFIG_I2C_HELPER_AUTO is not set
-CONFIG_I2C_ALGOPCF=m
-CONFIG_I2C_ALGOPCA=m
-CONFIG_I2C_IMX=y
-CONFIG_SPI=y
-CONFIG_SPI_GPIO=y
-CONFIG_SPI_IMX=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_MAX732X=y
-CONFIG_GPIO_PCA953X=y
-CONFIG_GPIO_74X164=y
-CONFIG_POWER_SUPPLY=y
-CONFIG_SABRESD_MAX8903=y
-CONFIG_POWER_RESET=y
-CONFIG_POWER_RESET_SYSCON_POWEROFF=y
-CONFIG_SENSORS_MAX17135=y
-CONFIG_SENSORS_MAG3110=y
-CONFIG_THERMAL=y
-CONFIG_CPU_THERMAL=y
-CONFIG_IMX_THERMAL=y
-CONFIG_DEVICE_THERMAL=y
-CONFIG_WATCHDOG=y
-CONFIG_IMX2_WDT=y
-CONFIG_MFD_DA9052_I2C=y
-CONFIG_MFD_MC13XXX_SPI=y
-CONFIG_MFD_MC13XXX_I2C=y
-CONFIG_MFD_MAX17135=y
-CONFIG_MFD_SI476X_CORE=y
-CONFIG_MFD_STMPE=y
-CONFIG_REGULATOR=y
-CONFIG_REGULATOR_FIXED_VOLTAGE=y
-CONFIG_REGULATOR_ANATOP=y
-CONFIG_REGULATOR_DA9052=y
-CONFIG_REGULATOR_GPIO=y
-CONFIG_REGULATOR_MAX17135=y
-CONFIG_REGULATOR_MC13783=y
-CONFIG_REGULATOR_MC13892=y
-CONFIG_REGULATOR_PFUZE100=y
-CONFIG_MEDIA_SUPPORT=y
-CONFIG_MEDIA_CAMERA_SUPPORT=y
-CONFIG_MEDIA_RADIO_SUPPORT=y
-CONFIG_MEDIA_RC_SUPPORT=y
-CONFIG_RC_DEVICES=y
-CONFIG_IR_GPIO_CIR=y
-CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_USB_VIDEO_CLASS=m
-CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_MXC_OUTPUT=y
-CONFIG_VIDEO_MXC_CAPTURE=m
-CONFIG_MXC_CAMERA_OV5640=m
-CONFIG_MXC_CAMERA_OV5642=m
-CONFIG_MXC_CAMERA_OV5640_MIPI=m
-CONFIG_MXC_TVIN_ADV7180=m
-CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m
-CONFIG_VIDEO_MXC_IPU_OUTPUT=y
-CONFIG_VIDEO_MXC_PXP_V4L2=y
-CONFIG_VIDEO_MXC_CSI_CAMERA=m
-CONFIG_MXC_VADC=m
-CONFIG_MXC_MIPI_CSI=m
-CONFIG_MXC_CAMERA_OV5647_MIPI=m
-CONFIG_SOC_CAMERA=y
-CONFIG_VIDEO_MX3=y
-CONFIG_V4L_MEM2MEM_DRIVERS=y
-CONFIG_VIDEO_CODA=y
-CONFIG_RADIO_SI476X=y
-CONFIG_SOC_CAMERA_OV2640=y
-CONFIG_DRM=y
-CONFIG_DRM_VIVANTE=y
-CONFIG_FB=y
-CONFIG_FB_MXS=y
-CONFIG_FB_MXC_SYNC_PANEL=y
-CONFIG_FB_MXC_MIPI_DSI=y
-CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
-CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
-CONFIG_FB_MXC_TRULY_PANEL_TFT3P5079E=y
-CONFIG_FB_MXC_TRULY_PANEL_TFT3P5581E=y
-CONFIG_FB_MXC_LDB=y
-CONFIG_FB_MXC_HDMI=y
-CONFIG_FB_MXS_SII902X=y
-CONFIG_FB_MXC_DCIC=m
-CONFIG_HANNSTAR_CABC=y
-CONFIG_FB_MXC_EINK_PANEL=y
-CONFIG_FB_MXC_EINK_V2_PANEL=y
-CONFIG_LCD_CLASS_DEVICE=y
-CONFIG_LCD_L4F00242T03=y
-CONFIG_LCD_PLATFORM=y
-CONFIG_BACKLIGHT_PWM=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-CONFIG_LOGO=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_USB_AUDIO=m
-CONFIG_SND_SOC=y
-CONFIG_SND_IMX_SOC=y
-CONFIG_SND_SOC_EUKREA_TLV320=y
-CONFIG_SND_SOC_IMX_WM8960=y
-CONFIG_SND_SOC_IMX_SII902X=y
-CONFIG_SND_SOC_IMX_WM8958=y
-CONFIG_SND_SOC_IMX_CS42888=y
-CONFIG_SND_SOC_IMX_WM8962=y
-CONFIG_SND_SOC_IMX_SGTL5000=y
-CONFIG_SND_SOC_IMX_MQS=y
-CONFIG_SND_SOC_IMX_SPDIF=y
-CONFIG_SND_SOC_IMX_MC13783=y
-CONFIG_SND_SOC_IMX_SI476X=y
-CONFIG_SND_SOC_IMX_HDMI=y
-CONFIG_SND_SIMPLE_CARD=y
-CONFIG_USB=y
-CONFIG_USB_OTG_WHITELIST=y
-CONFIG_USB_OTG_FSM=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_MXC=y
-CONFIG_USB_HCD_TEST_MODE=y
-CONFIG_USB_ACM=m
-CONFIG_USB_STORAGE=y
-CONFIG_USB_CHIPIDEA=y
-CONFIG_USB_CHIPIDEA_UDC=y
-CONFIG_USB_CHIPIDEA_HOST=y
-CONFIG_USB_SERIAL=m
-CONFIG_USB_SERIAL_GENERIC=y
-CONFIG_USB_SERIAL_FTDI_SIO=m
-CONFIG_USB_SERIAL_OPTION=m
-CONFIG_USB_EHSET_TEST_FIXTURE=y
-CONFIG_NOP_USB_XCEIV=y
-CONFIG_USB_MXS_PHY=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_CONFIGFS=m
-CONFIG_USB_CONFIGFS_SERIAL=y
-CONFIG_USB_CONFIGFS_ACM=y
-CONFIG_USB_CONFIGFS_OBEX=y
-CONFIG_USB_CONFIGFS_NCM=y
-CONFIG_USB_CONFIGFS_ECM=y
-CONFIG_USB_CONFIGFS_ECM_SUBSET=y
-CONFIG_USB_CONFIGFS_RNDIS=y
-CONFIG_USB_CONFIGFS_EEM=y
-CONFIG_USB_CONFIGFS_MASS_STORAGE=y
-CONFIG_USB_CONFIGFS_F_LB_SS=y
-CONFIG_USB_CONFIGFS_F_FS=y
-CONFIG_USB_ZERO=m
-CONFIG_USB_ETH=m
-CONFIG_USB_G_NCM=m
-CONFIG_USB_GADGETFS=m
-CONFIG_USB_MASS_STORAGE=m
-CONFIG_USB_G_SERIAL=m
-CONFIG_MMC=y
-CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_PLTFM=y
-CONFIG_MMC_SDHCI_ESDHC_IMX=y
-CONFIG_MXC_IPU=y
-CONFIG_MXC_IPU_V3_PRE=y
-CONFIG_MXC_GPU_VIV=y
-CONFIG_MXC_SIM=y
-CONFIG_MXC_MIPI_CSI2=y
-CONFIG_MXC_HDMI_CEC=y
-CONFIG_NEW_LEDS=y
-CONFIG_LEDS_CLASS=y
-CONFIG_LEDS_GPIO=y
-CONFIG_LEDS_TRIGGERS=y
-CONFIG_LEDS_TRIGGER_TIMER=y
-CONFIG_LEDS_TRIGGER_ONESHOT=y
-CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-CONFIG_LEDS_TRIGGER_BACKLIGHT=y
-CONFIG_LEDS_TRIGGER_GPIO=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_INTF_DEV_UIE_EMUL=y
-CONFIG_RTC_DRV_MC13XXX=y
-CONFIG_RTC_DRV_MXC=y
-CONFIG_RTC_DRV_SNVS=y
-CONFIG_DMADEVICES=y
-CONFIG_MXC_PXP_V2=y
-CONFIG_MXC_PXP_V3=y
-CONFIG_IMX_SDMA=y
-CONFIG_MXS_DMA=y
-CONFIG_DMATEST=m
-CONFIG_STAGING=y
-CONFIG_STAGING_MEDIA=y
-# CONFIG_IOMMU_SUPPORT is not set
-CONFIG_IIO=y
-CONFIG_IMX7D_ADC=y
-CONFIG_VF610_ADC=y
-CONFIG_PWM=y
-CONFIG_PWM_IMX=y
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT2_FS_POSIX_ACL=y
-CONFIG_EXT2_FS_SECURITY=y
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_POSIX_ACL=y
-CONFIG_EXT3_FS_SECURITY=y
-CONFIG_EXT4_FS=y
-CONFIG_EXT4_FS_POSIX_ACL=y
-CONFIG_EXT4_FS_SECURITY=y
-CONFIG_QUOTA=y
-CONFIG_QUOTA_NETLINK_INTERFACE=y
-# CONFIG_PRINT_QUOTA_WARNING is not set
-CONFIG_AUTOFS4_FS=y
-CONFIG_FUSE_FS=y
-CONFIG_ISO9660_FS=m
-CONFIG_JOLIET=y
-CONFIG_ZISOFS=y
-CONFIG_UDF_FS=m
-CONFIG_MSDOS_FS=m
-CONFIG_VFAT_FS=y
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_UBIFS_FS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_ROOT_NFS=y
-CONFIG_NLS_DEFAULT="cp437"
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_15=m
-CONFIG_NLS_UTF8=y
-CONFIG_DEBUG_FS=y
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_FTRACE is not set
-CONFIG_SECURITYFS=y
-CONFIG_CRYPTO_USER=y
-CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_CTS=y
-CONFIG_CRYPTO_LRW=y
-CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_MD4=y
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_MICHAEL_MIC=y
-CONFIG_CRYPTO_RMD128=y
-CONFIG_CRYPTO_RMD160=y
-CONFIG_CRYPTO_RMD256=y
-CONFIG_CRYPTO_RMD320=y
-CONFIG_CRYPTO_SHA512=y
-CONFIG_CRYPTO_TGR192=y
-CONFIG_CRYPTO_WP512=y
-CONFIG_CRYPTO_BLOWFISH=y
-CONFIG_CRYPTO_CAMELLIA=y
-CONFIG_CRYPTO_DES=y
-CONFIG_CRYPTO_TWOFISH=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRYPTO_DEV_FSL_CAAM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
-CONFIG_CRYPTO_DEV_MXS_DCP=y
-CONFIG_CRC_CCITT=m
-CONFIG_CRC_T10DIF=y
-CONFIG_CRC7=m
-CONFIG_LIBCRC32C=m
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt_4.1-2.0.x.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt_4.1-2.0.x.bb
deleted file mode 100644
index 621023b4..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx-rt_4.1-2.0.x.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "Realtime version of the FSL Community BSP i.MX6 Linux kernel with backported features and fixes"
-DESCRIPTION = "Linux kernel based on NXP 4.1-2.0.0 GA release, used by FSL Community BSP in order to \
-provide support for i.MX6 based platforms and include official Linux kernel stable updates, backported \
-features and fixes coming from the vendors, kernel community or FSL Community itself. \
-In addition, this kernel has the realtime patch (PREEMPT_RT) applied."
-
-include linux-fslc.inc
-
-PV .= "+git${SRCPV}"
-
-SRCBRANCH = "4.1-2.0.x-imx"
-SRCREV = "ee67fc7e072df596577e3a4e4fce7b51816d4b0a"
-
-SRC_URI += " \
- ${KERNELORG_MIRROR}/linux/kernel/projects/rt/4.1/older/patch-4.1.38-rt45.patch.gz;name=rt-patch \
- file://0001-fix-build.patch \
- file://0002-no-split-ptlocks.patch \
- file://0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch \
- file://0004-export-swait-locked-functions.patch \
-"
-
-SRC_URI[rt-patch.md5sum] = "6e86714997e190a45fb5b9c951d2c179"
-SRC_URI[rt-patch.sha256sum] = "12aa4947ee656fa724e17d8971dcb3634a058c18afe59a472adfcd6f11d17f67"
-
-
-COMPATIBLE_MACHINE = "(mx6|mx7)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool-4.9.123/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/imx/defconfig
index 85410638..622e5430 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool-4.9.123/defconfig
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/imx/defconfig
@@ -2,6 +2,7 @@ CONFIG_KERNEL_LZO=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=18
@@ -13,61 +14,61 @@ CONFIG_KALLSYMS_ALL=y
CONFIG_PERF_EVENTS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
-# CONFIG_BLK_DEV_BSG is not set
CONFIG_ARCH_MXC=y
CONFIG_SOC_IMX50=y
+CONFIG_SOC_IMX51=y
CONFIG_SOC_IMX53=y
CONFIG_SOC_IMX6Q=y
CONFIG_SOC_IMX6SL=y
+CONFIG_SOC_IMX6SLL=y
CONFIG_SOC_IMX6SX=y
-CONFIG_SOC_IMX6ULL=y
+CONFIG_SOC_IMX6UL=y
CONFIG_SOC_IMX7D=y
-CONFIG_SOC_IMX6SLL=y
CONFIG_SOC_IMX7ULP=y
CONFIG_SOC_VF610=y
-# CONFIG_SWP_EMULATE is not set
CONFIG_SMP=y
CONFIG_VMSPLIT_2G=y
CONFIG_ARM_PSCI=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
CONFIG_HIGHMEM=y
-CONFIG_CMA=y
+CONFIG_FORCE_MAX_ZONEORDER=14
CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
+CONFIG_KEXEC=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
-CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
+CONFIG_CPUFREQ_DT=y
CONFIG_ARM_IMX6Q_CPUFREQ=y
-CONFIG_ARM_IMX7D_CPUFREQ=y
+CONFIG_ARM_IMX_CPUFREQ_DT=y
CONFIG_ARM_IMX7ULP_CPUFREQ=y
CONFIG_CPU_IDLE=y
+CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_VFP=y
CONFIG_NEON=y
-CONFIG_BINFMT_MISC=m
CONFIG_PM_DEBUG=y
CONFIG_PM_TEST_SUSPEND=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_BINFMT_MISC=m
+CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-CONFIG_VLAN_8021Q=y
+CONFIG_NETFILTER=y
+CONFIG_VLAN_8021Q=m
CONFIG_LLC2=y
CONFIG_CAN=y
CONFIG_CAN_FLEXCAN=y
-CONFIG_CAN_M_CAN=y
CONFIG_BT=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
@@ -78,19 +79,24 @@ CONFIG_BT_HIDP=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_ATH3K=y
-CONFIG_BT_HCIBCM203X=y
-CONFIG_BT_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIUART_3WIRE=y
+CONFIG_BT_HCIUART_MRVL=y
+CONFIG_BT_HCIVHCI=y
+CONFIG_BT_MRVL=y
+CONFIG_BT_MRVL_SDIO=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
-CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_IMX6=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=0
+CONFIG_FW_LOADER_USER_HELPER=y
+CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
CONFIG_IMX_WEIM=y
CONFIG_CONNECTOR=y
CONFIG_MTD=y
@@ -101,17 +107,19 @@ CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
-CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
-CONFIG_MTD_NAND=y
+CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
+CONFIG_MTD_NAND_VF610_NFC=y
CONFIG_MTD_NAND_MXC=y
CONFIG_MTD_SPI_NOR=y
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
-CONFIG_SPI_FSL_QUADSPI=y
CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_FASTMAP=y
+CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
@@ -144,25 +152,27 @@ CONFIG_SMC91X=y
CONFIG_SMC911X=y
CONFIG_SMSC911X=y
# CONFIG_NET_VENDOR_STMICRO is not set
+CONFIG_AT803X_PHY=y
CONFIG_MICREL_PHY=y
-CONFIG_USB_KAWETH=y
-CONFIG_USB_PEGASUS=y
-CONFIG_USB_RTL8150=y
+CONFIG_SMSC_PHY=y
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=y
+CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=m
-CONFIG_BCMDHD=y
-CONFIG_BCMDHD_SDIO=y
-CONFIG_BCMDHD_FW_PATH="/lib/firmware/bcm/ZP_BCM4339/fw_bcmdhd.bin"
-CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/bcm/ZP_BCM4339/bcmdhd.ZP.OOB.cal"
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_MCS7830=y
+CONFIG_BRCMFMAC=m
CONFIG_HOSTAP=y
-# CONFIG_RTL_CARDS is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_WL12XX=m
+CONFIG_WL18XX=m
+CONFIG_WLCORE_SDIO=m
+# CONFIG_WILINK_PLATFORM_DATA is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=m
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_RPMSG=y
-CONFIG_KEYBOARD_PF1550_ONKEY=y
CONFIG_KEYBOARD_IMX=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ELANTECH=y
@@ -170,11 +180,16 @@ CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_TOUCHSCREEN_EGALAX=y
CONFIG_TOUCHSCREEN_ELAN_TS=y
+CONFIG_TOUCHSCREEN_GOODIX=y
CONFIG_TOUCHSCREEN_MAX11801=y
CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
+CONFIG_TOUCHSCREEN_EDT_FT5X06=y
CONFIG_TOUCHSCREEN_MC13783=y
+CONFIG_TOUCHSCREEN_TSC2004=y
CONFIG_TOUCHSCREEN_TSC2007=y
CONFIG_TOUCHSCREEN_STMPE=y
+CONFIG_TOUCHSCREEN_SX8654=y
+CONFIG_TOUCHSCREEN_COLIBRI_VF50=y
CONFIG_TOUCHSCREEN_FTS=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_MMA8450=y
@@ -184,111 +199,136 @@ CONFIG_SENSOR_IMX_RPMSG=y
CONFIG_INPUT_ISL29023=y
CONFIG_SERIO_SERPORT=m
# CONFIG_LEGACY_PTYS is not set
-# CONFIG_DEVKMEM is not set
CONFIG_SERIAL_IMX=y
CONFIG_SERIAL_IMX_CONSOLE=y
CONFIG_SERIAL_FSL_LPUART=y
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
-CONFIG_FSL_OTP=y
-CONFIG_HW_RANDOM_IMX_RNG=y
+CONFIG_SERIAL_DEV_BUS=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_GPIO=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
+CONFIG_I2C_GPIO=y
CONFIG_I2C_IMX=y
CONFIG_I2C_IMX_LPI2C=y
CONFIG_SPI=y
+CONFIG_SPI_FSL_LPSPI=y
+CONFIG_SPI_FSL_QUADSPI=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_IMX=y
-CONFIG_SPI_FSL_LPSPI=y
+CONFIG_SPI_FSL_DSPI=y
CONFIG_SPI_SPIDEV=y
+CONFIG_SPI_SLAVE=y
+CONFIG_SPI_SLAVE_TIME=y
+CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y
CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_SIOX=m
CONFIG_GPIO_IMX_RPMSG=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCF857X=y
+CONFIG_GPIO_STMPE=y
CONFIG_GPIO_74X164=y
CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_SYSCON=y
CONFIG_POWER_RESET_SYSCON_POWEROFF=y
CONFIG_POWER_SUPPLY=y
-CONFIG_CHARGER_PF1550=y
CONFIG_SABRESD_MAX8903=y
+CONFIG_SENSORS_MC13783_ADC=y
+CONFIG_SENSORS_GPIO_FAN=y
+CONFIG_SENSORS_IIO_HWMON=y
CONFIG_SENSORS_MAX17135=y
CONFIG_SENSORS_MAG3110=y
CONFIG_THERMAL=y
+CONFIG_THERMAL_STATISTICS=y
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_CPU_THERMAL=y
CONFIG_IMX_THERMAL=y
CONFIG_DEVICE_THERMAL=y
CONFIG_WATCHDOG=y
+CONFIG_DA9063_WATCHDOG=m
+CONFIG_DA9062_WATCHDOG=y
+CONFIG_RN5T618_WATCHDOG=y
CONFIG_IMX2_WDT=y
CONFIG_IMX7ULP_WDT=y
CONFIG_MFD_DA9052_I2C=y
+CONFIG_MFD_DA9062=y
+CONFIG_MFD_DA9063=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
-CONFIG_MFD_PF1550=y
CONFIG_MFD_MAX17135=y
+CONFIG_MFD_RN5T618=y
CONFIG_MFD_SI476X_CORE=y
CONFIG_MFD_STMPE=y
-CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_DA9052=y
+CONFIG_REGULATOR_DA9062=y
+CONFIG_REGULATOR_DA9063=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_MAX17135=y
CONFIG_REGULATOR_MC13783=y
CONFIG_REGULATOR_MC13892=y
-CONFIG_REGULATOR_PFUZE100=y
-CONFIG_REGULATOR_PF1550=y
CONFIG_REGULATOR_PF1550_RPMSG=y
+CONFIG_REGULATOR_PFUZE100=y
+CONFIG_REGULATOR_RN5T618=y
+CONFIG_RC_CORE=y
+CONFIG_RC_DEVICES=y
+CONFIG_IR_GPIO_CIR=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
-CONFIG_MEDIA_RC_SUPPORT=y
-CONFIG_RC_DEVICES=y
-CONFIG_IR_GPIO_CIR=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_MXC_OUTPUT=y
+CONFIG_VIDEO_MUX=y
CONFIG_VIDEO_MXC_CAPTURE=m
+CONFIG_VIDEO_MXC_OUTPUT=y
CONFIG_VIDEO_MXC_CSI_CAMERA=m
CONFIG_MXC_VADC=m
CONFIG_MXC_MIPI_CSI=m
CONFIG_MXC_CAMERA_OV5640=m
CONFIG_MXC_CAMERA_OV5640_V2=m
-CONFIG_MXC_CAMERA_OV5642=m
CONFIG_MXC_CAMERA_OV5640_MIPI=m
CONFIG_MXC_CAMERA_OV5640_MIPI_V2=m
-CONFIG_MXC_CAMERA_OV5647_MIPI=m
CONFIG_MXC_TVIN_ADV7180=m
CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m
CONFIG_VIDEO_MXC_IPU_OUTPUT=y
CONFIG_VIDEO_MXC_PXP_V4L2=y
-CONFIG_SOC_CAMERA=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
-CONFIG_VIDEO_CODA=y
+CONFIG_VIDEO_CODA=m
+CONFIG_VIDEO_IMX_PXP=y
CONFIG_RADIO_SI476X=y
-CONFIG_SOC_CAMERA_OV2640=y
+CONFIG_VIDEO_ADV7180=m
+CONFIG_VIDEO_OV2680=m
+CONFIG_VIDEO_OV5645=m
CONFIG_DRM=y
-CONFIG_DRM_VIVANTE=y
+CONFIG_DRM_MSM=y
+CONFIG_DRM_PANEL_LVDS=y
+CONFIG_DRM_PANEL_SIMPLE=y
+CONFIG_DRM_PANEL_SEIKO_43WVF1G=y
CONFIG_FB_MXS=y
CONFIG_FB_MXC_SYNC_PANEL=y
CONFIG_FB_MXC_OVERLAY=y
-CONFIG_FB_MXC_MIPI_DSI=y
-CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
CONFIG_FB_MXC_MIPI_DSI_NORTHWEST=y
-CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
-CONFIG_FB_MXC_TRULY_PANEL_TFT3P5079E=y
+CONFIG_FB_MXC_ADV7535=y
CONFIG_FB_MXC_TRULY_PANEL_TFT3P5581E=y
+CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
+CONFIG_FB_MXC_RK_PANEL_RK055AHD042=y
+CONFIG_FB_MXC_RK_PANEL_RK055IQH042=y
+CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
+CONFIG_FB_MXC_MIPI_DSI=y
CONFIG_FB_MXC_LDB=y
-CONFIG_FB_MXC_HDMI=y
-CONFIG_FB_MXS_SII902X=y
-CONFIG_FB_MXC_DCIC=m
-CONFIG_FB_MXC_ADV7535=y
-CONFIG_HANNSTAR_CABC=y
CONFIG_FB_MXC_EINK_PANEL=y
CONFIG_FB_MXC_EINK_V2_PANEL=y
+CONFIG_FB_MXC_HDMI=y
+CONFIG_FB_MXS_SII902X=y
+CONFIG_FB_MXC_DCIC=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_L4F00242T03=y
CONFIG_LCD_PLATFORM=y
@@ -308,13 +348,19 @@ CONFIG_SND_SOC_IMX_WM8958=y
CONFIG_SND_SOC_IMX_CS42888=y
CONFIG_SND_SOC_IMX_WM8962=y
CONFIG_SND_SOC_IMX_RPMSG=y
+CONFIG_SND_SOC_IMX_ES8328=y
CONFIG_SND_SOC_IMX_SGTL5000=y
CONFIG_SND_SOC_IMX_MQS=y
CONFIG_SND_SOC_IMX_SPDIF=y
CONFIG_SND_SOC_IMX_MC13783=y
CONFIG_SND_SOC_IMX_SI476X=y
CONFIG_SND_SOC_IMX_HDMI=y
+CONFIG_SND_SOC_AC97_CODEC=y
+CONFIG_SND_SOC_TLV320AIC3X=y
+CONFIG_SND_SIMPLE_CARD=y
+CONFIG_HID_MULTITOUCH=y
CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_OTG_WHITELIST=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_MXC=y
@@ -329,10 +375,11 @@ CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_USB_TEST=m
-CONFIG_USB_EHSET_TEST_FIXTURE=y
+CONFIG_USB_EHSET_TEST_FIXTURE=m
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_MXS_PHY=y
CONFIG_USB_GADGET=y
+CONFIG_USB_FSL_USB2=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
@@ -343,38 +390,48 @@ CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
-CONFIG_FSL_UTP=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
+CONFIG_USB_CONFIGFS_F_UAC1=y
+CONFIG_USB_CONFIGFS_F_UAC2=y
+CONFIG_USB_CONFIGFS_F_MIDI=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_F_UVC=y
+CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_ZERO=m
+CONFIG_USB_AUDIO=m
CONFIG_USB_ETH=m
CONFIG_USB_G_NCM=m
CONFIG_USB_GADGETFS=m
+CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_ESDHC_IMX=y
-CONFIG_MXC_IPU=y
-CONFIG_MXC_IPU_V3_PRE=y
-CONFIG_MXC_MIPI_CSI2=y
-CONFIG_MXC_HDMI_CEC=y
-CONFIG_MXC_SIM=y
-CONFIG_MXC_SIMv2=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_PWM=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_ISL1208=y
+CONFIG_RTC_DRV_PCF8523=y
+CONFIG_RTC_DRV_PCF8563=y
+CONFIG_RTC_DRV_M41T80=y
+CONFIG_RTC_DRV_DA9063=y
CONFIG_RTC_DRV_MC13XXX=y
CONFIG_RTC_DRV_MXC=y
+CONFIG_RTC_DRV_MXC_V2=y
CONFIG_RTC_DRV_SNVS=y
CONFIG_RTC_DRV_IMX_RPMSG=y
CONFIG_DMADEVICES=y
@@ -386,18 +443,34 @@ CONFIG_MXC_PXP_V3=y
CONFIG_DMATEST=m
CONFIG_STAGING=y
CONFIG_STAGING_MEDIA=y
-CONFIG_ION=y
-CONFIG_ION_MXC=y
-# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_COMMON_CLK_PWM=y
+CONFIG_MAILBOX=y
+CONFIG_IMX_MBOX=y
CONFIG_EXTCON_USB_GPIO=y
CONFIG_IIO=y
CONFIG_IMX7D_ADC=y
CONFIG_VF610_ADC=y
CONFIG_PWM=y
-CONFIG_PWM_IMX=y
-CONFIG_PWM_TPM=y
+CONFIG_PWM_FSL_FTM=y
+CONFIG_PWM_IMX27=y
+CONFIG_PWM_IMX_TPM=y
+CONFIG_PHY_MIXEL_LVDS=y
+CONFIG_PHY_MIXEL_LVDS_COMBO=y
+CONFIG_NVMEM_IMX_OCOTP=y
+CONFIG_NVMEM_VF610_OCOTP=y
+CONFIG_NVMEM_SNVS_LPGPR=y
CONFIG_TEE=y
CONFIG_OPTEE=y
+CONFIG_MUX_MMIO=y
+CONFIG_SIOX=m
+CONFIG_SIOX_BUS_GPIO=m
+CONFIG_MXC_SIM=y
+CONFIG_MXC_IPU=y
+CONFIG_MXC_SIMv2=y
+CONFIG_MXC_MLB150=y
+CONFIG_MXC_IPU_V3_PRE=y
+CONFIG_MXC_HDMI_CEC=y
+CONFIG_MXC_MIPI_CSI2=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
@@ -416,7 +489,7 @@ CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=y
-CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
CONFIG_JFFS2_FS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
@@ -429,38 +502,51 @@ CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_UTF8=y
-CONFIG_DEBUG_FS=y
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_FTRACE is not set
CONFIG_SECURITYFS=y
CONFIG_CRYPTO_USER=y
CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_CTS=y
-CONFIG_CRYPTO_LRW=y
-CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_MD4=y
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_RMD128=y
-CONFIG_CRYPTO_RMD160=y
-CONFIG_CRYPTO_RMD256=y
-CONFIG_CRYPTO_RMD320=y
-CONFIG_CRYPTO_SHA512=y
-CONFIG_CRYPTO_TGR192=y
-CONFIG_CRYPTO_WP512=y
-CONFIG_CRYPTO_BLOWFISH=y
-CONFIG_CRYPTO_CAMELLIA=y
-CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_ECHAINIV=m
+CONFIG_CRYPTO_TLS=m
+CONFIG_CRYPTO_CFB=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_OFB=m
+CONFIG_CRYPTO_XTS=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_SHA3=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_DEV_FSL_CAAM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=y
+CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=m
CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
+CONFIG_CRYPTO_DEV_SAHARA=y
CONFIG_CRYPTO_DEV_MXS_DCP=y
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
+CONFIG_DMA_CMA=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_FTRACE is not set
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-4.9.123/mx8/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/mx8/defconfig
index f7df110b..469ee0ef 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-4.9.123/mx8/defconfig
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/mx8/defconfig
@@ -3,6 +3,8 @@ CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
+CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
@@ -11,7 +13,7 @@ CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=14
+CONFIG_NUMA_BALANCING=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_BLK_CGROUP=y
@@ -21,73 +23,32 @@ CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
-CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
-CONFIG_EXPERT=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
-CONFIG_JUMP_LABEL=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_IOSCHED_DEADLINE is not set
-CONFIG_ARCH_SUNXI=y
-CONFIG_ARCH_ALPINE=y
-CONFIG_ARCH_BCM_IPROC=y
-CONFIG_ARCH_BERLIN=y
-CONFIG_ARCH_EXYNOS=y
CONFIG_ARCH_LAYERSCAPE=y
-CONFIG_ARCH_LG1K=y
-CONFIG_ARCH_HISI=y
-CONFIG_ARCH_MEDIATEK=y
-CONFIG_ARCH_MESON=y
-CONFIG_ARCH_MVEBU=y
-CONFIG_ARCH_QCOM=y
-CONFIG_ARCH_ROCKCHIP=y
-CONFIG_ARCH_SEATTLE=y
-CONFIG_ARCH_RENESAS=y
-CONFIG_ARCH_R8A7795=y
-CONFIG_ARCH_R8A7796=y
-CONFIG_ARCH_STRATIX10=y
-CONFIG_ARCH_TEGRA=y
-CONFIG_ARCH_SPRD=y
-CONFIG_ARCH_THUNDER=y
-CONFIG_ARCH_UNIPHIER=y
-CONFIG_ARCH_VEXPRESS=y
-CONFIG_ARCH_VULCAN=y
-CONFIG_ARCH_XGENE=y
-CONFIG_ARCH_ZX=y
-CONFIG_ARCH_ZYNQMP=y
-CONFIG_ARCH_FSL_IMX8QM=y
-CONFIG_ARCH_FSL_IMX8QP=y
-CONFIG_ARCH_FSL_IMX8QXP=y
-CONFIG_ARCH_FSL_IMX8MQ=y
-CONFIG_ARCH_FSL_IMX8MM=y
-CONFIG_PCI=y
-CONFIG_PCI_IOV=y
-CONFIG_PCI_AARDVARK=y
-CONFIG_PCI_IMX6=y
-CONFIG_PCIE_RCAR=y
-CONFIG_PCI_HOST_GENERIC=y
-CONFIG_PCI_XGENE=y
-CONFIG_PCI_HISI=y
+CONFIG_ARCH_MXC=y
+CONFIG_ARCH_S32=y
+CONFIG_SOC_S32V234=y
CONFIG_ARM64_VA_BITS_48=y
CONFIG_SCHED_MC=y
-CONFIG_PREEMPT=y
-CONFIG_KSM=y
-CONFIG_TRANSPARENT_HUGEPAGE=y
-CONFIG_CMA=y
+CONFIG_NUMA=y
CONFIG_SECCOMP=y
CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
CONFIG_XEN=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_FORCE_MAX_ZONEORDER=14
CONFIG_COMPAT=y
+CONFIG_RANDOMIZE_BASE=y
CONFIG_PM_DEBUG=y
CONFIG_PM_TEST_SUSPEND=y
+CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
@@ -95,12 +56,44 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
-CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
CONFIG_CPUFREQ_DT=y
-CONFIG_ARM_BIG_LITTLE_CPUFREQ=y
-CONFIG_ARM_IMX8_CPUFREQ=y
-CONFIG_ARM_IMX8MQ_CPUFREQ=y
+CONFIG_ACPI_CPPC_CPUFREQ=m
CONFIG_ARM_SCPI_CPUFREQ=y
+CONFIG_ARM_IMX_CPUFREQ_DT=y
+CONFIG_QORIQ_CPUFREQ=y
+CONFIG_ARM_SCPI_PROTOCOL=y
+CONFIG_EFI_CAPSULE_LOADER=y
+CONFIG_IMX_DSP=y
+CONFIG_IMX_SCU=y
+CONFIG_IMX_SCU_PD=y
+CONFIG_ACPI=y
+CONFIG_ACPI_APEI=y
+CONFIG_ACPI_APEI_GHES=y
+CONFIG_ACPI_APEI_PCIEAER=y
+CONFIG_ACPI_APEI_MEMORY_FAILURE=y
+CONFIG_ACPI_APEI_EINJ=y
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=y
+CONFIG_ARM64_CRYPTO=y
+CONFIG_CRYPTO_SHA1_ARM64_CE=y
+CONFIG_CRYPTO_SHA2_ARM64_CE=y
+CONFIG_CRYPTO_SHA512_ARM64_CE=m
+CONFIG_CRYPTO_SHA3_ARM64=m
+CONFIG_CRYPTO_SM3_ARM64_CE=m
+CONFIG_CRYPTO_GHASH_ARM64_CE=y
+CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m
+CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
+CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
+CONFIG_CRYPTO_CHACHA20_NEON=m
+CONFIG_CRYPTO_AES_ARM64_BS=m
+CONFIG_JUMP_LABEL=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_KSM=y
+CONFIG_MEMORY_FAILURE=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
@@ -109,7 +102,7 @@ CONFIG_IP_MULTICAST=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
-CONFIG_IPV6=m
+CONFIG_IPV6_SIT=m
CONFIG_NETFILTER=y
CONFIG_NF_CONNTRACK=m
CONFIG_NF_CONNTRACK_EVENTS=y
@@ -117,14 +110,12 @@ CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
-CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
-CONFIG_NF_CONNTRACK_IPV6=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
@@ -133,13 +124,14 @@ CONFIG_IP6_NF_NAT=m
CONFIG_IP6_NF_TARGET_MASQUERADE=m
CONFIG_BRIDGE=m
CONFIG_BRIDGE_VLAN_FILTERING=y
-CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC2=y
+CONFIG_TSN=y
+CONFIG_NET_SWITCHDEV=y
CONFIG_BPF_JIT=y
-CONFIG_CAN=y
-CONFIG_CAN_FLEXCAN=y
+CONFIG_CAN=m
+CONFIG_CAN_FLEXCAN=m
CONFIG_BT=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
@@ -147,67 +139,103 @@ CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
+# CONFIG_BT_HS is not set
+# CONFIG_BT_LE is not set
CONFIG_BT_LEDS=y
+# CONFIG_BT_DEBUGFS is not set
+CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
CONFIG_BT_HCIUART_BCM=y
CONFIG_BT_HCIUART_QCA=y
CONFIG_BT_HCIVHCI=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
-CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_PCI=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCI_IOV=y
+CONFIG_HOTPLUG_PCI=y
+CONFIG_HOTPLUG_PCI_ACPI=y
+CONFIG_PCI_HOST_GENERIC=y
+CONFIG_PCI_XGENE=y
+CONFIG_PCIE_ALTERA=y
+CONFIG_PCIE_ALTERA_MSI=y
+CONFIG_PCI_HOST_THUNDER_PEM=y
+CONFIG_PCI_HOST_THUNDER_ECAM=y
+CONFIG_PCI_IMX6=y
+CONFIG_PCI_LAYERSCAPE=y
+CONFIG_PCI_HISI=y
+CONFIG_PCIE_KIRIN=y
+CONFIG_PCIE_LAYERSCAPE_GEN4=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=320
-CONFIG_ARM_CCI400_PMU=y
-CONFIG_ARM_CCI5xx_PMU=y
+CONFIG_FW_LOADER_USER_HELPER=y
+CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
+CONFIG_BRCMSTB_GISB_ARB=y
+CONFIG_SIMPLE_PM_BUS=y
+CONFIG_VEXPRESS_CONFIG=y
+CONFIG_FSL_MC_BUS=y
+CONFIG_FSL_MC_UAPI_SUPPORT=y
CONFIG_MTD=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_BLOCK=y
-CONFIG_MTD_RAM=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_SLRAM=y
-CONFIG_MTD_NAND=y
+CONFIG_MTD_SST25L=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_NAND_DENALI_DT=y
CONFIG_MTD_NAND_GPMI_NAND=y
+CONFIG_MTD_NAND_FSL_IFC=y
CONFIG_MTD_SPI_NOR=y
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
-CONFIG_SPI_FSL_QUADSPI=y
-CONFIG_SPI_FSL_FLEXSPI=y
CONFIG_MTD_UBI=y
-CONFIG_OF_OVERLAY=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=m
-CONFIG_XEN_BLKDEV_BACKEND=y
+CONFIG_XEN_BLKDEV_BACKEND=m
CONFIG_VIRTIO_BLK=y
+CONFIG_BLK_DEV_NVME=y
CONFIG_SENSORS_FXOS8700=y
CONFIG_SENSORS_FXAS2100X=y
CONFIG_SRAM=y
+CONFIG_EEPROM_AT24=y
+CONFIG_EEPROM_AT25=m
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_HISI_SAS=y
+CONFIG_SCSI_HISI_SAS_PCI=y
+CONFIG_SCSI_MPT3SAS=m
+CONFIG_SCSI_UFSHCD=y
+CONFIG_SCSI_UFSHCD_PLATFORM=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_IMX=y
CONFIG_AHCI_CEVA=y
-CONFIG_AHCI_MVEBU=y
CONFIG_AHCI_XGENE=y
CONFIG_AHCI_QORIQ=y
CONFIG_SATA_SIL24=y
-CONFIG_SATA_RCAR=y
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
CONFIG_NETDEVICES=y
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
@@ -215,25 +243,53 @@ CONFIG_TUN=y
CONFIG_VETH=m
CONFIG_VIRTIO_NET=y
CONFIG_AMD_XGBE=y
-CONFIG_NET_XGENE=y
+CONFIG_ATL1C=m
+CONFIG_BNX2X=m
CONFIG_MACB=y
+CONFIG_THUNDER_NIC_PF=y
+CONFIG_FEC=y
+CONFIG_FSL_SDK_DPAA_ETH=y
+CONFIG_FSL_DPAA2_ETH=y
+CONFIG_FSL_ENETC=y
+CONFIG_FSL_ENETC_VF=y
+CONFIG_FSL_ENETC_MDIO=y
+CONFIG_HIX5HD2_GMAC=y
CONFIG_HNS_DSAF=y
CONFIG_HNS_ENET=y
+CONFIG_HNS3=y
+CONFIG_HNS3_HCLGE=y
+CONFIG_HNS3_ENET=y
+CONFIG_E1000=y
CONFIG_E1000E=y
CONFIG_IGB=y
CONFIG_IGBVF=y
+CONFIG_MVMDIO=y
CONFIG_SKY2=y
-CONFIG_RAVB=y
+CONFIG_MLX4_EN=m
+CONFIG_MLX5_CORE=m
+CONFIG_MLX5_CORE_EN=y
+CONFIG_MSCC_OCELOT_SWITCH=y
+CONFIG_QCOM_EMAC=m
CONFIG_SMC91X=y
CONFIG_SMSC911X=y
CONFIG_STMMAC_ETH=m
+CONFIG_MDIO_BITBANG=y
+CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y
+CONFIG_AQUANTIA_PHY=y
CONFIG_AT803X_PHY=y
+CONFIG_INPHI_PHY=y
+CONFIG_MARVELL_PHY=m
+CONFIG_MARVELL_10G_PHY=m
CONFIG_MICREL_PHY=y
-CONFIG_NXP_TJA110X_PHY=y
-CONFIG_REALTEK_PHY=m
+CONFIG_MICROSEMI_PHY=y
+CONFIG_NXP_TJA11XX_PHY=y
+CONFIG_REALTEK_PHY=y
+CONFIG_ROCKCHIP_PHY=y
+CONFIG_VITESSE_PHY=y
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=m
+CONFIG_USB_LAN78XX=m
CONFIG_USB_USBNET=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SR9800=m
@@ -241,23 +297,22 @@ CONFIG_USB_NET_SMSC75XX=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
-# CONFIG_WLAN_VENDOR_ATH is not set
-CONFIG_BCMDHD_1363=y
-CONFIG_BCMDHD_PCIE=y
+CONFIG_BRCMFMAC=m
+CONFIG_BRCMFMAC_PCIE=y
CONFIG_HOSTAP=y
-CONFIG_RTL_CARDS=m
-# CONFIG_WLAN_VENDOR_TI is not set
-CONFIG_XEN_NETDEV_BACKEND=m
-CONFIG_IVSHMEM_NET=y
-CONFIG_INPUT_POLLDEV=y
+CONFIG_WL18XX=m
+CONFIG_WLCORE_SDIO=m
+CONFIG_IVSHMEM_NET=m
CONFIG_INPUT_EVDEV=y
+CONFIG_KEYBOARD_ADC=m
CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_SNVS_PWRKEY=y
CONFIG_KEYBOARD_IMX_SC_PWRKEY=y
+CONFIG_KEYBOARD_CROS_EC=y
CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_I2C=y
+CONFIG_TOUCHSCREEN_ATMEL_MXT=m
+CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_I2C=m
CONFIG_INPUT_MISC=y
-CONFIG_INPUT_PM8941_PWRKEY=y
-CONFIG_INPUT_HISI_POWERKEY=y
CONFIG_INPUT_MPL3115=y
CONFIG_INPUT_ISL29023=y
# CONFIG_SERIO_SERPORT is not set
@@ -265,162 +320,187 @@ CONFIG_SERIO_AMBAKMI=y
CONFIG_LEGACY_PTY_COUNT=16
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DW=y
-CONFIG_SERIAL_8250_MT6577=y
-CONFIG_SERIAL_8250_UNIPHIER=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-CONFIG_SERIAL_MESON=y
-CONFIG_SERIAL_MESON_CONSOLE=y
-CONFIG_SERIAL_SAMSUNG=y
-CONFIG_SERIAL_SAMSUNG_CONSOLE=y
-CONFIG_SERIAL_TEGRA=y
+CONFIG_SERIAL_IMX=y
CONFIG_SERIAL_IMX_CONSOLE=y
-CONFIG_SERIAL_SH_SCI=y
-CONFIG_SERIAL_SH_SCI_NR_UARTS=11
-CONFIG_SERIAL_SH_SCI_CONSOLE=y
-CONFIG_SERIAL_MSM=y
-CONFIG_SERIAL_MSM_CONSOLE=y
CONFIG_SERIAL_XILINX_PS_UART=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
CONFIG_SERIAL_FSL_LPUART=y
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
-CONFIG_SERIAL_MVEBU_UART=y
+CONFIG_SERIAL_FSL_LINFLEXUART=y
+CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE=y
+CONFIG_SERIAL_DEV_BUS=y
CONFIG_VIRTIO_CONSOLE=y
+CONFIG_IPMI_HANDLER=m
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_TCG_TPM=y
+CONFIG_TCG_TIS_I2C_INFINEON=y
CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_I2C_GPIO=m
CONFIG_I2C_IMX=y
CONFIG_I2C_IMX_LPI2C=y
-CONFIG_I2C_MESON=y
-CONFIG_I2C_MV64XXX=y
-CONFIG_I2C_QUP=y
-CONFIG_I2C_TEGRA=y
-CONFIG_I2C_UNIPHIER_F=y
-CONFIG_I2C_RCAR=y
+CONFIG_I2C_RK3X=y
+CONFIG_I2C_RPBUS=y
CONFIG_I2C_CROS_EC_TUNNEL=y
+CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
-CONFIG_SPI_IMX=y
CONFIG_SPI_FSL_LPSPI=y
-CONFIG_SPI_MESON_SPIFC=m
-CONFIG_SPI_ORION=y
+CONFIG_SPI_FSL_QUADSPI=y
+CONFIG_SPI_NXP_FLEXSPI=y
+CONFIG_SPI_IMX=y
+CONFIG_SPI_FSL_DSPI=y
CONFIG_SPI_PL022=y
-CONFIG_SPI_QUP=y
-CONFIG_SPI_S3C64XX=y
-CONFIG_SPI_SPIDEV=m
+CONFIG_SPI_ROCKCHIP=y
+CONFIG_SPI_SPIDEV=y
+CONFIG_SPI_SLAVE=y
+CONFIG_SPI_SLAVE_TIME=y
+CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y
CONFIG_SPMI=y
CONFIG_PINCTRL_SINGLE=y
CONFIG_PINCTRL_MAX77620=y
-CONFIG_PINCTRL_MSM8916=y
-CONFIG_PINCTRL_MSM8996=y
-CONFIG_PINCTRL_QDF2XXX=y
-CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
+CONFIG_PINCTRL_IMX8MM=y
+CONFIG_PINCTRL_IMX8MN=y
+CONFIG_PINCTRL_IMX8MQ=y
+CONFIG_PINCTRL_IMX8QM=y
+CONFIG_PINCTRL_IMX8QXP=y
+CONFIG_PINCTRL_S32V234=y
+CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_DWAPB=y
+CONFIG_GPIO_MB86S7X=y
+CONFIG_GPIO_MPC8XXX=y
CONFIG_GPIO_PL061=y
-CONFIG_GPIO_RCAR=y
CONFIG_GPIO_XGENE=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_GPIO_MAX77620=y
CONFIG_POWER_AVS=y
-CONFIG_ROCKCHIP_IODOMAIN=y
-CONFIG_POWER_RESET_MSM=y
+CONFIG_POWER_RESET_BRCMSTB=y
+CONFIG_POWER_RESET_VEXPRESS=y
CONFIG_POWER_RESET_XGENE=y
CONFIG_POWER_RESET_SYSCON=y
+CONFIG_SYSCON_REBOOT_MODE=y
+CONFIG_BATTERY_SBS=m
CONFIG_BATTERY_BQ27XXX=y
CONFIG_SENSORS_ARM_SCPI=y
CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_PWM_FAN=m
CONFIG_SENSORS_INA2XX=m
-# CONFIG_MXC_MMA8451 is not set
+CONFIG_SENSORS_INA3221=m
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
CONFIG_CPU_THERMAL=y
CONFIG_THERMAL_EMULATION=y
-CONFIG_IMX8M_THERMAL=y
-CONFIG_IMX8MM_THERMAL=y
CONFIG_IMX_SC_THERMAL=y
CONFIG_DEVICE_THERMAL=y
-CONFIG_EXYNOS_THERMAL=y
+CONFIG_IMX8MM_THERMAL=y
+CONFIG_QORIQ_THERMAL=y
CONFIG_WATCHDOG=y
-CONFIG_S3C2410_WATCHDOG=y
+CONFIG_ARM_SP805_WATCHDOG=y
+CONFIG_ARM_SBSA_WATCHDOG=y
+CONFIG_DW_WATCHDOG=y
CONFIG_IMX2_WDT=y
-CONFIG_IMX8_WDT=y
-CONFIG_MESON_GXBB_WATCHDOG=m
-CONFIG_MESON_WATCHDOG=m
-CONFIG_RENESAS_WDT=y
-CONFIG_MFD_CROS_EC=y
-CONFIG_MFD_CROS_EC_I2C=y
-CONFIG_MFD_HI655X_PMIC=y
+CONFIG_IMX_SC_WDT=y
+CONFIG_MFD_BD9571MWV=y
+CONFIG_MFD_AXP20X_I2C=y
+CONFIG_MFD_HI6421_PMIC=y
CONFIG_MFD_MAX77620=y
-CONFIG_MFD_SPMI_PMIC=y
+CONFIG_MFD_RK808=y
CONFIG_MFD_SEC_CORE=y
-CONFIG_MFD_BD71837=y
+CONFIG_MFD_ROHM_BD718XX=y
+CONFIG_MFD_PCA9450=y
+CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_AXP20X=y
+CONFIG_REGULATOR_BD718XX=y
+CONFIG_REGULATOR_BD9571MWV=y
+CONFIG_REGULATOR_FAN53555=y
CONFIG_REGULATOR_GPIO=y
-CONFIG_REGULATOR_HI655X=y
+CONFIG_REGULATOR_HI6421V530=y
CONFIG_REGULATOR_MAX77620=y
+CONFIG_REGULATOR_MAX8973=y
+CONFIG_REGULATOR_PCA9450=y
CONFIG_REGULATOR_PFUZE100=y
CONFIG_REGULATOR_PWM=y
-CONFIG_REGULATOR_QCOM_SMD_RPM=y
CONFIG_REGULATOR_QCOM_SPMI=y
+CONFIG_REGULATOR_RK808=y
CONFIG_REGULATOR_S2MPS11=y
-CONFIG_REGULATOR_BD71837=y
+CONFIG_REGULATOR_VCTRL=m
+CONFIG_RC_CORE=m
+CONFIG_RC_DECODERS=y
+CONFIG_RC_DEVICES=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
+CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
+# CONFIG_DVB_NET is not set
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_MXC_CAPTURE=y
CONFIG_VIDEO_MX8_CAPTURE=y
-CONFIG_GMSL_MAX9286=y
+CONFIG_VIDEO_MXC_CAPTURE=y
CONFIG_VIDEO_MXC_CSI_CAMERA=y
CONFIG_MXC_MIPI_CSI=y
CONFIG_MXC_CAMERA_OV5640_MIPI_V2=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_OV5640=y
CONFIG_IMX_DPU_CORE=y
-CONFIG_IMX_DCSS_CORE=y
CONFIG_IMX_LCDIF_CORE=y
CONFIG_DRM=y
+CONFIG_DRM_I2C_NXP_TDA998X=m
+CONFIG_DRM_MALI_DISPLAY=m
CONFIG_DRM_NOUVEAU=m
-CONFIG_DRM_VIVANTE=m
-CONFIG_DRM_MSM=m
-CONFIG_DRM_TEGRA=m
+CONFIG_DRM_RCAR_LVDS=m
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_PANEL_RAYDIUM_RM67191=y
+CONFIG_DRM_SII902X=m
CONFIG_DRM_I2C_ADV7511=y
+CONFIG_DRM_NWL_MIPI_DSI=y
+CONFIG_DRM_CDNS_HDMI_CEC=y
+CONFIG_DRM_DW_HDMI_I2S_AUDIO=m
CONFIG_DRM_ITE_IT6263=y
+CONFIG_DRM_IMX=y
CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
CONFIG_DRM_IMX_TVE=y
CONFIG_DRM_IMX_LDB=y
CONFIG_DRM_IMX_HDMI=y
-CONFIG_DRM_IMX_NWL_DSI=y
CONFIG_DRM_IMX_SEC_DSIM=y
-CONFIG_DRM_IMX_HDP=y
-CONFIG_IMX_HDP_CEC=y
+CONFIG_DRM_IMX_CDNS_MHDP=y
+CONFIG_DRM_IMX_DCSS=y
+CONFIG_DRM_ETNAVIV=m
+CONFIG_DRM_HISI_HIBMC=m
CONFIG_DRM_HISI_KIRIN=m
CONFIG_DRM_MXSFB=y
-CONFIG_FB_IMX64=y
-CONFIG_FB_IMX64_DEBUG=y
+CONFIG_DRM_PL111=m
+CONFIG_DRM_LIMA=m
+CONFIG_DRM_PANFROST=m
CONFIG_FB_ARMCLCD=y
-CONFIG_FB_MXC_DISP_FRAMEWORK=y
+CONFIG_FB_EFI=y
CONFIG_BACKLIGHT_GENERIC=m
CONFIG_BACKLIGHT_PWM=y
CONFIG_BACKLIGHT_LP855X=m
-CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=y
CONFIG_SND=y
+CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_SOC=y
-CONFIG_SND_SOC_FSL_ACM=y
-CONFIG_SND_SOC_FSL_DSP=y
+CONFIG_SND_SOC_FSL_DAI=m
+CONFIG_SND_SOC_FSL_EASRC=y
CONFIG_SND_IMX_SOC=y
CONFIG_SND_SOC_IMX_AK4458=y
CONFIG_SND_SOC_IMX_AK5558=y
@@ -428,63 +508,61 @@ CONFIG_SND_SOC_IMX_AK4497=y
CONFIG_SND_SOC_IMX_WM8960=y
CONFIG_SND_SOC_IMX_WM8524=y
CONFIG_SND_SOC_IMX_CS42888=y
-CONFIG_SND_SOC_IMX_WM8962=y
CONFIG_SND_SOC_IMX_MICFIL=y
CONFIG_SND_SOC_IMX_RPMSG=y
CONFIG_SND_SOC_IMX_MQS=y
CONFIG_SND_SOC_IMX_SPDIF=y
-CONFIG_SND_SOC_IMX_AMIX=y
+CONFIG_SND_SOC_IMX_AUDMIX=y
+CONFIG_SND_SOC_IMX_PDM_MIC=y
+CONFIG_SND_SOC_IMX_DSP=y
CONFIG_SND_SOC_IMX_CDNHDMI=y
-CONFIG_SND_SOC_SAMSUNG=y
-CONFIG_SND_SOC_RCAR=y
-CONFIG_SND_SOC_AK4613=y
-CONFIG_HID_A4TECH=y
-CONFIG_HID_APPLE=y
-CONFIG_HID_BELKIN=y
-CONFIG_HID_CHERRY=y
-CONFIG_HID_CHICONY=y
-CONFIG_HID_CYPRESS=y
-CONFIG_HID_EZKEY=y
-CONFIG_HID_KENSINGTON=y
-CONFIG_HID_LOGITECH=y
-CONFIG_HID_MICROSOFT=y
-CONFIG_HID_MONTEREY=y
-CONFIG_HID_MULTITOUCH=y
+CONFIG_SND_SOC_SOF_TOPLEVEL=y
+CONFIG_SND_SOC_SOF_OF=m
+CONFIG_SND_SOC_SOF_IMX_TOPLEVEL=y
+CONFIG_SND_SOC_SOF_IMX8_SUPPORT=y
+CONFIG_SND_SOC_SOF_IMX8=m
+CONFIG_SND_SOC_AK4613=m
+CONFIG_SND_SOC_DMIC=m
+CONFIG_SND_SOC_ES7134=m
+CONFIG_SND_SOC_ES7241=m
+CONFIG_SND_SOC_MAX98357A=m
+CONFIG_SND_SOC_PCM3168A_I2C=m
+CONFIG_SND_SOC_SGTL5000=m
+CONFIG_SND_SOC_SPDIF=m
+CONFIG_SND_SOC_TAS571X=m
+CONFIG_SND_SIMPLE_CARD=y
+CONFIG_SND_AUDIO_GRAPH_CARD=y
+CONFIG_I2C_HID=m
CONFIG_USB=y
CONFIG_USB_OTG=y
CONFIG_USB_OTG_WHITELIST=y
CONFIG_USB_XHCI_HCD=y
-CONFIG_USB_XHCI_TEGRA=y
CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_EHCI_MSM=y
-CONFIG_USB_EHCI_EXYNOS=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_EXYNOS=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_HCD_TEST_MODE=y
-CONFIG_USB_RENESAS_USBHS=m
CONFIG_USB_ACM=m
CONFIG_USB_STORAGE=y
+CONFIG_USB_CDNS3=y
+CONFIG_USB_CDNS3_GADGET=y
+CONFIG_USB_CDNS3_HOST=y
+CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC2=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_ISP1760=y
-CONFIG_USB_ISP1760_HOST_ROLE=y
-CONFIG_USB_CDNS3=y
-CONFIG_USB_CDNS3_GADGET=y
-CONFIG_USB_CDNS3_HOST=y
CONFIG_USB_TEST=m
-CONFIG_USB_EHSET_TEST_FIXTURE=y
+CONFIG_USB_EHSET_TEST_FIXTURE=m
CONFIG_USB_HSIC_USB3503=y
CONFIG_NOP_USB_XCEIV=y
-CONFIG_USB_GPIO_VBUS=y
CONFIG_USB_MXS_PHY=y
CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
-CONFIG_USB_RENESAS_USBHS_UDC=m
+CONFIG_USB_SNP_UDC_PLAT=y
+CONFIG_USB_BDC_UDC=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
@@ -495,65 +573,82 @@ CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
-CONFIG_FSL_UTP=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_UAC1=y
+CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_ZERO=m
CONFIG_USB_AUDIO=m
-CONFIG_GADGET_UAC1=y
CONFIG_USB_ETH=m
-CONFIG_USB_ETH_EEM=y
-CONFIG_USB_G_NCM=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
-CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_TYPEC=y
+CONFIG_TYPEC_TCPM=y
+CONFIG_TYPEC_TCPCI=y
+CONFIG_TYPEC_SWITCH_GPIO=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_ARMMMCI=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_ACPI=y
CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_OF_ARASAN=y
+CONFIG_MMC_SDHCI_OF_ESDHC=y
+CONFIG_MMC_SDHCI_CADENCE=y
CONFIG_MMC_SDHCI_ESDHC_IMX=y
-# CONFIG_MMC_SDHCI_IPROC is not set
+CONFIG_MMC_SDHCI_F_SDH30=y
CONFIG_MMC_SPI=y
-CONFIG_MMC_SDHI=y
-CONFIG_MXC_SIM=y
-CONFIG_MXC_EMVSIM=y
-CONFIG_MXC_MLB150=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_EXYNOS=y
+CONFIG_MMC_DW_HI3798CV200=y
+CONFIG_MMC_DW_K3=y
+CONFIG_MMC_SDHCI_XENON=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_PWM=y
CONFIG_LEDS_SYSCON=y
+CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+CONFIG_LEDS_TRIGGER_PANIC=y
+CONFIG_EDAC=y
+CONFIG_EDAC_GHES=y
CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1307=y
CONFIG_RTC_DRV_MAX77686=y
+CONFIG_RTC_DRV_RK808=m
+CONFIG_RTC_DRV_PCF85363=y
+CONFIG_RTC_DRV_RX8581=m
CONFIG_RTC_DRV_S5M=y
CONFIG_RTC_DRV_DS3232=y
+CONFIG_RTC_DRV_PCF2127=y
CONFIG_RTC_DRV_EFI=y
-CONFIG_RTC_DRV_S3C=y
+CONFIG_RTC_DRV_CROS_EC=y
CONFIG_RTC_DRV_PL031=y
-CONFIG_RTC_DRV_TEGRA=y
CONFIG_RTC_DRV_SNVS=y
CONFIG_RTC_DRV_IMX_SC=y
-CONFIG_RTC_DRV_XGENE=y
CONFIG_DMADEVICES=y
+CONFIG_BCM_SBA_RAID=m
+CONFIG_FSL_EDMA=y
CONFIG_FSL_EDMA_V3=y
CONFIG_IMX_SDMA=y
+CONFIG_MV_XOR_V2=y
CONFIG_MXS_DMA=y
CONFIG_PL330_DMA=y
-CONFIG_TEGRA20_APB_DMA=y
-CONFIG_QCOM_BAM_DMA=y
CONFIG_QCOM_HIDMA_MGMT=y
CONFIG_QCOM_HIDMA=y
-CONFIG_RCAR_DMAC=y
+CONFIG_DMATEST=y
CONFIG_UIO=y
CONFIG_UIO_PCI_GENERIC=y
+CONFIG_VFIO=y
+CONFIG_VFIO_PCI=y
+CONFIG_VFIO_FSL_MC=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MMIO=y
@@ -561,50 +656,75 @@ CONFIG_XEN_GNTDEV=y
CONFIG_XEN_GRANT_DEV_ALLOC=y
CONFIG_STAGING=y
CONFIG_STAGING_MEDIA=y
-CONFIG_MEDIA_CEC=y
+CONFIG_VIDEO_IMX_CAPTURE=y
CONFIG_ION=y
-CONFIG_ION_MXC=y
-CONFIG_TYPEC_TCPM=y
-CONFIG_TYPEC_TCPCI=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
+CONFIG_FSL_DPAA2=y
+CONFIG_FSL_DPAA2_ETHSW=y
+CONFIG_FSL_DPAA2_MAC=y
+CONFIG_FSL_SDK_DPA=y
+CONFIG_FSL_PPFE=y
+CONFIG_FSL_PPFE_UTIL_DISABLED=y
+CONFIG_MFD_CROS_EC=y
+CONFIG_CROS_EC_I2C=y
+CONFIG_CROS_EC_SPI=y
+CONFIG_COMMON_CLK_VERSATILE=y
+CONFIG_CLK_SP810=y
+CONFIG_CLK_VEXPRESS_OSC=y
+CONFIG_COMMON_CLK_RK808=y
CONFIG_COMMON_CLK_SCPI=y
CONFIG_COMMON_CLK_CS2000_CP=y
CONFIG_COMMON_CLK_S2MPS11=y
-CONFIG_CLK_QORIQ=y
-CONFIG_COMMON_CLK_QCOM=y
-CONFIG_MSM_GCC_8916=y
-CONFIG_MSM_MMCC_8996=y
-CONFIG_HWSPINLOCK_QCOM=y
-CONFIG_CLKSRC_IMX_SYS_CNT=y
-CONFIG_MAILBOX=y
+CONFIG_COMMON_CLK_XGENE=y
+CONFIG_COMMON_CLK_PWM=y
+CONFIG_CLK_IMX8MM=y
+CONFIG_CLK_IMX8MN=y
+CONFIG_CLK_IMX8MQ=y
+CONFIG_CLK_IMX8QXP=y
+CONFIG_HWSPINLOCK=y
CONFIG_ARM_MHU=y
-CONFIG_HI6220_MBOX=y
+CONFIG_IMX_MBOX=y
+CONFIG_PLATFORM_MHU=y
CONFIG_ARM_SMMU=y
-CONFIG_ARCH_MXC_ARM64=y
-CONFIG_QCOM_SMEM=y
-CONFIG_QCOM_SMD=y
-CONFIG_QCOM_SMD_RPM=y
-CONFIG_ARCH_TEGRA_132_SOC=y
-CONFIG_ARCH_TEGRA_210_SOC=y
-CONFIG_EXTCON_PTN5150=y
+CONFIG_ARM_SMMU_V3=y
+CONFIG_REMOTEPROC=y
+CONFIG_RPMSG_QCOM_GLINK_RPM=y
+CONFIG_SOC_BRCMSTB=y
+CONFIG_FSL_MC_DPIO=y
+CONFIG_FSL_QIXIS=y
+CONFIG_IMX_SCU_SOC=y
+CONFIG_SOC_TI=y
+CONFIG_EXTCON_USB_GPIO=y
+CONFIG_EXTCON_USBC_CROS_EC=y
CONFIG_IIO=y
-CONFIG_EXYNOS_ADC=y
CONFIG_IMX8QXP_ADC=y
+CONFIG_IIO_CROS_EC_SENSORS_CORE=m
+CONFIG_IIO_CROS_EC_SENSORS=m
+CONFIG_IIO_CROS_EC_LIGHT_PROX=m
+CONFIG_IIO_CROS_EC_BARO=m
CONFIG_PWM=y
-CONFIG_PWM_FSL_FTM=y
-CONFIG_PWM_IMX=y
-CONFIG_PWM_SAMSUNG=y
-CONFIG_PWM_TEGRA=m
-CONFIG_PHY_HI6220_USB=y
+CONFIG_PWM_CROS_EC=m
+CONFIG_PWM_IMX27=y
CONFIG_PHY_XGENE=y
-CONFIG_PHY_TEGRA_XUSB=y
-CONFIG_IMX8_DDR_PERF=y
-CONFIG_NVMEM=y
+CONFIG_PHY_MIXEL_MIPI_DPHY=y
+CONFIG_PHY_QCOM_USB_HS=y
+CONFIG_PHY_SAMSUNG_USB2=y
+CONFIG_FSL_IMX8_DDR_PMU=m
+CONFIG_HISI_PMU=y
CONFIG_NVMEM_IMX_OCOTP=y
-CONFIG_NVMEM_IMX_SCU_OCOTP=y
+CONFIG_NVMEM_IMX_OCOTP_SCU=y
+CONFIG_FPGA=y
+CONFIG_FPGA_BRIDGE=m
+CONFIG_ALTERA_FREEZE_BRIDGE=m
+CONFIG_FPGA_REGION=m
+CONFIG_OF_FPGA_REGION=m
CONFIG_TEE=y
CONFIG_OPTEE=y
-CONFIG_ARM_SCPI_PROTOCOL=y
-CONFIG_ACPI=y
+CONFIG_MUX_MMIO=y
+CONFIG_MXC_SIM=y
+CONFIG_MXC_EMVSIM=y
+CONFIG_MXC_MLB150=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
@@ -631,49 +751,47 @@ CONFIG_ROOT_NFS=y
CONFIG_9P_FS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
-CONFIG_KVM=y
-CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_FS=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_LOCKUP_DETECTOR=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_PREEMPT is not set
-# CONFIG_FTRACE is not set
-CONFIG_MEMTEST=y
CONFIG_SECURITY=y
+CONFIG_CRYPTO_USER=y
CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_CHACHA20POLY1305=y
+CONFIG_CRYPTO_CHACHA20POLY1305=m
CONFIG_CRYPTO_ECHAINIV=y
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_CTS=y
-CONFIG_CRYPTO_LRW=y
-CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_MD4=y
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_RMD128=y
-CONFIG_CRYPTO_RMD160=y
-CONFIG_CRYPTO_RMD256=y
-CONFIG_CRYPTO_RMD320=y
-CONFIG_CRYPTO_SHA1=y
-CONFIG_CRYPTO_SHA512=y
-CONFIG_CRYPTO_SHA3=y
-CONFIG_CRYPTO_TGR192=y
-CONFIG_CRYPTO_WP512=y
-CONFIG_CRYPTO_BLOWFISH=y
-CONFIG_CRYPTO_CAMELLIA=y
-CONFIG_CRYPTO_CAST5=y
-CONFIG_CRYPTO_CAST6=y
-CONFIG_CRYPTO_SERPENT=y
-CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_TLS=m
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_CFB=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_OFB=m
+CONFIG_CRYPTO_XTS=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_DEV_FSL_CAAM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=y
+CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=m
CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
-CONFIG_ARM64_CRYPTO=y
-CONFIG_CRYPTO_SHA1_ARM64_CE=y
-CONFIG_CRYPTO_SHA2_ARM64_CE=y
-CONFIG_CRYPTO_GHASH_ARM64_CE=y
-CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
-CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
-CONFIG_CRYPTO_CRC32_ARM64=y
+CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y
+CONFIG_INDIRECT_PIO=y
+CONFIG_CMA_SIZE_MBYTES=320
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_FTRACE is not set
+CONFIG_MEMTEST=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_4.9-1.0.x.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_4.9-1.0.x.bb
deleted file mode 100644
index aff27bbf..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_4.9-1.0.x.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2015, 2017 O.S. Systems Software LTDA.
-# Released under the MIT license (see COPYING.MIT for the terms)
-
-SUMMARY = "FSL Community BSP i.MX Linux kernel with backported features and fixes"
-DESCRIPTION = "Linux kernel based on NXP 4.9.11-1.0.0 GA release, used by FSL Community BSP in order to \
-provide support for i.MX based platforms and include official Linux kernel stable updates, backported \
-features and fixes coming from the vendors, kernel community or FSL Community itself."
-
-include linux-fslc.inc
-
-PV .= "+git${SRCPV}"
-
-SRCBRANCH = "4.9-1.0.x-imx"
-SRCREV = "953c6e30c9701fda69ef08e2476c541dc4fb1453"
-
-COMPATIBLE_MACHINE = "(mx6|mx7)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_5.4.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_5.4.bb
new file mode 100644
index 00000000..ef3a7d52
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx_5.4.bb
@@ -0,0 +1,86 @@
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# SPDX-License-Identifier: MIT
+#
+
+SUMMARY = "Linux Kernel provided by NXP and supported by Community"
+DESCRIPTION = "Linux Kernel provided by NXP as the part of release distribution. \
+Main focus is set on i.MX Family Reference Boards. \
+It includes support for many NXP Proprietary IPs (GPU, VPU, IPU). \
+Latest stable Kernel patchlevel is applied and maintained by Community."
+
+###############################################################################
+# This recipe (and corresponding kernel repository and branch) receives updates
+# from 3 different sources:
+# 1. Stable [linux-5.4.y] branch updates of korg;
+# 2. NXP-specific updates via branch [lf-5.4.y] shared via CodeAurora forum;
+# 3. Critical patches, which are not (yet) integrated into either of 2 above
+# sources, but are required to be applied to the kernel tree.
+#
+# Therefore, there is a need to keep track on the patches which are introduced
+# from every source. This could be achieved in this recipe by filling the
+# below list with the information once the update is performed from any source.
+#
+# Once the critical patch gets merged into the stable branch, or NXP-specific
+# patches would be covered by the tag - individual entries from sections below
+# could be removed.
+#
+# ------------------------------------------------------------------------------
+# 1. Stable (tag or SHA(s))
+# ------------------------------------------------------------------------------
+# tag: v5.4.51
+#
+# ------------------------------------------------------------------------------
+# 2. NXP-specific (tag or SHA(s))
+# ------------------------------------------------------------------------------
+# tag: lf-5.4.y-1.0.0
+# 40fe6bd54230 MLK-23844-2 ARM64: dts: freescale: imx8mm: correct VDDARM@1.6GHz
+# aec0c14ae61d MLK-23844-1: ARM64: dts: freescale: imx8mn-ddr4-evk: cleanup Rhom pmic
+# e8e35fd0e759 MLK-23275-2: ARM64: dts: freescale: imx8mn-ddr4-evk: correct ldo1/ldo2 voltage
+# 975d8ab07267 MLK-23275-1: ARM64: dts: freescale: fsl-imx8mm-evk: correct ldo1/ldo2 voltage
+# 4711466d535c MLK-23562: regulator: core: adjust supply voltage in bypass
+# bbbc26a40a9c MLK-13793-6 regulator: anatop: fix min dropout for bypass mode
+#
+# ------------------------------------------------------------------------------
+# 3. Critical patches (SHA(s))
+# ------------------------------------------------------------------------------
+# 285869ec9087 ARM: dts: imx6ul-kontron-n6x1x-s: Remove an obsolete comment and fix indentation
+# f03791085754 ARM: dts: imx6ul-kontron-n6x1x-s: Add vbus-supply and overcurrent polarity to usb nodes
+# 67e44952c670 ARM: dts: imx6ul-kontron-n6x1x: Add 'chosen' node with 'stdout-path'
+# d4b105f930e2 ARM: dts: Add support for two more Kontron evalkit boards 'N6311 S' and 'N6411 S'
+# e778467f65d0 ARM: dts: imx6ul-kontron-n6310-s: Move common nodes to a separate file
+# 8b39f5e53831 ARM: dts: Add support for two more Kontron SoMs N6311 and N6411
+# 3bee262233eb ARM: dts: imx6ul-kontron-n6310: Move common SoM nodes to a separate file
+# 40a6a98b3f38 ARM: imx: Fix boot crash if ocotp is not found
+# 8aad5031be00 ARM: imx: Correct ocotp id for serial number support of i.MX6ULL/ULZ SoCs
+# 564409aa3b33 soc: imx-scu: Using existing serial_number instead of UID
+# 0ee8e005bbfc soc: imx8: Using existing serial_number instead of UID
+# 134cbb845fc7 ARM: imx: Add serial number support for i.MX6/7 SoCs
+#
+# NOTE to upgraders:
+# This recipe should NOT collect individual patches, they should be applied to
+# the linux-fslc kernel tree on the corresponding branch, and tracking
+# information should be properly filled in above.
+###############################################################################
+
+include linux-fslc.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+
+SRCBRANCH = "5.4-1.0.0-imx"
+SRCREV = "9fb52fae75909b9ca83b2a04e824f97d2df85302"
+
+# PV is defined in the base in linux-imx.inc file and uses the LINUX_VERSION definition
+# required by kernel-yocto.bbclass.
+#
+# LINUX_VERSION define should match to the kernel version referenced by SRC_URI and
+# should be updated once patchlevel is merged.
+LINUX_VERSION = "5.4.51"
+
+# Local version indicates the branch name in the NXP kernel tree where patches are collected from.
+LOCALVERSION = "-lf-5.4.y"
+
+DEFAULT_PREFERENCE = "1"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc_4.20.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19.bb
index d7bf4b7a..41b09347 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc_4.20.bb
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19.bb
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2019 O.S. Systems Software LTDA.
+# Copyright (C) 2012-2020 O.S. Systems Software LTDA.
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "FSL Community BSP Linux mainline based kernel with backported features and fixes"
@@ -11,9 +11,9 @@ include linux-fslc.inc
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
-PV = "4.20+git${SRCPV}"
+PV = "4.19.125+git${SRCPV}"
-SRCBRANCH = "4.20.x+fslc"
-SRCREV = "bf414f71d71348bf549d320fa6518b04738dbaa1"
+SRCBRANCH = "4.19.x+fslc"
+SRCREV = "d839dc0169b3c568813f2ee2abc30720f5244b89"
COMPATIBLE_MACHINE = "(mxs|mx5|mx6|vf|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/defconfig
index f9e53a6a..bab877b9 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-imx/defconfig
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/defconfig
@@ -6,10 +6,11 @@ CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
+CONFIG_NAMESPACES=y
+CONFIG_NET_NS=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_EXPERT=y
-CONFIG_KALLSYMS_ALL=y
CONFIG_PERF_EVENTS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
@@ -18,32 +19,50 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
+CONFIG_ARCH_MULTI_V6=y
CONFIG_ARCH_MXC=y
+CONFIG_MACH_MX31LILLY=y
+CONFIG_MACH_MX31LITE=y
+CONFIG_MACH_PCM037=y
+CONFIG_MACH_PCM037_EET=y
+CONFIG_MACH_MX31_3DS=y
+CONFIG_MACH_MX31MOBOARD=y
+CONFIG_MACH_QONG=y
+CONFIG_MACH_ARMADILLO5X0=y
+CONFIG_MACH_KZM_ARM11_01=y
+CONFIG_MACH_IMX31_DT=y
+CONFIG_MACH_IMX35_DT=y
+CONFIG_MACH_PCM043=y
+CONFIG_MACH_MX35_3DS=y
+CONFIG_MACH_VPR200=y
CONFIG_SOC_IMX50=y
+CONFIG_SOC_IMX51=y
CONFIG_SOC_IMX53=y
CONFIG_SOC_IMX6Q=y
CONFIG_SOC_IMX6SL=y
+CONFIG_SOC_IMX6SLL=y
CONFIG_SOC_IMX6SX=y
-CONFIG_SOC_IMX6ULL=y
+CONFIG_SOC_IMX6UL=y
CONFIG_SOC_IMX7D=y
-CONFIG_SOC_IMX6SLL=y
CONFIG_SOC_VF610=y
-# CONFIG_SWP_EMULATE is not set
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_IMX6=y
CONFIG_SMP=y
-CONFIG_VMSPLIT_2G=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
+CONFIG_ARM_PSCI=y
+CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_HIGHMEM=y
-CONFIG_CMA=y
+CONFIG_FORCE_MAX_ZONEORDER=14
CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
+CONFIG_KEXEC=y
CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
-CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
+CONFIG_CPUFREQ_DT=y
CONFIG_ARM_IMX6Q_CPUFREQ=y
-CONFIG_ARM_IMX7D_CPUFREQ=y
CONFIG_CPU_IDLE=y
CONFIG_VFP=y
CONFIG_NEON=y
@@ -59,31 +78,24 @@ CONFIG_IP_PNP_DHCP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
-CONFIG_VLAN_8021Q=y
-CONFIG_LLC2=y
+CONFIG_NETFILTER=y
CONFIG_CAN=y
CONFIG_CAN_FLEXCAN=y
-CONFIG_CAN_M_CAN=y
CONFIG_BT=y
-CONFIG_BT_RFCOMM=y
-CONFIG_BT_RFCOMM_TTY=y
-CONFIG_BT_BNEP=y
-CONFIG_BT_BNEP_MC_FILTER=y
-CONFIG_BT_BNEP_PROTO_FILTER=y
-CONFIG_BT_HIDP=y
-CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIUART=y
-CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_ATH3K=y
-CONFIG_BT_HCIBCM203X=y
-CONFIG_BT_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_BNEP=m
CONFIG_CFG80211=y
+CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
+CONFIG_RFKILL=y
+CONFIG_RFKILL_INPUT=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=0
+CONFIG_CMA_SIZE_MBYTES=64
+CONFIG_FW_LOADER_USER_HELPER=y
+CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
CONFIG_IMX_WEIM=y
CONFIG_CONNECTOR=y
CONFIG_MTD=y
@@ -100,15 +112,16 @@ CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
+CONFIG_MTD_NAND_VF610_NFC=y
CONFIG_MTD_NAND_MXC=y
CONFIG_MTD_SPI_NOR=y
CONFIG_SPI_FSL_QUADSPI=y
CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_FASTMAP=y
+CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
-CONFIG_SENSORS_FXOS8700=y
-CONFIG_SENSORS_FXAS2100X=y
CONFIG_EEPROM_AT24=y
CONFIG_EEPROM_AT25=y
# CONFIG_SCSI_PROC_FS is not set
@@ -136,160 +149,161 @@ CONFIG_SMC91X=y
CONFIG_SMC911X=y
CONFIG_SMSC911X=y
# CONFIG_NET_VENDOR_STMICRO is not set
+CONFIG_AT803X_PHY=y
CONFIG_MICREL_PHY=y
+CONFIG_SMSC_PHY=y
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=m
-CONFIG_USB_USBNET=m
+CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=m
-CONFIG_BCMDHD=y
-CONFIG_BCMDHD_SDIO=y
-CONFIG_BCMDHD_FW_PATH="/lib/firmware/bcm/ZP_BCM4339/fw_bcmdhd.bin"
-CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/bcm/ZP_BCM4339/bcmdhd.ZP.OOB.cal"
-# CONFIG_RTL_CARDS is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_BRCMFMAC=m
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+CONFIG_MWIFIEX_PCIE=m
+CONFIG_WL12XX=m
+CONFIG_WL18XX=m
+CONFIG_WLCORE_SDIO=m
+# CONFIG_WILINK_PLATFORM_DATA is not set
CONFIG_INPUT_EVDEV=y
-CONFIG_INPUT_EVBUG=m
CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_SNVS_PWRKEY=y
CONFIG_KEYBOARD_IMX=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_TOUCHSCREEN_EGALAX=y
-CONFIG_TOUCHSCREEN_ELAN_TS=y
CONFIG_TOUCHSCREEN_MAX11801=y
CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
+CONFIG_TOUCHSCREEN_EDT_FT5X06=y
CONFIG_TOUCHSCREEN_MC13783=y
+CONFIG_TOUCHSCREEN_TSC2004=y
CONFIG_TOUCHSCREEN_TSC2007=y
CONFIG_TOUCHSCREEN_STMPE=y
+CONFIG_TOUCHSCREEN_SX8654=y
+CONFIG_TOUCHSCREEN_COLIBRI_VF50=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_MMA8450=y
-CONFIG_INPUT_MPL3115=y
-CONFIG_SENSOR_FXLS8471=y
-CONFIG_INPUT_ISL29023=y
CONFIG_SERIO_SERPORT=m
# CONFIG_LEGACY_PTYS is not set
-# CONFIG_DEVKMEM is not set
CONFIG_SERIAL_IMX=y
CONFIG_SERIAL_IMX_CONSOLE=y
CONFIG_SERIAL_FSL_LPUART=y
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
-CONFIG_FSL_OTP=y
-CONFIG_HW_RANDOM_IMX_RNG=y
+CONFIG_SERIAL_DEV_BUS=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_GPIO=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
+CONFIG_I2C_GPIO=y
CONFIG_I2C_IMX=y
CONFIG_SPI=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_IMX=y
+CONFIG_SPI_FSL_DSPI=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_MAX732X=y
+CONFIG_GPIO_MC9S08DZ60=y
CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_STMPE=y
CONFIG_GPIO_74X164=y
CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_SYSCON=y
CONFIG_POWER_RESET_SYSCON_POWEROFF=y
CONFIG_POWER_SUPPLY=y
-CONFIG_SABRESD_MAX8903=y
-CONFIG_SENSORS_MAX17135=y
-CONFIG_SENSORS_MAG3110=y
-CONFIG_THERMAL=y
+CONFIG_SENSORS_GPIO_FAN=y
+CONFIG_SENSORS_IIO_HWMON=y
+CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_CPU_THERMAL=y
CONFIG_IMX_THERMAL=y
-CONFIG_DEVICE_THERMAL=y
CONFIG_WATCHDOG=y
+CONFIG_DA9062_WATCHDOG=y
+CONFIG_RN5T618_WATCHDOG=y
CONFIG_IMX2_WDT=y
CONFIG_MFD_DA9052_I2C=y
+CONFIG_MFD_DA9062=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
-CONFIG_MFD_MAX17135=y
-CONFIG_MFD_SI476X_CORE=y
+CONFIG_MFD_RN5T618=y
CONFIG_MFD_STMPE=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_DA9052=y
+CONFIG_REGULATOR_DA9062=y
CONFIG_REGULATOR_GPIO=y
-CONFIG_REGULATOR_MAX17135=y
CONFIG_REGULATOR_MC13783=y
CONFIG_REGULATOR_MC13892=y
CONFIG_REGULATOR_PFUZE100=y
-CONFIG_MEDIA_SUPPORT=y
-CONFIG_MEDIA_CAMERA_SUPPORT=y
-CONFIG_MEDIA_RADIO_SUPPORT=y
-CONFIG_MEDIA_RC_SUPPORT=y
+CONFIG_REGULATOR_RN5T618=y
+CONFIG_RC_CORE=y
CONFIG_RC_DEVICES=y
CONFIG_IR_GPIO_CIR=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_MXC_OUTPUT=y
-CONFIG_VIDEO_MXC_CAPTURE=m
-CONFIG_MXC_CAMERA_OV5640=m
-CONFIG_MXC_CAMERA_OV5642=m
-CONFIG_MXC_CAMERA_OV5640_MIPI=m
-CONFIG_MXC_TVIN_ADV7180=m
-CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m
-CONFIG_VIDEO_MXC_IPU_OUTPUT=y
-CONFIG_VIDEO_MXC_PXP_V4L2=y
-CONFIG_VIDEO_MXC_CSI_CAMERA=m
-CONFIG_MXC_VADC=m
-CONFIG_MXC_MIPI_CSI=m
-CONFIG_MXC_CAMERA_OV5647_MIPI=m
+CONFIG_VIDEO_MUX=y
CONFIG_SOC_CAMERA=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
-CONFIG_VIDEO_CODA=y
-CONFIG_RADIO_SI476X=y
-CONFIG_SOC_CAMERA_OV2640=y
+CONFIG_VIDEO_CODA=m
+# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
+CONFIG_VIDEO_ADV7180=m
+CONFIG_VIDEO_OV5640=m
+CONFIG_IMX_IPUV3_CORE=y
CONFIG_DRM=y
-CONFIG_DRM_VIVANTE=y
-CONFIG_FB_MXS=y
-CONFIG_FB_MXC_SYNC_PANEL=y
-CONFIG_FB_MXC_MIPI_DSI=y
-CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
-CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
-CONFIG_FB_MXC_TRULY_PANEL_TFT3P5079E=y
-CONFIG_FB_MXC_TRULY_PANEL_TFT3P5581E=y
-CONFIG_FB_MXC_LDB=y
-CONFIG_FB_MXC_HDMI=y
-CONFIG_FB_MXS_SII902X=y
-CONFIG_FB_MXC_DCIC=m
-CONFIG_HANNSTAR_CABC=y
-CONFIG_FB_MXC_EINK_PANEL=y
-CONFIG_FB_MXC_EINK_V2_PANEL=y
+CONFIG_DRM_PANEL_LVDS=y
+CONFIG_DRM_PANEL_SIMPLE=y
+CONFIG_DRM_PANEL_SEIKO_43WVF1G=y
+CONFIG_DRM_DW_HDMI_AHB_AUDIO=m
+CONFIG_DRM_DW_HDMI_CEC=y
+CONFIG_DRM_IMX=y
+CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
+CONFIG_DRM_IMX_TVE=y
+CONFIG_DRM_IMX_LDB=y
+CONFIG_DRM_IMX_HDMI=y
+CONFIG_DRM_ETNAVIV=y
+CONFIG_DRM_MXSFB=y
+CONFIG_FB_MODE_HELPERS=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_L4F00242T03=y
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_PWM=y
+CONFIG_BACKLIGHT_GPIO=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_LOGO=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_SOC=y
+CONFIG_SND_SOC_FSL_ASRC=y
CONFIG_SND_IMX_SOC=y
+CONFIG_SND_SOC_PHYCORE_AC97=y
CONFIG_SND_SOC_EUKREA_TLV320=y
-CONFIG_SND_SOC_IMX_WM8960=y
-CONFIG_SND_SOC_IMX_SII902X=y
-CONFIG_SND_SOC_IMX_WM8958=y
-CONFIG_SND_SOC_IMX_CS42888=y
-CONFIG_SND_SOC_IMX_WM8962=y
+CONFIG_SND_SOC_IMX_ES8328=y
CONFIG_SND_SOC_IMX_SGTL5000=y
-CONFIG_SND_SOC_IMX_MQS=y
CONFIG_SND_SOC_IMX_SPDIF=y
CONFIG_SND_SOC_IMX_MC13783=y
-CONFIG_SND_SOC_IMX_SI476X=y
-CONFIG_SND_SOC_IMX_HDMI=y
+CONFIG_SND_SOC_FSL_ASOC_CARD=y
+CONFIG_SND_SOC_AC97_CODEC=y
+CONFIG_SND_SOC_CS42XX8_I2C=y
+CONFIG_SND_SOC_TLV320AIC3X=y
+CONFIG_SND_SOC_WM8960=y
+CONFIG_SND_SOC_WM8962=y
CONFIG_SND_SIMPLE_CARD=y
+CONFIG_HID_MULTITOUCH=y
CONFIG_USB=y
-CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_MXC=y
-CONFIG_USB_HCD_TEST_MODE=y
-CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
CONFIG_USB_STORAGE=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
@@ -297,11 +311,14 @@ CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_SERIAL_OPTION=m
-CONFIG_USB_EHSET_TEST_FIXTURE=y
+CONFIG_USB_TEST=m
+CONFIG_USB_EHSET_TEST_FIXTURE=m
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_MXS_PHY=y
CONFIG_USB_GADGET=y
+CONFIG_USB_FSL_USB2=y
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
@@ -314,50 +331,71 @@ CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
+CONFIG_USB_CONFIGFS_F_UAC1=y
+CONFIG_USB_CONFIGFS_F_UAC2=y
+CONFIG_USB_CONFIGFS_F_MIDI=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_F_UVC=y
+CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_ZERO=m
+CONFIG_USB_AUDIO=m
CONFIG_USB_ETH=m
CONFIG_USB_G_NCM=m
CONFIG_USB_GADGETFS=m
+CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_ESDHC_IMX=y
-CONFIG_MXC_IPU=y
-CONFIG_MXC_IPU_V3_PRE=y
-CONFIG_MXC_GPU_VIV=y
-CONFIG_MXC_SIM=y
-CONFIG_MXC_MIPI_CSI2=y
-CONFIG_MXC_HDMI_CEC=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_PWM=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_ISL1208=y
+CONFIG_RTC_DRV_PCF8523=y
+CONFIG_RTC_DRV_PCF8563=y
+CONFIG_RTC_DRV_M41T80=y
+CONFIG_RTC_DRV_DA9063=y
CONFIG_RTC_DRV_MC13XXX=y
CONFIG_RTC_DRV_MXC=y
+CONFIG_RTC_DRV_MXC_V2=y
CONFIG_RTC_DRV_SNVS=y
CONFIG_DMADEVICES=y
+CONFIG_FSL_EDMA=y
CONFIG_IMX_SDMA=y
CONFIG_MXS_DMA=y
-CONFIG_MXC_PXP_V2=y
-CONFIG_MXC_PXP_V3=y
CONFIG_DMATEST=m
CONFIG_STAGING=y
CONFIG_STAGING_MEDIA=y
-# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_VIDEO_IMX_MEDIA=y
+CONFIG_COMMON_CLK_PWM=y
CONFIG_IIO=y
+CONFIG_MMA8452=y
CONFIG_IMX7D_ADC=y
CONFIG_VF610_ADC=y
+CONFIG_SENSORS_ISL29018=y
+CONFIG_MAG3110=y
+CONFIG_MPL3115=y
CONFIG_PWM=y
+CONFIG_PWM_FSL_FTM=y
CONFIG_PWM_IMX=y
+CONFIG_NVMEM_IMX_OCOTP=y
+CONFIG_NVMEM_VF610_OCOTP=y
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+CONFIG_MUX_MMIO=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
@@ -376,7 +414,7 @@ CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=y
-CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
CONFIG_JFFS2_FS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
@@ -389,34 +427,17 @@ CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_UTF8=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_SCHED_DEBUG is not set
+CONFIG_PROVE_LOCKING=y
# CONFIG_DEBUG_BUGVERBOSE is not set
CONFIG_FUNCTION_TRACER=y
+# CONFIG_ARM_UNWIND is not set
CONFIG_SECURITYFS=y
-CONFIG_CRYPTO_USER=y
-CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_CTS=y
-CONFIG_CRYPTO_LRW=y
-CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_MD4=y
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_MICHAEL_MIC=y
-CONFIG_CRYPTO_RMD128=y
-CONFIG_CRYPTO_RMD160=y
-CONFIG_CRYPTO_RMD256=y
-CONFIG_CRYPTO_RMD320=y
-CONFIG_CRYPTO_SHA512=y
-CONFIG_CRYPTO_TGR192=y
-CONFIG_CRYPTO_WP512=y
-CONFIG_CRYPTO_BLOWFISH=y
-CONFIG_CRYPTO_CAMELLIA=y
-CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_DEV_FSL_CAAM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
-CONFIG_CRYPTO_DEV_MXS_DCP=y
+CONFIG_CRYPTO_DEV_SAHARA=y
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC7=m
@@ -424,3 +445,7 @@ CONFIG_LIBCRC32C=m
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
+CONFIG_USER_NS=y
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_FQ_CODEL=y
+CONFIG_NET_SCH_FIFO=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mx25/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mx25/defconfig
new file mode 100644
index 00000000..4cd2f4a2
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mx25/defconfig
@@ -0,0 +1,189 @@
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CGROUPS=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_EXPERT=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_MULTI_V4T=y
+CONFIG_ARCH_MULTI_V5=y
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_MXC=y
+CONFIG_MACH_MX21ADS=y
+CONFIG_MACH_MX27ADS=y
+CONFIG_MACH_MX27_3DS=y
+CONFIG_MACH_IMX27_VISSTRIM_M10=y
+CONFIG_MACH_PCA100=y
+CONFIG_MACH_IMX27_DT=y
+CONFIG_SOC_IMX1=y
+CONFIG_SOC_IMX25=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_PM_DEBUG=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+CONFIG_NETFILTER=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_IMX_WEIM=y
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+# CONFIG_MTD_CFI_I2 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_MXC=y
+CONFIG_MTD_UBI=y
+CONFIG_EEPROM_AT24=y
+CONFIG_EEPROM_AT25=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+CONFIG_PATA_IMX=y
+CONFIG_NETDEVICES=y
+CONFIG_CS89x0=y
+CONFIG_CS89x0_PLATFORM=y
+CONFIG_DM9000=y
+CONFIG_SMC91X=y
+CONFIG_SMC911X=y
+CONFIG_SMSC911X=y
+CONFIG_SMSC_PHY=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_IMX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=m
+CONFIG_TOUCHSCREEN_MX25=y
+CONFIG_TOUCHSCREEN_MC13783=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_IMX=y
+CONFIG_SERIAL_IMX_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_IMX=y
+CONFIG_SPI=y
+CONFIG_SPI_IMX=y
+CONFIG_SPI_SPIDEV=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_W1=y
+CONFIG_W1_MASTER_MXC=y
+CONFIG_W1_SLAVE_THERM=y
+CONFIG_HWMON=m
+CONFIG_SENSORS_MC13783_ADC=m
+CONFIG_WATCHDOG=y
+CONFIG_IMX2_WDT=y
+CONFIG_MFD_MC13XXX_SPI=y
+CONFIG_MFD_MX25_TSADC=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_REGULATOR_MC13783=y
+CONFIG_REGULATOR_MC13892=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_SOC_CAMERA=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_CODA=y
+CONFIG_FB=y
+CONFIG_FB_IMX=y
+CONFIG_LCD_L4F00242T03=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_LOGO=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+# CONFIG_SND_ARM is not set
+# CONFIG_SND_SPI is not set
+CONFIG_SND_SOC=y
+CONFIG_SND_IMX_SOC=y
+CONFIG_SND_SOC_MX27VIS_AIC32X4=y
+CONFIG_SND_SOC_PHYCORE_AC97=y
+CONFIG_SND_SOC_EUKREA_TLV320=y
+CONFIG_SND_SOC_IMX_MC13783=y
+CONFIG_SND_SOC_FSL_ASOC_CARD=y
+CONFIG_SND_SOC_SGTL5000=y
+CONFIG_USB_HID=m
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_MXC=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_CHIPIDEA=y
+CONFIG_USB_CHIPIDEA_UDC=y
+CONFIG_USB_CHIPIDEA_HOST=y
+CONFIG_USB_CHIPIDEA_ULPI=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_ETH=m
+CONFIG_USB_ULPI_BUS=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_ESDHC_IMX=y
+CONFIG_MMC_MXC=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_MC13783=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_PCF8563=y
+CONFIG_RTC_DRV_IMXDI=y
+CONFIG_RTC_DRV_MC13XXX=y
+CONFIG_RTC_DRV_MXC=y
+CONFIG_DMADEVICES=y
+CONFIG_IMX_DMA=y
+CONFIG_IMX_SDMA=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_IIO=y
+CONFIG_FSL_MX25_ADC=y
+CONFIG_EXT4_FS=y
+# CONFIG_DNOTIFY is not set
+CONFIG_VFAT_FS=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_UBIFS_FS=y
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_15=m
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mxs/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mxs/defconfig
new file mode 100644
index 00000000..7b821285
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-lts-4.19/mxs/defconfig
@@ -0,0 +1,180 @@
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_CGROUPS=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_NET_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_PERF_EVENTS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_BLK_DEV_INTEGRITY=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_MXS=y
+# CONFIG_ARM_THUMB is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_AEABI=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+CONFIG_CAN=m
+CONFIG_CAN_FLEXCAN=m
+# CONFIG_WIRELESS is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_DATAFLASH=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SST25L=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_GPMI_NAND=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_UBI=y
+# CONFIG_BLK_DEV is not set
+CONFIG_EEPROM_AT24=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_NETDEVICES=y
+CONFIG_ENC28J60=y
+CONFIG_ICPLUS_PHY=y
+CONFIG_MICREL_PHY=y
+CONFIG_REALTEK_PHY=y
+CONFIG_SMSC_PHY=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_SMSC95XX=y
+# CONFIG_WLAN is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_MXS_LRADC=y
+CONFIG_TOUCHSCREEN_TSC2007=m
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_MXS_AUART=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+# CONFIG_I2C_COMPAT is not set
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MXS=y
+CONFIG_SPI=y
+CONFIG_SPI_GPIO=m
+CONFIG_SPI_MXS=y
+CONFIG_GPIO_SYSFS=y
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_STMP3XXX_RTC_WATCHDOG=y
+CONFIG_MFD_MXS_LRADC=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_DRM=y
+CONFIG_DRM_PANEL_SEIKO_43WVF1G=y
+CONFIG_DRM_MXSFB=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_PWM=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_LOGO=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_MXS_SOC=y
+CONFIG_SND_SOC_MXS_SGTL5000=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_CHIPIDEA=y
+CONFIG_USB_CHIPIDEA_UDC=y
+CONFIG_USB_CHIPIDEA_HOST=y
+CONFIG_USB_MXS_PHY=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_ETH=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_MMC=y
+CONFIG_MMC_MXS=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_ONESHOT=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1307=m
+CONFIG_RTC_DRV_STMP=y
+CONFIG_DMADEVICES=y
+CONFIG_MXS_DMA=y
+CONFIG_IIO=y
+CONFIG_MXS_LRADC_ADC=y
+CONFIG_IIO_SYSFS_TRIGGER=y
+CONFIG_PWM=y
+CONFIG_PWM_MXS=y
+CONFIG_NVMEM_MXS_OCOTP=y
+CONFIG_EXT4_FS=y
+# CONFIG_DNOTIFY is not set
+CONFIG_FSCACHE=m
+CONFIG_FSCACHE_STATS=y
+CONFIG_CACHEFILES=m
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_15=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
+CONFIG_FRAME_WARN=2048
+CONFIG_UNUSED_SYMBOLS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_SOFTLOCKUP_DETECTOR=y
+CONFIG_PROVE_LOCKING=y
+CONFIG_BLK_DEV_IO_TRACE=y
+CONFIG_STRICT_DEVMEM=y
+CONFIG_DEBUG_USER=y
+CONFIG_CRYPTO_DEV_MXS_DCP=y
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC7=m
+CONFIG_FONTS=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-qoriq_5.4.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-qoriq_5.4.bb
new file mode 100644
index 00000000..3ce5c1b6
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc-qoriq_5.4.bb
@@ -0,0 +1,17 @@
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Mainline/LTS rebased NXP/QorIQ patches + FSLC patches."
+DESCRIPTION = "Linux kernel based on LTS kernel used by FSL Community BSP in order to \
+provide support for some backported features and fixes, or because it was applied in linux-next \
+and takes some time to become part of a stable version, or because it is not applicable for \
+upstreaming."
+
+require recipes-kernel/linux/linux-qoriq.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+
+LINUX_VERSION = "5.4.51"
+
+SRCBRANCH = "5.4.y+qoriq+fslc"
+SRCREV = "c34b53c0927fcefcdea3be16cc1fb9fdcbedbe40"
+SRC_URI := "git://github.com/Freescale/linux-fslc.git;branch=${SRCBRANCH}"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/defconfig
index 6985d61e..dbb2387c 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/defconfig
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/defconfig
@@ -38,6 +38,7 @@ CONFIG_SOC_IMX6SLL=y
CONFIG_SOC_IMX6SX=y
CONFIG_SOC_IMX6UL=y
CONFIG_SOC_IMX7D=y
+CONFIG_SOC_IMX7ULP=y
CONFIG_SOC_VF610=y
CONFIG_PCI=y
CONFIG_PCI_MSI=y
@@ -56,8 +57,10 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPUFREQ_DT=y
CONFIG_ARM_IMX6Q_CPUFREQ=y
+CONFIG_ARM_IMX_CPUFREQ_DT=y
CONFIG_CPU_IDLE=y
CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_PM_DEBUG=y
@@ -81,6 +84,7 @@ CONFIG_NETFILTER=y
CONFIG_CAN=y
CONFIG_CAN_FLEXCAN=y
CONFIG_BT=y
+CONFIG_BT_BNEP=m
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_LL=y
CONFIG_CFG80211=y
@@ -108,7 +112,7 @@ CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
-CONFIG_MTD_NAND=y
+CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
CONFIG_MTD_NAND_VF610_NFC=y
CONFIG_MTD_NAND_MXC=y
@@ -175,6 +179,7 @@ CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_TOUCHSCREEN_EGALAX=y
+CONFIG_TOUCHSCREEN_GOODIX=y
CONFIG_TOUCHSCREEN_MAX11801=y
CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
CONFIG_TOUCHSCREEN_EDT_FT5X06=y
@@ -207,9 +212,11 @@ CONFIG_SPI_GPIO=y
CONFIG_SPI_IMX=y
CONFIG_SPI_FSL_DSPI=y
CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_SIOX=m
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_MC9S08DZ60=y
CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCF857X=y
CONFIG_GPIO_STMPE=y
CONFIG_GPIO_74X164=y
CONFIG_POWER_RESET=y
@@ -219,15 +226,18 @@ CONFIG_POWER_SUPPLY=y
CONFIG_SENSORS_MC13783_ADC=y
CONFIG_SENSORS_GPIO_FAN=y
CONFIG_SENSORS_IIO_HWMON=y
+CONFIG_THERMAL_STATISTICS=y
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_CPU_THERMAL=y
CONFIG_IMX_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_DA9062_WATCHDOG=y
+CONFIG_DA9063_WATCHDOG=m
CONFIG_RN5T618_WATCHDOG=y
CONFIG_IMX2_WDT=y
CONFIG_MFD_DA9052_I2C=y
CONFIG_MFD_DA9062=y
+CONFIG_MFD_DA9063=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
CONFIG_MFD_RN5T618=y
@@ -237,6 +247,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_DA9052=y
CONFIG_REGULATOR_DA9062=y
+CONFIG_REGULATOR_DA9063=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_MC13783=y
CONFIG_REGULATOR_MC13892=y
@@ -256,11 +267,15 @@ CONFIG_VIDEO_MUX=y
CONFIG_SOC_CAMERA=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_VIDEO_CODA=m
+CONFIG_VIDEO_IMX_PXP=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
CONFIG_VIDEO_ADV7180=m
+CONFIG_VIDEO_OV2680=m
CONFIG_VIDEO_OV5640=m
+CONFIG_VIDEO_OV5645=m
CONFIG_IMX_IPUV3_CORE=y
CONFIG_DRM=y
+CONFIG_DRM_MSM=y
CONFIG_DRM_PANEL_LVDS=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_PANEL_SEIKO_43WVF1G=y
@@ -302,6 +317,7 @@ CONFIG_SND_SOC_WM8962=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_HID_MULTITOUCH=y
CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_MXC=y
CONFIG_USB_STORAGE=y
@@ -389,12 +405,16 @@ CONFIG_MAG3110=y
CONFIG_MPL3115=y
CONFIG_PWM=y
CONFIG_PWM_FSL_FTM=y
-CONFIG_PWM_IMX=y
+CONFIG_PWM_IMX27=y
+CONFIG_PWM_IMX_TPM=y
CONFIG_NVMEM_IMX_OCOTP=y
CONFIG_NVMEM_VF610_OCOTP=y
+CONFIG_NVMEM_SNVS_LPGPR=y
CONFIG_TEE=y
CONFIG_OPTEE=y
CONFIG_MUX_MMIO=y
+CONFIG_SIOX=m
+CONFIG_SIOX_BUS_GPIO=m
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
@@ -429,6 +449,7 @@ CONFIG_NLS_UTF8=y
CONFIG_SECURITYFS=y
CONFIG_CRYPTO_DEV_FSL_CAAM=y
CONFIG_CRYPTO_DEV_SAHARA=y
+CONFIG_CRYPTO_DEV_MXS_DCP=y
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC7=m
@@ -438,7 +459,11 @@ CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_PROVE_LOCKING=y
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_FTRACE is not set
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_FQ_CODEL=y
+CONFIG_NET_SCH_FIFO=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mx25/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mx25/defconfig
index 8661dd9b..2b2d617e 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mx25/defconfig
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mx25/defconfig
@@ -47,7 +47,6 @@ CONFIG_IP_PNP_DHCP=y
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
CONFIG_NETFILTER=y
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_IMX_WEIM=y
@@ -61,7 +60,7 @@ CONFIG_MTD_CFI_GEOMETRY=y
# CONFIG_MTD_CFI_I2 is not set
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_NAND=y
+CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_MXC=y
CONFIG_MTD_UBI=y
CONFIG_EEPROM_AT24=y
@@ -170,6 +169,9 @@ CONFIG_IMX_SDMA=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_IIO=y
CONFIG_FSL_MX25_ADC=y
+CONFIG_PWM=y
+CONFIG_PWM_IMX1=y
+CONFIG_PWM_IMX27=y
CONFIG_EXT4_FS=y
# CONFIG_DNOTIFY is not set
CONFIG_VFAT_FS=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mxs/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mxs/defconfig
index 38480596..2773899c 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mxs/defconfig
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc/mxs/defconfig
@@ -50,7 +50,7 @@ CONFIG_MTD_BLOCK=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
-CONFIG_MTD_NAND=y
+CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_UBI=y
@@ -96,7 +96,6 @@ CONFIG_DRM=y
CONFIG_DRM_PANEL_SEIKO_43WVF1G=y
CONFIG_DRM_MXSFB=y
CONFIG_FB_MODE_HELPERS=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_PWM=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-fslc_5.4.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc_5.4.bb
new file mode 100644
index 00000000..cd7fb7a8
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-fslc_5.4.bb
@@ -0,0 +1,27 @@
+# Copyright (C) 2012-2019 O.S. Systems Software LTDA.
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# SPDX-License-Identifier: MIT
+#
+
+SUMMARY = "FSL Community BSP Linux mainline based kernel with backported features and fixes"
+DESCRIPTION = "Linux kernel based on mainline kernel used by FSL Community BSP in order to \
+provide support for some backported features and fixes, or because it was applied in linux-next \
+and takes some time to become part of a stable version, or because it is not applicable for \
+upstreaming."
+
+include linux-fslc.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+
+# PV is defined in the base in linux-imx.inc file and uses the LINUX_VERSION definition
+# required by kernel-yocto.bbclass.
+#
+# LINUX_VERSION define should match to the kernel version referenced by SRC_URI and
+# should be updated once patchlevel is merged.
+LINUX_VERSION = "5.4.51"
+
+SRCBRANCH = "5.4.x+fslc"
+SRCREV = "d051c7c9af6fa0bb57603ec927ea2674521167c8"
+
+COMPATIBLE_MACHINE = "(mxs|mx5|mx6|vf|use-mainline-bsp)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers-4.9.123/0001-uapi-Install-custom-headers.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers-4.9.123/0001-uapi-Install-custom-headers.patch
deleted file mode 100644
index fd842bf1..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers-4.9.123/0001-uapi-Install-custom-headers.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 33c85073a35e697e080583ca8edb31400b45de60 Mon Sep 17 00:00:00 2001
-From: Tom Hochstein <tom.hochstein@nxp.com>
-Date: Wed, 3 Oct 2018 18:02:43 -0500
-Subject: [PATCH] uapi: Install custom headers
-
-Upstream-Status: Inappropriate [i.MX specific]
-
-Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
----
- include/uapi/linux/Kbuild | 2 ++
- 1 file changed, 2 insertions(+)
-
-Index: git/include/uapi/linux/Kbuild
-===================================================================
---- git.orig/include/uapi/linux/Kbuild
-+++ git/include/uapi/linux/Kbuild
-@@ -104,6 +104,7 @@ header-y += dlm_device.h
- header-y += dlm.h
- header-y += dlm_netlink.h
- header-y += dlm_plock.h
-+header-y += dma-buf.h
- header-y += dm-ioctl.h
- header-y += dm-log-userspace.h
- header-y += dn.h
-@@ -144,6 +145,7 @@ header-y += gigaset_dev.h
- header-y += gpio.h
- header-y += gsmmux.h
- header-y += gtp.h
-+header-y += hantrodec.h
- header-y += hdlcdrv.h
- header-y += hdlc.h
- header-y += hdreg.h
-@@ -152,6 +154,7 @@ header-y += hid.h
- header-y += hidraw.h
- header-y += hpet.h
- header-y += hsr_netlink.h
-+header-y += hx280enc.h
- header-y += hyperv.h
- header-y += hysdn_if.h
- header-y += i2c-dev.h
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers_4.9.123.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers_5.4.3.bb
index 44bce42a..4257c41a 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers_4.9.123.bb
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-imx-headers_5.4.3.bb
@@ -1,20 +1,21 @@
-# Copyright 2017-2018 NXP
+# Copyright 2017-2019 NXP
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Installs i.MX-specific kernel headers"
DESCRIPTION = "Installs i.MX-specific kernel headers to userspace. \
New headers are installed in ${includedir}/imx."
LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
-SRCBRANCH = "imx_4.9.123_imx8mm_ga"
-LOCALVERSION = "-imx"
-SRC_URI = "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=${SRCBRANCH} \
- file://0001-uapi-Install-custom-headers.patch"
-SRCREV = "6a71cbc089755afd6a86c005c22a1af6eab24a70"
+SRCBRANCH = "lf-5.4.y"
+LOCALVERSION = "-1.0.0"
+SRC_URI = "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https;branch=${SRCBRANCH}"
+SRCREV = "f8118585ee3c7025265b28985fdfe0af96a84466"
S = "${WORKDIR}/git"
+do_configure[noexec] = "1"
+
do_compile[noexec] = "1"
IMX_UAPI_HEADERS = " \
@@ -42,18 +43,36 @@ do_install() {
# installed by mistake.
oe_runmake headers_install INSTALL_HDR_PATH=${B}${exec_prefix}
+ # Kernel should not be exporting this header
+ rm -f ${D}${exec_prefix}/include/scsi/scsi.h
+
+ # The ..install.cmd conflicts between various configure runs
+ find ${D}${includedir} -name ..install.cmd | xargs rm -f
+
# FIXME: The ion.h is still on staging so "promote" it for now
cp ${S}/drivers/staging/android/uapi/ion.h ${B}${includedir}/linux
# Install whitelisted headers only
for h in ${IMX_UAPI_HEADERS}; do
install -D -m 0644 ${B}${includedir}/linux/$h \
- ${D}${includedir}/imx/linux/$h
+ ${D}${includedir}/imx/linux/$h
done
}
+# Allow to build empty main package, this is required in order for -dev package
+# to be propagated into the SDK
+#
+# Without this setting the RDEPENDS in other recipes fails to find this
+# package, therefore causing the -dev package also to be skipped effectively not
+# populating it into SDK
ALLOW_EMPTY_${PN} = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS += "unifdef-native bison-native rsync-native"
+
PACKAGE_ARCH = "${MACHINE_SOCARCH}"
-COMPATIBLE_HOST_imx = ".*"
-COMPATIBLE_HOST ?= "(none)"
+
+# Restrict this recipe to NXP BSP only, this recipe is not compatible
+# with mainline BSP
+COMPATIBLE_HOST = '(null)'
+COMPATIBLE_HOST_use-nxp-bsp = '.*'
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool_4.9.123.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool_5.4.3.bb
index f7ead721..0a9f5259 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool_4.9.123.bb
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-imx-mfgtool_5.4.3.bb
@@ -5,6 +5,7 @@ SUMMARY = "Produces a Manufacturing Tool compatible Linux Kernel"
DESCRIPTION = "Linux Kernel provided and supported by Freescale that produces a \
Manufacturing Tool compatible Linux Kernel to be used in updater environment"
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-imx:"
require linux-imx_${PV}.bb
require linux-mfgtool.inc
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx.inc b/bsp/meta-freescale/recipes-kernel/linux/linux-imx.inc
index 9a8a035f..d508a727 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx.inc
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-imx.inc
@@ -4,19 +4,36 @@
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-inherit kernel fsl-kernel-localversion fsl-vivante-kernel-driver-handler
+inherit kernel-yocto kernel fsl-kernel-localversion fsl-vivante-kernel-driver-handler
# Put a local version until we have a true SRCREV to point to
LOCALVERSION ?= ""
SCMVERSION ?= "y"
SRCBRANCH ?= ""
+# Set the PV to the correct kernel version to satisfy the kernel version sanity check
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
SRC_URI = "git://source.codeaurora.org/external/imx/linux-imx;protocol=https;branch=${SRCBRANCH} \
file://defconfig \
"
S = "${WORKDIR}/git"
+# Tell to kernel class that we would like to use our defconfig to configure the kernel.
+# Otherwise, the --allnoconfig would be used per default which leads to mis-configured
+# kernel.
+#
+# This behavior happens when a defconfig is provided, the kernel-yocto configuration
+# uses the filename as a trigger to use a 'allnoconfig' baseline before merging
+# the defconfig into the build.
+#
+# If the defconfig file was created with make_savedefconfig, not all options are
+# specified, and should be restored with their defaults, not set to 'n'.
+# To properly expand a defconfig like this, we need to specify: KCONFIG_MODE="--alldefconfig"
+# in the kernel recipe include.
+KCONFIG_MODE="--alldefconfig"
+
# We need to pass it as param since kernel might support more then one
# machine, with different entry points
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-imx/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch
new file mode 100644
index 00000000..e3df8084
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-imx/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch
@@ -0,0 +1,63 @@
+From 0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 Mon Sep 17 00:00:00 2001
+From: Changbin Du <changbin.du@gmail.com>
+Date: Tue, 28 Jan 2020 23:29:38 +0800
+Subject: [PATCH] perf: Make perf able to build with latest libbfd
+
+libbfd has changed the bfd_section_* macros to inline functions
+bfd_section_<field> since 2019-09-18. See below two commits:
+ o http://www.sourceware.org/ml/gdb-cvs/2019-09/msg00064.html
+ o https://www.sourceware.org/ml/gdb-cvs/2019-09/msg00072.html
+
+This fix make perf able to build with both old and new libbfd.
+
+Upstream-Status: Submitted [commit 0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 upstream]
+
+Signed-off-by: Changbin Du <changbin.du@gmail.com>
+Acked-by: Jiri Olsa <jolsa@redhat.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Link: http://lore.kernel.org/lkml/20200128152938.31413-1-changbin.du@gmail.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ tools/perf/util/srcline.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
+index 6ccf6f6d09df..5b7d6c16d33f 100644
+--- a/tools/perf/util/srcline.c
++++ b/tools/perf/util/srcline.c
+@@ -193,16 +193,30 @@ static void find_address_in_section(bfd *abfd, asection *section, void *data)
+ bfd_vma pc, vma;
+ bfd_size_type size;
+ struct a2l_data *a2l = data;
++ flagword flags;
+
+ if (a2l->found)
+ return;
+
+- if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
++#ifdef bfd_get_section_flags
++ flags = bfd_get_section_flags(abfd, section);
++#else
++ flags = bfd_section_flags(section);
++#endif
++ if ((flags & SEC_ALLOC) == 0)
+ return;
+
+ pc = a2l->addr;
++#ifdef bfd_get_section_vma
+ vma = bfd_get_section_vma(abfd, section);
++#else
++ vma = bfd_section_vma(section);
++#endif
++#ifdef bfd_get_section_size
+ size = bfd_get_section_size(section);
++#else
++ size = bfd_section_size(section);
++#endif
+
+ if (pc < vma || pc >= vma + size)
+ return;
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-4.9.123/imx/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-imx/imx/defconfig
index 85410638..622e5430 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx-4.9.123/imx/defconfig
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-imx/imx/defconfig
@@ -2,6 +2,7 @@ CONFIG_KERNEL_LZO=y
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=18
@@ -13,61 +14,61 @@ CONFIG_KALLSYMS_ALL=y
CONFIG_PERF_EVENTS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
-# CONFIG_BLK_DEV_BSG is not set
CONFIG_ARCH_MXC=y
CONFIG_SOC_IMX50=y
+CONFIG_SOC_IMX51=y
CONFIG_SOC_IMX53=y
CONFIG_SOC_IMX6Q=y
CONFIG_SOC_IMX6SL=y
+CONFIG_SOC_IMX6SLL=y
CONFIG_SOC_IMX6SX=y
-CONFIG_SOC_IMX6ULL=y
+CONFIG_SOC_IMX6UL=y
CONFIG_SOC_IMX7D=y
-CONFIG_SOC_IMX6SLL=y
CONFIG_SOC_IMX7ULP=y
CONFIG_SOC_VF610=y
-# CONFIG_SWP_EMULATE is not set
CONFIG_SMP=y
CONFIG_VMSPLIT_2G=y
CONFIG_ARM_PSCI=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
CONFIG_HIGHMEM=y
-CONFIG_CMA=y
+CONFIG_FORCE_MAX_ZONEORDER=14
CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
+CONFIG_KEXEC=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
-CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
+CONFIG_CPUFREQ_DT=y
CONFIG_ARM_IMX6Q_CPUFREQ=y
-CONFIG_ARM_IMX7D_CPUFREQ=y
+CONFIG_ARM_IMX_CPUFREQ_DT=y
CONFIG_ARM_IMX7ULP_CPUFREQ=y
CONFIG_CPU_IDLE=y
+CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_VFP=y
CONFIG_NEON=y
-CONFIG_BINFMT_MISC=m
CONFIG_PM_DEBUG=y
CONFIG_PM_TEST_SUSPEND=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_BINFMT_MISC=m
+CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-CONFIG_VLAN_8021Q=y
+CONFIG_NETFILTER=y
+CONFIG_VLAN_8021Q=m
CONFIG_LLC2=y
CONFIG_CAN=y
CONFIG_CAN_FLEXCAN=y
-CONFIG_CAN_M_CAN=y
CONFIG_BT=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
@@ -78,19 +79,24 @@ CONFIG_BT_HIDP=y
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_ATH3K=y
-CONFIG_BT_HCIBCM203X=y
-CONFIG_BT_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIUART_3WIRE=y
+CONFIG_BT_HCIUART_MRVL=y
+CONFIG_BT_HCIVHCI=y
+CONFIG_BT_MRVL=y
+CONFIG_BT_MRVL_SDIO=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
-CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_IMX6=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=0
+CONFIG_FW_LOADER_USER_HELPER=y
+CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
CONFIG_IMX_WEIM=y
CONFIG_CONNECTOR=y
CONFIG_MTD=y
@@ -101,17 +107,19 @@ CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
-CONFIG_MTD_M25P80=y
CONFIG_MTD_SST25L=y
-CONFIG_MTD_NAND=y
+CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_GPMI_NAND=y
+CONFIG_MTD_NAND_VF610_NFC=y
CONFIG_MTD_NAND_MXC=y
CONFIG_MTD_SPI_NOR=y
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
-CONFIG_SPI_FSL_QUADSPI=y
CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_FASTMAP=y
+CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=65536
@@ -144,25 +152,27 @@ CONFIG_SMC91X=y
CONFIG_SMC911X=y
CONFIG_SMSC911X=y
# CONFIG_NET_VENDOR_STMICRO is not set
+CONFIG_AT803X_PHY=y
CONFIG_MICREL_PHY=y
-CONFIG_USB_KAWETH=y
-CONFIG_USB_PEGASUS=y
-CONFIG_USB_RTL8150=y
+CONFIG_SMSC_PHY=y
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=y
+CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=m
-CONFIG_BCMDHD=y
-CONFIG_BCMDHD_SDIO=y
-CONFIG_BCMDHD_FW_PATH="/lib/firmware/bcm/ZP_BCM4339/fw_bcmdhd.bin"
-CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/bcm/ZP_BCM4339/bcmdhd.ZP.OOB.cal"
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_MCS7830=y
+CONFIG_BRCMFMAC=m
CONFIG_HOSTAP=y
-# CONFIG_RTL_CARDS is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_WL12XX=m
+CONFIG_WL18XX=m
+CONFIG_WLCORE_SDIO=m
+# CONFIG_WILINK_PLATFORM_DATA is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=m
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_RPMSG=y
-CONFIG_KEYBOARD_PF1550_ONKEY=y
CONFIG_KEYBOARD_IMX=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ELANTECH=y
@@ -170,11 +180,16 @@ CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_TOUCHSCREEN_EGALAX=y
CONFIG_TOUCHSCREEN_ELAN_TS=y
+CONFIG_TOUCHSCREEN_GOODIX=y
CONFIG_TOUCHSCREEN_MAX11801=y
CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
+CONFIG_TOUCHSCREEN_EDT_FT5X06=y
CONFIG_TOUCHSCREEN_MC13783=y
+CONFIG_TOUCHSCREEN_TSC2004=y
CONFIG_TOUCHSCREEN_TSC2007=y
CONFIG_TOUCHSCREEN_STMPE=y
+CONFIG_TOUCHSCREEN_SX8654=y
+CONFIG_TOUCHSCREEN_COLIBRI_VF50=y
CONFIG_TOUCHSCREEN_FTS=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_MMA8450=y
@@ -184,111 +199,136 @@ CONFIG_SENSOR_IMX_RPMSG=y
CONFIG_INPUT_ISL29023=y
CONFIG_SERIO_SERPORT=m
# CONFIG_LEGACY_PTYS is not set
-# CONFIG_DEVKMEM is not set
CONFIG_SERIAL_IMX=y
CONFIG_SERIAL_IMX_CONSOLE=y
CONFIG_SERIAL_FSL_LPUART=y
CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
-CONFIG_FSL_OTP=y
-CONFIG_HW_RANDOM_IMX_RNG=y
+CONFIG_SERIAL_DEV_BUS=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_GPIO=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m
+CONFIG_I2C_GPIO=y
CONFIG_I2C_IMX=y
CONFIG_I2C_IMX_LPI2C=y
CONFIG_SPI=y
+CONFIG_SPI_FSL_LPSPI=y
+CONFIG_SPI_FSL_QUADSPI=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_IMX=y
-CONFIG_SPI_FSL_LPSPI=y
+CONFIG_SPI_FSL_DSPI=y
CONFIG_SPI_SPIDEV=y
+CONFIG_SPI_SLAVE=y
+CONFIG_SPI_SLAVE_TIME=y
+CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y
CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_SIOX=m
CONFIG_GPIO_IMX_RPMSG=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCF857X=y
+CONFIG_GPIO_STMPE=y
CONFIG_GPIO_74X164=y
CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_SYSCON=y
CONFIG_POWER_RESET_SYSCON_POWEROFF=y
CONFIG_POWER_SUPPLY=y
-CONFIG_CHARGER_PF1550=y
CONFIG_SABRESD_MAX8903=y
+CONFIG_SENSORS_MC13783_ADC=y
+CONFIG_SENSORS_GPIO_FAN=y
+CONFIG_SENSORS_IIO_HWMON=y
CONFIG_SENSORS_MAX17135=y
CONFIG_SENSORS_MAG3110=y
CONFIG_THERMAL=y
+CONFIG_THERMAL_STATISTICS=y
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_CPU_THERMAL=y
CONFIG_IMX_THERMAL=y
CONFIG_DEVICE_THERMAL=y
CONFIG_WATCHDOG=y
+CONFIG_DA9063_WATCHDOG=m
+CONFIG_DA9062_WATCHDOG=y
+CONFIG_RN5T618_WATCHDOG=y
CONFIG_IMX2_WDT=y
CONFIG_IMX7ULP_WDT=y
CONFIG_MFD_DA9052_I2C=y
+CONFIG_MFD_DA9062=y
+CONFIG_MFD_DA9063=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
-CONFIG_MFD_PF1550=y
CONFIG_MFD_MAX17135=y
+CONFIG_MFD_RN5T618=y
CONFIG_MFD_SI476X_CORE=y
CONFIG_MFD_STMPE=y
-CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_DA9052=y
+CONFIG_REGULATOR_DA9062=y
+CONFIG_REGULATOR_DA9063=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_MAX17135=y
CONFIG_REGULATOR_MC13783=y
CONFIG_REGULATOR_MC13892=y
-CONFIG_REGULATOR_PFUZE100=y
-CONFIG_REGULATOR_PF1550=y
CONFIG_REGULATOR_PF1550_RPMSG=y
+CONFIG_REGULATOR_PFUZE100=y
+CONFIG_REGULATOR_RN5T618=y
+CONFIG_RC_CORE=y
+CONFIG_RC_DEVICES=y
+CONFIG_IR_GPIO_CIR=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
-CONFIG_MEDIA_RC_SUPPORT=y
-CONFIG_RC_DEVICES=y
-CONFIG_IR_GPIO_CIR=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_MXC_OUTPUT=y
+CONFIG_VIDEO_MUX=y
CONFIG_VIDEO_MXC_CAPTURE=m
+CONFIG_VIDEO_MXC_OUTPUT=y
CONFIG_VIDEO_MXC_CSI_CAMERA=m
CONFIG_MXC_VADC=m
CONFIG_MXC_MIPI_CSI=m
CONFIG_MXC_CAMERA_OV5640=m
CONFIG_MXC_CAMERA_OV5640_V2=m
-CONFIG_MXC_CAMERA_OV5642=m
CONFIG_MXC_CAMERA_OV5640_MIPI=m
CONFIG_MXC_CAMERA_OV5640_MIPI_V2=m
-CONFIG_MXC_CAMERA_OV5647_MIPI=m
CONFIG_MXC_TVIN_ADV7180=m
CONFIG_MXC_IPU_DEVICE_QUEUE_SDC=m
CONFIG_VIDEO_MXC_IPU_OUTPUT=y
CONFIG_VIDEO_MXC_PXP_V4L2=y
-CONFIG_SOC_CAMERA=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
-CONFIG_VIDEO_CODA=y
+CONFIG_VIDEO_CODA=m
+CONFIG_VIDEO_IMX_PXP=y
CONFIG_RADIO_SI476X=y
-CONFIG_SOC_CAMERA_OV2640=y
+CONFIG_VIDEO_ADV7180=m
+CONFIG_VIDEO_OV2680=m
+CONFIG_VIDEO_OV5645=m
CONFIG_DRM=y
-CONFIG_DRM_VIVANTE=y
+CONFIG_DRM_MSM=y
+CONFIG_DRM_PANEL_LVDS=y
+CONFIG_DRM_PANEL_SIMPLE=y
+CONFIG_DRM_PANEL_SEIKO_43WVF1G=y
CONFIG_FB_MXS=y
CONFIG_FB_MXC_SYNC_PANEL=y
CONFIG_FB_MXC_OVERLAY=y
-CONFIG_FB_MXC_MIPI_DSI=y
-CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
CONFIG_FB_MXC_MIPI_DSI_NORTHWEST=y
-CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
-CONFIG_FB_MXC_TRULY_PANEL_TFT3P5079E=y
+CONFIG_FB_MXC_ADV7535=y
CONFIG_FB_MXC_TRULY_PANEL_TFT3P5581E=y
+CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
+CONFIG_FB_MXC_RK_PANEL_RK055AHD042=y
+CONFIG_FB_MXC_RK_PANEL_RK055IQH042=y
+CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
+CONFIG_FB_MXC_MIPI_DSI=y
CONFIG_FB_MXC_LDB=y
-CONFIG_FB_MXC_HDMI=y
-CONFIG_FB_MXS_SII902X=y
-CONFIG_FB_MXC_DCIC=m
-CONFIG_FB_MXC_ADV7535=y
-CONFIG_HANNSTAR_CABC=y
CONFIG_FB_MXC_EINK_PANEL=y
CONFIG_FB_MXC_EINK_V2_PANEL=y
+CONFIG_FB_MXC_HDMI=y
+CONFIG_FB_MXS_SII902X=y
+CONFIG_FB_MXC_DCIC=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_L4F00242T03=y
CONFIG_LCD_PLATFORM=y
@@ -308,13 +348,19 @@ CONFIG_SND_SOC_IMX_WM8958=y
CONFIG_SND_SOC_IMX_CS42888=y
CONFIG_SND_SOC_IMX_WM8962=y
CONFIG_SND_SOC_IMX_RPMSG=y
+CONFIG_SND_SOC_IMX_ES8328=y
CONFIG_SND_SOC_IMX_SGTL5000=y
CONFIG_SND_SOC_IMX_MQS=y
CONFIG_SND_SOC_IMX_SPDIF=y
CONFIG_SND_SOC_IMX_MC13783=y
CONFIG_SND_SOC_IMX_SI476X=y
CONFIG_SND_SOC_IMX_HDMI=y
+CONFIG_SND_SOC_AC97_CODEC=y
+CONFIG_SND_SOC_TLV320AIC3X=y
+CONFIG_SND_SIMPLE_CARD=y
+CONFIG_HID_MULTITOUCH=y
CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_OTG_WHITELIST=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_MXC=y
@@ -329,10 +375,11 @@ CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_USB_TEST=m
-CONFIG_USB_EHSET_TEST_FIXTURE=y
+CONFIG_USB_EHSET_TEST_FIXTURE=m
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_MXS_PHY=y
CONFIG_USB_GADGET=y
+CONFIG_USB_FSL_USB2=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
@@ -343,38 +390,48 @@ CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
-CONFIG_FSL_UTP=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
+CONFIG_USB_CONFIGFS_F_UAC1=y
+CONFIG_USB_CONFIGFS_F_UAC2=y
+CONFIG_USB_CONFIGFS_F_MIDI=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_F_UVC=y
+CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_ZERO=m
+CONFIG_USB_AUDIO=m
CONFIG_USB_ETH=m
CONFIG_USB_G_NCM=m
CONFIG_USB_GADGETFS=m
+CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_ESDHC_IMX=y
-CONFIG_MXC_IPU=y
-CONFIG_MXC_IPU_V3_PRE=y
-CONFIG_MXC_MIPI_CSI2=y
-CONFIG_MXC_HDMI_CEC=y
-CONFIG_MXC_SIM=y
-CONFIG_MXC_SIMv2=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_PWM=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_ISL1208=y
+CONFIG_RTC_DRV_PCF8523=y
+CONFIG_RTC_DRV_PCF8563=y
+CONFIG_RTC_DRV_M41T80=y
+CONFIG_RTC_DRV_DA9063=y
CONFIG_RTC_DRV_MC13XXX=y
CONFIG_RTC_DRV_MXC=y
+CONFIG_RTC_DRV_MXC_V2=y
CONFIG_RTC_DRV_SNVS=y
CONFIG_RTC_DRV_IMX_RPMSG=y
CONFIG_DMADEVICES=y
@@ -386,18 +443,34 @@ CONFIG_MXC_PXP_V3=y
CONFIG_DMATEST=m
CONFIG_STAGING=y
CONFIG_STAGING_MEDIA=y
-CONFIG_ION=y
-CONFIG_ION_MXC=y
-# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_COMMON_CLK_PWM=y
+CONFIG_MAILBOX=y
+CONFIG_IMX_MBOX=y
CONFIG_EXTCON_USB_GPIO=y
CONFIG_IIO=y
CONFIG_IMX7D_ADC=y
CONFIG_VF610_ADC=y
CONFIG_PWM=y
-CONFIG_PWM_IMX=y
-CONFIG_PWM_TPM=y
+CONFIG_PWM_FSL_FTM=y
+CONFIG_PWM_IMX27=y
+CONFIG_PWM_IMX_TPM=y
+CONFIG_PHY_MIXEL_LVDS=y
+CONFIG_PHY_MIXEL_LVDS_COMBO=y
+CONFIG_NVMEM_IMX_OCOTP=y
+CONFIG_NVMEM_VF610_OCOTP=y
+CONFIG_NVMEM_SNVS_LPGPR=y
CONFIG_TEE=y
CONFIG_OPTEE=y
+CONFIG_MUX_MMIO=y
+CONFIG_SIOX=m
+CONFIG_SIOX_BUS_GPIO=m
+CONFIG_MXC_SIM=y
+CONFIG_MXC_IPU=y
+CONFIG_MXC_SIMv2=y
+CONFIG_MXC_MLB150=y
+CONFIG_MXC_IPU_V3_PRE=y
+CONFIG_MXC_HDMI_CEC=y
+CONFIG_MXC_MIPI_CSI2=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
@@ -416,7 +489,7 @@ CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=y
-CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
CONFIG_JFFS2_FS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
@@ -429,38 +502,51 @@ CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_UTF8=y
-CONFIG_DEBUG_FS=y
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_FTRACE is not set
CONFIG_SECURITYFS=y
CONFIG_CRYPTO_USER=y
CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_CTS=y
-CONFIG_CRYPTO_LRW=y
-CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_MD4=y
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_RMD128=y
-CONFIG_CRYPTO_RMD160=y
-CONFIG_CRYPTO_RMD256=y
-CONFIG_CRYPTO_RMD320=y
-CONFIG_CRYPTO_SHA512=y
-CONFIG_CRYPTO_TGR192=y
-CONFIG_CRYPTO_WP512=y
-CONFIG_CRYPTO_BLOWFISH=y
-CONFIG_CRYPTO_CAMELLIA=y
-CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_ECHAINIV=m
+CONFIG_CRYPTO_TLS=m
+CONFIG_CRYPTO_CFB=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_OFB=m
+CONFIG_CRYPTO_XTS=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_SHA3=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_DEV_FSL_CAAM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
-CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=y
+CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=m
CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
+CONFIG_CRYPTO_DEV_SAHARA=y
CONFIG_CRYPTO_DEV_MXS_DCP=y
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
+CONFIG_DMA_CMA=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_FTRACE is not set
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx/mx8/defconfig b/bsp/meta-freescale/recipes-kernel/linux/linux-imx/mx8/defconfig
new file mode 100644
index 00000000..469ee0ef
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-imx/mx8/defconfig
@@ -0,0 +1,797 @@
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_AUDIT=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
+CONFIG_IRQ_TIME_ACCOUNTING=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_NUMA_BALANCING=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_SWAP=y
+CONFIG_BLK_CGROUP=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_HUGETLB=y
+CONFIG_CPUSETS=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_PERF=y
+CONFIG_USER_NS=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_RELAY=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_PROFILING=y
+CONFIG_ARCH_LAYERSCAPE=y
+CONFIG_ARCH_MXC=y
+CONFIG_ARCH_S32=y
+CONFIG_SOC_S32V234=y
+CONFIG_ARM64_VA_BITS_48=y
+CONFIG_SCHED_MC=y
+CONFIG_NUMA=y
+CONFIG_SECCOMP=y
+CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
+CONFIG_XEN=y
+CONFIG_FORCE_MAX_ZONEORDER=14
+CONFIG_COMPAT=y
+CONFIG_RANDOMIZE_BASE=y
+CONFIG_PM_DEBUG=y
+CONFIG_PM_TEST_SUSPEND=y
+CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
+CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_PSCI_CPUIDLE=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
+CONFIG_CPUFREQ_DT=y
+CONFIG_ACPI_CPPC_CPUFREQ=m
+CONFIG_ARM_SCPI_CPUFREQ=y
+CONFIG_ARM_IMX_CPUFREQ_DT=y
+CONFIG_QORIQ_CPUFREQ=y
+CONFIG_ARM_SCPI_PROTOCOL=y
+CONFIG_EFI_CAPSULE_LOADER=y
+CONFIG_IMX_DSP=y
+CONFIG_IMX_SCU=y
+CONFIG_IMX_SCU_PD=y
+CONFIG_ACPI=y
+CONFIG_ACPI_APEI=y
+CONFIG_ACPI_APEI_GHES=y
+CONFIG_ACPI_APEI_PCIEAER=y
+CONFIG_ACPI_APEI_MEMORY_FAILURE=y
+CONFIG_ACPI_APEI_EINJ=y
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=y
+CONFIG_ARM64_CRYPTO=y
+CONFIG_CRYPTO_SHA1_ARM64_CE=y
+CONFIG_CRYPTO_SHA2_ARM64_CE=y
+CONFIG_CRYPTO_SHA512_ARM64_CE=m
+CONFIG_CRYPTO_SHA3_ARM64=m
+CONFIG_CRYPTO_SM3_ARM64_CE=m
+CONFIG_CRYPTO_GHASH_ARM64_CE=y
+CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m
+CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
+CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
+CONFIG_CRYPTO_CHACHA20_NEON=m
+CONFIG_CRYPTO_AES_ARM64_BS=m
+CONFIG_JUMP_LABEL=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_KSM=y
+CONFIG_MEMORY_FAILURE=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IPV6_SIT=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
+CONFIG_NETFILTER_XT_TARGET_LOG=m
+CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_NAT=m
+CONFIG_IP6_NF_TARGET_MASQUERADE=m
+CONFIG_BRIDGE=m
+CONFIG_BRIDGE_VLAN_FILTERING=y
+CONFIG_VLAN_8021Q_GVRP=y
+CONFIG_VLAN_8021Q_MVRP=y
+CONFIG_LLC2=y
+CONFIG_TSN=y
+CONFIG_NET_SWITCHDEV=y
+CONFIG_BPF_JIT=y
+CONFIG_CAN=m
+CONFIG_CAN_FLEXCAN=m
+CONFIG_BT=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=y
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=y
+# CONFIG_BT_HS is not set
+# CONFIG_BT_LE is not set
+CONFIG_BT_LEDS=y
+# CONFIG_BT_DEBUGFS is not set
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIUART_3WIRE=y
+CONFIG_BT_HCIUART_BCM=y
+CONFIG_BT_HCIUART_QCA=y
+CONFIG_BT_HCIVHCI=y
+CONFIG_CFG80211=y
+CONFIG_NL80211_TESTMODE=y
+CONFIG_CFG80211_WEXT=y
+CONFIG_MAC80211=y
+CONFIG_MAC80211_LEDS=y
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
+CONFIG_PCI=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCI_IOV=y
+CONFIG_HOTPLUG_PCI=y
+CONFIG_HOTPLUG_PCI_ACPI=y
+CONFIG_PCI_HOST_GENERIC=y
+CONFIG_PCI_XGENE=y
+CONFIG_PCIE_ALTERA=y
+CONFIG_PCIE_ALTERA_MSI=y
+CONFIG_PCI_HOST_THUNDER_PEM=y
+CONFIG_PCI_HOST_THUNDER_ECAM=y
+CONFIG_PCI_IMX6=y
+CONFIG_PCI_LAYERSCAPE=y
+CONFIG_PCI_HISI=y
+CONFIG_PCIE_KIRIN=y
+CONFIG_PCIE_LAYERSCAPE_GEN4=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_FW_LOADER_USER_HELPER=y
+CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
+CONFIG_BRCMSTB_GISB_ARB=y
+CONFIG_SIMPLE_PM_BUS=y
+CONFIG_VEXPRESS_CONFIG=y
+CONFIG_FSL_MC_BUS=y
+CONFIG_FSL_MC_UAPI_SUPPORT=y
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_DATAFLASH=y
+CONFIG_MTD_SST25L=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_NAND_DENALI_DT=y
+CONFIG_MTD_NAND_GPMI_NAND=y
+CONFIG_MTD_NAND_FSL_IFC=y
+CONFIG_MTD_SPI_NOR=y
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+CONFIG_MTD_UBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_NBD=m
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_VIRTIO_BLK=y
+CONFIG_BLK_DEV_NVME=y
+CONFIG_SENSORS_FXOS8700=y
+CONFIG_SENSORS_FXAS2100X=y
+CONFIG_SRAM=y
+CONFIG_EEPROM_AT24=y
+CONFIG_EEPROM_AT25=m
+# CONFIG_SCSI_PROC_FS is not set
+CONFIG_BLK_DEV_SD=y
+CONFIG_SCSI_SAS_ATA=y
+CONFIG_SCSI_HISI_SAS=y
+CONFIG_SCSI_HISI_SAS_PCI=y
+CONFIG_SCSI_MPT3SAS=m
+CONFIG_SCSI_UFSHCD=y
+CONFIG_SCSI_UFSHCD_PLATFORM=y
+CONFIG_ATA=y
+CONFIG_SATA_AHCI=y
+CONFIG_SATA_AHCI_PLATFORM=y
+CONFIG_AHCI_IMX=y
+CONFIG_AHCI_CEVA=y
+CONFIG_AHCI_XGENE=y
+CONFIG_AHCI_QORIQ=y
+CONFIG_SATA_SIL24=y
+CONFIG_PATA_PLATFORM=y
+CONFIG_PATA_OF_PLATFORM=y
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_NETDEVICES=y
+CONFIG_MACVLAN=m
+CONFIG_MACVTAP=m
+CONFIG_TUN=y
+CONFIG_VETH=m
+CONFIG_VIRTIO_NET=y
+CONFIG_AMD_XGBE=y
+CONFIG_ATL1C=m
+CONFIG_BNX2X=m
+CONFIG_MACB=y
+CONFIG_THUNDER_NIC_PF=y
+CONFIG_FEC=y
+CONFIG_FSL_SDK_DPAA_ETH=y
+CONFIG_FSL_DPAA2_ETH=y
+CONFIG_FSL_ENETC=y
+CONFIG_FSL_ENETC_VF=y
+CONFIG_FSL_ENETC_MDIO=y
+CONFIG_HIX5HD2_GMAC=y
+CONFIG_HNS_DSAF=y
+CONFIG_HNS_ENET=y
+CONFIG_HNS3=y
+CONFIG_HNS3_HCLGE=y
+CONFIG_HNS3_ENET=y
+CONFIG_E1000=y
+CONFIG_E1000E=y
+CONFIG_IGB=y
+CONFIG_IGBVF=y
+CONFIG_MVMDIO=y
+CONFIG_SKY2=y
+CONFIG_MLX4_EN=m
+CONFIG_MLX5_CORE=m
+CONFIG_MLX5_CORE_EN=y
+CONFIG_MSCC_OCELOT_SWITCH=y
+CONFIG_QCOM_EMAC=m
+CONFIG_SMC91X=y
+CONFIG_SMSC911X=y
+CONFIG_STMMAC_ETH=m
+CONFIG_MDIO_BITBANG=y
+CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y
+CONFIG_AQUANTIA_PHY=y
+CONFIG_AT803X_PHY=y
+CONFIG_INPHI_PHY=y
+CONFIG_MARVELL_PHY=m
+CONFIG_MARVELL_10G_PHY=m
+CONFIG_MICREL_PHY=y
+CONFIG_MICROSEMI_PHY=y
+CONFIG_NXP_TJA11XX_PHY=y
+CONFIG_REALTEK_PHY=y
+CONFIG_ROCKCHIP_PHY=y
+CONFIG_VITESSE_PHY=y
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_RTL8152=m
+CONFIG_USB_LAN78XX=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_SR9800=m
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_BRCMFMAC=m
+CONFIG_BRCMFMAC_PCIE=y
+CONFIG_HOSTAP=y
+CONFIG_WL18XX=m
+CONFIG_WLCORE_SDIO=m
+CONFIG_IVSHMEM_NET=m
+CONFIG_INPUT_EVDEV=y
+CONFIG_KEYBOARD_ADC=m
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_SNVS_PWRKEY=y
+CONFIG_KEYBOARD_IMX_SC_PWRKEY=y
+CONFIG_KEYBOARD_CROS_EC=y
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ATMEL_MXT=m
+CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_I2C=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_MPL3115=y
+CONFIG_INPUT_ISL29023=y
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_SERIO_AMBAKMI=y
+CONFIG_LEGACY_PTY_COUNT=16
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DW=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_IMX=y
+CONFIG_SERIAL_IMX_CONSOLE=y
+CONFIG_SERIAL_XILINX_PS_UART=y
+CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
+CONFIG_SERIAL_FSL_LPUART=y
+CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
+CONFIG_SERIAL_FSL_LINFLEXUART=y
+CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE=y
+CONFIG_SERIAL_DEV_BUS=y
+CONFIG_VIRTIO_CONSOLE=y
+CONFIG_IPMI_HANDLER=m
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_TCG_TPM=y
+CONFIG_TCG_TIS_I2C_INFINEON=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_I2C_GPIO=m
+CONFIG_I2C_IMX=y
+CONFIG_I2C_IMX_LPI2C=y
+CONFIG_I2C_RK3X=y
+CONFIG_I2C_RPBUS=y
+CONFIG_I2C_CROS_EC_TUNNEL=y
+CONFIG_I2C_SLAVE=y
+CONFIG_SPI=y
+CONFIG_SPI_FSL_LPSPI=y
+CONFIG_SPI_FSL_QUADSPI=y
+CONFIG_SPI_NXP_FLEXSPI=y
+CONFIG_SPI_IMX=y
+CONFIG_SPI_FSL_DSPI=y
+CONFIG_SPI_PL022=y
+CONFIG_SPI_ROCKCHIP=y
+CONFIG_SPI_SPIDEV=y
+CONFIG_SPI_SLAVE=y
+CONFIG_SPI_SLAVE_TIME=y
+CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y
+CONFIG_SPMI=y
+CONFIG_PINCTRL_SINGLE=y
+CONFIG_PINCTRL_MAX77620=y
+CONFIG_PINCTRL_IMX8MM=y
+CONFIG_PINCTRL_IMX8MN=y
+CONFIG_PINCTRL_IMX8MQ=y
+CONFIG_PINCTRL_IMX8QM=y
+CONFIG_PINCTRL_IMX8QXP=y
+CONFIG_PINCTRL_S32V234=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_DWAPB=y
+CONFIG_GPIO_MB86S7X=y
+CONFIG_GPIO_MPC8XXX=y
+CONFIG_GPIO_PL061=y
+CONFIG_GPIO_XGENE=y
+CONFIG_GPIO_MAX732X=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=y
+CONFIG_GPIO_MAX77620=y
+CONFIG_POWER_AVS=y
+CONFIG_POWER_RESET_BRCMSTB=y
+CONFIG_POWER_RESET_VEXPRESS=y
+CONFIG_POWER_RESET_XGENE=y
+CONFIG_POWER_RESET_SYSCON=y
+CONFIG_SYSCON_REBOOT_MODE=y
+CONFIG_BATTERY_SBS=m
+CONFIG_BATTERY_BQ27XXX=y
+CONFIG_SENSORS_ARM_SCPI=y
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_PWM_FAN=m
+CONFIG_SENSORS_INA2XX=m
+CONFIG_SENSORS_INA3221=m
+CONFIG_THERMAL_WRITABLE_TRIPS=y
+CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
+CONFIG_CPU_THERMAL=y
+CONFIG_THERMAL_EMULATION=y
+CONFIG_IMX_SC_THERMAL=y
+CONFIG_DEVICE_THERMAL=y
+CONFIG_IMX8MM_THERMAL=y
+CONFIG_QORIQ_THERMAL=y
+CONFIG_WATCHDOG=y
+CONFIG_ARM_SP805_WATCHDOG=y
+CONFIG_ARM_SBSA_WATCHDOG=y
+CONFIG_DW_WATCHDOG=y
+CONFIG_IMX2_WDT=y
+CONFIG_IMX_SC_WDT=y
+CONFIG_MFD_BD9571MWV=y
+CONFIG_MFD_AXP20X_I2C=y
+CONFIG_MFD_HI6421_PMIC=y
+CONFIG_MFD_MAX77620=y
+CONFIG_MFD_RK808=y
+CONFIG_MFD_SEC_CORE=y
+CONFIG_MFD_ROHM_BD718XX=y
+CONFIG_MFD_PCA9450=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_AXP20X=y
+CONFIG_REGULATOR_BD718XX=y
+CONFIG_REGULATOR_BD9571MWV=y
+CONFIG_REGULATOR_FAN53555=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_REGULATOR_HI6421V530=y
+CONFIG_REGULATOR_MAX77620=y
+CONFIG_REGULATOR_MAX8973=y
+CONFIG_REGULATOR_PCA9450=y
+CONFIG_REGULATOR_PFUZE100=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_REGULATOR_QCOM_SPMI=y
+CONFIG_REGULATOR_RK808=y
+CONFIG_REGULATOR_S2MPS11=y
+CONFIG_REGULATOR_VCTRL=m
+CONFIG_RC_CORE=m
+CONFIG_RC_DECODERS=y
+CONFIG_RC_DEVICES=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
+CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+# CONFIG_DVB_NET is not set
+CONFIG_MEDIA_USB_SUPPORT=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_VIDEO_MX8_CAPTURE=y
+CONFIG_VIDEO_MXC_CAPTURE=y
+CONFIG_VIDEO_MXC_CSI_CAMERA=y
+CONFIG_MXC_MIPI_CSI=y
+CONFIG_MXC_CAMERA_OV5640_MIPI_V2=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_OV5640=y
+CONFIG_IMX_DPU_CORE=y
+CONFIG_IMX_LCDIF_CORE=y
+CONFIG_DRM=y
+CONFIG_DRM_I2C_NXP_TDA998X=m
+CONFIG_DRM_MALI_DISPLAY=m
+CONFIG_DRM_NOUVEAU=m
+CONFIG_DRM_RCAR_LVDS=m
+CONFIG_DRM_PANEL_SIMPLE=y
+CONFIG_DRM_PANEL_RAYDIUM_RM67191=y
+CONFIG_DRM_SII902X=m
+CONFIG_DRM_I2C_ADV7511=y
+CONFIG_DRM_NWL_MIPI_DSI=y
+CONFIG_DRM_CDNS_HDMI_CEC=y
+CONFIG_DRM_DW_HDMI_I2S_AUDIO=m
+CONFIG_DRM_ITE_IT6263=y
+CONFIG_DRM_IMX=y
+CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
+CONFIG_DRM_IMX_TVE=y
+CONFIG_DRM_IMX_LDB=y
+CONFIG_DRM_IMX_HDMI=y
+CONFIG_DRM_IMX_SEC_DSIM=y
+CONFIG_DRM_IMX_CDNS_MHDP=y
+CONFIG_DRM_IMX_DCSS=y
+CONFIG_DRM_ETNAVIV=m
+CONFIG_DRM_HISI_HIBMC=m
+CONFIG_DRM_HISI_KIRIN=m
+CONFIG_DRM_MXSFB=y
+CONFIG_DRM_PL111=m
+CONFIG_DRM_LIMA=m
+CONFIG_DRM_PANFROST=m
+CONFIG_FB_ARMCLCD=y
+CONFIG_FB_EFI=y
+CONFIG_BACKLIGHT_GENERIC=m
+CONFIG_BACKLIGHT_PWM=y
+CONFIG_BACKLIGHT_LP855X=m
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_FSL_DAI=m
+CONFIG_SND_SOC_FSL_EASRC=y
+CONFIG_SND_IMX_SOC=y
+CONFIG_SND_SOC_IMX_AK4458=y
+CONFIG_SND_SOC_IMX_AK5558=y
+CONFIG_SND_SOC_IMX_AK4497=y
+CONFIG_SND_SOC_IMX_WM8960=y
+CONFIG_SND_SOC_IMX_WM8524=y
+CONFIG_SND_SOC_IMX_CS42888=y
+CONFIG_SND_SOC_IMX_MICFIL=y
+CONFIG_SND_SOC_IMX_RPMSG=y
+CONFIG_SND_SOC_IMX_MQS=y
+CONFIG_SND_SOC_IMX_SPDIF=y
+CONFIG_SND_SOC_IMX_AUDMIX=y
+CONFIG_SND_SOC_IMX_PDM_MIC=y
+CONFIG_SND_SOC_IMX_DSP=y
+CONFIG_SND_SOC_IMX_CDNHDMI=y
+CONFIG_SND_SOC_SOF_TOPLEVEL=y
+CONFIG_SND_SOC_SOF_OF=m
+CONFIG_SND_SOC_SOF_IMX_TOPLEVEL=y
+CONFIG_SND_SOC_SOF_IMX8_SUPPORT=y
+CONFIG_SND_SOC_SOF_IMX8=m
+CONFIG_SND_SOC_AK4613=m
+CONFIG_SND_SOC_DMIC=m
+CONFIG_SND_SOC_ES7134=m
+CONFIG_SND_SOC_ES7241=m
+CONFIG_SND_SOC_MAX98357A=m
+CONFIG_SND_SOC_PCM3168A_I2C=m
+CONFIG_SND_SOC_SGTL5000=m
+CONFIG_SND_SOC_SPDIF=m
+CONFIG_SND_SOC_TAS571X=m
+CONFIG_SND_SIMPLE_CARD=y
+CONFIG_SND_AUDIO_GRAPH_CARD=y
+CONFIG_I2C_HID=m
+CONFIG_USB=y
+CONFIG_USB_OTG=y
+CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_HCD_TEST_MODE=y
+CONFIG_USB_ACM=m
+CONFIG_USB_STORAGE=y
+CONFIG_USB_CDNS3=y
+CONFIG_USB_CDNS3_GADGET=y
+CONFIG_USB_CDNS3_HOST=y
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_CHIPIDEA=y
+CONFIG_USB_CHIPIDEA_UDC=y
+CONFIG_USB_CHIPIDEA_HOST=y
+CONFIG_USB_ISP1760=y
+CONFIG_USB_TEST=m
+CONFIG_USB_EHSET_TEST_FIXTURE=m
+CONFIG_USB_HSIC_USB3503=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_USB_MXS_PHY=y
+CONFIG_USB_ULPI=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_SNP_UDC_PLAT=y
+CONFIG_USB_BDC_UDC=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_SERIAL=y
+CONFIG_USB_CONFIGFS_ACM=y
+CONFIG_USB_CONFIGFS_OBEX=y
+CONFIG_USB_CONFIGFS_NCM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_ECM_SUBSET=y
+CONFIG_USB_CONFIGFS_RNDIS=y
+CONFIG_USB_CONFIGFS_EEM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS_F_LB_SS=y
+CONFIG_USB_CONFIGFS_F_FS=y
+CONFIG_USB_CONFIGFS_F_UAC1=y
+CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
+CONFIG_USB_CONFIGFS_F_UAC2=y
+CONFIG_USB_CONFIGFS_F_MIDI=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_USB_CONFIGFS_F_UVC=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_AUDIO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_TYPEC=y
+CONFIG_TYPEC_TCPM=y
+CONFIG_TYPEC_TCPCI=y
+CONFIG_TYPEC_SWITCH_GPIO=y
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK_MINORS=32
+CONFIG_MMC_ARMMMCI=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_ACPI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_OF_ARASAN=y
+CONFIG_MMC_SDHCI_OF_ESDHC=y
+CONFIG_MMC_SDHCI_CADENCE=y
+CONFIG_MMC_SDHCI_ESDHC_IMX=y
+CONFIG_MMC_SDHCI_F_SDH30=y
+CONFIG_MMC_SPI=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_EXYNOS=y
+CONFIG_MMC_DW_HI3798CV200=y
+CONFIG_MMC_DW_K3=y
+CONFIG_MMC_SDHCI_XENON=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_PWM=y
+CONFIG_LEDS_SYSCON=y
+CONFIG_LEDS_TRIGGER_DISK=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_CPU=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+CONFIG_LEDS_TRIGGER_PANIC=y
+CONFIG_EDAC=y
+CONFIG_EDAC_GHES=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_MAX77686=y
+CONFIG_RTC_DRV_RK808=m
+CONFIG_RTC_DRV_PCF85363=y
+CONFIG_RTC_DRV_RX8581=m
+CONFIG_RTC_DRV_S5M=y
+CONFIG_RTC_DRV_DS3232=y
+CONFIG_RTC_DRV_PCF2127=y
+CONFIG_RTC_DRV_EFI=y
+CONFIG_RTC_DRV_CROS_EC=y
+CONFIG_RTC_DRV_PL031=y
+CONFIG_RTC_DRV_SNVS=y
+CONFIG_RTC_DRV_IMX_SC=y
+CONFIG_DMADEVICES=y
+CONFIG_BCM_SBA_RAID=m
+CONFIG_FSL_EDMA=y
+CONFIG_FSL_EDMA_V3=y
+CONFIG_IMX_SDMA=y
+CONFIG_MV_XOR_V2=y
+CONFIG_MXS_DMA=y
+CONFIG_PL330_DMA=y
+CONFIG_QCOM_HIDMA_MGMT=y
+CONFIG_QCOM_HIDMA=y
+CONFIG_DMATEST=y
+CONFIG_UIO=y
+CONFIG_UIO_PCI_GENERIC=y
+CONFIG_VFIO=y
+CONFIG_VFIO_PCI=y
+CONFIG_VFIO_FSL_MC=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_BALLOON=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+CONFIG_STAGING=y
+CONFIG_STAGING_MEDIA=y
+CONFIG_VIDEO_IMX_CAPTURE=y
+CONFIG_ION=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
+CONFIG_FSL_DPAA2=y
+CONFIG_FSL_DPAA2_ETHSW=y
+CONFIG_FSL_DPAA2_MAC=y
+CONFIG_FSL_SDK_DPA=y
+CONFIG_FSL_PPFE=y
+CONFIG_FSL_PPFE_UTIL_DISABLED=y
+CONFIG_MFD_CROS_EC=y
+CONFIG_CROS_EC_I2C=y
+CONFIG_CROS_EC_SPI=y
+CONFIG_COMMON_CLK_VERSATILE=y
+CONFIG_CLK_SP810=y
+CONFIG_CLK_VEXPRESS_OSC=y
+CONFIG_COMMON_CLK_RK808=y
+CONFIG_COMMON_CLK_SCPI=y
+CONFIG_COMMON_CLK_CS2000_CP=y
+CONFIG_COMMON_CLK_S2MPS11=y
+CONFIG_COMMON_CLK_XGENE=y
+CONFIG_COMMON_CLK_PWM=y
+CONFIG_CLK_IMX8MM=y
+CONFIG_CLK_IMX8MN=y
+CONFIG_CLK_IMX8MQ=y
+CONFIG_CLK_IMX8QXP=y
+CONFIG_HWSPINLOCK=y
+CONFIG_ARM_MHU=y
+CONFIG_IMX_MBOX=y
+CONFIG_PLATFORM_MHU=y
+CONFIG_ARM_SMMU=y
+CONFIG_ARM_SMMU_V3=y
+CONFIG_REMOTEPROC=y
+CONFIG_RPMSG_QCOM_GLINK_RPM=y
+CONFIG_SOC_BRCMSTB=y
+CONFIG_FSL_MC_DPIO=y
+CONFIG_FSL_QIXIS=y
+CONFIG_IMX_SCU_SOC=y
+CONFIG_SOC_TI=y
+CONFIG_EXTCON_USB_GPIO=y
+CONFIG_EXTCON_USBC_CROS_EC=y
+CONFIG_IIO=y
+CONFIG_IMX8QXP_ADC=y
+CONFIG_IIO_CROS_EC_SENSORS_CORE=m
+CONFIG_IIO_CROS_EC_SENSORS=m
+CONFIG_IIO_CROS_EC_LIGHT_PROX=m
+CONFIG_IIO_CROS_EC_BARO=m
+CONFIG_PWM=y
+CONFIG_PWM_CROS_EC=m
+CONFIG_PWM_IMX27=y
+CONFIG_PHY_XGENE=y
+CONFIG_PHY_MIXEL_MIPI_DPHY=y
+CONFIG_PHY_QCOM_USB_HS=y
+CONFIG_PHY_SAMSUNG_USB2=y
+CONFIG_FSL_IMX8_DDR_PMU=m
+CONFIG_HISI_PMU=y
+CONFIG_NVMEM_IMX_OCOTP=y
+CONFIG_NVMEM_IMX_OCOTP_SCU=y
+CONFIG_FPGA=y
+CONFIG_FPGA_BRIDGE=m
+CONFIG_ALTERA_FREEZE_BRIDGE=m
+CONFIG_FPGA_REGION=m
+CONFIG_OF_FPGA_REGION=m
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+CONFIG_MUX_MMIO=y
+CONFIG_MXC_SIM=y
+CONFIG_MXC_EMVSIM=y
+CONFIG_MXC_MLB150=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_BTRFS_FS=m
+CONFIG_BTRFS_FS_POSIX_ACL=y
+CONFIG_FANOTIFY=y
+CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
+CONFIG_QUOTA=y
+CONFIG_AUTOFS4_FS=y
+CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+CONFIG_OVERLAY_FS=m
+CONFIG_VFAT_FS=y
+CONFIG_HUGETLBFS=y
+CONFIG_EFIVAR_FS=y
+CONFIG_JFFS2_FS=y
+CONFIG_UBIFS_FS=y
+CONFIG_SQUASHFS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_NFS_V4_2=y
+CONFIG_ROOT_NFS=y
+CONFIG_9P_FS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_SECURITY=y
+CONFIG_CRYPTO_USER=y
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_CHACHA20POLY1305=m
+CONFIG_CRYPTO_ECHAINIV=y
+CONFIG_CRYPTO_TLS=m
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_CFB=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_OFB=m
+CONFIG_CRYPTO_XTS=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_ANSI_CPRNG=y
+CONFIG_CRYPTO_DEV_FSL_CAAM=y
+CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
+CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=m
+CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
+CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y
+CONFIG_INDIRECT_PIO=y
+CONFIG_CMA_SIZE_MBYTES=320
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_FTRACE is not set
+CONFIG_MEMTEST=y
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx_4.9.123.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-imx_4.9.123.bb
deleted file mode 100644
index bc47f2db..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-imx_4.9.123.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2013-2016 Freescale Semiconductor
-# Copyright 2017-2018 NXP
-# Copyright 2018 (C) O.S. Systems Software LTDA.
-# Released under the MIT license (see COPYING.MIT for the terms)
-
-SUMMARY = "Linux Kernel provided and supported by NXP"
-DESCRIPTION = "Linux Kernel provided and supported by NXP with focus on \
-i.MX Family Reference Boards. It includes support for many IPs such as GPU, VPU and IPU."
-
-require recipes-kernel/linux/linux-imx.inc
-
-DEPENDS += "lzop-native bc-native"
-
-SRCBRANCH = "imx_4.9.123_imx8mm_ga"
-LOCALVERSION = "-imx"
-SRCREV = "6a71cbc089755afd6a86c005c22a1af6eab24a70"
-
-DEFAULT_PREFERENCE = "1"
-
-COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-imx_5.4.3.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-imx_5.4.3.bb
new file mode 100644
index 00000000..6c042184
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-imx_5.4.3.bb
@@ -0,0 +1,35 @@
+# Copyright 2013-2016 (C) Freescale Semiconductor
+# Copyright 2017-2019 (C) NXP
+# Copyright 2018 (C) O.S. Systems Software LTDA.
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# SPDX-License-Identifier: MIT
+#
+
+SUMMARY = "Linux Kernel provided and supported by NXP"
+DESCRIPTION = "Linux Kernel provided and supported by NXP with focus on \
+i.MX Family Reference Boards. It includes support for many IPs such as GPU, VPU and IPU."
+
+require recipes-kernel/linux/linux-imx.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+
+DEPENDS += "lzop-native bc-native"
+
+SRCBRANCH = "lf-5.4.y"
+LOCALVERSION = "-1.0.0"
+SRCREV = "f8118585ee3c7025265b28985fdfe0af96a84466"
+
+# PV is defined in the base in linux-imx.inc file and uses the LINUX_VERSION definition
+# required by kernel-yocto.bbclass.
+#
+# LINUX_VERSION define should match to the kernel version referenced by SRC_URI and
+# should be updated once patchlevel is merged.
+LINUX_VERSION = "5.4.3"
+
+SRC_URI += "file://0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch"
+
+DEFAULT_PREFERENCE = "1"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_4.14.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq.inc
index cb06ae43..dcf28401 100644
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_4.14.bb
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq.inc
@@ -4,12 +4,6 @@ inherit fsl-kernel-localversion
SUMMARY = "Linux Kernel for NXP QorIQ platforms"
SECTION = "kernel"
LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/linux;nobranch=1 \
- file://0001-fix-gcc8-build-error.patch \
-"
-SRCREV = "7e0006ca696756b867abbeb7a4ed97ffe9caf725"
S = "${WORKDIR}/git"
@@ -24,6 +18,9 @@ KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
ZIMAGE_BASE_NAME = "zImage-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
ZIMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+# Set the PV to the correct kernel version to satisfy the kernel version sanity check
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
SCMVERSION ?= "y"
LOCALVERSION = ""
DELTA_KERNEL_DEFCONFIG ?= ""
@@ -31,12 +28,13 @@ DELTA_KERNEL_DEFCONFIG_prepend_qoriq-arm64 = "lsdk.config "
DELTA_KERNEL_DEFCONFIG_prepend_fsl-lsch2-32b = "multi_v7_lpae.config multi_v8.config lsdk.config "
DELTA_KERNEL_DEFCONFIG_prepend_ls102xa = "multi_v7_lpae.config lsdk.config "
+do_merge_delta_config[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot bison-native:do_populate_sysroot"
do_merge_delta_config[dirs] = "${B}"
do_merge_delta_config() {
# create config with make config
oe_runmake -C ${S} O=${B} ${KERNEL_DEFCONFIG}
-
+
# check if bigendian is enabled
if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then
echo "CONFIG_CPU_BIG_ENDIAN=y" >> .config
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makefile-fix-gcc-8-build-error.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makefile-fix-gcc-8-build-error.patch
deleted file mode 100644
index b4c4aed8..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makefile-fix-gcc-8-build-error.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 5066b8f46b0f2348881923491b93825ac04d13d2 Mon Sep 17 00:00:00 2001
-From: Chunrong Guo <chunrong.guo@nxp.com>
-Date: Sat, 29 Sep 2018 14:12:34 +0800
-Subject: [PATCH] Makefile: fix gcc-8 build error
-
-Signed-off-by: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com>
----
- Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/Makefile b/Makefile
-index 53d57ac..b7c5fd4 100644
---- a/Makefile
-+++ b/Makefile
-@@ -395,6 +395,7 @@ LINUXINCLUDE += $(filter-out $(LINUXINCLUDE),$(USERINCLUDE))
- KBUILD_AFLAGS := -D__ASSEMBLY__
- KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
- -fno-strict-aliasing -fno-common \
-+ -Wno-packed-not-aligned -Wno-tautological-compare \
- -Werror-implicit-function-declaration \
- -Wno-format-security \
- -std=gnu89
---
-1.8.3.1
-
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makfefile-linux-5.4-add-warning-cflags-on-LSDK-20.04.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makfefile-linux-5.4-add-warning-cflags-on-LSDK-20.04.patch
new file mode 100644
index 00000000..b6c21d06
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-Makfefile-linux-5.4-add-warning-cflags-on-LSDK-20.04.patch
@@ -0,0 +1,26 @@
+From 6cf92b25d63ff9e2b77ce0fbf62f4d5d040ef5db Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Tue, 12 Mar 2019 03:52:03 +0100
+Subject: [PATCH] Makfefile: linux-5.4 add warning cflags on LSDK-20.04
+
+Signed-off-by: C.r. Guo <nxa13725@lsv07004.swis.us-cdc01.nxp.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 07998b60d56c..7ec8fcb73e17 100644
+--- a/Makefile
++++ b/Makefile
+@@ -458,7 +458,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
+ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
+ -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
+ -Werror=implicit-function-declaration -Werror=implicit-int \
+- -Wno-format-security \
++ -Wno-address-of-packed-member -Wno-format-security \
+ -std=gnu89
+ KBUILD_CPPFLAGS := -D__KERNEL__
+ KBUILD_AFLAGS_KERNEL :=
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-fix-gcc8-build-error.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-fix-gcc8-build-error.patch
deleted file mode 100644
index 3cd25014..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-fix-gcc8-build-error.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 844ce11967bca7b7f68c6cb459e02c9a10f32574 Mon Sep 17 00:00:00 2001
-From: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com>
-Date: Tue, 3 Jul 2018 15:06:29 +0800
-Subject: [PATCH] fix gcc8 build error
-
----
- Makefile | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/Makefile b/Makefile
-index d6db01a..85d9d6c 100644
---- a/Makefile
-+++ b/Makefile
-@@ -422,6 +422,8 @@ LINUXINCLUDE := \
- KBUILD_AFLAGS := -D__ASSEMBLY__
- KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
- -fno-strict-aliasing -fno-common -fshort-wchar \
-+ -Wno-packed-not-aligned \
-+ -Wno-tautological-compare \
- -Werror-implicit-function-declaration \
- -Wno-format-security \
- -std=gnu89
---
-1.8.3.1
-
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch
new file mode 100644
index 00000000..e3df8084
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq/0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch
@@ -0,0 +1,63 @@
+From 0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 Mon Sep 17 00:00:00 2001
+From: Changbin Du <changbin.du@gmail.com>
+Date: Tue, 28 Jan 2020 23:29:38 +0800
+Subject: [PATCH] perf: Make perf able to build with latest libbfd
+
+libbfd has changed the bfd_section_* macros to inline functions
+bfd_section_<field> since 2019-09-18. See below two commits:
+ o http://www.sourceware.org/ml/gdb-cvs/2019-09/msg00064.html
+ o https://www.sourceware.org/ml/gdb-cvs/2019-09/msg00072.html
+
+This fix make perf able to build with both old and new libbfd.
+
+Upstream-Status: Submitted [commit 0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 upstream]
+
+Signed-off-by: Changbin Du <changbin.du@gmail.com>
+Acked-by: Jiri Olsa <jolsa@redhat.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Link: http://lore.kernel.org/lkml/20200128152938.31413-1-changbin.du@gmail.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ tools/perf/util/srcline.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
+index 6ccf6f6d09df..5b7d6c16d33f 100644
+--- a/tools/perf/util/srcline.c
++++ b/tools/perf/util/srcline.c
+@@ -193,16 +193,30 @@ static void find_address_in_section(bfd *abfd, asection *section, void *data)
+ bfd_vma pc, vma;
+ bfd_size_type size;
+ struct a2l_data *a2l = data;
++ flagword flags;
+
+ if (a2l->found)
+ return;
+
+- if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
++#ifdef bfd_get_section_flags
++ flags = bfd_get_section_flags(abfd, section);
++#else
++ flags = bfd_section_flags(section);
++#endif
++ if ((flags & SEC_ALLOC) == 0)
+ return;
+
+ pc = a2l->addr;
++#ifdef bfd_get_section_vma
+ vma = bfd_get_section_vma(abfd, section);
++#else
++ vma = bfd_section_vma(section);
++#endif
++#ifdef bfd_get_section_size
+ size = bfd_get_section_size(section);
++#else
++ size = bfd_section_size(section);
++#endif
+
+ if (pc < vma || pc >= vma + size)
+ return;
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_4.9.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_4.9.bb
deleted file mode 100644
index 04ff7b96..00000000
--- a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_4.9.bb
+++ /dev/null
@@ -1,71 +0,0 @@
-inherit kernel qoriq_build_64bit_kernel siteinfo
-inherit fsl-kernel-localversion
-
-SUMMARY = "Linux Kernel for Freescale QorIQ platforms"
-SECTION = "kernel"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-
-SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/linux;nobranch=1 \
- file://0001-Makefile-fix-gcc-8-build-error.patch \
-"
-SRCREV = "e8b01fb24fb8eb1adee9667eba2cae702b5892e9"
-
-S = "${WORKDIR}/git"
-
-DEPENDS_append = " libgcc"
-# not put Images into /boot of rootfs, install kernel-image if needed
-RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
-
-KERNEL_CC_append = " ${TOOLCHAIN_OPTIONS}"
-KERNEL_LD_append = " ${TOOLCHAIN_OPTIONS}"
-KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
-
-ZIMAGE_BASE_NAME = "zImage-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
-ZIMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
-
-SCMVERSION ?= "y"
-LOCALVERSION = ""
-DELTA_KERNEL_DEFCONFIG ?= ""
-DELTA_KERNEL_DEFCONFIG_prepend_qoriq-arm64 = "lsdk.config "
-DELTA_KERNEL_DEFCONFIG_prepend_fsl-lsch2-32b = "multi_v7_lpae.config multi_v8.config lsdk.config "
-DELTA_KERNEL_DEFCONFIG_prepend_ls102xa = "multi_v7_lpae.config lsdk.config "
-
-do_merge_delta_config[dirs] = "${B}"
-
-do_merge_delta_config() {
- # create .config with make config
- oe_runmake -C ${S} O=${B} ${KERNEL_DEFCONFIG}
-
- # check if bigendian is enabled
- if [ "${SITEINFO_ENDIANNESS}" = "be" ]; then
- echo "CONFIG_CPU_BIG_ENDIAN=y" >> .config
- echo "CONFIG_MTD_CFI_BE_BYTE_SWAP=y" >> .config
- fi
-
- # add config fragments
- for deltacfg in ${DELTA_KERNEL_DEFCONFIG}; do
- if [ -f ${S}/arch/${ARCH}/configs/${deltacfg} ]; then
- oe_runmake -C ${S} O=${B} ${deltacfg}
- elif [ -f "${WORKDIR}/${deltacfg}" ]; then
- ${S}/scripts/kconfig/merge_config.sh -m .config ${WORKDIR}/${deltacfg}
- elif [ -f "${deltacfg}" ]; then
- ${S}/scripts/kconfig/merge_config.sh -m .config ${deltacfg}
- fi
- done
- cp .config ${WORKDIR}/defconfig
-}
-addtask merge_delta_config before do_preconfigure after do_patch
-
-# The link of dts folder is needed for 32b compile of aarch64 targets(e.g. ls1043ardb-32b)
-do_compile_prepend_fsl-lsch2-32b() {
- ln -sfT ${STAGING_KERNEL_DIR}/arch/arm64/boot/dts/freescale ${STAGING_KERNEL_DIR}/arch/arm/boot/dts/freescale
-}
-
-do_install_append_qoriq-arm() {
- install -m 0644 arch/${ARCH}/boot/zImage ${D}/boot/zImage-${KERNEL_VERSION}
- ln -sf zImage-${KERNEL_VERSION} ${D}/boot/zImage
-}
-
-FILES_${KERNEL_PACKAGE_NAME}-image += "/boot/zImage*"
-COMPATIBLE_MACHINE = "(qoriq)"
diff --git a/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_5.4.bb b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_5.4.bb
new file mode 100644
index 00000000..d1b979f9
--- /dev/null
+++ b/bsp/meta-freescale/recipes-kernel/linux/linux-qoriq_5.4.bb
@@ -0,0 +1,11 @@
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+
+LINUX_VERSION = "5.4.3"
+
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/linux;nobranch=1 \
+ file://0001-Makfefile-linux-5.4-add-warning-cflags-on-LSDK-20.04.patch \
+ file://0001-perf-Make-perf-able-to-build-with-latest-libbfd.patch \
+"
+SRCREV = "134788b16485dd9fa81988681d2365ee38633fa2"
+
+require recipes-kernel/linux/linux-qoriq.inc
diff --git a/bsp/meta-freescale/recipes-kernel/skmm-host/skmm-host_git.bb b/bsp/meta-freescale/recipes-kernel/skmm-host/skmm-host_git.bb
index 4c7a371a..4b111b5d 100644
--- a/bsp/meta-freescale/recipes-kernel/skmm-host/skmm-host_git.bb
+++ b/bsp/meta-freescale/recipes-kernel/skmm-host/skmm-host_git.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=99803d8e9a595c0bdb45ca710f353813"
inherit module qoriq_build_64bit_kernel
-SRC_URI = "git://git.freescale.com/ppc/sdk/skmm-host.git;branch=sdk-v2.0.x"
+SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-yocto-sdk/skmm-host;protocol=https;nobranch=1"
SRCREV = "d5912ebdb8d3b29b1e2df52710e8821d1ce3eb80"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-multimedia/alsa/imx-alsa-plugins_1.0.26.bb b/bsp/meta-freescale/recipes-multimedia/alsa/imx-alsa-plugins_1.0.26.bb
index 94c3f4a7..db2f71fd 100644
--- a/bsp/meta-freescale/recipes-multimedia/alsa/imx-alsa-plugins_1.0.26.bb
+++ b/bsp/meta-freescale/recipes-multimedia/alsa/imx-alsa-plugins_1.0.26.bb
@@ -17,9 +17,9 @@ LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
inherit autotools pkgconfig use-imx-headers
-SRCBRANCH = "nxp/master"
+SRCBRANCH = "MM_04.05.01_1909_L4.19.35"
SRC_URI = "git://source.codeaurora.org/external/imx/imx-alsa-plugins.git;protocol=https;branch=${SRCBRANCH}"
-SRCREV = "9a63071e7734bd164017f3761b8d1944c017611f"
+SRCREV = "cde60d68ab2acee913dbfacb8aabb53d87dd3e38"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch
deleted file mode 100644
index 2cab87f9..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 90916f96262fa7b27a0a99788c69f9fd6df11000 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Tue, 24 Nov 2015 16:46:27 +0200
-Subject: [PATCH] introspection.m4: prefix pkgconfig paths with
- PKG_CONFIG_SYSROOT_DIR
-
-We can't use our tweaked introspection.m4 from gobject-introspection tarball
-because gstreamer also defines INTROSPECTION_INIT in its introspection.m4, which
-is later supplied to g-ir-scanner.
-
-Upstream-Status: Pending [review on oe-core list]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- common/m4/introspection.m4 | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/common/m4/introspection.m4 b/common/m4/introspection.m4
-index 162be57..217a6ae 100644
---- a/common/m4/introspection.m4
-+++ b/common/m4/introspection.m4
-@@ -54,14 +54,14 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
- INTROSPECTION_GIRDIR=
- INTROSPECTION_TYPELIBDIR=
- if test "x$found_introspection" = "xyes"; then
-- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
-+ INTROSPECTION_SCANNER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-+ INTROSPECTION_COMPILER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-+ INTROSPECTION_GENERATE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
- INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
- INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
- INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
- INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
-- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
-+ INTROSPECTION_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
- INTROSPECTION_INIT="extern void gst_init(gint*,gchar**); gst_init(NULL,NULL);"
- fi
- AC_SUBST(INTROSPECTION_SCANNER)
---
-2.6.2
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch
deleted file mode 100644
index d86c78d7..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 7018ca1c4bf26c8317e7fcd2e7e4e648195f42ca Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Wed, 20 Dec 2017 13:03:03 +0000
-Subject: [PATCH] gstreamer: use a patch instead of sed to fix gtk-doc
-
-Patch the gtk-doc makefiles so that the qemu wrapper is used to run transient
-binaries instead of libtool wrapper or running them directly.
-
-Also substitute a bogus plugin scanner, as trying to run the real one is causing
-issues during build on x86_64.
-
-Upstream-Status: Inappropriate
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
----
- common/gtk-doc.mak | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/common/gtk-doc.mak b/common/gtk-doc.mak
-index 3f83491..e5cb0d1 100644
---- a/common/gtk-doc.mak
-+++ b/common/gtk-doc.mak
-@@ -6,11 +6,11 @@
- if GTK_DOC_USE_LIBTOOL
- GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
--GTKDOC_RUN = $(LIBTOOL) --mode=execute
-+GTKDOC_RUN = $(top_builddir)/gtkdoc-qemuwrapper
- else
- GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
--GTKDOC_RUN =
-+GTKDOC_RUN = $(top_builddir)/gtkdoc-qemuwrapper
- endif
-
- # We set GPATH here; this gives us semantics for GNU make
-@@ -101,6 +101,7 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
- GST_PLUGIN_PATH_1_0= \
- GST_REGISTRY_1_0=doc-registry.xml \
- $(GTKDOC_EXTRA_ENVIRONMENT) \
-+ GST_PLUGIN_SCANNER_1_0="$(top_builddir)/libs/gst/helpers/gst-plugin-scanner-dummy" \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \
- CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
- LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
---
-2.15.1
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
new file mode 100644
index 00000000..1d99ad12
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
@@ -0,0 +1,33 @@
+From 54bba228ea52d01fd84941d97be23c03f9862b64 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Sat, 6 Apr 2013 01:22:22 +0200
+Subject: [PATCH] Disable yasm for libav when --disable-yasm
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ configure.ac | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 22ede88..ef3c050 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -305,6 +305,12 @@ else
+ emblibav_configure_args="$emblibav_configure_args --enable-gpl"
+ fi
+
++ AC_ARG_ENABLE(yasm,
++ [AC_HELP_STRING([--disable-yasm], [disable use of yasm assembler])])
++ if test "x$enable_yasm" = "xno"; then
++ emblibav_configure_args="$emblibav_configure_args --disable-yasm"
++ fi
++
+ # if we are cross-compiling, tell libav so
+ case $host in
+ *android*)
+--
+1.8.2
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch
new file mode 100644
index 00000000..b80d0739
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch
@@ -0,0 +1,35 @@
+From aac5902d3c9cb35c771e760d0e487622aa2e116a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Apr 2017 10:38:18 -0700
+Subject: [PATCH] configure: check for armv7ve variant
+
+OE passes -mcpu and -march via cmdline and if
+package tries to detect one of it own then it
+should be compatible otherwise, newer gcc7+ will
+error out
+
+Check for relevant preprocessor macro to determine
+armv7ve architecture
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gst-libs/ext/libav/configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gst-libs/ext/libav/configure b/gst-libs/ext/libav/configure
+index 4a5e477..727818e 100755
+--- a/gst-libs/ext/libav/configure
++++ b/gst-libs/ext/libav/configure
+@@ -4295,6 +4295,7 @@ elif enabled arm; then
+ elif check_arm_arch 6Z; then echo armv6z
+ elif check_arm_arch 6ZK; then echo armv6zk
+ elif check_arm_arch 6T2; then echo armv6t2
++ elif check_arm_arch EXT_IDIV; then echo armv7ve
+ elif check_arm_arch 7; then echo armv7
+ elif check_arm_arch 7A 7_A; then echo armv7-a
+ elif check_arm_arch 7S; then echo armv7-a
+--
+2.12.2
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-fix-host-contamination.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-fix-host-contamination.patch
new file mode 100644
index 00000000..120c0798
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-fix-host-contamination.patch
@@ -0,0 +1,36 @@
+From c1700f867f876ee33c130a8e28b688e2b1d89663 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Wed, 11 Apr 2018 17:14:55 +0800
+Subject: [PATCH] Prevent host contamination
+
+Remove reference to host $(libdir) from .la files.
+
+Upstream-Status: Inappropriate [cross-compile specific]
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ gst-libs/ext/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gst-libs/ext/Makefile.am b/gst-libs/ext/Makefile.am
+index 6cdc048..a19d255 100644
+--- a/gst-libs/ext/Makefile.am
++++ b/gst-libs/ext/Makefile.am
+@@ -49,7 +49,7 @@ echo " GEN $1.la" && \
+ echo "library_names=''" && \
+ echo "old_library='$1.a'" && \
+ echo "inherited_linker_flags=''" && \
+- echo "dependency_libs=' -L$(libdir) $(if $2,$(foreach dep,$2,$(abs_builddir)/$(dep).la)) $(call find_library_la,$3 $(LIBM),$(LDFLAGS)) '" && \
++ echo "dependency_libs=' -L $(if $2,$(foreach dep,$2,$(abs_builddir)/$(dep).la)) $(call find_library_la,$3 $(LIBM),$(LDFLAGS)) '" && \
+ echo "weak_library_names=''" && \
+ echo "current=" && \
+ echo "age=" && \
+@@ -58,7 +58,7 @@ echo " GEN $1.la" && \
+ echo "shouldnotlink=no" && \
+ echo "dlopen=''" && \
+ echo "dlpreopen=''" && \
+- echo "libdir='$(libdir)'") > $1.la
++ echo "libdir=''") > $1.la
+ endef
+
+ libavutil.la:
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch
new file mode 100644
index 00000000..7a0b4488
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch
@@ -0,0 +1,32 @@
+It will add -mips64r6 and -mips64r2 to cmdline which will
+cause conflicts
+
+in OE we user mips32r2 and mips64r2 for mips arch versions
+so there is no benefit of detecting it automatically by
+poking at tools especially in cross env
+
+Fixes errors like
+
+linking -mnan=2008 module with previous -mnan=legacy modules
+failed to merge target specific data of file
+
+-Khem
+Upstream-Status: Inappropriate [OE-Specific]
+
+Index: gst-libav-1.10.1/gst-libs/ext/libav/configure
+===================================================================
+--- gst-libav-1.10.1.orig/gst-libs/ext/libav/configure
++++ gst-libav-1.10.1/gst-libs/ext/libav/configure
+@@ -5269,12 +5269,9 @@ elif enabled mips; then
+
+ # Enable minimum ISA based on selected options
+ if enabled mips64; then
+- enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
+ enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
+ disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
+ else
+- enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
+- enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
+ enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
+ disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
+ fi
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
new file mode 100644
index 00000000..36abf860
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
@@ -0,0 +1,26 @@
+Description: Workaround to build libav for i586 with gcc 4.9.2 by avoiding memset
+Author: Bernhard Übelacker <bernhardu@vr-web.de>
+
+---
+Bug-Debian: https://bugs.debian.org/783082
+Last-Update: 2015-04-28
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+--- gst-libav-1.4.5.orig/gst-libs/ext/libav/libavcodec/h264_cabac.c
++++ gst-libav-1.4.5/gst-libs/ext/libav/libavcodec/h264_cabac.c
+@@ -2020,7 +2020,11 @@ decode_intra_mb:
+ // In deblocking, the quantizer is 0
+ h->cur_pic.qscale_table[mb_xy] = 0;
+ // All coeffs are present
+- memset(h->non_zero_count[mb_xy], 16, 48);
++ /*memset(h->non_zero_count[mb_xy], 16, 48);*/
++ /* avoiding this memset because it leads at least with gcc4.9.2 to error: 'asm' operand has impossible constraints */
++ for (size_t i = 0; i < 48; i++) {
++ ( (unsigned char*)(h->non_zero_count[mb_xy]) ) [i] = 16;
++ }
+ h->cur_pic.mb_type[mb_xy] = mb_type;
+ sl->last_qscale_diff = 0;
+ return 0;
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.16.0.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.16.0.bb
new file mode 100644
index 00000000..3f1ec99d
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.16.0.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Libav-based GStreamer 1.x plugin"
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+SECTION = "multimedia"
+
+LICENSE = "GPLv2+ & LGPLv2+ & ( (GPLv2+ & LGPLv2.1+) | (GPLv3+ & LGPLv3+) )"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+ file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
+ file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+ file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
+ file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
+ file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
+ file://mips64_cpu_detection.patch \
+ file://0001-configure-check-for-armv7ve-variant.patch \
+ file://0001-fix-host-contamination.patch \
+ "
+SRC_URI[md5sum] = "e3a201a45985ddc1327cd496046ca818"
+SRC_URI[sha256sum] = "dfac119043a9cfdcacd7acde77f674ab172cf2537b5812be52f49e9cddc53d9a"
+
+S = "${WORKDIR}/gst-libav-${PV}"
+
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base zlib bzip2 xz"
+
+inherit autotools pkgconfig upstream-version-is-even gtk-doc
+
+# CAUTION: Using the system libav is not recommended. Since the libav API is changing all the time,
+# compilation errors (and other, more subtle bugs) can happen. It is usually better to rely on the
+# libav copy included in the gst-libav package.
+PACKAGECONFIG ??= "orc yasm"
+
+PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl,"
+PACKAGECONFIG[libav] = "--with-system-libav,,libav"
+PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
+PACKAGECONFIG[yasm] = "--enable-yasm,--disable-yasm,nasm-native"
+PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind"
+
+GSTREAMER_1_0_DEBUG ?= "--disable-debug"
+
+LIBAV_EXTRA_CONFIGURE = "--with-libav-extra-configure"
+
+LIBAV_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux \
+ --cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \
+ --ranlib='${RANLIB}' \
+ ${GSTREAMER_1_0_DEBUG} \
+ --cross-prefix='${HOST_PREFIX}'"
+
+# Disable assembly optimizations for X32, as this libav lacks the support
+PACKAGECONFIG_remove_linux-gnux32 = "yasm"
+LIBAV_EXTRA_CONFIGURE_COMMON_ARG_append_linux-gnux32 = " --disable-asm"
+
+LIBAV_EXTRA_CONFIGURE_COMMON = \
+'${LIBAV_EXTRA_CONFIGURE}="${LIBAV_EXTRA_CONFIGURE_COMMON_ARG}"'
+
+EXTRA_OECONF = "${LIBAV_EXTRA_CONFIGURE_COMMON}"
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
+
+# http://errors.yoctoproject.org/Errors/Details/20493/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+# ffmpeg/libav disables PIC on some platforms (e.g. x86-32)
+INSANE_SKIP_${PN} = "textrel"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
deleted file mode 100644
index 355341e4..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From c890afb8a542a272acb398e8fc289b790afa08e4 Mon Sep 17 00:00:00 2001
-From: Yuqing Zhu <carol.zhu@nxp.com>
-Date: Sat, 21 Apr 2018 00:51:12 +0800
-Subject: [PATCH] Makefile.am: don't hardcode libtool name when running
- introspection tools
-
-Do refine base on commit: 7592e793b3906355d76ca9a59f8fea2749ea2a4e
-
-Upstream-Status: Pending [review on oe-core list]
-
-Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
----
- gst-libs/gst/insertbin/Makefile.am | 2 +-
- gst-libs/gst/mpegts/Makefile.am | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/gst-libs/gst/insertbin/Makefile.am b/gst-libs/gst/insertbin/Makefile.am
-index 1f8ea30..4b98ef6 100644
---- a/gst-libs/gst/insertbin/Makefile.am
-+++ b/gst-libs/gst/insertbin/Makefile.am
-@@ -45,7 +45,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstinsertbin-@GS
- --library=libgstinsertbin-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-insertbin-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/mpegts/Makefile.am b/gst-libs/gst/mpegts/Makefile.am
-index f264e33..9934a4d 100644
---- a/gst-libs/gst/mpegts/Makefile.am
-+++ b/gst-libs/gst/mpegts/Makefile.am
-@@ -82,7 +82,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstmpegts-@GST_API_
- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-video-@GST_API_VERSION@` \
- --library=libgstmpegts-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-video-@GST_API_VERSION@ \
- --pkg-export gstreamer-mpegts-@GST_API_VERSION@ \
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/configure-allow-to-disable-libssh2.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/configure-allow-to-disable-libssh2.patch
deleted file mode 100644
index ad863298..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.14.imx/configure-allow-to-disable-libssh2.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From f59c5269f92d59a5296cbfeeb682d42095cd88ad Mon Sep 17 00:00:00 2001
-From: Wenzong Fan <wenzong.fan@windriver.com>
-Date: Thu, 18 Sep 2014 02:24:07 -0400
-Subject: [PATCH] gstreamer1.0-plugins-bad: allow to disable libssh2
-
-libssh2 is automatically linked to if present, this undetermined
-dependency may cause build errors like:
-
- .../x86_64-poky-linux/4.9.0/ld: cannot find -lssh2
-
-libssh2 isn't an oe-core recipe, so allow to disable it from
-configure.
-
-Upstream-Status: Pending
-
-Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
----
- configure.ac | 23 +++++++++++++++++------
- 1 file changed, 17 insertions(+), 6 deletions(-)
-
-Index: gst-plugins-bad-1.12.3/configure.ac
-===================================================================
---- gst-plugins-bad-1.12.3.orig/configure.ac
-+++ gst-plugins-bad-1.12.3/configure.ac
-@@ -2139,6 +2139,15 @@ AG_GST_CHECK_FEATURE(CHROMAPRINT, [chrom
- ])
-
- dnl *** Curl ***
-+AC_ARG_ENABLE([libssh2],
-+ [ --enable-libssh2 enable LIBSSH2 support @<:@default=auto@:>@],
-+ [case "${enableval}" in
-+ yes) NEED_SSH2=yes ;;
-+ no) NEED_SSH2=no ;;
-+ auto) NEED_SSH2=auto ;;
-+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libssh2]) ;;
-+ esac],[NEED_SSH2=auto])
-+
- translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true)
- AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
- PKG_CHECK_MODULES(CURL, libcurl >= 7.35.0, [
-@@ -2161,12 +2170,14 @@ AG_GST_CHECK_FEATURE(CURL, [Curl plugin]
- ])
- AC_SUBST(CURL_CFLAGS)
- AC_SUBST(CURL_LIBS)
-- PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
-- HAVE_SSH2="yes"
-- AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
-- ], [
-- HAVE_SSH2="no"
-- ])
-+ if test "x$NEED_SSH2" != "xno"; then
-+ PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
-+ HAVE_SSH2="yes"
-+ AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
-+ ], [
-+ HAVE_SSH2="no"
-+ ])
-+ fi
- AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes")
- AC_SUBST(SSH2_CFLAGS)
- AC_SUBST(SSH2_LIBS)
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-ext-wayland-fix-meson-build-in-nxp-fork.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-ext-wayland-fix-meson-build-in-nxp-fork.patch
new file mode 100644
index 00000000..088976d8
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-ext-wayland-fix-meson-build-in-nxp-fork.patch
@@ -0,0 +1,60 @@
+From e637d9f6bb961afcecb74faa6dff38562f6ce796 Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+Date: Sun, 26 Jan 2020 10:45:28 +0000
+Subject: [PATCH] ext/wayland: fix meson build in nxp fork
+
+- Add Wayland protocols, which are not enabled in upstream
+- Add missing compilation unit, which in NXP-specific
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ ext/wayland/meson.build | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/ext/wayland/meson.build b/ext/wayland/meson.build
+index fa6fbf42f..eb425b14f 100644
+--- a/ext/wayland/meson.build
++++ b/ext/wayland/meson.build
+@@ -8,6 +8,11 @@ wl_sources = [
+ 'wllinuxdmabuf.c'
+ ]
+
++imx_wl_sources = [
++ 'wlutils.c',
++]
++wl_sources += imx_wl_sources
++
+ if use_wayland
+ protocols_datadir = wl_protocol_dep.get_pkgconfig_variable('pkgdatadir')
+
+@@ -19,6 +24,25 @@ if use_wayland
+ 'fullscreen-shell-unstable-v1-protocol.c', 'fullscreen-shell-unstable-v1-client-protocol.h'],
+ ['/stable/xdg-shell/xdg-shell.xml', 'xdg-shell-protocol.c', 'xdg-shell-client-protocol.h'],
+ ]
++
++ imx_protocol_defs = [
++ [
++ '/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml',
++ 'alpha-compositing-unstable-v1-protocol.c',
++ 'alpha-compositing-unstable-v1-client-protocol.h'
++ ],
++ ['/unstable/hdr10-metadata/hdr10-metadata-unstable-v1.xml',
++ 'hdr10-metadata-unstable-v1-protocol.c',
++ 'hdr10-metadata-unstable-v1-client-protocol.h'
++ ],
++ [
++ '/unstable/linux-explicit-synchronization/linux-explicit-synchronization-unstable-v1.xml',
++ 'linux-explicit-synchronization-unstable-v1-protocol.c',
++ 'linux-explicit-synchronization-unstable-v1-client-protocol.h'
++ ],
++ ]
++ protocol_defs += imx_protocol_defs
++
+ protocols_files = []
+
+ foreach protodef: protocol_defs
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch
new file mode 100644
index 00000000..13218520
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch
@@ -0,0 +1,36 @@
+From 97a4d0cd7de8cfbf983acc7e37ba2f8fb73c3e19 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
+Date: Fri, 18 Oct 2019 00:39:12 +0100
+Subject: [PATCH 1/2] meson: build gir even when cross-compiling if
+ introspection was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.
+
+Upstream-Status: Backport [97a4d0cd7de8cfbf983acc7e37ba2f8fb73c3e19]
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 67aeeb4d0..7b3314bd9 100644
+--- a/meson.build
++++ b/meson.build
+@@ -411,7 +411,7 @@ python3 = import('python').find_installation()
+
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+ 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
+ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-fix-build-with-opencv-enabled-and-opencv4.-Fix.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-fix-build-with-opencv-enabled-and-opencv4.-Fix.patch
new file mode 100644
index 00000000..874b8abc
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-meson-fix-build-with-opencv-enabled-and-opencv4.-Fix.patch
@@ -0,0 +1,45 @@
+From f41f356aebee916910453031c06c111000f2f261 Mon Sep 17 00:00:00 2001
+From: Christoph Reiter <reiter.christoph@gmail.com>
+Date: Sun, 5 May 2019 22:11:16 +0200
+Subject: [PATCH] meson: fix build with opencv=enabled and opencv4. Fixes #964
+
+Having the opencv feature enabled would lead to the opencv3 dependency
+being required which failed with only opencv4 being available.
+
+Instead don't require anything and error out at the end if the feature was enabled
+but no dependency was found.
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/22c6a4085f8792d8af0cdabfe1664d55ca2dee11]
+
+(cherry picked from commit 22c6a4085f8792d8af0cdabfe1664d55ca2dee11)
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ gst-libs/gst/opencv/meson.build | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/gst-libs/gst/opencv/meson.build b/gst-libs/gst/opencv/meson.build
+index 3fd472fda..8dc2ad99b 100644
+--- a/gst-libs/gst/opencv/meson.build
++++ b/gst-libs/gst/opencv/meson.build
+@@ -9,9 +9,9 @@ opencv_headers = [
+ 'gstopencvvideofilter.h',
+ ]
+
+-opencv_dep = dependency('opencv', version : '>= 3.0.0', required : get_option('opencv'))
++opencv_dep = dependency('opencv', version : '>= 3.0.0', required : false)
+ if not opencv_dep.found()
+- opencv_dep = dependency('opencv4', version : '>= 4.0.0', required : get_option('opencv'))
++ opencv_dep = dependency('opencv4', version : '>= 4.0.0', required : false)
+ endif
+ if opencv_dep.found()
+ gstopencv = library('gstopencv-' + api_version,
+@@ -30,4 +30,6 @@ if opencv_dep.found()
+ dependencies : [gstvideo_dep, opencv_dep])
+
+ install_headers(opencv_headers, subdir : 'gstreamer-1.0/gst/opencv')
++elif get_option('opencv').enabled()
++ error('OpenCV support enabled but required dependencies were not found.')
+ endif
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-allow-compilation-against-4.3.x.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-allow-compilation-against-4.3.x.patch
new file mode 100644
index 00000000..a9e1bd00
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-allow-compilation-against-4.3.x.patch
@@ -0,0 +1,34 @@
+From cfb196925312b3c3d7a19dbb9a3ce64d20d66409 Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.z@gmail.com>
+Date: Sat, 9 May 2020 19:56:51 +0000
+Subject: [PATCH] opencv: allow compilation against 4.3.x
+
+Backport upstream commit 4cf362e2df0fb809ea0f21dd4a6fbb8b46ca54ef to NXP
+fork of gstreamer1.0-plugins-bad.
+
+Original commit link:
+https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/commit/4cf362e2df0fb809ea0f21dd4a6fbb8b46ca54ef
+
+Upstream-Status: Backport [4cf362e2df0fb809ea0f21dd4a6fbb8b46ca54ef]
+
+Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
+---
+ ext/opencv/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/opencv/meson.build b/ext/opencv/meson.build
+index d0ce1d3ee..05b142edc 100644
+--- a/ext/opencv/meson.build
++++ b/ext/opencv/meson.build
+@@ -65,7 +65,7 @@ if opencv_found
+ endif
+ endforeach
+ else
+- opencv_dep = dependency('opencv4', version : ['>= 4.0.0', '< 4.1.0'], required : false)
++ opencv_dep = dependency('opencv4', version : ['>= 4.0.0', '< 4.4.0'], required : false)
+ opencv_found = opencv_dep.found()
+ if opencv_found
+ foreach h : libopencv4_headers
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch
deleted file mode 100644
index 5c53e8e5..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From c247745faaf885fd3fa094198fc0ea288e295dbf Mon Sep 17 00:00:00 2001
-From: Thibault Saunier <tsaunier@igalia.com>
-Date: Fri, 13 Jul 2018 14:42:28 -0400
-Subject: [PATCH] opencv: Fix build for opencv >= 3.4.2
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The `CV_RGB` macro is now in `imgproc.hpp`.
-
-Fixes:
-
- ../subprojects/gst-plugins-bad/ext/opencv/gsthanddetect.cpp:497:40: error: ‘CV_RGB’ was not declared in this scope
- cvCircle (img, center, radius, CV_RGB (0, 0, 200), 1, 8, 0);
- ^~~~~~
----
- ext/opencv/MotionCells.cpp | 3 +++
- ext/opencv/gsthanddetect.cpp | 3 +++
- ext/opencv/gsttemplatematch.cpp | 3 +++
- 3 files changed, 9 insertions(+)
-
-diff --git a/ext/opencv/MotionCells.cpp b/ext/opencv/MotionCells.cpp
-index f85989e117..175ec901b2 100644
---- a/ext/opencv/MotionCells.cpp
-+++ b/ext/opencv/MotionCells.cpp
-@@ -51,6 +51,9 @@
-
- #include <errno.h>
- #include "MotionCells.h"
-+#if (CV_MAJOR_VERSION >= 3)
-+#include <opencv2/imgproc.hpp>
-+#endif
- #include <opencv2/imgproc/imgproc_c.h>
-
- MotionCells::MotionCells ()
-diff --git a/ext/opencv/gsthanddetect.cpp b/ext/opencv/gsthanddetect.cpp
-index 60fd5be72b..47203fd0ea 100644
---- a/ext/opencv/gsthanddetect.cpp
-+++ b/ext/opencv/gsthanddetect.cpp
-@@ -62,6 +62,9 @@
-
- /* element header */
- #include "gsthanddetect.h"
-+#if (CV_MAJOR_VERSION >= 3)
-+#include <opencv2/imgproc.hpp>
-+#endif
- #include <opencv2/imgproc/imgproc_c.h>
-
- GST_DEBUG_CATEGORY_STATIC (gst_handdetect_debug);
-diff --git a/ext/opencv/gsttemplatematch.cpp b/ext/opencv/gsttemplatematch.cpp
-index f39208dc28..ec0b56af88 100644
---- a/ext/opencv/gsttemplatematch.cpp
-+++ b/ext/opencv/gsttemplatematch.cpp
-@@ -63,6 +63,9 @@
-
- #include "../../gst-libs/gst/gst-i18n-plugin.h"
- #include "gsttemplatematch.h"
-+#if (CV_MAJOR_VERSION >= 3)
-+#include <opencv2/imgproc.hpp>
-+#endif
- #include <opencv2/imgproc/imgproc_c.h>
-
- GST_DEBUG_CATEGORY_STATIC (gst_template_match_debug);
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch
new file mode 100644
index 00000000..32261279
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch
@@ -0,0 +1,30 @@
+From 72561a0fca562d03567ace7b4cfc94992cd6525c Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Wed, 3 Feb 2016 18:05:41 -0800
+Subject: [PATCH] avoid including <sys/poll.h> directly
+
+musl libc generates warnings if <sys/poll.h> is included directly.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ sys/dvb/gstdvbsrc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c
+index b93255f..49f145a 100644
+--- a/sys/dvb/gstdvbsrc.c
++++ b/sys/dvb/gstdvbsrc.c
+@@ -97,7 +97,7 @@
+ #include <gst/gst.h>
+ #include <gst/glib-compat-private.h>
+ #include <sys/ioctl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <stdio.h>
+--
+1.9.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
new file mode 100644
index 00000000..2d5389d9
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
@@ -0,0 +1,85 @@
+From 2262ba4b686d5cc0d3e894707fe1d31619a3a8f1 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 9 Feb 2016 14:00:00 -0800
+Subject: [PATCH] ensure valid sentinals for gst_structure_get() etc
+
+For GStreamer functions declared with G_GNUC_NULL_TERMINATED,
+ie __attribute__((__sentinel__)), gcc will generate a warning if the
+last parameter passed to the function is not NULL (where a valid NULL
+in this context is defined as zero with any pointer type).
+
+The C callers to such functions within gst-plugins-bad use the C NULL
+definition (ie ((void*)0)), which is a valid sentinel.
+
+However the C++ NULL definition (ie 0L), is not a valid sentinel
+without an explicit cast to a pointer type.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ sys/decklink/gstdecklink.cpp | 10 +++++-----
+ sys/decklink/gstdecklinkaudiosrc.cpp | 2 +-
+ sys/decklink/gstdecklinkvideosink.cpp | 2 +-
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklink.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklink.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklink.cpp
+@@ -617,7 +617,7 @@ gst_decklink_mode_get_structure (GstDeck
+ "pixel-aspect-ratio", GST_TYPE_FRACTION, mode->par_n, mode->par_d,
+ "interlace-mode", G_TYPE_STRING,
+ mode->interlaced ? "interleaved" : "progressive",
+- "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, NULL);
++ "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, (void*)NULL);
+
+ if (input && mode->interlaced) {
+ if (mode->tff)
+@@ -632,16 +632,16 @@ gst_decklink_mode_get_structure (GstDeck
+ case bmdFormat8BitYUV: /* '2vuy' */
+ gst_structure_set (s, "format", G_TYPE_STRING, "UYVY",
+ "colorimetry", G_TYPE_STRING, mode->colorimetry,
+- "chroma-site", G_TYPE_STRING, "mpeg2", NULL);
++ "chroma-site", G_TYPE_STRING, "mpeg2", (void*)NULL);
+ break;
+ case bmdFormat10BitYUV: /* 'v210' */
+- gst_structure_set (s, "format", G_TYPE_STRING, "v210", NULL);
++ gst_structure_set (s, "format", G_TYPE_STRING, "v210", (void*)NULL);
+ break;
+ case bmdFormat8BitARGB: /* 'ARGB' */
+- gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", NULL);
++ gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", (void*)NULL);
+ break;
+ case bmdFormat8BitBGRA: /* 'BGRA' */
+- gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", NULL);
++ gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", (void*)NULL);
+ break;
+ case bmdFormat10BitRGB: /* 'r210' Big-endian RGB 10-bit per component with SMPTE video levels (64-960). Packed as 2:10:10:10 */
+ case bmdFormat12BitRGB: /* 'R12B' Big-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component */
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkaudiosrc.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklinkaudiosrc.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkaudiosrc.cpp
+@@ -387,7 +387,7 @@ gst_decklink_audio_src_set_caps (GstBase
+ g_mutex_unlock (&self->input->lock);
+
+ if (videosrc) {
+- g_object_get (videosrc, "connection", &vconn, NULL);
++ g_object_get (videosrc, "connection", &vconn, (void *) NULL);
+ gst_object_unref (videosrc);
+
+ switch (vconn) {
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkvideosink.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklinkvideosink.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkvideosink.cpp
+@@ -285,7 +285,7 @@ reset_framerate (GstCapsFeatures * featu
+ gpointer user_data)
+ {
+ gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
+- G_MAXINT, 1, NULL);
++ G_MAXINT, 1, (void *) NULL);
+
+ return TRUE;
+ }
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch
new file mode 100644
index 00000000..73681f10
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch
@@ -0,0 +1,28 @@
+From a67781000e82bd9ae3813da29401e8c0c852328a Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 26 Jan 2016 15:16:01 -0800
+Subject: [PATCH] fix maybe-uninitialized warnings when compiling with -Os
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ gst-libs/gst/codecparsers/gstvc1parser.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst-libs/gst/codecparsers/gstvc1parser.c b/gst-libs/gst/codecparsers/gstvc1parser.c
+index fd16ee0..ddb890c 100644
+--- a/gst-libs/gst/codecparsers/gstvc1parser.c
++++ b/gst-libs/gst/codecparsers/gstvc1parser.c
+@@ -1730,7 +1730,7 @@ gst_vc1_parse_sequence_layer (const guint8 * data, gsize size,
+ GstVC1SeqLayer * seqlayer)
+ {
+ guint32 tmp;
+- guint8 tmp8;
++ guint8 tmp8 = 0;
+ guint8 structA[8] = { 0, };
+ guint8 structB[12] = { 0, };
+ GstBitReader br;
+--
+1.9.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch
new file mode 100644
index 00000000..3fe3f649
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch
@@ -0,0 +1,49 @@
+From 5830de9b1c8965683025082aeed7ccaf1dd85969 Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+Date: Sun, 26 Jan 2020 19:55:06 +0000
+Subject: [PATCH 2/2] opencv: resolve missing opencv data dir in yocto build
+
+When Yocto build is performed, opencv searches for data dir using simple
+test command, and this fails because pkg-config provides an absolute
+path on the target which needs to be prepended by PKG_CONFIG_SYSROOT_DIR
+in order for the 'test' utility to pick up the absolute path.
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ ext/opencv/meson.build | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/ext/opencv/meson.build b/ext/opencv/meson.build
+index f38b55dfe..a26403482 100644
+--- a/ext/opencv/meson.build
++++ b/ext/opencv/meson.build
+@@ -78,20 +78,21 @@ else
+ endif
+
+ if opencv_found
++ pkgconf_sysroot = run_command(python3, '-c', 'import os; print(os.environ.get("PKG_CONFIG_SYSROOT_DIR"))').stdout().strip()
+ opencv_prefix = opencv_dep.get_pkgconfig_variable('prefix')
+ gstopencv_cargs += ['-DOPENCV_PREFIX="' + opencv_prefix + '"']
+
+ # Check the data dir used by opencv for its xml data files
+ # Use prefix from pkg-config to be compatible with cross-compilation
+- r = run_command('test', '-d', opencv_prefix + '/share/opencv')
++ r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/opencv')
+ if r.returncode() == 0
+ gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv"'
+ else
+- r = run_command('test', '-d', opencv_prefix + '/share/OpenCV')
++ r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/OpenCV')
+ if r.returncode() == 0
+ gstopencv_cargs += '-DOPENCV_PATH_NAME="OpenCV"'
+ else
+- r = run_command('test', '-d', opencv_prefix + '/share/opencv4')
++ r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/opencv4')
+ if r.returncode() == 0
+ gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv4"'
+ else
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.imx.bb
deleted file mode 100644
index 2e3f3469..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.imx.bb
+++ /dev/null
@@ -1,174 +0,0 @@
-require recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
- file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 "
-
-DEPENDS_append_imxgpu2d = " virtual/libg2d"
-DEPENDS_append_mx8 = " libdrm"
-
-PACKAGECONFIG_append_mx6q = " opencv"
-PACKAGECONFIG_append_mx6qp = " opencv"
-PACKAGECONFIG_append_mx8 = " opencv kms"
-
-PACKAGECONFIG[wayland] = "--enable-wayland --disable-x11,--disable-wayland,wayland-native wayland wayland-protocols libdrm"
-
-# Disable introspection to fix [GstGL-1.0.gir] Error
-EXTRA_OECONF_append = " --disable-introspection"
-
-
-GST1.0-PLUGINS-BAD_SRC ?= "gitsm://source.codeaurora.org/external/imx/gst-plugins-bad.git;protocol=https"
-SRCBRANCH = "MM_04.04.02_1808_L4.9.123_MX8MM_GA"
-
-SRC_URI = " \
- ${GST1.0-PLUGINS-BAD_SRC};branch=${SRCBRANCH} \
- file://configure-allow-to-disable-libssh2.patch \
- file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \
- file://0001-opencv-fix-build-for-opencv-3-4-2.patch \
-"
-
-SRCREV = "03e6ef6a371a0578a9629abde8e9c83e66f34b11"
-
-DEFAULT_PREFERENCE = "-1"
-
-# This remove "--exclude=autopoint" option from autoreconf argument to avoid
-# configure.ac:30: error: required file './ABOUT-NLS' not found
-EXTRA_AUTORECONF = ""
-
-# include fragment shaders
-FILES_${PN}-opengl += "/usr/share/*.fs"
-
-PACKAGE_ARCH_imxpxp = "${MACHINE_SOCARCH}"
-PACKAGE_ARCH_mx8 = "${MACHINE_SOCARCH}"
-
-S = "${WORKDIR}/git"
-
-LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+"
-
-DEPENDS += "gstreamer1.0-plugins-base jpeg"
-
-inherit gettext bluetooth
-
-PACKAGECONFIG ??= " \
- ${GSTREAMER_ORC} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
- ${@bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)} \
- bz2 curl dash dtls hls rsvg sbc smoothstreaming sndfile ttml uvch264 webp \
-"
-
-# the gl packageconfig enables OpenGL elements that haven't been ported
-# to -base yet. They depend on the gstgl library in -base, so we do
-# not add GL dependencies here, since these are taken care of in -base.
-
-PACKAGECONFIG[assrender] = "--enable-assrender,--disable-assrender,libass"
-PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}"
-PACKAGECONFIG[bz2] = "--enable-bz2,--disable-bz2,bzip2"
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
-PACKAGECONFIG[dash] = "--enable-dash,--disable-dash,libxml2"
-PACKAGECONFIG[dc1394] = "--enable-dc1394,--disable-dc1394,libdc1394"
-PACKAGECONFIG[directfb] = "--enable-directfb,--disable-directfb,directfb"
-PACKAGECONFIG[dtls] = "--enable-dtls,--disable-dtls,openssl"
-PACKAGECONFIG[faac] = "--enable-faac,--disable-faac,faac"
-PACKAGECONFIG[faad] = "--enable-faad,--disable-faad,faad2"
-PACKAGECONFIG[flite] = "--enable-flite,--disable-flite,flite-alsa"
-PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
-PACKAGECONFIG[hls] = "--enable-hls --with-hls-crypto=nettle,--disable-hls,nettle"
-PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,"
-PACKAGECONFIG[kms] = "--enable-kms,--disable-kms,libdrm"
-PACKAGECONFIG[libde265] = "--enable-libde265,--disable-libde265,libde265"
-PACKAGECONFIG[libmms] = "--enable-libmms,--disable-libmms,libmms"
-PACKAGECONFIG[libssh2] = "--enable-libssh2,--disable-libssh2,libssh2"
-PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug"
-PACKAGECONFIG[neon] = "--enable-neon,--disable-neon,neon"
-PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft"
-PACKAGECONFIG[opencv] = "--enable-opencv,--disable-opencv,opencv"
-PACKAGECONFIG[openh264] = "--enable-openh264,--disable-openh264,openh264"
-PACKAGECONFIG[openjpeg] = "--enable-openjpeg,--disable-openjpeg,openjpeg"
-# the opus encoder/decoder elements are now in the -base package,
-# but the opus parser remains in -bad
-PACKAGECONFIG[opusparse] = "--enable-opus,--disable-opus,libopus"
-PACKAGECONFIG[resindvd] = "--enable-resindvd,--disable-resindvd,libdvdread libdvdnav"
-PACKAGECONFIG[rsvg] = "--enable-rsvg,--disable-rsvg,librsvg"
-PACKAGECONFIG[rtmp] = "--enable-rtmp,--disable-rtmp,rtmpdump"
-PACKAGECONFIG[sbc] = "--enable-sbc,--disable-sbc,sbc"
-PACKAGECONFIG[smoothstreaming] = "--enable-smoothstreaming,--disable-smoothstreaming,libxml2"
-PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1"
-PACKAGECONFIG[srtp] = "--enable-srtp,--disable-srtp,libsrtp"
-PACKAGECONFIG[tinyalsa] = "--enable-tinyalsa,--disable-tinyalsa,tinyalsa"
-PACKAGECONFIG[ttml] = "--enable-ttml,--disable-ttml,libxml2 pango cairo"
-PACKAGECONFIG[uvch264] = "--enable-uvch264,--disable-uvch264,libusb1 libgudev"
-PACKAGECONFIG[voaacenc] = "--enable-voaacenc,--disable-voaacenc,vo-aacenc"
-PACKAGECONFIG[voamrwbenc] = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc"
-PACKAGECONFIG[vulkan] = "--enable-vulkan,--disable-vulkan,vulkan"
-PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland-native wayland wayland-protocols libdrm"
-PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
-PACKAGECONFIG[webrtc] = "--enable-webrtc,--disable-webrtc,libnice"
-PACKAGECONFIG[webrtcdsp] = "--enable-webrtcdsp,--disable-webrtcdsp,webrtc-audio-processing"
-
-# these plugins have no corresponding library in OE-core or meta-openembedded:
-# openni2 winks direct3d directsound winscreencap acm apple_media iqa
-# android_media avc bs2b chromaprint daala dts fdkaac gme gsm kate ladspa
-# lv2 mpeg2enc mplex msdk musepack nvenc ofa openmpt opensles soundtouch
-# spandsp spc teletextdec vdpau wasapi x265 zbar
-
-EXTRA_OECONF += " \
- --enable-decklink \
- --enable-dvb \
- --enable-fbdev \
- --enable-ipcpipeline \
- --enable-netsim \
- --enable-shm \
- --enable-vcd \
- --disable-acm \
- --disable-android_media \
- --disable-aom \
- --disable-apple_media \
- --disable-avc \
- --disable-bs2b \
- --disable-chromaprint \
- --disable-daala \
- --disable-direct3d \
- --disable-directsound \
- --disable-dts \
- --disable-fdk_aac \
- --disable-gme \
- --disable-gsm \
- --disable-iqa \
- --disable-kate \
- --disable-ladspa \
- --disable-lv2 \
- --disable-mpeg2enc \
- --disable-mplex \
- --disable-msdk \
- --disable-musepack \
- --disable-nvenc \
- --disable-ofa \
- --disable-openexr \
- --disable-openmpt \
- --disable-openni2 \
- --disable-opensles \
- --disable-soundtouch \
- --disable-spandsp \
- --disable-spc \
- --disable-srt \
- --disable-teletextdec \
- --disable-vdpau \
- --disable-wasapi \
- --disable-wildmidi \
- --disable-winks \
- --disable-winscreencap \
- --disable-x265 \
- --disable-zbar \
- ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--disable-yadif", "", d)} \
-"
-export OPENCV_PREFIX = "${STAGING_DIR_TARGET}${prefix}"
-
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-
-FILES_${PN}-freeverb += "${datadir}/gstreamer-${LIBV}/presets/GstFreeverb.prs"
-FILES_${PN}-opencv += "${datadir}/gst-plugins-bad/${LIBV}/opencv*"
-FILES_${PN}-voamrwbenc += "${datadir}/gstreamer-${LIBV}/presets/GstVoAmrwbEnc.prs"
-
-COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.imx.bb
new file mode 100644
index 00000000..59aeca11
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.imx.bb
@@ -0,0 +1,173 @@
+require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc
+
+DEPENDS_append_imxgpu2d = " virtual/libg2d"
+DEPENDS_append_mx8 = " libdrm"
+
+PACKAGECONFIG_append_mx6q = " opencv"
+PACKAGECONFIG_append_mx6qp = " opencv"
+PACKAGECONFIG_append_mx8 = " opencv kms"
+
+DEFAULT_PREFERENCE = "-1"
+
+PACKAGE_ARCH_imxpxp = "${MACHINE_SOCARCH}"
+PACKAGE_ARCH_mx8 = "${MACHINE_SOCARCH}"
+
+GST1.0-PLUGINS-BAD_SRC ?= "gitsm://source.codeaurora.org/external/imx/gst-plugins-bad.git;protocol=https"
+SRCBRANCH = "MM_04.05.03_1911_L5.4.0"
+
+SRC_URI = " \
+ ${GST1.0-PLUGINS-BAD_SRC};branch=${SRCBRANCH} \
+ file://0001-ext-wayland-fix-meson-build-in-nxp-fork.patch \
+ file://0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch \
+ file://0001-meson-fix-build-with-opencv-enabled-and-opencv4.-Fix.patch \
+ file://0001-opencv-allow-compilation-against-4.3.x.patch \
+ file://opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch \
+ file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \
+ file://avoid-including-sys-poll.h-directly.patch \
+ file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \
+"
+SRCREV = "b80b6a2db690c815a88c2450956e23e86dbd6538"
+
+S = "${WORKDIR}/git"
+
+LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
+ file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 "
+
+DEPENDS += "gstreamer1.0-plugins-base"
+
+inherit gobject-introspection
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)} \
+ bz2 closedcaption curl dash dtls hls rsvg sbc smoothstreaming sndfile \
+ ttml uvch264 webp \
+"
+
+PACKAGECONFIG[assrender] = "-Dassrender=enabled,-Dassrender=disabled,libass"
+PACKAGECONFIG[bluez] = "-Dbluez=enabled,-Dbluez=disabled,bluez5"
+PACKAGECONFIG[bz2] = "-Dbz2=enabled,-Dbz2=disabled,bzip2"
+PACKAGECONFIG[closedcaption] = "-Dclosedcaption=enabled,-Dclosedcaption=disabled,pango cairo"
+PACKAGECONFIG[curl] = "-Dcurl=enabled,-Dcurl=disabled,curl"
+PACKAGECONFIG[dash] = "-Ddash=enabled,-Ddash=disabled,libxml2"
+PACKAGECONFIG[dc1394] = "-Ddc1394=enabled,-Ddc1394=disabled,libdc1394"
+PACKAGECONFIG[directfb] = "-Ddirectfb=enabled,-Ddirectfb=disabled,directfb"
+PACKAGECONFIG[dtls] = "-Ddtls=enabled,-Ddtls=disabled,openssl"
+PACKAGECONFIG[faac] = "-Dfaac=enabled,-Dfaac=disabled,faac"
+PACKAGECONFIG[faad] = "-Dfaad=enabled,-Dfaad=disabled,faad2"
+PACKAGECONFIG[fluidsynth] = "-Dfluidsynth=enabled,-Dfluidsynth=disabled,fluidsynth"
+PACKAGECONFIG[hls] = "-Dhls=enabled -Dhls-crypto=nettle,-Dhls=disabled,nettle"
+# the gl packageconfig enables OpenGL elements that haven't been ported
+# to -base yet. They depend on the gstgl library in -base, so we do
+# not add GL dependencies here, since these are taken care of in -base.
+PACKAGECONFIG[gl] = "-Dgl=enabled,-Dgl=disabled,"
+PACKAGECONFIG[kms] = "-Dkms=enabled,-Dkms=disabled,libdrm"
+PACKAGECONFIG[libde265] = "-Dlibde265=enabled,-Dlibde265=disabled,libde265"
+PACKAGECONFIG[libmms] = "-Dlibmms=enabled,-Dlibmms=disabled,libmms"
+PACKAGECONFIG[libssh2] = "-Dcurl-ssh2=enabled,-Dcurl-ssh2=disabled,libssh2"
+PACKAGECONFIG[modplug] = "-Dmodplug=enabled,-Dmodplug=disabled,libmodplug"
+PACKAGECONFIG[msdk] = "-Dmsdk=enabled,-Dmsdk=disabled,intel-mediasdk"
+PACKAGECONFIG[neon] = "-Dneon=enabled,-Dneon=disabled,neon"
+PACKAGECONFIG[openal] = "-Dopenal=enabled,-Dopenal=disabled,openal-soft"
+PACKAGECONFIG[opencv] = "-Dopencv=enabled,-Dopencv=disabled,opencv"
+PACKAGECONFIG[openh264] = "-Dopenh264=enabled,-Dopenh264=disabled,openh264"
+PACKAGECONFIG[openjpeg] = "-Dopenjpeg=enabled,-Dopenjpeg=disabled,openjpeg"
+PACKAGECONFIG[openmpt] = "-Dopenmpt=enabled,-Dopenmpt=disabled,libopenmpt"
+# the opus encoder/decoder elements are now in the -base package,
+# but the opus parser remains in -bad
+PACKAGECONFIG[opusparse] = "-Dopus=enabled,-Dopus=disabled,libopus"
+PACKAGECONFIG[resindvd] = "-Dresindvd=enabled,-Dresindvd=disabled,libdvdread libdvdnav"
+PACKAGECONFIG[rsvg] = "-Drsvg=enabled,-Drsvg=disabled,librsvg"
+PACKAGECONFIG[rtmp] = "-Drtmp=enabled,-Drtmp=disabled,rtmpdump"
+PACKAGECONFIG[sbc] = "-Dsbc=enabled,-Dsbc=disabled,sbc"
+PACKAGECONFIG[sctp] = "-Dsctp=enabled,-Dsctp=disabled,usrsctp"
+PACKAGECONFIG[smoothstreaming] = "-Dsmoothstreaming=enabled,-Dsmoothstreaming=disabled,libxml2"
+PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
+PACKAGECONFIG[srtp] = "-Dsrtp=enabled,-Dsrtp=disabled,libsrtp"
+PACKAGECONFIG[tinyalsa] = "-Dtinyalsa=enabled,-Dtinyalsa=disabled,tinyalsa"
+PACKAGECONFIG[ttml] = "-Dttml=enabled,-Dttml=disabled,libxml2 pango cairo"
+PACKAGECONFIG[uvch264] = "-Duvch264=enabled,-Duvch264=disabled,libusb1 libgudev"
+PACKAGECONFIG[voaacenc] = "-Dvoaacenc=enabled,-Dvoaacenc=disabled,vo-aacenc"
+PACKAGECONFIG[voamrwbenc] = "-Dvoamrwbenc=enabled,-Dvoamrwbenc=disabled,vo-amrwbenc"
+PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,vulkan-loader"
+PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,wayland-native wayland wayland-protocols libdrm"
+PACKAGECONFIG[webp] = "-Dwebp=enabled,-Dwebp=disabled,libwebp"
+PACKAGECONFIG[webrtc] = "-Dwebrtc=enabled,-Dwebrtc=disabled,libnice"
+PACKAGECONFIG[webrtcdsp] = "-Dwebrtcdsp=enabled,-Dwebrtcdsp=disabled,webrtc-audio-processing"
+PACKAGECONFIG[zbar] = "-Dzbar=enabled,-Dzbar=disabled,zbar"
+
+# Following package config in not available in NXP fork:
+#PACKAGECONFIG[lcms2] = "-Dcolormanagement=enabled,-Dcolormanagement=disabled,lcms"
+
+# these plugins currently have no corresponding library in OE-core or meta-openembedded:
+# aom androidmedia applemedia bs2b chromaprint d3dvideosink
+# directsound dts fdkaac gme gsm iq kate ladspa lv2 mpeg2enc
+# mplex musepack nvdec nvenc ofa openexr openni2 opensles
+# soundtouch spandsp srt teletext vdpau wasapi wildmidi winks
+# winscreencap wpe x265
+
+EXTRA_OEMESON += " \
+ -Ddecklink=enabled \
+ -Ddvb=enabled \
+ -Dfbdev=enabled \
+ -Dipcpipeline=enabled \
+ -Dnetsim=enabled \
+ -Dshm=enabled \
+ -Daom=disabled \
+ -Dandroidmedia=disabled \
+ -Dapplemedia=disabled \
+ -Dbs2b=disabled \
+ -Dchromaprint=disabled \
+ -Dd3dvideosink=disabled \
+ -Ddirectsound=disabled \
+ -Ddts=disabled \
+ -Dfdkaac=disabled \
+ -Dflite=disabled \
+ -Dgme=disabled \
+ -Dgsm=disabled \
+ -Diqa=disabled \
+ -Dkate=disabled \
+ -Dladspa=disabled \
+ -Dlv2=disabled \
+ -Dmpeg2enc=disabled \
+ -Dmplex=disabled \
+ -Dmsdk=disabled \
+ -Dmusepack=disabled \
+ -Dnvdec=disabled \
+ -Dnvenc=disabled \
+ -Dofa=disabled \
+ -Dopenexr=disabled \
+ -Dopenmpt=disabled \
+ -Dopenni2=disabled \
+ -Dopensles=disabled \
+ -Dsoundtouch=disabled \
+ -Dspandsp=disabled \
+ -Dsrt=disabled \
+ -Dteletext=disabled \
+ -Dvdpau=disabled \
+ -Dwasapi=disabled \
+ -Dwildmidi=disabled \
+ -Dwinks=disabled \
+ -Dwinscreencap=disabled \
+ -Dwpe=disabled \
+ -Dx265=disabled \
+ -Dzbar=disabled \
+ ${@bb.utils.contains("TUNE_FEATURES", "mx32", "-Dyadif=disabled", "", d)} \
+"
+
+export OPENCV_PREFIX = "${STAGING_DIR_TARGET}${prefix}"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+FILES_${PN}-freeverb += "${datadir}/gstreamer-1.0/presets/GstFreeverb.prs"
+FILES_${PN}-opencv += "${datadir}/gst-plugins-bad/1.0/opencv*"
+FILES_${PN}-voamrwbenc += "${datadir}/gstreamer-1.0/presets/GstVoAmrwbEnc.prs"
+# include fragment shaders
+FILES_${PN}-opengl += "/usr/share/*.fs"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
deleted file mode 100644
index a1cc7d3d..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From a049bb15839557594713cb32e7d6bfe0e2127392 Mon Sep 17 00:00:00 2001
-From: Yuqing Zhu <carol.zhu@nxp.com>
-Date: Fri, 20 Apr 2018 22:46:46 +0800
-Subject: [PATCH] Makefile.am: don't hardcode libtool name when running
- introspection tools
-
-Do patch refine basing on commit: f1d9652351e7754c63003104eceb526af424c7e0
-
-Upstream-Status: Pending [review on oe-core maillist]
-
-Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
----
- gst-libs/gst/allocators/Makefile.am | 2 +-
- gst-libs/gst/app/Makefile.am | 2 +-
- gst-libs/gst/audio/Makefile.am | 2 +-
- gst-libs/gst/gl/Makefile.am | 2 +-
- gst-libs/gst/pbutils/Makefile.am | 2 +-
- gst-libs/gst/riff/Makefile.am | 2 +-
- gst-libs/gst/rtp/Makefile.am | 2 +-
- gst-libs/gst/rtsp/Makefile.am | 2 +-
- gst-libs/gst/sdp/Makefile.am | 2 +-
- gst-libs/gst/tag/Makefile.am | 2 +-
- gst-libs/gst/video/Makefile.am | 2 +-
- 11 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
-index 0edc0ae..d0d425d 100644
---- a/gst-libs/gst/allocators/Makefile.am
-+++ b/gst-libs/gst/allocators/Makefile.am
-@@ -58,7 +58,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@
- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstallocators-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg-export gstreamer-allocators-@GST_API_VERSION@ \
- --output $@ \
-diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am
-index 52f6ad3..5bfd606 100644
---- a/gst-libs/gst/app/Makefile.am
-+++ b/gst-libs/gst/app/Makefile.am
-@@ -56,7 +56,7 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO
- --library=libgstapp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-app-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am
-index 2922245..7fb65f2 100644
---- a/gst-libs/gst/audio/Makefile.am
-+++ b/gst-libs/gst/audio/Makefile.am
-@@ -184,7 +184,7 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
- --include=GstTag-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-audio-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
-index b04187f..576bf1c 100644
---- a/gst-libs/gst/gl/Makefile.am
-+++ b/gst-libs/gst/gl/Makefile.am
-@@ -205,7 +205,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstgl-@GST_API_VERSION@
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
- --include=GstVideo-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg gstreamer-video-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am
-index ae51993..35a6e44 100644
---- a/gst-libs/gst/pbutils/Makefile.am
-+++ b/gst-libs/gst/pbutils/Makefile.am
-@@ -103,7 +103,7 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP
- --include=GstTag-@GST_API_VERSION@ \
- --include=GstVideo-@GST_API_VERSION@ \
- --include=GstAudio-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-tag-@GST_API_VERSION@ \
- --pkg gstreamer-video-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
-index fb53f06..e66ef4f 100644
---- a/gst-libs/gst/riff/Makefile.am
-+++ b/gst-libs/gst/riff/Makefile.am
-@@ -49,7 +49,7 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --include=GstAudio-@GST_API_VERSION@ \
- # --include=GstTag-@GST_API_VERSION@ \
- # --include=Gst-@GST_API_VERSION@ \
--# --libtool="$(top_builddir)/libtool" \
-+# --libtool="$(LIBTOOL)" \
- # --pkg gstreamer-@GST_API_VERSION@ \
- # --pkg gstreamer-tag-@GST_API_VERSION@ \
- # --pkg gstreamer-audio-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am
-index a6f971d..77ebeeb 100644
---- a/gst-libs/gst/rtp/Makefile.am
-+++ b/gst-libs/gst/rtp/Makefile.am
-@@ -69,7 +69,7 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO
- --library=libgstrtp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-rtp-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
-index ceb07f4..db9d0fd 100644
---- a/gst-libs/gst/rtsp/Makefile.am
-+++ b/gst-libs/gst/rtsp/Makefile.am
-@@ -76,7 +76,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
- --include=Gio-2.0 \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstSdp-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gio-2.0 \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-sdp-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am
-index e197e9b..6e05cc7 100644
---- a/gst-libs/gst/sdp/Makefile.am
-+++ b/gst-libs/gst/sdp/Makefile.am
-@@ -34,7 +34,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO
- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstsdp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg-export gstreamer-sdp-@GST_API_VERSION@ \
- --output $@ \
-diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am
-index 0247c33..c86515b 100644
---- a/gst-libs/gst/tag/Makefile.am
-+++ b/gst-libs/gst/tag/Makefile.am
-@@ -66,7 +66,7 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO
- --library=libgsttag-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-tag-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am
-index 1b74f37..0f7c07e 100644
---- a/gst-libs/gst/video/Makefile.am
-+++ b/gst-libs/gst/video/Makefile.am
-@@ -126,7 +126,7 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE
- --library=libgstvideo-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-video-@GST_API_VERSION@ \
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-gstreamer1.0-plugins-base-Fix-ion.h-header-inclusion.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-gstreamer1.0-plugins-base-Fix-ion.h-header-inclusion.patch
deleted file mode 100644
index d3822cfc..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0001-gstreamer1.0-plugins-base-Fix-ion.h-header-inclusion.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 84f693a70e6f3084ca67063a6336aaf3287abb49 Mon Sep 17 00:00:00 2001
-From: Yuqing Zhu <carol.zhu@nxp.com>
-Date: Thu, 27 Sep 2018 13:53:49 +0800
-Subject: [PATCH] gstreamer1.0-plugins-base: Fix ion.h header inclusion to be
- standard
-
-NXP "solution" was to manually copy the header to include/linux.
-Let's point the Makefile to the proper (mainline) location instead:
-https://elixir.bootlin.com/linux/v4.17/source/drivers/staging/android/uapi/ion.h
-
-Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
----
- configure.ac | 2 +-
- gst-libs/gst/allocators/gstionmemory.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 51272df..4bea0dd 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -678,7 +678,7 @@ AG_GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
- dnl check for ion
- translit(dnm, m, l) AM_CONDITIONAL(USE_ION, true)
- AG_GST_CHECK_FEATURE(ION, [ion], ion, [
-- AC_CHECK_HEADER(linux/ion.h, HAVE_ION="yes", HAVE_ION="no")
-+ AC_CHECK_HEADER(ion.h, HAVE_ION="yes", HAVE_ION="no")
- ])
-
- dnl FIXME : add second check somehow if that is necessary
-diff --git a/gst-libs/gst/allocators/gstionmemory.c b/gst-libs/gst/allocators/gstionmemory.c
-index 5e0455c..a285f09 100644
---- a/gst-libs/gst/allocators/gstionmemory.c
-+++ b/gst-libs/gst/allocators/gstionmemory.c
-@@ -26,7 +26,7 @@
- #include <sys/ioctl.h>
- #include <sys/mman.h>
- #include <sys/types.h>
--#include <linux/ion.h>
-+#include <ion.h>
- #include <linux/dma-buf.h>
- #include <linux/version.h>
-
---
-1.9.1
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch
deleted file mode 100644
index 4b6cfdd6..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch
+++ /dev/null
@@ -1,289 +0,0 @@
-From e3f28d15e38f7633d8ed4023fe883b8377c0597e Mon Sep 17 00:00:00 2001
-From: Yuqing Zhu <carol.zhu@nxp.com>
-Date: Fri, 20 Apr 2018 02:03:57 +0800
-Subject: [PATCH] Makefile.am: prefix calls to pkg-config with
- PKG_CONFIG_SYSROOT_DIR
-
-Do patch refine base on commit: 990b653c7b6de1937ec759019982d6c5f15770f7
-
-Upstream-Status: Pending [review on oe-core maillist]
-
-Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
----
- gst-libs/gst/allocators/Makefile.am | 4 ++--
- gst-libs/gst/app/Makefile.am | 8 ++++----
- gst-libs/gst/audio/Makefile.am | 12 ++++++------
- gst-libs/gst/pbutils/Makefile.am | 12 ++++++------
- gst-libs/gst/riff/Makefile.am | 8 ++++----
- gst-libs/gst/rtp/Makefile.am | 8 ++++----
- gst-libs/gst/rtsp/Makefile.am | 4 ++--
- gst-libs/gst/sdp/Makefile.am | 4 ++--
- gst-libs/gst/tag/Makefile.am | 8 ++++----
- gst-libs/gst/video/Makefile.am | 8 ++++----
- 10 files changed, 38 insertions(+), 38 deletions(-)
-
-diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
-index c4412a1..9f9d14d 100644
---- a/gst-libs/gst/allocators/Makefile.am
-+++ b/gst-libs/gst/allocators/Makefile.am
-@@ -59,7 +59,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@
- --c-include "gst/allocators/allocators.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstallocators-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --libtool="$(LIBTOOL)" \
-@@ -83,7 +83,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am
-index 5bfd606..c231267 100644
---- a/gst-libs/gst/app/Makefile.am
-+++ b/gst-libs/gst/app/Makefile.am
-@@ -51,8 +51,8 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO
- --c-include "gst/app/app.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgstapp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -79,8 +79,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am
-index 7fb65f2..5379f79 100644
---- a/gst-libs/gst/audio/Makefile.am
-+++ b/gst-libs/gst/audio/Makefile.am
-@@ -174,12 +174,12 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
- --c-include "gst/audio/audio.h" \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \
- --library=libgstaudio-@GST_API_VERSION@.la \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
- --library-path="$(top_builddir)/gst-libs/gst/tag/" \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -208,8 +208,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
- --includedir="$(top_builddir)/gst-libs/gst/tag/" \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am
-index 35a6e44..49d6894 100644
---- a/gst-libs/gst/pbutils/Makefile.am
-+++ b/gst-libs/gst/pbutils/Makefile.am
-@@ -88,14 +88,14 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP
- --c-include "gst/pbutils/pbutils.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \
- --add-include-path="$(top_builddir)/gst-libs/gst/video/" \
- --add-include-path="$(top_builddir)/gst-libs/gst/audio/" \
- --library=libgstpbutils-@GST_API_VERSION@.la \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
- --library-path="$(top_builddir)/gst-libs/gst/tag/" \
- --library-path="$(top_builddir)/gst-libs/gst/video/" \
- --library-path="$(top_builddir)/gst-libs/gst/audio/" \
-@@ -128,8 +128,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --includedir="$(top_builddir)/gst-libs/gst/tag/" \
- --includedir="$(top_builddir)/gst-libs/gst/video/" \
- --includedir="$(top_builddir)/gst-libs/gst/audio/" \
-diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
-index e66ef4f..c8c588a 100644
---- a/gst-libs/gst/riff/Makefile.am
-+++ b/gst-libs/gst/riff/Makefile.am
-@@ -43,8 +43,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --c-include "gst/riff/riff.h" \
- # --add-include-path=$(builddir)/../tag \
- # --add-include-path=$(builddir)/../audio \
--# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
--# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- # --library=libgstriff-@GST_API_VERSION@.la \
- # --include=GstAudio-@GST_API_VERSION@ \
- # --include=GstTag-@GST_API_VERSION@ \
-@@ -75,8 +75,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --includedir=$(builddir) \
- # --includedir=$(builddir)/../tag \
- # --includedir=$(builddir)/../audio \
--# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
--# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- # $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
- #
- #CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am
-index 77ebeeb..9aee788 100644
---- a/gst-libs/gst/rtp/Makefile.am
-+++ b/gst-libs/gst/rtp/Makefile.am
-@@ -64,8 +64,8 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO
- --c-include "gst/rtp/rtp.h" \
- -I$(top_builddir)/gst-libs \
- -I$(top_srcdir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgstrtp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -92,8 +92,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
-index db9d0fd..79027cb 100644
---- a/gst-libs/gst/rtsp/Makefile.am
-+++ b/gst-libs/gst/rtsp/Makefile.am
-@@ -71,7 +71,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
- -I$(top_builddir)/gst-libs \
- -I$(top_srcdir)/gst-libs \
- --add-include-path=$(builddir)/../sdp \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstrtsp-@GST_API_VERSION@.la \
- --include=Gio-2.0 \
- --include=Gst-@GST_API_VERSION@ \
-@@ -101,7 +101,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
- --includedir=$(builddir)/../sdp \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am
-index 6e05cc7..c7cf514 100644
---- a/gst-libs/gst/sdp/Makefile.am
-+++ b/gst-libs/gst/sdp/Makefile.am
-@@ -31,7 +31,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO
- --warn-all \
- --c-include "gst/sdp/sdp.h" \
- -I$(top_srcdir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstsdp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --libtool="$(LIBTOOL)" \
-@@ -55,7 +55,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am
-index c86515b..363e6d2 100644
---- a/gst-libs/gst/tag/Makefile.am
-+++ b/gst-libs/gst/tag/Makefile.am
-@@ -61,8 +61,8 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO
- --c-include "gst/tag/tag.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgsttag-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -89,8 +89,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am
-index 0f7c07e..d642267 100644
---- a/gst-libs/gst/video/Makefile.am
-+++ b/gst-libs/gst/video/Makefile.am
-@@ -121,8 +121,8 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE
- --c-include "gst/video/video.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgstvideo-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -149,8 +149,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
---
-2.7.4
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0003-riff-add-missing-include-directories-when-calling-in.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0003-riff-add-missing-include-directories-when-calling-in.patch
deleted file mode 100644
index 9b66f7f4..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0003-riff-add-missing-include-directories-when-calling-in.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3c2c2d5dd08aa30ed0e8acd8566ec99412bb8209 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 26 Oct 2015 17:29:37 +0200
-Subject: [PATCH 3/4] riff: add missing include directories when calling
- introspection scanner
-
-Upstream-Status: Pending [review on oe-core maillist]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- gst-libs/gst/riff/Makefile.am | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
-index 0a115cc..5057a58 100644
---- a/gst-libs/gst/riff/Makefile.am
-+++ b/gst-libs/gst/riff/Makefile.am
-@@ -39,6 +39,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --strip-prefix=Gst \
- # --warn-all \
- # --c-include "gst/riff/riff.h" \
-+# -I$(top_srcdir)/gst-libs \
-+# -I$(top_builddir)/gst-libs \
- # --add-include-path=$(builddir)/../tag \
- # --add-include-path=$(builddir)/../audio \
- # --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
---
-2.6.2
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
deleted file mode 100644
index 4adf6054..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 4330915d88dc4dd46eb4c28d756482b767c2747f Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 26 Oct 2015 17:30:14 +0200
-Subject: [PATCH 4/4] rtsp: drop incorrect reference to gstreamer-sdp in
- Makefile.am
-
-Upstream-Status: Pending [review on oe-core maillist]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- gst-libs/gst/rtsp/Makefile.am | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
-index 4f6d9f8..0afa370 100644
---- a/gst-libs/gst/rtsp/Makefile.am
-+++ b/gst-libs/gst/rtsp/Makefile.am
-@@ -75,7 +75,6 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
- --libtool="$(LIBTOOL)" \
- --pkg gio-2.0 \
- --pkg gstreamer-@GST_API_VERSION@ \
-- --pkg gstreamer-sdp-@GST_API_VERSION@ \
- --pkg-export gstreamer-rtsp-@GST_API_VERSION@ \
- --add-init-section="$(INTROSPECTION_INIT)" \
- --output $@ \
---
-2.6.2
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/make-gio_unix_2_0-dependency-configurable.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/make-gio_unix_2_0-dependency-configurable.patch
deleted file mode 100644
index 23950b67..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.14.imx/make-gio_unix_2_0-dependency-configurable.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 7ffa6e3d00e1d8a060f3f4c2bb9a72691af05d79 Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Wed, 20 Jan 2016 13:00:00 -0800
-Subject: [PATCH] make gio_unix_2_0 dependency configurable
-
-Prior to 1.7.1, gst-plugins-base accepted a configure option to
-disable gio_unix_2_0, however it was implemented incorrectly using
-AG_GST_CHECK_FEATURE. That was fixed in 1.7.1 by making the
-dependency unconditional.
-
- http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=aadefefba88afe4acbe64454650f24e7ce7c8d70
-
-To make builds deterministic, re-instate support for
---disable-gio_unix_2_0, but implement it using the AC_ARG_ENABLE
-instead of AG_GST_CHECK_FEATURE.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
-
----
- configure.ac | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 12807bc..35a0bf3 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -806,9 +806,16 @@ AM_CONDITIONAL(HAVE_PNG, test "x$HAVE_PNG" = "xyes")
- AM_CONDITIONAL(HAVE_JPEG, test "x$HAVE_JPEG" = "xyes")
-
- dnl *** gio-unix-2.0 for tests/check/pipelines/tcp.c ***
-+AC_ARG_ENABLE([gio_unix_2_0],
-+ [AS_HELP_STRING([--disable-gio_unix_2_0],[disable use of gio_unix_2_0])],
-+ [],
-+ [enable_gio_unix_2_0=yes])
-+
-+if test "x${enable_gio_unix_2_0}" != "xno"; then
- PKG_CHECK_MODULES(GIO_UNIX_2_0, gio-unix-2.0 >= 2.24,
- HAVE_GIO_UNIX_2_0="yes",
- HAVE_GIO_UNIX_2_0="no")
-+fi
- AM_CONDITIONAL(USE_GIO_UNIX_2_0, test "x$HAVE_GIO_UNIX_2_0" = "xyes")
-
- dnl *** finalize CFLAGS, LDFLAGS, LIBS
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gst-libs-gst-gl-wayland-fix-meson-build.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gst-libs-gst-gl-wayland-fix-meson-build.patch
new file mode 100644
index 00000000..61baf2f9
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gst-libs-gst-gl-wayland-fix-meson-build.patch
@@ -0,0 +1,36 @@
+From a145a129a8122f21c1e243b3dc2e5708f4c13bef Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+Date: Thu, 23 Jan 2020 12:54:10 +0000
+Subject: [PATCH] gst-libs gst gl wayland: fix meson build
+
+Since introduction of meson build system, modifications introduced in
+NXP fork are breaking the build, where xdg-shell-client-protocol.h
+is searched via relative path. This code is only present in NXP fork and
+should be removed.
+
+This reverts commit [48bde732b00fb42df636ebbaf3b06e5e7971c206]
+("wayland: fix build break in yocto") from upstream.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h
+index d1795591f..89dedd9b5 100644
+--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h
++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h
+@@ -22,7 +22,7 @@
+ #define __GST_GL_WINDOW_WAYLAND_EGL_H__
+
+ #include <wayland-client.h>
+-#include <gst/gl/wayland/xdg-shell-client-protocol.h>
++#include "xdg-shell-client-protocol.h"
+ #include <wayland-egl.h>
+ #include <wayland-cursor.h>
+
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gstreamer-plugins-base-fix-meson-build-in-nxp-fork.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gstreamer-plugins-base-fix-meson-build-in-nxp-fork.patch
new file mode 100644
index 00000000..da152531
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-gstreamer-plugins-base-fix-meson-build-in-nxp-fork.patch
@@ -0,0 +1,220 @@
+From def285f623bc30b9d1acede00393188e693cc741 Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+Date: Sat, 22 Feb 2020 13:22:57 +0000
+Subject: [PATCH] gstreamer-plugins-base: fix meson build in nxp fork
+
+- Add missing IMX header file into istall target;
+- Allocator's meta data files are missing in meson.build, bring them back;
+- Add ION NXP-specific allocator to meson.build;
+- Introduce additional configuration option to pass extra include paths,
+ which are required to build ION allocator;
+- Some video sources are missing, bring them also into the build;
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ gst-libs/gst/allocators/meson.build | 30 +++++++++++++++++++++++++++--
+ gst-libs/gst/gl/gstglconfig.h.meson | 2 ++
+ gst-libs/gst/gl/meson.build | 20 +++++++++++++++++++
+ gst-libs/gst/meson.build | 6 ++++++
+ gst-libs/gst/video/meson.build | 11 +++++++++++
+ meson.build | 3 +++
+ meson_options.txt | 4 ++++
+ 7 files changed, 74 insertions(+), 2 deletions(-)
+
+diff --git a/gst-libs/gst/allocators/meson.build b/gst-libs/gst/allocators/meson.build
+index 364baeebf..30b1495c9 100644
+--- a/gst-libs/gst/allocators/meson.build
++++ b/gst-libs/gst/allocators/meson.build
+@@ -5,18 +5,44 @@ gst_allocators_headers = [
+ 'gstphysmemory.h',
+ 'gstdmabuf.h',
+ ]
++
++imx_gst_allocators_headers = [
++ 'gstphymemmeta.h',
++ 'gstdmabufmeta.h',
++ 'gstallocatorphymem.h',
++]
++
++if cc.has_header('linux/ion.h', include_directories : imx_includes)
++ imx_gst_allocators_headers += [
++ 'gstionmemory.h',
++ ]
++endif
++
++gst_allocators_headers += imx_gst_allocators_headers
++
+ install_headers(gst_allocators_headers, subdir : 'gstreamer-1.0/gst/allocators/')
+
+ gst_allocators_sources = [ 'gstdmabuf.c', 'gstfdmemory.c', 'gstphysmemory.c']
++
++imx_gst_allocators_sources = ['gstdmabufmeta.c', 'gstphymemmeta.c', 'gstallocatorphymem.c']
++
++if cc.has_header('linux/ion.h', include_directories : imx_includes)
++ imx_gst_allocators_sources += [
++ 'gstionmemory.c',
++ ]
++endif
++
++gst_allocators_sources += imx_gst_allocators_sources
++
+ gstallocators = library('gstallocators-@0@'.format(api_version),
+ gst_allocators_sources,
+ c_args : gst_plugins_base_args + ['-DBUILDING_GST_ALLOCATORS'],
+- include_directories: [configinc, libsinc],
++ include_directories: [configinc, libsinc, imx_includes],
+ version : libversion,
+ soversion : soversion,
+ darwin_versions : osxversion,
+ install : true,
+- dependencies : [gst_dep],
++ dependencies : [video_dep, gst_dep],
+ )
+
+ allocators_gen_sources = []
+diff --git a/gst-libs/gst/gl/gstglconfig.h.meson b/gst-libs/gst/gl/gstglconfig.h.meson
+index 11795c16c..66cd54a7e 100644
+--- a/gst-libs/gst/gl/gstglconfig.h.meson
++++ b/gst-libs/gst/gl/gstglconfig.h.meson
+@@ -32,8 +32,10 @@ G_BEGIN_DECLS
+ #mesondefine GST_GL_HAVE_PLATFORM_CGL
+ #mesondefine GST_GL_HAVE_PLATFORM_EAGL
+
++#mesondefine GST_GL_HAVE_IONDMA
+ #mesondefine GST_GL_HAVE_DMABUF
+ #mesondefine GST_GL_HAVE_VIV_DIRECTVIV
++#mesondefine GST_GL_HAVE_PHYMEM
+
+ #mesondefine GST_GL_HAVE_GLEGLIMAGEOES
+ #mesondefine GST_GL_HAVE_GLCHAR
+diff --git a/gst-libs/gst/gl/meson.build b/gst-libs/gst/gl/meson.build
+index 0e0ba1b7d..6f6c6866d 100644
+--- a/gst-libs/gst/gl/meson.build
++++ b/gst-libs/gst/gl/meson.build
+@@ -123,8 +123,10 @@ glconf_options = [
+ 'GST_GL_HAVE_PLATFORM_CGL',
+ 'GST_GL_HAVE_PLATFORM_EAGL',
+
++ 'GST_GL_HAVE_IONDMA',
+ 'GST_GL_HAVE_DMABUF',
+ 'GST_GL_HAVE_VIV_DIRECTVIV',
++ 'GST_GL_HAVE_PHYMEM',
+
+ 'GST_GL_HAVE_GLEGLIMAGEOES',
+ 'GST_GL_HAVE_GLCHAR',
+@@ -146,6 +148,18 @@ if unneeded_dep.found()
+ error ('Found unfindable dependency')
+ endif
+
++if cc.has_header('linux/ion.h', include_directories : imx_includes)
++ glconf.set10('GST_GL_HAVE_IONDMA', 1)
++ gl_sources += [
++ 'gstglmemorydma.c',
++ ]
++ gl_headers += [
++ 'gstglmemorydma.h',
++ ]
++else
++ error('i.MX platform requires ION support to be enabled!')
++endif
++
+ # OpenGL/GLES2 libraries
+ gl_lib_deps = []
+ # GL platform - EGL, GLX, CGL, WGL, etc
+@@ -501,6 +515,7 @@ if need_platform_egl != 'no'
+ glconf.set10('GST_GL_HAVE_DMABUF', 1)
+ endif
+
++
+ egl_includes = '''
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
+@@ -808,9 +823,14 @@ if need_platform_egl != 'no' and need_win_viv_fb != 'no'
+ enabled_gl_winsys += 'viv-fb'
+ glconf.set10('GST_GL_HAVE_WINDOW_VIV_FB', 1)
+ glconf.set10('GST_GL_HAVE_VIV_DIRECTVIV', 1)
++ glconf.set10('GST_GL_HAVE_PHYMEM', 1)
+ gl_sources += [
+ 'viv-fb/gstgldisplay_viv_fb.c',
+ 'viv-fb/gstglwindow_viv_fb_egl.c',
++ 'gstglphymemory.c',
++ ]
++ gl_headers += [
++ 'gstglphymemory.h',
+ ]
+ gl_cpp_args += ['-DEGL_API_FB']
+ endif
+diff --git a/gst-libs/gst/meson.build b/gst-libs/gst/meson.build
+index cd3b5b043..1935f46e5 100644
+--- a/gst-libs/gst/meson.build
++++ b/gst-libs/gst/meson.build
+@@ -11,3 +11,9 @@ subdir('app')
+ subdir('allocators')
+ # FIXME: gl deps are automagic
+ subdir('gl')
++
++# Install dangling imx header, required by other plugins
++gst_imx_header = [
++ 'gstimxcommon.h',
++]
++install_headers(gst_imx_header, subdir : 'gstreamer-1.0/')
+diff --git a/gst-libs/gst/video/meson.build b/gst-libs/gst/video/meson.build
+index b4dfcdf65..d8531f199 100644
+--- a/gst-libs/gst/video/meson.build
++++ b/gst-libs/gst/video/meson.build
+@@ -35,6 +35,11 @@ video_sources = [
+ 'videooverlay.c',
+ ]
+
++imx_video_sources = [
++ 'gstvideohdr10meta.c',
++]
++video_sources += imx_video_sources
++
+ video_headers = [
+ 'colorbalance.h',
+ 'colorbalancechannel.h',
+@@ -70,6 +75,12 @@ video_headers = [
+ 'video-overlay-composition.h',
+ 'video-multiview.h',
+ ]
++
++imx_video_headers = [
++ 'gstvideohdr10meta.h',
++]
++video_headers += imx_video_headers
++
+ install_headers(video_headers, subdir : 'gstreamer-1.0/gst/video/')
+
+ video_mkenum_headers = [
+diff --git a/meson.build b/meson.build
+index 2fca28205..7781934cd 100644
+--- a/meson.build
++++ b/meson.build
+@@ -103,6 +103,9 @@ if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
+ add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
+ endif
+
++# Define i.MX-specific include path as variable from options
++imx_includes = include_directories(get_option('extra_imx_incdir'))
++
+ check_headers = [
+ ['HAVE_DLFCN_H', 'dlfcn.h'],
+ ['HAVE_EMMINTRIN_H', 'emmintrin.h'],
+diff --git a/meson_options.txt b/meson_options.txt
+index e7af4dd45..d44401ca6 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -85,3 +85,7 @@ option('package-name', type : 'string', yield : true,
+ description : 'package name to use in plugins')
+ option('package-origin', type : 'string', value : 'Unknown package origin', yield : true,
+ description : 'package origin URL to use in plugins')
++
++# NXP specific options
++option('extra_imx_incdir', type : 'string', yield : true, description : 'i.MX specific header include path')
++
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch
new file mode 100644
index 00000000..55871883
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch
@@ -0,0 +1,34 @@
+From f82db8496df8ffb8352248e895258c19f8f4776b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
+Date: Thu, 17 Oct 2019 20:06:24 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.
+
+Upstream-Status: Backport [30672ba7d134553e59935ddc875104adba26f25c]
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 2fca28205..2714af718 100644
+--- a/meson.build
++++ b/meson.build
+@@ -355,7 +355,7 @@ endif
+
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+ 'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
+ 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-meson-Add-variables-for-gir-files.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-meson-Add-variables-for-gir-files.patch
new file mode 100644
index 00000000..9494f622
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-meson-Add-variables-for-gir-files.patch
@@ -0,0 +1,233 @@
+From 7a21c86a3facfc7fe8285e764324839b2e55df8a Mon Sep 17 00:00:00 2001
+From: Thibault Saunier <tsaunier@igalia.com>
+Date: Mon, 22 Oct 2018 11:44:37 +0200
+Subject: [PATCH] meson: Add variables for gir files
+
+And flatten list of sources for dependencies
+
+Upstream-Status: Backport [685731e989dc074a4b0d48b6c8062e2738f09719]
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+
+---
+ gst-libs/gst/allocators/meson.build | 5 +++--
+ gst-libs/gst/app/meson.build | 6 ++++--
+ gst-libs/gst/audio/meson.build | 5 +++--
+ gst-libs/gst/pbutils/meson.build | 5 +++--
+ gst-libs/gst/rtp/meson.build | 6 ++++--
+ gst-libs/gst/rtsp/meson.build | 5 +++--
+ gst-libs/gst/sdp/meson.build | 6 ++++--
+ gst-libs/gst/tag/meson.build | 5 +++--
+ gst-libs/gst/video/meson.build | 5 +++--
+ 9 files changed, 30 insertions(+), 18 deletions(-)
+
+diff --git a/gst-libs/gst/allocators/meson.build b/gst-libs/gst/allocators/meson.build
+index 364baeebf..56f156dc3 100644
+--- a/gst-libs/gst/allocators/meson.build
++++ b/gst-libs/gst/allocators/meson.build
+@@ -22,7 +22,7 @@ gstallocators = library('gstallocators-@0@'.format(api_version),
+ allocators_gen_sources = []
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/allocators/allocators.h' ]
+- allocators_gen_sources += [gnome.generate_gir(gstallocators,
++ allocators_gir = gnome.generate_gir(gstallocators,
+ sources : gst_allocators_sources + gst_allocators_headers,
+ namespace : 'GstAllocators',
+ nsversion : api_version,
+@@ -33,7 +33,8 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : [gst_dep]
+- )]
++ )
++ allocators_gen_sources += allocators_gir
+ endif
+
+ allocators_dep = declare_dependency(link_with: gstallocators,
+diff --git a/gst-libs/gst/app/meson.build b/gst-libs/gst/app/meson.build
+index 81dd0f42c..7a90f5e10 100644
+--- a/gst-libs/gst/app/meson.build
++++ b/gst-libs/gst/app/meson.build
+@@ -32,7 +32,7 @@ gstapp = library('gstapp-@0@'.format(api_version),
+
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/app/app.h' ]
+- app_gen_sources += [gnome.generate_gir(gstapp,
++ app_gir = gnome.generate_gir(gstapp,
+ sources : app_sources + app_headers + [gstapp_c] + [gstapp_h],
+ namespace : 'GstApp',
+ nsversion : api_version,
+@@ -43,7 +43,9 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : [gst_dep, gst_base_dep]
+- )]
++ )
++
++ app_gen_sources += app_gir
+ endif
+
+ app_dep = declare_dependency(link_with: gstapp,
+diff --git a/gst-libs/gst/audio/meson.build b/gst-libs/gst/audio/meson.build
+index 0e4efab2e..2a449d4bf 100644
+--- a/gst-libs/gst/audio/meson.build
++++ b/gst-libs/gst/audio/meson.build
+@@ -153,7 +153,7 @@ gstaudio = library('gstaudio-@0@'.format(api_version),
+
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/audio/audio.h' ]
+- audio_gen_sources += [gnome.generate_gir(gstaudio,
++ audio_gir = gnome.generate_gir(gstaudio,
+ sources : audio_src + audio_headers + [gstaudio_c] + [gstaudio_h],
+ namespace : 'GstAudio',
+ nsversion : api_version,
+@@ -164,7 +164,8 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : gstaudio_deps
+- )]
++ )
++ audio_gen_sources += [audio_gir]
+ endif
+
+ audio_dep = declare_dependency(link_with : gstaudio,
+diff --git a/gst-libs/gst/pbutils/meson.build b/gst-libs/gst/pbutils/meson.build
+index 2faf62622..0e96722fd 100644
+--- a/gst-libs/gst/pbutils/meson.build
++++ b/gst-libs/gst/pbutils/meson.build
+@@ -63,7 +63,7 @@ pbutils = library('gstpbutils-@0@'.format(api_version),
+ pbutils_gen_sources = [gstpbutils_h, gst_pbutils_version_h]
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/pbutils/pbutils.h' ]
+- pbutils_gen_sources += [gnome.generate_gir(pbutils,
++ pbutils_gir = gnome.generate_gir(pbutils,
+ sources : pbutils_sources + pbutils_headers + [gstpbutils_h, gst_pbutils_version_h],
+ namespace : 'GstPbutils',
+ nsversion : api_version,
+@@ -74,7 +74,8 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : gstpbutils_deps
+- )]
++ )
++ pbutils_gen_sources += [pbutils_gir]
+ endif
+
+ pbutils_dep = declare_dependency(link_with : pbutils,
+diff --git a/gst-libs/gst/rtp/meson.build b/gst-libs/gst/rtp/meson.build
+index f47ec6592..7ea6658d5 100644
+--- a/gst-libs/gst/rtp/meson.build
++++ b/gst-libs/gst/rtp/meson.build
+@@ -49,7 +49,7 @@ gst_rtp = library('gstrtp-@0@'.format(api_version),
+ rtp_gen_sources = [gstrtp_enum_h]
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/rtp/rtp.h' ]
+- rtp_gen_sources += [gnome.generate_gir(gst_rtp,
++ rtp_gir = gnome.generate_gir(gst_rtp,
+ sources : rtp_sources + rtp_headers + [gstrtp_enum_c] + [gstrtp_enum_h],
+ namespace : 'GstRtp',
+ nsversion : api_version,
+@@ -60,7 +60,9 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : gstrtp_deps
+- )]
++ )
++
++ rtp_gen_sources += [rtp_gir]
+ endif
+
+
+diff --git a/gst-libs/gst/rtsp/meson.build b/gst-libs/gst/rtsp/meson.build
+index 27e309d5a..3632adceb 100644
+--- a/gst-libs/gst/rtsp/meson.build
++++ b/gst-libs/gst/rtsp/meson.build
+@@ -54,7 +54,7 @@ gst_rtsp = library('gstrtsp-@0@'.format(api_version),
+ rtsp_gen_sources = [gstrtsp_h]
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/rtsp/rtsp.h' ]
+- rtsp_gen_sources += [gnome.generate_gir(gst_rtsp,
++ rtsp_gir = gnome.generate_gir(gst_rtsp,
+ sources : rtsp_sources + rtsp_headers + [gstrtsp_c] + [gstrtsp_h],
+ namespace : 'GstRtsp',
+ nsversion : api_version,
+@@ -65,7 +65,8 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : gstrtsp_deps + [sdp_dep]
+- )]
++ )
++ rtsp_gen_sources += [rtsp_gir]
+ endif
+
+ rtsp_dep = declare_dependency(link_with : gst_rtsp,
+diff --git a/gst-libs/gst/sdp/meson.build b/gst-libs/gst/sdp/meson.build
+index 62c18b732..24cdb5293 100644
+--- a/gst-libs/gst/sdp/meson.build
++++ b/gst-libs/gst/sdp/meson.build
+@@ -23,7 +23,7 @@ gstsdp = library('gstsdp-@0@'.format(api_version),
+ sdp_gen_sources = []
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/sdp/sdp.h' ]
+- sdp_gen_sources += [gnome.generate_gir(gstsdp,
++ sdp_gir = gnome.generate_gir(gstsdp,
+ sources : gst_sdp_sources + gst_sdp_headers,
+ namespace : 'GstSdp',
+ nsversion : api_version,
+@@ -34,7 +34,9 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : rtsp_deps
+- )]
++ )
++
++ sdp_gen_sources += [sdp_gir]
+ endif
+
+ sdp_dep = declare_dependency(link_with: gstsdp,
+diff --git a/gst-libs/gst/tag/meson.build b/gst-libs/gst/tag/meson.build
+index 27e66fd63..5ec37392a 100644
+--- a/gst-libs/gst/tag/meson.build
++++ b/gst-libs/gst/tag/meson.build
+@@ -93,7 +93,7 @@ gsttag = library('gsttag-@0@'.format(api_version),
+
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/tag/tag.h' ]
+- tag_gen_sources += [gnome.generate_gir(gsttag,
++ tag_gir = gnome.generate_gir(gsttag,
+ sources : tag_sources + tag_headers + [gsttag_h] + [gsttag_c],
+ namespace : 'GstTag',
+ nsversion : api_version,
+@@ -104,7 +104,8 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : tag_deps
+- )]
++ )
++ tag_gen_sources += [tag_gir]
+ endif
+
+ tag_dep = declare_dependency(link_with: gsttag,
+diff --git a/gst-libs/gst/video/meson.build b/gst-libs/gst/video/meson.build
+index b4dfcdf65..036c3a6a7 100644
+--- a/gst-libs/gst/video/meson.build
++++ b/gst-libs/gst/video/meson.build
+@@ -135,7 +135,7 @@ gstvideo = library('gstvideo-@0@'.format(api_version),
+
+ if build_gir
+ gst_gir_extra_args = gir_init_section + [ '--c-include=gst/video/video.h' ]
+- video_gen_sources += [gnome.generate_gir(gstvideo,
++ video_gir = gnome.generate_gir(gstvideo,
+ sources : video_sources + video_headers + [gstvideo_c] + [gstvideo_h],
+ namespace : 'GstVideo',
+ nsversion : api_version,
+@@ -146,7 +146,8 @@ if build_gir
+ install : true,
+ extra_args : gst_gir_extra_args,
+ dependencies : gstvideo_deps
+- )]
++ )
++ video_gen_sources += [video_gir]
+ endif
+
+ video_dep = declare_dependency(link_with : gstvideo,
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-viv-fb-Make-sure-config.h-is-included.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-viv-fb-Make-sure-config.h-is-included.patch
new file mode 100644
index 00000000..731ba873
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-viv-fb-Make-sure-config.h-is-included.patch
@@ -0,0 +1,30 @@
+From 616cf194dfd26818ed7b776321582b8e0ff9b3f1 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <crg7475@mailbox.org>
+Date: Tue, 21 May 2019 14:01:11 +0200
+Subject: [PATCH] viv-fb: Make sure config.h is included
+
+This prevents build errors due to missing GST_API_* symbols
+
+Upstream-Status: Pending
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+
+---
+ gst-libs/gst/gl/gl-prelude.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gst-libs/gst/gl/gl-prelude.h b/gst-libs/gst/gl/gl-prelude.h
+index 05e1f6229..96ce5e685 100644
+--- a/gst-libs/gst/gl/gl-prelude.h
++++ b/gst-libs/gst/gl/gl-prelude.h
+@@ -22,6 +22,10 @@
+ #ifndef __GST_GL_PRELUDE_H__
+ #define __GST_GL_PRELUDE_H__
+
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #include <gst/gst.h>
+
+ #ifdef BUILDING_GST_GL
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-glimagesink-Downrank-to-marginal.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-glimagesink-Downrank-to-marginal.patch
new file mode 100644
index 00000000..fc67a486
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-glimagesink-Downrank-to-marginal.patch
@@ -0,0 +1,30 @@
+From f18f1206ec44f4154e60546ecb82823f7a6569d7 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 24 Sep 2015 19:47:32 +0300
+Subject: [PATCH] glimagesink: Downrank to marginal
+
+On desktop, where there is good OpenGL, xvimagesink will come up first,
+on other platforms, OpenGL can't be trusted because it's either software (like
+in a VM) or broken (like on embedded)., so let ximagesink come above.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=751684]
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ ext/gl/gstopengl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c
+index 302e8452c..463be9cd8 100644
+--- a/ext/gl/gstopengl.c
++++ b/ext/gl/gstopengl.c
+@@ -127,7 +127,7 @@ plugin_init (GstPlugin * plugin)
+ #endif
+
+ if (!gst_element_register (plugin, "glimagesink",
+- GST_RANK_SECONDARY, gst_gl_image_sink_bin_get_type ())) {
++ GST_RANK_MARGINAL, gst_gl_image_sink_bin_get_type ())) {
+ return FALSE;
+ }
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.bb
deleted file mode 100644
index 0da9a2ea..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.imx.bb
+++ /dev/null
@@ -1,76 +0,0 @@
-require recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
-
-LICENSE = "GPLv2+ & LGPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
- file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
- file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
-
-DEPENDS += "iso-codes util-linux"
-
-GST1.0-PLUGINS-BASE_SRC ?= "gitsm://source.codeaurora.org/external/imx/gst-plugins-base.git;protocol=https"
-SRCBRANCH = "MM_04.04.02_1808_L4.9.123_MX8MM_GA"
-
-SRC_URI = " \
- ${GST1.0-PLUGINS-BASE_SRC};branch=${SRCBRANCH} \
- file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
- file://make-gio_unix_2_0-dependency-configurable.patch \
- file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \
- file://0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch \
- file://0003-riff-add-missing-include-directories-when-calling-in.patch \
- file://0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch \
-"
-SRCREV = "e1f90437939b147658efed4d86c3f99d5e606968"
-
-DEFAULT_PREFERENCE = "-1"
-
-EXTRA_AUTORECONF = ""
-
-S = "${WORKDIR}/git"
-
-# Enable pango lib
-PACKAGECONFIG_append = " pango "
-
-# Disable introspection to fix [GstGL-1.0.gir] Error
-EXTRA_OECONF_append = " --disable-introspection --disable-opengl --enable-wayland"
-
-inherit gettext use-imx-headers
-
-PACKAGES_DYNAMIC =+ "^libgst.*"
-
-PACKAGECONFIG ??= " \
- ${GSTREAMER_ORC} \
- ${@bb.utils.filter('DISTRO_FEATURES', 'alsa x11', d)} \
- ogg pango theora vorbis \
-"
-
-X11DEPENDS = "virtual/libx11 libsm libxrender libxv"
-X11ENABLEOPTS = "--enable-x --enable-xvideo --enable-xshm"
-X11DISABLEOPTS = "--disable-x --disable-xvideo --disable-xshm"
-
-PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
-PACKAGECONFIG[cdparanoia] = "--enable-cdparanoia,--disable-cdparanoia,cdparanoia"
-PACKAGECONFIG[ivorbis] = "--enable-ivorbis,--disable-ivorbis,tremor"
-PACKAGECONFIG[ogg] = "--enable-ogg,--disable-ogg,libogg"
-PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus"
-PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
-PACKAGECONFIG[theora] = "--enable-theora,--disable-theora,libtheora"
-PACKAGECONFIG[visual] = "--enable-libvisual,--disable-libvisual,libvisual"
-PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis"
-PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}"
-
-EXTRA_OECONF += " \
- --enable-zlib \
- CPPFLAGS="-I${STAGING_INCDIR_IMX}" \
-"
-
-CACHED_CONFIGUREVARS_append_x86 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no"
-
-FILES_${MLPREFIX}libgsttag-1.0 += "${datadir}/gst-plugins-base/1.0/license-translations.dict"
-
-do_compile_prepend() {
- export GIR_EXTRA_LIBS_PATH="${B}/gst-libs/gst/tag/.libs:${B}/gst-libs/gst/video/.libs:${B}/gst-libs/gst/audio/.libs:${B}/gst-libs/gst/rtp/.libs"
-}
-
-FILES_${PN} += "${libdir}/gstreamer-1.0/include"
-
-COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.14.%.bbappend b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.%.bbappend
index 8565c6a5..d92bdf3c 100644
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.14.%.bbappend
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.%.bbappend
@@ -1,3 +1,5 @@
PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'opengl', '', d)}"
PACKAGECONFIG_GL_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl', '', d)}"
-PACKAGECONFIG_GL_use-mainline-bsp = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl', '', d)}"
+
+# For mainline BSP we need to enable 'gbm' Window system
+PACKAGECONFIG_GL_use-mainline-bsp = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl gbm', '', d)}"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.imx.bb
new file mode 100644
index 00000000..ae372729
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.16.imx.bb
@@ -0,0 +1,100 @@
+require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+ file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
+
+GST1.0-PLUGINS-BASE_SRC ?= "gitsm://source.codeaurora.org/external/imx/gst-plugins-base.git;protocol=https"
+SRCBRANCH = "MM_04.05.03_1911_L5.4.0"
+SRCREV = "289e06a129224b530d23b6d41f0a65cc341109c5"
+SRC_URI = "${GST1.0-PLUGINS-BASE_SRC};branch=${SRCBRANCH} \
+ file://0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch \
+ file://0001-gstreamer-plugins-base-fix-meson-build-in-nxp-fork.patch \
+ file://0002-meson-Add-variables-for-gir-files.patch \
+ file://0005-viv-fb-Make-sure-config.h-is-included.patch \
+ file://0009-glimagesink-Downrank-to-marginal.patch \
+ file://0001-gst-libs-gst-gl-wayland-fix-meson-build.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+DEPENDS += "iso-codes util-linux zlib"
+DEPENDS_append_imxgpu2d = " virtual/libg2d"
+
+inherit use-imx-headers gobject-introspection gtk-doc
+
+DEFAULT_PREFERENCE = "-1"
+
+PACKAGES_DYNAMIC =+ "^libgst.*"
+
+# opengl packageconfig factored out to make it easy for distros
+# and BSP layers to choose OpenGL APIs/platforms/window systems
+PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl', '', d)}"
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ ${PACKAGECONFIG_GL} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa x11', d)} \
+ ogg pango png theora vorbis \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \
+"
+
+OPENGL_APIS = 'opengl gles2'
+OPENGL_PLATFORMS = 'egl'
+OPENGL_WINSYS = 'x11 wayland gbm'
+
+X11DEPENDS = "virtual/libx11 libsm libxrender libxv"
+X11ENABLEOPTS = "-Dx11=enabled -Dxvideo=enabled -Dxshm=enabled"
+X11DISABLEOPTS = "-Dx11=disabled -Dxvideo=disabled -Dxshm=disabled"
+
+PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib"
+PACKAGECONFIG[cdparanoia] = "-Dcdparanoia=enabled,-Dcdparanoia=disabled,cdparanoia"
+PACKAGECONFIG[jpeg] = "-Dgl-jpeg=enabled,-Dgl-jpeg=disabled,jpeg"
+PACKAGECONFIG[ogg] = "-Dogg=enabled,-Dogg=disabled,libogg"
+PACKAGECONFIG[opus] = "-Dopus=enabled,-Dopus=disabled,libopus"
+PACKAGECONFIG[pango] = "-Dpango=enabled,-Dpango=disabled,pango"
+PACKAGECONFIG[png] = "-Dgl-png=enabled,-Dgl-png=disabled,libpng"
+PACKAGECONFIG[theora] = "-Dtheora=enabled,-Dtheora=disabled,libtheora"
+PACKAGECONFIG[tremor] = "-Dtremor=enabled,-Dtremor=disabled,tremor"
+PACKAGECONFIG[visual] = "-Dlibvisual=enabled,-Dlibvisual=disabled,libvisual"
+PACKAGECONFIG[vorbis] = "-Dvorbis=enabled,-Dvorbis=disabled,libvorbis"
+PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}"
+
+# OpenGL API packageconfigs
+PACKAGECONFIG[opengl] = ",,virtual/libgl libglu"
+PACKAGECONFIG[gles2] = ",,virtual/libgles2"
+
+# OpenGL platform packageconfigs
+PACKAGECONFIG[egl] = ",,virtual/egl"
+
+# OpenGL window systems (except for X11)
+PACKAGECONFIG[gbm] = ",,virtual/libgbm libgudev libdrm"
+PACKAGECONFIG[wayland] = ",,wayland-native wayland wayland-protocols libdrm"
+
+EXTRA_OEMESON += " \
+ -Dgl-graphene=disabled \
+ ${@get_opengl_cmdline_list('gl_api', d.getVar('OPENGL_APIS'), d)} \
+ ${@get_opengl_cmdline_list('gl_platform', d.getVar('OPENGL_PLATFORMS'), d)} \
+ ${@get_opengl_cmdline_list('gl_winsys', d.getVar('OPENGL_WINSYS'), d)} \
+ -Dextra_imx_incdir=${STAGING_INCDIR_IMX} \
+"
+
+GTKDOC_MESON_OPTION = "gtk_doc"
+GTKDOC_MESON_ENABLE_FLAG = "enabled"
+GTKDOC_MESON_DISABLE_FLAG = "disabled"
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/include"
+FILES_${MLPREFIX}libgsttag-1.0 += "${datadir}/gst-plugins-base/1.0/license-translations.dict"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
+
+def get_opengl_cmdline_list(switch_name, options, d):
+ selected_options = []
+ if bb.utils.contains('DISTRO_FEATURES', 'opengl', True, False, d):
+ for option in options.split():
+ if bb.utils.contains('PACKAGECONFIG', option, True, False, d):
+ selected_options += [option]
+ if selected_options:
+ return '-D' + switch_name + '=' + ','.join(selected_options)
+ else:
+ return ''
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.14.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.14.imx.bb
deleted file mode 100644
index d527073b..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.14.imx.bb
+++ /dev/null
@@ -1,71 +0,0 @@
-require recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
-
-LICENSE = "GPLv2+ & LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
- file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
- file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
-
-GST1.0-PLUGINS-GOOD_SRC ?= "gitsm://source.codeaurora.org/external/imx/gst-plugins-good.git;protocol=https"
-SRCBRANCH = "MM_04.04.02_1808_L4.9.123_MX8MM_GA"
-
-SRC_URI = " \
- ${GST1.0-PLUGINS-GOOD_SRC};branch=${SRCBRANCH} \
-"
-SRCREV = "f25cda9043fee159197898bb810d6e64f2a11140"
-
-DEFAULT_PREFERENCE = "-1"
-
-EXTRA_AUTORECONF = ""
-
-S = "${WORKDIR}/git"
-
-DEPENDS += "gstreamer1.0-plugins-base libcap zlib bzip2"
-RPROVIDES_${PN}-soup += "${PN}-souphttpsrc"
-
-inherit gettext
-
-PACKAGECONFIG ??= " \
- ${GSTREAMER_ORC} \
- ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio x11', d)} \
- cairo flac gdk-pixbuf gudev jpeg libpng soup speex taglib v4l2 \
-"
-
-X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage"
-
-PACKAGECONFIG[cairo] = "--enable-cairo,--disable-cairo,cairo"
-PACKAGECONFIG[dv1394] = "--enable-dv1394,--disable-dv1394,libiec61883 libavc1394 libraw1394"
-PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac"
-PACKAGECONFIG[gdk-pixbuf] = "--enable-gdk_pixbuf,--disable-gdk_pixbuf,gdk-pixbuf"
-PACKAGECONFIG[gudev] = "--with-gudev,--without-gudev,libgudev"
-PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
-PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
-PACKAGECONFIG[libpng] = "--enable-libpng,--disable-libpng,libpng"
-PACKAGECONFIG[libv4l2] = "--with-libv4l2,--without-libv4l2,v4l-utils"
-PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
-PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4"
-PACKAGECONFIG[speex] = "--enable-speex,--disable-speex,speex"
-PACKAGECONFIG[taglib] = "--enable-taglib,--disable-taglib,taglib"
-PACKAGECONFIG[v4l2] = "--enable-gst_v4l2 --enable-v4l2-probe,--disable-gst_v4l2,libdrm"
-PACKAGECONFIG[vpx] = "--enable-vpx,--disable-vpx,libvpx"
-PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack"
-PACKAGECONFIG[x11] = "--enable-x,--disable-x,${X11DEPENDS}"
-
-EXTRA_OECONF += " \
- --enable-bz2 \
- --enable-oss \
- --enable-zlib \
- --disable-aalib \
- --disable-aalibtest \
- --disable-directsound \
- --disable-libcaca \
- --disable-libdv \
- --disable-oss4 \
- --disable-osx_audio \
- --disable-osx_video \
- --disable-shout2 \
- --disable-waveform \
-"
-
-FILES_${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"
-
-COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.%.bbappend b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.%.bbappend
index 8565c6a5..8565c6a5 100644
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.14.%.bbappend
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.%.bbappend
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.imx.bb
new file mode 100644
index 00000000..6134789d
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.16.imx.bb
@@ -0,0 +1,79 @@
+require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc
+
+
+GST1.0-PLUGINS-GOOD_SRC ?= "gitsm://source.codeaurora.org/external/imx/gst-plugins-good.git;protocol=https"
+SRCBRANCH = "MM_04.05.03_1911_L5.4.0"
+
+SRC_URI = " \
+ ${GST1.0-PLUGINS-GOOD_SRC};branch=${SRCBRANCH} \
+"
+SRCREV = "3bcc85705695ee629ac3fb687411bb196d231918"
+
+DEFAULT_PREFERENCE = "-1"
+
+S = "${WORKDIR}/git"
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
+ file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
+
+DEPENDS += "gstreamer1.0-plugins-base libcap zlib"
+RPROVIDES_${PN}-pulseaudio += "${PN}-pulse"
+RPROVIDES_${PN}-soup += "${PN}-souphttpsrc"
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio x11', d)} \
+ bz2 cairo flac gdk-pixbuf gudev jpeg lame libpng mpg123 soup speex taglib v4l2 \
+"
+
+X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage"
+X11ENABLEOPTS = "-Dximagesrc=enabled -Dximagesrc-xshm=enabled -Dximagesrc-xfixes=enabled -Dximagesrc-xdamage=enabled"
+X11DISABLEOPTS = "-Dximagesrc=disabled -Dximagesrc-xshm=disabled -Dximagesrc-xfixes=disabled -Dximagesrc-xdamage=disabled"
+
+PACKAGECONFIG[bz2] = "-Dbz2=enabled,-Dbz2=disabled,bzip2"
+PACKAGECONFIG[cairo] = "-Dcairo=enabled,-Dcairo=disabled,cairo"
+PACKAGECONFIG[dv1394] = "-Ddv1394=enabled,-Ddv1394=disabled,libiec61883 libavc1394 libraw1394"
+PACKAGECONFIG[flac] = "-Dflac=enabled,-Dflac=disabled,flac"
+PACKAGECONFIG[gdk-pixbuf] = "-Dgdk-pixbuf=enabled,-Dgdk-pixbuf=disabled,gdk-pixbuf"
+PACKAGECONFIG[gtk] = "-Dgtk3=enabled,-Dgtk3=disabled,gtk+3"
+PACKAGECONFIG[gudev] = "-Dv4l2-gudev=enabled,-Dv4l2-gudev=disabled,libgudev"
+PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
+PACKAGECONFIG[jpeg] = "-Djpeg=enabled,-Djpeg=disabled,jpeg"
+PACKAGECONFIG[lame] = "-Dlame=enabled,-Dlame=disabled,lame"
+PACKAGECONFIG[libpng] = "-Dpng=enabled,-Dpng=disabled,libpng"
+PACKAGECONFIG[libv4l2] = "-Dv4l2-libv4l2=enabled,-Dv4l2-libv4l2=disabled,v4l-utils"
+PACKAGECONFIG[mpg123] = "-Dmpg123=enabled,-Dmpg123=disabled,mpg123"
+PACKAGECONFIG[pulseaudio] = "-Dpulse=enabled,-Dpulse=disabled,pulseaudio"
+PACKAGECONFIG[soup] = "-Dsoup=enabled,-Dsoup=disabled,libsoup-2.4"
+PACKAGECONFIG[speex] = "-Dspeex=enabled,-Dspeex=disabled,speex"
+PACKAGECONFIG[taglib] = "-Dtaglib=enabled,-Dtaglib=disabled,taglib"
+PACKAGECONFIG[v4l2] = "-Dv4l2=enabled -Dv4l2-probe=true,-Dv4l2=disabled -Dv4l2-probe=false,libdrm"
+PACKAGECONFIG[vpx] = "-Dvpx=enabled,-Dvpx=disabled,libvpx"
+PACKAGECONFIG[wavpack] = "-Dwavpack=enabled,-Dwavpack=disabled,wavpack"
+PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}"
+
+# qt5 support is disabled, because it is not present in OE core, and requires more work than
+# just adding a packageconfig (it requires access to moc, uic, rcc, and qmake paths).
+# This is better done in a separate qt5 layer (which then should add a "qt5" packageconfig
+# in a gstreamer1.0-plugins-good bbappend).
+
+EXTRA_OEMESON += " \
+ -Daalib=disabled \
+ -Ddirectsound=disabled \
+ -Ddv=disabled \
+ -Dlibcaca=disabled \
+ -Doss=enabled \
+ -Doss4=disabled \
+ -Dosxaudio=disabled \
+ -Dosxvideo=disabled \
+ -Dqt5=disabled \
+ -Dshout2=disabled \
+ -Dtwolame=disabled \
+ -Dwaveform=disabled \
+"
+
+FILES_${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_git.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.13.1.bb
index a74ff64b..35996337 100644
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_git.bb
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.13.1.bb
@@ -14,10 +14,10 @@ RDEPENDS_gstreamer1.0-plugins-imx = "gstreamer1.0-plugins-good"
RDEPENDS_gstreamer1.0-plugins-imx-imxaudio = "gstreamer1.0-plugins-good-audioparsers"
RDEPENDS_gstreamer1.0-plugins-imx-imxvpu = "gstreamer1.0-plugins-bad-videoparsersbad"
-PV = "0.13.0+git${SRCPV}"
+PV .= "+git${SRCPV}"
SRCBRANCH ?= "master"
-SRCREV = "963aea60b135d40236411357eb0b2de15eac9af5"
+SRCREV = "805987bff74af13fcb14ff111955206f1c92554d"
SRC_URI = "git://github.com/Freescale/gstreamer-imx.git;branch=${SRCBRANCH}"
S = "${WORKDIR}/git"
@@ -50,8 +50,8 @@ PACKAGECONFIG_append_imxipu = " ipu"
PACKAGECONFIG_append_imxvpu = " vpu"
PACKAGECONFIG_append_imxpxp = " pxp"
-PACKAGECONFIG[g2d] = ",--disable-g2d,imx-gpu-viv"
-PACKAGECONFIG[g2dpango] = ",--disable-g2dpango,imx-gpu-viv pango"
+PACKAGECONFIG[g2d] = ",--disable-g2d,imx-gpu-g2d"
+PACKAGECONFIG[g2dpango] = ",--disable-g2dpango,imx-gpu-g2d pango"
PACKAGECONFIG[pxp] = ",--disable-pxp,"
PACKAGECONFIG[ipu] = ",--disable-ipu,"
PACKAGECONFIG[vpu] = ",--disable-vpu,libimxvpuapi"
@@ -63,7 +63,7 @@ PACKAGECONFIG[mp3encoder] = ",--disable-mp3encoder,imx-codec"
# LIBV is used by gst-plugins-package.inc to specify the GStreamer version (0.10 vs 1.0)
LIBV = "1.0"
-require recipes-multimedia/gstreamer/gst-plugins-package.inc
+require recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc
# the following line is required to produce one package for each plugin
PACKAGES_DYNAMIC = "^${PN}-.*"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.16.0.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.16.0.bb
new file mode 100644
index 00000000..2a1cc3fd
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.16.0.bb
@@ -0,0 +1,39 @@
+require recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
+
+LICENSE = "GPLv2+ & LGPLv2.1+ & LGPLv2+"
+LICENSE_FLAGS = "commercial"
+
+SRC_URI = " \
+ http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \
+ "
+SRC_URI[md5sum] = "1ec343c58d4b17d682f7befa8453c11c"
+SRC_URI[sha256sum] = "e30964c5f031c32289e0b25e176c3c95a5737f2052dfc81d0f7427ef0233a4c2"
+
+S = "${WORKDIR}/gst-plugins-ugly-${PV}"
+
+DEPENDS += "gstreamer1.0-plugins-base"
+
+GST_PLUGIN_SET_HAS_EXAMPLES = "0"
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ a52dec mpeg2dec \
+"
+
+PACKAGECONFIG[a52dec] = "-Da52dec=enabled,-Da52dec=disabled,liba52"
+PACKAGECONFIG[amrnb] = "-Damrnb=enabled,-Damrnb=disabled,opencore-amr"
+PACKAGECONFIG[amrwb] = "-Damrwbdec=enabled,-Damrwbdec=disabled,opencore-amr"
+PACKAGECONFIG[cdio] = "-Dcdio=enabled,-Dcdio=disabled,libcdio"
+PACKAGECONFIG[dvdread] = "-Ddvdread=enabled,-Ddvdread=disabled,libdvdread"
+PACKAGECONFIG[mpeg2dec] = "-Dmpeg2dec=enabled,-Dmpeg2dec=disabled,mpeg2dec"
+PACKAGECONFIG[x264] = "-Dx264=enabled,-Dx264=disabled,x264"
+
+EXTRA_OEMESON += " \
+ -Dsidplay=disabled \
+"
+
+FILES_${PN}-amrnb += "${datadir}/gstreamer-1.0/presets/GstAmrnbEnc.prs"
+FILES_${PN}-x264 += "${datadir}/gstreamer-1.0/presets/GstX264Enc.prs"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch
new file mode 100644
index 00000000..6962a50d
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch
@@ -0,0 +1,36 @@
+From 95ce953e34cd0e9f5d42ce7900a9572e7bc8ca47 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
+Date: Fri, 18 Oct 2019 00:42:12 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.
+
+Upstream-Status: Backport [95ce953e34cd0e9f5d42ce7900a9572e7bc8ca47]
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index e1e3b1d..3f45f0e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -173,7 +173,7 @@ endif
+
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+ 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
+ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.16.0.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.16.0.bb
new file mode 100644
index 00000000..0a3c35ff
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.16.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "A library on top of GStreamer for building an RTSP server"
+HOMEPAGE = "http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/"
+SECTION = "multimedia"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
+
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base"
+
+PNREAL = "gst-rtsp-server"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz \
+ file://0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch \
+ "
+
+SRC_URI[md5sum] = "adc4460239ec2eccf58ad9752ce53bfd"
+SRC_URI[sha256sum] = "198e9eec1a3e32dc810d3fbf3a714850a22c6288d4a5c8e802c5ff984af03f19"
+
+S = "${WORKDIR}/${PNREAL}-${PV}"
+
+inherit meson pkgconfig upstream-version-is-even gobject-introspection
+
+EXTRA_OEMESON += " \
+ -Dexamples=disabled \
+ -Dtests=disabled \
+"
+
+GIR_MESON_ENABLE_FLAG = "enabled"
+GIR_MESON_DISABLE_FLAG = "disabled"
+
+# Starting with 1.8.0 gst-rtsp-server includes dependency-less plugins as well
+LIBV = "1.0"
+require recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/files/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
index 67a872cd..67a872cd 100644
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/files/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch
new file mode 100644
index 00000000..1ed7198a
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch
@@ -0,0 +1,36 @@
+From 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
+Date: Thu, 17 Oct 2019 12:13:35 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+Fixes #454 and #381.
+
+Upstream-Status: Backport [35db4a2433fbdf8612cf98b5aab5b14aeb5372f8]
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 90d98d8eb..a47e7f34e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -466,7 +466,7 @@ rt_lib = cc.find_library('rt', required : false)
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+ 'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch
new file mode 100644
index 00000000..f553340f
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch
@@ -0,0 +1,74 @@
+From f6c7973c03d9ba7dab60c496e768c5e6c4ee824c Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <crg7475@mailbox.org>
+Date: Sun, 20 Oct 2019 10:36:44 +0200
+Subject: [PATCH] meson: Add valgrind feature
+
+This allows for enabling/disabling Valgrind support. Since Valgrind is
+an external dependency, such a feature is needed by build environemnts
+such as Yocto to make sure builds are deterministic. These changes also
+add more Valgrind specific configure log output.
+
+Upstream-Status: Pending
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+---
+ meson.build | 23 ++++++++++++++++++++++-
+ meson_options.txt | 1 +
+ 2 files changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index b55ecc5..4751761 100644
+--- a/meson.build
++++ b/meson.build
+@@ -199,7 +199,6 @@ check_headers = [
+ 'sys/wait.h',
+ 'ucontext.h',
+ 'unistd.h',
+- 'valgrind/valgrind.h',
+ 'sys/resource.h',
+ ]
+
+@@ -214,6 +213,28 @@ foreach h : check_headers
+ endif
+ endforeach
+
++valgrind_option = get_option('valgrind')
++if valgrind_option.disabled()
++ message('Valgrind support not requested; disabled.')
++else
++ valgrind_header = 'valgrind/valgrind.h'
++ has_valgrind_header = cc.has_header(valgrind_header)
++ if has_valgrind_header
++ message('Valgrind support requested, and header ' + valgrind_header + \
++ ' found. Enabled Valgrind support.')
++ define = 'HAVE_' + valgrind_header.underscorify().to_upper()
++ cdata.set(define, 1)
++ else
++ if valgrind_option.enabled()
++ error('Valgrind support requested and set as required, but header ' + \
++ valgrind_header + ' not found.')
++ else
++ message('Valgrind support requested, but header ' + valgrind_header + \
++ ' not found. Disabling Valgrind support.')
++ endif
++ endif
++endif
++
+ if cc.has_member('struct tm', 'tm_gmtoff', prefix : '#include <time.h>')
+ cdata.set('HAVE_TM_GMTOFF', 1)
+ endif
+diff --git a/meson_options.txt b/meson_options.txt
+index e7ff7ba..8afde39 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -19,6 +19,7 @@ option('memory-alignment', type: 'combo',
+
+ # Feature options
+ option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries')
++option('valgrind', type : 'feature', value : 'auto', description : 'Enable Valgrind support')
+ option('libunwind', type : 'feature', value : 'auto', description : 'Use libunwind to generate backtraces')
+ option('libdw', type : 'feature', value : 'auto', description : 'Use libdw to generate better backtraces from libunwind')
+ option('dbghelp', type : 'feature', value : 'auto', description : 'Use dbghelp to generate backtraces')
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch
new file mode 100644
index 00000000..0e6c44ea
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch
@@ -0,0 +1,257 @@
+From b843400284751968862751dfe93853f151551c64 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <crg7475@mailbox.org>
+Date: Fri, 25 Oct 2019 00:06:26 +0200
+Subject: [PATCH] meson: Add option for installed tests
+
+This adds an option for producing installed versions of the unit tests.
+These versions don't need meson to run (only a small shell script). This
+makes it easier to run cross compiled tests on a target machine.
+
+Upstream-Status: Pending
+
+Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
+---
+ build-aux/gen-installed-test-desc.py | 18 ++++++
+ build-aux/gen-installed-test-shscript.py | 25 ++++++++
+ meson_options.txt | 2 +
+ tests/check/meson.build | 46 +++++++++++++-
+ tests/files/testfile | 80 ++++++++++++++++++++++++
+ 5 files changed, 170 insertions(+), 1 deletion(-)
+ create mode 100644 build-aux/gen-installed-test-desc.py
+ create mode 100644 build-aux/gen-installed-test-shscript.py
+ create mode 100644 tests/files/testfile
+
+diff --git a/build-aux/gen-installed-test-desc.py b/build-aux/gen-installed-test-desc.py
+new file mode 100644
+index 0000000..69e8a0f
+--- /dev/null
++++ b/build-aux/gen-installed-test-desc.py
+@@ -0,0 +1,18 @@
++import sys
++import os
++import argparse
++
++def write_template(filename, data):
++ with open(filename, 'w') as f:
++ f.write(data)
++
++def build_template(testdir, testname):
++ return "[Test]\nType=session\nExec={}\n".format(os.path.join(testdir, testname))
++
++argparser = argparse.ArgumentParser(description='Generate installed-test data.')
++argparser.add_argument('--test-execdir', metavar='dir', required=True, help='Installed test directory')
++argparser.add_argument('--testname', metavar='name', required=True, help='Installed test name')
++argparser.add_argument('--output', metavar='file', required=True, help='Output file')
++args = argparser.parse_args()
++
++write_template(args.output, build_template(args.test_execdir, args.testname))
+diff --git a/build-aux/gen-installed-test-shscript.py b/build-aux/gen-installed-test-shscript.py
+new file mode 100644
+index 0000000..5da86fb
+--- /dev/null
++++ b/build-aux/gen-installed-test-shscript.py
+@@ -0,0 +1,25 @@
++import sys
++import os
++import argparse
++
++def write_template(filename, data):
++ with open(filename, 'w') as f:
++ f.write(data)
++
++def build_template(testdir, testname):
++ return ''.join([
++ "#!/usr/bin/env sh\n",
++ "export GST_STATE_IGNORE_ELEMENTS=''\n",
++ "export CK_DEFAULT_TIMEOUT=20\n",
++ "export GST_PLUGIN_LOADING_WHITELIST='gstreamer'\n",
++ "{}\n".format(os.path.join(testdir, testname)),
++ ])
++
++argparser = argparse.ArgumentParser(description='Generate installed-test data.')
++argparser.add_argument('--test-execdir', metavar='dir', required=True, help='Installed test directory')
++argparser.add_argument('--testname', metavar='name', required=True, help='Installed test name')
++argparser.add_argument('--output', metavar='file', required=True, help='Output file')
++args = argparser.parse_args()
++
++write_template(args.output, build_template(args.test_execdir, args.testname))
++os.chmod(args.output, 0o755)
+diff --git a/meson_options.txt b/meson_options.txt
+index 8afde39..8884dcc 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -16,6 +16,8 @@ option('poisoning', type : 'boolean', value : false, description : 'Enable poiso
+ option('memory-alignment', type: 'combo',
+ choices : ['1', '2', '4', '8', '16', '32', '64', '128', '256', '512', '1024', '2048', '4096', '8192', 'malloc', 'pagesize'],
+ value: 'malloc')
++option('installed-tests', type : 'boolean', value : false, description : 'enable installed tests')
++option('test-files-path', type : 'string', description : 'Path where to find test files')
+
+ # Feature options
+ option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries')
+diff --git a/tests/check/meson.build b/tests/check/meson.build
+index 04da83f..2db7f76 100644
+--- a/tests/check/meson.build
++++ b/tests/check/meson.build
+@@ -118,11 +118,17 @@ if add_languages('cpp', required : false)
+ ]
+ endif
+
++test_files_path = get_option('test-files-path')
++if test_files_path == ''
++ test_files_path = meson.current_source_dir() + '/../files'
++endif
++message('Using path "@0@" as the path to read test files from'.format(test_files_path))
++
+ test_defines = [
+ '-UG_DISABLE_ASSERT',
+ '-UG_DISABLE_CAST_CHECKS',
+ '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
+- '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
++ '-DTESTFILE="@0@"'.format(test_files_path + '/testfile'),
+ '-DGST_USE_UNSTABLE_API',
+ '-DGST_DISABLE_DEPRECATED',
+ ]
+@@ -137,6 +143,14 @@ endif
+ glib_deps = [gio_dep, gobject_dep, gmodule_dep, glib_dep]
+ gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep]
+
++installed_tests_datadir = join_paths(prefix, get_option('datadir'), 'installed-tests', 'gstreamer-1.0')
++installed_tests_execdir = join_paths(prefix, libexecdir, 'installed-tests', 'gstreamer-1.0')
++installed_tests_enabled = get_option('installed-tests')
++
++python = import('python').find_installation()
++gen_installed_test_desc = files('../../build-aux/gen-installed-test-desc.py')
++gen_installed_test_shscript = files('../../build-aux/gen-installed-test-shscript.py')
++
+ foreach t : core_tests
+ fname = t[0]
+ test_name = fname.split('.')[0].underscorify()
+@@ -150,8 +164,38 @@ foreach t : core_tests
+ include_directories : [configinc],
+ link_with : link_with_libs,
+ dependencies : test_deps + glib_deps + gst_deps,
++ install_dir: installed_tests_execdir,
++ install: installed_tests_enabled
+ )
+
++ if installed_tests_enabled
++ installed_test_shscript = test_name + '.sh'
++ shscript = custom_target (test_name + '_shscript',
++ output: installed_test_shscript,
++ command: [
++ python,
++ gen_installed_test_shscript,
++ '--test-execdir=@0@'.format(installed_tests_execdir),
++ '--testname=@0@'.format(test_name),
++ '--output=@0@'.format(join_paths('@OUTDIR@', installed_test_shscript)),
++ ],
++ install: true,
++ install_dir: installed_tests_execdir)
++
++ installed_test_desc = test_name + '.test'
++ data = custom_target(test_name + '_desc',
++ output: installed_test_desc,
++ command: [
++ python,
++ gen_installed_test_desc,
++ '--test-execdir=@0@'.format(installed_tests_execdir),
++ '--testname=@0@'.format(installed_test_shscript),
++ '--output=@0@'.format(join_paths('@OUTDIR@', installed_test_desc)),
++ ],
++ install: true,
++ install_dir: installed_tests_datadir)
++ endif
++
+ env = environment()
+ env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
+ env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
+diff --git a/tests/files/testfile b/tests/files/testfile
+new file mode 100644
+index 0000000..89954e0
+--- /dev/null
++++ b/tests/files/testfile
+@@ -0,0 +1,80 @@
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
++................................................................................
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
new file mode 100644
index 00000000..7ca3d5ad
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
@@ -0,0 +1,37 @@
+Currently gstreamer configuration depends on whether setcap is found on the host
+system. Turn this into a configure option to make builds deterinistic.
+
+RP 2020/2/19
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Upstream-Status: Pending
+
+Index: gstreamer-1.16.1/libs/gst/helpers/meson.build
+===================================================================
+--- gstreamer-1.16.1.orig/libs/gst/helpers/meson.build
++++ gstreamer-1.16.1/libs/gst/helpers/meson.build
+@@ -73,7 +73,12 @@ if have_ptp
+ endif
+ endif
+
+- setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
++ setcap_feature = get_option('setcap')
++ if setcap_feature.disabled()
++ setcap = find_program('dontexist', required : false)
++ else
++ setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
++ endif
+
+ # user/group to change to in gst-ptp-helper
+ ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
+Index: gstreamer-1.16.1/meson_options.txt
+===================================================================
+--- gstreamer-1.16.1.orig/meson_options.txt
++++ gstreamer-1.16.1/meson_options.txt
+@@ -26,6 +26,7 @@ option('libunwind', type : 'feature', va
+ option('libdw', type : 'feature', value : 'auto', description : 'Use libdw to generate better backtraces from libunwind')
+ option('dbghelp', type : 'feature', value : 'auto', description : 'Use dbghelp to generate backtraces')
+ option('bash-completion', type : 'feature', value : 'auto', description : 'Install bash completion files')
++option('setcap', type : 'feature', value : 'auto', description : 'Use setcap')
+
+ # Common feature options
+ option('examples', type : 'feature', value : 'auto', yield : true)
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.14.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.14.imx.bb
deleted file mode 100644
index 30a6c03a..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.14.imx.bb
+++ /dev/null
@@ -1,76 +0,0 @@
-SUMMARY = "GStreamer 1.0 multimedia framework"
-DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \
-It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime."
-HOMEPAGE = "http://gstreamer.freedesktop.org/"
-BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
-SECTION = "multimedia"
-LICENSE = "LGPLv2+"
-
-DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native elfutils"
-
-inherit autotools pkgconfig gettext upstream-version-is-even gobject-introspection gtk-doc
-
-# This way common/m4/introspection.m4 will come first
-# (it has a custom INTROSPECTION_INIT macro, and so must be used instead of our common introspection.m4 file)
-acpaths = "-I ${S}/common/m4 -I ${S}/m4"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
- file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
-
-# Use i.MX fork of GST for customizations
-GST1.0_SRC ?= "gitsm://source.codeaurora.org/external/imx/gstreamer.git;protocol=https"
-SRCBRANCH = "MM_04.04.02_1808_L4.9.123_MX8MM_GA"
-
-SRC_URI = " \
- ${GST1.0_SRC};branch=${SRCBRANCH} \
- file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
- file://gtk-doc-tweaks.patch \
- file://0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch \
-"
-SRCREV = "f4e127a5e9a1eb977e023532d6636d939c8ccbc8"
-
-DEFAULT_PREFERENCE = "-1"
-
-EXTRA_AUTORECONF = ""
-
-PACKAGECONFIG ??= ""
-
-PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
-PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
-PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
-PACKAGECONFIG[gst-tracer-hooks] = "--enable-gst-tracer-hooks,--disable-gst-tracer-hooks,"
-
-EXTRA_OECONF = " \
- --disable-dependency-tracking \
- --disable-examples \
-"
-
-CACHED_CONFIGUREVARS += "ac_cv_header_valgrind_valgrind_h=no"
-
-# musl libc generates warnings if <sys/poll.h> is included directly
-CACHED_CONFIGUREVARS += "ac_cv_header_sys_poll_h=no"
-
-PACKAGES += "${PN}-bash-completion"
-
-FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
-FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la ${libdir}/gstreamer-1.0/*.a ${libdir}/gstreamer-1.0/include"
-FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions/ ${datadir}/bash-completion/helpers/gst*"
-
-RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
-RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
-
-delete_pkg_m4_file() {
- # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
- rm "${S}/common/m4/pkg.m4" || true
- rm -f "${S}/common/m4/gtk-doc.m4"
-}
-
-do_configure[prefuncs] += "delete_pkg_m4_file"
-
-do_compile_prepend() {
- export GIR_EXTRA_LIBS_PATH="${B}/gst/.libs:${B}/libs/gst/base/.libs"
-}
-
-S = "${WORKDIR}/git"
-
-COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.16.imx.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.16.imx.bb
new file mode 100644
index 00000000..f344db2d
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/gstreamer1.0_1.16.imx.bb
@@ -0,0 +1,84 @@
+SUMMARY = "GStreamer 1.0 multimedia framework"
+DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \
+It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime."
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
+SECTION = "multimedia"
+LICENSE = "LGPLv2+"
+
+DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native"
+
+inherit meson pkgconfig gettext upstream-version-is-even gobject-introspection gtk-doc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+ file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
+
+# Use i.MX fork of GST for customizations
+GST1.0_SRC ?= "gitsm://source.codeaurora.org/external/imx/gstreamer.git;protocol=https"
+SRCBRANCH = "MM_04.05.03_1911_L5.4.0"
+
+SRC_URI = " \
+ ${GST1.0_SRC};branch=${SRCBRANCH} \
+ file://0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch \
+ file://0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch \
+ file://0003-meson-Add-valgrind-feature.patch \
+ file://0004-meson-Add-option-for-installed-tests.patch \
+ file://capfix.patch \
+"
+SRCREV = "a4c220605ac0923596b89f4f07c05d235bc09259"
+
+S = "${WORKDIR}/git"
+
+DEFAULT_PREFERENCE = "-1"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
+ check \
+ debug \
+ tools"
+
+PACKAGECONFIG[debug] = "-Dgst_debug=true,-Dgst_debug=false"
+PACKAGECONFIG[tracer-hooks] = "-Dtracer_hooks=true,-Dtracer_hooks=false"
+PACKAGECONFIG[check] = "-Dcheck=enabled,-Dcheck=disabled"
+PACKAGECONFIG[tests] = "-Dtests=enabled -Dinstalled-tests=true,-Dtests=disabled -Dinstalled-tests=false"
+PACKAGECONFIG[valgrind] = "-Dvalgrind=enabled,-Dvalgrind=disabled,valgrind,"
+PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
+PACKAGECONFIG[dw] = "-Dlibdw=enabled,-Dlibdw=disabled,elfutils"
+PACKAGECONFIG[bash-completion] = "-Dbash-completion=enabled,-Dbash-completion=disabled,bash-completion"
+PACKAGECONFIG[tools] = "-Dtools=enabled,-Dtools=disabled"
+PACKAGECONFIG[setcap] = "-Dsetcap=enabled,-Dsetcap=disabled,libcap libcap-native"
+
+# TODO: put this in a gettext.bbclass patch
+def gettext_oemeson(d):
+ if d.getVar('USE_NLS') == 'no':
+ return '-Dnls=disabled'
+ # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
+ if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
+ return '-Dnls=disabled'
+ return '-Dnls=enabled'
+
+EXTRA_OEMESON += " \
+ -Dexamples=disabled \
+ -Ddbghelp=disabled \
+ ${@gettext_oemeson(d)} \
+"
+
+GTKDOC_MESON_OPTION = "gtk_doc"
+GTKDOC_MESON_ENABLE_FLAG = "enabled"
+GTKDOC_MESON_DISABLE_FLAG = "disabled"
+
+GIR_MESON_ENABLE_FLAG = "enabled"
+GIR_MESON_DISABLE_FLAG = "disabled"
+
+PACKAGES += "${PN}-bash-completion"
+
+# Add the core element plugins to the main package
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.a ${libdir}/gstreamer-1.0/include"
+FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions/ ${datadir}/bash-completion/helpers/gst*"
+FILES_${PN}-dbg += "${datadir}/gdb ${datadir}/gstreamer-1.0/gdb ${datadir}/glib-2.0/gdb"
+
+CVE_PRODUCT = "gstreamer"
+
+require recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin/0001-imx-gst1.0-plugin-Fix-ion.h-header-inclusion-to-be-s.patch b/bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin/0001-imx-gst1.0-plugin-Fix-ion.h-header-inclusion-to-be-s.patch
deleted file mode 100644
index 4e861a5d..00000000
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin/0001-imx-gst1.0-plugin-Fix-ion.h-header-inclusion-to-be-s.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From e4c96421700ecd008814bceceaf03f0ee9323c02 Mon Sep 17 00:00:00 2001
-From: Yuqing Zhu <carol.zhu@nxp.com>
-Date: Thu, 27 Sep 2018 16:00:55 +0800
-Subject: [PATCH] imx-gst1.0-plugin: Fix ion.h header inclusion to be standard
-
-NXP "solution" was to manually copy the header to include/linux.
-Let's point the Makefile to the proper (mainline) location instead:
-https://elixir.bootlin.com/linux/v4.17/source/drivers/staging/android/uapi/ion.h
-
-Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
----
- configure.ac | 2 +-
- libs/gstimxcommon.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 7b2709d..d94e3a8 100755
---- a/configure.ac
-+++ b/configure.ac
-@@ -216,7 +216,7 @@ dnl check ion allocator headfile
- old_CFLAGS=$CFLAGS
- PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= 1.14, CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gstreamer-allocators-1.0`",\
- CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gstreamer-bad-allocators-1.0`")
--AC_CHECK_HEADERS([linux/ion.h gst/allocators/gstionmemory.h], HAVE_ION="yes", HAVE_ION="no")
-+AC_CHECK_HEADERS([ion.h gst/allocators/gstionmemory.h], HAVE_ION="yes", HAVE_ION="no")
- AM_CONDITIONAL(USE_ION, test "x$HAVE_ION" = "xyes")
- CFLAGS=$old_CFLAGS
-
-diff --git a/libs/gstimxcommon.c b/libs/gstimxcommon.c
-index eb808b9..c02ab5f 100644
---- a/libs/gstimxcommon.c
-+++ b/libs/gstimxcommon.c
-@@ -26,7 +26,7 @@
- #include <linux/version.h>
- #include <linux/dma-buf.h>
- #ifdef USE_ION
--#include <linux/ion.h>
-+#include <ion.h>
- #endif
- const char *dev_ion = "/dev/ion";
-
---
-1.9.1
-
diff --git a/bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.4.2.bb b/bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.5.3.bb
index 986d4a1d..4e244715 100644
--- a/bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.4.2.bb
+++ b/bsp/meta-freescale/recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.5.3.bb
@@ -21,10 +21,10 @@ LIC_FILES_CHKSUM = "file://COPYING-LGPL-2;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
file://COPYING-LGPL-2.1;md5=fbc093901857fcd118f065f900982c24"
IMXGST_SRC ?= "git://source.codeaurora.org/external/imx/imx-gst1.0-plugin.git;protocol=https"
-SRCBRANCH = "MM_04.04.02_1808_L4.9.123_MX8MM_GA"
+SRCBRANCH = "MM_04.05.03_1911_L5.4.0"
SRC_URI = "${IMXGST_SRC};branch=${SRCBRANCH}"
-SRCREV = "23dd0315c7087e1c8eba836b9a458d7906187c7e"
+SRCREV = "190b80c50aa06d2fe32423f6e36d76374bb530b2"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-multimedia/imx-codec/imx-codec_4.4.2.bb b/bsp/meta-freescale/recipes-multimedia/imx-codec/imx-codec_4.5.3.bb
index 60a3717e..e41469f3 100644
--- a/bsp/meta-freescale/recipes-multimedia/imx-codec/imx-codec_4.4.2.bb
+++ b/bsp/meta-freescale/recipes-multimedia/imx-codec/imx-codec_4.5.3.bb
@@ -5,14 +5,14 @@
DESCRIPTION = "Freescale Multimedia codec libs"
LICENSE = "Proprietary"
SECTION = "multimedia"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd4b227530cd88a82af6a5982cfb724d"
# Backward compatibility
PROVIDES += "libfslcodec"
-SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
-SRC_URI[md5sum] = "6087fbac97002b7d8c5dd061e6b36417"
-SRC_URI[sha256sum] = "f225968d8efcdb8f1843adae162360df04166e91acea2c32388cf699f410bdda"
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
+SRC_URI[md5sum] = "a0413b390a473aee862806dd25a4a366"
+SRC_URI[sha256sum] = "ecaecb4afb646efad9a81d67a1a5e50a9e06ed49fa8ea947064465a085b2c578"
inherit fsl-eula-unpack autotools pkgconfig
@@ -23,27 +23,27 @@ EXTRA_OECONF = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--enable-armv8
PACKAGECONFIG ?= ""
PACKAGECONFIG_imxvpu = "vpu"
+# We need to ensure we don't have '-src' package overrided
+PACKAGE_DEBUG_SPLIT_STYLE = 'debug-without-src'
+
PACKAGECONFIG[vpu] = "--enable-vpu,--disable-vpu,virtual/imxvpu"
do_install_append() {
- # FIXME: This link points to nowhere
- if [ -e ${D}${libdir}/imx-mm/audio-codec/lib_src_ppp_arm11_elinux.so ]; then
- rm ${D}${libdir}/imx-mm/audio-codec/lib_src_ppp_arm11_elinux.so
- fi
-
# LTIB move the files around or gst-fsl-plugin won't find them
for p in $(find ${D}${libdir}/imx-mm -mindepth 2 -maxdepth 2 -not -type d); do
mv $p ${D}${libdir}
done
rmdir ${D}${libdir}/imx-mm/video-codec
+ # Fixup ownership of files
+ chown -R root:root ${D}
}
python __set_insane_skip() {
# Ensure we have PACKAGES expanded
bb.build.exec_func("read_subpackage_metadata", d)
- for p in d.getVar('PACKAGES', True).split():
+ for p in d.getVar('PACKAGES').split():
# Even though we are packaging libraries those are plugins so we
# shouldn't rename the packages to follow its sonames.
d.setVar("DEBIAN_NOAUTONAME_%s" % p, "1")
@@ -66,7 +66,7 @@ python __split_libfslcodec_plugins() {
output_pattern='imx-codec-%s',
description='Freescale i.MX Codec (%s)',
extra_depends='')
- pkgs = d.getVar('PACKAGES', True).split()
+ pkgs = d.getVar('PACKAGES').split()
for pkg in pkgs:
meta = pkg[10:]
if meta != '':
diff --git a/bsp/meta-freescale/recipes-multimedia/imx-dspc-asrc/imx-dspc-asrc_1.0.1.bb b/bsp/meta-freescale/recipes-multimedia/imx-dspc-asrc/imx-dspc-asrc_1.0.1.bb
new file mode 100644
index 00000000..d9fd8458
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/imx-dspc-asrc/imx-dspc-asrc_1.0.1.bb
@@ -0,0 +1,22 @@
+# Copyright 2019 NXP
+DESCRIPTION = "NXP Asynchronous Sample Rate Converter"
+LICENSE = "Proprietary"
+SECTION = "multimedia"
+LIC_FILES_CHKSUM = "file://COPYING;md5=72c0f70181bb6e83eee6aab8de12a9f3"
+
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
+
+SRC_URI[md5sum] = "d46005ee29ca603caa2e1b1e82953ff1"
+SRC_URI[sha256sum] = "e79cbf4788a86a0068bbe80c37317e3332ae76e3d5c3ff2eabd71f03121fab6a"
+
+inherit fsl-eula-unpack autotools pkgconfig
+
+EXTRA_OECONF = "--enable-armv8 --libdir=${libdir} --bindir=/unit_tests"
+
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_SYSROOT_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+FILES_${PN} += "/unit_tests ${datadir}/imx-mm"
+
+COMPATIBLE_MACHINE = "(mx8)"
diff --git a/bsp/meta-freescale/recipes-multimedia/imx-parser/imx-parser_4.4.2.bb b/bsp/meta-freescale/recipes-multimedia/imx-parser/imx-parser_4.5.3.bb
index 492ab893..ee0243dd 100644
--- a/bsp/meta-freescale/recipes-multimedia/imx-parser/imx-parser_4.4.2.bb
+++ b/bsp/meta-freescale/recipes-multimedia/imx-parser/imx-parser_4.5.3.bb
@@ -1,11 +1,11 @@
# Copyright (C) 2012-2018 O.S. Systems Software LTDA.
# Copyright (C) 2012-2016 Freescale Semiconductor
-# Copyright 2017 NXP
+# Copyright 2017, 2019 NXP
# Released under the MIT license (see COPYING.MIT for the terms)
DESCRIPTION = "Freescale Multimedia parser libs"
LICENSE = "Proprietary"
SECTION = "multimedia"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd4b227530cd88a82af6a5982cfb724d"
# For backwards compatibility
PROVIDES += "libfslparser"
@@ -13,9 +13,9 @@ RREPLACES_${PN} = "libfslparser"
RPROVIDES_${PN} = "libfslparser"
RCONFLICTS_${PN} = "libfslparser"
-SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
-SRC_URI[md5sum] = "0e425e143900f980c6fe7f735a679829"
-SRC_URI[sha256sum] = "21d1066dcdc6f0eb7efc56910ee9b116883456a013837506a0632153baedcbf3"
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
+SRC_URI[md5sum] = "9659678b1a07a14558d55ed7e23e04d3"
+SRC_URI[sha256sum] = "c6cb8a06acad73f50052d18cda02be729616218472f93974390622d6acea768e"
inherit fsl-eula-unpack autotools pkgconfig
@@ -30,7 +30,7 @@ python __set_insane_skip() {
# FIXME: All binaries lack GNU_HASH in elf binary but as we don't have
# the source we cannot fix it. Disable the insane check for now.
# FIXME: gst-fsl-plugin looks for the .so files so we need to deploy those
- for p in d.getVar('PACKAGES', True).split():
+ for p in d.getVar('PACKAGES').split():
d.setVar("INSANE_SKIP_%s" % p, "ldflags dev-so textrel")
}
diff --git a/bsp/meta-freescale/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_4.4.2.bb b/bsp/meta-freescale/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_4.5.3.bb
index c23c7fc9..3dcfcef8 100644
--- a/bsp/meta-freescale/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_4.4.2.bb
+++ b/bsp/meta-freescale/recipes-multimedia/imx-vpuwrap/imx-vpuwrap_4.5.3.bb
@@ -1,12 +1,12 @@
# Copyright (C) 2013-2016 Freescale Semiconductor
-# Copyright 2017 NXP
# Copyright 2018 (C) O.S. Systems Software LTDA.
+# Copyright 2017, 2019 NXP
# Released under the MIT license (see COPYING.MIT for the terms)
DESCRIPTION = "Freescale Multimedia VPU wrapper"
DEPENDS = "virtual/imxvpu"
LICENSE = "Proprietary"
SECTION = "multimedia"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5ab1a30d0cd181e3408077727ea5a2db"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd4b227530cd88a82af6a5982cfb724d"
# For backwards compatibility
PROVIDES += "libfslvpuwrap"
@@ -14,10 +14,10 @@ RREPLACES_${PN} = "libfslvpuwrap"
RPROVIDES_${PN} = "libfslvpuwrap"
RCONFLICTS_${PN} = "libfslvpuwrap"
-SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
+SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true"
-SRC_URI[md5sum] = "86d1829ef62ab51e187479bfea686874"
-SRC_URI[sha256sum] = "85f01ebdf55e4bd7a7cc21eb5203dfcaa7b663f03ecdb8d5e54fbb995e3dc761"
+SRC_URI[md5sum] = "41515584410b9e9a75d0880b51af5d76"
+SRC_URI[sha256sum] = "b2a7297afc9c5e1caebc1f3b7b4755430f595241d283c61cd0a3ba13dcf5c82b"
inherit fsl-eula-unpack autotools pkgconfig
diff --git a/bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.0.1.bb b/bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.0.1.bb
new file mode 100644
index 00000000..9a4497d8
--- /dev/null
+++ b/bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi2_2.0.1.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "frontend for the i.MX6 / i.MX8 VPU hardware video engines"
+HOMEPAGE = "https://github.com/Freescale/libimxvpuapi"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=38fa42a5a6425b26d2919b17b1527324"
+SECTION = "multimedia"
+DEPENDS = "virtual/imxvpu libimxdmabuffer"
+
+PV .= "+git${SRCPV}"
+
+SRCBRANCH ?= "master"
+SRCREV = "9a5e84af53e6765c4f0ea299df264a4e32a13ea7"
+SRC_URI = "git://github.com/Freescale/libimxvpuapi.git;branch=${SRCBRANCH}"
+
+S = "${WORKDIR}/git"
+
+inherit waf pkgconfig use-imx-headers
+
+IMX_PLATFORM_mx6 = "imx6"
+IMX_PLATFORM_mx8mq = "imx8m"
+IMX_PLATFORM_mx8mm = "imx8mm"
+
+EXTRA_OECONF = "--imx-platform=${IMX_PLATFORM} --libdir=${libdir} --imx-headers=${STAGING_INCDIR_IMX} --sysroot-path=${RECIPE_SYSROOT}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE = "(imxvpu)"
diff --git a/bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi_git.bb b/bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi_git.bb
index 540565f6..2d0f8571 100644
--- a/bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi_git.bb
+++ b/bsp/meta-freescale/recipes-multimedia/libimxvpuapi/libimxvpuapi_git.bb
@@ -8,8 +8,8 @@ DEPENDS = "imx-vpu"
PV = "0.10.3+${SRCPV}"
-SRCBRANCH ?= "master"
-SRCREV = "4afb52f97e28c731c903a8538bf99e4a6d155b42"
+SRCBRANCH ?= "v1"
+SRCREV = "3a1ee3a54fe93813868d38c3d32ea065b59e227e"
SRC_URI = "git://github.com/Freescale/libimxvpuapi.git;branch=${SRCBRANCH}"
S = "${WORKDIR}/git"
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch
new file mode 100644
index 00000000..86c360f2
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch
@@ -0,0 +1,54 @@
+From 6a600c5637c5446ab3d11eb4304a1dd473ec503e Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.z@gmail.com>
+Date: Thu, 4 Jun 2020 19:24:05 +0000
+Subject: [PATCH] flags: do not override CFLAGS from host
+
+Some build systems set CFLAGS in environment before the build, but they
+got overridden by CFLAGS immediate assignment operator.
+
+Replace immediate assignment with append directive and use override
+directive, so the former definition of CFLAGS gets passed either from
+command line or via environment is completely expanded (see [1] for
+detailed explanation of override directive and variable append).
+
+Link: [1] https://www.gnu.org/software/make/manual/html_node/Override-Directive.html
+
+Upstream-Status: Backport [https://github.com/OP-TEE/optee_client/pull/211]
+
+Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
+Reviewed-by: Jerome Forissier <jerome@forissier.org>
+Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
+---
+ flags.mk | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/flags.mk b/flags.mk
+index 71f3d18..faabef9 100644
+--- a/flags.mk
++++ b/flags.mk
+@@ -6,7 +6,7 @@ CROSS_COMPILE ?= arm-linux-gnueabihf-
+ CC ?= $(CROSS_COMPILE)gcc
+ AR ?= $(CROSS_COMPILE)ar
+
+-CFLAGS := -Wall -Wbad-function-cast -Wcast-align \
++override CFLAGS += -Wall -Wbad-function-cast -Wcast-align \
+ -Werror-implicit-function-declaration -Wextra \
+ -Wfloat-equal -Wformat-nonliteral -Wformat-security \
+ -Wformat=2 -Winit-self -Wmissing-declarations \
+@@ -15,11 +15,11 @@ CFLAGS := -Wall -Wbad-function-cast -Wcast-align \
+ -Wpointer-arith -Wshadow -Wstrict-prototypes \
+ -Wswitch-default -Wunsafe-loop-optimizations \
+ -Wwrite-strings -Werror
+-CFLAGS += -c -fPIC
++override CFLAGS += -c -fPIC
+
+ DEBUG ?= 0
+ ifeq ($(DEBUG), 1)
+-CFLAGS += -DDEBUG -O0 -g
++override CFLAGS += -DDEBUG -O0 -g
+ endif
+
+ RM := rm -f
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-client/tee-supplicant.service b/bsp/meta-freescale/recipes-security/optee-imx/optee-client/tee-supplicant.service
new file mode 100644
index 00000000..0e2b4f6b
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-client/tee-supplicant.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=TEE Supplicant
+
+[Service]
+User=root
+EnvironmentFile=-/etc/default/tee-supplicant
+ExecStart=/usr/bin/tee-supplicant $OPTARGS
+
+[Install]
+WantedBy=basic.target
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-client_3.2.0.imx.bb b/bsp/meta-freescale/recipes-security/optee-imx/optee-client_3.2.0.imx.bb
new file mode 100644
index 00000000..19770849
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-client_3.2.0.imx.bb
@@ -0,0 +1,52 @@
+# Copyright (C) 2017-2018 NXP
+
+SUMMARY = "OPTEE Client libs"
+HOMEPAGE = "http://www.optee.org/"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b"
+
+inherit python3native systemd
+
+SRCBRANCH = "lf-5.4.y"
+OPTEE_CLIENT_SRC ?= "git://source.codeaurora.org/external/imx/imx-optee-client.git;protocol=https"
+SRC_URI = "${OPTEE_CLIENT_SRC};branch=${SRCBRANCH}"
+
+SRCREV = "71a9bef78fff2d5d4db8a2307d3b91e2aa671dc9"
+
+SRC_URI += "file://tee-supplicant.service \
+ file://0001-flags-do-not-override-CFLAGS-from-host.patch \
+"
+
+S = "${WORKDIR}/git"
+SYSTEMD_SERVICE_${PN} = "tee-supplicant.service"
+
+OPTEE_ARCH ?= "arm32"
+OPTEE_ARCH_armv7a = "arm32"
+OPTEE_ARCH_aarch64 = "arm64"
+
+EXTRA_OEMAKE = "ARCH=${OPTEE_ARCH}"
+
+do_install () {
+ oe_runmake install
+
+ install -D -p -m0644 ${S}/out/export/lib/libteec.so.1.0 ${D}${libdir}/libteec.so.1.0
+ ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so
+ ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so.1
+
+ install -D -p -m0755 ${S}/out/export/bin/tee-supplicant ${D}${bindir}/tee-supplicant
+
+ cp -a ${S}/out/export/include ${D}/usr/
+
+ sed -i -e s:/etc:${sysconfdir}:g -e s:/usr/bin:${bindir}:g ${WORKDIR}/tee-supplicant.service
+ install -D -p -m0644 ${WORKDIR}/tee-supplicant.service ${D}${systemd_system_unitdir}/tee-supplicant.service
+}
+
+PACKAGES += "tee-supplicant"
+FILES_${PN} += "${libdir}/* ${includedir}/*"
+FILES_tee-supplicant += "${bindir}/tee-supplicant"
+
+INSANE_SKIP_${PN} = "ldflags dev-elf"
+INSANE_SKIP_${PN}-dev = "ldflags dev-elf"
+INSANE_SKIP_tee-supplicant = "ldflags"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch
new file mode 100644
index 00000000..509c7fb6
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch
@@ -0,0 +1,158 @@
+From 027a3b9a33fbb23e1d1d7ed6411d4d112d2a55a1 Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.z@gmail.com>
+Date: Sat, 30 May 2020 22:00:59 +0000
+Subject: [PATCH] optee-os: fix gcc10 compilation issue and missing cc-options
+
+Backport PR 3891 from upstream to imx fork, which addressed compilation
+failure when GCC10 is used.
+
+Additional changes ported fixed cc-options macro, which allows to query
+compiler used if the desired option exists before it could be set. This
+solves also the build issues when GCC9 is used to build this component.
+
+Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/3891]
+
+Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
+---
+ core/arch/arm/arm.mk | 21 ++++++++++++++++-----
+ core/core.mk | 5 +----
+ mk/cc-option.mk | 9 +++++++++
+ mk/gcc.mk | 2 +-
+ ta/mk/ta_dev_kit.mk | 3 +++
+ ta/ta.mk | 1 +
+ 6 files changed, 31 insertions(+), 10 deletions(-)
+ create mode 100644 mk/cc-option.mk
+
+diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
+index aa101be8..4123d85d 100644
+--- a/core/arch/arm/arm.mk
++++ b/core/arch/arm/arm.mk
+@@ -1,3 +1,16 @@
++# Setup compiler for the core module
++ifeq ($(CFG_ARM64_core),y)
++arch-bits-core := 64
++else
++arch-bits-core := 32
++endif
++CROSS_COMPILE_core := $(CROSS_COMPILE$(arch-bits-core))
++COMPILER_core := $(COMPILER)
++include mk/$(COMPILER_core).mk
++
++# Defines the cc-option macro using the compiler set for the core module
++include mk/cc-option.mk
++
+ CFG_LTC_OPTEE_THREAD ?= y
+ # Size of emulated TrustZone protected SRAM, 448 kB.
+ # Only applicable when paging is enabled.
+@@ -88,7 +101,7 @@ arm32-platform-aflags-no-hard-float ?=
+
+ arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
+ arm64-platform-cflags-hard-float ?=
+-arm64-platform-cflags-generic ?= -mstrict-align
++arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,)
+
+ ifeq ($(DEBUG),1)
+ # For backwards compatibility
+@@ -117,14 +130,12 @@ core-platform-aflags += $(platform-aflags-generic)
+ core-platform-aflags += $(platform-aflags-debug-info)
+
+ ifeq ($(CFG_ARM64_core),y)
+-arch-bits-core := 64
+ core-platform-cppflags += $(arm64-platform-cppflags)
+ core-platform-cflags += $(arm64-platform-cflags)
+ core-platform-cflags += $(arm64-platform-cflags-generic)
+ core-platform-cflags += $(arm64-platform-cflags-no-hard-float)
+ core-platform-aflags += $(arm64-platform-aflags)
+ else
+-arch-bits-core := 32
+ core-platform-cppflags += $(arm32-platform-cppflags)
+ core-platform-cflags += $(arm32-platform-cflags)
+ core-platform-cflags += $(arm32-platform-cflags-no-hard-float)
+@@ -196,5 +207,5 @@ ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE64 ?= $$(CROSS_COMPILE)_nl_
+ ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE_ta_arm64 ?= $$(CROSS_COMPILE64)_nl_
+ endif
+
+-# Set cross compiler prefix for each submodule
+-$(foreach sm, core $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm)))))
++# Set cross compiler prefix for each TA target
++$(foreach sm, $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm)))))
+diff --git a/core/core.mk b/core/core.mk
+index c05815f3..68f45552 100644
+--- a/core/core.mk
++++ b/core/core.mk
+@@ -8,6 +8,7 @@ arch-dir := core/arch/$(ARCH)
+ platform-dir := $(arch-dir)/plat-$(PLATFORM)
+ include $(platform-dir)/conf.mk
+ include mk/config.mk
++# $(ARCH).mk also sets the compiler for the core module
+ include core/arch/$(ARCH)/$(ARCH).mk
+
+ PLATFORM_$(PLATFORM) := y
+@@ -16,10 +17,6 @@ PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y
+ $(call cfg-depends-all,CFG_PAGED_USER_TA,CFG_WITH_PAGER CFG_WITH_USER_TA)
+ include core/crypto.mk
+
+-# Setup compiler for this sub module
+-COMPILER_$(sm) ?= $(COMPILER)
+-include mk/$(COMPILER_$(sm)).mk
+-
+ cppflags$(sm) += -D__KERNEL__
+
+ cppflags$(sm) += -Icore/include
+diff --git a/mk/cc-option.mk b/mk/cc-option.mk
+new file mode 100644
+index 00000000..4699fbcc
+--- /dev/null
++++ b/mk/cc-option.mk
+@@ -0,0 +1,9 @@
++_cc-option-supported = $(if $(shell $(CC$(sm)) $(1) -c -x c /dev/null -o /dev/null 2>/dev/null >/dev/null || echo "Not supported"),,1)
++_cc-opt-cached-var-name = $(subst =,~,$(strip cached-cc-option-$(1)-$(subst $(empty) $(empty),,$(CC$(sm)))))
++define _cc-option
++$(eval _var_name := $(call _cc-opt-cached-var-name,$(1)))
++$(eval $(_var_name) := $(if $(filter $(origin $(_var_name)),undefined),$(call _cc-option-supported,$(1)),$($(_var_name))))
++$(if $($(_var_name)),$(1),$(2))
++endef
++cc-option = $(strip $(call _cc-option,$(1),$(2)))
++
+diff --git a/mk/gcc.mk b/mk/gcc.mk
+index 1f2c5990..c53a23b1 100644
+--- a/mk/gcc.mk
++++ b/mk/gcc.mk
+@@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \
+ -print-file-name=include 2> /dev/null)
+
+ # Get location of libgcc from gcc
+-libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \
++libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \
+ -print-libgcc-file-name 2> /dev/null)
+
+ # Define these to something to discover accidental use
+diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
+index fa0bddfe..ae70ef87 100644
+--- a/ta/mk/ta_dev_kit.mk
++++ b/ta/mk/ta_dev_kit.mk
+@@ -78,6 +78,9 @@ clean:
+ @$(cmd-echo-silent) ' CLEAN $(O)'
+ ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi
+
++include $(ta-dev-kit-dir$(sm))/mk/$(COMPILER_$(sm)).mk
++include $(ta-dev-kit-dir$(sm))/mk/cc-option.mk
++
+ subdirs = .
+ include $(ta-dev-kit-dir)/mk/subdir.mk
+
+diff --git a/ta/ta.mk b/ta/ta.mk
+index 32353de3..9c64319d 100644
+--- a/ta/ta.mk
++++ b/ta/ta.mk
+@@ -98,6 +98,7 @@ $(foreach f, $(libfiles), \
+
+ # Copy .mk files
+ ta-mkfiles = mk/compile.mk mk/subdir.mk mk/gcc.mk mk/cleandirs.mk \
++ mk/cc-option.mk \
+ ta/arch/$(ARCH)/link.mk ta/arch/$(ARCH)/link_shlib.mk \
+ ta/mk/ta_dev_kit.mk
+
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch
new file mode 100644
index 00000000..9621cf6c
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-os/0001-scripts-update-scripts-to-use-python3.patch
@@ -0,0 +1,427 @@
+From 0d4941123b5a88351f5954f6de00892f85ed5abc Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+Date: Mon, 20 Jan 2020 22:32:13 +0000
+Subject: [PATCH] scripts: update scripts to use python3
+
+Python2 is deprecated effective Jan. 2020, and is not available in
+several distributions.
+
+Update scripts here to re-target then onto python version 3.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ scripts/gen_hashed_bin.py | 282 ++++++++++++++++++++------------------
+ scripts/gen_ld_sects.py | 8 +-
+ scripts/pem_to_pub_c.py | 2 +-
+ scripts/sign.py | 2 +-
+ scripts/symbolize.py | 2 +-
+ scripts/ta_bin_to_c.py | 2 +-
+ scripts/tee_bin_parser.py | 2 +-
+ 7 files changed, 157 insertions(+), 143 deletions(-)
+
+diff --git a/scripts/gen_hashed_bin.py b/scripts/gen_hashed_bin.py
+index 32350a47..a76a62cc 100755
+--- a/scripts/gen_hashed_bin.py
++++ b/scripts/gen_hashed_bin.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2014-2017, Linaro Limited
+@@ -14,163 +14,177 @@ import hashlib
+ arch_id = {'arm32': 0, 'arm64': 1}
+ image_id = {'pager': 0, 'paged': 1}
+
++
+ def write_header_v1(outf, init_size, args, paged_size):
+- magic = 0x4554504f # 'OPTE'
+- version = 1;
+- outf.write(struct.pack('<IBBHIIIII', \
+- magic, version, arch_id[args.arch], args.flags, init_size, \
+- args.init_load_addr_hi, args.init_load_addr_lo, \
+- args.init_mem_usage, paged_size))
++ magic = 0x4554504f # 'OPTE'
++ version = 1
++ outf.write(struct.pack('<IBBHIIIII',
++ magic,
++ version,
++ arch_id[args.arch],
++ args.flags,
++ init_size,
++ args.init_load_addr_hi,
++ args.init_load_addr_lo,
++ args.init_mem_usage,
++ paged_size))
++
+
+ def write_header_v2(outf, init_size, args, paged_size):
+- magic = 0x4554504f # 'OPTE'
+- version = 2
+- nb_images = 1 if paged_size == 0 else 2
+- outf.write(struct.pack('<IBBHI', \
+- magic, version, arch_id[args.arch], args.flags, nb_images))
+- outf.write(struct.pack('<IIII', \
+- args.init_load_addr_hi, args.init_load_addr_lo, \
+- image_id['pager'], init_size))
+- if nb_images == 2:
+- outf.write(struct.pack('<IIII', \
+- 0xffffffff, 0xffffffff, image_id['paged'], paged_size))
++ magic = 0x4554504f # 'OPTE'
++ version = 2
++ nb_images = 1 if paged_size == 0 else 2
++ outf.write(struct.pack('<IBBHI', magic, version,
++ arch_id[args.arch], args.flags, nb_images))
++ outf.write(struct.pack('<IIII',
++ args.init_load_addr_hi, args.init_load_addr_lo,
++ image_id['pager'], init_size))
++ if nb_images == 2:
++ outf.write(
++ struct.pack(
++ '<IIII',
++ 0xffffffff,
++ 0xffffffff,
++ image_id['paged'],
++ paged_size))
++
+
+ def append_to(outf, start_offs, in_fname, max_bytes=0xffffffff):
+- #print "Appending %s@0x%x 0x%x bytes at position 0x%x" % \
+- #( in_fname, start_offs, max_bytes, int(outf.tell()) )
+- inf = open(in_fname, 'rb');
+- inf.seek(start_offs)
+- while True :
+- nbytes = min(16 * 1024, max_bytes)
+- if nbytes == 0 :
+- break
+- #print "Reading %s %d bytes" % (in_fname, nbytes)
+- buf = inf.read(nbytes)
+- if not buf :
+- break
+- outf.write(buf)
+- max_bytes -= len(buf)
+- inf.close()
++ inf = open(in_fname, 'rb')
++ inf.seek(start_offs)
++ while True:
++ nbytes = min(16 * 1024, max_bytes)
++ if nbytes == 0:
++ break
++ buf = inf.read(nbytes)
++ if not buf:
++ break
++ outf.write(buf)
++ max_bytes -= len(buf)
++ inf.close()
++
+
+ def append_hashes(outf, in_fname):
+- page_size = 4 * 1024
+-
+- inf = open(in_fname, 'r')
+- while True :
+- page = inf.read(page_size)
+- if len(page) == page_size :
+- #print "Writing hash at position 0x%x" % \
+- #int(outf.tell())
+- outf.write(hashlib.sha256(page).digest())
+- elif len(page) == 0 :
+- break
+- else :
+- print("Error: short read, got " + repr(len(page)))
+- sys.exit(1)
+-
+- inf.close()
++ page_size = 4 * 1024
++
++ inf = open(in_fname, 'rb')
++ while True:
++ page = inf.read(page_size)
++ if len(page) == page_size:
++ outf.write(hashlib.sha256(page).digest())
++ elif len(page) == 0:
++ break
++ else:
++ print("Error: short read, got {}".format(len(page)))
++ sys.exit(1)
++
++ inf.close()
++
+
+ def int_parse(str):
+- return int(str, 0)
++ return int(str, 0)
++
+
+ def get_args():
+- parser = argparse.ArgumentParser()
+- parser.add_argument('--arch', required=True, \
+- choices=arch_id.keys(), \
+- help='Architecture')
++ parser = argparse.ArgumentParser()
++ parser.add_argument('--arch', required=True,
++ choices=list(arch_id.keys()),
++ help='Architecture')
+
+- parser.add_argument('--flags', \
+- type=int, default=0, \
+- help='Flags, currently none defined')
++ parser.add_argument('--flags',
++ type=int, default=0,
++ help='Flags, currently none defined')
+
+- parser.add_argument('--init_size', \
+- required=True, type=int_parse, \
+- help='Size of initialization part of binary')
++ parser.add_argument('--init_size',
++ required=True, type=int_parse,
++ help='Size of initialization part of binary')
+
+- parser.add_argument('--init_load_addr_hi', \
+- type=int_parse, default=0, \
+- help='Upper 32 bits of load address of binary')
++ parser.add_argument('--init_load_addr_hi',
++ type=int_parse, default=0,
++ help='Upper 32 bits of load address of binary')
+
+- parser.add_argument('--init_load_addr_lo', \
+- required=True, type=int_parse, \
+- help='Lower 32 bits of load address of binary')
++ parser.add_argument('--init_load_addr_lo',
++ required=True, type=int_parse,
++ help='Lower 32 bits of load address of binary')
+
+- parser.add_argument('--init_mem_usage', \
+- required=True, type=int_parse, \
+- help='Total amount of used memory when initializing');
++ parser.add_argument('--init_mem_usage',
++ required=True, type=int_parse,
++ help='Total amount of used memory when initializing')
+
+- parser.add_argument('--tee_pager_bin', \
+- required=True, \
+- help='The input tee_pager.bin')
++ parser.add_argument('--tee_pager_bin',
++ required=True,
++ help='The input tee_pager.bin')
+
+- parser.add_argument('--tee_pageable_bin', \
+- required=True, \
+- help='The input tee_pageable.bin')
++ parser.add_argument('--tee_pageable_bin',
++ required=True,
++ help='The input tee_pageable.bin')
+
+- parser.add_argument('--out', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee.bin')
++ parser.add_argument('--out',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee.bin')
+
+- parser.add_argument('--out_header_v2', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee_header_v2.bin')
++ parser.add_argument('--out_header_v2',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee_header_v2.bin')
+
+- parser.add_argument('--out_pager_v2', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee_pager_v2.bin')
++ parser.add_argument('--out_pager_v2',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee_pager_v2.bin')
+
+- parser.add_argument('--out_pageable_v2', \
+- required=False, type=argparse.FileType('wb'), \
+- help='The output tee_pageable_v2.bin')
++ parser.add_argument('--out_pageable_v2',
++ required=False, type=argparse.FileType('wb'),
++ help='The output tee_pageable_v2.bin')
++
++ return parser.parse_args()
+
+- return parser.parse_args();
+
+ def main():
+- args = get_args()
+- init_bin_size = args.init_size
+- tee_pager_fname = args.tee_pager_bin
+- tee_pageable_fname = args.tee_pageable_bin
+- pager_input_size = os.path.getsize(tee_pager_fname);
+- paged_input_size = os.path.getsize(tee_pageable_fname);
+- hash_size = paged_input_size / (4 * 1024) * \
+- hashlib.sha256().digest_size
+-
+- if paged_input_size % (4 * 1024) != 0:
+- print("Error: pageable size not a multiple of 4K:" + \
+- repr(paged_input_size))
+- sys.exit(1)
+-
+- init_size = pager_input_size + \
+- min(init_bin_size, paged_input_size) + \
+- hash_size
+- paged_size = paged_input_size - \
+- min(init_bin_size, paged_input_size)
+-
+- if args.out is not None:
+- outf = args.out
+- write_header_v1(outf, init_size, args, paged_size)
+- append_to(outf, 0, tee_pager_fname)
+- append_to(outf, 0, tee_pageable_fname, init_bin_size)
+- append_hashes(outf, tee_pageable_fname)
+- append_to(outf, init_bin_size, tee_pageable_fname)
+- outf.close()
+-
+- if args.out_header_v2 is not None:
+- outf = args.out_header_v2
+- write_header_v2(outf, init_size, args, paged_size)
+- outf.close()
+-
+- if args.out_pager_v2 is not None:
+- outf = args.out_pager_v2
+- append_to(outf, 0, tee_pager_fname)
+- append_to(outf, 0, tee_pageable_fname, init_bin_size)
+- append_hashes(outf, tee_pageable_fname)
+- outf.close()
+-
+- if args.out_pageable_v2 is not None:
+- outf = args.out_pageable_v2
+- append_to(outf, init_bin_size, tee_pageable_fname)
+- outf.close()
++ args = get_args()
++ init_bin_size = args.init_size
++ tee_pager_fname = args.tee_pager_bin
++ tee_pageable_fname = args.tee_pageable_bin
++ pager_input_size = os.path.getsize(tee_pager_fname)
++ paged_input_size = os.path.getsize(tee_pageable_fname)
++ hash_size = paged_input_size // (4 * 1024) * \
++ hashlib.sha256().digest_size
++
++ if paged_input_size % (4 * 1024) != 0:
++ print("Error: pageable size not a multiple of 4K: {}".format(
++ paged_input_size))
++ sys.exit(1)
++
++ init_size = pager_input_size + \
++ min(init_bin_size, paged_input_size) + \
++ hash_size
++ paged_size = paged_input_size - \
++ min(init_bin_size, paged_input_size)
++
++ if args.out is not None:
++ outf = args.out
++ write_header_v1(outf, init_size, args, paged_size)
++ append_to(outf, 0, tee_pager_fname)
++ append_to(outf, 0, tee_pageable_fname, init_bin_size)
++ append_hashes(outf, tee_pageable_fname)
++ append_to(outf, init_bin_size, tee_pageable_fname)
++ outf.close()
++
++ if args.out_header_v2 is not None:
++ outf = args.out_header_v2
++ write_header_v2(outf, init_size, args, paged_size)
++ outf.close()
++
++ if args.out_pager_v2 is not None:
++ outf = args.out_pager_v2
++ append_to(outf, 0, tee_pager_fname)
++ append_to(outf, 0, tee_pageable_fname, init_bin_size)
++ append_hashes(outf, tee_pageable_fname)
++ outf.close()
++
++ if args.out_pageable_v2 is not None:
++ outf = args.out_pageable_v2
++ append_to(outf, init_bin_size, tee_pageable_fname)
++ outf.close()
++
+
+ if __name__ == "__main__":
+- main()
++ main()
+diff --git a/scripts/gen_ld_sects.py b/scripts/gen_ld_sects.py
+index c5dc3a7b..2bdbb192 100755
+--- a/scripts/gen_ld_sects.py
++++ b/scripts/gen_ld_sects.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+@@ -8,8 +8,8 @@ import sys
+ import re
+
+ def usage():
+- print "Usage: {0} <section reg exp match> [<skip section>...]".format( \
+- sys.argv[0])
++ print("Usage: {0} <section reg exp match> [<skip section>...]".format( \
++ sys.argv[0]))
+ sys.exit (1)
+
+ def main():
+@@ -55,7 +55,7 @@ def main():
+ if sect_name in skip_sections :
+ continue
+
+- print '\t*({0})'.format(sect_name)
++ print ('\t*({0})'.format(sect_name))
+
+ if __name__ == "__main__":
+ main()
+diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py
+index 6b8fa365..0b03d62e 100755
+--- a/scripts/pem_to_pub_c.py
++++ b/scripts/pem_to_pub_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2015, Linaro Limited
+diff --git a/scripts/sign.py b/scripts/sign.py
+index ad47479b..348b40a2 100755
+--- a/scripts/sign.py
++++ b/scripts/sign.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2015, 2017, Linaro Limited
+ #
+diff --git a/scripts/symbolize.py b/scripts/symbolize.py
+index 1eecf758..0e9bd3ed 100755
+--- a/scripts/symbolize.py
++++ b/scripts/symbolize.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+diff --git a/scripts/ta_bin_to_c.py b/scripts/ta_bin_to_c.py
+index cabddbbd..f325fda0 100755
+--- a/scripts/ta_bin_to_c.py
++++ b/scripts/ta_bin_to_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+diff --git a/scripts/tee_bin_parser.py b/scripts/tee_bin_parser.py
+index 5f7dd3f0..07da5791 100755
+--- a/scripts/tee_bin_parser.py
++++ b/scripts/tee_bin_parser.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2016, Linaro Limited
+--
+2.17.1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-os_3.2.0.imx.bb b/bsp/meta-freescale/recipes-security/optee-imx/optee-os_3.2.0.imx.bb
new file mode 100644
index 00000000..d2c82940
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-os_3.2.0.imx.bb
@@ -0,0 +1,96 @@
+# Copyright (C) 2017-2018 NXP
+
+SUMMARY = "OPTEE OS"
+DESCRIPTION = "OPTEE OS"
+HOMEPAGE = "http://www.optee.org/"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b"
+
+inherit deploy python3native autotools
+DEPENDS = "python3-pycrypto-native u-boot-mkimage-native"
+
+SRCBRANCH = "lf-5.4.y"
+OPTEE_OS_SRC ?= "git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https"
+SRC_URI = "\
+ ${OPTEE_OS_SRC};branch=${SRCBRANCH} \
+ file://0001-scripts-update-scripts-to-use-python3.patch \
+ file://0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch \
+"
+
+SRCREV = "6d99b525af752ecdaabdca6098b2564b2665f2b2"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build.${PLATFORM_FLAVOR}"
+
+# The platform flavor corresponds to the Yocto machine without the leading 'i'.
+PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}"
+PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd"
+PLATFORM_FLAVOR_imx6ul7d = "mx6ulevk"
+PLATFORM_FLAVOR_imx6ull14x14evk = "mx6ullevk"
+PLATFORM_FLAVOR_imx6ull9x9evk = "mx6ullevk"
+PLATFORM_FLAVOR_imx6ulz14x14evk = "mx6ulzevk"
+PLATFORM_FLAVOR_mx8mm = "mx8mmevk"
+PLATFORM_FLAVOR_mx8mn = "mx8mnevk"
+PLATFORM_FLAVOR_mx8qxp = "mx8qxpmek"
+
+OPTEE_ARCH ?= "arm32"
+OPTEE_ARCH_armv7a = "arm32"
+OPTEE_ARCH_aarch64 = "arm64"
+
+# Optee-os can be built for 32 bits and 64 bits at the same time
+# as long as the compilers are correctly defined.
+# For 64bits, CROSS_COMPILE64 must be set
+# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
+# any 32 or 64 bits builds will pass
+EXTRA_OEMAKE = "PLATFORM=imx PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \
+ CROSS_COMPILE=${HOST_PREFIX} \
+ CROSS_COMPILE64=${HOST_PREFIX} \
+ NOWERROR=1 \
+ LDFLAGS= \
+ O=${B} \
+ "
+
+
+do_compile () {
+ unset LDFLAGS
+ export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
+ oe_runmake -C ${S} all CFG_TEE_TA_LOG_LEVEL=0
+}
+
+
+do_deploy () {
+ install -d ${DEPLOYDIR}
+ ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin
+
+ if [ "${OPTEE_ARCH}" != "arm64" ]; then
+ IMX_LOAD_ADDR=`cat ${B}/core/tee-init_load_addr.txt` && \
+ uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \
+ -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT}
+ fi
+
+ cd ${DEPLOYDIR}
+ ln -sf tee.${PLATFORM_FLAVOR}.bin tee.bin
+ cd -
+}
+
+do_install () {
+ install -d ${D}${nonarch_base_libdir}/firmware/
+ install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
+
+ # Install the TA devkit
+ install -d ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
+
+ for f in ${B}/export-ta_${OPTEE_ARCH}/*; do
+ cp -aR $f ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
+ done
+}
+
+addtask deploy after do_compile before do_install
+
+
+FILES_${PN} = "${nonarch_base_libdir}/firmware/"
+FILES_${PN}-staticdev = "/usr/include/optee/"
+RDEPENDS_${PN}-dev += "${PN}-staticdev"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE = "(imx)"
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch
new file mode 100644
index 00000000..20f190af
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch
@@ -0,0 +1,48 @@
+From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001
+From: Scott Branden <scott.branden@broadcom.com>
+Date: Fri, 27 Dec 2019 12:54:28 -0800
+Subject: [PATCH] use python3 instead of python
+
+use python3 instead of python as python2 is EOL January 2020.
+
+Signed-off-by: Scott Branden <scott.branden@broadcom.com>
+Reviewed-by: Jerome Forissier <jerome@forissier.org>
+Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, CFG_GCM_NIST_VECTORS=y)
+Upstream-Status: Backport from v3.8.0
+---
+ scripts/file_to_c.py | 4 ++--
+ scripts/rsp_to_gcm_test.py | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py
+index ae16f52..b4ce2a2 100755
+--- a/scripts/file_to_c.py
++++ b/scripts/file_to_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2018, Linaro Limited
+@@ -29,7 +29,7 @@ def main():
+
+ f.write("const uint8_t " + args.name + "[] = {\n")
+ i = 0
+- for x in array.array("B", inf.read()):
++ for x in array.array("B", map(ord, (inf.read()))):
+ f.write("0x" + '{0:02x}'.format(x) + ",")
+ i = i + 1
+ if i % 8 == 0:
+diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py
+index 0543541..e4418be 100755
+--- a/scripts/rsp_to_gcm_test.py
++++ b/scripts/rsp_to_gcm_test.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ modes = {'encrypt': 0, 'decrypt': 1}
+
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch
new file mode 100644
index 00000000..d32a8eb7
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch
@@ -0,0 +1,41 @@
+From dc8cd1c43edeedb9f7335020537c4ffdddd683f8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
+Date: Thu, 7 Feb 2019 01:26:53 +0000
+Subject: [PATCH 1/3] sock_server: fix compilation against musl (sys/errno.h)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compiling against musl-libc fails with the following error:
+
+| In file included from .../host/xtest/sock_server.c:24:
+| .../usr/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp]
+| #warning redirecting incorrect #include <sys/errno.h> to <errno.h>
+| ^~~~~~~
+
+Just remove the needless include.
+
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
+Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
+---
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Upstream-Status: Backport [3.5.0]
+ host/xtest/sock_server.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/host/xtest/sock_server.c b/host/xtest/sock_server.c
+index 0d2ff06..1ba73d6 100644
+--- a/host/xtest/sock_server.c
++++ b/host/xtest/sock_server.c
+@@ -21,7 +21,6 @@
+ #include <netdb.h>
+ #include <netinet/in.h>
+ #include <poll.h>
+-#include <sys/errno.h>
+ #include <sys/socket.h>
+ #include <unistd.h>
+
+--
+2.23.0.rc1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch
new file mode 100644
index 00000000..ed45df60
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch
@@ -0,0 +1,62 @@
+From 1401b89684ee81bf0b3d3dea06e2926b24ba3f97 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
+Date: Thu, 7 Feb 2019 01:29:08 +0000
+Subject: [PATCH 2/3] build: ignore declaration-after-statement warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| Makefile:37: recipe for target 'xtest' failed
+| make: *** [xtest] Error 2
+| make: *** Waiting for unfinished jobs....
+| arith_taf.c: In function 'get_handle':
+| arith_taf.c:56:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
+| int h = handle_get(&hdb, ptr);
+| ^~~
+| arith_taf.c: In function 'ta_entry_arith_new_var':
+| arith_taf.c:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
+| size_t len = TEE_BigIntSizeInU32(params[0].value.a);
+| ^~~~~~
+| arith_taf.c: In function 'ta_entry_arith_new_fmm_var':
+| arith_taf.c:129:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
+| size_t len = TEE_BigIntFMMSizeInU32(params[0].value.a);
+| ^~~~~~
+| arith_taf.c: In function 'ta_entry_arith_free_handle':
+| arith_taf.c:150:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
+| void *ptr = put_handle(params[0].value.a & ~HT_MASK);
+| ^~~~
+| arith_taf.c: In function 'ta_entry_arith_from_octet_string':
+| arith_taf.c:165:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
+| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a);
+| ^~~~~~~~~~
+| arith_taf.c: In function 'ta_entry_arith_from_s32':
+| arith_taf.c:181:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
+| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a);
+| ^~~~~~~~~~
+
+etc.
+
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
+Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
+---
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Upstream-Status: Backport [3.5.0]
+ host/xtest/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/host/xtest/Makefile b/host/xtest/Makefile
+index f4291e0..e97e555 100644
+--- a/host/xtest/Makefile
++++ b/host/xtest/Makefile
+@@ -154,6 +154,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
+ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
+ -Wshadow -Wstrict-prototypes -Wswitch-default \
+ -Wwrite-strings \
++ -Wno-declaration-after-statement \
+ -Wno-missing-field-initializers -Wno-format-zero-length
+ endif
+
+--
+2.23.0.rc1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch
new file mode 100644
index 00000000..58734aa4
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch
@@ -0,0 +1,57 @@
+From f74e9f339a8e8cb97fc8ea03bef51d7e3862a60a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
+Date: Thu, 7 Feb 2019 01:31:27 +0000
+Subject: [PATCH 3/3] benchmark_1000: fix compilation against musl (uint)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compiling against musl-libc fails with the following error:
+
+| .../host/xtest/benchmark_1000.c: In function 'show_test_result':
+| .../host/xtest/benchmark_1000.c:102:2: error: unknown type name 'uint'; did you mean 'int'?
+| uint i;
+| ^~~~
+| int
+| ...host/xtest/benchmark_1000.c:108:16: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare]
+| for (i = 0; i < size; i++) {
+| ^
+
+etc.
+
+Convert to using more standard size_t
+
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
+Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
+---
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Upstream-Status: Backport [3.5.0]
+ host/xtest/benchmark_1000.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/host/xtest/benchmark_1000.c b/host/xtest/benchmark_1000.c
+index bf92fa0..1caf420 100644
+--- a/host/xtest/benchmark_1000.c
++++ b/host/xtest/benchmark_1000.c
+@@ -99,7 +99,7 @@ static TEEC_Result run_chunk_access_test(enum storage_benchmark_cmd cmd,
+
+ static void show_test_result(struct test_record records[], size_t size)
+ {
+- uint i;
++ size_t i;
+
+ printf("-----------------+---------------+----------------\n");
+ printf(" Data Size (B) \t | Time (s)\t | Speed (kB/s)\t \n");
+@@ -119,7 +119,7 @@ static void chunk_test(ADBG_Case_t *c, enum storage_benchmark_cmd cmd)
+ {
+ uint32_t chunk_size = DEFAULT_CHUNK_SIZE;
+ struct test_record records[ARRAY_SIZE(data_size_table) - 1];
+- uint i;
++ size_t i;
+
+ for (i = 0; data_size_table[i]; i++) {
+ ADBG_EXPECT_TEEC_SUCCESS(c,
+--
+2.23.0.rc1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch
new file mode 100644
index 00000000..1a5c4044
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch
@@ -0,0 +1,88 @@
+From 7d566ed585d1e13f444d48fde5705b5be54de4af Mon Sep 17 00:00:00 2001
+From: Ricardo Salveti <ricardo@foundries.io>
+Date: Wed, 26 Jun 2019 17:32:11 -0300
+Subject: [PATCH] regression_8100: use null terminated strings with file_to_c
+
+GCC 9 is more strict with string manipulation, causing the build to
+fail as the string data converted via file_to_c is not null terminated,
+as described by the following build error:
+
+regression_8100.c:100:29: error: '%*s' directive argument is not a
+nul-terminated string [-Werror=format-overflow=]
+tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt),
+ ^~~
+ regression_8100_ca_crt);
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+Change file_to_c to terminate the string after conversion and update the
+string size to remove the null terminated byte. Also update
+regression_8100 to use the size variable defined via file_to_c instead
+of manually calling sizeof.
+
+Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
+Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
+---
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Upstream-Status: Backport [3.6.0]
+ host/xtest/regression_8100.c | 10 +++++-----
+ scripts/file_to_c.py | 4 ++--
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/host/xtest/regression_8100.c b/host/xtest/regression_8100.c
+index 04d62d9..13780e1 100644
+--- a/host/xtest/regression_8100.c
++++ b/host/xtest/regression_8100.c
+@@ -91,13 +91,13 @@ static void test_8102(ADBG_Case_t *c)
+ return;
+
+ clen = myasprintf(&chain, "%*s\n%*s",
+- (int)sizeof(regression_8100_my_crt),
++ (int)regression_8100_my_crt_size,
+ regression_8100_my_crt,
+- (int)sizeof(regression_8100_mid_crt),
++ (int)regression_8100_mid_crt_size,
+ regression_8100_mid_crt);
+ if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, !=, -1))
+ goto out;
+- tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt),
++ tlen = myasprintf(&trust, "%*s", (int)regression_8100_ca_crt_size,
+ regression_8100_ca_crt);
+ if (!ADBG_EXPECT_COMPARE_SIGNED(c, tlen, !=, -1))
+ goto out;
+@@ -282,7 +282,7 @@ static void test_8103(ADBG_Case_t *c)
+ NULL, &ret_orig)))
+ return;
+
+- clen = myasprintf(&csr, "%*s", (int)sizeof(regression_8100_my_csr),
++ clen = myasprintf(&csr, "%*s", (int)regression_8100_my_csr_size,
+ regression_8100_my_csr);
+ if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, >=, 0))
+ goto out;
+@@ -300,7 +300,7 @@ static void test_8103(ADBG_Case_t *c)
+ if (!ADBG_EXPECT_TEEC_SUCCESS(c, res))
+ goto out;
+
+- myasprintf(&ca, "%*s", (int)sizeof(regression_8100_ca_crt),
++ myasprintf(&ca, "%*s", (int)regression_8100_ca_crt_size,
+ regression_8100_ca_crt);
+ if (!ADBG_EXPECT_NOT_NULL(c, ca))
+ goto out;
+diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py
+index 83a9832..ae16f52 100755
+--- a/scripts/file_to_c.py
++++ b/scripts/file_to_c.py
+@@ -37,9 +37,9 @@ def main():
+ else:
+ f.write(" ")
+
+- f.write("};\n")
++ f.write("'\\0'};\n")
+ f.write("const size_t " + args.name + "_size = sizeof(" +
+- args.name + ");\n")
++ args.name + ") - 1;\n")
+
+ f.close()
+ inf.close()
+--
+2.23.0.rc1
+
diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-test_3.2.0.imx.bb b/bsp/meta-freescale/recipes-security/optee-imx/optee-test_3.2.0.imx.bb
new file mode 100644
index 00000000..c78f9816
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-test_3.2.0.imx.bb
@@ -0,0 +1,58 @@
+# Copyright (C) 2017-2018 NXP
+
+SUMMARY = "OPTEE test"
+HOMEPAGE = "http://www.optee.org/"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
+
+DEPENDS = "optee-os optee-client python3-pycrypto-native openssl"
+inherit python3native
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRCBRANCH = "lf-5.4.y"
+OPTEE_TEST_SRC ?= "git://source.codeaurora.org/external/imx/imx-optee-test.git;protocol=https"
+
+SRC_URI = "${OPTEE_TEST_SRC};branch=${SRCBRANCH} \
+ file://0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch \
+ file://0004-build-ignore-declaration-after-statement-warnings.patch \
+ file://0005-benchmark_1000-fix-compilation-against-musl-uint.patch \
+ file://0006-regression_8100-use-null-terminated-strings-with-fil.patch \
+ file://0001-use-python3-instead-of-python.patch \
+"
+
+S = "${WORKDIR}/git"
+
+SRCREV = "b7114b828b82f2c0eec124ed424eff1230cc5319"
+
+OPTEE_ARCH ?= "arm32"
+OPTEE_ARCH_armv7a = "arm32"
+OPTEE_ARCH_aarch64 = "arm64"
+
+do_compile () {
+ export TA_DEV_KIT_DIR=${STAGING_INCDIR}/optee/export-user_ta_${OPTEE_ARCH}/
+ export ARCH=${OPTEE_ARCH}
+
+ export OPTEE_CLIENT_EXPORT=${STAGING_DIR_HOST}/usr
+ export CROSS_COMPILE_HOST=${HOST_PREFIX}
+ export CROSS_COMPILE_TA=${HOST_PREFIX}
+ export CROSS_COMPILE=${HOST_PREFIX}
+ export OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}/
+ oe_runmake V=1 --warn-undefined-variables
+}
+
+do_install () {
+ install -d ${D}/usr/bin
+ install ${S}/out/xtest/xtest ${D}/usr/bin/
+
+ install -d ${D}/lib/optee_armtz
+ find ${S}/out/ta -name '*.ta' | while read name; do
+ install -m 444 $name ${D}/lib/optee_armtz/
+ done
+
+}
+
+FILES_${PN} = "/usr/bin/ /lib*/optee_armtz/"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-client-qoriq.bb b/bsp/meta-freescale/recipes-security/optee/optee-client-qoriq.bb
index 6aaf714c..af5fc095 100644
--- a/bsp/meta-freescale/recipes-security/optee/optee-client-qoriq.bb
+++ b/bsp/meta-freescale/recipes-security/optee/optee-client-qoriq.bb
@@ -4,15 +4,13 @@ HOMEPAGE = "https://github.com/qoriq-open-source/optee_client"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
-inherit pythonnative systemd
+inherit python3native systemd
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_client;nobranch=1 \
- file://0001-GCC-8-format-truncation-error.patch \
- file://0001-flags-CFLAGS-add-Wno-cpp.patch \
"
S = "${WORKDIR}/git"
-SRCREV = "ab3c79ccd3ea9323e236d30037977c0a19944dbd"
+SRCREV = "08428734c67fb559e420d87fa52fd74a955ea1bd"
EXTRA_OEMAKE = "ARCH=arm64"
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch b/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch
new file mode 100644
index 00000000..e22bd6c0
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch
@@ -0,0 +1,148 @@
+From b2dd8747125be413f9b8b7fd7e52f457cabd709c Mon Sep 17 00:00:00 2001
+From: Jens Wiklander <jens.wiklander@linaro.org>
+Date: Tue, 5 Feb 2019 13:05:29 +0100
+Subject: [PATCH] Fix alignment of data for mempool_alloc_pool()
+
+Upstream-Status: Submitted
+
+Prior to this patch was _TEE_MathAPI_Init() in
+lib/libutee/tee_api_arith_mpi.c supplying a data buffer which was only 4
+byte aligned while mempool_alloc_pool() requires the alignment of long.
+This will work in 32-bit mode, but could lead to alignment problem in
+64-bit mode. The same problem can happen with
+lib/libutee/tee_api_arith_mpa.c, but so far it has remained hidden.
+
+Incorrect alignment can result in errors like:
+E/TA: assertion '!((vaddr_t)data & (POOL_ALIGN - 1))' failed at lib/libutils/ext/mempool.c:134 in mempool_alloc_pool()
+
+This fix introduces MEMPOOL_ALIGN which specifies required alignment of
+data supplied to mempool_alloc_pool().
+
+Fixes: 062e3d01c039 ("ta: switch to to mbedtls for bignum")
+Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
+Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU v8)
+Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
+Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
+---
+ core/lib/libtomcrypt/src/mpa_desc.c | 2 +-
+ core/lib/libtomcrypt/src/mpi_desc.c | 2 +-
+ lib/libutee/tee_api_arith_mpa.c | 3 ++-
+ lib/libutee/tee_api_arith_mpi.c | 3 +--
+ lib/libutils/ext/include/mempool.h | 5 ++++-
+ lib/libutils/ext/mempool.c | 9 ++++-----
+ 6 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/core/lib/libtomcrypt/src/mpa_desc.c b/core/lib/libtomcrypt/src/mpa_desc.c
+index b407f54..58aa242 100644
+--- a/core/lib/libtomcrypt/src/mpa_desc.c
++++ b/core/lib/libtomcrypt/src/mpa_desc.c
+@@ -40,7 +40,7 @@ static struct mempool *get_mpa_scratch_memory_pool(void)
+ #else /* CFG_WITH_PAGER */
+ static struct mempool *get_mpa_scratch_memory_pool(void)
+ {
+- static uint32_t data[LTC_MEMPOOL_U32_SIZE] __aligned(__alignof__(long));
++ static uint32_t data[LTC_MEMPOOL_U32_SIZE] __aligned(MEMPOOL_ALIGN);
+
+ return mempool_alloc_pool(data, sizeof(data), NULL);
+ }
+diff --git a/core/lib/libtomcrypt/src/mpi_desc.c b/core/lib/libtomcrypt/src/mpi_desc.c
+index a43fbb4..67bc3a7 100644
+--- a/core/lib/libtomcrypt/src/mpi_desc.c
++++ b/core/lib/libtomcrypt/src/mpi_desc.c
+@@ -38,7 +38,7 @@ static struct mempool *get_mp_scratch_memory_pool(void)
+ #else /* CFG_WITH_PAGER */
+ static struct mempool *get_mp_scratch_memory_pool(void)
+ {
+- static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(__alignof__(long));
++ static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(MEMPOOL_ALIGN);
+
+ return mempool_alloc_pool(data, sizeof(data), NULL);
+ }
+diff --git a/lib/libutee/tee_api_arith_mpa.c b/lib/libutee/tee_api_arith_mpa.c
+index 0f6c7f1..a8ca6aa 100644
+--- a/lib/libutee/tee_api_arith_mpa.c
++++ b/lib/libutee/tee_api_arith_mpa.c
+@@ -19,7 +19,8 @@
+
+ static uint32_t mempool_u32[mpa_scratch_mem_size_in_U32(
+ MPA_INTERNAL_MEM_POOL_SIZE,
+- CFG_TA_BIGNUM_MAX_BITS)];
++ CFG_TA_BIGNUM_MAX_BITS)]
++ __aligned(MEMPOOL_ALIGN);
+ static mpa_scratch_mem mempool;
+
+ /*************************************************************
+diff --git a/lib/libutee/tee_api_arith_mpi.c b/lib/libutee/tee_api_arith_mpi.c
+index 8e2751b..6b074e1 100644
+--- a/lib/libutee/tee_api_arith_mpi.c
++++ b/lib/libutee/tee_api_arith_mpi.c
+@@ -42,8 +42,7 @@ static void __noreturn mpi_panic(const char *func, int line, int rc)
+
+ void _TEE_MathAPI_Init(void)
+ {
+- static uint8_t data[MPI_MEMPOOL_SIZE]
+- __aligned(__alignof__(mbedtls_mpi_uint));
++ static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(MEMPOOL_ALIGN);
+
+ mbedtls_mpi_mempool = mempool_alloc_pool(data, sizeof(data), NULL);
+ if (!mbedtls_mpi_mempool)
+diff --git a/lib/libutils/ext/include/mempool.h b/lib/libutils/ext/include/mempool.h
+index 62377df..2a60800 100644
+--- a/lib/libutils/ext/include/mempool.h
++++ b/lib/libutils/ext/include/mempool.h
+@@ -19,9 +19,12 @@ struct mempool_item {
+
+ struct mempool;
+
++#define MEMPOOL_ALIGN __alignof__(long)
++
+ /*
+ * mempool_alloc_pool() - Allocate a new memory pool
+- * @data: a block of memory to carve out items from
++ * @data: a block of memory to carve out items from, must
++ * have an alignment of MEMPOOL_ALIGN.
+ * @size: size fo the block of memory
+ * @release_mem: function to call when the pool has been emptied,
+ * ignored if NULL.
+diff --git a/lib/libutils/ext/mempool.c b/lib/libutils/ext/mempool.c
+index f977699..6d38590 100644
+--- a/lib/libutils/ext/mempool.c
++++ b/lib/libutils/ext/mempool.c
+@@ -53,7 +53,6 @@
+ * So the potential fragmentation is mitigated.
+ */
+
+-#define POOL_ALIGN __alignof__(long)
+
+ struct mempool {
+ size_t size; /* size of the memory pool, in bytes */
+@@ -130,8 +129,8 @@ mempool_alloc_pool(void *data, size_t size,
+ {
+ struct mempool *pool = calloc(1, sizeof(*pool));
+
+- COMPILE_TIME_ASSERT(POOL_ALIGN >= __alignof__(struct mempool_item));
+- assert(!((vaddr_t)data & (POOL_ALIGN - 1)));
++ COMPILE_TIME_ASSERT(MEMPOOL_ALIGN >= __alignof__(struct mempool_item));
++ assert(!((vaddr_t)data & (MEMPOOL_ALIGN - 1)));
+
+ if (pool) {
+ pool->size = size;
+@@ -163,13 +162,13 @@ void *mempool_alloc(struct mempool *pool, size_t size)
+ pool->last_offset);
+ offset = pool->last_offset + last_item->size;
+
+- offset = ROUNDUP(offset, POOL_ALIGN);
++ offset = ROUNDUP(offset, MEMPOOL_ALIGN);
+ if (offset > pool->size)
+ goto error;
+ }
+
+ size = sizeof(struct mempool_item) + size;
+- size = ROUNDUP(size, POOL_ALIGN);
++ size = ROUNDUP(size, MEMPOOL_ALIGN);
+ if (offset + size > pool->size)
+ goto error;
+
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch b/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch
new file mode 100644
index 00000000..6ecc6152
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch
@@ -0,0 +1,80 @@
+diff --git a/scripts/arm32_sysreg.py b/scripts/arm32_sysreg.py
+index bd0c619e..530b0f44 100755
+--- a/scripts/arm32_sysreg.py
++++ b/scripts/arm32_sysreg.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2018, Linaro Limited
+diff --git a/scripts/gen_hashed_bin.py b/scripts/gen_hashed_bin.py
+index 67b2b049..619cf26e 100755
+--- a/scripts/gen_hashed_bin.py
++++ b/scripts/gen_hashed_bin.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2014-2017, Linaro Limited
+diff --git a/scripts/gen_ld_sects.py b/scripts/gen_ld_sects.py
+index 43e812b5..bc82dd8b 100755
+--- a/scripts/gen_ld_sects.py
++++ b/scripts/gen_ld_sects.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py
+index ddc17c18..69a4355c 100755
+--- a/scripts/pem_to_pub_c.py
++++ b/scripts/pem_to_pub_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2015, Linaro Limited
+diff --git a/scripts/sign.py b/scripts/sign.py
+index 84fd7714..f6e6b667 100755
+--- a/scripts/sign.py
++++ b/scripts/sign.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2015, 2017, Linaro Limited
+ #
+diff --git a/scripts/symbolize.py b/scripts/symbolize.py
+index 99a48c70..cbd9884a 100755
+--- a/scripts/symbolize.py
++++ b/scripts/symbolize.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+diff --git a/scripts/ta_bin_to_c.py b/scripts/ta_bin_to_c.py
+index 1496f816..a01e7f9b 100755
+--- a/scripts/ta_bin_to_c.py
++++ b/scripts/ta_bin_to_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2017, Linaro Limited
+diff --git a/scripts/tee_bin_parser.py b/scripts/tee_bin_parser.py
+index 8356ad5d..4409074b 100755
+--- a/scripts/tee_bin_parser.py
++++ b/scripts/tee_bin_parser.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2016, Linaro Limited
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq_git.bb b/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq_git.bb
index c8ebe2bf..6ffe8298 100644
--- a/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq_git.bb
+++ b/bsp/meta-freescale/recipes-security/optee/optee-os-qoriq_git.bb
@@ -4,17 +4,21 @@ DESCRIPTION = "OPTEE OS"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
-DEPENDS = "python-pycrypto-native"
+DEPENDS = "python3-pycrypto-native"
-inherit deploy pythonnative
+inherit deploy python3native
-SRCREV = "e93f053213c574ec1b97f9e56b2f31692cd3723c"
+SRCREV = "4e8d2e5307b99a91a0cac3ea3560ecb7d62898d6"
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os;nobranch=1 \
file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \
+ file://0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch \
+ file://0001-use-python3-instead-of-python.patch \
"
S = "${WORKDIR}/git"
OPTEEMACHINE ?= "${MACHINE}"
+OPTEEMACHINE_ls1088ardb-pb = "ls1088ardb"
+OPTEEMACHINE_ls1046afrwy = "ls1046ardb"
EXTRA_OEMAKE = "PLATFORM=ls-${OPTEEMACHINE} CFG_ARM64_core=y \
ARCH=arm \
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-8.patch b/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-8.patch
deleted file mode 100644
index bad7c5e0..00000000
--- a/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-8.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From d877fddcef79e856193b9b0a3a3089c22151047f Mon Sep 17 00:00:00 2001
-From: Chunrong Guo <chunrong.guo@nxp.com>
-Date: Fri, 29 Jun 2018 15:49:34 +0800
-Subject: [PATCH] fix build failure with GCC 8
-
-Signed-off-by: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com>
----
- host/xtest/Makefile | 2 ++
- host/xtest/adbg/src/adbg_run.c | 2 +-
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/host/xtest/Makefile b/host/xtest/Makefile
-index 832cba2..d95899d 100644
---- a/host/xtest/Makefile
-+++ b/host/xtest/Makefile
-@@ -139,6 +139,8 @@ CFLAGS += -Wall -Wcast-align -Werror \
- -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
- -Wshadow -Wstrict-prototypes -Wswitch-default \
- -Wwrite-strings \
-+ -Wno-stringop-overflow \
-+ -Wno-array-bounds \
- -Wno-missing-field-initializers -Wno-format-zero-length
- endif
-
-diff --git a/host/xtest/adbg/src/adbg_run.c b/host/xtest/adbg/src/adbg_run.c
-index 406e429..3b57bbb 100644
---- a/host/xtest/adbg/src/adbg_run.c
-+++ b/host/xtest/adbg/src/adbg_run.c
-@@ -100,7 +100,7 @@ int Do_ADBG_AppendToSuite(
- snprintf(p, size, "%s+%s", Dest_p->SuiteID_p,
- Source_p->SuiteID_p);
- else
-- strncpy(p, Source_p->SuiteID_p, size);
-+ memcpy(p, Source_p->SuiteID_p, size);
- free((void *)Dest_p->SuiteID_p);
- Dest_p->SuiteID_p = p;
-
---
-1.8.3.1
-
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-9.patch b/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-9.patch
new file mode 100644
index 00000000..9b912777
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-fix-build-failure-with-GCC-9.patch
@@ -0,0 +1,28 @@
+From 79330c8383e02e91a355964a3cc7b932d03c2517 Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <chunrong.guo@nxp.com>
+Date: Wed, 10 Jul 2019 11:09:01 +0200
+Subject: [PATCH] fix build failure with GCC 9
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: C.r. Guo <nxa13725@lsv07004.swis.us-cdc01.nxp.com>
+---
+ host/xtest/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/host/xtest/Makefile b/host/xtest/Makefile
+index e4e2881..e86e056 100644
+--- a/host/xtest/Makefile
++++ b/host/xtest/Makefile
+@@ -152,7 +152,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
+ -Wmissing-include-dirs -Wmissing-noreturn \
+ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
+ -Wshadow -Wstrict-prototypes -Wswitch-default \
+- -Wwrite-strings \
++ -Wwrite-strings -Wno-format-overflow \
+ -Wno-missing-field-initializers -Wno-format-zero-length
+ endif
+
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-use-python3-instead-of-python.patch b/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-use-python3-instead-of-python.patch
new file mode 100644
index 00000000..20f190af
--- /dev/null
+++ b/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq/0001-use-python3-instead-of-python.patch
@@ -0,0 +1,48 @@
+From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001
+From: Scott Branden <scott.branden@broadcom.com>
+Date: Fri, 27 Dec 2019 12:54:28 -0800
+Subject: [PATCH] use python3 instead of python
+
+use python3 instead of python as python2 is EOL January 2020.
+
+Signed-off-by: Scott Branden <scott.branden@broadcom.com>
+Reviewed-by: Jerome Forissier <jerome@forissier.org>
+Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, CFG_GCM_NIST_VECTORS=y)
+Upstream-Status: Backport from v3.8.0
+---
+ scripts/file_to_c.py | 4 ++--
+ scripts/rsp_to_gcm_test.py | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py
+index ae16f52..b4ce2a2 100755
+--- a/scripts/file_to_c.py
++++ b/scripts/file_to_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2018, Linaro Limited
+@@ -29,7 +29,7 @@ def main():
+
+ f.write("const uint8_t " + args.name + "[] = {\n")
+ i = 0
+- for x in array.array("B", inf.read()):
++ for x in array.array("B", map(ord, (inf.read()))):
+ f.write("0x" + '{0:02x}'.format(x) + ",")
+ i = i + 1
+ if i % 8 == 0:
+diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py
+index 0543541..e4418be 100755
+--- a/scripts/rsp_to_gcm_test.py
++++ b/scripts/rsp_to_gcm_test.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ modes = {'encrypt': 0, 'decrypt': 1}
+
+--
+2.7.4
+
diff --git a/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq_git.bb b/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq_git.bb
index a9aaffc7..b66725c7 100644
--- a/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq_git.bb
+++ b/bsp/meta-freescale/recipes-security/optee/optee-test-qoriq_git.bb
@@ -4,16 +4,17 @@ HOMEPAGE = "https://github.com/qoriq-open-source/optee_test"
LICENSE = "BSD & GPLv2"
LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
-DEPENDS = "optee-client-qoriq optee-os-qoriq python-pycrypto-native"
+DEPENDS = "optee-client-qoriq optee-os-qoriq python3-pycrypto-native"
-inherit pythonnative
+inherit python3native
SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_test;nobranch=1 \
- file://0001-fix-build-failure-with-GCC-8.patch \
+ file://0001-fix-build-failure-with-GCC-9.patch \
+ file://0001-use-python3-instead-of-python.patch \
"
S = "${WORKDIR}/git"
-SRCREV = "83c87d9b368c33545688c7aad27432ff9a22868f"
+SRCREV = "669058459e4a544be12f37dab103ee4c2b32e31d"
OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
diff --git a/bsp/meta-freescale/wic/imx-imx-boot-bootpart.wks.in b/bsp/meta-freescale/wic/imx-imx-boot-bootpart.wks.in
index 601b9340..b50364d1 100644
--- a/bsp/meta-freescale/wic/imx-imx-boot-bootpart.wks.in
+++ b/bsp/meta-freescale/wic/imx-imx-boot-bootpart.wks.in
@@ -6,16 +6,15 @@
#
# The disk layout used is:
# - ---------- -------------- --------------
-# | | imx-boot | boot | rootfs |
+# | | imx-boot | boot | rootfs |
# - ---------- -------------- --------------
-# ^ ^ ^ ^
-# | | | |
-# 0 | 4MiB 16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
+# ^ ^ ^ ^ ^
+# | | | | |
+# 0 | 8MiB 72MiB 72MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
# ${IMX_BOOT_SEEK} 32 or 33kiB, see reference manual
#
part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
-part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
-part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
+part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 8192 --size 64
+part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 8192
bootloader --ptable msdos
-
diff --git a/bsp/meta-freescale/wic/imx-uboot-bootpart.wks b/bsp/meta-freescale/wic/imx-uboot-bootpart.wks.in
index a5e0137b..8fe019c0 100644
--- a/bsp/meta-freescale/wic/imx-uboot-bootpart.wks
+++ b/bsp/meta-freescale/wic/imx-uboot-bootpart.wks.in
@@ -12,7 +12,7 @@
# | | | |
# 0 1kiB 4MiB 16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
-part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1
+part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}" --ondisk mmcblk --no-table --align 1
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
diff --git a/bsp/meta-freescale/wic/imx-uboot-spl-bootpart.wks b/bsp/meta-freescale/wic/imx-uboot-spl-bootpart.wks.in
index 4e16ec35..8062c51e 100644
--- a/bsp/meta-freescale/wic/imx-uboot-spl-bootpart.wks
+++ b/bsp/meta-freescale/wic/imx-uboot-spl-bootpart.wks.in
@@ -13,7 +13,7 @@
# 0 1kiB 69kiB 4MiB 16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part SPL --source rawcopy --sourceparams="file=SPL" --ondisk mmcblk --no-table --align 1
-part u-boot --source rawcopy --sourceparams="file=u-boot.img" --ondisk mmcblk --no-table --align 69
+part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}" --ondisk mmcblk --no-table --align 69
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
diff --git a/bsp/meta-freescale/wic/imx-uboot-spl.wks b/bsp/meta-freescale/wic/imx-uboot-spl.wks.in
index e7b3beed..db2f89dd 100644
--- a/bsp/meta-freescale/wic/imx-uboot-spl.wks
+++ b/bsp/meta-freescale/wic/imx-uboot-spl.wks.in
@@ -13,7 +13,7 @@
# 0 1kiB 69kiB 4MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part SPL --source rawcopy --sourceparams="file=SPL" --ondisk mmcblk --no-table --align 1
-part u-boot --source rawcopy --sourceparams="file=u-boot.img" --ondisk mmcblk --no-table --align 69
+part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}" --ondisk mmcblk --no-table --align 69
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
bootloader --ptable msdos