summaryrefslogtreecommitdiffstats
path: root/meta-agl/meta-agl-bsp
diff options
context:
space:
mode:
authorToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
committerToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
commit5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch)
treeb4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /meta-agl/meta-agl-bsp
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
agl-basesystem
Diffstat (limited to 'meta-agl/meta-agl-bsp')
-rw-r--r--meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass182
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc43
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc45
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc27
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc11
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc47
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc3
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-820c.inc2
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc13
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc3
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc10
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc5
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc5
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc21
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc18
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc10
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc5
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc22
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_qemuarm.inc14
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_qemuarm64.inc17
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc34
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc42
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc10
-rw-r--r--meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc41
-rw-r--r--meta-agl/meta-agl-bsp/conf/layer.conf26
-rw-r--r--meta-agl/meta-agl-bsp/conf/machine/qemuarm.conf18
-rw-r--r--meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf26
-rw-r--r--meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend6
-rw-r--r--meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/libva_%.bbappend4
-rw-r--r--meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend9
-rw-r--r--meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf/virtual.cfg18
-rw-r--r--meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston_%.bbappend3
-rw-r--r--meta-agl/meta-agl-bsp/meta-core/recipes-core/ovmf/ovmf_git.bbappend1
-rwxr-xr-xmeta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg17
-rw-r--r--meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/most_deps.cfg9
-rw-r--r--meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/qemuarm.cfg6
-rw-r--r--meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/virtio.cfg6
-rw-r--r--meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend17
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf/fbdev.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg24
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg8
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/namespace.cfg6
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/tmpfs.cfg2
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/touchscreen.cfg2
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend23
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend25
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch17
-rw-r--r--meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend5
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend3
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend0
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg54
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc3
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg2
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh1
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg4
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg81
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend28
-rw-r--r--meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.12.bb32
-rw-r--r--meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/files/qcom-q6v5-pil.service12
-rw-r--r--meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/q6v5-pil.bb20
-rw-r--r--meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend3
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend12
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend43
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb32
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr3
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt21
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt21
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch82
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc15
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb34
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb67
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc333
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb4
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend10
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch42
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch52
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch46
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb30
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch624
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch377
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch234
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch43
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch99
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch71
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch44
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch62
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb59
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb10
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc267
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend2
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb20
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend4
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend7
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/dsi.cfg5
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270-720p.cfg7
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb47
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch39
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend10
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch33
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg12
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg5
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc140
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend40
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb16
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend2
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc5
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf73
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service10
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch184
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb28
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend8
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service10
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend18
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch84
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/disable_most.cfg9
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend30
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf2
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf2
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend3
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher4
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-kingfisher-conf_1.0.bb27
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state321
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend5
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-Boot-Normal-World-in-EL2.patch28
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt18
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt18
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb26
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb7
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend11
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg4
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg8
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend4
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend2
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend2
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend2
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch125
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/namespace_fix.cfg4
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend11
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bbappend3
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend8
-rw-r--r--meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh71
-rw-r--r--meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend6
-rw-r--r--meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend5
-rw-r--r--meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/.gitkeep0
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch3570
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch29
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch37
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch31
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch39
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch36
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend25
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state/asound.state1347
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend3
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km/add-AGL-toolchain-config.patch12
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km_%.bbappend4
-rwxr-xr-xmeta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt1
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend16
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/gbm/libgbm_%.bbappend2
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um/pvr.service19
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um_%.bbappend22
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend7
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf.bbappend7
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf/unnamed.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/dcan2_pinmux_enable.patch39
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend11
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio/dra7xx-evm-set-default-sink-source.patch15
-rw-r--r--meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend7
-rw-r--r--meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch41
-rw-r--r--meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch86
-rw-r--r--meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch138
-rw-r--r--meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-fixup-build-with-gcc7.patch101
-rw-r--r--meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb29
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch26
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend5
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb24
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb30
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend12
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg5
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg6
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg6
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/shell.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg5
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch78
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch173
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop9
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.pngbin0 -> 2383 bytes
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start7
-rw-r--r--meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb111
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/kernel-devsrc.bbappend6
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Handle-CGROUP2-in-the-same-way-that-CGROUP.patch40
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Privilege-check-on-key-operations.patch109
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc10
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc8
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc94
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg4
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/btusb.cfg37
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg41
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/drm.cfg2
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/fanotify.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/hid.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/i2c-led.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/iiodevice.cfg25
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/joystick.cfg9
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nbd.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nfc.cfg34
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/procevent.cfg2
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ramdisk.cfg2
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtc.cfg7
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtl_sdr.cfg4
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/scheddebug.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/sound.cfg7
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uinput.cfg3
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usb.cfg8
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbaudio.cfg2
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbmodem.cfg7
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uvc.cfg4
-rw-r--r--meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/vbox-vmware-sata.cfg19
-rw-r--r--meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch144
-rw-r--r--meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend4
-rw-r--r--meta-agl/meta-agl-bsp/wic/directdisk.wks.in9
-rw-r--r--meta-agl/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks6
-rw-r--r--meta-agl/meta-agl-bsp/wic/singlepart-noloader.wks5
-rw-r--r--meta-agl/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks23
-rw-r--r--meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks12
244 files changed, 12463 insertions, 0 deletions
diff --git a/meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass b/meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass
new file mode 100644
index 00000000..2967063e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass
@@ -0,0 +1,182 @@
+inherit image_types
+
+# Create an sdcard image suitable for the atlas board
+# This is copied from the raspberrypi and freescale sdcard classes
+
+# Disk layout
+# 0 -> 8*1024 - reserverd
+# 8*1024 -> 32*1024 -
+# 32*1024 -> 1024*1024 -
+# 1024*1024 -> BOOT_SPACE - bootloader and kernel in Part 3
+# BOOT_SPACE*1024 -> FAT_SPACE
+
+
+
+# This image depends on the rootfs image
+IMAGE_TYPEDEP_socfpga-sdimg = "${SDIMG_ROOTFS_TYPE}"
+
+# Boot partition volume id
+BOOTDD_VOLUME_ID ?= "${MACHINE}"
+
+# Boot partition size [in KiB] -> size 2M for A10
+BOOT_SPACE ?= "2048"
+
+# Fat partition size
+FAT_SPACE ?= "102400"
+
+# uBoot ENV offset
+SDIMG_UBOOT_ENV_OFFSET ?= "512"
+ENV_BASE_NAME ??= "${UBOOT_CONFIG}"
+
+# Boot partition begin at sector 1024
+# This is required as for c5/a5 mainline uboot hard codes the location
+# of the uboot image in the sdcard to 0xa00 sector
+IMAGE_ROOTFS_ALIGNMENT = "1024"
+
+# ROOTFS_SIZE_MOD ?= "524288"
+ROOTFS_SIZE_MOD ?= "16384"
+
+# Use an uncompressed ext3 by default as rootfs
+SDIMG_ROOTFS_TYPE = "ext3"
+SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}"
+
+
+do_image_socfpga_sdimg[depends] += " \
+ coreutils-native:do_populate_sysroot \
+ parted-native:do_populate_sysroot \
+ mtools-native:do_populate_sysroot \
+ dosfstools-native:do_populate_sysroot \
+ virtual/kernel:do_deploy \
+ virtual/bootloader:do_deploy \
+ "
+
+rootfs[depends] += "virtual/kernel:do_deploy"
+
+# SD card image name
+SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.socfpga-sdimg"
+
+IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}"
+
+# After uboot v2016.05 the boot partition number was changed from 3 to 1 so as a
+# result we need 2 different functions for creating the boot partitions just to
+# change the partition creation order
+
+SOCFPGA_SDIMG_PARTITION_COMMAND ?= "generate_sdcard_partitions"
+
+generate_sdcard_partitions () {
+
+ # Create partition table
+ parted -s ${SDIMG} mklabel msdos
+ # P1: Fat partition
+ parted -s ${SDIMG} unit KiB mkpart primary fat32 $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED}) $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ ${FAT_SPACE_ALIGNED})
+ # set fat partition as bootable for distroboot
+ parted -s ${SDIMG} set 1 boot on
+ # P2: Linux FS partition
+ parted -s ${SDIMG} unit KiB mkpart primary $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ ${FAT_SPACE_ALIGNED}) $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ ${FAT_SPACE_ALIGNED} \+ ${ROOTFS_SIZE_ALIGNED})
+ # P3: A2 partition for bootloader
+ parted -s ${SDIMG} unit KiB mkpart primary ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT})
+
+ # set part 3 to type a2 for spl / uboot image
+ # 446 to partition table, 16 bytes per entry, 4 byte offset to partition type
+ echo -ne "\xa2" | dd of=${SDIMG} bs=1 count=1 seek=$(expr 446 + 16 + 16 + 4) conv=notrunc && sync && sync
+
+ # Create a vfat image with boot files
+ FAT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
+ rm -f ${WORKDIR}/fat.img
+ mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/fat.img $FAT_BLOCKS
+
+}
+
+IMAGE_CMD_socfpga-sdimg () {
+
+ # Align partitions
+ BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
+ BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
+ FAT_SPACE_ALIGNED=$(expr ${FAT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
+ FAT_SPACE_ALIGNED=$(expr ${FAT_SPACE_ALIGNED} - ${FAT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
+
+ ROOTFS_SIZE_ALIGNED=$(expr ${ROOTFS_SIZE} \+ ${ROOTFS_SIZE_MOD})
+ ROOTFS_SIZE_ALIGNED=$(expr ${ROOTFS_SIZE_ALIGNED} \- ${ROOTFS_SIZE_ALIGNED} \% ${ROOTFS_SIZE_MOD})
+
+ SDIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + ${FAT_SPACE_ALIGNED} + ${ROOTFS_SIZE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT})
+
+ # Initialize sdcard image file
+ dd if=/dev/zero of=${SDIMG} bs=1 count=0 seek=$(expr 1024 \* ${SDIMG_SIZE}) && sync && sync
+
+ # Create partition table
+ ${SOCFPGA_SDIMG_PARTITION_COMMAND}
+
+ # Copy kernel image
+ mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::/${KERNEL_IMAGETYPE}
+
+ # Copy boot scripts
+ if [ -e "${DEPLOY_DIR_IMAGE}/${MACHINE}.scr" ]
+ then
+ mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${MACHINE}.scr ::/u-boot.scr
+ fi
+
+ # Copy device tree file
+ if test -n "${KERNEL_DEVICETREE}"; then
+ for DTS_FILE in ${KERNEL_DEVICETREE}; do
+ DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
+ if [ -e "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then
+ kernel_bin="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
+ kernel_bin_for_dtb="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb | sed "s,$DTS_BASE_NAME,${MACHINE},g;s,\.dtb$,.bin,g"`"
+ if [ $kernel_bin = $kernel_bin_for_dtb ]; then
+ mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb
+ fi
+ fi
+ done
+ fi
+
+ # copy extlinux stuff
+ if [ "${UBOOT_EXTLINUX}" = "1" ]
+ then
+ if [ -e "${DEPLOY_DIR_IMAGE}/extlinux.conf" ]
+ then
+ rm -Rf ${WORKDIR}/extlinux
+ mkdir ${WORKDIR}/extlinux
+ cp ${DEPLOY_DIR_IMAGE}/extlinux.conf ${WORKDIR}/extlinux/
+ mcopy -i ${WORKDIR}/fat.img -s ${WORKDIR}/extlinux ::/
+ fi
+
+ fi
+
+ # copy any files listed as extra files
+ if test -n "${SOCFPGA_SDIMG_EXTRA_FILES}"; then
+ for EXTRA_FILE in ${SOCFPGA_SDIMG_EXTRA_FILES}; do
+ if [ -e "${DEPLOY_DIR_IMAGE}/${EXTRA_FILE}" ]; then
+ mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${EXTRA_FILE} ::/${EXTRA_FILE}
+ fi
+ done
+ fi
+
+ # Add stamp file
+ echo "${IMAGE_NAME}-${IMAGEDATESTAMP}" > ${WORKDIR}/image-version-info
+ mcopy -i ${WORKDIR}/fat.img -v ${WORKDIR}//image-version-info ::
+
+ # Burn Partitions
+ dd if=${WORKDIR}/fat.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
+ # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
+ if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz"
+ then
+ xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + 1024 \* ${FAT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
+ else
+ dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + 1024 \* ${FAT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
+ fi
+
+ if [ -e "${DEPLOY_DIR_IMAGE}/${SPL_BINARY}-${UBOOT_CONFIG}" ]
+ then
+ dd if=${DEPLOY_DIR_IMAGE}/${SPL_BINARY}-${UBOOT_CONFIG} of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
+ elif [ -e "${DEPLOY_DIR_IMAGE}/${SPL_BINARY}" ]
+ then
+ dd if=${DEPLOY_DIR_IMAGE}/${SPL_BINARY} of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
+ else
+ bbfatal "${SPL_BINARY} does not exist."
+ fi
+
+ if [ -e "${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin" ]; then
+ dd if=${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin of=${SDIMG} conv=notrunc bs=1 seek=${SDIMG_UBOOT_ENV_OFFSET} && sync && sync
+ fi
+
+}
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc b/meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc
new file mode 100644
index 00000000..4f4dc986
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc
@@ -0,0 +1,43 @@
+# This config is for the Sancloud BBE, adapted from the config provider for the
+# standard Beaglebone
+
+AGL_DEFAULT_IMAGE_FSTYPES = "tar.xz wic.xz wic.bmap"
+
+CORE_IMAGE_EXTRA_INSTALL += "packagegroup-machine-base"
+
+#-------------------------------------------------
+## Graphics section ##
+#-------------------------------------------------
+PACKAGES_GFX = "omapdrm-pvr"
+IMAGE_INSTALL_append = " ${PACKAGES_GFX}"
+
+
+# Enable Gfx Pkgs
+MACHINE_FEATURES_append = " sgx"
+MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
+
+DEPENDS_remove = "virtual/libgl"
+
+# Preferred providers
+PREFERRED_PROVIDER_virtual/libgles1 = ""
+PREFERRED_PROVIDER_virtual/libgles2 = "ti-sgx-ddk-um"
+PREFERRED_PROVIDER_virtual/egl = "ti-sgx-ddk-um"
+PREFERRED_PROVIDER_virtual/mesa = "mesa-gl"
+PREFERRED_PROVIDER_libgbm = "libgbm"
+
+#Preferred versions
+PREFERRED_VERSION_libgbm = "10.0.0"
+
+#-------------------------------------------------
+## Multimedia section ##
+#-------------------------------------------------
+
+# DEFAULTTUNE for cortex-a8
+DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+
+SECURITY_CFLAGS_pn-mozjs = ""
+SECURITY_LDFLAGS_pn-mozjs = ""
+SECURITY_CFLAGS_pn-gpm = ""
+SECURITY_LDFLAGS_pn-gpm = ""
+SECURITY_CFLAGS_pn-libatasmart = ""
+SECURITY_LDFLAGS_pn-libatasmart = ""
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc b/meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc
new file mode 100644
index 00000000..988b3d53
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc
@@ -0,0 +1,45 @@
+# This config is for the beaglebone (inspired from the vayu config).
+
+#-------------------------------------------------
+## Graphics section ##
+#-------------------------------------------------
+PACKAGES_GFX = "omapdrm-pvr"
+IMAGE_INSTALL_append = " ${PACKAGES_GFX}"
+
+
+# Enable Gfx Pkgs
+MACHINE_FEATURES_append = " sgx"
+MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
+
+DEPENDS_remove = "virtual/libgl"
+
+# Preferred providers
+PREFERRED_PROVIDER_virtual/libgles1 = ""
+PREFERRED_PROVIDER_virtual/libgles2 = "ti-sgx-ddk-um"
+PREFERRED_PROVIDER_virtual/egl = "ti-sgx-ddk-um"
+PREFERRED_PROVIDER_virtual/mesa = "mesa-gl"
+PREFERRED_PROVIDER_libgbm = "libgbm"
+
+#Preferred versions
+PREFERRED_VERSION_libgbm = "10.0.0"
+
+#-------------------------------------------------
+## Multimedia section ##
+#-------------------------------------------------
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-ti-staging"
+PREFERRED_VERSION_virtual/kernel = "4.9"
+
+# DEFAULTTUNE for cortex-a8
+DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+
+SECURITY_CFLAGS_pn-mozjs = ""
+SECURITY_LDFLAGS_pn-mozjs = ""
+SECURITY_CFLAGS_pn-gpm = ""
+SECURITY_LDFLAGS_pn-gpm = ""
+SECURITY_CFLAGS_pn-libatasmart = ""
+SECURITY_LDFLAGS_pn-libatasmart = ""
+
+WKS_FILE = "sdimage-bootpart-uuid.wks"
+
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc b/meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc
new file mode 100644
index 00000000..b43ef47c
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc
@@ -0,0 +1,27 @@
+DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+
+# This disables the Freescale/NXP Vivante GPU driver and enables
+# etnaviv support.
+MACHINEOVERRIDES .= ":use-mainline-bsp"
+
+# 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}"
+
+# Include devicetrees for SOM 1.5 and Hummingboard 2 hardware
+KERNEL_DEVICETREE_append = " \
+ imx6dl-hummingboard-som-v15.dtb imx6q-hummingboard-som-v15.dtb \
+ imx6dl-hummingboard2.dtb imx6q-hummingboard2.dtb \
+ imx6dl-hummingboard2-som-v15.dtb imx6q-hummingboard2-som-v15.dtb \
+"
+
+# Disable the meta-freescale weston-init bbappend as it conflicts
+# with AGL's.
+BBMASK = "meta-freescale/recipes-graphics/wayland/weston-init"
+
+# Set CMA size large enough to work with AGL
+UBOOT_EXTLINUX_KERNEL_ARGS_append = " cma=512M"
+
+# Generate WIC image also
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc b/meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc
new file mode 100644
index 00000000..1eaf0ae6
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc
@@ -0,0 +1,11 @@
+OSTREE_BOOTLOADER ?= "u-boot"
+
+# DEFAULTTUNE for cortex-a9
+DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+
+
+# Add the custom rpi-sdimg output format
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz"
+
+# Use the AGL default ext4.xz to generate the rpi-sdimg
+SDIMG_ROOTFS_TYPE = "ext4.xz"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc b/meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
new file mode 100644
index 00000000..54524a81
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
@@ -0,0 +1,47 @@
+
+#-------------------------------------------------
+## Graphics section ##
+#-------------------------------------------------
+PACKAGES_GFX_${MACHINE} = "omapdrm-pvr"
+
+# Enable Gfx Pkgs
+MACHINE_FEATURES_append = " sgx"
+MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
+
+DEPENDS_remove = "virtual/libgl"
+
+# Preferred providers
+PREFERRED_PROVIDER_virtual/libgles1 = ""
+PREFERRED_PROVIDER_virtual/libgles2 = "ti-sgx-ddk-um"
+PREFERRED_PROVIDER_virtual/egl = "ti-sgx-ddk-um"
+PREFERRED_PROVIDER_virtual/mesa = "mesa-gl"
+PREFERRED_PROVIDER_libgbm = "libgbm"
+
+#Preferred versions
+PREFERRED_VERSION_libgbm = "10.0.0"
+
+#-------------------------------------------------
+## Multimedia section ##
+#-------------------------------------------------
+
+PACKAGES_MULTIMEDIA = " \
+ ipumm-fw \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio-misc' , '', d)} \
+"
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-ti-staging"
+PREFERRED_VERSION_virtual/kernel = "4.9"
+
+# Distribution-specific runtime components
+IMAGE_INSTALL_append = " \
+ ${PACKAGES_GFX} \
+ ${PACKAGES_MULTIMEDIA} \
+ cmem \
+"
+
+# Include WIC support based on beaglebone
+do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
+WKS_FILE = "sdimage-bootpart-uuid.wks"
+IMAGE_BOOT_FILES = "MLO u-boot.img uEnv.txt"
+
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc b/meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc
new file mode 100644
index 00000000..f6626536
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc
@@ -0,0 +1,3 @@
+# Install 96boards-tools for resizing partition
+# Add systemd unit file for the qcom_q6v5_pil kernel module
+IMAGE_INSTALL_append = " 96boards-tools q6v5-pil"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-820c.inc b/meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-820c.inc
new file mode 100644
index 00000000..f74d703f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-820c.inc
@@ -0,0 +1,2 @@
+# Install 96boards-tools for resizing partition
+IMAGE_INSTALL_append = " 96boards-tools"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc b/meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc
new file mode 100644
index 00000000..f7a73723
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc
@@ -0,0 +1,13 @@
+require conf/include/agl_ulcb.inc
+SOC_FAMILY = "r8a77990"
+BOARD_NAME = "ebisu"
+
+DTB_SUFFIX = "r8a77990-ebisu"
+
+DISTRO_FEATURES_remove = " use_eva_pkg"
+
+# Configuration for USB 3.0
+MACHINE_FEATURES_append = " usb3"
+
+IMAGE_INSTALL_append = " gstreamer1.0-omx gstreamer1.0-plugin-vspfilter"
+IMAGE_INSTALL_append = " kernel-module-mmngr kernel-module-mmngrbuf kernel-module-uvcs-drv kernel-module-vspmif"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc b/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc
new file mode 100644
index 00000000..74036111
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc
@@ -0,0 +1,3 @@
+# The H3-based (as opposed to the M3-based version) salvator-x needs a different
+# MACHINE but otherwise uses the same config as the H3.
+require conf/include/agl_h3ulcb.inc
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc
new file mode 100644
index 00000000..cee2acc3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc
@@ -0,0 +1,10 @@
+require conf/include/agl_ulcb-nogfx.inc
+SOC_FAMILY = "r8a7795"
+BOARD_NAME = "h3ulcb"
+
+DTB_SUFFIX = "r8a7795-h3ulcb"
+
+# Mask graphic Pkgs
+BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm"
+# Mask MMP recipes
+BBMASK += "kernel-module-uvcs-drv|omx-user-module"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc
new file mode 100644
index 00000000..00c2a70a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc
@@ -0,0 +1,5 @@
+require conf/include/agl_ulcb.inc
+SOC_FAMILY = "r8a7795"
+BOARD_NAME = "h3ulcb"
+
+DTB_SUFFIX = "r8a7795-h3ulcb"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc b/meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc
new file mode 100644
index 00000000..5967f237
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc
@@ -0,0 +1,5 @@
+KERNEL_IMAGETYPE = "uImage"
+WKS_FILE = "sdimage-hsdk.wks"
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz"
+IMAGE_BOOT_FILES = "uImage uboot.env"
+IMAGE_INSTALL_append = " kernel-modules"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc b/meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc
new file mode 100644
index 00000000..b5691778
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc
@@ -0,0 +1,21 @@
+DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+
+# This disables the Freescale/NXP Vivante GPU driver and enables
+# etnaviv support.
+MACHINEOVERRIDES .= ":use-mainline-bsp"
+
+# 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"
+
+# Set CMA size large enough to work with AGL
+UBOOT_EXTLINUX_KERNEL_ARGS_append = " cma=512M"
+
+# Generate WIC image also
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
+AGL_DEFAULT_INITRAMFS_FSTYPES := ""
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc b/meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
new file mode 100644
index 00000000..39ed6688
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
@@ -0,0 +1,18 @@
+# Enable Libvaapi for HW accelerated video support
+#
+IMAGE_INSTALL_append = " \
+ libva \
+ intel-vaapi-driver \
+ gstreamer1.0-vaapi"
+
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
+INITRD_LIVE = "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.ext4.gz"
+
+# Modify this file under meta-agl-bsp/meta-intel/wic to change the
+# kernel command line, including to change the screen resolution.
+WKS_FILE = "systemd-intel-corei7-64-bootdisk.wks"
+
+PREFERRED_VERSION_linux-intel ?= "4.19%"
+PREFERRED_VERSION_linux-intel-rt ?= "4.19%"
+
+SERIAL_CONSOLES_remove = "115200;ttyS2"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc
new file mode 100644
index 00000000..a5789c32
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc
@@ -0,0 +1,10 @@
+require conf/include/agl_ulcb-nogfx.inc
+SOC_FAMILY = "r8a7796"
+BOARD_NAME = "m3ulcb"
+
+DTB_SUFFIX = "r8a7796-m3ulcb"
+
+# Mask graphic Pkgs
+BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm"
+# Mask MMP recipes
+BBMASK += "kernel-module-uvcs-drv|omx-user-module"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc
new file mode 100644
index 00000000..7a1d6add
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc
@@ -0,0 +1,5 @@
+require conf/include/agl_ulcb.inc
+SOC_FAMILY = "r8a7796"
+BOARD_NAME = "m3ulcb"
+
+DTB_SUFFIX = "r8a7796-m3ulcb"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc b/meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc
new file mode 100644
index 00000000..5864354b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc
@@ -0,0 +1,22 @@
+DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+
+# This disables the Freescale/NXP Vivante GPU driver and enables
+# etnaviv support.
+MACHINEOVERRIDES .= ":use-mainline-bsp"
+
+# 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"
+
+# Set CMA size large enough to work with AGL
+UBOOT_EXTLINUX_KERNEL_ARGS_append = " cma=512M"
+
+# Generate WIC image also
+#WKS_FILE = "imx-uboot.wks"
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
+AGL_DEFAULT_INITRAMFS_FSTYPES := ""
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_qemuarm.inc b/meta-agl/meta-agl-bsp/conf/include/agl_qemuarm.inc
new file mode 100644
index 00000000..739eb8dd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_qemuarm.inc
@@ -0,0 +1,14 @@
+# Configuration for serial console
+#QB_KERNEL_CMDLINE_APPEND_append = " console=ttyAMA0,115200n8"
+#
+# All boot message will be off
+QB_KERNEL_CMDLINE_APPEND_append = " quiet"
+
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+#DISTRO_FEATURES_append = " sota"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Use our own wks file
+WKS_FILE="directdisk.wks.in"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_qemuarm64.inc b/meta-agl/meta-agl-bsp/conf/include/agl_qemuarm64.inc
new file mode 100644
index 00000000..ca2cc947
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_qemuarm64.inc
@@ -0,0 +1,17 @@
+# Configuration for serial console
+#QB_KERNEL_CMDLINE_APPEND_append = " console=ttyAMA0,115200n8"
+
+# All boot message will be off
+QB_KERNEL_CMDLINE_APPEND_append = " quiet"
+
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+DISTRO_FEATURES_append = " sota"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Over-ride setting in oe-core's qemuarm64.conf
+QB_MEM_qemuarm64 = "-m 2048"
+
+# Use our own wks file
+WKS_FILE="directdisk.wks.in"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc b/meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc
new file mode 100644
index 00000000..a72f7b0f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc
@@ -0,0 +1,34 @@
+# Configurations to run on VirtualBox/VMWare
+#
+# To get wide screen than default, there are a selection of resolutions
+# available:
+#
+#UVESA_MODE = "1024x768-32"
+UVESA_MODE = "1280x1024-32"
+#UVESA_MODE = "1600x1200-32"
+#
+# To avoid corrupt boot screen by systemd message, you can use serial
+# console separated from VGA console or disable all boot messages by
+# kernel command line.
+#
+# Configuration for serial console
+QB_KERNEL_CMDLINE_APPEND_append = " console=ttyS0,115200n8"
+#
+# All boot message will be off
+QB_KERNEL_CMDLINE_APPEND_append = " quiet"
+
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+DISTRO_FEATURES_append = " sota"
+
+# Image support
+AGL_EXTRA_IMAGE_FSTYPES = "ext4 wic.vmdk"
+IMAGE_BOOT_FILES_sota = "u-boot-qemux86-64.rom"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Force the virtio video device as 'vmware' doesn't always work
+QB_OPT_APPEND_append = " -vga virtio"
+
+# Use our own wks file
+WKS_FILE="directdisk.wks.in"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc b/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
new file mode 100644
index 00000000..cc307485
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
@@ -0,0 +1,42 @@
+# Maximum memory allowed to be assigned
+GPU_MEM = "128"
+
+ENABLE_CMA = "1"
+# Add CMA to the kernel arguments for SOTA
+OSTREE_KERNEL_ARGS_sota_append = " cma=256M"
+CMA_LWM = "16"
+CMA_HWM = "32"
+
+MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
+
+# The correct config for a Raspberry Pi 3 in 32bit mode
+UBOOT_MACHINE = "rpi_3_32b_config"
+
+KERNEL_IMAGETYPE = "uImage"
+
+MACHINE_FEATURES += "vc4graphics"
+
+# For libomxil
+#LICENSE_FLAGS_WHITELIST = "commercial"
+
+IMAGE_INSTALL_append = " kernel-modules linux-firmware-rpidistro-bcm43430 linux-firmware-rpidistro-bcm43455 create-combined-dtb "
+
+# Psplash causes crash on first boot on RPi
+IMAGE_FEATURES_remove = "splash"
+
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+DISTRO_FEATURES_append = " sota"
+
+# Create WIC images to write to SD cards.
+WKS_FILE = "sdimage-raspberrypi.wks"
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
+IMAGE_BOOT_FILES = "bcm2835-bootfiles/* \
+ ${@make_dtb_boot_files(d)} \
+ ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', \
+ '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \
+ '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \
+ "
+do_image_wic[depends] += " \
+ bcm2835-bootfiles:do_deploy \
+ ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'u-boot:do_deploy', '',d)} \
+ "
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc
new file mode 100644
index 00000000..8d97996f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc
@@ -0,0 +1,10 @@
+DISTRO_FEATURES_append = " sota"
+
+OSTREE_KERNEL = "Image"
+IMAGE_BOOT_FILES_sota = "renesas-ota-bootfiles/* Image-${DTB_SUFFIX}.dtb"
+OSTREE_BOOTLOADER ?= "u-boot"
+
+WKS_FILE = "singlepart-noloader.wks"
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum"
+
+RENESAS_DATADIR = "/usr"
diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc b/meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc
new file mode 100644
index 00000000..d71a6941
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc
@@ -0,0 +1,41 @@
+require conf/include/agl_ulcb-nogfx.inc
+
+# Enable AGL virtualization features
+MACHINE_FEATURES_append = " agl-egvirt"
+
+# for Wayland/Weston weston-laucher
+DISTRO_FEATURES_append = " pam"
+
+# Enable Gfx Pkgs
+MACHINE_FEATURES_append = " gsx"
+MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
+
+# for Wayland/Weston
+PREFERRED_PROVIDER_virtual/libgles1 = ""
+PREFERRED_PROVIDER_virtual/libgles2 = "virtual-gles-user-module"
+PREFERRED_PROVIDER_virtual/egl = "virtual-gles-user-module"
+PREFERRED_PROVIDER_virtual/libgl = ""
+PREFERRED_PROVIDER_virtual/mesa = "mesa"
+PREFERRED_PROVIDER_libgbm = "libgbm"
+PREFERRED_RPROVIDER_libgbm-dev = "libgbm"
+
+PREFERRED_RPROVIDER_libomxil = "omx-user-module"
+
+# Add for gstreamer plugins ugly
+LICENSE_FLAGS_WHITELIST = "commercial"
+
+MACHINE_FEATURES_append = " multimedia"
+
+DISTRO_FEATURES_append = " use_eva_pkg"
+
+#DISTRO_FEATURES_append = " h265dec_lib mpeg2dec_lib"
+DISTRO_FEATURES_append = " h264dec_lib h264enc_lib aaclcdec_lib aaclcdec_mdw"
+
+IMAGE_INSTALL_append_rcar-gen3 = " \
+ kernel-devicetree \
+ kernel-module-pvrsrvkm \
+ kernel-module-vsp2 \
+ kernel-module-vspm \
+ kernel-module-vspm-if \
+ omx-user-module \
+"
diff --git a/meta-agl/meta-agl-bsp/conf/layer.conf b/meta-agl/meta-agl-bsp/conf/layer.conf
new file mode 100644
index 00000000..35bf8112
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/layer.conf
@@ -0,0 +1,26 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH =. "${LAYERDIR}:"
+
+# Let us add layer-specific bbappends which are only applied when that
+# layer is included in our configuration -
+# e.g. only add layers if a bsp is present.
+# This is based on the BBFILE_COLLECTIONS name of the layer.
+# We use either the BBFILE_COLLECTIONS name of the layer directly (meta-ti)
+BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bbappend' % layer \
+ for layer in BBFILE_COLLECTIONS.split())}"
+BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bb' % layer \
+ for layer in BBFILE_COLLECTIONS.split())}"
+# or we prepend it with meta- (e.g. rpi, fsl*)
+BBFILES += "${@' '.join('${LAYERDIR}/meta-%s/recipes*/*/*.bbappend' % layer \
+ for layer in BBFILE_COLLECTIONS.split())}"
+BBFILES += "${@' '.join('${LAYERDIR}/meta-%s/recipes*/*/*.bb' % layer \
+ for layer in BBFILE_COLLECTIONS.split())}"
+
+# Add shared recipes among BSPs
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "aglbsp"
+BBFILE_PATTERN_aglbsp = "^${LAYERDIR}/"
+BBFILE_PRIORITY_aglbsp = "60"
+
+LAYERSERIES_COMPAT_aglbsp = "thud"
diff --git a/meta-agl/meta-agl-bsp/conf/machine/qemuarm.conf b/meta-agl/meta-agl-bsp/conf/machine/qemuarm.conf
new file mode 100644
index 00000000..8d41d692
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/machine/qemuarm.conf
@@ -0,0 +1,18 @@
+#@TYPE: Machine
+#@NAME: armv7a
+#@DESCRIPTION: generic ARM 32bit
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/arm/arch-armv7ve.inc
+
+KERNEL_IMAGETYPE = "zImage"
+
+SERIAL_CONSOLES ?= "38400;ttyAMA0 38400;hvc0"
+
+# For runqemu
+QB_SYSTEM_NAME = "qemu-system-arm"
+QB_MACHINE = "-machine virt"
+
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-show-cursor -usb -device virtio-rng-pci"
+PREFERRED_VERSION_linux-yocto ??= "4.18%"
diff --git a/meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf b/meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf
new file mode 100644
index 00000000..2f759286
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf
@@ -0,0 +1,26 @@
+#@TYPE: Machine
+#@NAME: RaspberryPi 4 Development Board (32bit)
+#@DESCRIPTION: Machine configuration for the RaspberryPi 4 in 32 bit mode
+
+DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4"
+require conf/machine/include/tune-cortexa7.inc
+include conf/machine/include/rpi-base.inc
+
+MACHINE_EXTRA_RRECOMMENDS += "\
+ linux-firmware-rpidistro-bcm43455 \
+ bluez-firmware-rpidistro-bcm4345c0-hcd \
+ pi-bluetooth \
+"
+
+# 'l' stands for LPAE
+SDIMG_KERNELIMAGE ?= "kernel7l.img"
+UBOOT_MACHINE = "rpi_4_32b_config"
+SERIAL_CONSOLES ?= "115200;ttyS0"
+
+MACHINE_FEATURES_append = " vc4graphics"
+VC4DTBO ?= "vc4-fkms-v3d"
+
+RPI_KERNEL_DEVICETREE_OVERLAYS_remove_raspberrypi4 = "overlays/lirc-rpi.dtbo"
+RPI_KERNEL_DEVICETREE_OVERLAYS_append_raspberrypi4 = " overlays/mcp2515-can0.dtbo overlays/vc4-fkms-v3d.dtbo"
+RPI_KERNEL_DEVICETREE_remove_raspberrypi4 = "bcm2708-rpi-0-w.dtb"
+RPI_KERNEL_DEVICETREE_append_raspberrypi4 = " bcm2708-rpi-zero-w.dtb bcm2711-rpi-4-b.dtb"
diff --git a/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 00000000..49e52770
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,6 @@
+# The gallium-llvm is recommended as software 3D graphics renderer
+GALLIUM_LLVM = "gallium-llvm"
+PACKAGECONFIG_append_qemux86 = " gallium ${GALLIUM_LLVM}"
+PACKAGECONFIG_append_qemux86-64 = " gallium ${GALLIUM_LLVM}"
+
+DRIDRIVERS_append_intel-corei7-64 = ",i965"
diff --git a/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/libva_%.bbappend b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/libva_%.bbappend
new file mode 100644
index 00000000..eda8de38
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/libva_%.bbappend
@@ -0,0 +1,4 @@
+# This patch correct a bug in libva1_1.7.0.bb 1.8 inmeta-intel (no clue when it will be fixed)
+# libva.bb calls for an x11 runtime dependency even if wayland is selected
+#
+RDEPENDS_${PN}-egl_remove = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "${PN}-x11", d)}"
diff --git a/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 00000000..8fa08bc3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+# OVERRIDES save us some c'n'p below ...
+OVERRIDES_prepend_qemux86 = "virtualmachine:"
+OVERRIDES_prepend_qemux86-64 = "virtualmachine:"
+
+# Switch to the Virtual section that we have when a valid DRM device is found
+SRC_URI_remove_virtualmachine = "file://hdmi-a-1-270.cfg"
+SRC_URI_append_virtualmachine = " file://virtual.cfg"
diff --git a/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf/virtual.cfg b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf/virtual.cfg
new file mode 100644
index 00000000..25a8fae9
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston-ini-conf/virtual.cfg
@@ -0,0 +1,18 @@
+[output]
+name=Virtual-1
+transform=270
+mode=1920x1080
+#mode=1600x1200
+#mode=1680x1050
+#mode=1400x1050
+#mode=1600x900
+#mode=1280x1024
+#mode=1440x900
+#mode=1280x960
+#mode=1360x768
+#mode=1280x800
+#mode=1280x768
+#mode=1280x720
+#mode=800x600
+#mode=848x480
+#mode=640x480
diff --git a/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston_%.bbappend b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston_%.bbappend
new file mode 100644
index 00000000..9aaea5f6
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-aglprofilegraphical/recipes-graphics/wayland/weston_%.bbappend
@@ -0,0 +1,3 @@
+RDEPENDS_${PN}_append_qemux86 = " mesa-megadriver"
+RDEPENDS_${PN}_append_qemux86-64 = " mesa-megadriver"
+RDEPENDS_${PN}_append_intel-corei7-64 = " mesa-megadriver"
diff --git a/meta-agl/meta-agl-bsp/meta-core/recipes-core/ovmf/ovmf_git.bbappend b/meta-agl/meta-agl-bsp/meta-core/recipes-core/ovmf/ovmf_git.bbappend
new file mode 100644
index 00000000..28584729
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-core/recipes-core/ovmf/ovmf_git.bbappend
@@ -0,0 +1 @@
+PARALLEL_MAKE = ""
diff --git a/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg
new file mode 100755
index 00000000..c9c4fe2e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg
@@ -0,0 +1,17 @@
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_INTEL=m
+CONFIG_BT_BCM=m
+CONFIG_BT_RTL=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTUSB_BCM=y
+CONFIG_BT_HCIBTUSB_RTL=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL_CP210X=y
diff --git a/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/most_deps.cfg b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/most_deps.cfg
new file mode 100644
index 00000000..15ddbd21
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/most_deps.cfg
@@ -0,0 +1,9 @@
+CONFIG_I2C=y
+CONFIG_USB=y
+CONFIG_MEDIA_SUPPORT=m
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_VIDEO_V4L2=m
diff --git a/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/qemuarm.cfg b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/qemuarm.cfg
new file mode 100644
index 00000000..e71c714d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/qemuarm.cfg
@@ -0,0 +1,6 @@
+# Necessary configs for using the virt qemu machine
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_VIRT=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_PCI_HOST_GENERIC=y
+CONFIG_RTC_DRV_PL031=y
diff --git a/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/virtio.cfg b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/virtio.cfg
new file mode 100644
index 00000000..d042d7d6
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/virtio.cfg
@@ -0,0 +1,6 @@
+# qemu need a virtio storage for rootfs
+CONFIG_BLK_MQ_VIRTIO=y
+CONFIG_VIRTIO=y
+CONFIG_VIRTIO_BLK=y
+# qemuarm need virtionet
+CONFIG_VIRTIO_NET=y
diff --git a/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend
new file mode 100644
index 00000000..e97b8f9d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -0,0 +1,17 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:"
+
+# Extra configuration options for the QEMU kernel
+SRC_URI += "file://hciattach.cfg \
+ file://virtio.cfg \
+ "
+
+# Enable some things on qemuarm64 so MOST drivers will build and load.
+SRC_URI_append_qemuarm64 = " file://most_deps.cfg"
+
+# Configuration for using the virt machine (and not versatilepb)
+SRC_URI_append_qemuarm = " file://qemuarm.cfg"
+
+# Build a generic v7 kernel instead of the arm926j one that upstream
+# qemuarm defaults to.
+KBUILD_DEFCONFIG_qemuarm = "multi_v7_defconfig"
+KCONFIG_MODE = "--alldefconfig"
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf/fbdev.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf/fbdev.cfg
new file mode 100644
index 00000000..b1a1f3cc
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf/fbdev.cfg
@@ -0,0 +1,3 @@
+[output]
+name=fbdev
+transform=270
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 00000000..2e1c950e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1 @@
+WESTONARGS_append_imxgpu3d = " --use-gl"
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
new file mode 100644
index 00000000..1b17bc73
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
@@ -0,0 +1,49 @@
+From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
+From: jooseong lee <jooseong.lee@samsung.com>
+Date: Thu, 3 Nov 2016 10:55:43 +0100
+Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
+
+Creating struct sock by sk_alloc function in various kernel subsystems
+like bluetooth dosen't call smack_socket_post_create(). In such case,
+received sock label is the floor('_') label and makes access deny.
+
+Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
+
+Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
+Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
+Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+---
+ security/smack/smack_lsm.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
+index e45f0a3..a3f3ccc 100644
+--- a/security/smack/smack_lsm.c
++++ b/security/smack/smack_lsm.c
+@@ -2107,8 +2107,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
+ if (ssp == NULL)
+ return -ENOMEM;
+
+- ssp->smk_in = skp;
+- ssp->smk_out = skp;
++ /*
++ * Sockets created by kernel threads receive web label.
++ */
++ if (unlikely(current->flags & PF_KTHREAD)) {
++ ssp->smk_in = &smack_known_web;
++ ssp->smk_out = &smack_known_web;
++ } else {
++ ssp->smk_in = skp;
++ ssp->smk_out = skp;
++ }
+ ssp->smk_packet = NULL;
+
+ sk->sk_security = ssp;
+--
+2.7.4
+
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg
new file mode 100644
index 00000000..3550a7bf
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg
@@ -0,0 +1 @@
+CONFIG_CFG80211=y
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg
new file mode 100644
index 00000000..14984ccd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg
@@ -0,0 +1,24 @@
+CONFIG_BPF=y
+CONFIG_BPF_SYSCALL=y
+CONFIG_CGROUPS=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_SWAP=y
+CONFIG_MEMCG_SWAP_ENABLED=y
+CONFIG_MEMCG_KMEM=y
+CONFIG_CGROUP_DEBUG=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CGROUP_CPUACCT=y
+# CONFIG_CGROUP_HUGETLB is not set
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_BPF=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_BLK_CGROUP=y
+# CONFIG_DEBUG_BLK_CGROUP is not set
+CONFIG_CGROUP_WRITEBACK=y
+# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set
+CONFIG_NET_CLS_CGROUP=y
+CONFIG_CGROUP_NET_PRIO=y
+CONFIG_CGROUP_NET_CLASSID=y
+
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg
new file mode 100644
index 00000000..d6b3a30f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg
@@ -0,0 +1,8 @@
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_FW_LOADER_USER_HELPER is not set
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/namespace.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/namespace.cfg
new file mode 100644
index 00000000..6254019c
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/namespace.cfg
@@ -0,0 +1,6 @@
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/tmpfs.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/tmpfs.cfg
new file mode 100644
index 00000000..8385bb18
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/tmpfs.cfg
@@ -0,0 +1,2 @@
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_TMPFS_XATTR=y
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/touchscreen.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/touchscreen.cfg
new file mode 100644
index 00000000..fbd0e322
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/touchscreen.cfg
@@ -0,0 +1,2 @@
+CONFIG_HID_MULTITOUCH=y
+
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend
new file mode 100644
index 00000000..54159823
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend
@@ -0,0 +1,23 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+require recipes-kernel/linux/linux-agl.inc
+
+# Make sure these are enabled so that AGL configurations work
+SRC_URI_append = " file://tmpfs.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/tmpfs.cfg"
+SRC_URI_append = " file://namespace.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/namespace.cfg"
+SRC_URI_append = " file://cgroup.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cgroup.cfg"
+
+#-------------------------------------------------------------------------
+# smack patches for handling bluetooth
+
+SRC_URI_append_with-lsm-smack = "\
+ file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
+"
+
+# Support for CFG80211 subsystem
+SRC_URI_append = " file://cfg80211.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cfg80211.cfg"
+
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend
new file mode 100644
index 00000000..640f9cfe
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend
@@ -0,0 +1,25 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+require recipes-kernel/linux/linux-agl.inc
+
+# Make sure these are enabled so that AGL configurations work
+SRC_URI_append = " file://tmpfs.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/tmpfs.cfg"
+SRC_URI_append = " file://namespace.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/namespace.cfg"
+SRC_URI_append = " file://cgroup.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cgroup.cfg"
+
+# Support for CFG80211 subsystem
+SRC_URI_append = " file://cfg80211.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cfg80211.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"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/fixups.cfg"
+
+do_install_append_cubox-i() {
+ # Add symlink to work with default Hummingboard 2 u-boot configuration
+ ln -sf imx6q-hummingboard2.dtb ${D}/boot/imx6q-hummingboard2-emmc.dtb
+}
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch
new file mode 100644
index 00000000..8489b6f3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch
@@ -0,0 +1,17 @@
+Index: git/mkspecs/linux-oe-g++/qmake.conf
+===================================================================
+--- git.orig/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 16:51:48.468955533 -0600
++++ git/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 17:03:17.000000000 -0600
+@@ -39,5 +39,12 @@ isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG
+
+ include(../oe-device-extra.pri)
+
++QMAKE_CFLAGS += -DLINUX=1 -DEGL_API_FB=1
++QMAKE_CXXFLAGS += -DLINUX=1 -DEGL_API_FB=1
++
++QMAKE_LIBS_EGL += -lEGL
++QMAKE_LIBS_OPENGL_ES2 += -lEGL -lGLESv2
++QMAKE_LIBS_OPENVG += -lEGL -lOpenVG
++
+ load(device_config)
+ load(qt_config)
diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend
new file mode 100644
index 00000000..c4afc30e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend
@@ -0,0 +1,5 @@
+
+# Fixing Qt5.8 build breaks by overriding original patches with ours
+# This will be fixed in the latest meta-freescale upstream
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 00000000..00767197
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,3 @@
+# Select a different rotation for our default panel.
+SRC_URI_remove = "file://hdmi-a-1-270.cfg"
+SRC_URI += "file://hdmi-a-1-90.cfg"
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg
new file mode 100644
index 00000000..125406ea
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg
@@ -0,0 +1,54 @@
+CONFIG_MWIFIEX_PCIE=m
+CONFIG_MWIFIEX_USB=m
+CONFIG_RSI_91X=m
+CONFIG_RSI_DEBUGFS=y
+CONFIG_RSI_SDIO=m
+CONFIG_RSI_USB=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_RADEON_USERPTR=y
+# CONFIG_DRM_RADEON_UMS is not set
+CONFIG_DRM_NOUVEAU=m
+CONFIG_NOUVEAU_DEBUG=5
+CONFIG_NOUVEAU_DEBUG_DEFAULT=3
+CONFIG_DRM_NOUVEAU_BACKLIGHT=y
+CONFIG_DRM_VGEM=m
+CONFIG_DRM_VMWGFX=m
+CONFIG_DRM_VMWGFX_FBCON=y
+CONFIG_DRM_GMA500=m
+CONFIG_DRM_GMA600=y
+CONFIG_DRM_GMA3600=y
+CONFIG_DRM_UDL=m
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_FB_BACKLIGHT=y
+# CONFIG_LEDS_DELL_NETBOOKS is not set
+CONFIG_IRQ_BYPASS_MANAGER=m
+# CONFIG_ACER_WMI is not set
+# CONFIG_ALIENWARE_WMI is not set
+# CONFIG_DELL_WMI is not set
+# CONFIG_DELL_WMI_AIO is not set
+# CONFIG_HP_WMI is not set
+# CONFIG_ASUS_WMI is not set
+CONFIG_ACPI_WMI=m
+# CONFIG_MSI_WMI is not set
+# CONFIG_ACPI_TOSHIBA is not set
+# CONFIG_TOSHIBA_WMI is not set
+CONFIG_MXM_WMI=m
+CONFIG_SCHED_INFO=y
+CONFIG_HAVE_KVM_IRQCHIP=y
+CONFIG_HAVE_KVM_IRQFD=y
+CONFIG_HAVE_KVM_IRQ_ROUTING=y
+CONFIG_HAVE_KVM_EVENTFD=y
+CONFIG_KVM_APIC_ARCHITECTURE=y
+CONFIG_KVM_MMIO=y
+CONFIG_KVM_ASYNC_PF=y
+CONFIG_HAVE_KVM_MSI=y
+CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
+CONFIG_KVM_VFIO=y
+CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
+CONFIG_KVM_COMPAT=y
+CONFIG_HAVE_KVM_IRQ_BYPASS=y
+CONFIG_KVM=m
+CONFIG_KVM_INTEL=m
+# CONFIG_KVM_AMD is not set
+# CONFIG_KVM_MMU_AUDIT is not set
+CONFIG_CRC7=m
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc
new file mode 100644
index 00000000..d94108d9
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc
@@ -0,0 +1,3 @@
+
+branch bxt-rebase
+mark patching start
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg
new file mode 100644
index 00000000..4dcf4036
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg
@@ -0,0 +1,3 @@
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_NBD=y
+CONFIG_BLK_DEV_INITRD=y
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg
new file mode 100644
index 00000000..ab88cedc
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg
@@ -0,0 +1,2 @@
+CONFIG_IGB=y
+CONFIG_R8169=y
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg
new file mode 100644
index 00000000..b66b1b9b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg
@@ -0,0 +1,3 @@
+CONFIG_TCG_TPM=y
+CONFIG_TCG_TIS=y
+CONFIG_TCG_CRB=y
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh
new file mode 100644
index 00000000..33746243
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh
@@ -0,0 +1 @@
+fs0:EFI\BOOT\BOOTx64.EFI
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg
new file mode 100644
index 00000000..7be178bf
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg
@@ -0,0 +1,4 @@
+CONFIG_MFD_CORE=y
+CONFIG_MFD_INTEL_LPSS=y
+CONFIG_MFD_INTEL_LPSS_ACPI=y
+CONFIG_MFD_INTEL_LPSS_PCI=y
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg
new file mode 100644
index 00000000..b65e55b0
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg
@@ -0,0 +1,81 @@
+CONFIG_BT_QCA=m
+CONFIG_BT_HCIBTSDIO=m
+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_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_SPY=y
+CONFIG_WEXT_PRIV=y
+CONFIG_CFG80211_WEXT_EXPORT=y
+CONFIG_LIB80211=m
+CONFIG_LIB80211_CRYPT_WEP=m
+CONFIG_LIB80211_CRYPT_CCMP=m
+CONFIG_LIB80211_CRYPT_TKIP=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_VHOST_NET=m
+CONFIG_VHOST_RING=m
+CONFIG_VHOST=m
+CONFIG_MICROCHIP_PHY=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8152=m
+CONFIG_USB_LAN78XX=m
+CONFIG_USB_NET_SR9800=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_HSO=m
+CONFIG_USB_IPHETH=m
+CONFIG_USB_ZD1201=m
+CONFIG_USB_NET_RNDIS_WLAN=m
+CONFIG_RTL8180=m
+CONFIG_RTL8187=m
+CONFIG_RTL8187_LEDS=y
+CONFIG_MWL8K=m
+# CONFIG_B43_BUSES_BCMA_AND_SSB is not set
+# CONFIG_B43_BUSES_BCMA is not set
+# CONFIG_B43_BUSES_SSB is not set
+CONFIG_BRCMFMAC_PROTO_MSGBUF=y
+CONFIG_BRCMFMAC_PCIE=y
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+CONFIG_IPW2100_DEBUG=y
+CONFIG_IPW2200=m
+CONFIG_IPW2200_MONITOR=y
+CONFIG_IPW2200_RADIOTAP=y
+CONFIG_IPW2200_PROMISCUOUS=y
+CONFIG_IPW2200_QOS=y
+CONFIG_IPW2200_DEBUG=y
+CONFIG_LIBIPW=m
+CONFIG_LIBIPW_DEBUG=y
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+CONFIG_LIBERTAS_SDIO=m
+CONFIG_LIBERTAS_SPI=m
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_MESH is not set
+CONFIG_RTL8XXXU=m
+CONFIG_RTL8XXXU_UNTESTED=y
+CONFIG_WL_TI=y
+CONFIG_WL1251=m
+# CONFIG_WL1251_SPI is not set
+# CONFIG_WL1251_SDIO is not set
+CONFIG_WL12XX=m
+CONFIG_WL18XX=m
+CONFIG_WLCORE=m
+CONFIG_WLCORE_SPI=m
+CONFIG_WLCORE_SDIO=m
+CONFIG_WILINK_PLATFORM_DATA=y
+CONFIG_ZD1211RW=m
+CONFIG_ZD1211RW_DEBUG=y
+CONFIG_MWIFIEX=m
+# CONFIG_MWIFIEX_SDIO is not set
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend
new file mode 100644
index 00000000..88ac94b1
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend
@@ -0,0 +1 @@
+require recipes-kernel/linux/linux-agl.inc
diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend
new file mode 100644
index 00000000..9827b3e7
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend
@@ -0,0 +1,28 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+# adding most supported USB Bluetooth, Wifi, and Ethernet devices
+SRC_URI_append = " file://usb-devices.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/usb-devices.cfg"
+
+# adding support for other graphic cards to work on more PC HW
+SRC_URI_append = " file://extra-graphic-devices.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/extra-graphic-devices.cfg"
+
+# adding internal network in kernel for network boot
+SRC_URI_append = " file://net-devices.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/net-devices.cfg"
+
+# adding specific driver needed by the upsquare board
+SRC_URI_append = " file://upsquare.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/upsquare.cfg"
+
+# adding CONFIG needed by LAVA and NBD
+SRC_URI_append = " file://lava.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/lava.cfg"
+
+# Ensure we have a startup.nsh file
+SRC_URI_append = " file://startup.nsh"
+
+do_deploy_append() {
+ install -m 0755 ${WORKDIR}/startup.nsh ${DEPLOYDIR}/
+}
diff --git a/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.12.bb b/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.12.bb
new file mode 100644
index 00000000..446770f8
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.12.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Useful bits an pieces to make 96Boards more standard across the board"
+HOMEPAGE = "https://github.com/96boards/96boards-tools"
+SECTION = "devel"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRCREV = "ed0f0dbec02c1869a0c4fa0140b4aa5338c9d010"
+SRC_URI = "git://github.com/96boards/96boards-tools;branch=master;protocol=https"
+
+S = "${WORKDIR}/git"
+
+inherit systemd allarch update-rc.d
+
+do_install () {
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0755 ${S}/*.rules ${D}${sysconfdir}/udev/rules.d/
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${S}/resize-disk ${D}${sysconfdir}/init.d/
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${S}/resize-helper.service ${D}${systemd_unitdir}/system
+
+ install -d ${D}${sbindir}
+ install -m 0755 ${S}/resize-helper ${D}${sbindir}
+}
+
+INITSCRIPT_NAME = "resize-disk"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "resize-helper.service"
+RDEPENDS_${PN} += "e2fsprogs-resize2fs gptfdisk parted util-linux udev"
diff --git a/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/files/qcom-q6v5-pil.service b/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/files/qcom-q6v5-pil.service
new file mode 100644
index 00000000..3d9cd24b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/files/qcom-q6v5-pil.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Qualcomm Hexagon PIL setup
+After=rmtfs.service
+Requires=rmtfs.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/sbin/modprobe -q qcom_q6v5_pil
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/q6v5-pil.bb b/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/q6v5-pil.bb
new file mode 100644
index 00000000..19f0760a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-qcom/recipes-bsp/q6v5-pil/q6v5-pil.bb
@@ -0,0 +1,20 @@
+inherit systemd
+
+SUMMARY = "Systemd unit file for the delay loading Hexagon PIL kernel module"
+SECTION = "misc"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI += "file://qcom-q6v5-pil.service"
+
+do_install() {
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/qcom-q6v5-pil.service ${D}${systemd_unitdir}/system
+
+ # Blacklist qcom_q6v5_pil to prevent modules autoload
+ # qcom-q6v5-pil.service will do the work after rmtfs done.
+ install -d ${D}/${sysconfdir}/modprobe.d
+ echo "blacklist qcom_q6v5_pil" > ${D}/${sysconfdir}/modprobe.d/qcom_q6v5_pil.conf
+}
+
+SYSTEMD_SERVICE_${PN} = "qcom-q6v5-pil.service"
diff --git a/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend b/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend
new file mode 100644
index 00000000..0b2b99d4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+require recipes-kernel/linux/linux-agl.inc
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend
new file mode 100644
index 00000000..009c448b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend
@@ -0,0 +1,12 @@
+RDEPENDS_${PN}_append_sota += " u-boot-otascript"
+
+RPIFW_DATE_raspberrypi4 = "20190709"
+SRCREV_raspberrypi4 = "356f5c2880a3c7e8774025aa6fc934a617553e7b"
+RPIFW_SRC_URI_raspberrypi4 = "https://github.com/raspberrypi/firmware/archive/${SRCREV}.tar.gz"
+RPIFW_S_raspberrypi_4 = "${WORKDIR}/firmware-${SRCREV}"
+
+SRC_URI_raspberrypi4 = "${RPIFW_SRC_URI}"
+SRC_URI[md5sum] = "${@ '5962784e7963f0116cd1519e47749b25' if d.getVar('MACHINE_ARCH') == 'raspberrypi4' else '5ccdb5447cbdd3ee0158a514f7b76cb9'}"
+SRC_URI[sha256sum] = "${@ '6e07d98e4229ba7a1970a4c475fc6b8631823d200d3b8734a508e7ff5ea4c120' if d.getVar('MACHINE_ARCH') == 'raspberrypi4' else '9a34ccc4a51695a33206cc6c8534f615ba5a30fcbce5fa3add400ecc6b80ad8a'}"
+
+PV_raspberrypi4 = "${RPIFW_DATE}"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
new file mode 100644
index 00000000..5c74cae7
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
@@ -0,0 +1,43 @@
+DISABLE_OVERSCAN = "1"
+
+do_deploy_append_raspberrypi4() {
+ # ENABLE CAN
+ if [ "${ENABLE_CAN}" = "1" ]; then
+ echo "# Enable CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ fi
+
+ # Handle setup with armstub file
+ if [ -n "${ARMSTUB}" ]; then
+ echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ case "${ARMSTUB}" in
+ *-gic.bin)
+ echo "enable_gic=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ ;;
+ esac
+ fi
+}
+
+do_deploy_append() {
+ if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_LWM}" ]; then
+ sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ fi
+
+ if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_HWM}" ]; then
+ sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ fi
+
+ echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+}
+
+do_deploy_append_sota() {
+ echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+}
+
+ENABLE_UART_raspberrypi3 = "1"
+ENABLE_UART_raspberrypi4 = "1"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb
new file mode 100644
index 00000000..ccaefc71
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb
@@ -0,0 +1,32 @@
+DESCRIPTION = "Boot script for launching OTA-enabled images on raspberrypi"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "u-boot-mkimage-native"
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
+SRC_URI = "file://boot.scr \
+ file://uEnv.txt \
+ file://uEnv.cma.txt \
+ "
+
+S = "${WORKDIR}"
+
+inherit deploy
+
+do_deploy() {
+ install -d ${DEPLOYDIR}/bcm2835-bootfiles
+
+ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ostree boot script" -d ${S}/boot.scr ${DEPLOYDIR}/bcm2835-bootfiles/boot.scr
+ if [ "${ENABLE_CMA}" = "1" ]; then
+ install -m 0755 ${S}/uEnv.cma.txt ${DEPLOYDIR}/bcm2835-bootfiles/uEnv.txt
+ else
+ install -m 0755 ${S}/uEnv.txt ${DEPLOYDIR}/bcm2835-bootfiles/uEnv.txt
+ fi
+}
+
+addtask deploy before do_package after do_install
+do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr
new file mode 100644
index 00000000..dc13f85b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr
@@ -0,0 +1,3 @@
+fatload mmc 0:1 $loadaddr /uEnv.txt
+env import -t $loadaddr $filesize
+run bootcmd
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt
new file mode 100644
index 00000000..062bddb9
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt
@@ -0,0 +1,21 @@
+bootcmd_resetvars=setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2
+bootcmd_otenv=run bootcmd_resetvars; load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
+bootcmd_rollbackenv=setenv kernel_image ${kernel_image2}; setenv bootargs ${bootargs2}
+
+bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 panic=1 coherent_pool=6M smsc95xx.turbo_mode=N"
+
+bootcmd_getroot=setexpr ostree_root gsub "^.*ostree=([^ ]*).*$" "\\\\1" "${bootargs}";
+
+bootcmd_fitconf=run bootcmd_getroot; if test -e mmc 0:2 "${ostree_root}/usr/lib/fit_conf"; then load mmc 0:2 $loadaddr "${ostree_root}/usr/lib/fit_conf"; env import -t $loadaddr $filesize; fi
+
+bootcmd_load=load mmc 0:2 $ramdisk_addr_r "/boot"$kernel_image
+bootcmd_run=bootm "${ramdisk_addr_r}${fit_conf}"
+
+bootcmd_create_envfile=if test ! -e mmc 0:1 uboot.env; then saveenv; fi;
+
+bootlimit=3
+
+bootcmd=if test "${rollback}" = "1"; then run altbootcmd; else run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; if ! "${upgrade_available}" = "1"; then setenv upgrade_available 1; saveenv; fi; reset; fi
+
+bootcmd_set_rollback=if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi
+altbootcmd=run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_set_rollback; if test -n "${kernel_image2}"; then run bootcmd_rollbackenv; fi; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; reset
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
new file mode 100644
index 00000000..436fe95f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
@@ -0,0 +1,21 @@
+bootcmd_resetvars=setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2
+bootcmd_otenv=run bootcmd_resetvars; load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
+bootcmd_rollbackenv=setenv kernel_image ${kernel_image2}; setenv bootargs ${bootargs2}
+
+bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 panic=1"
+
+bootcmd_getroot=setexpr ostree_root gsub "^.*ostree=([^ ]*).*$" "\\\\1" "${bootargs}";
+
+bootcmd_fitconf=run bootcmd_getroot; if test -e mmc 0:2 "${ostree_root}/usr/lib/fit_conf"; then load mmc 0:2 $loadaddr "${ostree_root}/usr/lib/fit_conf"; env import -t $loadaddr $filesize; fi
+
+bootcmd_load=load mmc 0:2 $ramdisk_addr_r "/boot"$kernel_image
+bootcmd_run=bootm "${ramdisk_addr_r}${fit_conf}"
+
+bootcmd_create_envfile=if test ! -e mmc 0:1 uboot.env; then saveenv; fi;
+
+bootlimit=3
+
+bootcmd=if test "${rollback}" = "1"; then run altbootcmd; else run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; if ! "${upgrade_available}" = "1"; then setenv upgrade_available 1; saveenv; fi; reset; fi
+
+bootcmd_set_rollback=if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi
+altbootcmd=run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_set_rollback; if test -n "${kernel_image2}"; then run bootcmd_rollbackenv; fi; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; reset
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch
new file mode 100644
index 00000000..964cdb7a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch
@@ -0,0 +1,82 @@
+From 86cc911aaa958fedf2ea9cb04b4af17f5357815d Mon Sep 17 00:00:00 2001
+From: Anton Gerasimov <anton.gerasimov@here.com>
+Date: Fri, 1 Feb 2019 14:39:48 +0100
+Subject: [PATCH] board: raspberrypi: add serial and revision to the device
+ tree
+
+Raspberry Pi bootloader adds this node to fdt, but if u-boot script
+doesn't reuse the tree provided by it, this information is lost.
+
+Revision and serial are displayed in /proc/cpuinfo after boot.
+
+Signed-off-by: Anton Gerasimov <anton.gerasimov@here.com>
+---
+ board/raspberrypi/rpi/rpi.c | 31 +++++++++++++++++++++++++++++--
+ 1 file changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
+index 35f5939552..114178397e 100644
+--- a/board/raspberrypi/rpi/rpi.c
++++ b/board/raspberrypi/rpi/rpi.c
+@@ -241,6 +241,8 @@ static uint32_t rev_scheme;
+ static uint32_t rev_type;
+ static const struct rpi_model *model;
+
++uint64_t serial;
++
+ #ifdef CONFIG_ARM64
+ static struct mm_region bcm2837_mem_map[] = {
+ {
+@@ -384,8 +386,8 @@ static void set_serial_number(void)
+ return;
+ }
+
+- snprintf(serial_string, sizeof(serial_string), "%016llx",
+- msg->get_board_serial.body.resp.serial);
++ serial = msg->get_board_serial.body.resp.serial;
++ snprintf(serial_string, sizeof(serial_string), "%016llx", serial);
+ env_set("serial#", serial_string);
+ }
+
+@@ -478,6 +480,29 @@ void *board_fdt_blob_setup(void)
+ return (void *)fw_dtb_pointer;
+ }
+
++static int ft_add_revision_info(void *blob) {
++ int off;
++ int ret;
++
++ off = fdt_subnode_offset(blob, 0, "system");
++
++ if (off < 0) {
++ off = fdt_add_subnode(blob, 0, "system");
++ if (off < 0)
++ return -1;
++ }
++
++ ret = fdt_setprop_u64(blob, off, "linux,serial", serial);
++ if (ret < 0)
++ return -1;
++
++ ret = fdt_setprop_u32(blob, off, "linux,revision", revision);
++ if (ret < 0)
++ return -1;
++
++ return 0;
++}
++
+ int ft_board_setup(void *blob, bd_t *bd)
+ {
+ /*
+@@ -487,6 +512,8 @@ int ft_board_setup(void *blob, bd_t *bd)
+ */
+ lcd_dt_simplefb_add_node(blob);
+
++ ft_add_revision_info(blob);
++
+ #ifdef CONFIG_EFI_LOADER
+ /* Reserve the spin table */
+ efi_add_memory_map(0, 1, EFI_RESERVED_MEMORY_TYPE, 0);
+--
+2.17.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc
new file mode 100644
index 00000000..ad043dbc
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc
@@ -0,0 +1,15 @@
+HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
+SECTION = "bootloaders"
+DEPENDS += "flex-native bison-native"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e"
+PE = "1"
+
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "e5aee22e4be75e75a854ab64503fc80598bc2004"
+
+SRC_URI = "git://git.denx.de/u-boot.git"
+
+S = "${WORKDIR}/git"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb
new file mode 100644
index 00000000..b5ce5684
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb
@@ -0,0 +1,34 @@
+require u-boot-common.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 = 'HOSTCC="${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
+ install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
+
+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_DIRS_append_class-cross = " ${bindir_cross}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+BBCLASSEXTEND = "cross"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb
new file mode 100644
index 00000000..bede984e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb
@@ -0,0 +1,67 @@
+require u-boot-common.inc
+
+SUMMARY = "U-Boot bootloader tools"
+DEPENDS += "openssl"
+
+PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage"
+PROVIDES_class-native = "u-boot-mkimage-native u-boot-mkenvimage-native"
+
+PACKAGES += "${PN}-mkimage ${PN}-mkenvimage"
+
+# Required for backward compatibility with "u-boot-mkimage-xxx.bb"
+RPROVIDES_${PN}-mkimage = "u-boot-mkimage"
+RREPLACES_${PN}-mkimage = "u-boot-mkimage"
+RCONFLICTS_${PN}-mkimage = "u-boot-mkimage"
+
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+
+SED_CONFIG_EFI = '-e "s/CONFIG_EFI_LOADER=.*/# CONFIG_EFI_LOADER is not set/"'
+SED_CONFIG_EFI_x86 = ''
+SED_CONFIG_EFI_x86-64 = ''
+SED_CONFIG_EFI_arm = ''
+SED_CONFIG_EFI_armeb = ''
+SED_CONFIG_EFI_aarch64 = ''
+
+do_compile () {
+ oe_runmake 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 -e "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" ${SED_CONFIG_EFI} .config
+
+ oe_runmake cross_tools NO_SDL=1
+}
+
+do_install () {
+ install -d ${D}${bindir}
+
+ # mkimage
+ install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
+ ln -sf uboot-mkimage ${D}${bindir}/mkimage
+
+ # mkenvimage
+ install -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage
+ ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage
+
+ # dumpimage
+ install -m 0755 tools/dumpimage ${D}${bindir}/uboot-dumpimage
+ ln -sf uboot-dumpimage ${D}${bindir}/dumpimage
+
+ # fit_check_sign
+ install -m 0755 tools/fit_check_sign ${D}${bindir}/uboot-fit_check_sign
+ ln -sf uboot-fit_check_sign ${D}${bindir}/fit_check_sign
+}
+
+ALLOW_EMPTY_${PN} = "1"
+FILES_${PN} = ""
+FILES_${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign"
+FILES_${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage"
+
+RDEPENDS_${PN}-mkimage += "dtc"
+RDEPENDS_${PN} += "${PN}-mkimage ${PN}-mkenvimage"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc
new file mode 100644
index 00000000..9a754fd0
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc
@@ -0,0 +1,333 @@
+SUMMARY = "Universal Boot Loader for embedded devices"
+PROVIDES = "virtual/bootloader"
+
+B = "${WORKDIR}/build"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+DEPENDS += "kern-tools-native"
+
+inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1
+
+DEPENDS += "swig-native python-native"
+
+EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
+EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+EXTRA_OEMAKE += 'PYTHON2=nativepython STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
+
+PACKAGECONFIG ??= "openssl"
+# u-boot will compile its own tools during the build, with specific
+# configurations (aka when CONFIG_FIT_SIGNATURE is enabled) openssl is needed as
+# a host build dependency.
+PACKAGECONFIG[openssl] = ",,openssl-native"
+
+# Allow setting an additional version string that will be picked up by the
+# u-boot build system and appended to the u-boot version. If the .scmversion
+# file already exists it will not be overwritten.
+UBOOT_LOCALVERSION ?= ""
+
+# Some versions of u-boot use .bin and others use .img. By default use .bin
+# but enable individual recipes to change this value.
+UBOOT_SUFFIX ??= "bin"
+UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
+UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
+UBOOT_MAKE_TARGET ?= "all"
+
+# Output the ELF generated. Some platforms can use the ELF file and directly
+# load it (JTAG booting, QEMU) additionally the ELF can be used for debugging
+# purposes.
+UBOOT_ELF ?= ""
+UBOOT_ELF_SUFFIX ?= "elf"
+UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}"
+UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}"
+UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
+
+# Some versions of u-boot build an SPL (Second Program Loader) image that
+# should be packaged along with the u-boot binary as well as placed in the
+# deploy directory. For those versions they can set the following variables
+# to allow packaging the SPL.
+SPL_BINARY ?= ""
+SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}"
+SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}"
+SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}"
+
+# Additional environment variables or a script can be installed alongside
+# u-boot to be used automatically on boot. This file, typically 'uEnv.txt'
+# or 'boot.scr', should be packaged along with u-boot as well as placed in the
+# deploy directory. Machine configurations needing one of these files should
+# include it in the SRC_URI and set the UBOOT_ENV parameter.
+UBOOT_ENV_SUFFIX ?= "txt"
+UBOOT_ENV ?= ""
+UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}"
+UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}"
+UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}"
+
+# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf
+# to find EXTLINUX conf file.
+UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux"
+UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf"
+UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}"
+
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+ sources=src_patches(d, True)
+ sources_list=[]
+ for s in sources:
+ if s.endswith('.cfg'):
+ sources_list.append(s)
+
+ return sources_list
+
+do_configure () {
+ if [ -z "${UBOOT_CONFIG}" ]; then
+ if [ -n "${UBOOT_MACHINE}" ]; then
+ oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
+ else
+ oe_runmake -C ${S} O=${B} oldconfig
+ fi
+ merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
+ cml1_do_configure
+ fi
+}
+
+do_compile () {
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
+ sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
+ fi
+
+ unset LDFLAGS
+ unset CFLAGS
+ unset CPPFLAGS
+
+ if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
+ then
+ echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
+ echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
+ fi
+
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ unset i j k
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ oe_runmake -C ${S} O=${B}/${config} ${config}
+ oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
+ for binary in ${UBOOT_BINARIES}; do
+ k=$(expr $k + 1);
+ if [ $k -eq $i ]; then
+ cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
+ fi
+ done
+ unset k
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
+ fi
+
+}
+
+do_install () {
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -d ${D}/boot
+ install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -d ${D}/boot
+ install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+ ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+ fi
+
+ if [ -n "${UBOOT_ELF}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
+ ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
+ fi
+ fi
+
+ if [ -e ${WORKDIR}/fw_env.config ] ; then
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+ fi
+
+ if [ -n "${SPL_BINARY}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
+ ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME}
+ fi
+ fi
+
+ if [ -n "${UBOOT_ENV}" ]
+ then
+ install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
+ ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
+ fi
+
+ if [ "${UBOOT_EXTLINUX}" = "1" ]
+ then
+ install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}
+ fi
+
+}
+
+FILES_${PN} = "/boot ${sysconfdir} ${datadir}"
+
+do_deploy () {
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -d ${DEPLOYDIR}
+ install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+ cd ${DEPLOYDIR}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -d ${DEPLOYDIR}
+ install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+ cd ${DEPLOYDIR}
+ rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
+ fi
+
+ if [ -n "${UBOOT_ELF}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
+ ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
+ ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
+ fi
+ fi
+
+
+ if [ -n "${SPL_BINARY}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR}
+ rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
+ rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
+ fi
+ fi
+
+
+ if [ -n "${UBOOT_ENV}" ]
+ then
+ install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
+ rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
+ ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
+ ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
+ fi
+
+ if [ "${UBOOT_EXTLINUX}" = "1" ]
+ then
+ install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK}
+ ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}
+ ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}
+ fi
+}
+
+addtask deploy before do_build after do_compile
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb
new file mode 100644
index 00000000..02d67c0d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb
@@ -0,0 +1,4 @@
+require u-boot-common.inc
+require u-boot.inc
+
+DEPENDS += "bc-native dtc-native"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend
new file mode 100644
index 00000000..03e7dc84
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_raspberrypi4 = "git://github.com/balena-os/u-boot;branch=ag/rpi4"
+SRCREV_raspberrypi4 = "62b6e39a53c56a9085aeab1b47b5cc6020fcdb6f"
+SRC_URI_raspberrypi4-64 = "git://github.com/balena-os/u-boot;branch=ag/rpi4"
+SRCREV_raspberrypi4-64 = "62b6e39a53c56a9085aeab1b47b5cc6020fcdb6f"
+
+# Update the patch for u-boot 2019.07
+SRC_URI_remove_sota = "file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch"
+SRC_URI_append_sota = "file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch
new file mode 100644
index 00000000..9fba5da4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch
@@ -0,0 +1,42 @@
+From ea966884e39aae9571c038fab55f3c1663d17850 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Wed, 12 Jun 2019 13:40:20 -0300
+Subject: [PATCH] meson.build: check for all linux host_os combinations
+Organization: O.S. Systems Software LTDA.
+
+Make sure that we are also looking for our host_os combinations like
+linux-musl etc. when assuming support for DRM/KMS.
+
+Also delete a duplicate line.
+
+Upstream-Status: Pending
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 567a81afd6f..b33b430aed4 100644
+--- a/meson.build
++++ b/meson.build
+@@ -107,7 +107,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2
+ # Only build shared_glapi if at least one OpenGL API is enabled
+ with_shared_glapi = get_option('shared-glapi') and with_any_opengl
+
+-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux'].contains(host_machine.system())
++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly'].contains(host_machine.system()) or host_machine.system().startswith('linux')
+
+ dri_drivers = get_option('dri-drivers')
+ if dri_drivers.contains('auto')
+@@ -845,7 +845,7 @@ if cc.compiles('int foo(void) __attribute__((__noreturn__));',
+ endif
+
+ # TODO: this is very incomplete
+-if ['linux', 'cygwin', 'gnu', 'gnu/kfreebsd'].contains(host_machine.system())
++if ['cygwin', 'gnu', 'gnu/kfreebsd'].contains(host_machine.system()) or host_machine.system().startswith('linux')
+ pre_args += '-D_GNU_SOURCE'
+ endif
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch
new file mode 100644
index 00000000..641bacf1
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch
@@ -0,0 +1,52 @@
+From cee8e48c5344124e5d84307cb0c48ee0c9b3e684 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Wed, 12 Jun 2019 14:15:57 -0300
+Subject: [PATCH] meson.build: make TLS GLX optional again
+Organization: O.S. Systems Software LTDA.
+
+This was optional with autotools, and needs to be disabled
+when using musl C library, for instance.
+
+Upstream-Status: Pending
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ meson.build | 4 +++-
+ meson_options.txt | 7 +++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index b33b430aed4..0e50bb26c0a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -369,7 +369,9 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless or with_plat
+ endif
+ endif
+
+-pre_args += '-DGLX_USE_TLS'
++if get_option('glx-tls')
++ pre_args += '-DGLX_USE_TLS'
++endif
+ if with_glx != 'disabled'
+ if not (with_platform_x11 and with_any_opengl)
+ error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
+diff --git a/meson_options.txt b/meson_options.txt
+index 1f72faabee8..fcd49efea27 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -339,6 +339,13 @@ option(
+ value : true,
+ description : 'Enable direct rendering in GLX and EGL for DRI',
+ )
++option(
++ 'glx-tls',
++ type : 'boolean',
++ value : true,
++ description : 'Enable TLS support in GLX',
++)
++
+ option(
+ 'I-love-half-baked-turnips',
+ type : 'boolean',
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch
new file mode 100644
index 00000000..3458c191
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch
@@ -0,0 +1,46 @@
+From f1482e88c2295b9c7288f5b273335a8e18039de8 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Wed, 12 Jun 2019 14:18:31 -0300
+Subject: [PATCH] Allow enable DRI without DRI drivers
+Organization: O.S. Systems Software LTDA.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ meson.build | 2 +-
+ meson_options.txt | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 0e50bb26c0a..de065c290d6 100644
+--- a/meson.build
++++ b/meson.build
+@@ -137,7 +137,7 @@ with_dri_r200 = dri_drivers.contains('r200')
+ with_dri_nouveau = dri_drivers.contains('nouveau')
+ with_dri_swrast = dri_drivers.contains('swrast')
+
+-with_dri = dri_drivers.length() != 0 and dri_drivers != ['']
++with_dri = get_option('dri') or (_drivers.length() != 0 and _drivers != [''])
+
+ gallium_drivers = get_option('gallium-drivers')
+ if gallium_drivers.contains('auto')
+diff --git a/meson_options.txt b/meson_options.txt
+index fcd49efea27..0529200b3bb 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -34,6 +34,12 @@ option(
+ choices : ['auto', 'true', 'false'],
+ description : 'enable support for dri3'
+ )
++option(
++ 'dri',
++ type : 'boolean',
++ value : false,
++ description : 'enable support for dri'
++)
+ option(
+ 'dri-drivers',
+ type : 'array',
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb
new file mode 100644
index 00000000..068fb19e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb
@@ -0,0 +1,30 @@
+SUMMARY = "The OpenGL utility toolkit"
+DESCRIPTION = "GLU is a utility toolkit used with OpenGL implementations"
+
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://include/GL/glu.h;endline=29;md5=6b79c570f644363b356456e7d44471d9 \
+ file://src/libtess/tess.c;endline=29;md5=6b79c570f644363b356456e7d44471d9"
+
+# Epoch as this used to be part of mesa
+PE = "2"
+PR = "0"
+
+SRC_URI = "https://mesa.freedesktop.org/archive/glu/glu-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "5599a0e0a97335e10239d9165aced60d"
+SRC_URI[sha256sum] = "f6f484cfcd51e489afe88031afdea1e173aa652697e4c19ddbcb8260579a10f7"
+
+S = "${WORKDIR}/glu-${PV}"
+
+DEPENDS = "virtual/libgl"
+
+inherit autotools pkgconfig distro_features_check
+
+# Requires libGL.so which is provided by mesa when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11 opengl"
+
+# Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
+RDEPENDS_${PN}-dev = ""
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
new file mode 100644
index 00000000..93ee9c28
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
@@ -0,0 +1,624 @@
+From b695c3a3fa3f4cd48c13aa26542110de27075518 Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Mon, 12 May 2014 15:22:32 -0400
+Subject: [PATCH 1/9] mesa-demos: Add missing data files.
+
+Add some data files that are present in the git repository:
+ http://cgit.freedesktop.org/mesa/demos/tree/?id=mesa-demos-8.1.0
+but not in the release tarball
+ ftp://ftp.freedesktop.org/pub/mesa/demos/8.1.0/mesa-demos-8.1.0.tar.bz2
+
+Upstream-Status: Backport
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/fpglsl/depth-read.glsl | 4 +
+ src/fpglsl/infinite-loop.glsl | 7 +
+ src/glsl/CH11-bumpmaptex.frag | 47 +++++++
+ src/glsl/blinking-teapot.frag | 31 +++++
+ src/glsl/blinking-teapot.vert | 16 +++
+ src/glsl/convolution.frag | 21 +++
+ src/glsl/simplex-noise.glsl | 279 ++++++++++++++++++++++++++++++++++++++++
+ src/glsl/skinning.vert | 24 ++++
+ src/perf/glslstateschange1.frag | 19 +++
+ src/perf/glslstateschange1.vert | 14 ++
+ src/perf/glslstateschange2.frag | 17 +++
+ src/perf/glslstateschange2.vert | 14 ++
+ src/vpglsl/infinite-loop.glsl | 8 ++
+ 13 files changed, 501 insertions(+)
+ create mode 100644 src/fpglsl/depth-read.glsl
+ create mode 100644 src/fpglsl/infinite-loop.glsl
+ create mode 100644 src/glsl/CH11-bumpmaptex.frag
+ create mode 100644 src/glsl/blinking-teapot.frag
+ create mode 100644 src/glsl/blinking-teapot.vert
+ create mode 100644 src/glsl/convolution.frag
+ create mode 100644 src/glsl/simplex-noise.glsl
+ create mode 100644 src/glsl/skinning.vert
+ create mode 100644 src/perf/glslstateschange1.frag
+ create mode 100644 src/perf/glslstateschange1.vert
+ create mode 100644 src/perf/glslstateschange2.frag
+ create mode 100644 src/perf/glslstateschange2.vert
+ create mode 100644 src/vpglsl/infinite-loop.glsl
+
+diff --git a/src/fpglsl/depth-read.glsl b/src/fpglsl/depth-read.glsl
+new file mode 100644
+index 0000000..86d298e
+--- /dev/null
++++ b/src/fpglsl/depth-read.glsl
+@@ -0,0 +1,4 @@
++void main()
++{
++ gl_FragColor = gl_FragCoord.zzzz;
++}
+diff --git a/src/fpglsl/infinite-loop.glsl b/src/fpglsl/infinite-loop.glsl
+new file mode 100644
+index 0000000..c6dc6ee
+--- /dev/null
++++ b/src/fpglsl/infinite-loop.glsl
+@@ -0,0 +1,7 @@
++void main() {
++ vec4 sum = vec4(0);
++ for (int i = 1; i != 2; i += 2) {
++ sum += vec4(0.1, 0.1, 0.1, 0.1);
++ }
++ gl_FragColor = sum;
++}
+diff --git a/src/glsl/CH11-bumpmaptex.frag b/src/glsl/CH11-bumpmaptex.frag
+new file mode 100644
+index 0000000..b5dabb4
+--- /dev/null
++++ b/src/glsl/CH11-bumpmaptex.frag
+@@ -0,0 +1,47 @@
++//
++// Fragment shader for procedural bumps
++//
++// Authors: John Kessenich, Randi Rost
++//
++// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
++//
++// See 3Dlabs-License.txt for license information
++//
++// Texture mapping/modulation added by Brian Paul
++//
++
++varying vec3 LightDir;
++varying vec3 EyeDir;
++
++uniform float BumpDensity; // = 16.0
++uniform float BumpSize; // = 0.15
++uniform float SpecularFactor; // = 0.5
++
++uniform sampler2D Tex;
++
++void main()
++{
++ vec3 ambient = vec3(0.25);
++ vec3 litColor;
++ vec2 c = BumpDensity * gl_TexCoord[0].st;
++ vec2 p = fract(c) - vec2(0.5);
++
++ float d, f;
++ d = p.x * p.x + p.y * p.y;
++ f = inversesqrt(d + 1.0);
++
++ if (d >= BumpSize)
++ { p = vec2(0.0); f = 1.0; }
++
++ vec3 SurfaceColor = texture2D(Tex, gl_TexCoord[0].st).xyz;
++
++ vec3 normDelta = vec3(p.x, p.y, 1.0) * f;
++ litColor = SurfaceColor * (ambient + max(dot(normDelta, LightDir), 0.0));
++ vec3 reflectDir = reflect(LightDir, normDelta);
++
++ float spec = max(dot(EyeDir, reflectDir), 0.0);
++ spec *= SpecularFactor;
++ litColor = min(litColor + spec, vec3(1.0));
++
++ gl_FragColor = vec4(litColor, 1.0);
++}
+diff --git a/src/glsl/blinking-teapot.frag b/src/glsl/blinking-teapot.frag
+new file mode 100644
+index 0000000..0db060b
+--- /dev/null
++++ b/src/glsl/blinking-teapot.frag
+@@ -0,0 +1,31 @@
++#extension GL_ARB_uniform_buffer_object : enable
++
++layout(std140) uniform colors0
++{
++ float DiffuseCool;
++ float DiffuseWarm;
++ vec3 SurfaceColor;
++ vec3 WarmColor;
++ vec3 CoolColor;
++ vec4 some[8];
++};
++
++varying float NdotL;
++varying vec3 ReflectVec;
++varying vec3 ViewVec;
++
++void main (void)
++{
++
++ vec3 kcool = min(CoolColor + DiffuseCool * SurfaceColor, 1.0);
++ vec3 kwarm = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0);
++ vec3 kfinal = mix(kcool, kwarm, NdotL);
++
++ vec3 nreflect = normalize(ReflectVec);
++ vec3 nview = normalize(ViewVec);
++
++ float spec = max(dot(nreflect, nview), 0.0);
++ spec = pow(spec, 32.0);
++
++ gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0);
++}
+diff --git a/src/glsl/blinking-teapot.vert b/src/glsl/blinking-teapot.vert
+new file mode 100644
+index 0000000..397d733
+--- /dev/null
++++ b/src/glsl/blinking-teapot.vert
+@@ -0,0 +1,16 @@
++vec3 LightPosition = vec3(0.0, 10.0, 4.0);
++
++varying float NdotL;
++varying vec3 ReflectVec;
++varying vec3 ViewVec;
++
++void main(void)
++{
++ vec3 ecPos = vec3 (gl_ModelViewMatrix * gl_Vertex);
++ vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal);
++ vec3 lightVec = normalize(LightPosition - ecPos);
++ ReflectVec = normalize(reflect(-lightVec, tnorm));
++ ViewVec = normalize(-ecPos);
++ NdotL = (dot(lightVec, tnorm) + 1.0) * 0.5;
++ gl_Position = ftransform();
++}
+diff --git a/src/glsl/convolution.frag b/src/glsl/convolution.frag
+new file mode 100644
+index 0000000..e49b8ac
+--- /dev/null
++++ b/src/glsl/convolution.frag
+@@ -0,0 +1,21 @@
++
++const int KernelSize = 9;
++
++//texture offsets
++uniform vec2 Offset[KernelSize];
++//convolution kernel
++uniform vec4 KernelValue[KernelSize];
++uniform sampler2D srcTex;
++uniform vec4 ScaleFactor;
++uniform vec4 BaseColor;
++
++void main(void)
++{
++ int i;
++ vec4 sum = vec4(0.0);
++ for (i = 0; i < KernelSize; ++i) {
++ vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
++ sum += tmp * KernelValue[i];
++ }
++ gl_FragColor = sum * ScaleFactor + BaseColor;
++}
+diff --git a/src/glsl/simplex-noise.glsl b/src/glsl/simplex-noise.glsl
+new file mode 100644
+index 0000000..b6833cb
+--- /dev/null
++++ b/src/glsl/simplex-noise.glsl
+@@ -0,0 +1,279 @@
++//
++// Description : Array and textureless GLSL 2D/3D/4D simplex
++// noise functions.
++// Author : Ian McEwan, Ashima Arts.
++// Maintainer : ijm
++// Lastmod : 20110223
++// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
++// Distributed under the Artistic License 2.0; See LICENCE file.
++//
++
++#define NORMALIZE_GRADIENTS
++#undef USE_CIRCLE
++#define COLLAPSE_SORTNET
++
++float permute(float x0,vec3 p) {
++ float x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++vec2 permute(vec2 x0,vec3 p) {
++ vec2 x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++vec3 permute(vec3 x0,vec3 p) {
++ vec3 x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++vec4 permute(vec4 x0,vec3 p) {
++ vec4 x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++
++uniform vec4 pParam;
++// Example
++// const vec4 pParam = vec4( 17.* 17., 34., 1., 7.);
++
++float taylorInvSqrt(float r)
++ {
++ return ( 0.83666002653408 + 0.7*0.85373472095314 - 0.85373472095314 * r );
++ }
++
++float simplexNoise2(vec2 v)
++ {
++ const vec2 C = vec2(0.211324865405187134, // (3.0-sqrt(3.0))/6.;
++ 0.366025403784438597); // 0.5*(sqrt(3.0)-1.);
++ const vec3 D = vec3( 0., 0.5, 2.0) * 3.14159265358979312;
++// First corner
++ vec2 i = floor(v + dot(v, C.yy) );
++ vec2 x0 = v - i + dot(i, C.xx);
++
++// Other corners
++ vec2 i1 = (x0.x > x0.y) ? vec2(1.,0.) : vec2(0.,1.) ;
++
++ // x0 = x0 - 0. + 0. * C
++ vec2 x1 = x0 - i1 + 1. * C.xx ;
++ vec2 x2 = x0 - 1. + 2. * C.xx ;
++
++// Permutations
++ i = mod(i, pParam.x);
++ vec3 p = permute( permute(
++ i.y + vec3(0., i1.y, 1. ), pParam.xyz)
++ + i.x + vec3(0., i1.x, 1. ), pParam.xyz);
++
++#ifndef USE_CIRCLE
++// ( N points uniformly over a line, mapped onto a diamond.)
++ vec3 x = fract(p / pParam.w) ;
++ vec3 h = 0.5 - abs(x) ;
++
++ vec3 sx = vec3(lessThan(x,D.xxx)) *2. -1.;
++ vec3 sh = vec3(lessThan(h,D.xxx));
++
++ vec3 a0 = x + sx*sh;
++ vec2 p0 = vec2(a0.x,h.x);
++ vec2 p1 = vec2(a0.y,h.y);
++ vec2 p2 = vec2(a0.z,h.z);
++
++#ifdef NORMALISE_GRADIENTS
++ p0 *= taylorInvSqrt(dot(p0,p0));
++ p1 *= taylorInvSqrt(dot(p1,p1));
++ p2 *= taylorInvSqrt(dot(p2,p2));
++#endif
++
++ vec3 g = 2.0 * vec3( dot(p0, x0), dot(p1, x1), dot(p2, x2) );
++#else
++// N points around a unit circle.
++ vec3 phi = D.z * mod(p,pParam.w) /pParam.w ;
++ vec4 a0 = sin(phi.xxyy+D.xyxy);
++ vec2 a1 = sin(phi.zz +D.xy);
++ vec3 g = vec3( dot(a0.xy, x0), dot(a0.zw, x1), dot(a1.xy, x2) );
++#endif
++// mix
++ vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
++ m = m*m ;
++ return 1.66666* 70.*dot(m*m, g);
++ }
++
++float simplexNoise3(vec3 v)
++ {
++ const vec2 C = vec2(1./6. , 1./3. ) ;
++ const vec4 D = vec4(0., 0.5, 1.0, 2.0);
++
++// First corner
++ vec3 i = floor(v + dot(v, C.yyy) );
++ vec3 x0 = v - i + dot(i, C.xxx) ;
++
++// Other corners
++#ifdef COLLAPSE_SORTNET
++ vec3 g = vec3( greaterThan( x0.xyz, x0.yzx) );
++ vec3 l = vec3( lessThanEqual( x0.xyz, x0.yzx) );
++
++ vec3 i1 = g.xyz * l.zxy;
++ vec3 i2 = max( g.xyz, l.zxy);
++#else
++// Keeping this clean - let the compiler optimize.
++ vec3 q1;
++ q1.x = max(x0.x, x0.y);
++ q1.y = min(x0.x, x0.y);
++ q1.z = x0.z;
++
++ vec3 q2;
++ q2.x = max(q1.x,q1.z);
++ q2.z = min(q1.x,q1.z);
++ q2.y = q1.y;
++
++ vec3 q3;
++ q3.y = max(q2.y, q2.z);
++ q3.z = min(q2.y, q2.z);
++ q3.x = q2.x;
++
++ vec3 i1 = vec3(equal(q3.xxx, x0));
++ vec3 i2 = i1 + vec3(equal(q3.yyy, x0));
++#endif
++
++ // x0 = x0 - 0. + 0. * C
++ vec3 x1 = x0 - i1 + 1. * C.xxx;
++ vec3 x2 = x0 - i2 + 2. * C.xxx;
++ vec3 x3 = x0 - 1. + 3. * C.xxx;
++
++// Permutations
++ i = mod(i, pParam.x );
++ vec4 p = permute( permute( permute(
++ i.z + vec4(0., i1.z, i2.z, 1. ), pParam.xyz)
++ + i.y + vec4(0., i1.y, i2.y, 1. ), pParam.xyz)
++ + i.x + vec4(0., i1.x, i2.x, 1. ), pParam.xyz);
++
++// Gradients
++// ( N*N points uniformly over a square, mapped onto a octohedron.)
++ float n_ = 1.0/pParam.w ;
++ vec3 ns = n_ * D.wyz - D.xzx ;
++
++ vec4 j = p - pParam.w*pParam.w*floor(p * ns.z *ns.z); // mod(p,N*N)
++
++ vec4 x_ = floor(j * ns.z) ;
++ vec4 y_ = floor(j - pParam.w * x_ ) ; // mod(j,N)
++
++ vec4 x = x_ *ns.x + ns.yyyy;
++ vec4 y = y_ *ns.x + ns.yyyy;
++ vec4 h = 1. - abs(x) - abs(y);
++
++ vec4 b0 = vec4( x.xy, y.xy );
++ vec4 b1 = vec4( x.zw, y.zw );
++
++ vec4 s0 = vec4(lessThan(b0,D.xxxx)) *2. -1.;
++ vec4 s1 = vec4(lessThan(b1,D.xxxx)) *2. -1.;
++ vec4 sh = vec4(lessThan(h, D.xxxx));
++
++ vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
++ vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
++
++ vec3 p0 = vec3(a0.xy,h.x);
++ vec3 p1 = vec3(a0.zw,h.y);
++ vec3 p2 = vec3(a1.xy,h.z);
++ vec3 p3 = vec3(a1.zw,h.w);
++
++#ifdef NORMALISE_GRADIENTS
++ p0 *= taylorInvSqrt(dot(p0,p0));
++ p1 *= taylorInvSqrt(dot(p1,p1));
++ p2 *= taylorInvSqrt(dot(p2,p2));
++ p3 *= taylorInvSqrt(dot(p3,p3));
++#endif
++
++// Mix
++ vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.);
++ m = m * m;
++//used to be 64.
++ return 48.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
++ dot(p2,x2), dot(p3,x3) ) );
++ }
++
++vec4 grad4(float j, vec4 ip)
++ {
++ const vec4 ones = vec4(1.,1.,1.,-1.);
++ vec4 p,s;
++
++ p.xyz = floor( fract (vec3(j) * ip.xyz) *pParam.w) * ip.z -1.0;
++ p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
++ s = vec4(lessThan(p,vec4(0.)));
++ p.xyz = p.xyz + (s.xyz*2.-1.) * s.www;
++
++ return p;
++ }
++
++float simplexNoise4(vec4 v)
++ {
++ const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4
++ 0.309016994374947451); // (sqrt(5) - 1)/4 F4
++// First corner
++ vec4 i = floor(v + dot(v, C.yyyy) );
++ vec4 x0 = v - i + dot(i, C.xxxx);
++
++// Other corners
++
++// Force existance of strict total ordering in sort.
++ vec4 q0 = floor(x0 * 1024.0) + vec4( 0., 1./4., 2./4. , 3./4.);
++ vec4 q1;
++ q1.xy = max(q0.xy,q0.zw); // x:z y:w
++ q1.zw = min(q0.xy,q0.zw);
++
++ vec4 q2;
++ q2.xz = max(q1.xz,q1.yw); // x:y z:w
++ q2.yw = min(q1.xz,q1.yw);
++
++ vec4 q3;
++ q3.y = max(q2.y,q2.z); // y:z
++ q3.z = min(q2.y,q2.z);
++ q3.xw = q2.xw;
++
++ vec4 i1 = vec4(lessThanEqual(q3.xxxx, q0));
++ vec4 i2 = vec4(lessThanEqual(q3.yyyy, q0));
++ vec4 i3 = vec4(lessThanEqual(q3.zzzz, q0));
++
++ // x0 = x0 - 0. + 0. * C
++ vec4 x1 = x0 - i1 + 1. * C.xxxx;
++ vec4 x2 = x0 - i2 + 2. * C.xxxx;
++ vec4 x3 = x0 - i3 + 3. * C.xxxx;
++ vec4 x4 = x0 - 1. + 4. * C.xxxx;
++
++// Permutations
++ i = mod(i, pParam.x );
++ float j0 = permute( permute( permute( permute (
++ i.w, pParam.xyz) + i.z, pParam.xyz)
++ + i.y, pParam.xyz) + i.x, pParam.xyz);
++ vec4 j1 = permute( permute( permute( permute (
++ i.w + vec4(i1.w, i2.w, i3.w, 1. ), pParam.xyz)
++ + i.z + vec4(i1.z, i2.z, i3.z, 1. ), pParam.xyz)
++ + i.y + vec4(i1.y, i2.y, i3.y, 1. ), pParam.xyz)
++ + i.x + vec4(i1.x, i2.x, i3.x, 1. ), pParam.xyz);
++// Gradients
++// ( N*N*N points uniformly over a cube, mapped onto a 4-octohedron.)
++ vec4 ip = pParam ;
++ ip.xy *= pParam.w ;
++ ip.x *= pParam.w ;
++ ip = vec4(1.,1.,1.,2.) / ip ;
++
++ vec4 p0 = grad4(j0, ip);
++ vec4 p1 = grad4(j1.x, ip);
++ vec4 p2 = grad4(j1.y, ip);
++ vec4 p3 = grad4(j1.z, ip);
++ vec4 p4 = grad4(j1.w, ip);
++
++#ifdef NORMALISE_GRADIENTS
++ p0 *= taylorInvSqrt(dot(p0,p0));
++ p1 *= taylorInvSqrt(dot(p1,p1));
++ p2 *= taylorInvSqrt(dot(p2,p2));
++ p3 *= taylorInvSqrt(dot(p3,p3));
++ p4 *= taylorInvSqrt(dot(p4,p4));
++#endif
++
++// Mix
++ vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
++ vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.);
++ m0 = m0 * m0;
++ m1 = m1 * m1;
++ return 32. * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
++ + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
++
++ }
++
++
++
+diff --git a/src/glsl/skinning.vert b/src/glsl/skinning.vert
+new file mode 100644
+index 0000000..28970ee
+--- /dev/null
++++ b/src/glsl/skinning.vert
+@@ -0,0 +1,24 @@
++// Vertex weighting/blendin shader
++// Brian Paul
++// 4 Nov 2008
++
++uniform mat4 mat0, mat1;
++attribute float weight;
++
++void main()
++{
++ // simple diffuse shading
++ // Note that we should really transform the normal vector along with
++ // the postion below... someday.
++ vec3 lightVec = vec3(0, 0, 1);
++ vec3 norm = gl_NormalMatrix * gl_Normal;
++ float dot = 0.2 + max(0.0, dot(norm, lightVec));
++ gl_FrontColor = vec4(dot);
++
++ // compute sum of weighted transformations
++ vec4 pos0 = mat0 * gl_Vertex;
++ vec4 pos1 = mat1 * gl_Vertex;
++ vec4 pos = mix(pos0, pos1, weight);
++
++ gl_Position = gl_ModelViewProjectionMatrix * pos;
++}
+diff --git a/src/perf/glslstateschange1.frag b/src/perf/glslstateschange1.frag
+new file mode 100644
+index 0000000..0839436
+--- /dev/null
++++ b/src/perf/glslstateschange1.frag
+@@ -0,0 +1,19 @@
++// Multi-texture fragment shader
++// Brian Paul
++
++// Composite second texture over first.
++// We're assuming the 2nd texture has a meaningful alpha channel.
++
++uniform sampler2D tex1;
++uniform sampler2D tex2;
++uniform vec4 UniV1;
++uniform vec4 UniV2;
++
++void main()
++{
++ vec4 t3;
++ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
++ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
++ t3 = mix(t1, t2, t2.w);
++ gl_FragColor = t3 + UniV1 + UniV2;
++}
+diff --git a/src/perf/glslstateschange1.vert b/src/perf/glslstateschange1.vert
+new file mode 100644
+index 0000000..cef50db
+--- /dev/null
++++ b/src/perf/glslstateschange1.vert
+@@ -0,0 +1,14 @@
++// Multi-texture vertex shader
++// Brian Paul
++
++
++attribute vec4 TexCoord0, TexCoord1;
++attribute vec4 VertCoord;
++
++void main()
++{
++ gl_TexCoord[0] = TexCoord0;
++ gl_TexCoord[1] = TexCoord1;
++ // note: may use gl_Vertex or VertCoord here for testing:
++ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
++}
+diff --git a/src/perf/glslstateschange2.frag b/src/perf/glslstateschange2.frag
+new file mode 100644
+index 0000000..0df0319
+--- /dev/null
++++ b/src/perf/glslstateschange2.frag
+@@ -0,0 +1,17 @@
++// Multi-texture fragment shader
++// Brian Paul
++
++// Composite second texture over first.
++// We're assuming the 2nd texture has a meaningful alpha channel.
++
++uniform sampler2D tex1;
++uniform sampler2D tex2;
++uniform vec4 UniV1;
++uniform vec4 UniV2;
++
++void main()
++{
++ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
++ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
++ gl_FragColor = t1 + t2 + UniV1 + UniV2;
++}
+diff --git a/src/perf/glslstateschange2.vert b/src/perf/glslstateschange2.vert
+new file mode 100644
+index 0000000..cef50db
+--- /dev/null
++++ b/src/perf/glslstateschange2.vert
+@@ -0,0 +1,14 @@
++// Multi-texture vertex shader
++// Brian Paul
++
++
++attribute vec4 TexCoord0, TexCoord1;
++attribute vec4 VertCoord;
++
++void main()
++{
++ gl_TexCoord[0] = TexCoord0;
++ gl_TexCoord[1] = TexCoord1;
++ // note: may use gl_Vertex or VertCoord here for testing:
++ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
++}
+diff --git a/src/vpglsl/infinite-loop.glsl b/src/vpglsl/infinite-loop.glsl
+new file mode 100644
+index 0000000..bc7ae4b
+--- /dev/null
++++ b/src/vpglsl/infinite-loop.glsl
+@@ -0,0 +1,8 @@
++void main() {
++ gl_Position = gl_Vertex;
++ vec4 sum = vec4(0);
++ for (int i = 1; i != 2; i += 2) {
++ sum += vec4(0.1, 0.1, 0.1, 0.1);
++ }
++ gl_FrontColor = sum;
++}
+--
+2.0.0
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
new file mode 100644
index 00000000..f6b59a11
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
@@ -0,0 +1,377 @@
+From 779438770bedf3d53e6ad8f7cd6889b7f50daf3b Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Wed, 9 Jul 2014 14:23:41 +0200
+Subject: [PATCH] configure: Allow to disable demos which require GLEW or GLU
+
+* in some systems without X11 support we don't have GLEW, but
+ mesa-demos are still useful
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Port to 8.3.0
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 49 ++++++++++++++++++++---------
+ src/Makefile.am | 18 ++++++++---
+ src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
+ src/egl/Makefile.am | 8 +++--
+ src/egl/opengles1/Makefile.am | 10 ++++--
+ src/egl/opengles2/Makefile.am | 29 ++++++++---------
+ 6 files changed, 117 insertions(+), 70 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0525b09..28834cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
+ [AC_DEFINE(HAVE_FREEGLUT)],
+ [])
+
+-dnl Check for GLEW
+-PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++AC_ARG_ENABLE([glew],
++ [AS_HELP_STRING([--enable-glew],
++ [build demos which require glew @<:@default=yes@:>@])],
++ [enable_glew="$enableval"],
++ [enable_glew=yes]
++)
++
++if test "x$enable_glew" = xyes; then
++ dnl Check for GLEW
++ PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
++ DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
++ DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++fi
+
+ # LIBS was set by AC_CHECK_LIB above
+ LIBS=""
+
+-PKG_CHECK_MODULES(GLU, [glu], [],
+- [AC_CHECK_HEADER([GL/glu.h],
+- [],
+- AC_MSG_ERROR([GLU not found]))
+- AC_CHECK_LIB([GLU],
+- [gluBeginCurve],
+- [GLU_LIBS=-lGLU],
+- AC_MSG_ERROR([GLU required])) ])
++AC_ARG_ENABLE([glu],
++ [AS_HELP_STRING([--enable-glu],
++ [build demos which require glu @<:@default=yes@:>@])],
++ [enable_glu="$enableval"],
++ [enable_glu=yes]
++)
+
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++if test "x$enable_glu" = xyes; then
++ PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes],
++ [AC_CHECK_HEADER([GL/glu.h],
++ [],
++ AC_MSG_ERROR([GLU not found]))
++ AC_CHECK_LIB([GLU],
++ [gluBeginCurve],
++ [GLU_LIBS=-lGLU
++ glu_enabled=yes],
++ AC_MSG_ERROR([GLU required])) ])
++
++ DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
++ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++fi
+
+ AC_ARG_ENABLE([egl],
+ [AS_HELP_STRING([--enable-egl],
+@@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
+ AC_SUBST([WAYLAND_LIBS])
+
+
++AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 1647d64..8b89dee 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,15 +22,19 @@
+ # Authors:
+ # Eric Anholt <eric@anholt.net>
+
++if HAVE_GLEW
++UTIL = util
++endif
++
+ SUBDIRS = \
+- util \
++ $(UTIL) \
+ data \
+ demos \
+ egl \
+ fp \
+ fpglsl \
+ glsl \
+- gs \
++ gs \
+ objviewer \
+ osdemos \
+ perf \
+@@ -40,8 +44,12 @@ SUBDIRS = \
+ slang \
+ tests \
+ tools \
+- trivial \
+- vp \
+- vpglsl \
+ wgl \
+ xdemos
++
++if HAVE_GLEW
++SUBDIRS += \
++ vp \
++ vpglsl \
++ trivial
++endif
+diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
+index 41603fa..ab1e3ab 100644
+--- a/src/demos/Makefile.am
++++ b/src/demos/Makefile.am
+@@ -30,91 +30,100 @@ AM_LDFLAGS = \
+ $(DEMO_LIBS) \
+ $(GLUT_LIBS)
+
++bin_PROGRAMS =
++
+ if HAVE_GLUT
+-bin_PROGRAMS = \
++if HAVE_GLEW
++bin_PROGRAMS += \
+ arbfplight \
+ arbfslight \
+ arbocclude \
+ arbocclude2 \
+- bounce \
+- clearspd \
+ copypix \
+ cubemap \
+ cuberender \
+ dinoshade \
+- dissolve \
+- drawpix \
+ engine \
+ fbo_firecube \
+ fbotexture \
+- fire \
+ fogcoord \
+ fplight \
+ fslight \
++ gloss \
++ isosurf \
++ multiarb \
++ paltex \
++ pointblast \
++ projtex \
++ shadowtex \
++ spriteblast \
++ stex3d \
++ textures \
++ vao_demo \
++ winpos
++
++copypix_LDADD = ../util/libutil.la
++cubemap_LDADD = ../util/libutil.la
++cuberender_LDADD = ../util/libutil.la
++engine_LDADD = ../util/libutil.la
++fbo_firecube_LDADD = ../util/libutil.la
++gloss_LDADD = ../util/libutil.la
++isosurf_LDADD = ../util/libutil.la
++multiarb_LDADD = ../util/libutil.la
++projtex_LDADD = ../util/libutil.la
++textures_LDADD = ../util/libutil.la
++winpos_LDADD = ../util/libutil.la
++endif
++
++if HAVE_GLU
++bin_PROGRAMS += \
++ bounce \
++ clearspd \
++ dissolve \
++ drawpix \
++ fire \
+ gamma \
+ gearbox \
+ gears \
+ geartrain \
+ glinfo \
+- gloss \
+ gltestperf \
+ ipers \
+- isosurf \
+ lodbias \
+ morph3d \
+- multiarb \
+- paltex \
+ pixeltest \
+- pointblast \
+- projtex \
+ ray \
+ readpix \
+ reflect \
+ renormal \
+- shadowtex \
+ singlebuffer \
+ spectex \
+- spriteblast \
+- stex3d \
+ teapot \
+ terrain \
+ tessdemo \
+ texcyl \
+ texenv \
+- textures \
+ trispd \
+ tunnel2 \
+- tunnel \
+- vao_demo \
+- winpos
+-endif
++ tunnel
+
+ tunnel_SOURCES = \
+ tunnel.c \
+ tunneldat.h
+
+-copypix_LDADD = ../util/libutil.la
+-cubemap_LDADD = ../util/libutil.la
+-cuberender_LDADD = ../util/libutil.la
+-drawpix_LDADD = ../util/libutil.la
+ dissolve_LDADD = ../util/libutil.la
+-engine_LDADD = ../util/libutil.la
+-fbo_firecube_LDADD = ../util/libutil.la
++drawpix_LDADD = ../util/libutil.la
+ fire_LDADD = ../util/libutil.la
+-gloss_LDADD = ../util/libutil.la
+ ipers_LDADD = ../util/libutil.la
+-isosurf_LDADD = ../util/libutil.la
+ lodbias_LDADD = ../util/libutil.la
+-multiarb_LDADD = ../util/libutil.la
+-projtex_LDADD = ../util/libutil.la
+ readpix_LDADD = ../util/libutil.la
+ reflect_LDADD = ../util/libutil.la
+ teapot_LDADD = ../util/libutil.la
+ texcyl_LDADD = ../util/libutil.la
+-textures_LDADD = ../util/libutil.la
+ tunnel_LDADD = ../util/libutil.la
+ tunnel2_LDADD = ../util/libutil.la
+-winpos_LDADD = ../util/libutil.la
++endif
++endif
+
+ EXTRA_DIST = \
+ README
+diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
+index d64a49e..4fe1ca8 100644
+--- a/src/egl/Makefile.am
++++ b/src/egl/Makefile.am
+@@ -24,8 +24,12 @@
+
+ SUBDIRS = \
+ eglut \
+- opengl \
+- openvg \
+ opengles1 \
+ opengles2 \
+ oes_vg
++
++if HAVE_GLU
++SUBDIRS += \
++ opengl \
++ openvg
++endif
+diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
+index fa397c2..21853e8 100644
+--- a/src/egl/opengles1/Makefile.am
++++ b/src/egl/opengles1/Makefile.am
+@@ -36,9 +36,12 @@ AM_LDFLAGS = \
+ $(EGL_LIBS) \
+ -lm
+
++noinst_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV1
+-noinst_PROGRAMS = \
++if HAVE_X11
++bin_PROGRAMS = \
+ bindtex \
+ clear \
+ drawtex_x11 \
+@@ -52,8 +55,6 @@ noinst_PROGRAMS = \
+ torus_x11 \
+ tri_x11 \
+ two_win
+-endif
+-endif
+
+ bindtex_LDADD = $(X11_LIBS)
+ es1_info_LDADD = $(X11_LIBS)
+@@ -76,3 +77,6 @@ drawtex_x11_LDADD = ../eglut/libeglut_x11.la
+ gears_x11_LDADD = ../eglut/libeglut_x11.la
+ torus_x11_LDADD = ../eglut/libeglut_x11.la
+ tri_x11_LDADD = ../eglut/libeglut_x11.la
++endif
++endif
++endif
+diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
+index b80ba50..17f8d49 100644
+--- a/src/egl/opengles2/Makefile.am
++++ b/src/egl/opengles2/Makefile.am
+@@ -33,27 +33,28 @@ AM_LDFLAGS = \
+ $(EGL_LIBS) \
+ -lm
+
++bin_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV2
+-bin_PROGRAMS =
+-if HAVE_X11
+-bin_PROGRAMS += \
+- es2_info \
+- es2gears_x11 \
+- es2tri
+-endif
+ if HAVE_WAYLAND
+ bin_PROGRAMS += es2gears_wayland
+-endif
+-endif
++
++es2gears_wayland_SOURCES = es2gears.c
++es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
+ endif
+
+-es2_info_LDADD = $(X11_LIBS)
+-es2tri_LDADD = $(X11_LIBS)
++if HAVE_X11
++bin_PROGRAMS += \
++ es2tri \
++ es2_info \
++ es2gears_x11
+
++es2_info_LDADD = $(X11_LIBS)
+ es2gears_x11_SOURCES = es2gears.c
+-
+ es2gears_x11_LDADD = ../eglut/libeglut_x11.la
++es2tri_LDADD = $(X11_LIBS)
++endif
++endif
++endif
+
+-es2gears_wayland_SOURCES = es2gears.c
+-es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
+--
+2.1.4
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
new file mode 100644
index 00000000..f77b97f3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
@@ -0,0 +1,234 @@
+From 5e10108d76a59abac21c7e540bcfd2ddaccca2cb Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Fri, 9 May 2014 11:50:24 -0400
+Subject: [PATCH 4/9] Use DEMOS_DATA_DIR to locate data files
+
+Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=78496]
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+---
+ src/glsl/bezier.c | 2 +-
+ src/glsl/blinking-teapot.c | 4 ++--
+ src/glsl/brick.c | 4 ++--
+ src/glsl/bump.c | 6 +++---
+ src/glsl/convolutions.c | 2 +-
+ src/glsl/mandelbrot.c | 4 ++--
+ src/glsl/multitex.c | 4 ++--
+ src/glsl/simplex-noise.c | 2 +-
+ src/glsl/skinning.c | 4 ++--
+ src/glsl/texdemo1.c | 8 ++++----
+ src/glsl/toyball.c | 4 ++--
+ src/objviewer/objview.c | 12 ++++++------
+ src/perf/glslstateschange.c | 8 ++++----
+ 13 files changed, 32 insertions(+), 32 deletions(-)
+
+diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c
+index 0b56bc1..e01603d 100644
+--- a/src/glsl/bezier.c
++++ b/src/glsl/bezier.c
+@@ -13,7 +13,7 @@
+ #include "glut_wrap.h"
+ #include "shaderutil.h"
+
+-static const char *filename = "bezier.geom";
++static const char *filename = DEMOS_DATA_DIR "bezier.geom";
+
+ static GLuint fragShader;
+ static GLuint vertShader;
+diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c
+index e3bf24d..7662b1f 100644
+--- a/src/glsl/blinking-teapot.c
++++ b/src/glsl/blinking-teapot.c
+@@ -63,8 +63,8 @@ init_opengl (void)
+ exit(1);
+ }
+
+- vshad_id = CompileShaderFile (GL_VERTEX_SHADER, "blinking-teapot.vert");
+- fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, "blinking-teapot.frag");
++ vshad_id = CompileShaderFile (GL_VERTEX_SHADER, DEMOS_DATA_DIR "blinking-teapot.vert");
++ fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, DEMOS_DATA_DIR "blinking-teapot.frag");
+ prog_id = LinkShaders (vshad_id, fshad_id);
+
+ UseProgram (prog_id);
+diff --git a/src/glsl/brick.c b/src/glsl/brick.c
+index 3021856..fe5f190 100644
+--- a/src/glsl/brick.c
++++ b/src/glsl/brick.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+
+
+-static char *FragProgFile = "CH06-brick.frag";
+-static char *VertProgFile = "CH06-brick.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH06-brick.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH06-brick.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/bump.c b/src/glsl/bump.c
+index 59f62cd..3a1b20a 100644
+--- a/src/glsl/bump.c
++++ b/src/glsl/bump.c
+@@ -15,9 +15,9 @@
+ #include "readtex.h"
+
+
+-static char *FragProgFile = "CH11-bumpmap.frag";
+-static char *FragTexProgFile = "CH11-bumpmaptex.frag";
+-static char *VertProgFile = "CH11-bumpmap.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH11-bumpmap.frag";
++static char *FragTexProgFile = DEMOS_DATA_DIR "CH11-bumpmaptex.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH11-bumpmap.vert";
+ static char *TextureFile = DEMOS_DATA_DIR "tile.rgb";
+
+ /* program/shader objects */
+diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c
+index a120cfe..9312f00 100644
+--- a/src/glsl/convolutions.c
++++ b/src/glsl/convolutions.c
+@@ -340,7 +340,7 @@ static void init(void)
+
+ menuInit();
+ readTexture(textureLocation);
+- createProgram("convolution.vert", "convolution.frag");
++ createProgram(DEMOS_DATA_DIR "convolution.vert", DEMOS_DATA_DIR "convolution.frag");
+
+ glEnable(GL_TEXTURE_2D);
+ glClearColor(1.0, 1.0, 1.0, 1.0);
+diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c
+index 31ede1d..ab34a0f 100644
+--- a/src/glsl/mandelbrot.c
++++ b/src/glsl/mandelbrot.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+
+
+-static char *FragProgFile = "CH18-mandel.frag";
+-static char *VertProgFile = "CH18-mandel.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH18-mandel.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH18-mandel.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
+index 262ea50..546bd27 100644
+--- a/src/glsl/multitex.c
++++ b/src/glsl/multitex.c
+@@ -35,8 +35,8 @@
+
+ static const char *Demo = "multitex";
+
+-static const char *VertFile = "multitex.vert";
+-static const char *FragFile = "multitex.frag";
++static const char *VertFile = DEMOS_DATA_DIR "multitex.vert";
++static const char *FragFile = DEMOS_DATA_DIR "multitex.frag";
+
+ static const char *TexFiles[2] =
+ {
+diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c
+index 13fdd5d..885f01e 100644
+--- a/src/glsl/simplex-noise.c
++++ b/src/glsl/simplex-noise.c
+@@ -169,7 +169,7 @@ SpecialKey(int key, int x, int y)
+ static void
+ Init(void)
+ {
+- const char *filename = "simplex-noise.glsl";
++ const char *filename = DEMOS_DATA_DIR "simplex-noise.glsl";
+ char noiseText[10000];
+ FILE *f;
+ int len;
+diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c
+index bf38d77..536d475 100644
+--- a/src/glsl/skinning.c
++++ b/src/glsl/skinning.c
+@@ -20,8 +20,8 @@
+ #define M_PI 3.1415926535
+ #endif
+
+-static char *FragProgFile = "skinning.frag";
+-static char *VertProgFile = "skinning.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "skinning.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "skinning.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c
+index 6cde239..a082342 100644
+--- a/src/glsl/texdemo1.c
++++ b/src/glsl/texdemo1.c
+@@ -35,11 +35,11 @@
+
+ static const char *Demo = "texdemo1";
+
+-static const char *ReflectVertFile = "reflect.vert";
+-static const char *CubeFragFile = "cubemap.frag";
++static const char *ReflectVertFile = DEMOS_DATA_DIR "reflect.vert";
++static const char *CubeFragFile = DEMOS_DATA_DIR "cubemap.frag";
+
+-static const char *SimpleVertFile = "simple.vert";
+-static const char *SimpleTexFragFile = "shadowtex.frag";
++static const char *SimpleVertFile = DEMOS_DATA_DIR "simple.vert";
++static const char *SimpleTexFragFile = DEMOS_DATA_DIR "shadowtex.frag";
+
+ static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb";
+
+diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c
+index 5f27951..4e7e832 100644
+--- a/src/glsl/toyball.c
++++ b/src/glsl/toyball.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+
+
+-static char *FragProgFile = "CH11-toyball.frag";
+-static char *VertProgFile = "CH11-toyball.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH11-toyball.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH11-toyball.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c
+index 6def726..78a6acf 100644
+--- a/src/objviewer/objview.c
++++ b/src/objviewer/objview.c
+@@ -162,12 +162,12 @@ init_model(void)
+ static void
+ init_skybox(void)
+ {
+- SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
+- "alpine_west.rgb",
+- "alpine_up.rgb",
+- "alpine_down.rgb",
+- "alpine_south.rgb",
+- "alpine_north.rgb");
++ SkyboxTex = LoadSkyBoxCubeTexture(DEMOS_DATA_DIR "alpine_east.rgb",
++ DEMOS_DATA_DIR "alpine_west.rgb",
++ DEMOS_DATA_DIR "alpine_up.rgb",
++ DEMOS_DATA_DIR "alpine_down.rgb",
++ DEMOS_DATA_DIR "alpine_south.rgb",
++ DEMOS_DATA_DIR "alpine_north.rgb");
+ glmSpecularTexture(Model, SkyboxTex);
+ }
+
+diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
+index 7422b78..dbf8332 100644
+--- a/src/perf/glslstateschange.c
++++ b/src/perf/glslstateschange.c
+@@ -33,10 +33,10 @@
+ #include "glmain.h"
+ #include "common.h"
+
+-static const char *VertFile1 = "glslstateschange1.vert";
+-static const char *FragFile1 = "glslstateschange1.frag";
+-static const char *VertFile2 = "glslstateschange2.vert";
+-static const char *FragFile2 = "glslstateschange2.frag";
++static const char *VertFile1 = DEMOS_DATA_DIR "glslstateschange1.vert";
++static const char *FragFile1 = DEMOS_DATA_DIR "glslstateschange1.frag";
++static const char *VertFile2 = DEMOS_DATA_DIR "glslstateschange2.vert";
++static const char *FragFile2 = DEMOS_DATA_DIR "glslstateschange2.frag";
+ static struct uniform_info Uniforms1[] = {
+ { "tex1", 1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
+ { "tex2", 1, GL_SAMPLER_2D, { 1, 0, 0, 0 }, -1 },
+--
+2.0.0
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
new file mode 100644
index 00000000..b27d9eaf
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
@@ -0,0 +1,43 @@
+From 2e0367a941445a862ab99c54ec85d1357d0f73c0 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:30:52 +0200
+Subject: [PATCH] Install few more test programs
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ src/egl/opengl/Makefile.am | 3 +--
+ src/egl/openvg/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
+index 6d184ff6..ab09d028 100644
+--- a/src/egl/opengl/Makefile.am
++++ b/src/egl/opengl/Makefile.am
+@@ -57,8 +57,7 @@ endif
+
+ if HAVE_EGL
+ bin_PROGRAMS = \
+- eglinfo
+-noinst_PROGRAMS = \
++ eglinfo \
+ peglgears \
+ $(EGL_DRM_DEMOS) \
+ $(EGL_X11_DEMOS) \
+diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am
+index b0f1212f..5fd1cf83 100644
+--- a/src/egl/openvg/Makefile.am
++++ b/src/egl/openvg/Makefile.am
+@@ -49,7 +49,7 @@ endif
+
+ if HAVE_EGL
+ if HAVE_VG
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ $(EGL_X11_DEMOS)
+ endif
+ endif
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
new file mode 100644
index 00000000..a6d16817
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
@@ -0,0 +1,99 @@
+From 894add34c2b5e6b4ccc78996bf681d7ec7bc9e36 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:29:27 +0200
+Subject: [PATCH] glsl, perf: Add few missing .glsl, .vert, .frag files to
+ EXTRA_DATA
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+---
+ src/fpglsl/Makefile.am | 2 ++
+ src/glsl/Makefile.am | 10 ++++++++--
+ src/perf/Makefile.am | 6 ++++++
+ src/vpglsl/Makefile.am | 1 +
+ 4 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
+index 47c1039f..fd43c919 100644
+--- a/src/fpglsl/Makefile.am
++++ b/src/fpglsl/Makefile.am
+@@ -39,10 +39,12 @@ noinst_PROGRAMS = \
+ endif
+
+ EXTRA_DIST = \
++ depth-read.glsl \
+ dowhile2.glsl \
+ dowhile.glsl \
+ forbreak.glsl \
+ for.glsl \
++ infinite-loop.glsl \
+ mov.glsl \
+ mov-imm.glsl \
+ simpleif.glsl \
+diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
+index 4faa8dbf..079a29d8 100644
+--- a/src/glsl/Makefile.am
++++ b/src/glsl/Makefile.am
+@@ -37,7 +37,7 @@ AM_LDFLAGS = \
+ if HAVE_GLUT
+ bin_PROGRAMS = \
+ array \
+- bezier \
++ bezier \
+ bitmap \
+ brick \
+ bump \
+@@ -123,12 +123,16 @@ EXTRA_DIST = \
+ CH06-brick.vert \
+ CH11-bumpmap.frag \
+ CH11-bumpmap.vert \
++ CH11-bumpmaptex.frag \
+ CH11-toyball.frag \
+ CH11-toyball.vert \
+ CH18-mandel.frag \
+ CH18-mandel.vert \
+- bezier.geom \
++ bezier.geom \
+ brick.shtest \
++ blinking-teapot.frag \
++ blinking-teapot.vert \
++ convolution.frag \
+ convolution.vert \
+ cubemap.frag \
+ mandelbrot.shtest \
+@@ -138,5 +142,7 @@ EXTRA_DIST = \
+ reflect.vert \
+ shadowtex.frag \
+ simple.vert \
++ simplex-noise.glsl \
+ skinning.frag \
++ skinning.vert \
+ toyball.shtest
+diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
+index f0031fea..60069396 100644
+--- a/src/perf/Makefile.am
++++ b/src/perf/Makefile.am
+@@ -59,3 +59,9 @@ endif
+
+ glslstateschange_LDADD = libperf.la ../util/libutil.la
+ glsl_compile_time_LDADD = ../util/libutil.la
++
++EXTRA_DIST = \
++ glslstateschange1.frag \
++ glslstateschange1.vert \
++ glslstateschange2.frag \
++ glslstateschange2.vert
+diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
+index 4a85ed40..48b08f48 100644
+--- a/src/vpglsl/Makefile.am
++++ b/src/vpglsl/Makefile.am
+@@ -44,6 +44,7 @@ EXTRA_DIST = \
+ func2.glsl \
+ ifelse.glsl \
+ if.glsl \
++ infinite-loop.glsl \
+ mov.glsl \
+ nestedifs.glsl \
+ nestedswizzle.glsl \
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
new file mode 100644
index 00000000..8a98ba60
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
@@ -0,0 +1,71 @@
+From 477ab6d90a17d8e4d3935be6ce8b8e154db0e3e5 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:48:12 +0200
+Subject: [PATCH] glsl, perf: Install .glsl, .vert, .frag files
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+---
+ src/fpglsl/Makefile.am | 3 ++-
+ src/glsl/Makefile.am | 3 ++-
+ src/perf/Makefile.am | 3 ++-
+ src/vpglsl/Makefile.am | 3 ++-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
+index fd43c919..2bf51de4 100644
+--- a/src/fpglsl/Makefile.am
++++ b/src/fpglsl/Makefile.am
+@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
+ fp-tri
+ endif
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ depth-read.glsl \
+ dowhile2.glsl \
+ dowhile.glsl \
+diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
+index 079a29d8..f66ec299 100644
+--- a/src/glsl/Makefile.am
++++ b/src/glsl/Makefile.am
+@@ -118,7 +118,8 @@ vert_or_frag_only_LDADD = ../util/libutil.la
+ vert_tex_LDADD = ../util/libutil.la
+ vsraytrace_LDADD = ../util/libutil.la
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ CH06-brick.frag \
+ CH06-brick.vert \
+ CH11-bumpmap.frag \
+diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
+index 60069396..469bdf45 100644
+--- a/src/perf/Makefile.am
++++ b/src/perf/Makefile.am
+@@ -60,7 +60,8 @@ endif
+ glslstateschange_LDADD = libperf.la ../util/libutil.la
+ glsl_compile_time_LDADD = ../util/libutil.la
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ glslstateschange1.frag \
+ glslstateschange1.vert \
+ glslstateschange2.frag \
+diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
+index 48b08f48..55268675 100644
+--- a/src/vpglsl/Makefile.am
++++ b/src/vpglsl/Makefile.am
+@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
+ vp-tris
+ endif
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ for.glsl \
+ func.glsl \
+ func2.glsl \
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch
new file mode 100644
index 00000000..c6876474
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch
@@ -0,0 +1,44 @@
+From 3aa84c47e88a4c38446ce1323abf6f2c77389104 Mon Sep 17 00:00:00 2001
+From: Prabhu <prabhu.sundararaj@freescale.com>
+Date: Mon, 16 Nov 2015 17:09:32 -0600
+Subject: [PATCH] mesa-demos: OpenVG demos with single frame need eglSwapBuffer
+
+sp and text demos rendering single frame. to display the
+single frame rendered needed a eglSwapBuffer to diplay to window.
+Hence added eglutPostRedisplay to display the frame
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu <prabhu.sundararaj@freescale.com>
+---
+ src/egl/openvg/sp.c | 1 +
+ src/egl/openvg/text.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/egl/openvg/sp.c b/src/egl/openvg/sp.c
+index a20c0a3..468e91e 100644
+--- a/src/egl/openvg/sp.c
++++ b/src/egl/openvg/sp.c
+@@ -500,6 +500,7 @@ draw(void)
+ }
+
+ vgFlush();
++ eglutPostRedisplay();
+ }
+
+
+diff --git a/src/egl/openvg/text.c b/src/egl/openvg/text.c
+index f5c6de8..492581c 100644
+--- a/src/egl/openvg/text.c
++++ b/src/egl/openvg/text.c
+@@ -360,6 +360,7 @@ display(void)
+ {
+ vgClear(0, 0, width, height);
+ glyph_string_draw(10.0, 10.0);
++ eglutPostRedisplay();
+ }
+
+
+--
+2.5.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch
new file mode 100644
index 00000000..e7be4dfb
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch
@@ -0,0 +1,62 @@
+From 322af294390a7f4e1524c5a79312be6cbebce988 Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Wed, 11 Nov 2015 17:22:12 +0500
+Subject: [PATCH] only build GLX demos if needed
+
+There are platforms that default to EGL only configurations
+in which case the GLX applications are not required
+at all. Allow the user to control generation of these
+demos as needed through a configure switch.
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+Upstream-Status: Pending
+---
+ configure.ac | 9 +++++++++
+ src/Makefile.am | 6 +++++-
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index f8ec7e3..1a4d96d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -132,6 +132,11 @@ if test "x$enable_glu" = xyes; then
+ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
+ fi
+
++AC_ARG_ENABLE([glx-demos],
++ [AS_HELP_STRING([--enable-glx-demos],
++ [enable GLX demos @<:@default=auto@:>@])],
++ [glx_demos_enabled="$enableval"],
++ [glx_demos_enabled=yes])
+ AC_ARG_ENABLE([egl],
+ [AS_HELP_STRING([--enable-egl],
+ [enable EGL library @<:@default=auto@:>@])],
+@@ -325,6 +333,7 @@ AC_SUBST([WAYLAND_LIBS])
+
+ AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLX, test "x$glx_demos_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8b89dee..a4d7e8f 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -44,8 +44,12 @@ SUBDIRS = \
+ slang \
+ tests \
+ tools \
+- wgl \
++ wgl
++
++if HAVE_GLX
++SUBDIRS += \
+ xdemos
++endif
+
+ if HAVE_GLEW
+ SUBDIRS += \
+--
+1.9.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb
new file mode 100644
index 00000000..129a47df
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb
@@ -0,0 +1,59 @@
+SUMMARY = "Mesa demo applications"
+DESCRIPTION = "This package includes the demonstration application, such as glxgears. \
+These applications can be used for Mesa validation and benchmarking."
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+
+LICENSE = "MIT & PD"
+LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \
+ file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
+
+SRC_URI = "https://mesa.freedesktop.org/archive/demos/${BPN}-${PV}.tar.bz2 \
+ file://0001-mesa-demos-Add-missing-data-files.patch \
+ file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \
+ file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
+ file://0007-Install-few-more-test-programs.patch \
+ file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
+ file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
+ file://0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch \
+ file://0013-only-build-GLX-demos-if-needed.patch \
+ "
+SRC_URI[md5sum] = "6b65a02622765522176d00f553086fa3"
+SRC_URI[sha256sum] = "01e99c94a0184e63e796728af89bfac559795fb2a0d6f506fa900455ca5fff7d"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/egl, virtual/libgl ...
+REQUIRED_DISTRO_FEATURES = "opengl x11"
+
+PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \
+ x11 glew glu glx"
+
+# The Wayland code doesn't work with Wayland 1.0, so disable it for now
+#${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)}"
+
+EXTRA_OECONF = "--with-system-data-files"
+
+PACKAGECONFIG[drm] = "--enable-libdrm,--disable-libdrm,libdrm"
+PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
+PACKAGECONFIG[freetype2] = "--enable-freetype2,--disable-freetype2,freetype"
+PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl"
+PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1"
+PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
+PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,freeglut"
+PACKAGECONFIG[osmesa] = "--enable-osmesa,--disable-osmesa,"
+PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libopenvg"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
+PACKAGECONFIG[glew] = "--enable-glew,--disable-glew,glew"
+PACKAGECONFIG[glu] = "--enable-glu,--disable-glu,virtual/libgl"
+PACKAGECONFIG[glx] = "--enable-glx-demos,--disable-glx-demos"
+
+do_install_append() {
+ # it can be completely empty when all PACKAGECONFIG options are disabled
+ rmdir --ignore-fail-on-non-empty ${D}${bindir}
+
+ if [ -f ${D}${bindir}/clear ]; then
+ mv ${D}${bindir}/clear ${D}${bindir}/clear.mesa-demos
+ fi
+}
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb
new file mode 100644
index 00000000..d4b1c1c4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb
@@ -0,0 +1,10 @@
+require mesa_${PV}.bb
+
+SUMMARY += " (OpenGL only, no EGL/GLES)"
+
+PROVIDES = "virtual/libgl virtual/mesa"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+PACKAGECONFIG ??= "opengl dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG_class-target = "opengl dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc
new file mode 100644
index 00000000..54b7618f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc
@@ -0,0 +1,267 @@
+SUMMARY = "A free implementation of the OpenGL API"
+DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \
+a system for rendering interactive 3D graphics. \
+A variety of device drivers allows Mesa to be used in many different environments \
+ranging from software emulation to complete hardware acceleration for modern GPUs. \
+Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \
+environment."
+
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
+
+PE = "2"
+
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"
+EXTRANATIVEPATH += "chrpath-native"
+PROVIDES = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
+ virtual/mesa \
+ "
+
+inherit meson pkgconfig python3native gettext distro_features_check
+
+# Unset these to stop python trying to report the target Python setup
+_PYTHON_SYSCONFIGDATA_NAME[unexport] = "1"
+STAGING_INCDIR[unexport] = "1"
+STAGING_LIBDIR[unexport] = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+ANY_OF_DISTRO_FEATURES_class-target = "opengl vulkan"
+
+PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)} \
+ surfaceless"
+
+export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config"
+export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}"
+export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}"
+export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
+
+MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
+
+EXTRA_OEMESON = " \
+ -Dshared-glapi=true \
+ -Dgallium-opencl=disabled \
+ -Dglx-read-only-text=true \
+ -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
+"
+
+PACKAGECONFIG_class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri gallium', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
+ glx-tls \
+ "
+PACKAGECONFIG_class-native ?= "gbm dri egl opengl glx-tls"
+PACKAGECONFIG_class-nativesdk ?= "gbm dri egl opengl glx-tls"
+
+PACKAGECONFIG_remove_libc-musl = "glx-tls"
+
+# "gbm" requires "dri", "opengl"
+PACKAGECONFIG[gbm] = "-Dgbm=true,-Dgbm=false"
+
+X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr"
+# "x11" requires "opengl"
+PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}"
+PACKAGECONFIG[glx-tls] = "-Dglx-tls=true, -Dglx-tls=false"
+PACKAGECONFIG[xvmc] = "-Dgallium-xvmc=true,-Dgallium-xvmc=false,libxvmc"
+PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
+
+DRIDRIVERS_class-native = "swrast"
+DRIDRIVERS_class-nativesdk = "swrast"
+DRIDRIVERS_append_x86_class-target = ",r100,r200,nouveau,i965,i915"
+DRIDRIVERS_append_x86-64_class-target = ",r100,r200,nouveau,i965,i915"
+# "dri" requires "opengl"
+PACKAGECONFIG[dri] = "-Ddri=true -Ddri-drivers=${DRIDRIVERS}, -Ddri=false -Ddri-drivers='', xorgproto libdrm"
+PACKAGECONFIG[dri3] = "-Ddri3=true, -Ddri3=false, xorgproto libxshmfence"
+
+# Vulkan drivers need dri3 enabled
+# radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9
+VULKAN_DRIVERS = ""
+VULKAN_DRIVERS_append_x86_class-target = ",intel"
+VULKAN_DRIVERS_append_x86-64_class-target = ",intel"
+PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${VULKAN_DRIVERS}, -Dvulkan-drivers='',"
+
+PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
+
+# "gles" requires "opengl"
+PACKAGECONFIG[gles] = "-Dgles1=true -Dgles2=true, -Dgles1=false -Dgles2=false"
+
+# "egl" requires "dri", "opengl"
+PACKAGECONFIG[egl] = "-Degl=true, -Degl=false"
+
+PACKAGECONFIG[etnaviv] = ""
+PACKAGECONFIG[kmsro] = ""
+PACKAGECONFIG[vc4] = ""
+PACKAGECONFIG[v3d] = ""
+
+GALLIUMDRIVERS = "swrast"
+# gallium swrast was found to crash Xorg on startup in x32 qemu
+GALLIUMDRIVERS_x86-x32 = ""
+
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}"
+
+# radeonsi requires LLVM
+GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
+GALLIUMDRIVERS_LLVM33_ENABLED = "${@oe.utils.version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
+GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
+
+PACKAGECONFIG[r600] = ""
+
+GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
+GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}"
+GALLIUMDRIVERS_append = ",virgl"
+
+PACKAGECONFIG[gallium] = "-Dgallium-drivers=${GALLIUMDRIVERS}, -Dgallium-drivers=''"
+PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, llvm${MESA_LLVM_RELEASE} llvm-native \
+ ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
+PACKAGECONFIG[xa] = "-Dgallium-xa=true, -Dgallium-xa=false"
+
+PACKAGECONFIG[lima] = ""
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}"
+
+PACKAGECONFIG[panfrost] = ""
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}"
+
+OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium', 'classic', d)}"
+PACKAGECONFIG[osmesa] = "-Dosmesa=${OSMESA},-Dosmesa=none"
+
+PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind"
+
+# mesa tries to run cross-built gen_matypes on build machine to get struct size information
+EXTRA_OEMESON_append = " -Dasm=false"
+
+# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
+FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
+
+CFLAGS_append_armv5 = " -DMISSING_64BIT_ATOMICS"
+
+# Remove the mesa dependency on mesa-dev, as mesa is empty
+RDEPENDS_${PN}-dev = ""
+
+# Add dependency so that GLES3 header don't need to be added manually
+RDEPENDS_libgles2-mesa-dev += "libgles3-mesa-dev"
+
+PACKAGES =+ "libegl-mesa libegl-mesa-dev \
+ libosmesa libosmesa-dev \
+ libgl-mesa libgl-mesa-dev \
+ libglapi libglapi-dev \
+ libgbm libgbm-dev \
+ libgles1-mesa libgles1-mesa-dev \
+ libgles2-mesa libgles2-mesa-dev \
+ libgles3-mesa libgles3-mesa-dev \
+ libxatracker libxatracker-dev \
+ mesa-megadriver mesa-vulkan-drivers \
+ "
+
+do_install_append () {
+ # Drivers never need libtool .la files
+ rm -f ${D}${libdir}/dri/*.la
+ rm -f ${D}${libdir}/egl/*.la
+ rm -f ${D}${libdir}/gallium-pipe/*.la
+ rm -f ${D}${libdir}/gbm/*.la
+
+ # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used
+ chrpath --delete ${D}${libdir}/dri/*_dri.so || true
+
+ # libwayland-egl has been moved to wayland 1.15+
+ rm -f ${D}${libdir}/libwayland-egl*
+ rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
+}
+
+# For the packages that make up the OpenGL interfaces, inject variables so that
+# they don't get Debian-renamed (which would remove the -mesa suffix), and
+# RPROVIDEs/RCONFLICTs on the generic libgl name.
+python __anonymous() {
+ pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
+ for p in (("egl", "libegl", "libegl1"),
+ ("dri", "libgl", "libgl1"),
+ ("gles", "libgles1", "libglesv1-cm1"),
+ ("gles", "libgles2", "libglesv2-2"),
+ ("gles", "libgles3",)):
+ if not p[0] in pkgconfig:
+ continue
+ fullp = p[1] + "-mesa"
+ pkgs = " ".join(p[1:])
+ d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
+ d.appendVar("RREPLACES_" + fullp, pkgs)
+ d.appendVar("RPROVIDES_" + fullp, pkgs)
+ d.appendVar("RCONFLICTS_" + fullp, pkgs)
+
+ d.appendVar("RRECOMMENDS_" + fullp, " mesa-megadriver")
+
+ # For -dev, the first element is both the Debian and original name
+ fullp += "-dev"
+ pkgs = p[1] + "-dev"
+ d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
+ d.appendVar("RREPLACES_" + fullp, pkgs)
+ d.appendVar("RPROVIDES_" + fullp, pkgs)
+ d.appendVar("RCONFLICTS_" + fullp, pkgs)
+}
+
+python mesa_populate_packages() {
+ pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
+ for pkg in pkgs:
+ d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+ d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+ d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+
+ import re
+ dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri")
+ if os.path.isdir(dri_drivers_root):
+ dri_pkgs = os.listdir(dri_drivers_root)
+ lib_name = d.expand("${MLPREFIX}mesa-megadriver")
+ for p in dri_pkgs:
+ m = re.match(r'^(.*)_dri\.so$', p)
+ if m:
+ pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
+ d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
+ d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
+ d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
+
+ pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe")
+ do_split_packages(d, pipe_drivers_root, r'^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
+}
+
+PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
+
+PACKAGES_DYNAMIC += "^mesa-driver-.*"
+
+FILES_mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d/00-mesa-defaults.conf"
+FILES_mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
+FILES_libegl-mesa = "${libdir}/libEGL.so.*"
+FILES_libgbm = "${libdir}/libgbm.so.*"
+FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
+FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
+FILES_libgl-mesa = "${libdir}/libGL.so.*"
+FILES_libglapi = "${libdir}/libglapi.so.*"
+FILES_libosmesa = "${libdir}/libOSMesa.so.*"
+FILES_libxatracker = "${libdir}/libxatracker.so.*"
+
+FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan"
+FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
+FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
+FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
+FILES_libglapi-dev = "${libdir}/libglapi.*"
+FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
+FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
+FILES_libgles3-mesa-dev = "${includedir}/GLES3"
+FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
+FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
+ ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
+ ${libdir}/pkgconfig/xatracker.pc"
+
+# Fix upgrade path from mesa to mesa-megadriver
+RREPLACES_mesa-megadriver = "mesa"
+RCONFLICTS_mesa-megadriver = "mesa"
+RPROVIDES_mesa-megadriver = "mesa"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 00000000..58aea6c0
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,2 @@
+# enable ludicrous speed for GFX on rpi4
+PACKAGECONFIG_append_class-target = " v3d kmsro"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb
new file mode 100644
index 00000000..19221e9e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb
@@ -0,0 +1,20 @@
+require ${BPN}.inc
+
+SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
+ file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
+ file://0002-meson.build-make-TLS-GLX-optional-again.patch \
+ file://0003-Allow-enable-DRI-without-DRI-drivers.patch \
+ "
+
+SRC_URI[md5sum] = "7dbb40b8d10e89bee0a5bfc85350647b"
+SRC_URI[sha256sum] = "2a369b7b48545c6486e7e44913ad022daca097c8bd937bf30dcf3f17a94d3496"
+
+UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install_append() {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+ sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+ fi
+}
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend
new file mode 100644
index 00000000..d4c74ef4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend
@@ -0,0 +1,4 @@
+# FIXME: Temporary fix that can be removed once commit 752db52 gets backported
+# from master to thud branch of meta-raspberrypi
+RDEPENDS_${PN}_remove = "libegl1"
+RDEPENDS_${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "libegl-mesa", "", d)}"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 00000000..d652d6be
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://dsi.cfg"
+
+# Reduce the screen resolution to HD Ready (720p)
+SRC_URI_remove = "file://hdmi-a-1-270.cfg"
+SRC_URI_append = "file://hdmi-a-1-270-720p.cfg"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/dsi.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/dsi.cfg
new file mode 100644
index 00000000..72a6d2bf
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/dsi.cfg
@@ -0,0 +1,5 @@
+# Support the Raspberry Pi Foundation 7" tablet which uses the DSI connector
+# rather than HDMI.
+[output]
+name=DSI-1
+transform=270
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270-720p.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270-720p.cfg
new file mode 100644
index 00000000..e1c9db1a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270-720p.cfg
@@ -0,0 +1,7 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 270 degrees
+# to have a proper orientation of the homescreen. For example the various sizes
+# of the GeChic display or the Dell display.
+[output]
+name=HDMI-A-1
+transform=270
+mode=1280x720
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb
new file mode 100644
index 00000000..818b5e78
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Combine dtb and dtbo"
+DESCRIPTION = "Combine specified dtb and one or more dtbo into specified filename found in deploydir"
+SECTION = "bootloader"
+PR = "r1"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "dtc-native"
+
+ALLOW_EMPTY_${PN} = "1"
+FILES_${PN} = ""
+
+S = "${WORKDIR}"
+
+do_compile[depends] += "virtual/kernel:do_deploy"
+
+do_compile () {
+ # Official touchscreen setup (rpi3b/rpi3b dtb, vc4-kms-v3d and ft5406)
+ if [ -f "${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b-plus.dtb" ]; then
+ fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b-plus.dtb -o bcm2710-rpi-3-b-plus+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo ${DEPLOY_DIR_IMAGE}/vc4-kms-v3d.dtbo
+ fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b.dtb -o bcm2710-rpi-3-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo ${DEPLOY_DIR_IMAGE}/vc4-kms-v3d.dtbo
+ fi
+
+ # HDMI screen setup (rpi3b/rpi3b dtb and vc4-kms-v3d)
+ if [ -f "${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b-plus.dtb" ]; then
+ fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b-plus.dtb -o bcm2710-rpi-3-b-plus+vc4.dtb ${DEPLOY_DIR_IMAGE}/vc4-kms-v3d.dtbo
+ fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b.dtb -o bcm2710-rpi-3-b+vc4.dtb ${DEPLOY_DIR_IMAGE}/vc4-kms-v3d.dtbo
+ fi
+}
+
+do_deploy () {
+ install -d ${DEPLOY_DIR_IMAGE}
+ if [ -f "${S}/bcm2710-rpi-3-b+vc4+ft5406.dtb" ]; then
+ install -m 0644 ${S}/bcm2710-rpi-3-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}
+ fi
+ if [ -f "${S}/bcm2710-rpi-3+vc4+ft5406.dtb" ]; then
+ install -m 0644 ${S}/bcm2710-rpi-3+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}
+ fi
+ if [ -f "${S}/bcm2710-rpi-3-b+vc4.dtb" ]; then
+ install -m 0644 ${S}/bcm2710-rpi-3-b+vc4.dtb ${DEPLOY_DIR_IMAGE}
+ fi
+ if [ -f "${S}/bcm2710-rpi-3+vc4.dtb" ]; then
+ install -m 0644 ${S}/bcm2710-rpi-3+vc4.dtb ${DEPLOY_DIR_IMAGE}
+ fi
+}
+
+addtask deploy after do_install
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch
new file mode 100644
index 00000000..1ad0fd1b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch
@@ -0,0 +1,39 @@
+From c9d4f263131cb8e62597e0a296968b5cdbfe0019 Mon Sep 17 00:00:00 2001
+From: Andrei Gherzan <andrei@gherzan.ro>
+Date: Thu, 27 Jun 2019 20:49:10 +0100
+Subject: [PATCH] brcmfmac43455-sdio.txt: Follow raspbian change for
+ boardflags3
+
+Without this change the WiFi interface on RPi4 never comes up. Also the
+upstream repository doesn't include this change. It is only (as far as I
+know) part of the raspberrypi deb repository with the following
+changelog:
+
+firmware-nonfree (1:20190114-1+rpt2) buster; urgency=medium
+ * Update brcmfmac43455-sdio.txt
+ - Update boardflags3
+ -- Serge Schneider <serge@raspberrypi.org> Thu, 18 Apr 2019 14:35:34
++0100
+
+Upstream-status: Pending
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+---
+ brcm/brcmfmac43455-sdio.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/brcm/brcmfmac43455-sdio.txt b/brcm/brcmfmac43455-sdio.txt
+index 54d9321..6801286 100644
+--- a/brcm/brcmfmac43455-sdio.txt
++++ b/brcm/brcmfmac43455-sdio.txt
+@@ -21,7 +21,7 @@ btc_mode=1
+ # bit1 for btcoex
+ boardflags=0x00480201
+ boardflags2=0x40800000
+-boardflags3=0x48200100
++boardflags3=0x44200100
+ phycal_tempdelta=15
+ rxchain=1
+ txchain=1
+--
+2.17.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend
new file mode 100644
index 00000000..30c18fb0
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch"
+
+do_unpack_append() {
+ bb.build.exec_func('do_clean_pc', d)
+}
+do_clean_pc() {
+ rm -rf ${S}/.pc
+}
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg
new file mode 100644
index 00000000..07b14371
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg
@@ -0,0 +1 @@
+CONFIG_SENSORS_RPI_POE_FAN=m
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch
new file mode 100644
index 00000000..00e36920
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch
@@ -0,0 +1,33 @@
+From f9fefc63456dd50eeec727ae2fbc13b0d84eb44e Mon Sep 17 00:00:00 2001
+From: Tom Pollard <tom.pollard@codethink.co.uk>
+Date: Wed, 6 Apr 2016 07:47:25 +0000
+Subject: [PATCH 1/1] Fix lack of touch up for Faytech 10" Touchscreen MonitorV2
+
+NOTE: This is a very temporary hack that is not in a state to be upstreamed yet.
+---
+Index: a/drivers/hid/hid-multitouch.c
+===================================================================
+--- a/drivers/hid/hid-multitouch.c 2016-07-05 08:45:06.006466000 +0000
++++ b/drivers/hid/hid-multitouch.c 2016-07-05 08:48:44.574466000 +0000
+@@ -205,7 +205,6 @@
+ { .name = MT_CLS_WIN_8,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_IGNORE_DUPLICATES |
+- MT_QUIRK_HOVERING |
+ MT_QUIRK_CONTACT_CNT_ACCURATE },
+ { .name = MT_CLS_EXPORT_ALL_INPUTS,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+@@ -396,11 +395,6 @@
+ td->is_buttonpad = true;
+
+ break;
+- case 0xff0000c5:
+- /* Retrieve the Win8 blob once to enable some devices */
+- if (usage->usage_index == 0)
+- mt_get_feature(hdev, field->report);
+- break;
+ }
+ }
+
+--
+1.9.1
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg
new file mode 100644
index 00000000..4a67a7e6
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg
@@ -0,0 +1 @@
+CONFIG_KPROBES=n
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg
new file mode 100644
index 00000000..eac59dbd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg
@@ -0,0 +1,12 @@
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BT_HCIUART_BCSP is not set
+# CONFIG_BT_HCIUART_ATH3K is not set
+# CONFIG_BT_HCIUART_LL is not set
+CONFIG_BT_HCIUART_3WIRE=y
+# CONFIG_BT_HCIUART_INTEL is not set
+CONFIG_BT_HCIUART_BCM=y
+# CONFIG_BT_HCIUART_QCA is not set
+# CONFIG_BT_HCIUART_AG6XX is not set
+# CONFIG_BT_HCIUART_MRVL is not set
+# CONFIG_BT_HCIBPA10X is not set
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg
new file mode 100644
index 00000000..8c573578
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg
@@ -0,0 +1 @@
+CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=y
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg
new file mode 100644
index 00000000..993d1508
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg
@@ -0,0 +1,5 @@
+CONFIG_NETDEVICES=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_DRIVERS=y
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_SMSC75XX=y
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc
new file mode 100644
index 00000000..ea7f7783
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc
@@ -0,0 +1,140 @@
+DESCRIPTION = "Linux Kernel for Raspberry Pi"
+SECTION = "kernel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+COMPATIBLE_MACHINE = "^rpi$"
+
+PE = "1"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+inherit kernel siteinfo
+require recipes-kernel/linux/linux-yocto.inc
+
+SRC_URI += "file://rpi-kernel-misc.cfg"
+
+KCONFIG_MODE = "--alldefconfig"
+KBUILD_DEFCONFIG_raspberrypi0-wifi ?= "bcmrpi_defconfig"
+KBUILD_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig"
+KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig"
+KBUILD_DEFCONFIG_raspberrypi3 ?= "bcm2709_defconfig"
+KBUILD_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig"
+KBUILD_DEFCONFIG_raspberrypi4 ?= "bcm2711_defconfig"
+KBUILD_DEFCONFIG_raspberrypi4-64 ?= "bcm2711_defconfig"
+
+# CMDLINE for raspberrypi
+SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}"
+CMDLINE ?= "dwc_otg.lpm_enable=0 ${SERIAL} root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
+
+# Add the kernel debugger over console kernel command line option if enabled
+CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
+
+# Disable rpi logo on boot
+CMDLINE_append += ' ${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}'
+
+# You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf
+# to enable kernel debugging.
+CMDLINE_DEBUG ?= ""
+CMDLINE_append = " ${CMDLINE_DEBUG}"
+
+KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}"
+
+# A LOADADDR is needed when building a uImage format kernel. This value is not
+# set by default in rpi-4.8.y and later branches so we need to provide it
+# manually. This value unused if KERNEL_IMAGETYPE is not uImage.
+KERNEL_EXTRA_ARGS += "LOADADDR=0x00008000"
+
+# Set a variable in .configure
+# $1 - Configure variable to be set
+# $2 - value [n/y/value]
+kernel_configure_variable() {
+ # Remove the config
+ CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
+ if test "$2" = "n"
+ then
+ echo "# CONFIG_$1 is not set" >> ${B}/.config
+ else
+ echo "CONFIG_$1=$2" >> ${B}/.config
+ fi
+}
+
+config_setup() {
+ # From kernel.bbclass. Unfortunately, this is needed to support builds that
+ # use devtool. The reason is as follows:
+ #
+ # - In devtool builds, externalsrc.bbclass gets inherited and sets a list of
+ # SRCTREECOVEREDTASKS, which don't get run because they affect the source
+ # tree and, when using devtool, we want the developer's changes to be the
+ # single source of truth. kernel-yocto.bbclass adds do_kernel_configme to
+ # SRCTREECOVEREDTASKS, so it doesn't run in a devtool build., In a normal
+ # non-devtool build, do_kernel_configme creates ${B}.config.
+ #
+ # - Normally (e.g. in linux-yocto), it would be OK that do_kernel_configme
+ # doesn't run, because the first few lines of do_configure in kernel.bbclass
+ # populate ${B}.config from either ${S}.config (if it exists) for custom
+ # developer changes, or otherwise from ${WORDIR}/defconfig.
+ #
+ # - In linux-raspberrypi, we add do_configure_prepend, which tweaks
+ # ${B}.config. Since this runs *before* the kernel.bbclass do_configure,
+ # ${B}.config doesn't yet exist and we hit an error. Thus we need to move
+ # the logic from do_configure up to before our do_configure_prepend. Because
+ # we are copying only a portion of do_configure and not the whole thing,
+ # there is no clean way to do it using OE functionality, so we just
+ # copy-and-paste.
+ if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
+ mv "${S}/.config" "${B}/.config"
+ fi
+
+ # Copy defconfig to .config if .config does not exist. This allows
+ # recipes to manage the .config themselves in do_configure_prepend().
+ if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
+ cp "${WORKDIR}/defconfig" "${B}/.config"
+ fi
+}
+
+do_configure_prepend() {
+ config_setup
+
+ mv -f ${B}/.config ${B}/.config.patched
+ CONF_SED_SCRIPT=""
+
+ # Localversion
+ kernel_configure_variable LOCALVERSION "\"\""
+
+ if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
+ kernel_configure_variable OVERLAY_FS y
+ kernel_configure_variable SQUASHFS y
+ kernel_configure_variable UBIFS_FS y
+ fi
+
+ # Activate the configuration options for VC4
+ VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}"
+ if [ "${VC4GRAPHICS}" = "1" ]; then
+ kernel_configure_variable I2C_BCM2835 y
+ kernel_configure_variable DRM y
+ kernel_configure_variable DRM_FBDEV_EMULATION y
+ kernel_configure_variable DRM_VC4 y
+ fi
+
+ # Keep this the last line
+ # Remove all modified configs and add the rest to .config
+ sed -e "${CONF_SED_SCRIPT}" < '${B}/.config.patched' >> '${B}/.config'
+ rm -f ${B}/.config.patched
+}
+
+do_compile_append() {
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ cc_extra=$(get_cc_option)
+ oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
+ fi
+}
+
+do_deploy_append() {
+ # Deploy cmdline.txt
+ install -d ${DEPLOYDIR}/bcm2835-bootfiles
+ PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
+ if [ ${PITFT} = "1" ]; then
+ PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8"
+ fi
+ echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt
+}
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
new file mode 100644
index 00000000..c12cd6c5
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
@@ -0,0 +1,40 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+
+require recipes-kernel/linux/linux-agl.inc
+
+# NOTE: Kprobes need to be disabled until linux-raspberrypi gets updated
+# to newer than 4.14.104 to avoid lttng-modules failing to build.
+SRC_URI_append = "\
+ ${@oe.utils.conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \
+ file://disable_kprobes.cfg \
+"
+
+CMDLINE_DEBUG = ""
+CMDLINE_append = " usbhid.mousepoll=0"
+
+# Add options to allow CMA to operate
+CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_CMA", "1", "coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}'
+
+KERNEL_MODULE_AUTOLOAD += "snd-bcm2835"
+KERNEL_MODULE_AUTOLOAD += "hid-multitouch"
+
+RDEPENDS_${PN} += "kernel-module-snd-bcm2835"
+PACKAGES += "kernel-module-snd-bcm2835"
+
+# Enable support for usb video class for usb camera devices
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/uvc.cfg"
+
+# Enable support for joystick devices
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/joystick.cfg"
+
+# Enable support for Pi foundation touchscreen
+SRC_URI_append = " file://raspberrypi-panel.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/raspberrypi-panel.cfg"
+
+# Enable bt hci uart
+SRC_URI_append = " file://raspberrypi-hciuart.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/raspberrypi-hciuart.cfg"
+
+# ENABLE NETWORK (built-in)
+SRC_URI_append = " file://raspberrypi_network.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/raspberrypi_network.cfg"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend
new file mode 100644
index 00000000..ba11890b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend
@@ -0,0 +1 @@
+require recipes-kernel/linux/linux-agl-4.14.inc
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb
new file mode 100644
index 00000000..e58559b8
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb
@@ -0,0 +1,16 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"
+
+LINUX_VERSION ?= "4.19.58"
+LINUX_RPI_BRANCH ?= "rpi-4.19.y"
+
+SRCREV = "8222f38b1ceadd0642d49812fd34a3a6cb00e264"
+SRC_URI = " \
+ git://github.com/raspberrypi/linux.git;protocol=git;branch=${LINUX_RPI_BRANCH} \
+ "
+SRC_URI_append_raspberrypi4-64 = " file://rpi4-64-kernel-misc.cfg"
+
+require linux-raspberrypi4.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
+
+KERNEL_EXTRA_ARGS_append_rpi = " DTC_FLAGS='-@ -H epapr'"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
new file mode 100644
index 00000000..e48a380a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
@@ -0,0 +1,2 @@
+# Disable faad by default to avoid licensing issues
+PACKAGECONFIG_remove_rpi = "faad"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc
new file mode 100644
index 00000000..9295739b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc
@@ -0,0 +1,5 @@
+#Keep this as a reminder
+#MACHINEOVERRIDES .= ":kingfisher"
+#PACKAGE_EXTRA_ARCHS_append = " kingfisher"
+
+PREFERRED_RPROVIDER_virtual/gpsd-conf ?= "gpsd-kingfisher-conf"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf
new file mode 100644
index 00000000..796d9268
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf
@@ -0,0 +1,73 @@
+# We have a conf and classes directory, append to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes directory, add to BBFILES
+BBFILES += " \
+ ${LAYERDIR}/../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-*/*/*.bb \
+ ${LAYERDIR}/../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-*/*/*.bbappend \
+ ${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend \
+"
+
+BBFILE_COLLECTIONS += "rcar-gen3-cogent"
+BBFILE_PATTERN_rcar-gen3-cogent := "^${LAYERDIR}/../../../bsp/meta-rcar/meta-rcar-gen3-adas/"
+BBFILE_PRIORITY_rcar-gen3-cogent = "7"
+
+LAYERSERIES_COMPAT_rcar-gen3-cogent = "thud"
+
+# Custom packages
+IMAGE_INSTALL_append_rcar-gen3 = " \
+ can-utils \
+ libsocketcan \
+ spidev-dbg spidev-test \
+ e2fsprogs \
+ e2fsprogs-tune2fs \
+ ethtool \
+ pciutils \
+ usbutils \
+ mtd-utils \
+ capture \
+ v4l2-fw \
+ iperf3 \
+ bonnie++ \
+ lmbench \
+ eglibc-utils \
+ mm-init \
+ iio-utils \
+ most-tools \
+"
+
+# Radio packages
+IMAGE_INSTALL_append_rcar-gen3 += " \
+ si-tools \
+ si-init \
+ linux-firmware-wl18xx \
+ ti-bt \
+ ti-bt-firmware \
+ bluez5 \
+ bluez5-testtools \
+ ofono \
+ ofono-tests \
+"
+
+# IMP
+IMAGE_INSTALL_append_r8a7797 += " \
+ kernel-module-uio-imp \
+ kernel-module-cmemdrv \
+ udev-rules-cvlib \
+"
+
+IMAGE_INSTALL_append_r8a7798 += " \
+ kernel-module-uio-imp \
+ kernel-module-cmemdrv \
+ udev-rules-cvlib \
+"
+
+DISTRO_FEATURES_append = " surroundview "
+DISTRO_FEATURES_append = " bluetooth"
+
+
+BBMASK += "/meta-rcar-gen3-adas/recipes-core/systemd/"
+BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/opencv/"
+BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/valgrind/"
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service
new file mode 100644
index 00000000..d2204cb6
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Initialize Si468x radio
+ConditionPathExists=/sys/firmware/devicetree/base/si468x@0/compatible
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/si_init
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch
new file mode 100644
index 00000000..9bbccadd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch
@@ -0,0 +1,184 @@
+FM configuration improvements
+
+Changes include:
+- Add command-line option for selecting FM band plan. The default
+ band plan is US / Canada.
+- Add command-line options for setting FM scanning valid SNR and RSSI
+ thresholds to allow tweaking sensitivity in poor radio environments.
+- Increased seeking scan timeout to 3 seconds, which seems to improve
+ behavior in poor radio environments where powerful stations may be
+ far apart.
+- Removed explicit setting of FM_SOFTMUTE_SNR_LIMITS, as it seemed
+ like it might be resulting in odd muting behavior when scanning.
+- Changed initial FM frequency if not specified to the minimum of the
+ band plan.
+
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+diff --git a/si46xx.h b/si46xx.h
+index 172ea8b..c32fca4 100644
+--- a/si46xx.h
++++ b/si46xx.h
+@@ -83,6 +83,7 @@
+ #define SI46XX_PIN_CONFIG_ENABLE 0x0800
+ #define SI46XX_FM_SEEK_BAND_BOTTOM 0x3100
+ #define SI46XX_FM_SEEK_BAND_TOP 0x3101
++#define SI46XX_FM_SEEK_FREQUENCY_SPACING 0x3102
+ #define SI46XX_FM_VALID_MAX_TUNE_ERROR 0x3200
+ #define SI46XX_FM_VALID_RSSI_TIME 0x3201
+ #define SI46XX_FM_VALID_RSSI_THRESHOLD 0x3202
+@@ -150,7 +151,7 @@
+ #define MAX_SERVICES 32
+ #define MAX_COMPONENTS 15
+
+-#define TIMEOUT_SEEK 2000 /* mS = 2S */
++#define TIMEOUT_SEEK 3000 /* mS = 3S */
+ #define TIMEOUT_TUNE 500 /* mS = .5S */
+
+ struct dab_service_t{
+diff --git a/si_ctl.c b/si_ctl.c
+index 59dfaf2..f168218 100644
+--- a/si_ctl.c
++++ b/si_ctl.c
+@@ -101,6 +101,26 @@ uint32_t frequency_list_ch[] = { CHAN_12A,
+ CHAN_9D,
+ CHAN_8B};
+
++// Structure to describe FM band plans, all values in Hz.
++typedef struct {
++ char *name;
++ uint32_t min;
++ uint32_t max;
++ uint32_t step;
++} fm_band_plan_t;
++
++static fm_band_plan_t known_fm_band_plans[5] = {
++ { .name = "US", .min = 87900000, .max = 107900000, .step = 200000 },
++ { .name = "JP", .min = 76000000, .max = 95000000, .step = 100000 },
++ { .name = "EU", .min = 87500000, .max = 108000000, .step = 50000 },
++ { .name = "ITU-1", .min = 87500000, .max = 108000000, .step = 50000 },
++ { .name = "ITU-2", .min = 87900000, .max = 107900000, .step = 50000 }
++};
++
++static unsigned int fm_band_plan;
++static int fm_snr_threshold = 128;
++static int fm_rssi_threshold = 128;
++
+ int init_am(int offset)
+ {
+ int ret;
+@@ -160,12 +180,32 @@ int init_fm(int offset)
+ * enable I2S output
+ */
+ si46xx_set_property(SI46XX_PIN_CONFIG_ENABLE, 0x0003);
+- //si46xx_set_property(SI46XX_FM_VALID_RSSI_THRESHOLD,0x0000);
+- //si46xx_set_property(SI46XX_FM_VALID_SNR_THRESHOLD,0x0000);
+- si46xx_set_property(SI46XX_FM_SOFTMUTE_SNR_LIMITS, 0x0000); // set the SNR limits for soft mute attenuation
++ //si46xx_set_property(SI46XX_FM_SOFTMUTE_SNR_LIMITS, 0x0000); // set the SNR limits for soft mute attenuation
+ si46xx_set_property(SI46XX_FM_TUNE_FE_CFG, 0x0000); // front end switch open
+- si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, 88000 / 10);
+- si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, 108000 / 10);
++
++ //si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, 88000 / 10);
++ //si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, 108000 / 10);
++ if (verbose)
++ fprintf(stderr, "Using FM Bandplan: %s\n", known_fm_band_plans[fm_band_plan].name);
++ si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, known_fm_band_plans[fm_band_plan].min / 10000);
++ si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, known_fm_band_plans[fm_band_plan].max / 10000);
++ if (verbose)
++ fprintf(stderr, "Using FM band: %d - %d, %d spacing\n",
++ known_fm_band_plans[fm_band_plan].min / 10000,
++ known_fm_band_plans[fm_band_plan].max / 10000,
++ known_fm_band_plans[fm_band_plan].step / 10000);
++ si46xx_set_property(SI46XX_FM_SEEK_FREQUENCY_SPACING, known_fm_band_plans[fm_band_plan].step / 10000);
++ if (fm_snr_threshold != 128) {
++ if (verbose)
++ fprintf(stderr, "Setting FM valid SNR threshold to %d dB\n", fm_snr_threshold);
++ si46xx_set_property(SI46XX_FM_VALID_SNR_THRESHOLD, fm_snr_threshold);
++ }
++ if (fm_rssi_threshold != 128) {
++ if (verbose)
++ fprintf(stderr, "Setting FM valid RSSI threshold to %d dB\n", fm_rssi_threshold);
++ si46xx_set_property(SI46XX_FM_VALID_RSSI_THRESHOLD, fm_rssi_threshold);
++ }
++
+ /*
+ * rate
+ */
+@@ -190,6 +230,7 @@ int init_fm(int offset)
+
+ return 0;
+ }
++
+ int init_dab(int offset)
+ {
+ int ret;
+@@ -245,6 +286,10 @@ int output_help(char *prog_name)
+ printf(" -l up|down FM/AM seek next station\n");
+ printf(" -d FM/AM RSQ status\n");
+ printf(" -m FM rds status\n");
++ printf("Common FM:\n");
++ printf(" -p bandplan FM bandplan (us, jp, eu, itu-1, itu-2\n");
++ printf(" -t SNR FM scan valid SNR threshold (-127 to 127 dB)\n");
++ printf(" -u RSSI FM scan valid RSSI threshold (-127 to 127 dBuV)\n");
+ printf("DAB only:\n");
+ printf(" -e dab status\n");
+ printf(" -f service start service of dab service list\n");
+@@ -354,6 +399,7 @@ int main(int argc, char **argv)
+ int offset = - 1;
+ int mode;
+ int tmp;
++ unsigned int i;
+ struct dab_digrad_status_t dab_digrad_status;
+ bool init = false;
+ bool seek_up = false;
+@@ -374,7 +420,7 @@ int main(int argc, char **argv)
+
+ optind = 0;
+ while (optind < argc) {
+- if ((c = getopt(argc, argv, "a:b:c:def:ghi:j:k:l:mnosv")) != -1) {
++ if ((c = getopt(argc, argv, "a:b:c:def:ghi:j:k:l:mnop:st:u:v")) != -1) {
+ switch(c){
+ /* init */
+ case 'a':
+@@ -422,6 +468,31 @@ int main(int argc, char **argv)
+ case 'c':
+ frequency = atoi(optarg);
+ break;
++ /* FM */
++ case 'p':
++ for(i = 0;
++ i < sizeof(known_fm_band_plans) / sizeof(fm_band_plan_t);
++ i++) {
++ if(!strcasecmp(optarg, known_fm_band_plans[i].name)) {
++ fm_band_plan = i;
++ break;
++ }
++ }
++ if(i >= (sizeof(known_fm_band_plans) / sizeof(fm_band_plan_t))) {
++ printf("Invalid mode: %s\n", optarg);
++ return -EINVAL;
++ }
++ break;
++ case 't':
++ fm_snr_threshold = atoi(optarg);
++ if(fm_snr_threshold < -128 || fm_snr_threshold > 127)
++ fm_snr_threshold = 128; // use firmware default
++ break;
++ case 'u':
++ fm_rssi_threshold = atoi(optarg);
++ if(fm_rssi_threshold < -128 || fm_rssi_threshold > 127)
++ fm_rssi_threshold = 128; // use firmware default
++ break;
+ /* DAB stuff. TODO: rework */
+ case 'e':
+ si46xx_dab_digrad_status(&dab_digrad_status);
+@@ -473,7 +544,7 @@ int main(int argc, char **argv)
+ case SI46XX_MODE_FM:
+ ret = init_fm(offset);
+ if (frequency < 0)
+- frequency = 105500;
++ frequency = known_fm_band_plans[fm_band_plan].min / 1000;
+ break;
+ case SI46XX_MODE_AM:
+ ret = init_am(offset);
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb
new file mode 100644
index 00000000..7ab99e02
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Systemd service unit for Si468x radio initialization"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit systemd
+
+SRC_URI = "file://si-init.service"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/si-init.service ${D}${systemd_system_unitdir}
+
+ # Add symlink to sysinit.target.wants
+ install -d ${D}${sysconfdir}/systemd/system/sysinit.target.wants
+ ln -s ${systemd_system_unitdir}/si-init.service ${D}${sysconfdir}/systemd/system/sysinit.target.wants/
+
+ # Add a rule to ensure the 'audio' user has permission to access
+ # the Si468x device via i2c
+ install -d ${D}${sysconfdir}/udev/rules.d
+ cat >${D}${sysconfdir}/udev/rules.d/zz-radio-si.rules <<'EOF'
+KERNEL=="i2c-12", MODE="0660", GROUP="audio", SECLABEL{smack}="*"
+EOF
+}
+
+FILES_${PN} += "${systemd_system_unitdir}"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend
new file mode 100644
index 00000000..7a459314
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend
@@ -0,0 +1,8 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/files"
+
+SRC_URI += " \
+ file://si-tools-fm-improvements.patch \
+"
+
+EXTRA_OEMAKE_append = " 'LDFLAGS=${LDFLAGS}'"
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service
new file mode 100644
index 00000000..214e6070
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=User Mode Init Manager for TI shared transport
+Before=bluetooth.service
+
+[Service]
+ExecStartPre=-/sbin/modprobe -q btwilink
+ExecStart=/usr/bin/uim -f /sys/devices/platform/kim
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend
new file mode 100644
index 00000000..a08cb262
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend
@@ -0,0 +1,18 @@
+inherit systemd
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://ti-uim.service"
+
+SYSTEMD_SERVICE_${PN} = "ti-uim.service"
+
+PR = "r0"
+PV = "0.1+git${SRCPV}"
+
+do_install_append() {
+ # We do not want the blacklist
+ rm -f ${D}/${sysconfdir}/modprobe.d/ti_bt.conf
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/ti-uim.service ${D}${systemd_unitdir}/system
+}
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch
new file mode 100644
index 00000000..64c9542a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch
@@ -0,0 +1,84 @@
+From ce9a7a41a9f65cc8cc129cdd27e155b35b26d393 Mon Sep 17 00:00:00 2001
+From: Matt Porter <mporter@konsulko.com>
+Date: Wed, 13 Dec 2017 12:49:20 -0500
+Subject: [PATCH] arm64: dts: renesas: preserve drm HDMI connector naming on KF
+
+Kingfisher adds encoders on ports 0 and 2 of the R-Car
+display unit. The bare ULCB SK has only an HDMI encoder
+in use on port 1. When the system is booted with an SK
+dtb, port 1's HDMI encoder is assigned as HDMI-A-1 because
+it is the first (and only) encoder present. When booting
+a KF dtb, port 0's HDMI encoder preceeds port1 in the dtb due
+to incremental ordering of the endpoint port nodes. This causes
+the KF HDMI to be assigned HDMI-A-1 and the SK HDMI to be assigned
+as HDMI-A-2. In order to preserve the SK's HDMI output naming as
+connector HDMI-A-1, reorder the endpoint port nodes so that port1
+is first.
+
+Change-Id: Ibbb1975c2383a526a54c257fb7d68d32a042d468
+Signed-off-by: Matt Porter <mporter@konsulko.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
+---
+ arch/arm64/boot/dts/renesas/r8a7795.dtsi | 10 +++++-----
+ arch/arm64/boot/dts/renesas/r8a7796.dtsi | 10 +++++-----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+index f7f947d27b0d..5bcc2391587d 100644
+--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
++++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+@@ -3054,11 +3054,6 @@
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+- port@0 {
+- reg = <0>;
+- du_out_rgb: endpoint {
+- };
+- };
+ port@1 {
+ reg = <1>;
+ du_out_hdmi0: endpoint {
+@@ -3076,6 +3071,11 @@
+ du_out_lvds0: endpoint {
+ };
+ };
++ port@0 {
++ reg = <0>;
++ du_out_rgb: endpoint {
++ };
++ };
+ };
+ };
+
+diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+index df26656e0f19..154ac1dd91fa 100644
+--- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
++++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+@@ -2846,11 +2846,6 @@
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+- port@0 {
+- reg = <0>;
+- du_out_rgb: endpoint {
+- };
+- };
+ port@1 {
+ reg = <1>;
+ du_out_hdmi0: endpoint {
+@@ -2862,6 +2857,11 @@
+ du_out_lvds0: endpoint {
+ };
+ };
++ port@0 {
++ reg = <0>;
++ du_out_rgb: endpoint {
++ };
++ };
+ };
+ };
+
+--
+2.11.0
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/disable_most.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/disable_most.cfg
new file mode 100644
index 00000000..4179e25c
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/disable_most.cfg
@@ -0,0 +1,9 @@
+# CONFIG_STAGING is not set
+# CONFIG_MOST is not set
+# CONFIG_MOSTCORE is not set
+# CONFIG_AIM_CDEV is not set
+# CONFIG_AIM_NETWORK is not set
+# CONFIG_AIM_SOUND is not set
+# CONFIG_AIM_V4L2 is not set
+# CONFIG_HDM_DIM2 is not set
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend
new file mode 100644
index 00000000..72a4a78e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend
@@ -0,0 +1,30 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_ulcb = " \
+ file://0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch \
+ file://disable_most.cfg \
+"
+
+SRC_URI_remove_ulcb = " \
+ file://0113-arm64-dts-ulcb-kf-increase-SDIO-frequency-for-WLAN-c.patch \
+"
+
+KERNEL_DEVICETREE_remove_h3ulcb = " \
+ renesas/r8a7795-es1-h3ulcb-view.dtb \
+ renesas/r8a7795-es1-h3ulcb-had-alfa.dtb \
+ renesas/r8a7795-es1-h3ulcb-had-beta.dtb \
+ renesas/r8a7795-es1-h3ulcb-vb.dtb \
+ renesas/r8a7795-es1-h3ulcb-vb2.dtb \
+ renesas/r8a7795-es1-h3ulcb-vbm.dtb \
+ renesas/r8a7795-h3ulcb-view.dtb \
+ renesas/r8a7795-h3ulcb-had-alfa.dtb \
+ renesas/r8a7795-h3ulcb-had-beta.dtb \
+ renesas/r8a7795-h3ulcb-vb.dtb \
+ renesas/r8a7795-h3ulcb-vb2.dtb \
+ renesas/r8a7795-h3ulcb-vb2.1.dtb \
+ renesas/r8a7795-h3ulcb-vbm.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vb.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vb2.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vb2.1.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vbm.dtb \
+"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf
new file mode 100644
index 00000000..f0c47231
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf
@@ -0,0 +1,2 @@
+input-device-name=/dev/video16
+output-device-name=/dev/video17
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf
new file mode 100644
index 00000000..25a3fa1e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf
@@ -0,0 +1,2 @@
+input-device-name=/dev/video8
+output-device-name=/dev/video9
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend
new file mode 100644
index 00000000..e77b58e0
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend
@@ -0,0 +1,3 @@
+COMPATIBLE_MACHINE = "r8a7795|r8a7796"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher
new file mode 100644
index 00000000..7e991dc0
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher
@@ -0,0 +1,4 @@
+# If you must specify a non-NMEA driver, uncomment and modify the next line
+GPSD_SOCKET="/var/run/gpsd.sock"
+GPSD_OPTIONS=""
+GPS_DEVICES="/dev/ttySC2"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-kingfisher-conf_1.0.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-kingfisher-conf_1.0.bb
new file mode 100644
index 00000000..2c4192b9
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-kingfisher-conf_1.0.bb
@@ -0,0 +1,27 @@
+SUMMARY = "King fisher specific gpsd config"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD;md5=3775480a712fc46a69647678acb234cb"
+
+SRC_URI = " \
+ file://gpsd.kingfisher \
+"
+
+inherit update-alternatives
+
+RPROVIDES_${PN} += "virtual/gpsd-conf"
+
+ALTERNATIVE_${PN} = "gpsd-defaults"
+ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
+ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.kingfisher"
+ALTERNATIVE_PRIORITY[gpsd-defaults] = "20"
+
+COMPATIBLE_MACHINE = "ulcb"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+ install -d ${D}/${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/gpsd.kingfisher ${D}/${sysconfdir}/default/gpsd.kingfisher
+}
+
+FILES_${PN} = "${sysconfdir}/default/gpsd.kingfisher"
+CONFFILES_${PN} = "${sysconfdir}/default/gpsd.kingfisher"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend
new file mode 100644
index 00000000..72d991c7
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644
index 00000000..12353942
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state
@@ -0,0 +1,321 @@
+state.ak4613 {
+ control.1 {
+ iface MIXER
+ name 'Digital Playback Volume1'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.2 {
+ iface MIXER
+ name 'Digital Playback Volume2'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.3 {
+ iface MIXER
+ name 'Digital Playback Volume3'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.4 {
+ iface MIXER
+ name 'Digital Playback Volume4'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.5 {
+ iface MIXER
+ name 'Digital Playback Volume5'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.6 {
+ iface MIXER
+ name 'Digital Playback Volume6'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.7 {
+ iface MIXER
+ name 'DVC Out Playback Volume'
+ value.0 1677721
+ value.1 1677721
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 8388607'
+ }
+ }
+ control.8 {
+ iface MIXER
+ name 'DVC Out Mute Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.9 {
+ iface MIXER
+ name 'DVC Out Ramp Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.10 {
+ iface MIXER
+ name 'DVC Out Ramp Up Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+ control.11 {
+ iface MIXER
+ name 'DVC Out Ramp Down Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+ control.12 {
+ iface MIXER
+ name 'SRC Out Rate Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.13 {
+ iface MIXER
+ name 'SRC Out Rate'
+ value 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 192000'
+ }
+ }
+ control.14 {
+ iface MIXER
+ name 'DVC In Capture Volume'
+ value.0 838861
+ value.1 838861
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 8388607'
+ }
+ }
+ control.15 {
+ iface MIXER
+ name 'DVC In Mute Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.16 {
+ iface MIXER
+ name 'DVC In Ramp Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.17 {
+ iface MIXER
+ name 'DVC In Ramp Up Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+ control.18 {
+ iface MIXER
+ name 'DVC In Ramp Down Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+}
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend
new file mode 100644
index 00000000..cdfb3cbe
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append = " \
+ file://0001-Boot-Normal-World-in-EL2.patch \
+"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-Boot-Normal-World-in-EL2.patch b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-Boot-Normal-World-in-EL2.patch
new file mode 100644
index 00000000..6ce9c0f9
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-Boot-Normal-World-in-EL2.patch
@@ -0,0 +1,28 @@
+From c97f38b09f8b7d9c57a6e6f500c6ba8f7abd9914 Mon Sep 17 00:00:00 2001
+From: Michele Paolino <m.paolino@virtualopensystems.com>
+Date: Fri, 19 May 2017 14:50:55 +0200
+Subject: [PATCH] Boot Normal World in EL2
+
+This patch configures ATF (SPSR register) to boot BL33 in EL2.
+
+Signed-off-by: Michele Paolino <m.paolino@virtualopensystems.com>
+---
+ plat/renesas/rcar/platform.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plat/renesas/rcar/platform.mk b/plat/renesas/rcar/platform.mk
+index ef7bf0f..06bc592 100644
+--- a/plat/renesas/rcar/platform.mk
++++ b/plat/renesas/rcar/platform.mk
+@@ -186,7 +186,7 @@ $(eval $(call add_define,RCAR_DRAM_SPLIT))
+
+ # Process RCAR_BL33_EXECUTION_EL flag
+ ifndef RCAR_BL33_EXECUTION_EL
+-RCAR_BL33_EXECUTION_EL := 0
++RCAR_BL33_EXECUTION_EL := 1
+ endif
+ $(eval $(call add_define,RCAR_BL33_EXECUTION_EL))
+
+--
+2.7.4
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt
new file mode 100644
index 00000000..ff86b4e8
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt
@@ -0,0 +1,18 @@
+bootkaddr=0x49090000
+bootdaddr=0x48000000
+bootiaddr=0x5C3F9520
+
+bootargs_console=console=ttySC0,115200 ignore_loglevel
+bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2
+bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384
+
+bootmmc=0:1
+rootmmc=0:2
+
+booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize}
+bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image}
+bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize}
+bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} Image-r8a7795-h3ulcb.dtb
+
+bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr}
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt
new file mode 100644
index 00000000..64f83330
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt
@@ -0,0 +1,18 @@
+bootkaddr=0x49090000
+bootdaddr=0x48000000
+bootiaddr=0x5C3F9520
+
+bootargs_console=console=ttySC0,115200 ignore_loglevel
+bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2
+bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384
+
+bootmmc=0:1
+rootmmc=0:2
+
+booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize}
+bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image}
+bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize}
+bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} Image-r8a7796-m3ulcb.dtb
+
+bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr}
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb
new file mode 100644
index 00000000..db08f3f4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb
@@ -0,0 +1,26 @@
+DESCRIPTION = "Boot files (bootscripts etc.) for Renesas RCar-M3 board"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit deploy
+
+COMPATIBLE_MACHINE = "(m3ulcb|h3ulcb|ebisu)"
+
+S = "${WORKDIR}"
+
+SRC_URI_append_sota = "file://uEnv-ota-m3ulcb.txt \
+ file://uEnv-ota-h3ulcb.txt"
+
+do_deploy() {
+ install -d ${DEPLOYDIR}/${PN}
+}
+
+do_deploy_append_sota() {
+ install -m 0755 ${WORKDIR}/uEnv-ota-${BOARD_NAME}.txt ${DEPLOYDIR}/${PN}/uEnv.txt
+}
+
+addtask deploy before do_package after do_install
+do_deploy[dirs] += "${DEPLOYDIR}/${PN}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb
new file mode 100644
index 00000000..a477e1c3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb
@@ -0,0 +1,7 @@
+DESCRIPTION = "Virtual gles-module"
+
+LICENSE="GPLv2"
+
+DEPENDS = "gles-user-module wayland-kms libgbm"
+
+PROVIDES = "virtual/libgles2 virtual/egl"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 00000000..198f83f1
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://kingfisher_output.cfg"
+SRC_URI_append_ebisu += "file://ebisu_output.cfg"
+
+do_configure() {
+ echo repaint-window=34 >> ${WORKDIR}/core.cfg
+
+ echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg
+ echo cursor-theme=default >> ${WORKDIR}/ivishell.cfg
+}
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg
new file mode 100644
index 00000000..618f04e7
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg
@@ -0,0 +1,4 @@
+[output]
+name=VGA-1
+mode=off
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg
new file mode 100644
index 00000000..a194a4a4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg
@@ -0,0 +1,8 @@
+[output]
+name=HDMI-A-2
+mode=off
+
+[output]
+name=LVDS-1
+mode=off
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
new file mode 100644
index 00000000..38590dcd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
@@ -0,0 +1 @@
+DEPENDS_append_ulcb = " gstreamer1.0-plugins-base"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend
new file mode 100644
index 00000000..8a4176fc
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend
@@ -0,0 +1,4 @@
+module_do_compile_prepend() {
+ cd ${S}/build/linux/config/compilers
+ cp aarch64-poky-linux.mk ${TARGET_SYS}.mk
+}
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend
new file mode 100644
index 00000000..5262a9c5
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend
@@ -0,0 +1,2 @@
+KERNEL_MODULE_AUTOLOAD_append = " mmngr"
+KERNEL_MODULE_PACKAGE_SUFFIX = ""
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend
new file mode 100644
index 00000000..6b935b09
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend
@@ -0,0 +1,2 @@
+KERNEL_MODULE_AUTOLOAD_append = " mmngrbuf"
+KERNEL_MODULE_PACKAGE_SUFFIX = ""
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend
new file mode 100644
index 00000000..f1450747
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend
@@ -0,0 +1 @@
+KERNEL_MODULE_AUTOLOAD = "uvcs_drv"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend
new file mode 100644
index 00000000..37979724
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend
@@ -0,0 +1,2 @@
+KERNEL_MODULE_AUTOLOAD_append = " vspm_if"
+KERNEL_MODULE_PACKAGE_SUFFIX = ""
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch
new file mode 100644
index 00000000..966b006a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch
@@ -0,0 +1,125 @@
+The ADSP on Renesas SoCs required a reserved memory area to become
+enabled, and this needs to be done manually.
+
+This patch adds sound hardware abstraction information for the m3ulcb
+and m3ulcb-kf (kingfisher) device trees. This is helpful on-board the
+ADSP for dynamically determining sound hardware at runtime, allowing
+single binaries to be used between the two boards.
+
+Future work will incorporate the h3ulcb and Salvator boards into the
+abstraction.
+
+Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
+---
+diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
+index de2390f009e7..4ccfa8315d17 100644
+--- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
++++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
+@@ -15,6 +15,39 @@
+ "renesas,r8a7796";
+ };
+
++
++&adsp {
++
++ /* ADSP playback setting for pcm3168 */
++ adsp_playback0: adsp,playback {
++ mode = "tdm";
++ clock-mode = "master";
++ bus-width = <24>;
++ ssi = <3>;
++ bus-if = <0>;
++ channels = <8>;
++ pin-share-ssi = <4>;
++ };
++
++ /* ADSP capture setting for pcm3168 */
++ adsp_capture0: adsp,capture {
++ mode = "tdm";
++ clock-mode = "slave";
++ bus-width = <24>;
++ ssi = <4>;
++ bus-if = <0>;
++ channels = <8>;
++ pin-share-ssi = <3>;
++ };
++
++ adsp,ports {
++ port@0 {
++ playback = <&adsp_playback0>;
++ capture = <&adsp_capture0>;
++ };
++ };
++};
++
+ &du {
+ ports {
+ port@0 {
+diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
+index 1cd64c1b3b31..71e59da3528d 100644
+--- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
++++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
+@@ -42,11 +42,18 @@
+ reg = <0x00000000 0x54000000 0x0 0x03000000>;
+ };
+
++ /* For Audio DSP */
++ adsp_reserved: linux,adsp {
++ compatible = "shared-dma-pool";
++ reusable;
++ reg = <0x00000000 0x57000000 0x0 0x01000000>;
++ };
++
+ /* global autoconfigured region for contiguous allocations */
+ linux,cma@57000000 {
+ compatible = "shared-dma-pool";
+ reusable;
+- reg = <0x00000000 0x57000000 0x0 0x19000000>;
++ reg = <0x00000000 0x58000000 0x0 0x18000000>;
+ linux,cma-default;
+ };
+
+@@ -110,6 +117,42 @@
+ "dclkin.0", "dclkin.1", "dclkin.2";
+ };
+
++&adsp {
++ status = "okay";
++ clock-frequency = <12288000 11289600>;
++ audio-clocks = <22579200 24576000>;
++ memory-region = <&adsp_reserved>;
++
++ /* ADSP playback setting for ak4613 */
++ adsp_playback0: adsp,playback {
++ mode = "i2s";
++ clock-mode = "master";
++ bus-width = <16>;
++ ssi = <0>;
++ bus-if = <0>;
++ channels = <2>;
++ pin-share-ssi = <1>;
++ };
++
++ /* ADSP capture setting for ak4613 */
++ adsp_capture0: adsp,capture {
++ mode = "i2s";
++ clock-mode = "slave";
++ bus-width = <16>;
++ ssi = <1>;
++ bus-if = <0>;
++ channels = <2>;
++ pin-share-ssi = <0>;
++ };
++
++ adsp,ports {
++ port@0 {
++ playback = <&adsp_playback0>;
++ capture = <&adsp_capture0>;
++ };
++ };
++};
++
+ &vspb {
+ status = "okay";
+ };
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/namespace_fix.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/namespace_fix.cfg
new file mode 100644
index 00000000..d5ade412
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/namespace_fix.cfg
@@ -0,0 +1,4 @@
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_NET_NS=y
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend
new file mode 100644
index 00000000..e72dc3df
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+require recipes-kernel/linux/linux-agl.inc
+
+SRC_URI_append = " file://namespace_fix.cfg \
+ "
+
+# Add ADSP patch to enable and add sound hardware abstraction
+SRC_URI_append_ulcb = " \
+ file://0004-ADSP-enable-and-add-sound-hardware-abstraction.patch \
+"
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bbappend
new file mode 100644
index 00000000..c1e9ce12
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bbappend
@@ -0,0 +1,3 @@
+require recipes-kernel/linux/linux-agl-4.14.inc
+
+
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend
new file mode 100644
index 00000000..b35c614c
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend
@@ -0,0 +1,8 @@
+setup_build_tree() {
+ for omxmc in ${OMX_COMMON_SRC} ${OMX_VIDEO_DEC_COMMON_SRC} ${OMX_VIDEO_ENC_COMMON_SRC}
+ do
+ tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${WORKDIR}
+ tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${S} ${omxmc}/src --strip=2
+ tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${S} ${omxmc}/include --strip=1
+ done
+}
diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh b/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
new file mode 100644
index 00000000..0dea86bd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston5-20190802.zip"
+ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston5-20190802.zip"
+
+COPY_SCRIPT="$METADIR/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh"
+
+test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
+DOWNLOAD_DIR=${XDG_DOWNLOAD_DIR:-$HOME/Downloads}
+EXTRACT_DIR=$METADIR/binary-tmp
+
+stdout_in_terminal=1
+[[ -t 1 ]] && stdout_in_terminal=1
+function color {
+ [[ $stdout_in_terminal == 0 ]] && return
+ for k in $*; do
+ case $k in
+ bold) tput bold;;
+ none) tput sgr0;;
+ *) tput setaf $k;;
+ esac
+ if [[ $? != 0 ]]; then
+ echo "tput: terminal doesn't support color settings, continuing" >&2
+ true
+ fi
+ done
+}
+color_green=$(color bold 2)
+color_yellow=$(color bold 3)
+color_red=$(color bold 1)
+color_none=$(color none)
+
+function error() {
+ echo "${color_red}$@${color_none}" >&2
+}
+
+function log() {
+ echo "$@" >&2
+}
+
+function copy_mm_packages() {
+ # first clean up workdir
+ [[ -d $EXTRACT_DIR ]] && rm -r $EXTRACT_DIR
+
+ if [ -f $DOWNLOAD_DIR/$ZIP_1 -a -f $DOWNLOAD_DIR/$ZIP_2 ]; then
+ mkdir -p $EXTRACT_DIR
+ cp --update $DOWNLOAD_DIR/$ZIP_1 $EXTRACT_DIR
+ cp --update $DOWNLOAD_DIR/$ZIP_2 $EXTRACT_DIR
+ else
+ error "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_1+"\" NOT EXTRACTING CORRECTLY"
+ error "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_2+"\" NOT EXTRACTING CORRECTLY"
+ log "The graphics and multimedia acceleration packages for "
+ log "the R-Car Gen3 board BSP can be downloaded from:"
+ log "<https://www.renesas.com/us/en/solutions/automotive/rcar-download/rcar-demoboard-2.html>"
+ log
+ error "These 2 files from there should be stored in your"
+ error "'$DOWNLOAD_DIR' directory."
+ error " $ZIP_1"
+ error " $ZIP_2"
+ return 1
+ fi
+
+ if [ -f $COPY_SCRIPT ]; then
+ cd $METADIR/bsp/meta-renesas-rcar-gen3/
+ $COPY_SCRIPT -d -f $EXTRACT_DIR
+ cd ..
+ else
+ log "scripts to copy drivers for Gen3 not found."
+ return 1
+ fi
+}
diff --git a/meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 00000000..e737b540
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,6 @@
+do_configure_append_bbe() {
+ echo 'gbm-format=rgb565' >> ${WORKDIR}/core.cfg
+ if [[ -e "${WORKDIR}/hdmi-a-1-270.cfg" ]]; then
+ echo 'mode=1280x720' >> ${WORKDIR}/hdmi-a-1-270.cfg
+ fi
+}
diff --git a/meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg
new file mode 100644
index 00000000..e08ea6c7
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg
@@ -0,0 +1 @@
+CONFIG_CMA_SIZE_MBYTES=256
diff --git a/meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend
new file mode 100644
index 00000000..6c15b166
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend
@@ -0,0 +1,5 @@
+require recipes-kernel/linux/linux-agl.inc
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+
+SRC_URI += "file://cma-256.cfg"
diff --git a/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend b/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend
new file mode 100644
index 00000000..88ac94b1
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend
@@ -0,0 +1 @@
+require recipes-kernel/linux/linux-agl.inc
diff --git a/meta-agl/meta-agl-bsp/meta-ti/.gitkeep b/meta-agl/meta-agl-bsp/meta-ti/.gitkeep
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/.gitkeep
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch
new file mode 100644
index 00000000..4268b7dc
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch
@@ -0,0 +1,3570 @@
+From 7830118ecb980766f4a6e3997769d7ae326bee77 Mon Sep 17 00:00:00 2001
+From: Karthik Ramanan <a0393906@ti.com>
+Date: Fri, 3 Jun 2016 18:32:50 +0530
+Subject: [PATCH] Add soc performance monitor utilites
+
+Signed-off-by: Karthik Ramanan <a0393906@ti.com>
+---
+ Makefile.am | 17 +-
+ clients/Dra7xx_ddrstat_speed.c | 494 +++++++++++++
+ clients/soc_performance_monitor.c | 630 ++++++++++++++++
+ clients/soc_performance_monitor.h | 40 ++
+ clients/statcoll.c | 1433 +++++++++++++++++++++++++++++++++++++
+ clients/statcoll.h | 152 ++++
+ clients/statcoll_gui.h | 101 +++
+ clients/time_bar_graph.c | 515 +++++++++++++
+ clients/time_bar_graph.h | 93 +++
+ 10 files changed, 4873 insertions(+), 1 deletion(-)
+ create mode 100644 clients/Dra7xx_ddrstat_speed.c
+ create mode 100644 clients/soc_performance_monitor.c
+ create mode 100644 clients/soc_performance_monitor.h
+ create mode 100644 clients/statcoll.c
+ create mode 100644 clients/statcoll.h
+ create mode 100644 clients/statcoll_gui.h
+ create mode 100644 clients/time_bar_graph.c
+ create mode 100644 clients/time_bar_graph.h
+
+diff --git a/Makefile.am b/Makefile.am
+index 62719c9..55aed6d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -432,7 +432,9 @@ demo_clients = \
+ weston-fullscreen \
+ weston-stacking \
+ weston-calibrator \
+- weston-scaler
++ weston-scaler \
++ soc-performance-monitor \
++ soc-ddr-bw-visualizer
+
+ if INSTALL_DEMO_CLIENTS
+ bin_PROGRAMS += $(demo_clients)
+@@ -570,6 +572,19 @@ weston_image_SOURCES = clients/image.c
+ weston_image_LDADD = libtoytoolkit.la
+ weston_image_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
+
++noinst_LTLIBRARIES += libtimebargraph.la
++libtimebargraph_la_SOURCES = clients/time_bar_graph.c clients/time_bar_graph.h
++libtimebargraph_la_LIBADD = libtoytoolkit.la
++libtimebargraph_la_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(CAIRO_CFLAGS) $(CAIRO_EGL_CFLAGS)
++
++soc_performance_monitor_SOURCES = clients/soc_performance_monitor.c clients/soc_performance_monitor.h
++soc_performance_monitor_LDADD = libtoytoolkit.la libtimebargraph.la
++soc_performance__CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
++
++soc_ddr_bw_visualizer_SOURCES = clients/statcoll.c clients/Dra7xx_ddrstat_speed.c clients/statcoll.h clients/statcoll_gui.h
++soc_ddr_bw_visualizer_LDADD = libtoytoolkit.la libtimebargraph.la
++soc_ddr_bw_visualizer__CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
++
+ weston_cliptest_SOURCES = \
+ clients/cliptest.c \
+ src/vertex-clipping.c \
+diff --git a/clients/Dra7xx_ddrstat_speed.c b/clients/Dra7xx_ddrstat_speed.c
+new file mode 100644
+index 0000000..af06733
+--- /dev/null
++++ b/clients/Dra7xx_ddrstat_speed.c
+@@ -0,0 +1,494 @@
++/*
++ * Copyright (C) 2015 Texas Instruments
++ * Author: Karthik Ramanan <karthik.ramanan@ti.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published by
++ * the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <stdint.h>
++#include <string.h>
++#include <sys/mman.h>
++#include <sys/time.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include "statcoll.h"
++
++#define PAGE_SIZE 4096
++
++#define EMIF1_BASE 0x4c000000
++#define EMIF2_BASE 0x4d000000
++
++#define EMIF_PERF_CNT_1 0x80
++#define EMIF_PERF_CNT_2 0x84
++#define EMIF_PERF_CNT_CFG 0x88
++#define EMIF_PERF_CNT_TIM 0x90
++
++static unsigned
++tv_diff(struct timeval *tv1, struct timeval *tv2)
++{
++ return (tv2->tv_sec - tv1->tv_sec) * 1000000 +
++ (tv2->tv_usec - tv1->tv_usec);
++}
++
++
++struct emif_perf {
++ int code;
++ const char *name;
++};
++
++static const struct emif_perf emif_perf_tab[] = {
++ { 0, "access" },
++ { 1, "activate" },
++ { 2, "read" },
++ { 3, "write" },
++ { 4, "fifo_cmd" },
++ { 5, "fifo_write" },
++ { 6, "fifo_read" },
++ { 7, "fifo_ret" },
++ { 8, "prio" },
++ { 9, "cmd_pend" },
++ { 10, "data" },
++};
++
++static void *emif1, *emif2;
++static int BANDWIDTH=0;
++static int DELAY = 1;
++static int EMIF_PERF_CFG1 = 9;
++static int EMIF_PERF_CFG2 = 10;
++
++
++static int STATCOLL=0;
++static int TOTAL_TIME;
++static int INTERVAL_US;
++
++struct timeval t1, t2;
++
++FILE* outfile;
++struct emif_stats {
++ uint32_t cycles;
++ uint32_t cnt1;
++ uint32_t cnt2;
++};
++
++static struct emif_stats emif1_start, emif1_end;
++static struct emif_stats emif2_start, emif2_end;
++
++static void *emif_init(int fd, unsigned base)
++{
++ void *mem =
++ mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base);
++ volatile uint32_t *emif = mem,temp;
++
++ if (mem == MAP_FAILED){
++ return NULL;
++ }
++
++ emif[EMIF_PERF_CNT_CFG>>2] = EMIF_PERF_CFG2 << 16 | EMIF_PERF_CFG1;
++
++ return mem;
++}
++
++static void emif_read(volatile uint32_t *emif, struct emif_stats *st)
++{
++ st->cycles = emif[EMIF_PERF_CNT_TIM>>2];
++ st->cnt1 = emif[EMIF_PERF_CNT_1>>2];
++ st->cnt2 = emif[EMIF_PERF_CNT_2>>2];
++}
++
++static void emif_print(const char *tag, struct emif_stats *st1,
++ struct emif_stats *st2)
++{
++ uint32_t cycles = st2->cycles - st1->cycles;
++ uint32_t cnt1 = st2->cnt1 - st1->cnt1;
++ uint32_t cnt2 = st2->cnt2 - st1->cnt2;
++ printf("%s %s %2llu%% %s %2llu%%", tag,
++ emif_perf_tab[EMIF_PERF_CFG1].name, 100ull*cnt1/cycles,
++ emif_perf_tab[EMIF_PERF_CFG2].name, 100ull*cnt2/cycles);
++ fprintf(outfile,"%s%s= %2llu,%s%s= %2llu,",
++ tag, emif_perf_tab[EMIF_PERF_CFG1].name, 100ull*cnt1/cycles,
++ tag, emif_perf_tab[EMIF_PERF_CFG2].name, 100ull*cnt2/cycles);
++}
++
++static int perf_init(void)
++{
++ int fd = open("/dev/mem", O_RDWR);
++ int err = 0;
++
++ if (fd == -1){
++ printf("error fd=open() \n");
++ return -1;
++ }
++ emif1 = emif_init(fd, EMIF1_BASE);
++ emif2 = emif_init(fd, EMIF2_BASE);
++
++ if (!emif1 || !emif2){
++ printf("error if (!emif1 || !emif2) \n");
++ err = -1;
++ }
++
++ close(fd);
++ return err;
++}
++
++static void perf_start(void)
++{
++ if (emif1) {
++ emif_read(emif1, &emif1_start);
++ emif_read(emif2, &emif2_start);
++ }
++}
++
++static void perf_stop(void)
++{
++ if (emif1) {
++ emif_read(emif1, &emif1_end);
++ emif_read(emif2, &emif2_end);
++ }
++}
++
++static void perf_print(void)
++{
++ if (emif1) {
++ emif_print("EMIF1", &emif1_start, &emif1_end);
++ printf("\t");
++ emif_print("EMIF2", &emif2_start, &emif2_end);
++ printf("\r");
++ fprintf(outfile, "\n");
++ fflush(outfile);
++ fflush(stdout);
++ }
++}
++
++static void perf_close(void)
++{
++ if (emif1) munmap(emif1, PAGE_SIZE);
++ if (emif2) munmap(emif2, PAGE_SIZE);
++}
++
++static int get_cfg(const char *name, int def)
++{
++ char *end;
++ int n = strtol(name, &end, 0);
++ int i;
++
++ if (!*end)
++ return n;
++
++ for (i = 0; i < sizeof(emif_perf_tab)/sizeof(emif_perf_tab[0]); i++)
++ if (!strcmp(name, emif_perf_tab[i].name))
++ return emif_perf_tab[i].code;
++
++ return def;
++}
++
++
++unsigned int emif_freq()
++{
++ volatile unsigned *tim1;
++ unsigned v1, v2;
++ int fd;
++
++ /*calculation EMIF frequency
++ EMIF_PERF_CNT_TIM = \n32-bit counter that
++ continuously counts number for
++ EMIF_FCLK clock cycles elapsed
++ after EMIFis brought out of reset*/
++
++ fd = open("/dev/mem", O_RDONLY);
++ if (fd == -1) {
++ perror("/dev/mem");
++ return 1;
++ }
++
++ void *mem =
++ mem = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, EMIF1_BASE);
++ if (mem == MAP_FAILED) {
++ perror("mmap");
++ exit(1);
++ }
++
++ tim1 = (unsigned *)((char*)mem + EMIF_PERF_CNT_TIM);
++
++ v1 = *tim1;
++ gettimeofday(&t1, NULL);
++ sleep(2);
++ v2 = *tim1;
++ gettimeofday(&t2, NULL);
++
++ munmap(mem, PAGE_SIZE);
++ close(fd);
++
++ return (v2 - v1) / tv_diff(&t1, &t2);
++
++}
++
++
++char config_file_path[100];
++char keylist[][50] = {
++ "DELAY",
++ "EMIF_PERF_CFG1",
++ "EMIF_PERF_CFG2",
++ "BANDWIDTH",
++ "STATCOLL",
++ "TOTAL_TIME",
++ "INTERVAL_US",
++ "INITIATORS",
++};
++
++char line[512], *p;
++char tokens[6][512];
++int temp, flag = 0;
++char *keyvalue, *pair;
++char key[100];
++int linecount=0;
++
++
++int debug=0;
++
++void print_valid_options(void)
++{
++ int i;
++ printf("Invalid key found\n");
++ printf("Supported keys are :\n");
++ for(i=0; i<sizeof(keylist)/sizeof(keylist[0]); i++)
++ printf("\t\t %s\n", keylist[i]);
++
++}
++int validatekey(char *ptr)
++{
++ int i;
++ for(i=0; i<sizeof(keylist)/sizeof(keylist[0]); i++)
++ if(strcmp(ptr, keylist[i]) == 0)
++ return 0;
++
++ return 1;
++}
++
++void add_key_value(char *key, int value)
++{
++ printd("%s", "Inside add_key_value\n");
++
++ if(strcmp(key, "BANDWIDTH") == 0) {
++ BANDWIDTH = value;
++ return;
++ }
++ if(strcmp(key, "STATCOLL") == 0) {
++ STATCOLL = value;
++ return;
++ }
++ else
++ printd("%s", "********** UNKNOWN**********");
++
++ if(BANDWIDTH == 1) {
++ if(strcmp(key, "DELAY") == 0)
++ DELAY = value;
++ else if(strcmp(key, "EMIF_PERF_CFG1") == 0)
++ EMIF_PERF_CFG1 = value;
++ else if(strcmp(key, "EMIF_PERF_CFG2") == 0)
++ EMIF_PERF_CFG2 = value;
++ }
++ else
++ printf("NOTE: BANDWIDTH is not enabled, ignoring %s\n", key);
++
++
++ if(STATCOLL == 1) {
++ if(strcmp(key, "INTERVAL_US") == 0)
++ INTERVAL_US = value;
++ else if(strcmp(key, "TOTAL_TIME") == 0)
++ TOTAL_TIME = value;
++ }
++ else
++ printf("NOTE: STATCOLL is not enabled, ignoring %s\n", key);
++}
++
++void bandwidth_usage() {
++
++ printf("#########################################################\n##\n"
++
++ "## usage : ./Dra7xx_ddrstat <DELAY> <EMIF_PERF_CFG1> <EMIF_PERF_CFG2> \n"
++ "## default : DELAY=1 EMIF_PERF_CFG1=9 EMIF_PERF_CFG2=10\n"
++ "## option : for EMIF_PERF_CFG1 and EMIF_PERF_CFG2\n"
++ "## 0 -> access,\n"
++ "## 1 -> activate,\n"
++ "## 2 -> read,\n"
++ "## 3 -> write,\n"
++ "## 4 -> fifo_cmd,\n"
++ "## 5 -> fifo_write,\n"
++ "## 6 -> fifo_read,\n"
++ "## 7 -> fifo_ret,\n"
++ "## 8 -> prio,\n"
++ "## 9 -> cmd_pend,\n"
++ "## 10 -> data \n##\n"
++
++ "## EMIF frq : %d MHz\n\n", emif_freq() );
++}
++
++
++int main(int argc, char **argv)
++{
++ int option;
++ FILE *fp;
++ int i;
++ int xpos = 600, ypos = 40;
++
++
++ /* Read config file */
++ /* Initialize this to turn off verbosity of getopt */
++ opterr = 0;
++
++// while ((option = getopt (argc, argv, "df:")) != -1)
++ while ((option = getopt (argc, argv, "dx:y:")) != -1)
++ {
++ switch(option)
++ {
++#if 0
++ case 'f':
++ strcpy(config_file_path, optarg);
++ break;
++#endif
++ case 'd':
++ debug=1;
++ break;
++ case 'x':
++ xpos=atoi(optarg);
++ break;
++ case 'y':
++ ypos=atoi(optarg);
++ break;
++
++ default:
++ printf("Invalid option.. Exiting\n");
++ exit(0);
++ }
++ }
++
++ printf("xpos = %d, ypos = %d\n", xpos, ypos);
++
++ strcpy(config_file_path,"config.ini");
++ fp = fopen(config_file_path, "r");
++ if (fp == NULL) {
++ fprintf(stderr, "couldn't open the specified file\n");
++ return -1;
++ }
++
++ while (fgets(line, sizeof line, fp)) {
++ printd("Line is = %s", line);
++
++ if (line[0] == '#' || line[0] == '\n') {
++ continue;
++ }
++
++ memset(tokens, 0, sizeof(tokens));
++ i = 0;
++
++ pair = strtok (line," ,");
++ while (pair != NULL)
++ {
++ printd ("\tPair is = %s\n",pair);
++ strcpy(tokens[i++], pair);
++ pair = strtok (NULL, " ,.-");
++ }
++
++ for(temp=0; temp< i; temp++)
++ {
++ printd("Line %d: %s\n", temp, tokens[temp]);
++
++ keyvalue = strtok (tokens[temp]," =");
++ while (keyvalue != NULL)
++ {
++ if(flag == 0)
++ {
++ if(validatekey(keyvalue))
++ {
++ print_valid_options();
++ exit(0);
++ }
++ strcpy(key, keyvalue);
++ printd ("\tKey is = %s\n",key);
++ flag++;
++ }
++ else
++ {
++ printd ("\tValue is = %s",keyvalue);
++ printd (" (%d)\n", atoi(keyvalue));
++ add_key_value(key, atoi(keyvalue));
++ flag = 0;
++ }
++ keyvalue = strtok (NULL, " =");
++ }
++ }
++
++
++
++ linecount++;
++ printd("%s", "------------------- \n");
++
++ }
++
++ fclose(fp);
++
++ printf("\n\nCOMPLETED: Parsing of the user specified parameters.. \n \
++ \nConfiguring device now.. \n\n");
++ if(BANDWIDTH == 1) {
++ bandwidth_usage();
++ if (DELAY <= 0)
++ DELAY = 1;
++
++ if (perf_init()){
++ printf("perf_init return non zero \n");
++ return 1;
++ }
++
++ outfile = fopen("emif-performance.csv", "w+");
++ if (!outfile) {
++ printf("\n Error opening file");
++ }
++ for (;;) {
++ perf_start();
++ sleep(DELAY);
++ perf_stop();
++ perf_print();
++ }
++
++ fclose(outfile);
++ perf_close();
++ return 0;
++ }
++
++ if(STATCOLL == 1) {
++ printf("STATISTICS COLLECTOR option chosen\n");
++ printf("------------------------------------------------\n\n");
++ fp = fopen("initiators.cfg", "r");
++ if (fp == NULL) {
++ fprintf(stderr, "couldn't open the specified file initiators.cfg'\n");
++ return -1;
++ }
++
++ int i=0;
++ char list[100][50];
++ memset(list, sizeof(list), 0);
++ while (fgets(line, sizeof line, fp)) {
++ printf("Line is = %s", line);
++ /* Slightly strange way to chop off the \n character */
++ strtok(line, "\n");
++ strcpy(list[i++], line);
++ }
++ fclose(fp);
++
++ statcoll_start(TOTAL_TIME, INTERVAL_US, list, xpos, ypos);
++ }
++
++}
++
+diff --git a/clients/soc_performance_monitor.c b/clients/soc_performance_monitor.c
+new file mode 100644
+index 0000000..5d1db32
+--- /dev/null
++++ b/clients/soc_performance_monitor.c
+@@ -0,0 +1,630 @@
++/*
++ * Copyright (C) 2016 Texas Instruments
++ * Author: Karthik Ramanan <karthik.ramanan@ti.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published by
++ * the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <stdint.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdint.h>
++#include <signal.h>
++#include <time.h>
++#include <math.h>
++#include <unistd.h>
++#include <sys/time.h>
++#include <pthread.h>
++#include <errno.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <sys/stat.h>
++
++#include "time_bar_graph.h"
++
++#include "soc_performance_monitor.h"
++
++static int debug=0;
++
++static char readfifo[100];
++static int MAX_WIDTH=1920;
++static int MAX_HEIGHT=1080;
++static int x_pos=0;
++static int y_pos=40;
++
++void *ctx;
++struct time_graph_create_params tg_p;
++struct bar_graph_create_params bg_p;
++
++static int cpu_load_offset = 0;
++static int total_cpu_load_items = 0;
++static int total_elements = 0;
++
++struct _bar_graph_y_config *y_cfg;
++struct _text_config *t_cfg;
++char *tg_text[100];
++char *bg_text[100];
++
++
++int command_handler(int command, double *y, char **text)
++{
++ static int fd;
++ char buf[MAX_BUF];
++ int i, bytes, offset;
++
++ switch(command)
++ {
++ case OPEN:
++ fd = open(readfifo, O_RDONLY|O_NONBLOCK);
++ break;
++
++ case READ:
++
++ /* open, read, and display the message from the FIFO */
++ bytes=read(fd, buf, MAX_BUF);
++ buf[bytes]='\0';
++ if(bytes > 0)
++ {
++ char command[100];
++ char string[100];
++ sscanf(buf, "%s %s", command, string);
++ printd("Received %s\n", buf);
++ if(strcmp(command, "TABLE:") == 0)
++ {
++ char field[100], value[100], unit[100];
++ sscanf(buf, "%s %s %s %s", command, field, value, unit);
++ for(i=0; i<cpu_load_offset; i++) {
++ if(strcmp(text[i*2], field) == 0) {
++ printd("Updating value(%s), unit(%s)\n", value, unit);
++ sprintf(text[i*2+1], "%s %s", value, unit);
++ }
++ }
++ }
++ else if(strcmp(command, "CPULOAD:") == 0)
++ {
++ char field[100], value[100];
++
++ sscanf(buf, "%s %s %s", command, field, value);
++
++ for(i=cpu_load_offset; i<cpu_load_offset+total_cpu_load_items; i++) {
++ if(strcmp(text[i*2], field) == 0) {
++ if(strlen(value) <= 2) {
++ y[i*2+1] = atoi(value)/100.0;
++ sprintf(text[i*2+1], " %02s%s", value,"%");
++ printd("CPULOAD: Updating %s with %s\n", field, value);
++ }
++ else {
++ printf("Ignoring value: %s\n", value);
++ }
++ }
++ }
++ }
++ else if(strcmp(command, "MOVE:") == 0)
++ {
++ char value[100];
++ printd("Received MOVE command : %s\n", buf);
++ sscanf(string, "%s", value);
++ sprintf(tg_p.title, "CPU Usage[@position-req=%sx%d]", value, y_pos);
++ move_graph(ctx, &tg_p);
++ }
++ else
++ {
++ printf("ERROR: Received unexpected data from FIFO - \" %s \" \n", buf);
++ }
++ memset(buf, 0x0, sizeof(buf));
++ }
++
++ break;
++
++ case CLOSE:
++ close(fd);
++ break;
++ }
++ return bytes;
++}
++
++volatile sig_atomic_t sigtermed = 0;
++
++void my_signal_handler(int signum)
++{
++ if (signum == SIGTERM || signum == SIGINT) {
++ sigtermed = 1;
++ }
++}
++
++int get_strings_in_section(char *string, char **output)
++{
++ FILE *fd;
++ char line[512];
++ int total_strings = 0;
++
++ fd = fopen("soc_performance_monitor.cfg", "r");
++ if(fd == NULL) {
++ fprintf(stderr, "ERROR: Unable to open file soc_performance_monitor.cfg\n");
++ fprintf(stderr, " Please copy the file from /etc/visualization_scripts into current directory\n");
++ exit(0);
++ }
++
++ while(fgets(line, sizeof line, fd)) {
++ if(strstr(line, string)) {
++ printf("\n-------------------------------------------------\n");
++ printf("CONFIG FILE PARSE: Found section %s in line : %s\n", string, line);
++ break;
++ }
++ }
++
++ while(fgets(line, sizeof line, fd)) {
++ printd("Line is = %s", line);
++
++ if (line[0] == '#' || line[0] == '\n' || line[0] == '[') {
++ break;
++ }
++
++ line[strlen(line) - 1] = '\0';
++ strcpy(output[total_strings++], line);
++
++ }
++ fclose(fd);
++
++ return total_strings;
++}
++
++
++void fill_cpu_load_details(int start_offset, int end_offset, char **output, struct table_configuration *table_config)
++{
++ int i;
++
++ const int BL_START_X = table_config->BL_START_X;
++ const int BL_START_Y = table_config->BL_START_Y;
++ const int BAR_GAP = table_config->BAR_GAP;
++ const int BAR_HEIGHT = table_config->BAR_HEIGHT;
++ const int BAR_WIDTH = table_config->BAR_WIDTH;
++ const int TR_START_X = table_config->TR_START_X;
++ const int TR_START_Y = table_config->TR_START_Y;
++ const int FONT_SIZE = table_config->FONT_SIZE;
++ printf("Filling from %d to %d\n", start_offset, end_offset);
++ cpu_load_offset = start_offset;
++
++ for(i=start_offset; i< end_offset-1; i++) {
++ y_cfg[i*2].region.bottom_left.x = BL_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
++ y_cfg[i*2].region.bottom_left.y = BL_START_Y;
++ y_cfg[i*2].region.top_right.x = TR_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
++ y_cfg[i*2].region.top_right.y = TR_START_Y;
++ y_cfg[i*2].line_color.r = 1.0;
++ y_cfg[i*2].line_color.g = 1.0;
++ y_cfg[i*2].line_color.b = 1.0;
++ y_cfg[i*2].line_color.a = 1.0;
++ y_cfg[i*2].fill_color.r = 0.0;
++ y_cfg[i*2].fill_color.g = 0.0;
++ y_cfg[i*2].fill_color.b = 1.0;
++ y_cfg[i*2].fill_color.a = 0.7;
++
++ y_cfg[i*2+1].region.bottom_left.x = BL_START_X +(i-start_offset) * (BAR_GAP + BAR_WIDTH);
++ y_cfg[i*2+1].region.bottom_left.y = BL_START_Y;
++ y_cfg[i*2+1].region.top_right.x = TR_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
++ y_cfg[i*2+1].region.top_right.y = TR_START_Y;
++ y_cfg[i*2+1].line_color.r = 1.0;
++ y_cfg[i*2+1].line_color.g = 1.0;
++ y_cfg[i*2+1].line_color.b = 1.0;
++ y_cfg[i*2+1].line_color.a = 1.0;
++ y_cfg[i*2+1].fill_color.r = 1.0;
++ y_cfg[i*2+1].fill_color.g = 0.0;
++ y_cfg[i*2+1].fill_color.b = 0.0;
++ y_cfg[i*2+1].fill_color.a = 1.0;
++
++
++ t_cfg[i*2].color.r = 1.0;
++ t_cfg[i*2].color.g = 1.0;
++ t_cfg[i*2].color.b = 1.0;
++ t_cfg[i*2].color.a = 1.0;
++ t_cfg[i*2].at.x = BL_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
++ t_cfg[i*2].at.y = BL_START_Y + FONT_SIZE;
++ t_cfg[i*2].fontsize = FONT_SIZE;
++
++ t_cfg[i*2+1].color.r = 1.0;
++ t_cfg[i*2+1].color.g = 1.0;
++ t_cfg[i*2+1].color.b = 1.0;
++ t_cfg[i*2+1].color.a = 1.0;
++ t_cfg[i*2+1].at.x = BL_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
++ t_cfg[i*2+1].at.y = BL_START_Y - BAR_HEIGHT - FONT_SIZE;
++ t_cfg[i*2+1].fontsize = FONT_SIZE;
++
++ strcpy(bg_text[i*2], output[i - start_offset]);
++ strcpy(bg_text[i*2+1], "0%");
++ }
++
++ t_cfg[(end_offset-1)*2].color.r = 0.0;
++ t_cfg[(end_offset-1)*2].color.g = 1.0;
++ t_cfg[(end_offset-1)*2].color.b = 1.0;
++ t_cfg[(end_offset-1)*2].color.a = 1.0;
++ t_cfg[(end_offset-1)*2].at.x = BL_START_X + 80;
++ t_cfg[(end_offset-1)*2].at.y = TR_START_Y - 40;
++ t_cfg[(end_offset-1)*2].fontsize = FONT_SIZE + 3;
++
++ printd("Copying title string %s\n", output[end_offset - start_offset -1]);
++ strcpy(bg_text[(end_offset-1)*2], output[end_offset - start_offset-1]);
++}
++
++void fill_table_details(int start_offset, int end_offset, char **output, struct table_configuration *table_config)
++{
++ int i;
++
++ const int BL_START_X = table_config->BL_START_X;
++ const int BL_START_Y = table_config->BL_START_Y;
++ const int BAR_GAP = table_config->BAR_GAP;
++ const int BAR_HEIGHT = table_config->BAR_HEIGHT;
++ const int BAR_WIDTH = table_config->BAR_WIDTH;
++ const int TR_START_X = table_config->TR_START_X;
++ const int TR_START_Y = table_config->TR_START_Y;
++ const int FONT_SIZE = table_config->FONT_SIZE;
++ printf("Filling from %d to %d\n", start_offset, end_offset);
++
++
++ char tokenize[200];
++ char tokens[10][100];
++ char *pair, *key, *value;
++ int k=0;
++ char title[100], unit[100];
++
++ strcpy(tokenize, output[end_offset - start_offset - 1]);
++ memset(tokens, 0, sizeof(tokens));
++
++ k=0;
++ pair = strtok (tokenize,",");
++ while (pair != NULL) {
++ strcpy(tokens[k++], pair);
++ pair = strtok (NULL, ",");
++ }
++
++ i=0;
++ memset(title, 0, sizeof(title));
++ memset(unit, 0, sizeof(unit));
++ while(i < k) {
++ key=strtok(tokens[i], "=");
++ if(key != NULL) {
++ if(strcmp(key,"TITLE") == 0) {
++ value = strtok(NULL, "=");
++ if(value != NULL) {
++ strcpy(title, value);
++ }
++ }
++ if(strcmp(key,"UNIT") == 0) {
++ value = strtok(NULL, "=");
++ if(value != NULL) {
++ strcpy(unit, value);
++ }
++ }
++ }
++ i++;
++ }
++
++ for(i=start_offset; i< end_offset-1; i++) {
++ y_cfg[i*2].region.bottom_left.x = BL_START_X;
++ y_cfg[i*2].region.bottom_left.y = BL_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);
++ y_cfg[i*2].region.top_right.x = TR_START_X;
++ y_cfg[i*2].region.top_right.y = TR_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);
++ y_cfg[i*2].line_color.r = 1.0;
++ y_cfg[i*2].line_color.g = 1.0;
++ y_cfg[i*2].line_color.b = 1.0;
++ y_cfg[i*2].line_color.a = 1.0;
++ y_cfg[i*2].fill_color.r = 0.0;
++ y_cfg[i*2].fill_color.g = 0.3;
++ y_cfg[i*2].fill_color.b = 0.0;
++ y_cfg[i*2].fill_color.a = 0.7;
++
++ y_cfg[i*2+1].region.bottom_left.x = TR_START_X;
++ y_cfg[i*2+1].region.bottom_left.y = BL_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);
++ y_cfg[i*2+1].region.top_right.x = TR_START_X + (BAR_WIDTH); //+ 1 * BL_START_X;
++ y_cfg[i*2+1].region.top_right.y = TR_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);;
++ y_cfg[i*2+1].line_color.r = 1.0;
++ y_cfg[i*2+1].line_color.g = 1.0;
++ y_cfg[i*2+1].line_color.b = 1.0;
++ y_cfg[i*2+1].line_color.a = 1.0;
++ y_cfg[i*2+1].fill_color.r = 0.3;
++ y_cfg[i*2+1].fill_color.g = 0.0;
++ y_cfg[i*2+1].fill_color.b = 0.0;
++ y_cfg[i*2+1].fill_color.a = 0.7;
++
++
++ t_cfg[i*2].color.r = 1.0;
++ t_cfg[i*2].color.g = 1.0;
++ t_cfg[i*2].color.b = 1.0;
++ t_cfg[i*2].color.a = 1.0;
++ t_cfg[i*2].at.x = BL_START_X + 5;
++ t_cfg[i*2].at.y = BL_START_Y + (i - start_offset) * (BAR_GAP+BAR_HEIGHT) -5;
++ t_cfg[i*2].fontsize = FONT_SIZE;
++
++ t_cfg[i*2+1].color.r = 1.0;
++ t_cfg[i*2+1].color.g = 1.0;
++ t_cfg[i*2+1].color.b = 1.0;
++ t_cfg[i*2+1].color.a = 1.0;
++ t_cfg[i*2+1].at.x = TR_START_X + 50;//BAR_WIDTH + TR_START_X;
++ t_cfg[i*2+1].at.y = BL_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT) -5;
++ t_cfg[i*2+1].fontsize = FONT_SIZE;
++
++ printd("Copying string %s at %d\n", output[i-start_offset], i);
++ strcpy(bg_text[i*2], output[i-start_offset]);
++ printd("Setting text 0 %s at %d\n", unit, i*2+1);
++ sprintf(bg_text[i*2+1], "0 %s", unit);
++ }
++ for(i=start_offset; i< end_offset*2; i++) {
++ printd("%d - (%d, %d) to (%d, %d)\n", i, y_cfg[i].region.bottom_left.x, y_cfg[i].region.bottom_left.y, y_cfg[i].region.top_right.x, y_cfg[i].region.top_right.y);
++ }
++
++ t_cfg[(end_offset-1)*2].color.r = 0.0;
++ t_cfg[(end_offset-1)*2].color.g = 1.0;
++ t_cfg[(end_offset-1)*2].color.b = 1.0;
++ t_cfg[(end_offset-1)*2].color.a = 1.0;
++ t_cfg[(end_offset-1)*2].at.x = BL_START_X + 80;
++ t_cfg[(end_offset-1)*2].at.y = BL_START_Y - 40;
++ t_cfg[(end_offset-1)*2].fontsize = FONT_SIZE + 3;
++
++ printd("Copying title string %s\n", title);
++ strcpy(bg_text[(end_offset-1)*2], title);
++
++}
++
++
++int get_key_value_from_string(char *string, char *limiter, char *key, char *value)
++{
++ char *mykey, *myvalue;
++
++ mykey=strtok(string, limiter);
++ if(mykey != NULL) {
++ myvalue = strtok(NULL, "=");
++ strtok(myvalue, "\n");
++ if(myvalue == NULL) {
++ return -1;
++ }
++ }
++ else {
++ return -1;
++ }
++ printd("Key is %s\n", mykey);
++ printd("Value is %s\n", myvalue);
++ strcpy(key, mykey);
++ strcpy(value, myvalue);
++ return 0;
++
++}
++
++void populate_table_configuration(struct table_configuration *tbl_cfg, int cur_items, char **item_list)
++{
++ static int total_items = 0;
++ static int total_tables = 0;
++
++ tbl_cfg->BAR_HEIGHT = 25;
++ tbl_cfg->BAR_WIDTH = 150;
++ tbl_cfg->BL_START_X = 40;
++ tbl_cfg->BL_START_Y = 80 + (total_items + total_tables) * tbl_cfg->BAR_HEIGHT;
++ tbl_cfg->BAR_GAP = 0;
++ tbl_cfg->TR_START_X = tbl_cfg->BL_START_X + tbl_cfg->BAR_WIDTH;
++ tbl_cfg->TR_START_Y = tbl_cfg->BL_START_Y - tbl_cfg->BAR_HEIGHT;
++ tbl_cfg->FONT_SIZE = 15;
++
++ printf("Proceeding with filling out details...\n");
++ if(cur_items > 0)
++ fill_table_details(total_items, total_items+cur_items, item_list, tbl_cfg);
++
++ total_items += cur_items;
++ if(cur_items > 0)
++ total_tables++;
++
++ printf("total_items = %d, total_tables = %d\n", total_items, total_tables);
++ return;
++}
++
++int fill_list_from_section(char **section_list, char *section_name)
++{
++ int total_items, j;
++
++ for(j=0; j<20; j++) {
++ section_list[j] = malloc(100);
++ }
++
++ total_items = get_strings_in_section(section_name, section_list);
++ printf("\tThe total values in the section %s are %d\n", section_name, total_items);
++ for(j=0; j<total_items; j++) {
++ printf("\t\tThe returned strings for BOOT_TIME are %s\n", section_list[j]);
++ }
++
++ total_elements += total_items;
++
++ return total_items;
++}
++
++int main(int argc, char *argv[])
++{
++ double *bg_y;
++ double *tg_y;
++ int i,j;
++ int refresh_rate;
++
++ if (SIG_ERR == signal(SIGPIPE,SIG_IGN))
++ exit(1);
++
++ if (SIG_ERR == signal(SIGINT,my_signal_handler))
++ exit(1);
++
++ if (SIG_ERR == signal(SIGTERM,my_signal_handler))
++ exit(1);
++
++ if(argc == 2) {
++ printf("Enabling debug\n");
++ debug = atoi(argv[1]);
++ }
++ else {
++ printf("Debug is disabled\n");
++ debug = 0;
++ }
++
++ char *output[20];
++ int total = fill_list_from_section(output, "GLOBAL");
++ for(j=0; j<total; j++) {
++ char key[100], value[100];
++ int ret = get_key_value_from_string(output[j], "=", key, value);
++ if(ret == 0) {
++ if(strcmp(key, "FIFO") == 0) {
++ strcpy(readfifo, value);
++ }
++ if(strcmp(key, "REFRESH_RATE_USEC") == 0) {
++ refresh_rate = atoi(value);
++ }
++ if(strcmp(key, "MAX_WIDTH") == 0) {
++ MAX_WIDTH = atoi(value);
++ }
++ if(strcmp(key, "MAX_HEIGHT") == 0) {
++ MAX_HEIGHT = atoi(value);
++ }
++ if(strcmp(key, "X_POS") == 0) {
++ x_pos = atoi(value);
++ }
++ if(strcmp(key, "Y_POS") == 0) {
++ y_pos = atoi(value);
++ }
++ }
++
++ }
++
++ printf("\n-------------------------------------------------\n");
++ printf("Configured REFRESH_RATE is %d\n", refresh_rate);
++ printf("Configured FIFO is %s\n", readfifo);
++ printf("Configured MAX_WIDTH is %d\n", MAX_WIDTH);
++ printf("Configured MAX_HEIGHT is %d\n", MAX_HEIGHT);
++ printf("Configured starting location is (%d, %d)\n", x_pos, y_pos);
++ printf("\n-------------------------------------------------\n");
++
++ int fd = open(readfifo, O_RDONLY|O_NONBLOCK);
++ if (fd != -1) {
++ printf("SUCCESS: Configured FIFO exists\n");
++ close(fd);
++ }
++ else {
++ printf("ERROR: %s not found\nPlease create the fifo by executing mkfifo %s before running the application\n", readfifo, readfifo);
++ exit(0);
++ }
++
++
++ bg_p.title = malloc(100);
++ sprintf(bg_p.title, "CPU Usage[@position-req=%dx%d]", x_pos, y_pos);
++
++ /* ------------------------------------------------------------------------*/
++ /* Section for populating all lists from cfg sections*/
++ /* ------------------------------------------------------------------------*/
++ char *boot_list[20];
++ int total_boot_items = fill_list_from_section(boot_list, "BOOT_TIME");
++
++ char *temperature_list[20];
++ int total_temperature_items = fill_list_from_section(temperature_list, "TEMPERATURE");
++
++ char *cpu_load_list[20];
++ total_cpu_load_items = fill_list_from_section(cpu_load_list, "CPU_LOAD");
++
++ char *voltage_list[20];
++ int total_voltage_items = fill_list_from_section(voltage_list, "VOLTAGE");
++
++ char *frequency_list[20];
++ int total_frequency_items = fill_list_from_section(frequency_list, "FREQUENCY");
++ /* ------------------------------------------------------------------------*/
++ /* total_elements will be updated inside the fill_list_from_section function */
++
++ t_cfg = malloc(sizeof(struct _text_config) * (total_elements*2 + 1));
++ y_cfg = malloc(sizeof(struct _bar_graph_y_config) * total_elements*2);
++ bg_p.num_of_y_items = total_elements*2;
++ bg_p.y_config_array = y_cfg;
++ bg_p.num_of_text_items = total_elements*2 + 1;
++ bg_p.text_config_array = t_cfg;
++
++ bg_y = malloc(sizeof(double) * total_elements * 2);
++ for(i=0; i< (total_elements*2+1); i++) {
++ bg_text[i] = malloc(150);
++ bg_y[i] = 1.0;
++ }
++
++ tg_y = malloc(sizeof(double) * total_elements * 2);
++ for(i=0; i< (total_elements*2+1); i++) {
++ tg_text[i] = malloc(150);
++ tg_y[i] = 0.1 * i;
++ }
++
++ struct table_configuration boot_table_config;
++ populate_table_configuration(&boot_table_config, total_boot_items, boot_list);
++
++ struct table_configuration temp_table_config;
++ populate_table_configuration(&temp_table_config, total_temperature_items, temperature_list);
++
++ struct table_configuration voltage_table_config;
++ populate_table_configuration(&voltage_table_config, total_voltage_items, voltage_list);
++
++ struct table_configuration frequency_table_config;
++ populate_table_configuration(&frequency_table_config, total_frequency_items, frequency_list);
++
++ struct table_configuration cpu_load_config;
++ cpu_load_config.BL_START_X = 40;
++ cpu_load_config.BL_START_Y = 80 + (total_boot_items + total_temperature_items + total_voltage_items + total_frequency_items+ 4) * boot_table_config.BAR_HEIGHT + 80 /*cpu_load_config.BAR_HEIGHT */;
++ cpu_load_config.BAR_GAP = 20;
++ cpu_load_config.BAR_HEIGHT = 80;
++ cpu_load_config.BAR_WIDTH = 40;
++ cpu_load_config.TR_START_X = cpu_load_config.BL_START_X + cpu_load_config.BAR_WIDTH;
++ cpu_load_config.TR_START_Y = cpu_load_config.BL_START_Y - cpu_load_config.BAR_HEIGHT;
++ cpu_load_config.FONT_SIZE = 15;
++ if(total_cpu_load_items > 0) {
++ fill_cpu_load_details(total_boot_items+total_temperature_items+total_voltage_items+total_frequency_items, total_boot_items+total_temperature_items+total_voltage_items+total_frequency_items+total_cpu_load_items, cpu_load_list, &cpu_load_config);
++ }
++ else {
++ cpu_load_offset = total_boot_items + total_temperature_items + total_voltage_items + total_frequency_items;
++ }
++
++ tg_p.title=(char *)malloc(100);
++ sprintf(tg_p.title, "CPU Usage[@position-req=%dx%d]", x_pos, y_pos);
++ tg_p.height = MAX_HEIGHT;
++ tg_p.width = MAX_WIDTH;
++
++ struct _y_config *tg_y_cfg = malloc(tg_p.num_of_y_items * sizeof(struct _y_config));
++ tg_p.y_config_array = tg_y_cfg;
++ tg_p.text_config_array = t_cfg;
++
++ printf("Proceeding to create starting visualization...\n");
++ ctx = time_graph_create(argc, argv, &tg_p);
++ if (!ctx) {
++ printf("Unable to create time_graph... \n");
++ exit(0);
++ }
++
++ ctx = bar_graph_create(argc, argv, &bg_p);
++ if (!ctx) {
++ printf("Error creating context\n");
++ exit(0);
++ }
++
++ command_handler(OPEN, NULL, NULL);
++
++ /* Plot the graph first time */
++ time_graph_plot(ctx, tg_y, (const char **)tg_text);
++ bar_graph_plot(ctx, bg_y, (const char **)bg_text);
++
++ while (!sigtermed)
++ {
++ usleep(refresh_rate);
++ int bytes_read = command_handler(READ, bg_y, bg_text);
++ if(bytes_read > 0) {
++ time_graph_plot(ctx, tg_y, (const char **)tg_text);
++ bar_graph_plot(ctx, bg_y, (const char **)bg_text);
++ }
++ }
++
++ bar_graph_destroy(ctx);
++ command_handler(CLOSE, NULL, NULL);
++ return 0;
++}
+diff --git a/clients/soc_performance_monitor.h b/clients/soc_performance_monitor.h
+new file mode 100644
+index 0000000..861c8c7
+--- /dev/null
++++ b/clients/soc_performance_monitor.h
+@@ -0,0 +1,40 @@
++#define __SLEEP usleep(1000000)
++
++#define MAX_BUF 1024
++#define OPEN 1
++#define READ 2
++#define CLOSE 3
++
++#define MAX_COLORS 12
++
++#define printd(fmt, ...) \
++ do { if (debug) fprintf(stderr, fmt, __VA_ARGS__); } while (0)
++
++
++struct _rgba pallette[MAX_COLORS] =
++{
++ { 1.0, 0.0, 0.0, 1.0 },
++ { 0.0, 0.5, 0.0, 1.0 },
++ { 0.0, 0.0, 1.0, 1.0 },
++ { 0.0, 0.0, 0.0, 1.0 },
++ { 0.0, 0.5, 1.0, 1.0 },
++ { 1.0, 0.0, 1.0, 1.0 },
++ { 0.5, 0.5, 1.0, 1.0 },
++ { 1.0, 0.5, 0.0, 1.0 },
++ { 0.5, 0.5, 0.25, 1.0 },
++ { 0.5, 0.0, 0.0, 1.0 },
++ { 1.0, 0.5, 0.5, 1.0 },
++ { 0.0, 0.0, 0.20, 1.0 }
++};
++
++struct table_configuration {
++ int BL_START_X;
++ int BL_START_Y;
++ int BAR_GAP;
++ int BAR_HEIGHT;
++ int BAR_WIDTH;
++ int TR_START_X;
++ int TR_START_Y;
++ int FONT_SIZE;
++};
++
+diff --git a/clients/statcoll.c b/clients/statcoll.c
+new file mode 100644
+index 0000000..5d5cae7
+--- /dev/null
++++ b/clients/statcoll.c
+@@ -0,0 +1,1433 @@
++/*
++ * Copyright (C) 2015 Texas Instruments
++ * created by prash@ti.com on 16 Jan 2013
++ * Adapted to Linux with changes in framework: Karthik R <karthik.ramanan@ti.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published by
++ * the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/mman.h>
++#include <fcntl.h>
++#include <signal.h>
++#include <unistd.h>
++#include <sys/time.h>
++
++#include "statcoll.h"
++#include "statcoll_gui.h"
++#include "time_bar_graph.h"
++
++#define ENABLE_MODE 0x0
++#define READ_STATUS_MODE 0x1
++
++
++
++#define OPEN 1
++#define READ 2
++#define CLOSE 3
++
++
++#if 1
++#define __SLEEP sleep(1)
++#else
++#define __SLEEP usleep(100000)
++#endif
++//#define DUMMY_MODE
++
++#define MAX_COLORS 12
++
++struct _rgba pallette[MAX_COLORS] =
++{
++ { 1.0, 0.0, 0.0, 1.0 },
++ { 0.0, 0.5, 0.0, 1.0 },
++ { 0.0, 0.0, 1.0, 1.0 },
++ { 0.0, 0.0, 0.0, 1.0 },
++ { 0.0, 0.5, 1.0, 1.0 },
++ { 1.0, 0.0, 1.0, 1.0 },
++ { 0.5, 0.5, 1.0, 1.0 },
++ { 1.0, 0.5, 0.0, 1.0 },
++ { 0.5, 0.5, 0.25, 1.0 },
++ { 0.5, 0.0, 0.0, 1.0 },
++ { 1.0, 0.5, 0.5, 1.0 },
++ { 0.0, 0.0, 0.20, 1.0 }
++};
++
++const struct list_of_initiators initiators[STATCOL_MAX] =
++{
++ { STATCOL_EMIF1_SYS, "STATCOL_EMIF1_SYS" },
++ { STATCOL_EMIF2_SYS,"STATCOL_EMIF2_SYS" },
++ { STATCOL_MA_MPU_P1,"STATCOL_MPU_P1" },
++ { STATCOL_MA_MPU_P2,"STATCOL_MPU_P2" },
++ { STATCOL_MPU1,"STATCOL_MPU1" },
++ { STATCOL_MMU1,"STATCOL_MMU1" },
++ { STATCOL_TPTC_RD1,"STATCOL_TPTC_RD1" },
++ { STATCOL_TPTC_WR1,"STATCOL_TPTC_WR1" },
++ { STATCOL_TPTC_RD2,"STATCOL_TPTC_RD2" },
++ { STATCOL_TPTC_WR2,"STATCOL_TPTC_WR2" },
++ { STATCOL_VIP1_P1,"STATCOL_VIP1_P1" },
++ { STATCOL_VIP1_P2,"STATCOL_VIP1_P2" },
++ { STATCOL_VIP2_P1,"STATCOL_VIP2_P1" },
++ { STATCOL_VIP2_P2,"STATCOL_VIP2_P2" },
++ { STATCOL_VIP3_P1,"STATCOL_VIP3_P1" },
++ { STATCOL_VIP3_P2,"STATCOL_VIP3_P2" },
++ { STATCOL_VPE_P1,"STATCOL_VPE_P1" },
++ { STATCOL_VPE_P2,"STATCOL_VPE_P2" },
++ { STATCOL_EVE1_TC0,"STATCOL_EVE1_TC0" },
++ { STATCOL_EVE1_TC1,"STATCOL_EVE1_TC1" },
++ { STATCOL_EVE2_TC0,"STATCOL_EVE2_TC0" },
++ { STATCOL_EVE2_TC1,"STATCOL_EVE2_TC1" },
++ { STATCOL_EVE3_TC0,"STATCOL_EVE3_TC0" },
++ { STATCOL_EVE3_TC1,"STATCOL_EVE3_TC1" },
++ { STATCOL_EVE4_TC0,"STATCOL_EVE4_TC0" },
++ { STATCOL_EVE4_TC1,"STATCOL_EVE4_TC1" },
++ { STATCOL_DSP1_MDMA,"STATCOL_DSP1_MDMA" },
++ { STATCOL_DSP1_EDMA,"STATCOL_DSP1_EDMA" },
++ { STATCOL_DSP2_MDMA,"STATCOL_DSP2_MDMA" },
++ { STATCOL_DSP2_EDMA,"STATCOL_DSP2_EDMA" },
++ { STATCOL_IVA,"STATCOL_IVA" },
++ { STATCOL_GPU_P1,"STATCOL_GPU_P1" },
++ { STATCOL_GPU_P2,"STATCOL_GPU_P2" },
++ { STATCOL_BB2D_P1,"STATCOL_BB2D_P1" },
++ { STATCOL_DSS,"STATCOL_DSS" },
++ { STATCOL_CSI2_2,"STATCOL_CSI2_2" },
++ { STATCOL_MMU2,"STATCOL_MMU2" },
++ { STATCOL_IPU1,"STATCOL_IPU1" },
++ { STATCOL_IPU2,"STATCOL_IPU2" },
++ { STATCOL_DMA_SYSTEM_RD,"STATCOL_DMA_SYSTEM_RD" },
++ { STATCOL_DMA_SYSTEM_WR,"STATCOL_DMA_SYSTEM_WR" },
++ { STATCOL_CSI2_1,"STATCOL_CSI2_1" },
++ { STATCOL_USB3_SS,"STATCOL_USB3_SS" },
++ { STATCOL_USB2_SS,"STATCOL_USB2_SS" },
++ { STATCOL_USB2_ULPI_SS1,"STATCOL_USB2_ULPI_SS1" },
++ { STATCOL_USB2_ULPI_SS2,"STATCOL_USB2_ULPI_SS2" },
++ { STATCOL_PCIE_SS1,"STATCOL_PCIE_SS1" },
++ { STATCOL_PCIE_SS2,"STATCOL_PCIE_SS2" },
++ { STATCOL_DSP1_CFG,"STATCOL_DSP1_CFG" },
++ { STATCOL_DSP2_CFG,"STATCOL_DSP2_CFG" },
++ { STATCOL_GMAC_SW,"STATCOL_GMAC_SW" },
++ { STATCOL_PRUSS1_P1,"STATCOL_PRUSS1_P1" },
++ { STATCOL_PRUSS1_P2,"STATCOL_PRUSS1_P2" },
++ { STATCOL_PRUSS2_P1,"STATCOL_PRUSS2_P1" },
++ { STATCOL_PRUSS2_P2,"STATCOL_PRUSS2_P2" },
++ { STATCOL_DMA_CRYPTO_RD,"STATCOL_DMA_CRYPTO_RD" },
++ { STATCOL_DMA_CRYPTO_WR,"STATCOL_DMA_CRYPTO_WR" },
++ { STATCOL_MPU2,"STATCOL_MPU2" },
++ { STATCOL_MMC1,"STATCOL_MMC1" },
++ { STATCOL_MMC2,"STATCOL_MMC2" },
++ { STATCOL_SATA,"STATCOL_SATA" },
++ { STATCOL_MLBSS,"STATCOL_MLBSS" },
++ { STATCOL_BB2D_P2,"STATCOL_BB2D_P2" },
++ { STATCOL_IEEE1500,"STATCOL_IEEE1500" },
++ { STATCOL_DBG,"STATCOL_DBG" },
++ { STATCOL_VCP1,"STATCOL_VCP1" },
++ { STATCOL_OCMC_RAM1,"STATCOL_OCMC_RAM1" },
++ { STATCOL_OCMC_RAM2,"STATCOL_OCMC_RAM2" },
++ { STATCOL_OCMC_RAM3,"STATCOL_OCMC_RAM3" },
++ { STATCOL_GPMC,"STATCOL_GPMC" },
++ { STATCOL_MCASP1,"STATCOL_MCASP1" },
++ { STATCOL_MCASP2,"STATCOL_MCASP2" },
++ { STATCOL_MCASP3,"STATCOL_MCASP3" },
++ { STATCOL_VCP2, "STATCOL_VCP2" }
++};
++
++StatCollectorObj gStatColState;
++
++static void *statcoll_base_mem;
++static int *l3_3_clkctrl;
++
++static UInt32 *statCountDSS = NULL;
++static UInt32 *statCountIVA = NULL;
++static UInt32 *statCountBB2DP1 = NULL;
++static UInt32 *statCountBB2DP2 = NULL;
++static UInt32 *statCountUSB4 = NULL;
++static UInt32 *statCountSata = NULL;
++static UInt32 *statCountEmif1 = NULL;
++static UInt32 *statCountEmif2 = NULL;
++
++
++static statcoll_initiators_object global_object[STATCOL_MAX];
++UInt32 statCountIdx = 0;
++UInt32 TRACE_SZ = 0;
++
++void create_overall_box(struct _bar_graph_y_config *y_cfg, struct _text_config *t_cfg, char *text[])
++{
++ int i=0;
++
++ memset(y_cfg, 0x0, sizeof(struct _y_config)*25);
++ memset(t_cfg, 0x0, sizeof(struct _text_config)*25);
++
++
++ for(i=0; i<TOTAL_Y_PARAMETERS; i++) {
++ (y_cfg+i)->line_color.r = 1.0;
++ (y_cfg+i)->line_color.g = 1.0;
++ (y_cfg+i)->line_color.b = 1.0;
++ (y_cfg+i)->line_color.a = 0.7;
++ (y_cfg+i)->fill_color.r = 0.0;
++ (y_cfg+i)->fill_color.g = 0.0;
++ (y_cfg+i)->fill_color.b = 0.0;
++ (y_cfg+i)->fill_color.a = 0.1;
++ }
++
++ (y_cfg+0)->region.bottom_left.x = 0;
++ (y_cfg+0)->region.bottom_left.y = MAX_HEIGHT - HEIGHT_EMIF_AREA;
++ (y_cfg+0)->region.top_right.x = MAX_WIDTH;
++ (y_cfg+0)->region.top_right.y = 0;
++
++ (t_cfg+0)->at.x = MAX_WIDTH/2 - 8*FONT_SIZE - 50;
++ (t_cfg+0)->at.y = BORDER - FONT_SIZE + 6;
++ strcpy(text[0], string_list[0]);
++
++ (y_cfg+1)->region.bottom_left.x = TIME_GRAPH_AREA_BL_X;
++ (y_cfg+1)->region.bottom_left.y = TIME_GRAPH_AREA_BL_Y;
++ (y_cfg+1)->region.top_right.x = TIME_GRAPH_AREA_TR_X;
++ (y_cfg+1)->region.top_right.y = TIME_GRAPH_AREA_TR_Y;
++
++ (t_cfg+1)->at.x = TIME_GRAPH_AREA_BL_X - 2*FONT_SIZE;
++ (t_cfg+1)->at.y = TIME_GRAPH_AREA_TR_Y;
++ strcpy(text[1],string_list[1]);
++
++ for(i=2; i<7; i++)
++ {
++ (y_cfg+i)->region.bottom_left.x = TIME_GRAPH_AREA_BL_X;
++ (y_cfg+i)->region.bottom_left.y = TIME_GRAPH_AREA_BL_Y;// - (i-2) * (30);
++ (y_cfg+i)->region.top_right.x = TIME_GRAPH_AREA_TR_X;
++ (y_cfg+i)->region.top_right.y = TIME_GRAPH_AREA_TR_Y + (i-1) * ((TIME_GRAPH_AREA_BL_Y - TIME_GRAPH_AREA_TR_Y)/5);
++ (t_cfg+i)->at.x = TIME_GRAPH_AREA_BL_X - 2*FONT_SIZE;
++ (t_cfg+i)->at.y = TIME_GRAPH_AREA_TR_Y + (i-1) * ((TIME_GRAPH_AREA_BL_Y - TIME_GRAPH_AREA_TR_Y)/5);//TIME_GRAPH_AREA_TR_Y;
++ strcpy(text[i],string_list[i]);
++ }
++
++#if 1
++ (y_cfg+7)->region.bottom_left.x = EMIF_AREA_BL_X;
++ (y_cfg+7)->region.bottom_left.y = EMIF_AREA_BL_Y;
++ (y_cfg+7)->region.top_right.x = EMIF_AREA_TR_X;
++ (y_cfg+7)->region.top_right.y = EMIF_AREA_TR_Y;
++
++ (t_cfg+7)->at.x = WIDTH_EMIF_AREA/2 - 2*FONT_SIZE;
++ (t_cfg+7)->at.y = EMIF_AREA_TR_Y + FONT_SIZE;
++ strcpy(text[7],string_list[7]);
++
++ for(i=8; i<12; i=i+2)
++ {
++ (y_cfg+i)->region.bottom_left.x = EMIF_AREA_BL_X + BORDER + (i-8)*(BAR_WIDTH+BAR_GAP)/2;
++ (y_cfg+i)->region.bottom_left.y = EMIF_AREA_BL_Y - BORDER/2;// - (i-2) * (30);
++ (y_cfg+i)->region.top_right.x = EMIF_AREA_BL_X + BORDER + BAR_WIDTH + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
++ (y_cfg+i)->region.top_right.y = EMIF_AREA_TR_Y + BORDER * 1.2;
++
++ (y_cfg+i)->fill_color.r = 1.0;
++ (y_cfg+i)->fill_color.g = 0.0;
++ (y_cfg+i)->fill_color.b = 0.0;
++ (y_cfg+i)->fill_color.a = 0.1;
++
++ (y_cfg+i+1)->region.bottom_left.x = EMIF_AREA_BL_X + BORDER + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
++ (y_cfg+i+1)->region.bottom_left.y = EMIF_AREA_BL_Y - BORDER/2;
++ (y_cfg+i+1)->region.top_right.x = EMIF_AREA_BL_X + BORDER + BAR_WIDTH + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
++ (y_cfg+i+1)->region.top_right.y = EMIF_AREA_TR_Y + BORDER*1.2;
++
++ (y_cfg+i+1)->fill_color.r = 0.0;
++ (y_cfg+i+1)->fill_color.g = 1.0;
++ (y_cfg+i+1)->fill_color.b = 0.0;
++ (y_cfg+i+1)->fill_color.a = 1.0;
++
++ (t_cfg+i)->at.x = EMIF_AREA_BL_X + BAR_WIDTH + BORDER + (i-8) * (BAR_WIDTH + BAR_GAP)/2- 2.2*FONT_SIZE;
++ (t_cfg+i)->at.y = EMIF_AREA_TR_Y + BORDER*1.2 -5;
++
++ /* Fixed strings */
++ (t_cfg+i+1)->at.x = EMIF_AREA_BL_X + BORDER + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
++ (t_cfg+i+1)->at.y = EMIF_AREA_BL_Y;// - BORDER + FONT_SIZE;
++
++ strcpy(text[i],string_list[i]);
++ strcpy(text[i+1],string_list[i+1]);
++ }
++
++ (y_cfg+12)->region.bottom_left.x = INITIATORS_AREA_BL_X;
++ (y_cfg+12)->region.bottom_left.y = INITIATORS_AREA_BL_Y;
++ (y_cfg+12)->region.top_right.x = INITIATORS_AREA_TR_X;
++ (y_cfg+12)->region.top_right.y = INITIATORS_AREA_TR_Y;
++
++ (t_cfg+12)->at.x = EMIF_AREA_TR_X + (INITIATORS_AREA_TR_X - INITIATORS_AREA_BL_X)/2 - 4 * FONT_SIZE;
++ (t_cfg+12)->at.y = INITIATORS_AREA_TR_Y + FONT_SIZE;
++ strcpy(text[12],string_list[12]);
++
++ for(i=13; i<25; i=i+2)
++ {
++ (y_cfg+i)->region.bottom_left.x = INITIATORS_AREA_BL_X + BORDER + (i-13)*(BAR_WIDTH+BAR_GAP)/2;
++ (y_cfg+i)->region.bottom_left.y = INITIATORS_AREA_BL_Y - BORDER/2;// - (i-2) * (30);
++ (y_cfg+i)->region.top_right.x = INITIATORS_AREA_BL_X + BORDER + BAR_WIDTH + (i-13) * (BAR_WIDTH + BAR_GAP)/2;
++ (y_cfg+i)->region.top_right.y = INITIATORS_AREA_TR_Y + BORDER*1.2;
++
++ (y_cfg+i)->fill_color.r = 1.0;
++ (y_cfg+i)->fill_color.g = 0.0;
++ (y_cfg+i)->fill_color.b = 0.0;
++ (y_cfg+i)->fill_color.a = 0.1;
++
++ (y_cfg+i+1)->region.bottom_left.x = INITIATORS_AREA_BL_X + BORDER + (i-13) * (BAR_WIDTH + BAR_GAP)/2;
++ (y_cfg+i+1)->region.bottom_left.y = INITIATORS_AREA_BL_Y - BORDER/2;// - (i-2) * (30);
++ (y_cfg+i+1)->region.top_right.x = INITIATORS_AREA_BL_X + BORDER + BAR_WIDTH + (i-13) * (BAR_WIDTH + BAR_GAP)/2;
++ (y_cfg+i+1)->region.top_right.y = INITIATORS_AREA_TR_Y + BORDER* 1.2;
++
++ (y_cfg+i+1)->fill_color.r = 0.0;
++ (y_cfg+i+1)->fill_color.g = 1.0;
++ (y_cfg+i+1)->fill_color.b = 0.0;
++ (y_cfg+i+1)->fill_color.a = 1.0;
++
++ (t_cfg+i)->at.x = INITIATORS_AREA_BL_X + BORDER + BAR_WIDTH + (i-13) * (BAR_WIDTH + BAR_GAP)/2 - 2.2* FONT_SIZE;
++ (t_cfg+i)->at.y = INITIATORS_AREA_TR_Y + BORDER*1.2 -5;
++
++ (t_cfg+i+1)->at.x = INITIATORS_AREA_BL_X + BORDER + (i-13)*(BAR_WIDTH+BAR_GAP)/2;
++ (t_cfg+i+1)->at.y = INITIATORS_AREA_BL_Y;
++
++ strcpy(text[i],string_list[i]);
++ strcpy(text[i+1],string_list[i+1]);
++ }
++#endif
++
++#if 0
++ for(i=0; i<25; i++)
++ printf("(%d, %d) to (%d, %d)\n", (y_cfg +i)->region.bottom_left.x,(y_cfg +i)->region.bottom_left.y,(y_cfg +i)->region.top_right.x, (y_cfg +i)->region.top_right.y);
++#endif
++
++
++
++ for(i=0; i<25; i++) {
++ (t_cfg+i)->color.r = 0.0;
++ (t_cfg+i)->color.g = 1.0;
++ (t_cfg+i)->color.b = 1.0;
++ (t_cfg+i)->color.a = 1.0;
++ (t_cfg+i)->fontsize = FONT_SIZE;
++ }
++ (t_cfg+0)->fontsize = 20;
++
++
++}
++
++
++void statCollectorInit()
++{
++ int index;
++
++ gStatColState.stat0_filter_cnt = 0;
++ gStatColState.stat1_filter_cnt = 0;
++ gStatColState.stat2_filter_cnt = 0;
++ gStatColState.stat3_filter_cnt = 0;
++ gStatColState.stat4_filter_cnt = 0;
++ gStatColState.stat5_filter_cnt = 0;
++ gStatColState.stat6_filter_cnt = 0;
++ gStatColState.stat7_filter_cnt = 0;
++ gStatColState.stat8_filter_cnt = 0;
++ gStatColState.stat9_filter_cnt = 0;
++
++ for(index=STATCOL_EMIF1_SYS; index < STATCOL_MAX; index++)
++ {
++ global_object[index].b_enabled = 0;
++
++ strcpy(global_object[index].name, initiators[index].name);
++
++ global_object[index].readings = malloc(TRACE_SZ * sizeof(UInt32));
++ memset(global_object[index].readings, 0, TRACE_SZ * sizeof(UInt32));
++
++ global_object[index].timestamp = NULL;
++
++ global_object[index].group_id = 0xFF;
++ global_object[index].counter_id = 0;
++ global_object[index].base_address = 0;
++ global_object[index].mux_req = 0;
++ }
++
++}
++
++void wr_stat_reg(UInt32 address, UInt32 data)
++{
++ UInt32 *mymem = statcoll_base_mem;
++ UInt32 delta = (address - STATCOLL_BASE) / 4;
++#ifndef DUMMY_MODE
++ mymem[delta] = data;
++#else
++ printf("WRITE: Address = 0x%x, Data = 0x%x\n", address, data);
++#endif
++}
++
++UInt32 rd_stat_reg(UInt32 address)
++{
++#ifndef DUMMY_MODE
++ UInt32 *mymem = statcoll_base_mem;
++ UInt32 data;
++ UInt32 delta = (address - STATCOLL_BASE) / 4;
++ data = mymem[delta];
++ return data;
++#else
++ printf("READ: Address = 0x%x\n", address);
++#endif
++}
++
++UInt32 statCollectorControlInitialize(UInt32 instance_id)
++{
++ UInt32 cur_base_address = 0;
++ UInt32 cur_event_mux_req;
++ UInt32 cur_event_mux_resp;
++ UInt32 cur_stat_filter_cnt;
++
++ switch (instance_id)
++ {
++ case STATCOL_EMIF1_SYS:
++ cur_base_address = stat_coll0_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
++ global_object[instance_id].group_id = 0;
++ break;
++ case STATCOL_EMIF2_SYS:
++ cur_base_address = stat_coll0_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
++ global_object[instance_id].group_id = 0;
++ break;
++ case STATCOL_MA_MPU_P1:
++ cur_base_address = stat_coll0_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
++ global_object[instance_id].group_id = 0;
++ break;
++ case STATCOL_MA_MPU_P2:
++ cur_base_address = stat_coll0_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
++ global_object[instance_id].group_id = 0;
++ break;
++ case STATCOL_MPU1:
++ cur_base_address = stat_coll1_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
++ global_object[instance_id].group_id = 1;
++ break;
++ case STATCOL_MMU1:
++ cur_base_address = stat_coll1_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
++ global_object[instance_id].group_id = 1;
++ break;
++ case STATCOL_TPTC_RD1:
++ cur_base_address = stat_coll1_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
++ global_object[instance_id].group_id = 1;
++ break;
++ case STATCOL_TPTC_WR1:
++ cur_base_address = stat_coll1_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
++ global_object[instance_id].group_id = 1;
++ break;
++ case STATCOL_TPTC_RD2:
++ cur_base_address = stat_coll1_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
++ global_object[instance_id].group_id = 1;
++ break;
++ case STATCOL_TPTC_WR2:
++ cur_base_address = stat_coll1_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
++ global_object[instance_id].group_id = 1;
++ break;
++ case STATCOL_VIP1_P1:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_VIP1_P2:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_VIP2_P1:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_VIP2_P2:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_VIP3_P1:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_VIP3_P2:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_VPE_P1:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_VPE_P2:
++ cur_base_address = stat_coll2_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
++ global_object[instance_id].group_id = 2;
++ break;
++ case STATCOL_EVE1_TC0:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_EVE1_TC1:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_EVE2_TC0:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_EVE2_TC1:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_EVE3_TC0:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_EVE3_TC1:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_EVE4_TC0:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_EVE4_TC1:
++ cur_base_address = stat_coll3_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
++ global_object[instance_id].group_id = 3;
++ break;
++ case STATCOL_DSP1_MDMA:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_DSP1_EDMA:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_DSP2_MDMA:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_DSP2_EDMA:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_IVA:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_GPU_P1:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_GPU_P2:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_BB2D_P1:
++ cur_base_address = stat_coll4_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
++ global_object[instance_id].group_id = 4;
++ break;
++ case STATCOL_DSS:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_CSI2_2:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_MMU2:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_IPU1:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_IPU2:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_DMA_SYSTEM_RD:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_DMA_SYSTEM_WR:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_CSI2_1:
++ cur_base_address = stat_coll5_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
++ global_object[instance_id].group_id = 5;
++ break;
++ case STATCOL_USB3_SS:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_USB2_SS:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_USB2_ULPI_SS1:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_USB2_ULPI_SS2:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_PCIE_SS1:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_PCIE_SS2:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_DSP1_CFG:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_DSP2_CFG:
++ cur_base_address = stat_coll6_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
++ global_object[instance_id].group_id = 6;
++ break;
++ case STATCOL_GMAC_SW:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_PRUSS1_P1:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_PRUSS1_P2:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_PRUSS2_P1:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_PRUSS2_P2:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_DMA_CRYPTO_RD:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_DMA_CRYPTO_WR:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_MPU2:
++ cur_base_address = stat_coll7_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
++ global_object[instance_id].group_id = 7;
++ break;
++ case STATCOL_MMC1:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_MMC2:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_SATA:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_MLBSS:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_BB2D_P2:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_IEEE1500:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_DBG:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_VCP1:
++ cur_base_address = stat_coll8_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
++ global_object[instance_id].group_id = 8;
++ break;
++ case STATCOL_OCMC_RAM1:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 0;
++ cur_event_mux_resp = 1;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ case STATCOL_OCMC_RAM2:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 2;
++ cur_event_mux_resp = 3;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ case STATCOL_OCMC_RAM3:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 4;
++ cur_event_mux_resp = 5;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ case STATCOL_GPMC:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 6;
++ cur_event_mux_resp = 7;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ case STATCOL_MCASP1:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 8;
++ cur_event_mux_resp = 9;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ case STATCOL_MCASP2:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 10;
++ cur_event_mux_resp = 11;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ case STATCOL_MCASP3:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 12;
++ cur_event_mux_resp = 13;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ case STATCOL_VCP2:
++ cur_base_address = stat_coll9_base_address;
++ cur_event_mux_req = 14;
++ cur_event_mux_resp = 15;
++ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
++ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
++ global_object[instance_id].group_id = 9;
++ break;
++ default:
++ printf("ERROR: Unknown initiator %d\n", instance_id);
++ exit(0);
++ };
++
++ {
++ if ( cur_stat_filter_cnt > 4 )
++ {
++ printf("WARNING: We have exhausted filters/counters.....\n");
++ return 0;
++ }
++ // Global Enable Stat Collector
++ wr_stat_reg(cur_base_address+0x8,0x1);
++
++ // Soft Enable Stat Collector
++ wr_stat_reg(cur_base_address+0xC,0x1);
++
++ wr_stat_reg(cur_base_address+0x18,0x5);
++ // Operation of Stat Collector / RespEvt => Packet
++ wr_stat_reg(cur_base_address+0x1C,0x5);
++
++
++ // Event Sel
++ wr_stat_reg(cur_base_address+0x20+4*(cur_stat_filter_cnt-1),cur_event_mux_req);
++
++ // Op is EventInfo
++ wr_stat_reg(cur_base_address+0x1FC+(0x158*(cur_stat_filter_cnt-1)),2);
++
++ // Event Info Sel Op -> packet length
++ wr_stat_reg(cur_base_address+0x1F8+(0x158*(cur_stat_filter_cnt-1)),0);
++
++ // Filter Global Enable
++ wr_stat_reg(cur_base_address+0xAC+(0x158*(cur_stat_filter_cnt-1)),0x1);
++
++ // Filter Enable
++ wr_stat_reg(cur_base_address+0xBC+(0x158*(cur_stat_filter_cnt-1)),0x1);
++
++ // Manual dump
++ wr_stat_reg(cur_base_address+0x54,0x1);
++ // use send register to reset counters
++
++ }
++
++ global_object[instance_id].mux_req = cur_event_mux_req;
++ global_object[instance_id].base_address = cur_base_address;
++ global_object[instance_id].counter_id = cur_stat_filter_cnt;
++ global_object[instance_id].b_enabled = 1;
++
++ return cur_stat_filter_cnt;
++}
++
++
++
++void statCollectorReadGroup(UInt32 group_id)
++{
++ int i=0;
++ UInt32 cur_base_address = 0x45001000 + ((group_id - 1) * 0x1000);
++
++ wr_stat_reg(cur_base_address+0xC,0x0);
++
++ for(i=0; i < STATCOL_MAX; i++)
++ {
++ if(global_object[i].group_id == (group_id - 1) &&
++ global_object[i].b_enabled == 1)
++ {
++ UInt32 cur_stat_filter_cnt = global_object[i].counter_id;
++
++ global_object[i].readings[statCountIdx] = rd_stat_reg(cur_base_address+0x8C+((cur_stat_filter_cnt-1)*4));
++ }
++ }
++
++ wr_stat_reg(cur_base_address+0xC,0x1);
++}
++
++
++volatile sig_atomic_t sigtermed = 0;
++
++void my_signal_handler(int signum)
++{
++ if (signum == SIGTERM || signum == SIGINT) {
++ sigtermed = 1;
++ }
++}
++
++struct sort
++{
++ int pos;
++ double value;
++};
++
++
++void *ctx;
++struct time_graph_create_params p;
++char xpos_string[100], ypos_string[100];
++
++void mpu_handler(int command)
++{
++#if 1
++ static int fd;
++ char buf[1000];
++ char * tabledata= "/tmp/statcollfifo";
++ int i;
++ int bytes;
++ static int offset = 13;
++
++ switch(command)
++ {
++ case OPEN:
++ fd = open(tabledata, O_RDONLY|O_NONBLOCK);
++ break;
++
++ case READ:
++
++ /* open, read, and display the message from the FIFO */
++ bytes=read(fd, buf, 1000);
++ if(bytes > 0)
++ {
++ char str[100];
++ char value[100];
++ sscanf(buf, "%s %s", str, value);
++ if(strcmp(str, "MOVE:") == 0)
++ {
++ printf("Received MOVE command : %s\n", buf);
++ sprintf(p.title, "CPU Usage[@position-req=%sx%s]", value, ypos_string);
++ move_graph(ctx, &p);
++ }
++ else
++ {
++ printf("ERROR: Received unexpected data from FIFO - \" %s \" \n", buf);
++ }
++ memset(buf, 0x0, sizeof(buf));
++ }
++
++ break;
++
++ case CLOSE:
++ close(fd);
++ break;
++ }
++#endif
++ return;
++}
++
++
++UInt32 statcoll_start(UInt32 TOTAL_TIME, UInt32 INTERVAL_US, char list[][50], UInt32 xpos, UInt32 ypos)
++{
++ int i, fd, index;
++ UInt32 counterIdDss, counterIdIva, counterIdBB2dP1, counterIdBB2dP2, counterIdUsb4, counterIdSata, counterIdEmif1, counterIdEmif2;
++
++ if (SIG_ERR == signal(SIGPIPE,SIG_IGN))
++ exit(1);
++
++ if (SIG_ERR == signal(SIGINT,my_signal_handler))
++ exit(1);
++
++ if (SIG_ERR == signal(SIGTERM,my_signal_handler))
++ exit(1);
++
++
++ struct timeval tv1, tv2;
++ gettimeofday(&tv1, NULL);
++ printf("------------------------------------------------\n");
++ printf("Compile time = %s %s\n",__DATE__, __TIME__);
++ printf("------------------------------------------------\n\n");
++ //printd("Start time = %d\n", time(NULL));
++ //printd("Time seconds = %d, usecs = %d\n", tv.tv_sec, tv.tv_usec);
++
++ statcoll_params params;
++ memset(&params, sizeof(params), 0);
++ params.INTERVAL_US = INTERVAL_US;
++ params.TOTAL_TIME = TOTAL_TIME;
++
++ i=0;
++ index=0;
++
++ while(list[i][0] != 0)
++ {
++ for(index=0; index< STATCOL_MAX; index++) {
++ if(strcmp(list[i], initiators[index].name) == 0)
++ {
++ strcpy(params.user_config_list[params.no_of_initiators].name, list[i]);
++ params.user_config_list[params.no_of_initiators++].id = initiators[index].id;
++ break;
++ }
++ }
++
++ if(index == STATCOL_MAX) {
++ printf("ERROR: Unknown initiator.%d.. .%s. \n", i, list[i]);
++ //exit(0);
++ }
++ i++;
++ }
++
++ struct bar_graph_create_params bg_p;
++ struct _y_config *y_cfg;
++ struct _text_config *t_cfg;
++ double *y;
++ double *bg_y;
++ char *text_list[STATCOL_MAX];
++
++ struct _bar_graph_y_config *bg_y_cfg;
++ struct _text_config *bg_t_cfg;
++ char *bg_text_list[STATCOL_MAX];
++
++ sprintf(xpos_string, "%d", xpos);
++ sprintf(ypos_string, "%d", ypos);
++ p.title=(char *)malloc(100);
++ sprintf(p.title, "CPU Usage[@position-req=%sx%s]", xpos_string, ypos_string);
++ //p.height = MAX_HEIGHT - HEIGHT_EMIF_AREA;
++ p.height = MAX_HEIGHT;// - HEIGHT_EMIF_AREA;
++ p.width = MAX_WIDTH;
++ p.draw_area.bottom_left.x = TIME_GRAPH_AREA_BL_X;
++ p.draw_area.bottom_left.y = TIME_GRAPH_AREA_BL_Y;
++ p.draw_area.top_right.x = TIME_GRAPH_AREA_TR_X;
++ p.draw_area.top_right.y = TIME_GRAPH_AREA_TR_Y;
++ p.time_span = 120000; // 120 seconds
++ p.num_of_y_items = params.no_of_initiators+1;
++ p.num_of_text_items = 0;//params.no_of_initiators;
++
++
++ y_cfg = malloc((params.no_of_initiators+1) * sizeof(struct _y_config));
++ t_cfg = malloc(params.no_of_initiators * sizeof(struct _text_config));
++ y = malloc((params.no_of_initiators+1) * sizeof(double));
++ p.y_config_array = y_cfg;
++ p.text_config_array = t_cfg;
++
++ bg_y_cfg = malloc(TOTAL_Y_PARAMETERS * sizeof(struct _bar_graph_y_config));
++ bg_t_cfg = malloc(TOTAL_Y_PARAMETERS * sizeof(struct _text_config));
++ bg_y = malloc(TOTAL_Y_PARAMETERS * sizeof(double));
++
++ for(i=0; i<TOTAL_Y_PARAMETERS; i++)
++ {
++ bg_text_list[i] = malloc(100);
++ strcpy(bg_text_list[i],"test");
++ }
++
++ create_overall_box(bg_y_cfg, bg_t_cfg, bg_text_list);
++
++
++ i=0;
++ while(i < params.no_of_initiators)
++ {
++ text_list[i] = malloc(100 * sizeof(char));
++ memset(text_list[i], 0x0, 100);
++
++ ((struct _y_config *)y_cfg+i)->line_color.r = pallette[i%MAX_COLORS].r;
++ ((struct _y_config *)y_cfg+i)->line_color.g = pallette[i%MAX_COLORS].g;
++ ((struct _y_config *)y_cfg+i)->line_color.b = pallette[i%MAX_COLORS].b;
++ ((struct _y_config *)y_cfg+i)->line_color.a = 0.0;//pallette[i%MAX_COLORS].a;
++
++ ((struct _y_config *)y_cfg+i)->fill_color.r = 0.0;
++ ((struct _y_config *)y_cfg+i)->fill_color.g = 1.0;
++ ((struct _y_config *)y_cfg+i)->fill_color.b = 0.0;
++ ((struct _y_config *)y_cfg+i)->fill_color.a = 0.5;
++
++ i++;
++ }
++
++ ((struct _y_config *)y_cfg+i)->line_color.r = 0.0;
++ ((struct _y_config *)y_cfg+i)->line_color.g = 0.0;
++ ((struct _y_config *)y_cfg+i)->line_color.b = 0.0;
++ ((struct _y_config *)y_cfg+i)->line_color.a = 0.5;
++ ((struct _y_config *)y_cfg+i)->fill_color.r = 0.1;
++ ((struct _y_config *)y_cfg+i)->fill_color.g = 0.9;
++ ((struct _y_config *)y_cfg+i)->fill_color.b = 0.5;
++ ((struct _y_config *)y_cfg+i)->fill_color.a = 1.0;
++
++ bg_p.title = "CPU Usage";
++
++ bg_p.num_of_y_items = TOTAL_Y_PARAMETERS;
++ bg_p.y_config_array = bg_y_cfg;
++ bg_p.num_of_text_items = TOTAL_Y_PARAMETERS;
++ bg_p.text_config_array = bg_t_cfg;
++
++
++ int argc;
++ char *argv[10];
++ ctx = time_graph_create(argc, argv, &p);
++ if (!ctx) {
++ printf("Error creating context\n");
++ exit(0);
++ }
++
++ printf("\n Context after time_graph_create = 0x%x\n", ctx);
++ ctx = bar_graph_create(argc, argv, &bg_p);
++ if (!ctx) {
++ printf("Error creating context\n");
++ exit(0);
++ }
++
++ printf("\n Context after bar_graph_create= 0x%x\n", ctx);
++
++ printf("Total configured initiators = %d\n", params.no_of_initiators);
++
++
++ fd = open("/dev/mem", O_RDWR);
++ if (fd == -1){
++ printf("error fd=open() \n");
++ return -1;
++ }
++ statcoll_base_mem = mmap(NULL, STATCOLL_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, STATCOLL_BASE);
++
++ if (statcoll_base_mem == MAP_FAILED){
++ printf("ERROR: mmap failed \n");
++ return;
++ }
++ close(fd);
++
++ fd = open("/dev/mem", O_RDWR);
++ if (fd == -1){
++ printf("error fd=open() \n");
++ return -1;
++ }
++ l3_3_clkctrl = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, CM_L3INSTR_REGISTER_BASE);
++ if (l3_3_clkctrl == MAP_FAILED){
++ printf("ERROR: mmap failed for CM_L3INSTR_REGISTER_BASE\n");
++ return;
++ }
++ close(fd);
++
++ printf("SUCCESS: Mapped 0x%x to user space address 0x%x\n", STATCOLL_BASE, statcoll_base_mem);
++ printf("INTERVAL = %d usecs\n", INTERVAL_US);
++ printf("TOTAL TIME = %d seconds\n", TOTAL_TIME);
++ TRACE_SZ = (TOTAL_TIME * 1000000)/INTERVAL_US;
++ printf("TRACE SIZE = %d samples\n", TRACE_SZ);
++
++ printf("**************************************\n");
++ printf("Going to initialize the L3 clocks \n");
++ l3_3_clkctrl[CM_L3INSTR_L3INSTR_CLKSTCTRL_OFFSET >> 2] = 0x2;
++ l3_3_clkctrl[CM_L3INSTR_L3_MAIN_2_CLKCTRL_OFFSET >> 2] = 0x1;
++ printf("**************************************\n");
++
++ while( (l3_3_clkctrl[CM_L3INSTR_L3_MAIN_2_CLKCTRL_OFFSET >> 2] & 0x30000) != 0x0)
++ {
++ printf("Waiting on module to be functional\n");
++ }
++
++ statCollectorInit();
++
++ printf("SUCCESS: Initialized STAT COLLECTOR\n");
++ /* Initialize all enabled initiators */
++ for(index =0; index < params.no_of_initiators; index++) {
++ printf("\t\t Initialized %s\n", params.user_config_list[index].name);
++ statCollectorControlInitialize(params.user_config_list[index].id);
++ }
++
++ const char *bg_text = "CPU Utilization";
++
++ int second_counter=0;
++ memset(y, 0x0, sizeof(double)* (params.no_of_initiators+1));
++
++
++
++
++ mpu_handler(OPEN);
++
++
++ while(statCountIdx != (TRACE_SZ - 1))
++ {
++ usleep(INTERVAL_US);
++ int group;
++ for(group = 1; group<11; group++)
++ statCollectorReadGroup(group);
++
++ mpu_handler(READ);
++
++ if(statCountIdx != 0 )
++ for(i=0; i<params.no_of_initiators; i++) {
++ y[i] += (double)(global_object[params.user_config_list[i].id].readings[statCountIdx])/ (8000000000);
++ }
++ second_counter++;
++
++ if(second_counter % 30 == 0)
++ {
++
++ for(i=0; i<TOTAL_Y_PARAMETERS; i++) {
++ bg_y[i] = 1.0;
++ }
++
++ //HACK
++ bg_y[9]=y[0]*2;
++ bg_y[11]=y[1]*2;
++ sprintf(bg_text_list[8], "%02.1f%s", y[0]*100, "%");
++ sprintf(bg_text_list[10], "%02.1f%s", y[1]*100, "%");
++
++ struct sort sort_array[STATCOL_MAX];
++ memset(sort_array, 0x0, sizeof(struct sort) * STATCOL_MAX);
++ /* Sort here */
++ for(i=2; i<params.no_of_initiators; i++) {
++ sort_array[i-2].value = y[i];
++ sort_array[i-2].pos = i;
++ }
++
++ int j;
++ double tempdouble;
++ int tempint;
++ for(i=0; i<params.no_of_initiators-2; i++) {
++ for(j=i+1; j<params.no_of_initiators-2; j++) {
++ if(sort_array[i].value < sort_array[j].value) {
++ tempdouble = sort_array[j].value;
++ tempint = sort_array[j].pos;
++
++ sort_array[j].value = sort_array[i].value;
++ sort_array[j].pos = sort_array[i].pos;
++
++ sort_array[i].value = tempdouble;
++ sort_array[i].pos = tempint;
++ }
++ }
++ }
++
++ for(i=0; i<6; i++)
++ {
++ //HACK
++ bg_y[14+i*2] = sort_array[i].value*2;
++ sprintf(bg_text_list[13+i*2], "%02.1f%s", sort_array[i].value*100, "%");
++ sprintf(bg_text_list[14+i*2], "%s", (params.user_config_list[sort_array[i].pos].name)+8);
++ }
++
++ bar_graph_plot(ctx, bg_y, (const char **)bg_text_list);
++
++ y[params.no_of_initiators]=y[0]+y[1];
++ time_graph_plot(ctx, y, (const char **)text_list);
++ //printf("Plotting the time_graph\n");
++ memset(y, 0x0, sizeof(double)* (params.no_of_initiators+1));
++ }
++ statCountIdx++;
++
++ }
++
++ mpu_handler(CLOSE);
++
++ printf("------------------------------------------------\n\n");
++ printf("SUCCESS: Stat collection completed... Writing into file now\n");
++ FILE *outfile = fopen("statcollector.csv", "w+");
++ if (!outfile) {
++ printf("\n ERROR: Error opening file");
++ }
++
++ /* Ignore the first index at 0 */
++ for(index=1; index<statCountIdx; index++) {
++ for(i=0; i<params.no_of_initiators; i++) {
++ fprintf(outfile,"%s = %d,", params.user_config_list[i].name, global_object[params.user_config_list[i].id].readings[index]);
++ }
++ fprintf(outfile,"\n");
++ }
++ fclose(outfile);
++
++ time_graph_destroy(ctx);
++ gettimeofday(&tv2, NULL);
++ //printf("End time = %d\n", time(NULL));
++ //printf("Time seconds = %d, usecs = %d\n", tv.tv_sec, tv.tv_usec);
++ printf("Total execution time = %d secs, %d usecs\n\n", (tv2.tv_sec - tv1.tv_sec), (tv2.tv_usec - tv2.tv_usec));
++
++ return 0;
++}
++
++
+diff --git a/clients/statcoll.h b/clients/statcoll.h
+new file mode 100644
+index 0000000..fa92753
+--- /dev/null
++++ b/clients/statcoll.h
+@@ -0,0 +1,152 @@
++#ifndef __STATCOLL_H
++#define __STATCOLL_H
++
++
++#define CM_L3INSTR_REGISTER_BASE (0x4A008000)
++
++#define CM_L3INSTR_L3INSTR_CLKSTCTRL_OFFSET (0xE00)
++#define CM_L3INSTR_L3_MAIN_2_CLKCTRL_OFFSET (0xE20)
++
++#define STATCOLL_SIZE 40960
++#define STATCOLL_BASE (0x45001000)
++
++#define stat_coll0_base_address (0x45001000)
++#define stat_coll1_base_address (0x45002000)
++#define stat_coll2_base_address (0x45003000)
++#define stat_coll3_base_address (0x45004000)
++#define stat_coll4_base_address (0x45005000)
++#define stat_coll5_base_address (0x45006000)
++#define stat_coll6_base_address (0x45007000)
++#define stat_coll7_base_address (0x45008000)
++#define stat_coll8_base_address (0x45009000)
++#define stat_coll9_base_address (0x4500a000)
++
++#define printd(fmt, ...) \
++ do { if (debug) fprintf(stderr, fmt, __VA_ARGS__); } while (0)
++
++typedef unsigned int UInt32;
++
++
++typedef enum
++{
++ STATCOL_EMIF1_SYS,
++ STATCOL_EMIF2_SYS,
++ STATCOL_MA_MPU_P1,
++ STATCOL_MA_MPU_P2,
++ STATCOL_MPU1,
++ STATCOL_MMU1,
++ STATCOL_TPTC_RD1,
++ STATCOL_TPTC_WR1,
++ STATCOL_TPTC_RD2,
++ STATCOL_TPTC_WR2,
++ STATCOL_VIP1_P1,
++ STATCOL_VIP1_P2,
++ STATCOL_VIP2_P1,
++ STATCOL_VIP2_P2,
++ STATCOL_VIP3_P1,
++ STATCOL_VIP3_P2,
++ STATCOL_VPE_P1,
++ STATCOL_VPE_P2,
++ STATCOL_EVE1_TC0,
++ STATCOL_EVE1_TC1,
++ STATCOL_EVE2_TC0,
++ STATCOL_EVE2_TC1,
++ STATCOL_EVE3_TC0,
++ STATCOL_EVE3_TC1,
++ STATCOL_EVE4_TC0,
++ STATCOL_EVE4_TC1,
++ STATCOL_DSP1_MDMA,
++ STATCOL_DSP1_EDMA,
++ STATCOL_DSP2_MDMA,
++ STATCOL_DSP2_EDMA,
++ STATCOL_IVA,
++ STATCOL_GPU_P1,
++ STATCOL_GPU_P2,
++ STATCOL_BB2D_P1,
++ STATCOL_DSS,
++ STATCOL_CSI2_2,
++ STATCOL_MMU2,
++ STATCOL_IPU1,
++ STATCOL_IPU2,
++ STATCOL_DMA_SYSTEM_RD,
++ STATCOL_DMA_SYSTEM_WR,
++ STATCOL_CSI2_1,
++ STATCOL_USB3_SS,
++ STATCOL_USB2_SS,
++ STATCOL_USB2_ULPI_SS1,
++ STATCOL_USB2_ULPI_SS2,
++ STATCOL_PCIE_SS1,
++ STATCOL_PCIE_SS2,
++ STATCOL_DSP1_CFG,
++ STATCOL_DSP2_CFG,
++ STATCOL_GMAC_SW,
++ STATCOL_PRUSS1_P1,
++ STATCOL_PRUSS1_P2,
++ STATCOL_PRUSS2_P1,
++ STATCOL_PRUSS2_P2,
++ STATCOL_DMA_CRYPTO_RD,
++ STATCOL_DMA_CRYPTO_WR,
++ STATCOL_MPU2,
++ STATCOL_MMC1,
++ STATCOL_MMC2,
++ STATCOL_SATA,
++ STATCOL_MLBSS,
++ STATCOL_BB2D_P2,
++ STATCOL_IEEE1500,
++ STATCOL_DBG,
++ STATCOL_VCP1,
++ STATCOL_OCMC_RAM1,
++ STATCOL_OCMC_RAM2,
++ STATCOL_OCMC_RAM3,
++ STATCOL_GPMC,
++ STATCOL_MCASP1,
++ STATCOL_MCASP2,
++ STATCOL_MCASP3,
++ STATCOL_VCP2,
++ STATCOL_MAX
++} STATCOL_ID;
++
++
++
++typedef struct
++{
++ UInt32 stat0_filter_cnt;
++ UInt32 stat1_filter_cnt;
++ UInt32 stat2_filter_cnt;
++ UInt32 stat3_filter_cnt;
++ UInt32 stat4_filter_cnt;
++ UInt32 stat5_filter_cnt;
++ UInt32 stat6_filter_cnt;
++ UInt32 stat7_filter_cnt;
++ UInt32 stat8_filter_cnt;
++ UInt32 stat9_filter_cnt;
++} StatCollectorObj;
++
++struct list_of_initiators
++{
++ STATCOL_ID id;
++ char name[50];
++};
++
++typedef struct
++{
++ UInt32 INTERVAL_US;
++ UInt32 TOTAL_TIME;
++ UInt32 no_of_initiators;
++ struct list_of_initiators user_config_list[STATCOL_MAX];
++} statcoll_params;
++
++typedef struct
++{
++ UInt32 b_enabled;
++ char name[100];
++ UInt32 *readings;
++ UInt32 *timestamp;
++ UInt32 group_id;
++ UInt32 counter_id;
++ UInt32 base_address;
++ UInt32 mux_req;
++}statcoll_initiators_object;
++
++
++#endif
+diff --git a/clients/statcoll_gui.h b/clients/statcoll_gui.h
+new file mode 100644
+index 0000000..7362bde
+--- /dev/null
++++ b/clients/statcoll_gui.h
+@@ -0,0 +1,101 @@
++
++/*
++
++ ---------------------------------------------
++ | |
++ | --------------------------------------- |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ | |
++ ---------------------------------------------
++ | | |
++ | | |
++ | | |
++ | | |
++ | | |
++ | | |
++ ---------------------------------------------
++
++
++
++
++*/
++#define POSITION_X 2800
++#define POSITION_Y 40
++
++#define MAX_WIDTH 900
++//#define MAX_WIDTH 528
++#define MAX_HEIGHT 900
++
++/* Derived parameters */
++#define BAR_GAP (MAX_WIDTH/25)
++#define BAR_WIDTH (MAX_WIDTH/16)
++
++#define BAR_HEIGHT ((MX_HEIGHT/40) * 6)
++
++#define BORDER (MAX_WIDTH/15)
++
++#define HEIGHT_EMIF_AREA (MAX_HEIGHT/4)
++
++#define FONT_SIZE (MAX_WIDTH/40)
++
++#define WIDTH_EMIF_AREA (MAX_WIDTH / 4)
++
++#define TOTAL_Y_PARAMETERS (25)
++
++#define TIME_GRAPH_AREA_BL_X (BORDER)
++#define TIME_GRAPH_AREA_BL_Y (MAX_HEIGHT - HEIGHT_EMIF_AREA - BORDER)
++#define TIME_GRAPH_AREA_TR_X (MAX_WIDTH - BORDER)
++#define TIME_GRAPH_AREA_TR_Y (BORDER)
++
++#define EMIF_AREA_BL_X (0)
++#define EMIF_AREA_BL_Y (MAX_HEIGHT)
++#define EMIF_AREA_TR_X (WIDTH_EMIF_AREA)
++#define EMIF_AREA_TR_Y (MAX_HEIGHT - HEIGHT_EMIF_AREA)
++
++#define INITIATORS_AREA_BL_X (WIDTH_EMIF_AREA)
++#define INITIATORS_AREA_BL_Y (MAX_HEIGHT)
++#define INITIATORS_AREA_TR_X (MAX_WIDTH)
++#define INITIATORS_AREA_TR_Y (MAX_HEIGHT - HEIGHT_EMIF_AREA)
++
++
++const char *string_list[TOTAL_Y_PARAMETERS] = {
++ "----DDR BANDWIDTH PLOT----",
++ "8 GBPS",
++ "6.4 ",
++ "4.8",
++ "3.2",
++ "1.6",
++ "0",
++ "EMIF Plot",
++ "test",
++ "EMIF1",
++ "test",
++ "EMIF2",
++ "TOP 6 INITIATORS",
++ "test",
++ "MPU",
++ "test",
++ "DSS",
++ "test",
++ "DSP",
++ "test",
++ "IVA",
++ "test",
++ "GPU",
++ "test",
++ "BB2D",
++};
++
+diff --git a/clients/time_bar_graph.c b/clients/time_bar_graph.c
+new file mode 100644
+index 0000000..9fa9c12
+--- /dev/null
++++ b/clients/time_bar_graph.c
+@@ -0,0 +1,515 @@
++/*
++ * Copyright © 2008 Kristian Høgsberg
++ *
++ * Permission to use, copy, modify, distribute, and sell this software and its
++ * documentation for any purpose is hereby granted without fee, provided that
++ * the above copyright notice appear in all copies and that both that copyright
++ * notice and this permission notice appear in supporting documentation, and
++ * that the name of the copyright holders not be used in advertising or
++ * publicity pertaining to distribution of the software without specific,
++ * written prior permission. The copyright holders make no representations
++ * about the suitability of this software for any purpose. It is provided "as
++ * is" without express or implied warranty.
++ *
++ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
++ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
++ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
++ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
++ * OF THIS SOFTWARE.
++ */
++
++#include <stdint.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdint.h>
++#include <signal.h>
++#include <time.h>
++#include <math.h>
++#include <cairo.h>
++#include <sys/time.h>
++#include <pthread.h>
++#include <errno.h>
++#include <unistd.h>
++#include <sys/eventfd.h>
++#include <sys/epoll.h>
++
++#include <linux/input.h>
++#include <wayland-client.h>
++#include "window.h"
++#include "../shared/cairo-util.h"
++#include "time_bar_graph.h"
++
++//#define DEBUG 1
++#ifdef DEBUG
++#define DBG(x...) printf(x)
++#else
++#define DBG(x...) // printf(x)
++#endif
++
++#define MAX_ITEMS 180
++#define MAX_TEXT_SIZE 128
++
++struct graph_dataset_point {
++ int next_index;
++ double y_values[MAX_ITEMS];
++};
++
++struct graph_data {
++ int dataset_size;
++ int first_index, last_index, num_elems;
++ uint64_t last_time;
++ struct graph_dataset_point dataset[1];
++};
++
++struct graph {
++ struct display *display;
++ struct window *window;
++ struct widget *widget;
++ int width, height;
++ struct time_graph_create_params params;
++ struct bar_graph_create_params bar_graph_params;
++ struct _y_config y_config_array[MAX_ITEMS];
++ struct _text_config text_config_array[MAX_ITEMS];
++
++ /* Bar graph parameters */
++ struct _bar_graph_y_config bar_graph_y_config_array[MAX_ITEMS];
++ struct _text_config bar_graph_text_config_array[MAX_ITEMS];
++
++ pthread_t thr;
++ int eventfd;
++ struct task task;
++ double x_scaling_factor;
++ pthread_mutex_t mtx;
++ double time_graph_y_values[MAX_ITEMS];
++ char text_values[MAX_ITEMS][MAX_TEXT_SIZE];
++
++ double bar_graph_y_values[MAX_ITEMS];
++ char bar_graph_text_values[MAX_ITEMS][MAX_TEXT_SIZE];
++
++ uint64_t time_now;
++ time_t start_time_tv_sec;
++ struct graph_data *data;
++};
++
++struct graph *global_graph=NULL;
++static void
++draw_stuff(struct graph *g, cairo_surface_t *surface)
++{
++ cairo_t *cr;
++ int i, j, n_elems;
++ double c_x, c_y, d_x, d_y;
++
++ cr = cairo_create(surface);
++ cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
++ cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.5);
++ cairo_paint(cr);
++ cairo_select_font_face(cr, "mono",
++ CAIRO_FONT_SLANT_NORMAL,
++ CAIRO_FONT_WEIGHT_BOLD);
++ cairo_set_line_width (cr, 1.0);
++ cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
++ pthread_mutex_lock(&g->mtx);
++ for (j=0; g->data->num_elems > 0 && j<g->params.num_of_y_items; j++) {
++ n_elems = g->data->num_elems;
++ DBG("first_index: %d, last_index: %d\n", g->data->first_index, g->data->last_index);
++ if (g->y_config_array[j].fill_color.a != 0.0)
++ cairo_move_to(cr, (double)g->params.draw_area.bottom_left.x, (double)g->params.draw_area.bottom_left.y);
++ c_x = (double)g->params.draw_area.bottom_left.x;
++ c_y = (double)g->params.draw_area.bottom_left.y;
++ d_x = 0;
++ i = g->data->first_index;
++ while (n_elems) {
++ DBG("index: %d, x: %f, y: %f, next_index: %d\n", i, c_x,
++ g->data->dataset[i].y_values[j], g->data->dataset[i].next_index);
++ d_y = g->data->dataset[i].y_values[j] - c_y;
++ c_y = g->data->dataset[i].y_values[j];
++ c_x = c_x + d_x;
++ if (g->y_config_array[j].fill_color.a == 0.0 && n_elems == g->data->num_elems) {
++ cairo_move_to(cr, c_x, c_y);
++ } else {
++ cairo_curve_to(cr, c_x - (d_x * 0.75), c_y - (d_y * 0.92), c_x - (d_x * 0.25), c_y - (d_y * 0.08), c_x, c_y);
++ }
++ if (g->data->dataset[i].next_index > i) {
++ d_x = (g->data->dataset[i].next_index - i);
++ } else {
++ d_x = (g->data->dataset_size + g->data->dataset[i].next_index - i);
++ }
++ i = g->data->dataset[i].next_index;
++ n_elems--;
++ }
++ if (g->y_config_array[j].fill_color.a != 0.0) {
++ cairo_line_to(cr, c_x, (double)g->params.draw_area.bottom_left.y);
++ cairo_line_to(cr, (double)g->params.draw_area.bottom_left.x, (double)g->params.draw_area.bottom_left.y);
++ cairo_close_path(cr);
++ cairo_set_source_rgba(cr, g->y_config_array[j].fill_color.r, g->y_config_array[j].fill_color.g,
++ g->y_config_array[j].fill_color.b, g->y_config_array[j].fill_color.a);
++ cairo_fill_preserve(cr);
++ }
++ cairo_set_source_rgba(cr, g->y_config_array[j].line_color.r, g->y_config_array[j].line_color.g,
++ g->y_config_array[j].line_color.b, g->y_config_array[j].line_color.a);
++ cairo_stroke(cr);
++ }
++
++ for (j=0; j<g->params.num_of_text_items; j++) {
++ cairo_move_to(cr, (double)g->text_config_array[j].at.x, (double)g->text_config_array[j].at.y);
++ cairo_set_font_size(cr, g->text_config_array[j].fontsize);
++ cairo_set_source_rgba(cr, g->text_config_array[j].color.r, g->text_config_array[j].color.g,
++ g->text_config_array[j].color.b, g->text_config_array[j].color.a);
++ cairo_show_text(cr, g->text_values[j]);
++ }
++
++
++ for (j=0; j<g->bar_graph_params.num_of_y_items; j++) {
++ cairo_move_to(cr, (double)g->bar_graph_params.y_config_array[j].region.bottom_left.x,
++ (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y);
++ c_y = (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y -
++ (g->bar_graph_y_values[j] * (double)(g->bar_graph_params.y_config_array[j].region.bottom_left.y -
++ g->bar_graph_params.y_config_array[j].region.top_right.y));
++ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.bottom_left.x, c_y);
++ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.top_right.x, c_y);
++ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.top_right.x,
++ (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y);
++ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.bottom_left.x,
++ (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y);
++ cairo_close_path(cr);
++ cairo_set_source_rgba(cr, g->bar_graph_y_config_array[j].fill_color.r, g->bar_graph_y_config_array[j].fill_color.g,
++ g->bar_graph_y_config_array[j].fill_color.b, g->bar_graph_y_config_array[j].fill_color.a);
++ cairo_fill_preserve(cr);
++ cairo_set_source_rgba(cr, g->bar_graph_y_config_array[j].line_color.r, g->bar_graph_y_config_array[j].line_color.g,
++ g->bar_graph_y_config_array[j].line_color.b, g->bar_graph_y_config_array[j].line_color.a);
++ cairo_stroke(cr);
++ }
++ for (j=0; j<g->bar_graph_params.num_of_text_items; j++) {
++ cairo_move_to(cr, (double)g->bar_graph_text_config_array[j].at.x, (double)g->bar_graph_text_config_array[j].at.y);
++ cairo_set_font_size(cr, g->bar_graph_text_config_array[j].fontsize);
++ cairo_set_source_rgba(cr, g->bar_graph_text_config_array[j].color.r, g->bar_graph_text_config_array[j].color.g,
++ g->bar_graph_text_config_array[j].color.b, g->bar_graph_text_config_array[j].color.a);
++ cairo_save (cr);
++ //cairo_rotate(cr, 2*3.14*21/24);
++ cairo_show_text(cr, g->bar_graph_text_values[j]);
++ cairo_restore(cr);
++ }
++ pthread_mutex_unlock(&g->mtx);
++ cairo_destroy(cr);
++}
++
++static void
++resize_handler(struct widget *widget,
++ int32_t width, int32_t height, void *data)
++{
++ struct graph *g = data;
++
++ /* Dont resize me */
++ widget_set_size(g->widget, g->width, g->height);
++}
++
++static void
++redraw_handler(struct widget *widget, void *data)
++{
++ struct graph *g = data;
++ cairo_surface_t *surface;
++
++ surface = window_get_surface(g->window);
++ if (surface == NULL ||
++ cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
++ fprintf(stderr, "failed to create cairo egl surface\n");
++ return;
++ }
++
++ draw_stuff(g, surface);
++ cairo_surface_destroy(surface);
++}
++
++static void
++button_handler(struct widget *widget,
++ struct input *input, uint32_t time,
++ uint32_t button, enum wl_pointer_button_state state, void *data)
++{
++ struct graph *g = data;
++
++ switch (button) {
++ case BTN_LEFT:
++ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
++ window_move(g->window, input,
++ display_get_serial(g->display));
++ break;
++ case BTN_MIDDLE:
++ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
++ widget_schedule_redraw(widget);
++ break;
++ case BTN_RIGHT:
++ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
++ window_show_frame_menu(g->window, input, time);
++ break;
++ }
++}
++
++static void
++touch_down_handler(struct widget *widget, struct input *input,
++ uint32_t serial, uint32_t time, int32_t id,
++ float x, float y, void *data)
++{
++ struct graph *g = data;
++ window_move(g->window, input, display_get_serial(g->display));
++}
++
++static void task_run(struct task *task, uint32_t events)
++{
++ eventfd_t e;
++ struct graph *g = (struct graph *)(task->link.prev);
++ uint64_t time_diff;
++ int elems, tmp, incr, i;
++ double y;
++
++ eventfd_read(g->eventfd, &e);
++ if(e == 1) {
++ pthread_mutex_lock(&g->mtx);
++ /* Process new data */
++ DBG("time_now: %llu, last_time: %llu\n", g->time_now, g->data->last_time);
++ if (g->time_now > g->data->last_time) {
++ time_diff = g->time_now - g->data->last_time;
++ y = (double)time_diff * g->x_scaling_factor;
++ incr = (int)y;
++ DBG("incr: %d\n", incr);
++
++ if (g->data->last_index >= g->data->first_index) elems = g->data->last_index - g->data->first_index + 1;
++ else elems = g->data->dataset_size - g->data->first_index + g->data->last_index + 1;
++ /* Move first index to make room for new element */
++ while (g->data->dataset_size > 0 && (elems + incr) > g->data->dataset_size) {
++ tmp = g->data->dataset[g->data->first_index].next_index - g->data->first_index;
++ if (tmp < 0) tmp = g->data->dataset_size + tmp;
++ g->data->first_index = g->data->dataset[g->data->first_index].next_index;
++ elems -= tmp;
++ g->data->num_elems--;
++ }
++ for (i=0; i<g->params.num_of_y_items; i++) {
++ /* Scale Y */
++ y = g->time_graph_y_values[i] * (double)(g->params.draw_area.bottom_left.y-g->params.draw_area.top_right.y);
++ y = (double)g->params.draw_area.bottom_left.y - y;
++ g->data->dataset[g->data->last_index].y_values[i] = y;
++ }
++ g->data->dataset[g->data->last_index].next_index = g->data->last_index + incr;
++ if (g->data->dataset[g->data->last_index].next_index >= g->data->dataset_size)
++ g->data->dataset[g->data->last_index].next_index -= g->data->dataset_size;
++ g->data->num_elems++;
++ g->data->last_index = g->data->dataset[g->data->last_index].next_index;
++ g->data->last_time = g->time_now;
++ }
++ pthread_mutex_unlock(&g->mtx);
++ }
++ widget_schedule_redraw(g->widget);
++ DBG("event task ran...\n");
++}
++
++void *time_graph_create(int argc, char *argv[], struct time_graph_create_params *cp)
++{
++ struct graph *g;
++ struct display *d;
++ int dataset_size;
++ struct timeval tv;
++
++ if (cp->num_of_y_items > MAX_ITEMS) return NULL;
++ if (cp->num_of_text_items > MAX_ITEMS) return NULL;
++
++ g = (struct graph*)malloc(sizeof(struct graph));
++ if (g == NULL) {
++ fprintf(stderr, "failed to allocate memory\n");
++ return NULL;
++ }
++ global_graph = g;
++ g->params = *cp;
++ if (cp->num_of_y_items)
++ memcpy(&g->y_config_array[0], cp->y_config_array,
++ sizeof(struct _y_config) * cp->num_of_y_items);
++ if (cp->num_of_text_items)
++ memcpy(&g->text_config_array[0], cp->text_config_array,
++ sizeof(struct _text_config) * cp->num_of_text_items);
++ d = display_create(&argc, argv);
++ if (d == NULL) {
++ fprintf(stderr, "failed to create display: %m\n");
++ return NULL;
++ }
++ g->display = d;
++ //g->bg_image = load_cairo_surface(cp->bg_image);
++ g->width = cp->width; //cairo_image_surface_get_width(g->bg_image);
++ g->height = cp->height; //cairo_image_surface_get_height(g->bg_image);
++ dataset_size = cp->draw_area.top_right.x - cp->draw_area.bottom_left.x;
++ g->data = (struct graph_data *)malloc(sizeof(struct graph_data) +
++ (dataset_size * sizeof(struct graph_dataset_point)));
++ if (!g->data) {
++ fprintf(stderr, "failed to allocate memory\n");
++ display_destroy(g->display);
++ //cairo_surface_destroy(g->bg_image);
++ free(g);
++ return NULL;
++ }
++ g->data->first_index = 0;
++ g->data->last_index = 0;
++ g->data->num_elems = 0;
++ g->data->dataset_size = dataset_size;
++ g->x_scaling_factor = (double)dataset_size / (double)cp->time_span;
++ g->window = window_create(d);
++ g->widget = window_add_widget(g->window, g);
++ window_set_title(g->window, cp->title);
++ widget_set_resize_handler(g->widget, resize_handler);
++ widget_set_redraw_handler(g->widget, redraw_handler);
++ widget_set_button_handler(g->widget, button_handler);
++ widget_set_default_cursor(g->widget, CURSOR_HAND1);
++ widget_set_touch_down_handler(g->widget, touch_down_handler);
++ window_schedule_resize(g->window, g->width, g->height);
++ g->eventfd = eventfd(0, 0);
++ g->task.run = task_run;
++ g->task.link.prev = (struct wl_list*)g;
++ g->task.link.next = NULL;
++ display_watch_fd(d, g->eventfd, EPOLLIN, &g->task);
++ pthread_mutex_init(&g->mtx, NULL);
++
++ if (0 != pthread_create(&g->thr, NULL, (void *(*)(void *))display_run, (void *)d)) {
++ fprintf(stderr, "pthread_create failed: %m\n");
++ widget_destroy(g->widget);
++ window_destroy(g->window);
++ display_destroy(g->display);
++ //cairo_surface_destroy(g->bg_image);
++ free(g->data);
++ close(g->eventfd);
++ free(g);
++ return NULL;
++ }
++ gettimeofday(&tv, NULL);
++ g->start_time_tv_sec = tv.tv_sec;
++ g->data->last_time = 0;
++ return (void*)g;
++}
++
++void move_graph(void *ctx, struct time_graph_create_params *cp)
++{
++ struct graph *g = ctx;
++ window_set_title(g->window, cp->title);
++}
++
++void time_graph_plot(void *ctx, double *y_values, const char *text_values[])
++{
++ struct timeval tv;
++ struct graph *g = ctx;
++ int i;
++ pthread_mutex_lock(&g->mtx);
++ gettimeofday(&tv, NULL);
++ g->time_now = ((tv.tv_sec - g->start_time_tv_sec) * 1000) + (tv.tv_usec / 1000);
++ memcpy(g->time_graph_y_values, y_values, g->params.num_of_y_items * sizeof(double));
++ for (i=0;i<g->params.num_of_text_items; i++) {
++ strncpy(g->text_values[i], text_values[i], MAX_TEXT_SIZE);
++ g->text_values[i][MAX_TEXT_SIZE-1] = '\0';
++ }
++ pthread_mutex_unlock(&g->mtx);
++ eventfd_write(g->eventfd, (eventfd_t)1);
++}
++
++void time_graph_destroy(void *ctx)
++{
++ struct graph *g = (struct graph *)ctx;
++ display_exit(g->display);
++ eventfd_write(g->eventfd, (eventfd_t)1);
++ pthread_join(g->thr, NULL);
++ widget_destroy(g->widget);
++ window_destroy(g->window);
++ display_destroy(g->display);
++ free(g->data);
++ close(g->eventfd);
++ free(g);
++ global_graph=NULL;
++}
++
++void util_get_cpu_usage(double *cpu_usage)
++{
++ static FILE *fp = NULL;
++ char buf[256];
++ uint64_t tot;
++ uint64_t u, n, s, i, w, x, y, z;
++ static uint64_t last_i = 0, last_total = 0;
++
++
++ if (!fp) {
++ if (!(fp = fopen("/proc/stat", "r")))
++ fprintf(stderr, "Failed /proc/stat open: %s", strerror(errno));
++ }
++ if (fp) {
++ while (1) {
++ rewind(fp);
++ fflush(fp);
++ if (!fgets(buf, sizeof(buf), fp)) {
++ fprintf(stderr, "failed /proc/stat read\n");
++ } else {
++ sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu",
++ &u,
++ &n,
++ &s,
++ &i,
++ &w,
++ &x,
++ &y,
++ &z
++ );
++ if (last_total == 0) {
++ last_total = u+n+s+i+w+x+y+z;
++ last_i = i;
++ usleep(100000);
++ } else {
++ tot = u+n+s+i+w+x+y+z;
++ *cpu_usage = (1.0 - ((double)(i-last_i)/(double)(tot-last_total)));
++ last_i = i;
++ last_total = tot;
++ break;
++ }
++ }
++ }
++ }
++}
++
++void *bar_graph_create(int argc, char *argv[], struct bar_graph_create_params *cp)
++{
++ struct graph *g;
++ struct display *d;
++ struct timeval tv;
++
++ if (cp->num_of_y_items > MAX_ITEMS) return NULL;
++ if (cp->num_of_text_items > MAX_ITEMS) return NULL;
++
++ if (global_graph == NULL) {
++ fprintf(stderr, "graph not initialized invoke time_graph_create first\n");
++ return NULL;
++ }
++ g=global_graph;
++ g->bar_graph_params = *cp;
++ if (cp->num_of_y_items)
++ memcpy(&g->bar_graph_y_config_array[0], cp->y_config_array,
++ sizeof(struct _bar_graph_y_config) * cp->num_of_y_items);
++ if (cp->num_of_text_items)
++ memcpy(&g->bar_graph_text_config_array[0], cp->text_config_array,
++ sizeof(struct _text_config) * cp->num_of_text_items);
++
++ return g;
++}
++
++void bar_graph_plot(void *ctx, double *y_values, const char *text_values[])
++{
++ struct graph *g = ctx;
++ int i;
++ pthread_mutex_lock(&g->mtx);
++ memcpy(g->bar_graph_y_values, y_values, g->bar_graph_params.num_of_y_items * sizeof(double));
++ for (i=0;i<g->bar_graph_params.num_of_text_items; i++) {
++ strncpy(g->bar_graph_text_values[i], text_values[i], MAX_TEXT_SIZE);
++ g->bar_graph_text_values[i][MAX_TEXT_SIZE-1] = '\0';
++ }
++ pthread_mutex_unlock(&g->mtx);
++ //eventfd_write(g->eventfd, (eventfd_t)2);
++}
++
++void bar_graph_destroy(void *ctx)
++{
++ printf("Nothing to be done for this call\n");
++ return;
++}
++
+diff --git a/clients/time_bar_graph.h b/clients/time_bar_graph.h
+new file mode 100644
+index 0000000..97ac05a
+--- /dev/null
++++ b/clients/time_bar_graph.h
+@@ -0,0 +1,93 @@
++
++#ifndef _BAR_GRAPH_H_
++#define _BAR_GRAPH_H_
++
++#include <stdint.h>
++
++struct _rgba {
++ double r, g, b, a; // Values between 0 and 1
++};
++
++struct _coordinate {
++ uint32_t x, y; // Co-ordinates relative to top-left of the window
++};
++
++struct _rect {
++ struct _coordinate bottom_left, top_right;
++};
++
++struct _y_config {
++ struct _rgba line_color; // Line color
++ struct _rgba fill_color; // Fill color, 0 alpha => no fill
++};
++
++struct _text_config {
++ struct _rgba color; // Color for drawing the text, RGBA
++ struct _coordinate at; // where to draw the text
++ int fontsize; // Font size
++};
++
++struct time_graph_create_params {
++ char *title;
++ //const char *bg_image;
++ uint32_t width;
++ uint32_t height;
++ struct _rect draw_area;
++ uint32_t time_span; // Amount of time the graph has to span in milliseconds
++ uint32_t num_of_y_items;
++ struct _y_config *y_config_array;
++ uint32_t num_of_text_items;
++ struct _text_config *text_config_array;
++};
++
++
++struct _bar_graph_y_config {
++ struct _rect region; // Region for the bar graph
++ struct _rgba line_color; // Color for drawing the line, RGBA
++ struct _rgba fill_color; // Fill under the line with color RGBA, 0 => no fill
++};
++
++struct bar_graph_create_params {
++ char *title;
++ //const char *bg_image;
++ uint32_t num_of_y_items;
++ struct _bar_graph_y_config *y_config_array;
++ uint32_t num_of_text_items;
++ struct _text_config *text_config_array;
++};
++
++/* Creates a time graph using create parameters */
++void *bar_graph_create(int argc, char *argv[], struct bar_graph_create_params *cp);
++
++void move_graph(void *ctx, struct time_graph_create_params *cp);
++
++/* Plots a new set of y-values from the values in the array y_values.
++ The number of values must be equal to "num_of_y_items" from create params
++ y_values must be normalized between 0.0 to 1.0
++*/
++void bar_graph_plot(void *ctx, double *y_values, const char *text_values[]);
++
++/* Destroy the graph */
++void bar_graph_destroy(void *ctx);
++
++
++/* Creates a time graph using create parameters */
++void *time_graph_create(int argc, char *argv[], struct time_graph_create_params *cp);
++
++/*
++ * Plots a new set of points from the values in the array y_values.
++ * The number of values in the array y_values must be equal to "num_of_y_items"
++ * from create params
++ * y_values must be normalized between 0.0 to 1.0
++
++ * The number of values in the array text_values must be equal to "num_of_text_items"
++ * from create params
++*/
++void time_graph_plot(void *ctx, double *y_values, const char *text_values[]);
++
++/* Destroy the graph */
++void time_graph_destroy(void *ctx);
++
++void util_get_cpu_usage(double *cpu_usage);
++
++#endif /* _BAR_GRAPH_H_ */
+--
+1.9.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch
new file mode 100644
index 00000000..7801bdd5
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch
@@ -0,0 +1,29 @@
+From 53d7c243ba0baa052081735b8effff4e2679ce65 Mon Sep 17 00:00:00 2001
+From: Kamal Pandey <kamal.pandey@ifm.com>
+Date: Thu, 4 Apr 2019 19:45:45 +0530
+Subject: [PATCH] FIX: weston: clients: typo in simple-dmabuf-egl.c
+
+Fix variable EGL_NO_IMAGE to EGL_NO_IMAGE_KHR in
+clients/simple-dmabuf-egl.c
+
+Signed-off-by: Kamal Pandey <pandeykamal13526@gmail.com>
+---
+ clients/simple-dmabuf-egl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/clients/simple-dmabuf-egl.c b/clients/simple-dmabuf-egl.c
+index 75d880e08..2d99c4709 100644
+--- a/clients/simple-dmabuf-egl.c
++++ b/clients/simple-dmabuf-egl.c
+@@ -293,7 +293,7 @@ create_fbo_for_buffer(struct display *display, struct buffer *buffer)
+ EGL_NO_CONTEXT,
+ EGL_LINUX_DMA_BUF_EXT,
+ NULL, attribs);
+- if (buffer->egl_image == EGL_NO_IMAGE) {
++ if (buffer->egl_image == EGL_NO_IMAGE_KHR) {
+ fprintf(stderr, "EGLImageKHR creation failed\n");
+ return false;
+ }
+--
+2.21.0
+
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch
new file mode 100644
index 00000000..45d4ec7d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch
@@ -0,0 +1,37 @@
+From e8e7a9f7dfa164a75fdbdca87622a2e13334478a Mon Sep 17 00:00:00 2001
+From: Anand Balagopalakrishnan <anandb@ti.com>
+Date: Sat, 23 Jan 2016 22:48:07 +0530
+Subject: [PATCH 1/1] udev-seat: restrict udev enumeration to card0
+
+In case of separate GPU and Display devices as found in embedded systems, we
+could have modeset node and render node controlled by different drivers.
+There is a distinct possibility that udev enumeration returns the DRM device
+corresponding to render node as the primary DRM device.
+
+Obviously, modeset operations cannot be done on the GPU DRM device.
+
+Restrict the udev enumeration to card0 and ensure that DRM device corresponding
+to display is returned as the primary DRM device.
+
+Upstream-Status: Pending
+
+Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
+---
+ libweston/compositor-drm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
+index 6777bf8..59c2cc5 100644
+--- a/libweston/compositor-drm.c
++++ b/libweston/compositor-drm.c
+@@ -2827,7 +2827,7 @@ find_primary_gpu(struct drm_backend *b, const char *seat)
+
+ e = udev_enumerate_new(b->udev);
+ udev_enumerate_add_match_subsystem(e, "drm");
+- udev_enumerate_add_match_sysname(e, "card[0-9]*");
++ udev_enumerate_add_match_sysname(e, "card0");
+
+ udev_enumerate_scan_devices(e);
+ drm_device = NULL;
+--
+1.7.9.5
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch
new file mode 100644
index 00000000..b7f467b4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch
@@ -0,0 +1,31 @@
+From 5b5de6a814b43ca023a92b85b407b3d061dbc64f Mon Sep 17 00:00:00 2001
+From: Eric Ruei <e-ruei1@ti.com>
+Date: Thu, 9 Mar 2017 14:32:24 -0500
+Subject: [PATCH 2/4] Weston: Allow visual_id to be 0
+
+The inquiry of visual id from egl API eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID)
+is an optional feature. The visual id will be set to 0 if this feature is
+not supported. Therefore, the return condition @function match_config_to_visual()
+should be (id == visual_id || id == 0) instead of (id == visual_id)
+
+Signed-off-by: Eric Ruei <e-ruei1@ti.com>
+---
+ libweston/gl-renderer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
+index 23c0cd7..4c1f170 100644
+--- a/libweston/gl-renderer.c
++++ b/libweston/gl-renderer.c
+@@ -2462,7 +2462,7 @@ match_config_to_visual(EGLDisplay egl_display,
+ &id))
+ continue;
+
+- if (id == visual_id)
++ if (id == visual_id || id == 0)
+ return i;
+ }
+
+--
+1.9.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch
new file mode 100644
index 00000000..126d4ed3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch
@@ -0,0 +1,39 @@
+From 0d15218ced5bf2e6f3d05758f0f5f21c2a0303f2 Mon Sep 17 00:00:00 2001
+From: Eric Ruei <e-ruei1@ti.com>
+Date: Thu, 9 Mar 2017 14:33:08 -0500
+Subject: [PATCH 3/4] Weston: Fix virtual keyboard display issue for QT5
+ application
+
+The virtual keyboard does pop up as expected, however, it will never hide
+even when the application is terminated. This problem is due to the order
+of the text APIs( text_input_activate and test_input_show_input_panel) are
+invoked in QT5 and a potential bug of the API implementation. The virtual
+keyboard works as expected if the test_input_show_input_panel() is invoked
+prior to the test_input_activate() as most of the weston sample applications
+do. However, the problem will show up if that order is reversed and the reason
+why is that the current_panel is not set in this case and hence this panel
+cannot be hidden.
+
+It is required to set the current_panel to the text_input when the input_panel
+becomes visible at the first time.
+
+Updated for weston 5.0.0 by Scott Murray <scott.murray@konsulko.com>.
+
+Signed-off-by: Eric Ruei <e-ruei1@ti.com>
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+ compositor/text-backend.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/compositor/text-backend.c b/compositor/text-backend.c
+index 664c36f7..b610dfb1 100644
+--- a/compositor/text-backend.c
++++ b/compositor/text-backend.c
+@@ -349,6 +349,7 @@ text_input_show_input_panel(struct wl_client *client,
+ text_input->surface);
+ wl_signal_emit(&ec->update_input_panel_signal,
+ &text_input->cursor_rectangle);
++ text_input->manager->current_text_input = text_input;
+ }
+ }
+
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch
new file mode 100644
index 00000000..ba20551e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch
@@ -0,0 +1,36 @@
+From 8958bf21960a475d2933e688d0da9a0d2186d509 Mon Sep 17 00:00:00 2001
+From: Eric Ruei <e-ruei1@ti.com>
+Date: Thu, 9 Mar 2017 14:34:18 -0500
+Subject: [PATCH 4/4] Weston: Fix touch screen crash issue
+
+Touch screen operation causes the weston to crash with segment fault sometimes.
+The crash occurs when the coordinate (x,y) passed to the weston input module
+is outside the view window, hence the weston compositor is not able to pick
+up a display view and there is no code to detect this condition at function
+notify_touch().
+
+Signed-off-by: Eric Ruei <e-ruei1@ti.com>
+---
+ libweston/input.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libweston/input.c b/libweston/input.c
+index 8fe898c..0f72d23 100644
+--- a/libweston/input.c
++++ b/libweston/input.c
+@@ -1848,6 +1848,12 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
+ * until all touch points are up again. */
+ if (touch->num_tp == 1) {
+ ev = weston_compositor_pick_view(ec, x, y, &sx, &sy);
++ if (!ev)
++ {
++ weston_log("notify_touch: weston_compositor_pick_view(%d, %d) failed to find a view!\n",
++ wl_fixed_to_int(x), wl_fixed_to_int(y));
++ return;
++ }
+ weston_touch_set_focus(touch, ev);
+ } else if (!touch->focus) {
+ /* Unexpected condition: We have non-initial touch but
+--
+1.9.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend
new file mode 100644
index 00000000..5d27bb8e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend
@@ -0,0 +1,25 @@
+# When configured for fbdev compositor, make it the default
+PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor WESTON_NATIVE_BACKEND="fbdev-backend.so",--disable-fbdev-compositor,udev mtdev"
+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev libgbm mtdev"
+
+PR_append = ".agl_arago_23"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+RDEPENDS_${PN} += "weston-conf"
+
+####################### F I X M E ##########################
+DISABLED_SRC_URI += " \
+ file://0001-Add-soc-performance-monitor-utilites.patch \
+"
+####################### F I X M E ##########################
+
+SRC_URI += " \
+ file://0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch \
+ file://0002-Weston-Allow-visual_id-to-be-0.patch \
+ file://0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \
+ file://0004-Weston-Fix-touch-screen-crash-issue.patch \
+"
+
+
+RDEPENDS_${PN}_remove = "weston-conf"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state.bbappend
new file mode 100644
index 00000000..3b2b8beb
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend_dra7xx-evm := "${THISDIR}/${PN}:"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state/asound.state b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644
index 00000000..fe3ce679
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/alsa-state/alsa-state/asound.state
@@ -0,0 +1,1347 @@
+state.DRA7xxEVM {
+ control.1 {
+ iface MIXER
+ name 'Left Line Mixer Line2R Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.2 {
+ iface MIXER
+ name 'Right Line Mixer Line2L Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.3 {
+ iface MIXER
+ name 'Left HP Mixer Line2R Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.4 {
+ iface MIXER
+ name 'Right HP Mixer Line2L Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.5 {
+ iface MIXER
+ name 'Left HPCOM Mixer Line2R Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.6 {
+ iface MIXER
+ name 'Right HPCOM Mixer Line2L Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.7 {
+ iface MIXER
+ name 'Line Line2 Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.8 {
+ iface MIXER
+ name 'HP Line2 Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.9 {
+ iface MIXER
+ name 'HPCOM Line2 Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.10 {
+ iface MIXER
+ name 'Mono Line2 Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.11 {
+ iface MIXER
+ name 'Mono PGA Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.12 {
+ iface MIXER
+ name 'Mono DAC Playback Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.13 {
+ iface MIXER
+ name 'Mono Playback Switch'
+ value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.14 {
+ iface MIXER
+ name 'PCM Playback Volume'
+ value.0 127
+ value.1 127
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 127'
+ dbmin -6350
+ dbmax 0
+ dbvalue.0 0
+ dbvalue.1 0
+ }
+ }
+ control.15 {
+ iface MIXER
+ name 'Left Line Mixer PGAR Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.16 {
+ iface MIXER
+ name 'Left Line Mixer DACR1 Playback Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.17 {
+ iface MIXER
+ name 'Right Line Mixer PGAL Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.18 {
+ iface MIXER
+ name 'Right Line Mixer DACL1 Playback Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.19 {
+ iface MIXER
+ name 'Left HP Mixer PGAR Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.20 {
+ iface MIXER
+ name 'Left HP Mixer DACR1 Playback Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.21 {
+ iface MIXER
+ name 'Right HP Mixer PGAL Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.22 {
+ iface MIXER
+ name 'Right HP Mixer DACL1 Playback Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.23 {
+ iface MIXER
+ name 'Left HPCOM Mixer PGAR Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.24 {
+ iface MIXER
+ name 'Left HPCOM Mixer DACR1 Playback Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.25 {
+ iface MIXER
+ name 'Right HPCOM Mixer PGAL Bypass Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.26 {
+ iface MIXER
+ name 'Right HPCOM Mixer DACL1 Playback Volume'
+ value 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ }
+ }
+ control.27 {
+ iface MIXER
+ name 'Line PGA Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.28 {
+ iface MIXER
+ name 'Line DAC Playback Volume'
+ value.0 118
+ value.1 118
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 0
+ dbvalue.1 0
+ }
+ }
+ control.29 {
+ iface MIXER
+ name 'HP PGA Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.30 {
+ iface MIXER
+ name 'HP DAC Playback Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.31 {
+ iface MIXER
+ name 'HPCOM PGA Bypass Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.32 {
+ iface MIXER
+ name 'HPCOM DAC Playback Volume'
+ value.0 71
+ value.1 71
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 118'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2350
+ dbvalue.1 -2350
+ }
+ }
+ control.33 {
+ iface MIXER
+ name 'Line Playback Switch'
+ value.0 true
+ value.1 true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.34 {
+ iface MIXER
+ name 'HP Playback Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.35 {
+ iface MIXER
+ name 'HPCOM Playback Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.36 {
+ iface MIXER
+ name 'AGC Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.37 {
+ iface MIXER
+ name 'Left AGC Target level'
+ value '-5.5dB'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '-5.5dB'
+ item.1 '-8dB'
+ item.2 '-10dB'
+ item.3 '-12dB'
+ item.4 '-14dB'
+ item.5 '-17dB'
+ item.6 '-20dB'
+ item.7 '-24dB'
+ }
+ }
+ control.38 {
+ iface MIXER
+ name 'Right AGC Target level'
+ value '-5.5dB'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '-5.5dB'
+ item.1 '-8dB'
+ item.2 '-10dB'
+ item.3 '-12dB'
+ item.4 '-14dB'
+ item.5 '-17dB'
+ item.6 '-20dB'
+ item.7 '-24dB'
+ }
+ }
+ control.39 {
+ iface MIXER
+ name 'Left AGC Attack time'
+ value '8ms'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '8ms'
+ item.1 '11ms'
+ item.2 '16ms'
+ item.3 '20ms'
+ }
+ }
+ control.40 {
+ iface MIXER
+ name 'Right AGC Attack time'
+ value '8ms'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '8ms'
+ item.1 '11ms'
+ item.2 '16ms'
+ item.3 '20ms'
+ }
+ }
+ control.41 {
+ iface MIXER
+ name 'Left AGC Decay time'
+ value '100ms'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '100ms'
+ item.1 '200ms'
+ item.2 '400ms'
+ item.3 '500ms'
+ }
+ }
+ control.42 {
+ iface MIXER
+ name 'Right AGC Decay time'
+ value '100ms'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '100ms'
+ item.1 '200ms'
+ item.2 '400ms'
+ item.3 '500ms'
+ }
+ }
+ control.43 {
+ iface MIXER
+ name 'De-emphasis Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.44 {
+ iface MIXER
+ name 'PGA Capture Volume'
+ value.0 79
+ value.1 79
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 119'
+ dbmin 0
+ dbmax 5950
+ dbvalue.0 3950
+ dbvalue.1 3950
+ }
+ }
+ control.45 {
+ iface MIXER
+ name 'PGA Capture Switch'
+ value.0 true
+ value.1 true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.46 {
+ iface MIXER
+ name 'ADC HPF Cut-off'
+ value.0 Disabled
+ value.1 Disabled
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 2
+ item.0 Disabled
+ item.1 '0.0045xFs'
+ item.2 '0.0125xFs'
+ item.3 '0.025xFs'
+ }
+ }
+ control.47 {
+ iface MIXER
+ name 'Output Driver Power-On time'
+ value '0us'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '0us'
+ item.1 '10us'
+ item.2 '100us'
+ item.3 '1ms'
+ item.4 '10ms'
+ item.5 '50ms'
+ item.6 '100ms'
+ item.7 '200ms'
+ item.8 '400ms'
+ item.9 '800ms'
+ item.10 '2s'
+ item.11 '4s'
+ }
+ }
+ control.48 {
+ iface MIXER
+ name 'Output Driver Ramp-up step'
+ value '0ms'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '0ms'
+ item.1 '1ms'
+ item.2 '2ms'
+ item.3 '4ms'
+ }
+ }
+ control.49 {
+ iface MIXER
+ name 'Left DAC Mux'
+ value DAC_L1
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 DAC_L1
+ item.1 DAC_L3
+ item.2 DAC_L2
+ }
+ }
+ control.50 {
+ iface MIXER
+ name 'Left HPCOM Mux'
+ value 'differential of HPLOUT'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'differential of HPLOUT'
+ item.1 'constant VCM'
+ item.2 single-ended
+ }
+ }
+ control.51 {
+ iface MIXER
+ name 'Right DAC Mux'
+ value DAC_R1
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 DAC_R1
+ item.1 DAC_R3
+ item.2 DAC_R2
+ }
+ }
+ control.52 {
+ iface MIXER
+ name 'Right HPCOM Mux'
+ value 'differential of HPROUT'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'differential of HPROUT'
+ item.1 'constant VCM'
+ item.2 single-ended
+ item.3 'differential of HPLCOM'
+ item.4 'external feedback'
+ }
+ }
+ control.53 {
+ iface MIXER
+ name 'Left Line1L Mux'
+ value single-ended
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 single-ended
+ item.1 differential
+ }
+ }
+ control.54 {
+ iface MIXER
+ name 'Left Line1R Mux'
+ value single-ended
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 single-ended
+ item.1 differential
+ }
+ }
+ control.55 {
+ iface MIXER
+ name 'Right Line1L Mux'
+ value single-ended
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 single-ended
+ item.1 differential
+ }
+ }
+ control.56 {
+ iface MIXER
+ name 'Right Line1R Mux'
+ value single-ended
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 single-ended
+ item.1 differential
+ }
+ }
+ control.57 {
+ iface MIXER
+ name 'Left PGA Mixer Line1L Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.58 {
+ iface MIXER
+ name 'Left PGA Mixer Line1R Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.59 {
+ iface MIXER
+ name 'Left PGA Mixer Line2L Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.60 {
+ iface MIXER
+ name 'Left PGA Mixer Mic3L Switch'
+ value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.61 {
+ iface MIXER
+ name 'Left PGA Mixer Mic3R Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.62 {
+ iface MIXER
+ name 'Left Line2L Mux'
+ value single-ended
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 single-ended
+ item.1 differential
+ }
+ }
+ control.63 {
+ iface MIXER
+ name 'Right PGA Mixer Line1R Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.64 {
+ iface MIXER
+ name 'Right PGA Mixer Line1L Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.65 {
+ iface MIXER
+ name 'Right PGA Mixer Line2R Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.66 {
+ iface MIXER
+ name 'Right PGA Mixer Mic3L Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.67 {
+ iface MIXER
+ name 'Right PGA Mixer Mic3R Switch'
+ value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.68 {
+ iface MIXER
+ name 'Right Line2R Mux'
+ value single-ended
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 single-ended
+ item.1 differential
+ }
+ }
+ control.69 {
+ iface MIXER
+ name 'Left Line Mixer PGAL Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.70 {
+ iface MIXER
+ name 'Left Line Mixer DACL1 Switch'
+ value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.71 {
+ iface MIXER
+ name 'Left Line Mixer PGAR Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.72 {
+ iface MIXER
+ name 'Left Line Mixer DACR1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.73 {
+ iface MIXER
+ name 'Left Line Mixer Line2L Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.74 {
+ iface MIXER
+ name 'Left Line Mixer Line2R Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.75 {
+ iface MIXER
+ name 'Right Line Mixer PGAL Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.76 {
+ iface MIXER
+ name 'Right Line Mixer DACL1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.77 {
+ iface MIXER
+ name 'Right Line Mixer PGAR Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.78 {
+ iface MIXER
+ name 'Right Line Mixer DACR1 Switch'
+ value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.79 {
+ iface MIXER
+ name 'Right Line Mixer Line2L Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.80 {
+ iface MIXER
+ name 'Right Line Mixer Line2R Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.81 {
+ iface MIXER
+ name 'Left HP Mixer PGAL Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.82 {
+ iface MIXER
+ name 'Left HP Mixer DACL1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.83 {
+ iface MIXER
+ name 'Left HP Mixer PGAR Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.84 {
+ iface MIXER
+ name 'Left HP Mixer DACR1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.85 {
+ iface MIXER
+ name 'Left HP Mixer Line2L Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.86 {
+ iface MIXER
+ name 'Left HP Mixer Line2R Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.87 {
+ iface MIXER
+ name 'Right HP Mixer PGAL Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.88 {
+ iface MIXER
+ name 'Right HP Mixer DACL1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.89 {
+ iface MIXER
+ name 'Right HP Mixer PGAR Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.90 {
+ iface MIXER
+ name 'Right HP Mixer DACR1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.91 {
+ iface MIXER
+ name 'Right HP Mixer Line2L Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.92 {
+ iface MIXER
+ name 'Right HP Mixer Line2R Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.93 {
+ iface MIXER
+ name 'Left HPCOM Mixer PGAL Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.94 {
+ iface MIXER
+ name 'Left HPCOM Mixer DACL1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.95 {
+ iface MIXER
+ name 'Left HPCOM Mixer PGAR Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.96 {
+ iface MIXER
+ name 'Left HPCOM Mixer DACR1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.97 {
+ iface MIXER
+ name 'Left HPCOM Mixer Line2L Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.98 {
+ iface MIXER
+ name 'Left HPCOM Mixer Line2R Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.99 {
+ iface MIXER
+ name 'Right HPCOM Mixer PGAL Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.100 {
+ iface MIXER
+ name 'Right HPCOM Mixer DACL1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.101 {
+ iface MIXER
+ name 'Right HPCOM Mixer PGAR Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.102 {
+ iface MIXER
+ name 'Right HPCOM Mixer DACR1 Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.103 {
+ iface MIXER
+ name 'Right HPCOM Mixer Line2L Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.104 {
+ iface MIXER
+ name 'Right HPCOM Mixer Line2R Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.105 {
+ iface MIXER
+ name 'Mono Mixer Line2L Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.106 {
+ iface MIXER
+ name 'Mono Mixer PGAL Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.107 {
+ iface MIXER
+ name 'Mono Mixer DACL1 Switch'
+ value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.108 {
+ iface MIXER
+ name 'Mono Mixer Line2R Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.109 {
+ iface MIXER
+ name 'Mono Mixer PGAR Bypass Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.110 {
+ iface MIXER
+ name 'Mono Mixer DACR1 Switch'
+ value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+}
+state.H58040000encode {
+ control {
+ }
+}
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend
new file mode 100644
index 00000000..1fc5130f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend
@@ -0,0 +1,3 @@
+# We need to override some of the build in defaults and the recipe is very
+# strict in how it grabs the correct compiler. Pass in our override here.
+TOOLCHAIN_OPTIONS += "${SECURITY_NOPIE_CFLAGS}"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km/add-AGL-toolchain-config.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km/add-AGL-toolchain-config.patch
new file mode 100644
index 00000000..9fdd95b4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km/add-AGL-toolchain-config.patch
@@ -0,0 +1,12 @@
+diff --git a/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-agl-linux-gnueabi.mk b/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-agl-linux-gnueabi.mk
+new file mode 100644
+index 0000000..2abaa9f
+--- /dev/null
++++ b/eurasia_km/eurasiacon/build/linux2/config/compilers/arm-agl-linux-gnueabi.mk
+@@ -0,0 +1,6 @@
++# 32-bit ARM hard float compiler
++ifeq ($(MULTIARCH),1)
++ TARGET_SECONDARY_ARCH := target_armhf
++else
++ TARGET_PRIMARY_ARCH := target_armhf
++endif
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km_%.bbappend
new file mode 100644
index 00000000..182f6cac
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/ti-sgx-ddk-km/ti-sgx-ddk-km_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://add-AGL-toolchain-config.patch"
+SRCREV = "16961a3f4524b653fba99d949d6972c77c7d2701"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt
new file mode 100755
index 00000000..79f3d1ff
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt
@@ -0,0 +1 @@
+fdtfile=dra7-evm-lcd-osd101t2045.dtb
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend
new file mode 100644
index 00000000..d1b9b270
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend
@@ -0,0 +1,16 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR_append = "_agl"
+
+SRC_URI += " file://${UBOOT_ENV_BINARY}"
+
+UBOOT_ENV = "uEnv"
+
+do_deploy_append () {
+ if [ "x${UBOOT_ENV}" != "x" ]
+ then
+ install ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
+ ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
+ fi
+}
+
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/gbm/libgbm_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/gbm/libgbm_%.bbappend
new file mode 100644
index 00000000..7a16fbfe
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/gbm/libgbm_%.bbappend
@@ -0,0 +1,2 @@
+# Hotfix for rpm metadata clash with ti-sgx-ddk-um-dev
+DIRFILES = "1"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um/pvr.service b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um/pvr.service
new file mode 100644
index 00000000..1acb94fd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um/pvr.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=PVR service
+SourcePath=/etc/ti-sgx/rc.pvr
+DefaultDependencies=no
+Before=psplash-start.service
+
+[Service]
+Type=forking
+Restart=no
+TimeoutSec=5min
+IgnoreSIGPIPE=no
+KillMode=process
+GuessMainPID=no
+RemainAfterExit=yes
+ExecStart=/etc/ti-sgx/rc.pvr start
+ExecStop=/etc/ti-sgx/rc.pvr stop
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um_%.bbappend
new file mode 100644
index 00000000..fe93f1a6
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/libgles/ti-sgx-ddk-um_%.bbappend
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+FILES_${PN} += "/etc/ti-sgx/"
+
+SRC_URI_append = "\
+ file://pvr.service \
+"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "pvr.service"
+
+do_install_append() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0755 ${WORKDIR}/pvr.service ${D}${systemd_system_unitdir}
+ install -d ${D}/etc/ti-sgx
+ install -m 0755 ${D}/etc/init.d/rc.pvr ${D}/etc/ti-sgx
+}
+
+
+# Fix for rpm metadata clash with libgbm-dev
+DIRFILES = "1"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend
new file mode 100644
index 00000000..a5a69513
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend
@@ -0,0 +1,7 @@
+# Remove GBM support from Mesa
+# TI Platforms provides own GBM library
+
+PACKAGES_remove = "libgbm"
+PACKAGES_remove = "libgbm-dev"
+
+EXTRA_OECONF_remove = "--enable-gbm"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 00000000..684031ea
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+# While we could have a panel attached to HDMI, we only use the default
+# panel isntead.
+SRC_URI_remove_dra7xx-evm = "file://hdmi-a-1-270.cfg"
+# Our DPI panel shows up as "UNNAMED-1"
+SRC_URI_append_dra7xx-evm = " file://unnamed.cfg"
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf/unnamed.cfg b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf/unnamed.cfg
new file mode 100644
index 00000000..29544932
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-graphics/wayland/weston-ini-conf/unnamed.cfg
@@ -0,0 +1,3 @@
+[output]
+name=UNNAMED-1
+transform=270
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/dcan2_pinmux_enable.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/dcan2_pinmux_enable.patch
new file mode 100644
index 00000000..6c54c5ee
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/dcan2_pinmux_enable.patch
@@ -0,0 +1,39 @@
+diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
+index 35424da..08fca09 100644
+--- a/arch/arm/boot/dts/dra7-evm.dts
++++ b/arch/arm/boot/dts/dra7-evm.dts
+@@ -243,6 +243,20 @@
+ DRA7XX_CORE_IOPAD(0x380c, PIN_INPUT | MUX_MODE1) /* i2c2_scl.hdmi1_ddc_sda */
+ >;
+ };
++ dcan2_pins_default: dcan2_pins_default {
++ pinctrl-single,pins = <
++ DRA7XX_CORE_IOPAD(0x3688, PIN_OUTPUT_PULLUP | MUX_MODE2) /* gpio6_14.dcan2_tx */
++ DRA7XX_CORE_IOPAD(0x368C, PIN_INPUT_PULLUP | MUX_MODE2) /* gpio6_15.dcan2_rx */
++ >;
++ };
++
++ dcan2_pins_sleep: dcan2_pins_sleep {
++ pinctrl-single,pins = <
++ DRA7XX_CORE_IOPAD(0x3688, MUX_MODE15 | PULL_UP) /* gpio6_14.dcan2_tx.off */
++ DRA7XX_CORE_IOPAD(0x368C, MUX_MODE15 | PULL_UP) /* gpio6_15.dcan2_rx.off */
++ >;
++ };
++
+ };
+
+ &i2c1 {
+@@ -703,6 +717,13 @@
+ memory-region = <&ipu1_memory_region>;
+ };
+
++&dcan2 {
++ status = "ok";
++ pinctrl-names = "default", "sleep";
++ pinctrl-0 = <&dcan2_pins_default>;
++ pinctrl-1 = <&dcan2_pins_sleep>;
++};
++
+ &dsp1 {
+ status = "okay";
+ memory-region = <&dsp1_memory_region>;
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend
new file mode 100644
index 00000000..2f6c449b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend
@@ -0,0 +1,11 @@
+require recipes-kernel/linux/linux-agl.inc
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+#-------------------------------------------------------------------------
+# patches for enabling dcan2 and fix dcan1 & dcan2 adresses
+
+SRC_URI += " \
+ file://dcan2_pinmux_enable.patch \
+"
+
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio/dra7xx-evm-set-default-sink-source.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio/dra7xx-evm-set-default-sink-source.patch
new file mode 100644
index 00000000..d45c5ef5
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio/dra7xx-evm-set-default-sink-source.patch
@@ -0,0 +1,15 @@
+--- pulseaudio-9.0/src/daemon/default.pa.in.orig 2017-08-04 00:07:08.833004893 +0300
++++ pulseaudio-9.0/src/daemon/default.pa.in 2017-08-04 00:09:18.045102067 +0300
+@@ -162,8 +162,10 @@
+ ])dnl
+
+ ### Make some devices default
+-#set-default-sink output
+-#set-default-source input
++# DRA7xx-EVM CPU Board Line-Out/Headphone
++set-default-sink alsa_output.platform-sound0.analog-stereo
++# DRA7xx-EVM CPU Board Microphone/Line-In
++set-default-source alsa_input.platform-sound0.analog-stereo
+
+ .ifexists module-router.so
+ load-module module-router
diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
new file mode 100644
index 00000000..37c4179e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/pulseaudio:"
+
+################### F I X M E ####################
+# FIXME pyro
+DISABLED_SRC_URI += " \
+ file://dra7xx-evm-set-default-sink-source.patch \
+"
diff --git a/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
new file mode 100644
index 00000000..5172fdd3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
@@ -0,0 +1,41 @@
+From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001
+From: Anton Gerasimov <anton@advancedtelematic.com>
+Date: Thu, 15 Sep 2016 17:52:41 +0200
+Subject: [PATCH 1/2] Set up environment for OSTree integration
+
+---
+ include/configs/qemu-x86.h | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h
+index 78c296f..79df455 100644
+--- a/include/configs/qemu-x86.h
++++ b/include/configs/qemu-x86.h
+@@ -74,4 +74,24 @@
+ #undef CONFIG_ENV_IS_IN_SPI_FLASH
+ #define CONFIG_ENV_IS_NOWHERE
+
++#undef CONFIG_BOOTARGS
++#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0"
++
++#undef CONFIG_BOOTDELAY
++#define CONFIG_BOOTDELAY 3
++
++#undef CONFIG_BOOTCOMMAND
++#define CONFIG_BOOTCOMMAND "run loadenv;" \
++ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \
++ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \
++ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \
++ "zboot $loadaddr - $ramdiskaddr $filesize"
++
++#undef CONFIG_EXTRA_ENV_SETTINGS
++#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \
++ "ramdisk_image=/initrd\0" \
++ "ramdiskaddr=0x4000000\0" \
++ "bootdelay=3\0" \
++ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;"
++
+ #endif /* __CONFIG_H */
+--
+2.9.3
+
diff --git a/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch
new file mode 100644
index 00000000..df1f786c
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch
@@ -0,0 +1,86 @@
+From ba619c7ec7820e80d1b5b520440fdb81c31c0baf Mon Sep 17 00:00:00 2001
+From: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Date: Fri, 14 Oct 2016 09:03:11 +0200
+Subject: [PATCH] fix gcc6 build
+
+Signed-off-by: ronan <ronan@linux-pgnz.suse>
+---
+ include/linux/compiler-gcc6.h | 66 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+ create mode 100644 include/linux/compiler-gcc6.h
+
+diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h
+new file mode 100644
+index 0000000..a3d00d8
+--- /dev/null
++++ b/include/linux/compiler-gcc6.h
+@@ -0,0 +1,66 @@
++#ifndef __LINUX_COMPILER_H
++#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
++#endif
++
++#define __used __attribute__((__used__))
++#define __must_check __attribute__((warn_unused_result))
++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
++
++/* Mark functions as cold. gcc will assume any path leading to a call
++ to them will be unlikely. This means a lot of manual unlikely()s
++ are unnecessary now for any paths leading to the usual suspects
++ like BUG(), printk(), panic() etc. [but let's keep them for now for
++ older compilers]
++
++ Early snapshots of gcc 4.3 don't support this and we can't detect this
++ in the preprocessor, but we can live with this because they're unreleased.
++ Maketime probing would be overkill here.
++
++ gcc also has a __attribute__((__hot__)) to move hot functions into
++ a special section, but I don't see any sense in this right now in
++ the kernel context */
++#define __cold __attribute__((__cold__))
++
++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
++
++#ifndef __CHECKER__
++# define __compiletime_warning(message) __attribute__((warning(message)))
++# define __compiletime_error(message) __attribute__((error(message)))
++#endif /* __CHECKER__ */
++
++/*
++ * Mark a position in code as unreachable. This can be used to
++ * suppress control flow warnings after asm blocks that transfer
++ * control elsewhere.
++ *
++ * Early snapshots of gcc 4.5 don't support this and we can't detect
++ * this in the preprocessor, but we can live with this because they're
++ * unreleased. Really, we need to have autoconf for the kernel.
++ */
++#define unreachable() __builtin_unreachable()
++
++/* Mark a function definition as prohibited from being cloned. */
++#define __noclone __attribute__((__noclone__))
++
++/*
++ * Tell the optimizer that something else uses this function or variable.
++ */
++#define __visible __attribute__((externally_visible))
++
++/*
++ * GCC 'asm goto' miscompiles certain code sequences:
++ *
++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
++ *
++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
++ * Fixed in GCC 4.8.2 and later versions.
++ *
++ * (asm goto is automatically volatile - the naming reflects this.)
++ */
++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
++
++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
++#define __HAVE_BUILTIN_BSWAP32__
++#define __HAVE_BUILTIN_BSWAP64__
++#define __HAVE_BUILTIN_BSWAP16__
++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
+--
+2.6.6
+
diff --git a/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
new file mode 100644
index 00000000..7540b746
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
@@ -0,0 +1,138 @@
+From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001
+From: Anton Gerasimov <anton@advancedtelematic.com>
+Date: Thu, 15 Sep 2016 16:49:32 +0200
+Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on
+ multilib
+
+---
+ arch/x86/config.mk | 2 --
+ arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++---------
+ 2 files changed, 87 insertions(+), 19 deletions(-)
+
+diff --git a/arch/x86/config.mk b/arch/x86/config.mk
+index 999143e..139576e 100644
+--- a/arch/x86/config.mk
++++ b/arch/x86/config.mk
+@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
+ PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386
+
+ LDFLAGS_FINAL += --gc-sections -pie
+-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
+-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
+diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c
+index 497ad75..c321b11 100644
+--- a/arch/x86/lib/gcc.c
++++ b/arch/x86/lib/gcc.c
+@@ -19,22 +19,92 @@
+
+ #ifdef __GNUC__
+
+-/*
+- * GCC's libgcc handling is quite broken. While the libgcc functions
+- * are always regparm(0) the code that calls them uses whatever the
+- * compiler call specifies. Therefore we need a wrapper around those
+- * functions. See gcc bug PR41055 for more information.
+- */
+-#define WRAP_LIBGCC_CALL(type, name) \
+- type __normal_##name(type a, type b) __attribute__((regparm(0))); \
+- type __wrap_##name(type a, type b); \
+- type __attribute__((no_instrument_function)) \
+- __wrap_##name(type a, type b) \
+- { return __normal_##name(a, b); }
+-
+-WRAP_LIBGCC_CALL(long long, __divdi3)
+-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3)
+-WRAP_LIBGCC_CALL(long long, __moddi3)
+-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3)
++#include <stdint.h>
++#include <stddef.h>
++
++uint64_t __udivmoddi4 ( uint64_t num,
++ uint64_t den,
++ uint64_t *rem_p )
++{
++ uint64_t quot = 0, qbit = 1;
++
++ if ( den == 0 ) {
++ return 1/((unsigned)den); /* Intentional divide by zero, without
++ triggering a compiler warning which
++ would abort the build */
++ }
++
++ /* Left-justify denominator and count shift */
++ while ( (int64_t)den >= 0 ) {
++ den <<= 1;
++ qbit <<= 1;
++ }
++
++ while ( qbit ) {
++ if ( den <= num ) {
++ num -= den;
++ quot += qbit;
++ }
++ den >>= 1;
++ qbit >>= 1;
++ }
++
++ if ( rem_p )
++ *rem_p = num;
++
++ return quot;
++}
++uint64_t __udivdi3( uint64_t num, uint64_t den )
++{
++ return __udivmoddi4(num, den, NULL);
++}
++
++uint64_t __umoddi3 ( uint64_t num, uint64_t den )
++{
++ uint64_t v;
++
++ (void) __udivmoddi4(num, den, &v);
++ return v;
++}
++
++int64_t __divmoddi4 ( int64_t num,
++ int64_t den,
++ int64_t* rem_p )
++{
++ int minus = 0;
++ int64_t v;
++
++ if ( num < 0 ) {
++ num = -num;
++ minus = 1;
++ }
++ if ( den < 0 ) {
++ den = -den;
++ minus ^= 1;
++ }
++
++ v = __udivmoddi4(num, den, (uint64_t *)rem_p);
++ if ( minus ) {
++ v = -v;
++ if ( rem_p )
++ *rem_p = -(*rem_p);
++ }
++
++ return v;
++}
++
++
++int64_t __moddi3 (int64_t num, int64_t den)
++{
++ int64_t v;
++
++ (void) __divmoddi4(num, den, &v);
++ return v;
++}
++
++int64_t __divdi3(int64_t num, int64_t den)
++{
++ return __divmoddi4(num, den, NULL);
++}
+
+ #endif
+--
+2.9.3
+
diff --git a/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-fixup-build-with-gcc7.patch b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-fixup-build-with-gcc7.patch
new file mode 100644
index 00000000..fc7933ea
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-fixup-build-with-gcc7.patch
@@ -0,0 +1,101 @@
+From eea58226f0b604d3047c495985197113838d3a7a Mon Sep 17 00:00:00 2001
+From: Trevor Woerner <twoerner@gmail.com>
+Date: Tue, 20 Jun 2017 13:25:20 -0400
+Subject: [PATCH] fix build for gcc7
+
+| In file included from .../include/linux/compiler.h:54:0,
+| from .../include/uapi/linux/stddef.h:1,
+| from .../include/linux/stddef.h:4,
+| from .../include/uapi/linux/posix_types.h:4,
+| from .../include/uapi/linux/types.h:13,
+| from .../include/linux/types.h:5,
+| from .../include/linux/mod_devicetable.h:11,
+| from .../scripts/mod/devicetable-offsets.c:2:
+| .../include/linux/compiler-gcc.h:121:1: fatal error: linux/compiler-gcc7.h: No such file or directory
+| #include gcc_header(__GNUC__)
+
+Upstream-Status: Pending
+
+Signed-off-by: Trevor Woerner <twoerner@gmail.com>
+Signed-off-by: Fabio Berton <fabio.berton@gmail.com>
+Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
+---
+ include/linux/compiler-gcc7.h | 66 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+ create mode 100644 include/linux/compiler-gcc7.h
+
+diff --git a/include/linux/compiler-gcc7.h b/include/linux/compiler-gcc7.h
+new file mode 100644
+index 0000000..cdd1cc2
+--- /dev/null
++++ b/include/linux/compiler-gcc7.h
+@@ -0,0 +1,66 @@
++#ifndef __LINUX_COMPILER_H
++#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
++#endif
++
++#define __used __attribute__((__used__))
++#define __must_check __attribute__((warn_unused_result))
++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
++
++/* Mark functions as cold. gcc will assume any path leading to a call
++ to them will be unlikely. This means a lot of manual unlikely()s
++ are unnecessary now for any paths leading to the usual suspects
++ like BUG(), printk(), panic() etc. [but let's keep them for now for
++ older compilers]
++
++ Early snapshots of gcc 4.3 don't support this and we can't detect this
++ in the preprocessor, but we can live with this because they're unreleased.
++ Maketime probing would be overkill here.
++
++ gcc also has a __attribute__((__hot__)) to move hot functions into
++ a special section, but I don't see any sense in this right now in
++ the kernel context */
++#define __cold __attribute__((__cold__))
++
++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
++
++#ifndef __CHECKER__
++# define __compiletime_warning(message) __attribute__((warning(message)))
++# define __compiletime_error(message) __attribute__((error(message)))
++#endif /* __CHECKER__ */
++
++/*
++ * Mark a position in code as unreachable. This can be used to
++ * suppress control flow warnings after asm blocks that transfer
++ * control elsewhere.
++ *
++ * Early snapshots of gcc 4.5 don't support this and we can't detect
++ * this in the preprocessor, but we can live with this because they're
++ * unreleased. Really, we need to have autoconf for the kernel.
++ */
++#define unreachable() __builtin_unreachable()
++
++/* Mark a function definition as prohibited from being cloned. */
++#define __noclone __attribute__((__noclone__))
++
++/*
++ * Tell the optimizer that something else uses this function or variable.
++ */
++#define __visible __attribute__((externally_visible))
++
++/*
++ * GCC 'asm goto' miscompiles certain code sequences:
++ *
++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
++ *
++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
++ * Fixed in GCC 4.8.2 and later versions.
++ *
++ * (asm goto is automatically volatile - the naming reflects this.)
++ */
++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
++
++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
++#define __HAVE_BUILTIN_BSWAP32__
++#define __HAVE_BUILTIN_BSWAP64__
++#define __HAVE_BUILTIN_BSWAP16__
++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
+--
+2.7.4
+
diff --git a/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
new file mode 100644
index 00000000..7ef3cacd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
@@ -0,0 +1,29 @@
+include recipes-bsp/u-boot/u-boot.inc
+DEPENDS += "dtc-native"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
+
+# This revision corresponds to the tag "v2015.07"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204"
+
+SRC_URI = "\
+ git://git.denx.de/u-boot.git;branch=master \
+ file://0001-Set-up-environment-for-OSTree-integration.patch \
+ file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \
+ file://0001-fixup-build-with-gcc6.patch \
+ file://0002-fixup-build-with-gcc7.patch \
+"
+S = "${WORKDIR}/git"
+
+PV = "v2015.07+git${SRCPV}"
+
+EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline "
+EXTRA_OEMAKE_append_qemux86 = " BUILD_ROM=y"
+EXTRA_OEMAKE_append_qemux86-64 = " BUILD_ROM=y"
+
+UBOOT_SUFFIX = "bin"
+UBOOT_SUFFIX_qemux86 = "rom"
+UBOOT_SUFFIX_qemux86-64 = "rom"
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch
new file mode 100644
index 00000000..fb574847
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch
@@ -0,0 +1,26 @@
+diff --git a/modules/videoio/src/cap_libv4l.cpp b/modules/videoio/src/cap_libv4l.cpp
+index d82ad43..a3929a6 100644
+--- a/modules/videoio/src/cap_libv4l.cpp
++++ b/modules/videoio/src/cap_libv4l.cpp
+@@ -271,7 +271,7 @@ make & enjoy!
+ #define DEFAULT_V4L_HEIGHT 480
+
+ #define CHANNEL_NUMBER 1
+-#define MAX_CAMERAS 8
++#define MAX_CAMERAS 16
+
+
+ // default and maximum number of V4L buffers, not including last, 'special' buffer
+diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp
+index 37d93cd..6b4321c 100644
+--- a/modules/videoio/src/cap_v4l.cpp
++++ b/modules/videoio/src/cap_v4l.cpp
+@@ -241,7 +241,7 @@ make & enjoy!
+ #define DEFAULT_V4L_FPS 30
+
+ #define CHANNEL_NUMBER 1
+-#define MAX_CAMERAS 8
++#define MAX_CAMERAS 16
+
+
+ // default and maximum number of V4L buffers, not including last, 'special' buffer
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend
new file mode 100644
index 00000000..8a68b064
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+ file://0004-Change-Max-Device-Count-To-16.patch \
+ "
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb
new file mode 100644
index 00000000..ee9e3d43
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Collection of additional Wayland protocols"
+DESCRIPTION = "Wayland protocols that add functionality not \
+available in the Wayland core protocol. Such protocols either add \
+completely new functionality, or extend the functionality of some other \
+protocol either in Wayland core, or some other protocol in \
+wayland-protocols."
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \
+ file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53"
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ "
+SRC_URI[md5sum] = "e0b523ff162e30bab46be1d65d527683"
+SRC_URI[sha256sum] = "6b1485951fdcd36a960c870c46f28b03a3e5121fb46246916333ed07f78c98c5"
+SRC_URI[md5sum] = "55ddd5fdb02b73b9de9559aaec267315"
+SRC_URI[sha256sum] = "df1319cf9705643aea9fd16f9056f4e5b2471bd10c0cc3713d4a4cdc23d6812f"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+
+inherit allarch autotools pkgconfig
+
+PACKAGES = "${PN}"
+FILES_${PN} += "${datadir}/pkgconfig/wayland-protocols.pc"
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb
new file mode 100644
index 00000000..4628f96f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://core.cfg \
+ file://ivishell.cfg \
+ file://id-agent.cfg \
+ file://shell.cfg \
+ file://hdmi-a-1-270.cfg \
+ "
+
+S = "${WORKDIR}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_compile() {
+ # Put all of our cfg files together.
+ rm -f ${WORKDIR}/weston.ini
+ for F in ${WORKDIR}/*.cfg; do
+ cat $F >> ${WORKDIR}/weston.ini
+ echo >> ${WORKDIR}/weston.ini
+ done
+ sed -i -e '$ d' ${WORKDIR}/weston.ini
+}
+
+do_install_append() {
+ WESTON_INI_CONFIG=${sysconfdir}/xdg/weston
+ install -d ${D}${WESTON_INI_CONFIG}
+ install -m 0644 ${WORKDIR}/weston.ini ${D}${WESTON_INI_CONFIG}/weston.ini
+}
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 00000000..00cd35b3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,12 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI += "${@bb.utils.contains("DISTRO_FEATURES", "gst-record", "file://virtualoutput.cfg", "",d)}"
+
+do_configure_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'gst-record', 'true', 'false', d)}; then
+ echo virtual=1 >> ${WORKDIR}/core.cfg
+ fi
+}
+
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg
new file mode 100644
index 00000000..eb5d470e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg
@@ -0,0 +1,5 @@
+[core]
+shell=ivi-shell.so
+backend=drm-backend.so
+require-input=false
+modules=systemd-notify.so,ivi-controller.so
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg
new file mode 100644
index 00000000..dffc2b6d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 270 degrees
+# to have a proper orientation of the homescreen. For example the various sizes
+# of the GeChic display or the Dell display.
+[output]
+name=HDMI-A-1
+transform=270
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg
new file mode 100644
index 00000000..88a692a1
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees
+# to have a proper orientation of the homescreen. For example, the 'eGalax'
+# display used in some instances.
+[output]
+name=HDMI-A-1
+transform=90
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg
new file mode 100644
index 00000000..c8529925
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg
@@ -0,0 +1,3 @@
+[desktop-app-default]
+default-surface-id=2000000
+default-surface-id-max=2001000
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg
new file mode 100644
index 00000000..d0bcb833
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg
@@ -0,0 +1,3 @@
+[ivi-shell]
+ivi-input-module=ivi-input-controller.so
+ivi-id-agent-module=ivi-id-agent.so
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/shell.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/shell.cfg
new file mode 100644
index 00000000..975e539e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/shell.cfg
@@ -0,0 +1,3 @@
+[shell]
+locking=true
+panel-position=none
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg
new file mode 100644
index 00000000..51985127
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg
@@ -0,0 +1,5 @@
+[remote-output]
+name=remote-1
+mode=384x368@30
+host=192.168.20.99
+port=5005
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch
new file mode 100644
index 00000000..0eb3d95a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -0,0 +1,78 @@
+From c4677e155736062e75687f1a655732c8902e912b 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 c05ad01..6da6e04 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -126,6 +126,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+ [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
+ [[#include <time.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 bf73e0d..9064439 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/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
new file mode 100644
index 00000000..d648538b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
@@ -0,0 +1,173 @@
+From b98b9dbda902225cdd972b5bff6a641c36cc7e90 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
+
+weston-launch requires PAM for starting weston as a non-root user.
+
+Since starting weston as root is a valid use case by itself, if
+PAM is not available, provide a default version of weston-launch
+without non-root-user support.
+
+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>
+
+---
+ configure.ac | 9 +++++++--
+ libweston/weston-launch.c | 20 ++++++++++++++++++++
+ 2 files changed, 27 insertions(+), 2 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/weston-launch.c b/libweston/weston-launch.c
+index 166bf3b..6fb9232 100644
+--- a/libweston/weston-launch.c
++++ b/libweston/weston-launch.c
+@@ -51,7 +51,9 @@
+
+ #include <pwd.h>
+ #include <grp.h>
++#ifdef HAVE_PAM
+ #include <security/pam_appl.h>
++#endif
+
+ #ifdef HAVE_SYSTEMD_LOGIN
+ #include <systemd/sd-login.h>
+@@ -101,8 +103,10 @@ drmSetMaster(int drm_fd)
+ #endif
+
+ struct weston_launch {
++#ifdef HAVE_PAM
+ struct pam_conv pc;
+ pam_handle_t *ph;
++#endif
+ int tty;
+ int ttynr;
+ int sock[2];
+@@ -189,6 +193,7 @@ weston_launch_allowed(struct weston_launch *wl)
+ return false;
+ }
+
++#ifdef HAVE_PAM
+ static int
+ pam_conversation_fn(int msg_count,
+ const struct pam_message **messages,
+@@ -229,6 +234,7 @@ setup_pam(struct weston_launch *wl)
+
+ return 0;
+ }
++#endif
+
+ static int
+ setup_launcher_socket(struct weston_launch *wl)
+@@ -422,6 +428,7 @@ quit(struct weston_launch *wl, int status)
+ close(wl->signalfd);
+ close(wl->sock[0]);
+
++#ifdef HAVE_PAM
+ if (wl->new_user) {
+ err = pam_close_session(wl->ph, 0);
+ if (err)
+@@ -429,6 +436,7 @@ quit(struct weston_launch *wl, int status)
+ err, pam_strerror(wl->ph, err));
+ pam_end(wl->ph, err);
+ }
++#endif
+
+ 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)
+ setenv("HOME", wl->pw->pw_dir, 1);
+ setenv("SHELL", wl->pw->pw_shell, 1);
+
++#ifdef HAVE_PAM
+ 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)
+ }
+ free(env);
+ }
++#endif
+
+ /*
+ * We open a new session, so it makes sense
+@@ -683,8 +693,10 @@ static void
+ help(const char *name)
+ {
+ fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
++#ifdef HAVE_PAM
+ fprintf(stderr, " -u, --user Start session as specified username,\n"
+ " e.g. -u joe, requires root.\n");
++#endif
+ 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[])
+ int i, c;
+ char *tty = NULL;
+ struct option opts[] = {
++#ifdef HAVE_PAM
+ { "user", required_argument, NULL, 'u' },
++#endif
+ { "tty", required_argument, NULL, 't' },
+ { "verbose", no_argument, NULL, 'v' },
+ { "help", no_argument, NULL, 'h' },
+@@ -710,9 +724,13 @@ 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");
++#else
++ error(1, 0, "-u is unsupported in this weston-launch build");
++#endif
+ break;
+ case 't':
+ tty = optarg;
+@@ -753,8 +771,10 @@ main(int argc, char *argv[])
+ if (setup_tty(&wl, tty) < 0)
+ exit(EXIT_FAILURE);
+
++#ifdef HAVE_PAM
+ if (wl.new_user && setup_pam(&wl) < 0)
+ exit(EXIT_FAILURE);
++#endif
+
+ if (setup_launcher_socket(&wl) < 0)
+ exit(EXIT_FAILURE);
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop
new file mode 100644
index 00000000..1086ae8b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=Weston
+Comment=Wayland Compostitor
+Exec=weston
+Icon=weston
+Terminal=false
+Categories=Utility;
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.png b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.png
new file mode 100644
index 00000000..ea8b7e0e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.png
Binary files differ
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start
new file mode 100644
index 00000000..b483c97c
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if type Xwayland >/dev/null 2>/dev/null; then
+ mkdir -p /tmp/.X11-unix
+
+ add_weston_argument "--modules=xwayland.so"
+fi
diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb
new file mode 100644
index 00000000..f1e67e31
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb
@@ -0,0 +1,111 @@
+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://0001-make-error-portable.patch \
+ file://xwayland.weston-start \
+ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
+"
+SRC_URI[md5sum] = "752a04ce3c65af4884cfac4e57231bdb"
+SRC_URI[sha256sum] = "15a23423bcfa45e31e1dedc0cd524ba71e2930df174fde9c99b71a537c4e4caf"
+SRC_URI[md5sum] = "7c634e262f8a464a076c97fd50ad36b3"
+SRC_URI[sha256sum] = "546323a90607b3bd7f48809ea9d76e64cd09718102f2deca6d95aa59a882e612"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+
+inherit autotools pkgconfig useradd distro_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_OECONF = "--enable-setuid-install \
+ --disable-rdp-compositor \
+ --enable-autotools \
+ "
+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', 'pam systemd x11', d)} \
+ clients launch"
+#
+# Compositor choices
+#
+# Weston on KMS
+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa virtual/libgbm 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"
+
+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
+}
+
+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}"
+
+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-conf liberation-fonts"
+RRECOMMENDS_${PN}-dev += "wayland-protocols"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system weston-launch"
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/kernel-devsrc.bbappend b/meta-agl/meta-agl-bsp/recipes-kernel/linux/kernel-devsrc.bbappend
new file mode 100644
index 00000000..52fe69d2
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/kernel-devsrc.bbappend
@@ -0,0 +1,6 @@
+# fix for kernel using hardcoded awk while our filesystem only provides gawk
+do_install_append() {
+ # enforce all scripts to use /usr/bin/awk . This fixes the rpm dependency failure on install of kernel-devsrc
+ cd ${D} || true
+ ( for i in `grep -srI "\!/bin/awk" | cut -d":" -f1 ` ; do sed -i -e "s#\!/bin/awk#\!/usr/bin/env awk#g" $i ; done ) || true
+} \ No newline at end of file
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Handle-CGROUP2-in-the-same-way-that-CGROUP.patch b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Handle-CGROUP2-in-the-same-way-that-CGROUP.patch
new file mode 100644
index 00000000..c595dfdf
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Handle-CGROUP2-in-the-same-way-that-CGROUP.patch
@@ -0,0 +1,40 @@
+From 63f5acdf097b7baca8d0f7056a037f8811b48aaa Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
+Date: Tue, 27 Feb 2018 17:06:21 +0100
+Subject: [PATCH] Smack: Handle CGROUP2 in the same way that CGROUP
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The new file system CGROUP2 isn't actually handled
+by smack. This changes makes Smack treat equally
+CGROUP and CGROUP2 items.
+
+Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+---
+ security/smack/smack_lsm.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
+index 03fdecba93bb..5d77ed04422c 100644
+--- a/security/smack/smack_lsm.c
++++ b/security/smack/smack_lsm.c
+@@ -3431,6 +3431,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
+ if (opt_dentry->d_parent == opt_dentry) {
+ switch (sbp->s_magic) {
+ case CGROUP_SUPER_MAGIC:
++ case CGROUP2_SUPER_MAGIC:
+ /*
+ * The cgroup filesystem is never mounted,
+ * so there's no opportunity to set the mount
+@@ -3474,6 +3475,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
+ switch (sbp->s_magic) {
+ case SMACK_MAGIC:
+ case CGROUP_SUPER_MAGIC:
++ case CGROUP2_SUPER_MAGIC:
+ /*
+ * Casey says that it's a little embarrassing
+ * that the smack file system doesn't do
+--
+2.14.3
+
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Privilege-check-on-key-operations.patch b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Privilege-check-on-key-operations.patch
new file mode 100644
index 00000000..4100bb8f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.14/Smack-Privilege-check-on-key-operations.patch
@@ -0,0 +1,109 @@
+Smack: Privilege check on key operations
+
+Operations on key objects are subjected to Smack policy
+even if the process is privileged. This is inconsistent
+with the general behavior of Smack and may cause issues
+with authentication by privileged daemons. This patch
+allows processes with CAP_MAC_OVERRIDE to access keys
+even if the Smack rules indicate otherwise.
+
+Reported-by: Jose Bollo <jobol@nonadev.net>
+Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
+---
+ security/smack/smack.h | 1 +
+ security/smack/smack_access.c | 40 +++++++++++++++++++++++++++++-----------
+ security/smack/smack_lsm.c | 4 ++++
+ 3 files changed, 34 insertions(+), 11 deletions(-)
+
+diff --git a/security/smack/smack.h b/security/smack/smack.h
+index 6a71fc7..f7db791 100644
+--- a/security/smack/smack.h
++++ b/security/smack/smack.h
+@@ -321,6 +321,7 @@ struct smack_known *smk_import_entry(const char *, int);
+ void smk_insert_entry(struct smack_known *skp);
+ struct smack_known *smk_find_entry(const char *);
+ bool smack_privileged(int cap);
++bool smack_privileged_cred(int cap, const struct cred *cred);
+ void smk_destroy_label_list(struct list_head *list);
+
+ /*
+diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
+index 1a30041..141ffac 100644
+--- a/security/smack/smack_access.c
++++ b/security/smack/smack_access.c
+@@ -623,26 +623,24 @@ struct smack_known *smack_from_secid(const u32 secid)
+ LIST_HEAD(smack_onlycap_list);
+ DEFINE_MUTEX(smack_onlycap_lock);
+
+-/*
++/**
++ * smack_privileged_cred - are all privilege requirements met by cred
++ * @cap: The requested capability
++ * @cred: the credential to use
++ *
+ * Is the task privileged and allowed to be privileged
+ * by the onlycap rule.
+ *
+ * Returns true if the task is allowed to be privileged, false if it's not.
+ */
+-bool smack_privileged(int cap)
++bool smack_privileged_cred(int cap, const struct cred *cred)
+ {
+- struct smack_known *skp = smk_of_current();
++ struct task_smack *tsp = cred->security;
++ struct smack_known *skp = tsp->smk_task;
+ struct smack_known_list_elem *sklep;
+ int rc;
+
+- /*
+- * All kernel tasks are privileged
+- */
+- if (unlikely(current->flags & PF_KTHREAD))
+- return true;
+-
+- rc = cap_capable(current_cred(), &init_user_ns, cap,
+- SECURITY_CAP_AUDIT);
++ rc = cap_capable(cred, &init_user_ns, cap, SECURITY_CAP_AUDIT);
+ if (rc)
+ return false;
+
+@@ -662,3 +660,23 @@ bool smack_privileged(int cap)
+
+ return false;
+ }
++
++/**
++ * smack_privileged - are all privilege requirements met
++ * @cap: The requested capability
++ *
++ * Is the task privileged and allowed to be privileged
++ * by the onlycap rule.
++ *
++ * Returns true if the task is allowed to be privileged, false if it's not.
++ */
++bool smack_privileged(int cap)
++{
++ /*
++ * All kernel tasks are privileged
++ */
++ if (unlikely(current->flags & PF_KTHREAD))
++ return true;
++
++ return smack_privileged_cred(cap, current_cred());
++}
+diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
+index 30f2c3d..03fdecb 100644
+--- a/security/smack/smack_lsm.c
++++ b/security/smack/smack_lsm.c
+@@ -4369,6 +4369,10 @@ static int smack_key_permission(key_ref_t key_ref,
+ */
+ if (tkp == NULL)
+ return -EACCES;
++
++ if (smack_privileged_cred(CAP_MAC_OVERRIDE, cred))
++ return 0;
++
+ #ifdef CONFIG_AUDIT
+ smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_KEY);
+ ad.a.u.key_struct.key = keyp->serial;
+
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
new file mode 100644
index 00000000..a1eeac3d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
@@ -0,0 +1,49 @@
+From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
+From: jooseong lee <jooseong.lee@samsung.com>
+Date: Thu, 3 Nov 2016 10:55:43 +0100
+Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
+
+Creating struct sock by sk_alloc function in various kernel subsystems
+like bluetooth dosen't call smack_socket_post_create(). In such case,
+received sock label is the floor('_') label and makes access deny.
+
+Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
+
+Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
+Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
+Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+---
+ security/smack/smack_lsm.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
+index cf8a93f..21651bc 100644
+--- a/security/smack/smack_lsm.c
++++ b/security/smack/smack_lsm.c
+@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
+ if (ssp == NULL)
+ return -ENOMEM;
+
+- ssp->smk_in = skp;
+- ssp->smk_out = skp;
++ /*
++ * Sockets created by kernel threads receive web label.
++ */
++ if (unlikely(current->flags & PF_KTHREAD)) {
++ ssp->smk_in = &smack_known_web;
++ ssp->smk_out = &smack_known_web;
++ } else {
++ ssp->smk_in = skp;
++ ssp->smk_out = skp;
++ }
+ ssp->smk_packet = NULL;
+
+ sk->sk_security = ssp;
+--
+2.7.4
+
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc
new file mode 100644
index 00000000..87249bdc
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-4.14:"
+
+#-------------------------------------------------------------------------
+# smack patches for kernels keys
+
+SRC_URI_append_with-lsm-smack = "\
+ file://Smack-Privilege-check-on-key-operations.patch \
+ file://Smack-Handle-CGROUP2-in-the-same-way-that-CGROUP.patch \
+ "
+
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc
new file mode 100644
index 00000000..c4ebf4d4
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc
@@ -0,0 +1,8 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-4.9:"
+
+#-------------------------------------------------------------------------
+# smack patches for handling bluetooth
+
+SRC_URI_append_with-lsm-smack = "\
+ file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
+ "
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc
new file mode 100644
index 00000000..e8be23c7
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc
@@ -0,0 +1,94 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux:"
+
+DEPENDS += "kern-tools-native"
+
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+ sources=src_patches(d, True)
+ sources_list=[]
+ for s in sources:
+ if s.endswith('.cfg'):
+ sources_list.append(s)
+
+ return sources_list
+
+do_configure_append () {
+ [ ! -f .config ] && cp -a ${WORKDIR}/defconfig .config
+ merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
+ yes '' | make oldconfig
+}
+
+# Extra configuration options for the AGL kernel
+SRC_URI_append = "\
+ file://can-bus.cfg \
+ file://usb.cfg \
+ file://uvc.cfg \
+ file://joystick.cfg \
+ file://fanotify.cfg \
+ file://uinput.cfg \
+ file://hid.cfg \
+ file://drm.cfg \
+ file://btusb.cfg \
+ file://usbaudio.cfg \
+ file://usbmodem.cfg \
+ file://i2c-led.cfg \
+ file://nfc.cfg \
+ "
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg"
+# Enable support for usb video class for usb camera devices
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/uvc.cfg"
+# Enable support for joystick devices
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/joystick.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/fanotify.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/uinput.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/hid.cfg"
+# Enable DRM support for graphics
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/drm.cfg"
+# Enable Bluetooth USB devices
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/btusb.cfg"
+# Enable USB audio devices
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/usbaudio.cfg"
+# Enable I2C and LED for demontrator
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/i2c-led.cfg"
+# Enable NFC devices
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/nfc.cfg"
+
+# Enable required features for the agl-netboot feature
+SRC_URI_append_netboot = " file://nbd.cfg \
+ file://ramdisk.cfg"
+KERNEL_CONFIG_FRAGMENTS_append_netboot = " ${WORKDIR}/nbd.cfg ${WORKDIR}/ramdisk.cfg"
+
+# Enable support for TP-Link TL-W722N USB Wifi adapter
+SRC_URI_append = " file://ath9k_htc.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg"
+
+# Enable support for RTLSDR
+SRC_URI_append = " file://rtl_sdr.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtl_sdr.cfg"
+
+# Additional drivers for virtual machines
+# OVERRIDES save us some c'n'p below ...
+OVERRIDES_prepend_qemux86 = "virtualmachine:"
+OVERRIDES_prepend_qemux86-64 = "virtualmachine:"
+SRC_URI_append_virtualmachine = " file://vbox-vmware-sata.cfg"
+KERNEL_CONFIG_FRAGMENTS_append_virtualmachine = " ${WORKDIR}/vbox-vmware-sata.cfg"
+
+# Enable support for smack
+KERNEL_CONFIG_FRAGMENTS_append_with-lsm-smack = "\
+ ${WORKDIR}/audit.cfg \
+ ${WORKDIR}/smack.cfg \
+ ${WORKDIR}/smack-default-lsm.cfg \
+"
+
+# ALSA support and other sound related configuration
+SRC_URI_append = " file://sound.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/sound.cfg"
+
+# iio-dummy-device support for test iiodevice
+SRC_URI_append = " file://iiodevice.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/iiodevice.cfg"
+
+# external rtc support via e.g. http://wiki.seeedstudio.com/Grove-RTC/
+SRC_URI_append = " file://rtc.cfg"
+KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtc.cfg"
+
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend
new file mode 100644
index 00000000..38611202
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -0,0 +1 @@
+require linux-agl.inc
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg
new file mode 100644
index 00000000..6f7d4988
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg
@@ -0,0 +1,4 @@
+CONFIG_CFG80211=m
+CONFIG_MAC80211=m
+CONFIG_ATH_CARDS=m
+CONFIG_ATH9K_HTC=m
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/btusb.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/btusb.cfg
new file mode 100644
index 00000000..dd7c460b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/btusb.cfg
@@ -0,0 +1,37 @@
+CONFIG_BT=m
+CONFIG_BT_BREDR=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HS=y
+CONFIG_BT_LE=y
+CONFIG_BT_LEDS=y
+# CONFIG_BT_SELFTEST is not set
+CONFIG_BT_DEBUGFS=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_INTEL=m
+CONFIG_BT_BCM=m
+CONFIG_BT_RTL=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTUSB_BCM=y
+CONFIG_BT_HCIBTUSB_RTL=y
+# CONFIG_BT_HCIBTSDIO is not set
+# CONFIG_BT_HCIUART is not set
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBFUSB=m
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_BT_MRVL is not set
+# CONFIG_BT_ATH3K is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CMAC=m
+
+#
+# Bluetooth AVRCP support
+#
+CONFIG_INPUT_UINPUT=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg
new file mode 100644
index 00000000..57e25fc6
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg
@@ -0,0 +1,41 @@
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+# CONFIG_TASK_XACCT is not set
+CONFIG_USER_RETURN_NOTIFIER=y
+CONFIG_PREEMPT_NOTIFIERS=y
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+CONFIG_CAN_GW=m
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_C_CAN=m
+CONFIG_CAN_C_CAN_PLATFORM=m
+CONFIG_CAN_VCAN=m
+CONFIG_CAN_SLCAN=m
+CONFIG_CAN_DEV=m
+CONFIG_CAN_CALC_BITTIMING=y
+# CONFIG_CAN_LEDS is not set
+# CONFIG_CAN_SJA1000 is not set
+# CONFIG_CAN_M_CAN is not set
+# CONFIG_CAN_CC770 is not set
+
+#
+# CAN SPI interfaces
+#
+CONFIG_CAN_MCP251X=m
+
+#
+# CAN USB interfaces
+#
+# CONFIG_CAN_EMS_USB is not set
+CONFIG_CAN_ESD_USB2=m
+CONFIG_CAN_GS_USB=m
+CONFIG_CAN_KVASER_USB=m
+CONFIG_CAN_PEAK_USB=m
+CONFIG_CAN_8DEV_USB=m
+CONFIG_CAN_MCBA_USB=m
+# CONFIG_CAN_SOFTING is not set
+# CONFIG_CAN_DEBUG_DEVICES is not set
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/drm.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/drm.cfg
new file mode 100644
index 00000000..65fe71cd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/drm.cfg
@@ -0,0 +1,2 @@
+CONFIG_DRM_BOCHS=y
+CONFIG_DRM_VIRTIO_GPU=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/fanotify.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/fanotify.cfg
new file mode 100644
index 00000000..de5dd8d3
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/fanotify.cfg
@@ -0,0 +1,3 @@
+# Enable the fanotify API (notification/interception of FS events)
+CONFIG_FANOTIFY=y
+CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/hid.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/hid.cfg
new file mode 100644
index 00000000..327c753a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/hid.cfg
@@ -0,0 +1 @@
+CONFIG_HID_MULTITOUCH=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/i2c-led.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/i2c-led.cfg
new file mode 100644
index 00000000..248b5118
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/i2c-led.cfg
@@ -0,0 +1,3 @@
+# enabling I2C and LED for demonstrator
+CONFIG_I2C_TINY_USB=y
+CONFIG_LEDS_BLINKM=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/iiodevice.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/iiodevice.cfg
new file mode 100644
index 00000000..8633f29a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/iiodevice.cfg
@@ -0,0 +1,25 @@
+#
+# Extcon Device Drivers
+#
+CONFIG_IIO=y
+CONFIG_IIO_BUFFER=y
+CONFIG_IIO_BUFFER_CB=y
+CONFIG_IIO_KFIFO_BUF=y
+CONFIG_IIO_CONFIGFS=m
+CONFIG_IIO_TRIGGER=y
+CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
+CONFIG_IIO_SW_DEVICE=m
+CONFIG_IIO_SW_TRIGGER=m
+
+#
+# IIO dummy driver
+#
+CONFIG_IIO_DUMMY_EVGEN=m
+CONFIG_IIO_SIMPLE_DUMMY=m
+CONFIG_IIO_SIMPLE_DUMMY_EVENTS=y
+CONFIG_IIO_SIMPLE_DUMMY_BUFFER=y
+
+#
+# Triggers - standalone
+#
+CONFIG_IIO_HRTIMER_TRIGGER=m \ No newline at end of file
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/joystick.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/joystick.cfg
new file mode 100644
index 00000000..2201bcb0
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/joystick.cfg
@@ -0,0 +1,9 @@
+CONFIG_INPUT_JOYDEV=y
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ADI=y
+CONFIG_GAMEPORT=y
+CONFIG_HID_LOGITECH=y
+CONFIG_LOGIWHEELS_FF=y
+CONFIG_HID_LOGITECH_HIDPP=y
+CONFIG_LOGITECH_FF=y
+CONFIG_LOGIG940_FF=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nbd.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nbd.cfg
new file mode 100644
index 00000000..af37685e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nbd.cfg
@@ -0,0 +1 @@
+CONFIG_BLK_DEV_NBD=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nfc.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nfc.cfg
new file mode 100644
index 00000000..6d863a07
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/nfc.cfg
@@ -0,0 +1,34 @@
+CONFIG_NFC=m
+CONFIG_NFC_DIGITAL=m
+CONFIG_NFC_NCI=m
+CONFIG_NFC_NCI_SPI=m
+CONFIG_NFC_HCI=m
+CONFIG_NFC_SHDLC=y
+CONFIG_NFC_TRF7970A=m
+CONFIG_NFC_MEI_PHY=m
+CONFIG_NFC_PORT100=m
+CONFIG_NFC_FDP=m
+CONFIG_NFC_FDP_I2C=m
+CONFIG_NFC_PN544=m
+CONFIG_NFC_PN544_I2C=m
+CONFIG_NFC_PN544_MEI=m
+CONFIG_NFC_PN533=m
+CONFIG_NFC_PN533_USB=m
+CONFIG_NFC_PN533_I2C=m
+CONFIG_NFC_MICROREAD=m
+CONFIG_NFC_MICROREAD_I2C=m
+CONFIG_NFC_MICROREAD_MEI=m
+CONFIG_NFC_MRVL=m
+CONFIG_NFC_MRVL_USB=m
+CONFIG_NFC_MRVL_I2C=m
+CONFIG_NFC_MRVL_SPI=m
+CONFIG_NFC_ST21NFCA=m
+CONFIG_NFC_ST21NFCA_I2C=m
+CONFIG_NFC_ST_NCI=m
+CONFIG_NFC_ST_NCI_I2C=m
+CONFIG_NFC_ST_NCI_SPI=m
+CONFIG_NFC_NXP_NCI=m
+CONFIG_NFC_NXP_NCI_I2C=m
+CONFIG_NFC_S3FWRN5=m
+CONFIG_NFC_S3FWRN5_I2C=m
+CONFIG_NFC_ST95HF=m
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/procevent.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/procevent.cfg
new file mode 100644
index 00000000..6e08c25b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/procevent.cfg
@@ -0,0 +1,2 @@
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ramdisk.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ramdisk.cfg
new file mode 100644
index 00000000..3d44de80
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ramdisk.cfg
@@ -0,0 +1,2 @@
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=65536
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtc.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtc.cfg
new file mode 100644
index 00000000..2641958a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtc.cfg
@@ -0,0 +1,7 @@
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_LIB=y
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+CONFIG_RTC_DRV_DS1307=m
+CONFIG_RTC_DRV_DS3232=m
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtl_sdr.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtl_sdr.cfg
new file mode 100644
index 00000000..d4574700
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/rtl_sdr.cfg
@@ -0,0 +1,4 @@
+CONFIG_MEDIA_USB_SUPPORT=y
+CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
+CONFIG_DVB_USB_V2=m
+CONFIG_DVB_USB_RTL28XXU=m
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/scheddebug.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/scheddebug.cfg
new file mode 100644
index 00000000..e8b09aa7
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/scheddebug.cfg
@@ -0,0 +1 @@
+CONFIG_SCHED_DEBUG=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/sound.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/sound.cfg
new file mode 100644
index 00000000..ad34ea68
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/sound.cfg
@@ -0,0 +1,7 @@
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_MAX_CARDS=32
+CONFIG_SND_ALOOP=m
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uinput.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uinput.cfg
new file mode 100644
index 00000000..7996ef1d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uinput.cfg
@@ -0,0 +1,3 @@
+# Enable the User-level Input driver (required by "wayland-fits")
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usb.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usb.cfg
new file mode 100644
index 00000000..8e9e98ec
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usb.cfg
@@ -0,0 +1,8 @@
+CONFIG_USB_SERIAL=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_ACM=m
+CONFIG_CRC_CCITT=y
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_PCI=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbaudio.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbaudio.cfg
new file mode 100644
index 00000000..5961f43d
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbaudio.cfg
@@ -0,0 +1,2 @@
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbmodem.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbmodem.cfg
new file mode 100644
index 00000000..3ded931e
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/usbmodem.cfg
@@ -0,0 +1,7 @@
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_CDC_MBIM=m
+CONFIG_USB_NET_QMI_WWAN=m
+CONFIG_USB_SIERRA_NET=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_QUALCOMM=m
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uvc.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uvc.cfg
new file mode 100644
index 00000000..7c6556c1
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/uvc.cfg
@@ -0,0 +1,4 @@
+CONFIG_VIDEOBUF2_VMALLOC=y
+CONFIG_MEDIA_USB_SUPPORT=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/vbox-vmware-sata.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/vbox-vmware-sata.cfg
new file mode 100644
index 00000000..ce1eca1a
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/vbox-vmware-sata.cfg
@@ -0,0 +1,19 @@
+# enable harddrive driver for vmware/virtualbox
+CONFIG_ATA_PIIX=y
+CONFIG_SATA_AHCI=y
+CONFIG_ATA_SFF=y
+CONFIG_ATA_BMDMA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_ATA_ACPI=y
+
+# needed for VMWare
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=y
+CONFIG_DRM_VMWGFX=y
+CONFIG_DRM_VMWGFX_FBCON=y
+CONFIG_VMWARE_BALLOON=m
+CONFIG_VMWARE_VMCI=m
+CONFIG_VMWARE_VMCI_VSOCKETS=m
+CONFIG_SND_ENS1371=m
diff --git a/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch
new file mode 100644
index 00000000..28c9c09b
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch
@@ -0,0 +1,144 @@
+From 11b29ce444610a07067a89b38e9e85c2162bbf67 Mon Sep 17 00:00:00 2001
+From: Tim Orling <timothy.t.orling@linux.intel.com>
+Date: Mon, 15 Oct 2018 18:30:42 -0700
+Subject: [PATCH 7/7] [WIP] Initial LAVA support
+
+Linaro Automated Validation Architecture (LAVA) launches a test suite
+on the target but thereafter only observes stdout.
+
+LAVA knows that a test case has started or ended based on signals
+emitted to stdout:
+(setup)
+<LAVA_SIGNAL_STARTTC test_case_name>
+(teardown)
+<LAVA_SIGNAL_ENDTC test_case_name>
+<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=test_case_name RESULT=pass|fail \
+ [[ MEASUREMENT=numeric_measurement ][ UNITS=units_string]]>
+
+It is valid to have a measurement without units, but not units without a measurement.
+
+Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
+---
+ flags.h | 10 ++++++++++
+ main.c | 9 ++++++++-
+ utils.c | 15 +++++++++++++++
+ utils.h | 2 +-
+ 4 files changed, 34 insertions(+), 2 deletions(-)
+ create mode 100644 flags.h
+
+diff --git a/flags.h b/flags.h
+new file mode 100644
+index 000000000000..0dac2234e0b4
+--- /dev/null
++++ b/flags.h
+@@ -0,0 +1,10 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++
++/* Flag bit definitions */
++
++#ifndef __FLAGS_H__
++#define __FLAGS_H__
++
++#define LAVA_SIGNAL_ENABLE (0x0001)
++
++#endif /* __FLAGS_H__ */
+diff --git a/main.c b/main.c
+index 83600b7d1b31..92ced6926c3d 100644
+--- a/main.c
++++ b/main.c
+@@ -36,6 +36,7 @@
+ #endif
+
+ #include "utils.h"
++#include "flags.h"
+
+ #define DEFAULT_DIRECTORY "/usr/lib"
+ #define DEFAULT_TIMEOUT 300
+@@ -70,8 +71,9 @@ main(int argc, char *argv[])
+ opts.timeout = DEFAULT_TIMEOUT;
+ opts.ptests = NULL;
+ opts.xml_filename = NULL;
++ opts.flags = 0;
+
+- while ((opt = getopt(argc, argv, "d:e:lt:x:h")) != -1) {
++ while ((opt = getopt(argc, argv, "d:e:lt:x:Lh")) != -1) {
+ switch (opt) {
+ case 'd':
+ free(opts.directory);
+@@ -118,6 +120,11 @@ main(int argc, char *argv[])
+ opts.xml_filename = strdup(optarg);
+ CHECK_ALLOCATION(opts.xml_filename, 1, 1);
+ break;
++ case 'L':
++ // set LAVA signal mode
++ opts.flags |= LAVA_SIGNAL_ENABLE;
++ fprintf(stdout, "LAVA_SIGNAL_ENABLE == %d\n", opts.flags);
++ break;
+ default:
+ print_usage(stdout, argv[0]);
+ exit(1);
+diff --git a/utils.c b/utils.c
+index ed2eff7900c1..0fd1da6aec92 100644
+--- a/utils.c
++++ b/utils.c
+@@ -39,6 +39,7 @@
+
+ #include "ptest_list.h"
+ #include "utils.h"
++#include "flags.h"
+
+ #define GET_STIME_BUF_SIZE 1024
+ #define WAIT_CHILD_POLL_TIMEOUT_MS 200
+@@ -358,6 +359,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ fprintf(fp, "START: %s\n", progname);
+ PTEST_LIST_ITERATE_START(head, p);
+ char *ptest_dir = strdup(p->run_ptest);
++ char *ptest = strdup(p->ptest);
+ if (ptest_dir == NULL) {
+ rc = -1;
+ break;
+@@ -376,6 +378,11 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ int fds[2]; fds[0] = pipefd_stdout[0]; fds[1] = pipefd_stderr[0];
+ FILE *fps[2]; fps[0] = fp; fps[1] = fp_stderr;
+
++ char result[5]; // pass\0, fail\0, skip\0
++
++ if (opts.flags & LAVA_SIGNAL_ENABLE) {
++ fprintf(stdout, "<LAVA_SIGNAL_STARTTC %s>\n", ptest);
++ }
+ fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE));
+ fprintf(fp, "BEGIN: %s\n", ptest_dir);
+
+@@ -389,6 +396,14 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+
+ fprintf(fp, "END: %s\n", ptest_dir);
+ fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE));
++ if (opts.flags & LAVA_SIGNAL_ENABLE) {
++ if (status)
++ sprintf(result, "fail");
++ else
++ sprintf(result, "pass");
++ fprintf(stdout, "<LAVA_SIGNAL_ENDTC %s>\n", ptest);
++ fprintf(stdout, "<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=%s>\n", ptest, result);
++ }
+ }
+ PTEST_LIST_ITERATE_END;
+ fprintf(fp, "STOP: %s\n", progname);
+diff --git a/utils.h b/utils.h
+index ee85163ddfff..06d4c100d151 100644
+--- a/utils.h
++++ b/utils.h
+@@ -37,9 +37,9 @@ struct ptest_options {
+ int timeout;
+ char **ptests;
+ char *xml_filename;
++ unsigned int flags;
+ };
+
+-
+ extern void check_allocation1(void *, size_t, char *, int, int);
+ extern struct ptest_list *get_available_ptests(const char *);
+ extern int print_ptests(struct ptest_list *, FILE *);
+--
+2.11.0
+
diff --git a/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend
new file mode 100644
index 00000000..7a1d2a8f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0007-WIP-Initial-LAVA-support.patch"
+
diff --git a/meta-agl/meta-agl-bsp/wic/directdisk.wks.in b/meta-agl/meta-agl-bsp/wic/directdisk.wks.in
new file mode 100644
index 00000000..f7b220cd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/wic/directdisk.wks.in
@@ -0,0 +1,9 @@
+# short-description: Create a 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media.
+
+part /boot --source bootimg-pcbios --use-uuid --label boot --active --align 1024
+part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
+
+bootloader --timeout=0 --append="rootwait rootfstype=ext4 ${QB_KERNEL_CMDLINE_APPEND}"
+
diff --git a/meta-agl/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks b/meta-agl/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks
new file mode 100644
index 00000000..1f51a0bd
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks
@@ -0,0 +1,6 @@
+# short-description: Create SD card image with a boot partition
+# long-description: Creates a partitioned SD card image. Boot files
+# are located in the first vfat partition.
+
+part /boot --source bootimg-partition --fstype=vfat --label boot --use-uuid --active --align 4 --size 16
+part / --source rootfs --fstype=ext4 --label root --align 4 --use-uuid
diff --git a/meta-agl/meta-agl-bsp/wic/singlepart-noloader.wks b/meta-agl/meta-agl-bsp/wic/singlepart-noloader.wks
new file mode 100644
index 00000000..31c499ae
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/wic/singlepart-noloader.wks
@@ -0,0 +1,5 @@
+# short-description: Single partition rootfs with UUID and no bootloader
+# long-description: Creates a partitioned image with a single partition in
+# use and does not contain a bootloader.
+
+part / --source rootfs --use-uuid --fstype=ext4 --label root --align 4096
diff --git a/meta-agl/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks b/meta-agl/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks
new file mode 100644
index 00000000..56393728
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks
@@ -0,0 +1,23 @@
+# short-description: Custom EFI disk image with systemd-boot
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media. The selected bootloader is systemd-boot
+# and we do not have swap
+
+part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode.cpio" --use-uuid --label msdos --active --align 1024
+
+part / --source rootfs --fstype=ext4 --label platform --align 1024 --use-uuid
+
+# Modify the append line here as needed to suit the environment.
+#
+# To change the default video resolution add one of the following
+# resolutions:
+# uvesafb.mode_option=1024x768-32
+# uvesafb.mode_option=1280x1024-32
+# uvesafb.mode_option=1600x1200-32
+#
+# To avoid corrupt boot screen by systemd message you can remove the
+# console=tty0 portion below or disable all boot messages by kernel command
+# line. To disable all boot messages add:
+#
+# quiet
+bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 reboot=efi"
diff --git a/meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks b/meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks
new file mode 100644
index 00000000..a318e231
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks
@@ -0,0 +1,12 @@
+# short-description: Custom EFI disk image with systemd-boot
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media. The selected bootloader is systemd-boot
+# and we do not have swap. We assume a Joule system and provide an
+# appropriate kernel command line.
+
+part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode.cpio" --use-uuid --label msdos --active --align 1024
+
+part / --source rootfs --fstype=ext4 --label platform --align 1024 --use-uuid
+
+# Modify the append line here as needed to suit the environment
+bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS2,115200n8 console=tty0 video=efifb maxcpus=4 noxsave reboot=efi kmemleak=off"