From 5367184c0335eded285c6da17e87b82392afd40f Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 30 Jul 2020 14:27:51 -0400 Subject: Add imx8mqevk machine that uses etnaviv To enable debugging/development of the etnaviv driver against the GC7000L GPU in the i.MX8MQ, add a "imx8mqevk" template that uses etnaviv instead of Vivante. Since there seem to be some issues with respect to GPU hangs and resulting graphical corruption, the existing "imx8mqevk-viv" template that uses Vivante has been retained for now. Bug-AGL: SPEC-3520 Signed-off-by: Scott Murray Change-Id: If5b84c6021994cce0f30410985b1ec4678e718ef Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/25058 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Walter Lozano Reviewed-by: Jan-Simon Moeller --- meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc | 19 ++++++++++++ meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc | 20 +------------ meta-agl-bsp/conf/include/agl_imx8mqevk.inc | 23 +++++++++++++++ .../mesa/files/0001-kmsro-add-imx-dcss.patch | 34 ++++++++++++++++++++++ .../recipes-graphics/mesa/mesa_%.bbappend | 10 +++++++ .../0001-enable-mhdp-with-etnaviv.patch | 23 +++++++++++++++ .../linux-fslc-imx/0002-dts-enable-etnaviv.patch | 23 +++++++++++++++ .../linux/linux-fslc-imx/etnaviv.cfg | 4 +++ .../recipes-kernel/linux/linux-fslc-imx_%.bbappend | 14 ++++++++- .../imx8mqevk-viv/README_machine_imx8mqevk-viv.md | 4 +-- templates/machine/imx8mqevk/40_bblayers.conf.inc | 5 ++++ templates/machine/imx8mqevk/50_local.conf.inc | 3 ++ templates/machine/imx8mqevk/50_setup.sh | 2 ++ .../machine/imx8mqevk/README_machine_imx8mqevk.md | 13 +++++++++ 14 files changed, 175 insertions(+), 22 deletions(-) create mode 100644 meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc create mode 100644 meta-agl-bsp/conf/include/agl_imx8mqevk.inc create mode 100644 meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch create mode 100644 meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend create mode 100644 meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch create mode 100644 meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch create mode 100644 meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg create mode 100644 templates/machine/imx8mqevk/40_bblayers.conf.inc create mode 100644 templates/machine/imx8mqevk/50_local.conf.inc create mode 100644 templates/machine/imx8mqevk/50_setup.sh create mode 100644 templates/machine/imx8mqevk/README_machine_imx8mqevk.md diff --git a/meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc b/meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc new file mode 100644 index 000000000..50567583c --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc @@ -0,0 +1,19 @@ +DISTRO_FEATURES_append = " agl-medium-arm-compiler" + +# Force use of the community supported LTS kernel instead of the +# default linux-imx +IMX_DEFAULT_KERNEL_imx8mqevk = "linux-fslc-imx" + +# For EVKB wifi support +MACHINE_FEATURES_append = " bcm4356" + +# Disable meta-freescale package architecure mangling, as it causes +# issues with AGL's explicit setting of DEFAULTTUNE. +INHERIT_remove = "fsl-dynamic-packagearch" +MACHINE_SOCARCH = "${TUNE_PKGARCH}" + +# Disable the meta-freescale weston-init bbappend as it conflicts +# with AGL's. +BBMASK = "meta-freescale/recipes-graphics/wayland/weston-init" + +AGL_DEFAULT_INITRAMFS_FSTYPES := "" diff --git a/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc b/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc index 50567583c..8227f5c06 100644 --- a/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc +++ b/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc @@ -1,19 +1 @@ -DISTRO_FEATURES_append = " agl-medium-arm-compiler" - -# Force use of the community supported LTS kernel instead of the -# default linux-imx -IMX_DEFAULT_KERNEL_imx8mqevk = "linux-fslc-imx" - -# For EVKB wifi support -MACHINE_FEATURES_append = " bcm4356" - -# Disable meta-freescale package architecure mangling, as it causes -# issues with AGL's explicit setting of DEFAULTTUNE. -INHERIT_remove = "fsl-dynamic-packagearch" -MACHINE_SOCARCH = "${TUNE_PKGARCH}" - -# Disable the meta-freescale weston-init bbappend as it conflicts -# with AGL's. -BBMASK = "meta-freescale/recipes-graphics/wayland/weston-init" - -AGL_DEFAULT_INITRAMFS_FSTYPES := "" +include agl_imx8mqevk-common.inc diff --git a/meta-agl-bsp/conf/include/agl_imx8mqevk.inc b/meta-agl-bsp/conf/include/agl_imx8mqevk.inc new file mode 100644 index 000000000..88c06336c --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx8mqevk.inc @@ -0,0 +1,23 @@ +include agl_imx8mqevk-common.inc + +# NOTE: currently not using IMX_DEFAULT_BSP = "mainline", as it +# requires more changes than this approach of disabling +# Vivante. + +# Add our own over-ride for use in a few recipes where there is +# conflicting Vivante vs etnaviv configuration. +MACHINEOVERRIDES .= ":etnaviv" + +# Knock out Vivante overrides +MACHINEOVERRIDES_EXTENDER_mx8mq_forcevariable = "" +PREFERRED_VERSION_weston_mx8 = "8.0.0" +PREFERRED_VERSION_wayland-protocols_mx8 = "1.20" +PREFERRED_VERSION_libdrm_mx8 = "2.4.100" + +CORE_IMAGE_EXTRA_INSTALL += "libdrm-etnaviv" + +PREFERRED_VERSION_gstreamer1.0_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-base_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-good_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-bad_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-ugly_mx8 = "1.16.2" diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch new file mode 100644 index 000000000..7f7ab9124 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch @@ -0,0 +1,34 @@ +Add i.MX8MQ DCSS kmsro support + +Add required dummy entry for NXP's i.MX8MQ DCSS display controller DRM +driver to the kmsro configuration so that the loader will not think it +is a GPU. + +Upstream-Status: pending +Signed-off-by: Scott Murray +--- + +diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build +index ae25a21..17379c7 100644 +--- a/src/gallium/targets/dri/meson.build ++++ b/src/gallium/targets/dri/meson.build +@@ -72,6 +72,7 @@ foreach d : [[with_gallium_kmsro, [ + 'hx8357d_dri.so', + 'ili9225_dri.so', + 'ili9341_dri.so', ++ 'imx-dcss_dri.so', + 'imx-drm_dri.so', + 'ingenic-drm_dri.so', + 'mcde_dri.so', +diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c +index f71f690..41c5c75 100644 +--- a/src/gallium/targets/dri/target.c ++++ b/src/gallium/targets/dri/target.c +@@ -97,6 +97,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(exynos) + DEFINE_LOADER_DRM_ENTRYPOINT(hx8357d) + DEFINE_LOADER_DRM_ENTRYPOINT(ili9225) + DEFINE_LOADER_DRM_ENTRYPOINT(ili9341) ++DEFINE_LOADER_DRM_ENTRYPOINT(imx_dcss) + DEFINE_LOADER_DRM_ENTRYPOINT(imx_drm) + DEFINE_LOADER_DRM_ENTRYPOINT(ingenic_drm) + DEFINE_LOADER_DRM_ENTRYPOINT(mcde) diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 000000000..636b75c53 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://0001-kmsro-add-imx-dcss.patch" + +# These over-rides should use "use-mainline-bsp" instead when that +# becomes more workable for i.MX8 in upstream meta-freescale. + +USE_OSMESA_ONLY_etnaviv = "no" + +PACKAGECONFIG_append_etnaviv = " gallium etnaviv kmsro" diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch new file mode 100644 index 000000000..23ca0475a --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch @@ -0,0 +1,23 @@ +Tweak MHDP driver Kconfig so it can be enabled with etnaviv + +The MHDP driver is needed for using HDMI on the i.MX8MQ EVK, tweak its +Kconfig entry so that it can be enabled when using etnaviv, not just +Vivante. + +Upstream-Status: pending +Signed-off-by: Scott Murray +--- + +diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig +index 63d5f1b532ee..a18ba56aa218 100644 +--- a/drivers/gpu/drm/imx/Kconfig ++++ b/drivers/gpu/drm/imx/Kconfig +@@ -85,7 +85,7 @@ config DRM_IMX_CDNS_MHDP + select DRM_CDNS_DP + select DRM_CDNS_HDMI + select DRM_CDNS_AUDIO +- depends on DRM_IMX ++ depends on DRM_IMX || DRM_ETNAVIV + help + Choose this if you want to use HDMI on i.MX8. + diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch new file mode 100644 index 000000000..4ce9b9d38 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch @@ -0,0 +1,23 @@ +Enable etnaviv support in i.MX8MQ EVK devicetree + +Some further investigation is required into how to manage this upstream +in meta-freescale, as it is not required for the i.MX6 platforms AFAIK. + +Upstream-Status: pending + +Signed-off-by: Scott Murray +--- + +diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts +index f2a7e4069a0d..c0b6c5052656 100755 +--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts +@@ -1074,7 +1074,7 @@ + status = "okay"; + }; + +-&gpu3d { ++&gpu { + status = "okay"; + }; + diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg new file mode 100644 index 000000000..35602c6d8 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg @@ -0,0 +1,4 @@ +CONFIG_DRM_IMX=n +CONFIG_DRM_IMX_CDNS_MHDP=y +CONFIG_DRM_ROCKCHIP=n +CONFIG_DRM_ETNAVIV=y diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend index 33e72bf7d..549ba3994 100644 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend @@ -1,7 +1,15 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:${THISDIR}/files:" require recipes-kernel/linux/linux-agl.inc +# These patches and the configuration fragment below will need to be +# revisited if/when using IMX_DEFAULT_BSP = "mainline" with i.MX8 +# becomes more feasible with upstream meta-freescale. +SRC_URI_append_etnaviv = " \ + file://0001-enable-mhdp-with-etnaviv.patch \ + file://0002-dts-enable-etnaviv.patch \ +" + # Make sure these are enabled so that AGL configurations work SRC_URI_append = " file://tmpfs.cfg" KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/tmpfs.cfg" @@ -18,6 +26,10 @@ KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cfg80211.cfg" SRC_URI_append_imx8mqevk = " file://imx8mq-evkb.cfg" KERNEL_CONFIG_FRAGMENTS_append_imx8mqevk = " ${WORKDIR}/imx8mq-evkb.cfg" +# Build in etnaviv if required +SRC_URI_append_etnaviv = " file://etnaviv.cfg" +KERNEL_CONFIG_FRAGMENTS_append_etnaviv = " ${WORKDIR}/etnaviv.cfg" + # Turn off a couple of things enabled by default by Freescale # (lock debugging and userspace firmware loader fallback) SRC_URI_append = " file://fixups.cfg" diff --git a/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md b/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md index a85140e6a..be30e00fe 100644 --- a/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md +++ b/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md @@ -1,9 +1,9 @@ --- -description: i.MX8 EVK with Vivante GPU driver +description: i.MX8MQ EVK with Vivante GPU driver authors: Scott Murray --- ### Machine imx8mqevk-viv -i.MX8 EVK and EVKB boards with Vivante GPU driver support. +i.MX8MQ EVK and EVKB boards with Vivante GPU driver support. diff --git a/templates/machine/imx8mqevk/40_bblayers.conf.inc b/templates/machine/imx8mqevk/40_bblayers.conf.inc new file mode 100644 index 000000000..edcb6a3a2 --- /dev/null +++ b/templates/machine/imx8mqevk/40_bblayers.conf.inc @@ -0,0 +1,5 @@ +# This must be parsed after qt5, etc. layers so that they are correctly +# recognized by meta-freescale/dynamic-layers +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-freescale \ + " diff --git a/templates/machine/imx8mqevk/50_local.conf.inc b/templates/machine/imx8mqevk/50_local.conf.inc new file mode 100644 index 000000000..5f9b95943 --- /dev/null +++ b/templates/machine/imx8mqevk/50_local.conf.inc @@ -0,0 +1,3 @@ +MACHINE = "imx8mqevk" +#see meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk.inc +require conf/include/agl_imx8mqevk.inc diff --git a/templates/machine/imx8mqevk/50_setup.sh b/templates/machine/imx8mqevk/50_setup.sh new file mode 100644 index 000000000..eefd1eb7f --- /dev/null +++ b/templates/machine/imx8mqevk/50_setup.sh @@ -0,0 +1,2 @@ +find_and_ack_eula $METADIR/bsp/meta-freescale EULA +export EULA_FLAG_NAME="ACCEPT_FSL_EULA" diff --git a/templates/machine/imx8mqevk/README_machine_imx8mqevk.md b/templates/machine/imx8mqevk/README_machine_imx8mqevk.md new file mode 100644 index 000000000..5d2bcbd37 --- /dev/null +++ b/templates/machine/imx8mqevk/README_machine_imx8mqevk.md @@ -0,0 +1,13 @@ +--- +description: i.MX8MQ EVK with etnaviv GPU driver +authors: Scott Murray +--- + +### Machine imx8mqevk + +i.MX8MQ EVK and EVKB boards with etnaviv GPU driver support. +Note that etnaviv on the GC7000L GPU in the i.MX8MQ is currently still +a work in progress, the imx8mqevk-viv template using the NXP Vivante +driver may be a better choice for those not interested in etnaviv +debugging and development. + -- cgit 1.2.3-korg