diff options
Diffstat (limited to 'meta-agl-bsp')
439 files changed, 3802 insertions, 31982 deletions
diff --git a/meta-agl-bsp/LICENSE b/meta-agl-bsp/LICENSE new file mode 100644 index 000000000..e8758f89c --- /dev/null +++ b/meta-agl-bsp/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl-bsp/LICENSE.GPL-2.0-only b/meta-agl-bsp/LICENSE.GPL-2.0-only new file mode 100644 index 000000000..5db3c0a21 --- /dev/null +++ b/meta-agl-bsp/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl-bsp/LICENSE.MIT b/meta-agl-bsp/LICENSE.MIT new file mode 100644 index 000000000..a6919eb7e --- /dev/null +++ b/meta-agl-bsp/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl-bsp/README b/meta-agl-bsp/README new file mode 100644 index 000000000..69ca72c9d --- /dev/null +++ b/meta-agl-bsp/README @@ -0,0 +1,19 @@ +This is meta-agl-bsp. + +This layer holds the 'impedance-mismatch' between AGL and the BSP's. + +/dream on +In an ideal world, this would be empty! +/dream off + +Maintenance +----------- + +All patches must be submitted via the AGL Gerrit instance at +https://gerrit.automotivelinux.org. See this wiki page for +details: + +https://wiki.automotivelinux.org/agl-distro/contributing + +Layer maintainers: + Jan-Simon Möller <jsmoeller@linuxfoundation.org> diff --git a/meta-agl-bsp/classes/sdcard_image-rpi.bbclass b/meta-agl-bsp/classes/sdcard_image-rpi.bbclass deleted file mode 100644 index c22a6f880..000000000 --- a/meta-agl-bsp/classes/sdcard_image-rpi.bbclass +++ /dev/null @@ -1,184 +0,0 @@ -inherit image_types -inherit linux-raspberrypi-base - -# -# Create an image that can by written onto a SD card using dd. -# -# The disk layout used is: -# -# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved for other data -# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - bootloader and kernel -# BOOT_SPACE -> SDIMG_SIZE - rootfs -# - -# Default Free space = 1.3x -# Use IMAGE_OVERHEAD_FACTOR to add more space -# <---------> -# 4MiB 40MiB SDIMG_ROOTFS -# <-----------------------> <----------> <----------------------> -# ------------------------ ------------ ------------------------ -# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE | -# ------------------------ ------------ ------------------------ -# ^ ^ ^ ^ -# | | | | -# 0 4MiB 4MiB + 40MiB 4MiB + 40Mib + SDIMG_ROOTFS - -# This image depends on the rootfs image -IMAGE_TYPEDEP_rpi-sdimg = "${SDIMG_ROOTFS_TYPE}" - -# Set kernel and boot loader -IMAGE_BOOTLOADER ?= "bcm2835-bootfiles" - -# Set initramfs extension -KERNEL_INITRAMFS ?= "" - -# Kernel image name -SDIMG_KERNELIMAGE_raspberrypi ?= "kernel.img" -SDIMG_KERNELIMAGE_raspberrypi2 ?= "kernel7.img" -SDIMG_KERNELIMAGE_raspberrypi3-64 ?= "kernel8.img" - -# Boot partition volume id -BOOTDD_VOLUME_ID ?= "${MACHINE}" - -# Boot partition size [in KiB] (will be rounded up to IMAGE_ROOTFS_ALIGNMENT) -BOOT_SPACE ?= "40960" - -# Set alignment to 4MB [in KiB] -IMAGE_ROOTFS_ALIGNMENT = "4096" - -# Use an uncompressed ext3 by default as rootfs -SDIMG_ROOTFS_TYPE ?= "ext3" -SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}" - -IMAGE_DEPENDS_rpi-sdimg = " \ - parted-native \ - mtools-native \ - dosfstools-native \ - virtual/kernel:do_deploy \ - ${IMAGE_BOOTLOADER} \ - ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'u-boot', '',d)} \ - " - -# SD card image name -SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.rpi-sdimg" - -# Compression method to apply to SDIMG after it has been created. Supported -# compression formats are "gzip", "bzip2" or "xz". The original .rpi-sdimg file -# is kept and a new compressed file is created if one of these compression -# formats is chosen. If SDIMG_COMPRESSION is set to any other value it is -# silently ignored. -#SDIMG_COMPRESSION ?= "" - -# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. -FATPAYLOAD ?= "" - -IMAGE_CMD_rpi-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}) - SDIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $ROOTFS_SIZE) - - echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB" - - # Check if we are building with device tree support - DTS="${@get_dts(d)}" - - # Initialize sdcard image file - dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE} - - # Create partition table - parted -s ${SDIMG} mklabel msdos - # Create boot partition and mark it as bootable - parted -s ${SDIMG} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) - parted -s ${SDIMG} set 1 boot on - # Create rootfs partition to the end of disk - parted -s ${SDIMG} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s - parted ${SDIMG} print - - # Create a vfat image with boot files - BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }') - rm -f ${WORKDIR}/boot.img - mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/ - if test -n "${DTS}"; then - # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder - DT_OVERLAYS="${@split_overlays(d, 0)}" - DT_ROOT="${@split_overlays(d, 1)}" - - # Copy board device trees to root folder - for DTB in ${DT_ROOT}; do - DTB_BASE_NAME=`basename ${DTB} .dtb` - - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb - done - - # Copy device tree overlays to dedicated folder - mmd -i ${WORKDIR}/boot.img overlays - for DTB in ${DT_OVERLAYS}; do - DTB_EXT=${DTB##*.} - DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"` - - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.${DTB_EXT} ::overlays/${DTB_BASE_NAME}.${DTB_EXT} - done - fi - case "${KERNEL_IMAGETYPE}" in - "uImage") - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.bin ::${SDIMG_KERNELIMAGE} - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::uImage - mcopy -o -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr - ;; - *) - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${SDIMG_KERNELIMAGE} - ;; - esac - - if [ -n ${FATPAYLOAD} ] ; then - echo "Copying payload into VFAT" - for entry in ${FATPAYLOAD} ; do - # add the || true to stop aborting on vfat issues like not supporting .~lock files - mcopy -i ${WORKDIR}/boot.img -s -v ${IMAGE_ROOTFS}$entry :: || true - done - fi - - # Add stamp file - echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info - mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info :: - - # Burn Partitions - dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${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} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - else - dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - fi - - # Optionally apply compression - case "${SDIMG_COMPRESSION}" in - "gzip") - gzip -k9 "${SDIMG}" - ;; - "bzip2") - bzip2 -k9 "${SDIMG}" - ;; - "xz") - xz -k "${SDIMG}" - ;; - esac -} - -ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; " - -rpi_generate_sysctl_config() { - # systemd sysctl config - test -d ${IMAGE_ROOTFS}${sysconfdir}/sysctl.d && \ - echo "vm.min_free_kbytes = 8192" > ${IMAGE_ROOTFS}${sysconfdir}/sysctl.d/rpi-vm.conf - - # sysv sysctl config - IMAGE_SYSCTL_CONF="${IMAGE_ROOTFS}${sysconfdir}/sysctl.conf" - test -e ${IMAGE_ROOTFS}${sysconfdir}/sysctl.conf && \ - sed -e "/vm.min_free_kbytes/d" -i ${IMAGE_SYSCTL_CONF} - echo "" >> ${IMAGE_SYSCTL_CONF} && echo "vm.min_free_kbytes = 8192" >> ${IMAGE_SYSCTL_CONF} -} diff --git a/meta-agl-bsp/conf/include/agl_am62xx-evm.inc b/meta-agl-bsp/conf/include/agl_am62xx-evm.inc new file mode 100644 index 000000000..24fd95141 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_am62xx-evm.inc @@ -0,0 +1,8 @@ +# am62xx-evm has a k3r5 BBMULTICONFIG to build its bootloader +# firmware, need to use an override to set DEFAULTTUNE back to +# what that machine configuration needs. +DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf" + +# meta-ti-bsp layer conf does break expectations wrt common folders +# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti" +TI_COMMON_DEPLOY := "${TMPDIR}/deploy" diff --git a/meta-agl-bsp/conf/include/agl_bbe.inc b/meta-agl-bsp/conf/include/agl_bbe.inc new file mode 100644 index 000000000..5252c558b --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_bbe.inc @@ -0,0 +1,24 @@ +# This config is for the Sancloud BBE, adapted from the config provider for the +# standard Beaglebone + +#AGL_DEFAULT_IMAGE_FSTYPES += "tar.xz" + +CORE_IMAGE_EXTRA_INSTALL += "packagegroup-machine-base" + +#------------------------------------------------- +## 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 = "" + +# meta-ti-bsp layer conf does break expectations wrt common folders +# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti" +TI_COMMON_DEPLOY := "${TMPDIR}/deploy"
\ No newline at end of file diff --git a/meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc b/meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc new file mode 100644 index 000000000..1e03b70ff --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc @@ -0,0 +1,6 @@ +# beaglebone-ai64 has a k3r5 BBMULTICONFIG to build its bootloader +# and firmware, need to use an override to set DEFAULTTUNE back to +# what that machine configuration needs. +DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf" + +TI_COMMON_DEPLOY := "${TMPDIR}/deploy" diff --git a/meta-agl-bsp/conf/include/agl_beaglebone.inc b/meta-agl-bsp/conf/include/agl_beaglebone.inc index be9785a5a..ec3a3a448 100644 --- a/meta-agl-bsp/conf/include/agl_beaglebone.inc +++ b/meta-agl-bsp/conf/include/agl_beaglebone.inc @@ -1,42 +1,10 @@ # 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" +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" +# meta-ti-bsp layer conf does break expectations wrt common folders +# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti" +TI_COMMON_DEPLOY := "${TMPDIR}/deploy"
\ No newline at end of file diff --git a/meta-agl-bsp/conf/include/agl_beagleplay.inc b/meta-agl-bsp/conf/include/agl_beagleplay.inc new file mode 100644 index 000000000..77b669bb7 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_beagleplay.inc @@ -0,0 +1,6 @@ +# beagleplay has a k3r5 BBMULTICONFIG to build its bootloader +# and firmware, need to use an override to set DEFAULTTUNE back to +# what that machine configuration needs. +DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf" + +TI_COMMON_DEPLOY := "${TMPDIR}/deploy" diff --git a/meta-agl-bsp/conf/include/agl_cubox-i.inc b/meta-agl-bsp/conf/include/agl_cubox-i.inc new file mode 100644 index 000000000..ee5e759e4 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_cubox-i.inc @@ -0,0 +1,15 @@ +require agl_imx6-common.inc + +# Force use of the community supported LTS kernel instead of the +# default linux-fslc +PREFERRED_PROVIDER_virtual/kernel = "linux-fslc-lts" + +# 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 \ +" diff --git a/meta-agl-bsp/conf/include/agl_cyclone5.inc b/meta-agl-bsp/conf/include/agl_cyclone5.inc index 8accf7dca..3f12a2a92 100644 --- a/meta-agl-bsp/conf/include/agl_cyclone5.inc +++ b/meta-agl-bsp/conf/include/agl_cyclone5.inc @@ -1,5 +1,7 @@ OSTREE_BOOTLOADER ?= "u-boot" # DEFAULTTUNE for cortex-a9 -DISTRO_FEATURES_append = " agl-medium-arm-compiler" +DISTRO_FEATURES:append = " agl-medium-arm-compiler" +# Use the AGL default ext4.xz to generate the rpi-sdimg +SDIMG_ROOTFS_TYPE = "ext4.xz" diff --git a/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc b/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc deleted file mode 100644 index f3abe4cc5..000000000 --- a/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc +++ /dev/null @@ -1,49 +0,0 @@ - -#------------------------------------------------- -## 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 ## -#------------------------------------------------- - -GSTREAMER_PLUGINS = " \ - gstreamer1.0-plugins-bad-meta \ - gstreamer1.0-plugins-ducati \ - gstreamer1.0-plugins-vpe \ -" - -PACKAGES_MULTIMEDIA = " \ - ipumm-fw \ - pulseaudio-misc \ - ${GSTREAMER_PLUGINS} \ -" - -PREFERRED_VERSION_ipumm-fw = "3.00.13.00" - -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 \ -" diff --git a/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc b/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc deleted file mode 100644 index f74d703fa..000000000 --- a/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc +++ /dev/null @@ -1,2 +0,0 @@ -# Install 96boards-tools for resizing partition -IMAGE_INSTALL_append = " 96boards-tools" diff --git a/meta-agl-bsp/conf/include/agl_ebisu.inc b/meta-agl-bsp/conf/include/agl_ebisu.inc new file mode 100644 index 000000000..d684f814d --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_ebisu.inc @@ -0,0 +1,13 @@ +require conf/include/agl_rcar.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-vspm-if" diff --git a/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc b/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc new file mode 100644 index 000000000..4ff103df8 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc @@ -0,0 +1,9 @@ +require conf/include/agl_salvator-nogfx.inc +SOC_FAMILY = "r8a7795" +BOARD_NAME = "h3-salvator-x" + +DTB_SUFFIX = "r8a77951-salvator-xs" + +# do use software rendering to display the compositor +# used for images w/o binary-only driver +WESTON_USE_PIXMAN = "1" diff --git a/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc b/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc new file mode 100644 index 000000000..134b1dd1f --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc @@ -0,0 +1,6 @@ +require conf/include/agl_salvator.inc +SOC_FAMILY = "r8a7795" +BOARD_NAME = "h3-salvator-x" + +DTB_SUFFIX = "r8a77951-salvator-xs" + diff --git a/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc b/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc new file mode 100644 index 000000000..5f288fca5 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc @@ -0,0 +1,25 @@ +require conf/include/agl_rcar-nogfx.inc +SOC_FAMILY = "r8a7795" +BOARD_NAME = "h3ulcb" + +DTB_SUFFIX = "r8a77951-ulcb" + +# Mask graphic Pkgs +BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm" +# Mask MMP recipes +BBMASK += "kernel-module-uvcs-drv|omx-user-module" + +# Work around use of obsolete Weston backend-fbdev in meta-rcar-gen3 +# when building without the proprietary driver stack. Masking out the +# weston_%.bbappend seems the simplest approach for now, as forcing +# USE_GLES = "1" to disable the adding of -Dbackend-default="fbdev" to +# EXTRA_OEMESON triggers adding "libgbm" to DEPENDS, which breaks due +# to that being a component specific to the proprietary stack we are +# explicitly disabling. If the "libgbm" usage in the bbappend was +# instead "virtual/libgbm" as is now used in poky, it might be possible +# to just tweak PREFERRED_PROVIDER_virtual/libgbm = "mesa". +BBMASK += "meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend" + +# do use software rendering to display the compositor +# used for images w/o binary-only driver +WESTON_USE_PIXMAN = "1" diff --git a/meta-agl-bsp/conf/include/agl_h3ulcb.inc b/meta-agl-bsp/conf/include/agl_h3ulcb.inc index 7cafb833e..b958d767c 100644 --- a/meta-agl-bsp/conf/include/agl_h3ulcb.inc +++ b/meta-agl-bsp/conf/include/agl_h3ulcb.inc @@ -1,51 +1,6 @@ +require conf/include/agl_rcar.inc SOC_FAMILY = "r8a7795" +BOARD_NAME = "h3ulcb" -# 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 = "gles-user-module" -PREFERRED_PROVIDER_virtual/egl = "gles-user-module" -PREFERRED_PROVIDER_virtual/libgl = "" -PREFERRED_PROVIDER_virtual/mesa = "mesa" -PREFERRED_PROVIDER_libgbm = "libgbm" -PREFERRED_RPROVIDER_libgbm-dev = "libgbm" - -# Mask the gstreamer recipe for MMP -BBMASK = "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer" - -# Add for gstreamer plugins ugly -LICENSE_FLAGS_WHITELIST = "commercial" - -PREFERRED_VERSION_gstreamer1.0 = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-libav = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-base = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-ugly = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-vspfilter = "1.0%" - -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" - -DISTRO_FEATURES_BACKFILL_remove = "gobject-introspection-data" - -IMAGE_INSTALL_append_rcar-gen3 = " \ - kernel-module-pvrsrvkm \ - kernel-module-vsp2 \ - kernel-module-vspm-if \ - omx-user-module \ - weston-bin \ -" - -BBMASK .= "|meta-renesas-rcar-gen3/meta-rcar-gen3/recipes-forward-port/" -OSTREE_BOOTLOADER ?= "u-boot" +#ws2.0 +DTB_SUFFIX = "r8a77951-ulcb" diff --git a/meta-agl-bsp/conf/include/agl_imx-common.inc b/meta-agl-bsp/conf/include/agl_imx-common.inc new file mode 100644 index 000000000..b58a99589 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx-common.inc @@ -0,0 +1,8 @@ +# 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" diff --git a/meta-agl-bsp/conf/include/agl_imx6-common.inc b/meta-agl-bsp/conf/include/agl_imx6-common.inc new file mode 100644 index 000000000..7b22282dd --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx6-common.inc @@ -0,0 +1,14 @@ +require agl_imx-common.inc + +DISTRO_FEATURES:append = " agl-medium-arm-compiler" + +# This disables the Freescale/NXP Vivante GPU driver and enables +# etnaviv support. This is the default for the i.MX6 platforms in +# meta-freescale, but not for all the ones in meta-freescale-3rdparty, +# so set it here to give a consistent default. +IMX_DEFAULT_BSP = "mainline" + +# Set CMA size large enough to work with AGL +UBOOT_EXTLINUX_KERNEL_ARGS:append = " cma=512M" + +AGL_DEFAULT_INITRAMFS_FSTYPES := "" diff --git a/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc b/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc new file mode 100644 index 000000000..f058ba1a5 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc @@ -0,0 +1,5 @@ +require agl_imx6-common.inc + +# Force use of the community supported LTS kernel instead of the +# default linux-fslc +IMX_DEFAULT_KERNEL:imx6qdlsabreauto = "linux-fslc-lts" diff --git a/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc b/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc deleted file mode 100644 index 74879dbbf..000000000 --- a/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc +++ /dev/null @@ -1,35 +0,0 @@ -# Caution: Hand-merge needed when original recipes are updated -# -# Here we only have selected lines from the following (and -# their included) files -# -# fslc-wayland.conf -# fsl-image-multimedia-full.bb -# - -# fslc-wayland.conf - -# -# Followings were intentionally removed from the original recipe -# to make our set simpler -# -# gtk+3-demo clutter-1.0-examples -# - -IMAGE_INSTALL_append = " \ - packagegroup-fsl-tools-gpu \ - packagegroup-fsl-gstreamer1.0 \ - packagegroup-imx-tools-audio \ - weston weston-init weston-examples \ -" - -# fsl-image-multimedia-full.bb - -IMAGE_INSTALL_append = " \ - packagegroup-fsl-gstreamer1.0-full \ -" - -# fix build error - -SECURITY_CFLAGS_pn-devil = "${SECURITY_NO_PIE_CFLAGS}" - diff --git a/meta-agl-bsp/conf/include/agl_imx8mq-evk-common.inc b/meta-agl-bsp/conf/include/agl_imx8mq-evk-common.inc new file mode 100644 index 000000000..b3faadd0a --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx8mq-evk-common.inc @@ -0,0 +1,8 @@ +require agl_imx-common.inc + +# Add helper to drive setting up HCI UART device +# NOTE: Disabled 2023/05 due to kernel oops, further investigation +# required, see SPEC-4807 in JIRA. +#MACHINE_EXTRA_RRECOMMENDS:append = " hci-uart-helper" + +AGL_DEFAULT_INITRAMFS_FSTYPES := "" diff --git a/meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc b/meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc new file mode 100644 index 000000000..3988fcd6f --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc @@ -0,0 +1,8 @@ +require agl_imx8mq-evk-common.inc + +IMX_DEFAULT_BSP = "nxp" + +# NOTE: +# There is some potential benefit to using the community supported +# linux-fslc-imx hybrid kernel here, but keeping the configuration +# close to upstream to ease maintenance seems worthwhile. diff --git a/meta-agl-bsp/conf/include/agl_imx8mq-evk.inc b/meta-agl-bsp/conf/include/agl_imx8mq-evk.inc new file mode 100644 index 000000000..620ee0fdd --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_imx8mq-evk.inc @@ -0,0 +1,23 @@ +require agl_imx8mq-evk-common.inc + +# NOTE: +# Currently using the upstream default of IMX_DEFAULT_BSP = "mainline", +# since we want to use the etnaviv driver and upstream Mesa + weston +# stack. More tweaks are required to accomplish that if the BSP is set +# to "nxp". + +# Force use of the community supported hybrid NXP/LTS kernel instead of +# the default linux-fslc. This is required to get the drivers required +# for HDMI output. +IMX_DEFAULT_KERNEL:imx8mq-evk = "linux-fslc-imx" + +# Tweaks to allow using linux-fslc-imx on its own without the whole +# NXP BSP. Just the DISTROOVERRIDES change on its own is not enough, +# as COMPATIBLE_MACHINE is evaluated early enough that the recipe is +# not seen as compatible without an explicit override. +COMPATIBLE_MACHINE:pn-linux-fslc-imx = "(imx8mq-evk)" +DISTROOVERRIDES:pn-linux-fslc-imx:append = "mx8-nxp-bsp" + +# Add our own over-ride for use in a few recipes where there is +# conflicting Vivante vs etnaviv configuration. +MACHINEOVERRIDES .= ":etnaviv" diff --git a/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc b/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc deleted file mode 100644 index c31ac2759..000000000 --- a/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc +++ /dev/null @@ -1,25 +0,0 @@ -# Configurations to run on VirtualBox/VMWare -# -# To get wide screen than default, there are a selection of resolutions -# available: -# -#APPEND += "uvesafb.mode_option=1024x768-32" -#APPEND += "uvesafb.mode_option=1280x1024-32" -#APPEND += "uvesafb.mode_option=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 -APPEND += "console=ttyS0,115200n8 reboot=efi" -# -# All boot message will be off -#APPEND += "quiet" - -# Enable Libvaapi for HW accelerated video support -# -IMAGE_INSTALL_append = " \ - libva \ - va-intel \ - gstreamer-vaapi-1.0 " diff --git a/meta-agl-bsp/conf/include/agl_j721e-evm.inc b/meta-agl-bsp/conf/include/agl_j721e-evm.inc new file mode 100644 index 000000000..963b5697d --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_j721e-evm.inc @@ -0,0 +1,11 @@ +# j721e-evm has a k3r5 BBMULTICONFIG to build its bootloader +# firmware, need to use an override to set DEFAULTTUNE back to +# what that machine configuration needs. +DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf" + +# Workaround for recipe assumption of poky location +LIC_FILES_CHKSUM:pn-ti-rtos-firmware = "file://${THISDIR}/../../licenses/TI-TFL;md5=a1b59cb7ba626b9dbbcbf00f3fbc438a" + +# meta-ti-bsp layer conf does break expectations wrt common folders +# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti" +TI_COMMON_DEPLOY := "${TMPDIR}/deploy"
\ No newline at end of file diff --git a/meta-agl-bsp/conf/include/agl_joule.inc b/meta-agl-bsp/conf/include/agl_joule.inc deleted file mode 100644 index 212cb15af..000000000 --- a/meta-agl-bsp/conf/include/agl_joule.inc +++ /dev/null @@ -1,11 +0,0 @@ -INTEL_MACHINE_SUBTYPE = "broxton-m" -PREFERRED_VERSION_linux-yocto_intel-corei7-64 ?= "4.4%" - -APPEND += "console=ttyS2,115200n8 video=efifb maxcpus=4 noxsave reboot=efi kmemleak=off" - -IMAGE_INSTALL_append = " linux-firmware-iwlwifi-8000c linux-firmware-ibt-11-5" -IMAGE_INSTALL_append = " \ - libva \ - va-intel \ - gstreamer-vaapi-1.0 " -OSTREE_BOOTLOADER ?= "u-boot" diff --git a/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc b/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc new file mode 100644 index 000000000..ebbb3006a --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc @@ -0,0 +1,6 @@ +require conf/include/agl_salvator-nogfx.inc +SOC_FAMILY = "r8a7796" +BOARD_NAME = "m3-salvator-x" + +DTB_SUFFIX = "r8a7796-salvator-xs" + diff --git a/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc b/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc new file mode 100644 index 000000000..355040ba9 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc @@ -0,0 +1,6 @@ +require conf/include/agl_salvator.inc +SOC_FAMILY = "r8a7796" +BOARD_NAME = "m3-salvator-x" + +DTB_SUFFIX = "r8a7796-salvator-xs" + diff --git a/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc b/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc index f1f9b87fd..31d99c342 100644 --- a/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc +++ b/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc @@ -1,16 +1,28 @@ +require conf/include/agl_rcar-nogfx.inc SOC_FAMILY = "r8a7796" +BOARD_NAME = "m3ulcb" -IMAGE_INSTALL_append = " \ - weston-bin \ -" +DTB_SUFFIX = "r8a77960-ulcb" # Mask graphic Pkgs -BBMASK = "gles-user-module|kernel-module-gles|wayland-kms|libgbm" +BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm" # Mask MMP recipes -BBMASK .= "|kernel-module-uvcs-drv|omx-user-module" +BBMASK += "kernel-module-uvcs-drv|omx-user-module" -BBMASK .= "|meta-renesas-rcar-gen3/meta-rcar-gen3/recipes-forward-port/" +# Work around use of obsolete Weston backend-fbdev in meta-rcar-gen3 +# when building without the proprietary driver stack. Masking out the +# weston_%.bbappend seems the simplest approach for now, as forcing +# USE_GLES = "1" to disable the adding of -Dbackend-default="fbdev" to +# EXTRA_OEMESON triggers adding "libgbm" to DEPENDS, which breaks due +# to that being a component specific to the proprietary stack we are +# explicitly disabling. If the "libgbm" usage in the bbappend was +# instead "virtual/libgbm" as is now used in poky, it might be possible +# to just tweak PREFERRED_PROVIDER_virtual/libgbm = "mesa". +BBMASK += "meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend" -OSTREE_KERNEL = "Image" -IMAGE_BOOT_FILES_sota = "m3ulcb-ota-bootfiles/* Image-r8a7796-m3ulcb.dtb" -OSTREE_BOOTLOADER ?= "u-boot" +# do use software rendering to display the compositor +# used for images w/o binary-only driver +WESTON_USE_PIXMAN = "1" + +DISTRO_FEATURES:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}" +IMAGE_INSTALL:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen-base xen-mkimage', '', d)}" diff --git a/meta-agl-bsp/conf/include/agl_m3ulcb.inc b/meta-agl-bsp/conf/include/agl_m3ulcb.inc index 9b9bc7548..4f788324c 100644 --- a/meta-agl-bsp/conf/include/agl_m3ulcb.inc +++ b/meta-agl-bsp/conf/include/agl_m3ulcb.inc @@ -1,54 +1,8 @@ +require conf/include/agl_rcar.inc SOC_FAMILY = "r8a7796" +BOARD_NAME = "m3ulcb" -# for Wayland/Weston weston-laucher -DISTRO_FEATURES_append = " pam" +DTB_SUFFIX = "r8a77960-ulcb" -# 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 = "gles-user-module" -PREFERRED_PROVIDER_virtual/egl = "gles-user-module" -PREFERRED_PROVIDER_virtual/libgl = "" -PREFERRED_PROVIDER_virtual/mesa = "mesa" -PREFERRED_PROVIDER_libgbm = "libgbm" -PREFERRED_RPROVIDER_libgbm-dev = "libgbm" - -# Mask the gstreamer recipe for MMP -BBMASK = "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer" - -# Add for gstreamer plugins ugly -LICENSE_FLAGS_WHITELIST = "commercial" - -PREFERRED_VERSION_gstreamer1.0 = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-libav = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-base = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-ugly = "1.6.3" -PREFERRED_VERSION_gstreamer1.0-plugins-vspfilter = "1.0%" - -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" - -DISTRO_FEATURES_BACKFILL_remove = "gobject-introspection-data" - -IMAGE_INSTALL_append_rcar-gen3 = " \ - kernel-module-pvrsrvkm \ - kernel-module-vsp2 \ - kernel-module-vspm-if \ - omx-user-module \ - weston-bin \ -" - -BBMASK .= "|meta-renesas-rcar-gen3/meta-rcar-gen3/recipes-forward-port/" - -OSTREE_KERNEL = "Image" -IMAGE_BOOT_FILES_sota = "m3ulcb-ota-bootfiles/* Image-r8a7796-m3ulcb.dtb" -OSTREE_BOOTLOADER ?= "u-boot" +DISTRO_FEATURES:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}" +IMAGE_INSTALL:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen-base xen-mkimage', '', d)}" diff --git a/meta-agl-bsp/conf/include/agl_porter-nogfx.inc b/meta-agl-bsp/conf/include/agl_porter-nogfx.inc deleted file mode 100644 index cb7b4a560..000000000 --- a/meta-agl-bsp/conf/include/agl_porter-nogfx.inc +++ /dev/null @@ -1,24 +0,0 @@ -MACHINE = "porter" - -# For Bluetooth hardware support -BT_KERNEL_MODULES = " \ - kernel-module-btusb \ - kernel-module-bnep \ - kernel-module-rfcomm \ - kernel-module-rfkill \ - " - -# Distribution-specific runtime components -IMAGE_INSTALL_append = " \ - ${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "${BT_KERNEL_MODULES}", "", d)} \ - " - -# Setting for u-boot Wayland -UBOOT_MACHINE = "porter_vin_config" - -PREFERRED_PROVIDER_virtual/libgles2 = "mesa" -PREFERRED_PROVIDER_virtual/egl = "mesa" - -# Build updatable image. Only takes effect when sota.bbclass is inherited -DISTRO_FEATURES_append = " sota" - diff --git a/meta-agl-bsp/conf/include/agl_porter.inc b/meta-agl-bsp/conf/include/agl_porter.inc deleted file mode 100644 index 06dcb8e51..000000000 --- a/meta-agl-bsp/conf/include/agl_porter.inc +++ /dev/null @@ -1,183 +0,0 @@ - -# For running GStreamer on wayland (experimental). -# -# Uncoment below if want to use multimedia acceleration on wayland -# -IMAGE_INSTALL_append_porter = " \ - gstreamer1.0-plugins-bad-waylandsink \ - " - -# Additional plugins to test multimedia acceleration (experimental) -# -# Uncoment below if want to use multimedia acceleration -# -IMAGE_INSTALL_append_porter = " \ - gstreamer1.0-plugins-base-videorate \ - gstreamer1.0-plugins-base-videotestsrc \ - gstreamer1.0-plugins-base-audiotestsrc \ - gstreamer1.0-plugins-base-alsa \ - gstreamer1.0-plugins-good-autodetect \ - gstreamer1.0-plugins-good-isomp4 \ - gstreamer1.0-plugins-good-videocrop \ - gstreamer1.0-plugins-bad-asfmux \ - gstreamer1.0-plugins-bad-fbdevsink \ - gstreamer1.0-plugins-bad-faad \ - gstreamer1.0-plugins-bad-videoparsersbad \ -" -# gstreamer1.0-plugins-good-video4linux2 (temp disabled) - -# for graphics acceleration -# -# Uncoment below if want to use multimedia acceleration -# -IMAGE_INSTALL_append_porter = " \ - libegl libegl-dev libgbm-dev \ - gles-kernel-module gles-user-module \ - libdrm-tests \ - libdrm-kms \ - " - -# for multimedia acceleration -# -# Uncoment below if want to use multimedia acceleration -# -IMAGE_INSTALL_append_porter = " \ - packagegroup-rcar-gen2-multimedia \ - packagegroup-lcb-oss-codecs \ - alsa-utils alsa-utils-config alsa-tools \ -" - -IMAGE_INSTALL_append_porter = " \ - gles-kernel-module \ - libegl \ - libgbm-dev \ - " - -# For Bluetooth hardware support -BT_KERNEL_MODULES = " \ - kernel-module-btusb \ - kernel-module-bnep \ - kernel-module-rfcomm \ - kernel-module-rfkill \ - " - -# Distribution-specific runtime components -IMAGE_INSTALL_append = " \ - ${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "${BT_KERNEL_MODULES}", "", d)} \ - " - -# TODO: When booting weston, someone try to load 'libgbm_kms.so' then -# fail to boot. It should be 'libgbm_kms.so.1'. -# Tentatively, it is to install 'libgbm-dev' pkg. -#IMAGE_INSTALL_append = "libgbm-dev" -# this is not recommended and should be done in the recipe requiring this module (gles-user-module) - -LICENSE_FLAGS_WHITELIST = "commercial" - -# Define the name of multimedia, dtv, graphic test, multimedia-test for bbmask -BB_MULTIMEDIA_KERNEL_MODULE = "fdpm-kernel-module|mmngr-kernel-module|mmngrbuf-kernel-module|s3ctl-kernel-module|uvcs-kernel-module|vspm-kernel-module" -BB_MULTIMEDIA_USER_MODULE = "fdpm-user-module|mmngr-user-module|mmngrbuf-user-module|omx-user-module|s3ctl-user-module|vspm-user-module|libmemcpy" -BB_MULTIMEDIA_TEST_MODULE = "fdpm-tp-user-module|mmngr-tp-user-module|mmngrbuf-tp-user-module|s3ctl-tp-user-module|vspm-tp-user-module" - -BB_GST_PLUGINS = "meta-renesas/meta-rcar-gen2/recipes-multimedia/gstreamer" -MULTIMEDIA_BB = "${BB_MULTIMEDIA_KERNEL_MODULE}|${BB_MULTIMEDIA_USER_MODULE}|\ - ${BB_MULTIMEDIA_TEST_MODULE}|${BB_GST_PLUGINS}" - -# Enable Multimedia standard pkg -MACHINE_FEATURES_append = " multimedia" - -# UnMask the multimedia kernel modules -#BBMASK .= "|${BB_MULTIMEDIA_KERNEL_MODULE}" - -# UnMask the multimedia user modules -#BBMASK .= "|${BB_MULTIMEDIA_USER_MODULE}" - -# Include static library in SDK -SDKIMAGE_FEATURES_append = " staticdev-pkgs" - -# Mask the DTV pkgs -#MACHINE_FEATURES_append = " dtv" -BBMASK = "dtv-module|ssp-module|scu-module" - -# Enable graphic pkgs -#BBMASK .= "|gles-kernel-module|gles-user-module" - -# Mask the multimedia-test -BBMASK .= "|${BB_MULTIMEDIA_TEST_MODULE}" - -# Mask the graphic test -BBMASK .= "|gles-test-module" - -#DISTRO_FEATURES_append = " mm-test" -#DISTRO_FEATURES_append = " gles-test" - -# Enable Gfx Pkgs -MACHINE_FEATURES_append = " sgx" -MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" - -# for Wayland/Weston - -PREFERRED_PROVIDER_virtual/libgles1 = "" -PREFERRED_PROVIDER_virtual/libgles2 = "gles-user-module" -PREFERRED_PROVIDER_virtual/egl = "libegl" -PREFERRED_PROVIDER_virtual/libgl = "" -PREFERRED_PROVIDER_virtual/mesa = "mesa" -PREFERRED_PROVIDER_libgbm = "libgbm" -PREFERRED_RPROVIDER_libgbm-dev = "libgbm" - -# Setting for u-boot Wayland -UBOOT_MACHINE = "porter_vin_config" - -# Addtional Configurations of Optional OMX modules - -# OMX Media Component H263 Decoder Library -#DISTRO_FEATURES_append = " h263dec_lib" -# OMX Media Component VC-1 Decoder Library -#DISTRO_FEATURES_append = " vc1dec_lib" -# OMX Media Component MPEG-4 Decoder Library -#DISTRO_FEATURES_append = " mpeg4dec_lib" -# VCP3 Driver Adapted for Linux MPEG-2 Decoder Library -#DISTRO_FEATURES_append = " mpeg2dec_lib" -# DivX Decoder Library for Linux -#DISTRO_FEATURES_append = " divxdec_lib" -# Encoder Library for Linux -DISTRO_FEATURES_append = " h264avcenc_lib" - -# Configurations of Optional Audio Decoders -# ARM 5.1ch aacPlus V2 Decoder for Linux -#DISTRO_FEATURES_append = " aacp2dec_lib" -# ARM MP3 Decoder for Linux -#DISTRO_FEATURES_append = " mp3dec_lib" -# ARM WMA Decoder for Linux -#DISTRO_FEATURES_append = " wmadec_lib" -# ARM 5.1ch Dolby Digital Decoder for Linux -#DISTRO_FEATURES_append = " ddddec_lib" -# ARM ALAC Decoder for Linux -#DISTRO_FEATURES_append = " alacdec_lib" -# ARM FLAC Decoder for Linux -#DISTRO_FEATURES_append = " flacdec_lib" -# ARM AAC-LC Decoder Library Sample for Linux -#DISTRO_FEATURES_append = " aaclcsdec_lib" -# ARM AAC Encoder for Linux -#DISTRO_FEATURES_append = " aacenc_lib" - -# Configurations of Optional Audio Middlewares -# ARM 5.1ch aacPlus V2 Decode Middleware for Linux -#DISTRO_FEATURES_append = " armaccp2dec_mdw" -# ARM MP3 Decode Middleware for Linux -#DISTRO_FEATURES_append = " mp3dec_mdw" -# ARM WMA Decode Middleware for Linux -#DISTRO_FEATURES_append = " wmadec_mdw" -# ARM 5.1ch Dolby Digital Decode Middleware for Linux -#DISTRO_FEATURES_append = " ddddec_mdw" -# ARM ALAC Decode Middleware for Linux -#DISTRO_FEATURES_append = " alacdec_mdw" -# ARM FLAC Decode Middleware for Linux -#DISTRO_FEATURES_append = " flacdec_mdw" -# ARM AAC Decode Middleware Sample for Linux -#DISTRO_FEATURES_append = " aacsdec_mdw" -# ARM AAC Encode Middleware for Linux -#DISTRO_FEATURES_append = " aacenc_mdw" - -# Build updatable image. Only takes effect when sota.bbclass is inherited -DISTRO_FEATURES_append = " sota" diff --git a/meta-agl-bsp/conf/include/agl_qemuarm.inc b/meta-agl-bsp/conf/include/agl_qemuarm.inc new file mode 100644 index 000000000..2449e1800 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_qemuarm.inc @@ -0,0 +1,20 @@ +# 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" + +# Use pixman as software renderer to avoid high cpu consumption by GL-renderer +WESTON_USE_PIXMAN = "1" + +# Over-ride setting in oe-core's qemuboot.bbclass +QB_MEM:qemuarm = "-m 2048" + +# Changes to make runqemu work out-of-the-box +QB_AUDIO_DRV:qemuarm := "alsa" +QB_MACHINE:qemuarm := "-machine virt-2.11 -smp 4" +QB_OPT_APPEND:qemuarm := "-show-cursor -device VGA,vgamem_mb=64,edid=on -device qemu-xhci -device usb-tablet -device usb-kbd -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" +QB_KERNEL_CMDLINE_APPEND:qemuarm := "console=ttyAMA0 verbose vmalloc=256M" diff --git a/meta-agl-bsp/conf/include/agl_qemuarm64.inc b/meta-agl-bsp/conf/include/agl_qemuarm64.inc new file mode 100644 index 000000000..46d3b4c39 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_qemuarm64.inc @@ -0,0 +1,20 @@ +# 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" + +# Use pixman as software renderer to avoid high cpu consumption by GL-renderer +WESTON_USE_PIXMAN = "1" + +# Over-ride setting in oe-core's qemuboot.bbclass +QB_MEM:qemuarm64 = "-m 2048" + +# Changes to make runqemu work out-of-the-box +QB_AUDIO_DRV:qemuarm64 := "alsa" +QB_MACHINE:qemuarm64 := "-machine virt -smp 4" +QB_OPT_APPEND:qemuarm64 := " -show-cursor -device VGA,vgamem_mb=64,edid=on -device qemu-xhci -device usb-tablet -device usb-kbd -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" +QB_KERNEL_CMDLINE_APPEND:qemuarm64 := "console=ttyAMA0,115200n8 verbose"
\ No newline at end of file diff --git a/meta-agl-bsp/conf/include/agl_qemuriscv64.inc b/meta-agl-bsp/conf/include/agl_qemuriscv64.inc new file mode 100644 index 000000000..1ffc3cf0e --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_qemuriscv64.inc @@ -0,0 +1,11 @@ +# 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 qemuriscv64.conf +QB_MEM:qemuriscv64 = "-m 2048" + +# Use our own wks file +WKS_FILE="directdisk.wks.in" diff --git a/meta-agl-bsp/conf/include/agl_qemux86-64.inc b/meta-agl-bsp/conf/include/agl_qemux86-64.inc index f058c6bfc..cb40b8b37 100644 --- a/meta-agl-bsp/conf/include/agl_qemux86-64.inc +++ b/meta-agl-bsp/conf/include/agl_qemux86-64.inc @@ -1,23 +1,50 @@ - # Configurations to run on VirtualBox/VMWare # # To get wide screen than default, there are a selection of resolutions # available: # -#APPEND += "uvesafb.mode_option=1024x768-32" -APPEND += "uvesafb.mode_option=1280x1024-32" -#APPEND += "uvesafb.mode_option=1600x1200-32" +#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 -APPEND += "console=ttyS0,115200n8" +QB_KERNEL_CMDLINE_APPEND:append = " console=ttyS0,115200n8" # # All boot message will be off -APPEND += "quiet" +QB_KERNEL_CMDLINE_APPEND:append = " quiet" # Build updatable image. Only takes effect when sota.bbclass is inherited -DISTRO_FEATURES_append = " sota" +DISTRO_FEATURES:append = " sota" + +# Add firmware required by Up^2 board and default Intel mPCIe wifi card +# sold by upshop.org +MACHINE_EXTRA_RRECOMMENDS:append = " \ + linux-firmware-i915 \ + linux-firmware-rtl8168 \ + linux-firmware-ibt-hw-37-8 \ + linux-firmware-iwlwifi-7265d \ + wireless-regdb-static \ +" + +# Image support +# NOTE: wic.{xz,bmap} are here since qemu targets override +# AGL_DEFAULT_IMAGE_FSTYPES to not include them, but for Intel +# we actually do want them for use on physical hardware. +AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap ${@bb.utils.contains('AGL_FEATURES', 'AGLCI', 'wic.vmdk.xz', 'wic.vmdk', d)}" +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" + +# DRM device weston/compositor systemd unit should depend upon +WESTON_DRM_DEVICE = "dev-dri-card0.device" +# Use our own wks file +WKS_FILE="systemd-intel-corei7-64-bootdisk.wks" diff --git a/meta-agl-bsp/conf/include/agl_qemux86.inc b/meta-agl-bsp/conf/include/agl_qemux86.inc deleted file mode 100644 index ae284b3f7..000000000 --- a/meta-agl-bsp/conf/include/agl_qemux86.inc +++ /dev/null @@ -1,25 +0,0 @@ - -# Configurations to run on VirtualBox/VMWare -# -# To get wide screen than default, there are a selection of resolutions -# available: -# -#APPEND += "uvesafb.mode_option=1024x768-32" -APPEND += "uvesafb.mode_option=1280x1024-32" -#APPEND += "uvesafb.mode_option=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 -APPEND += "console=ttyS0,115200n8" -# -# All boot message will be off -APPEND += "quiet" - -# U-Boot support for SOTA -PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot-ota" -UBOOT_MACHINE_sota = "qemu-x86_defconfig" -OSTREE_BOOTLOADER ?= "u-boot" -OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi2.inc b/meta-agl-bsp/conf/include/agl_raspberrypi2.inc deleted file mode 100644 index 2cd9ec2a9..000000000 --- a/meta-agl-bsp/conf/include/agl_raspberrypi2.inc +++ /dev/null @@ -1,40 +0,0 @@ -# Maximum memory allowed to be assigned -GPU_MEM = "255" - -ENABLE_CMA = "1" -CMA_LWM = "16" -CMA_HWM = "32" - -CORE_IMAGE_EXTRA_INSTALL += "wayland weston" - -MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" - -KERNEL_IMAGETYPE = "Image" -KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb" -PREFERRED_VERSION_linux-raspberrypi = "4.4.%" -PREFERRED_VERSION_mesa = "12.%" - -PREFERRED_PROVIDER_virtual/egl = "mesa" -PREFERRED_PROVIDER_virtual/libgles2 = "mesa" -PREFERRED_PROVIDER_virtual/libgl = "mesa" -PREFERRED_PROVIDER_virtual/mesa = "mesa" -PREFERRED_PROVIDER_jpeg = "jpeg" - -MACHINE_FEATURES += "vc4graphics" - -# For libomxil -#LICENSE_FLAGS_WHITELIST = "commercial" - -IMAGE_INSTALL_append = " kernel-modules linux-firmware " - -# 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" - -# Add the custom rpi-sdimg output format -AGL_EXTRA_IMAGE_FSTYPES_append = " rpi-sdimg.xz" - -# Use the AGL default ext4.xz to generate the rpi-sdimg -SDIMG_ROOTFS_TYPE = "ext4.xz" diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc b/meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc deleted file mode 100644 index cfa36afed..000000000 --- a/meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc +++ /dev/null @@ -1,37 +0,0 @@ -# Maximum memory allowed to be assigned -GPU_MEM = "255" - -ENABLE_CMA = "1" -CMA_LWM = "16" -CMA_HWM = "32" - -CORE_IMAGE_EXTRA_INSTALL += "wayland weston" - -MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" - -KERNEL_IMAGETYPE = "Image" -KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb" -PREFERRED_VERSION_linux-raspberrypi = "4.9.%" -PREFERRED_VERSION_mesa = "12.%" - -PREFERRED_PROVIDER_virtual/egl = "mesa" -PREFERRED_PROVIDER_virtual/libgles2 = "mesa" -PREFERRED_PROVIDER_virtual/libgl = "mesa" -PREFERRED_PROVIDER_virtual/mesa = "mesa" -PREFERRED_PROVIDER_jpeg = "jpeg" - -MACHINE_FEATURES += "vc4graphics" - -# For libomxil -#LICENSE_FLAGS_WHITELIST = "commercial" - -IMAGE_INSTALL_append = " kernel-modules linux-firmware " - -# Psplash causes crash on first boot on RPi -IMAGE_FEATURES_remove = "splash" - -# Add the custom rpi-sdimg output format -AGL_EXTRA_IMAGE_FSTYPES_append = " rpi-sdimg.xz" - -# Use the AGL default ext4.xz to generate the rpi-sdimg -SDIMG_ROOTFS_TYPE = "ext4.xz" diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc b/meta-agl-bsp/conf/include/agl_raspberrypi3.inc deleted file mode 100644 index 2cd9ec2a9..000000000 --- a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc +++ /dev/null @@ -1,40 +0,0 @@ -# Maximum memory allowed to be assigned -GPU_MEM = "255" - -ENABLE_CMA = "1" -CMA_LWM = "16" -CMA_HWM = "32" - -CORE_IMAGE_EXTRA_INSTALL += "wayland weston" - -MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" - -KERNEL_IMAGETYPE = "Image" -KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb" -PREFERRED_VERSION_linux-raspberrypi = "4.4.%" -PREFERRED_VERSION_mesa = "12.%" - -PREFERRED_PROVIDER_virtual/egl = "mesa" -PREFERRED_PROVIDER_virtual/libgles2 = "mesa" -PREFERRED_PROVIDER_virtual/libgl = "mesa" -PREFERRED_PROVIDER_virtual/mesa = "mesa" -PREFERRED_PROVIDER_jpeg = "jpeg" - -MACHINE_FEATURES += "vc4graphics" - -# For libomxil -#LICENSE_FLAGS_WHITELIST = "commercial" - -IMAGE_INSTALL_append = " kernel-modules linux-firmware " - -# 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" - -# Add the custom rpi-sdimg output format -AGL_EXTRA_IMAGE_FSTYPES_append = " rpi-sdimg.xz" - -# Use the AGL default ext4.xz to generate the rpi-sdimg -SDIMG_ROOTFS_TYPE = "ext4.xz" diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi4.inc b/meta-agl-bsp/conf/include/agl_raspberrypi4.inc new file mode 100644 index 000000000..4ba7ff0f6 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_raspberrypi4.inc @@ -0,0 +1,37 @@ +# Maximum memory allowed to be assigned +GPU_MEM = "256" + +# Add CMA to the kernel arguments for SOTA +OSTREE_KERNEL_ARGS:sota:append = " cma=256M" + +# use u-boot always +RPI_USE_U_BOOT = "1" + +# Use UART for serial console +ENABLE_UART ?= "1" + +# For libomxil +#LICENSE_FLAGS_ACCEPTED += "commercial" + +# For linux-firmware-rpidistro +LICENSE_FLAGS_ACCEPTED += "synaptics-killswitch" + +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" + +# Add xen build, if the xen feature activated +DISTRO_FEATURES:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}" + +# add xen-tools to build +IMAGE_INSTALL:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', 'xen-tools xen-mkimage-rpi4', '', d)}" + +# Add xen-raspberry binary to boot files +IMAGE_BOOT_FILES:append = " ${@bb.utils.contains('AGL_XEN_WANTED','1', 'xen-${MACHINE}', '',d)}" + +#DISPLAY CONFIGURATION +WESTON_DISPLAYS:raspberrypi4 = " hdmi-a-1-90 hdmi-a-2-90" diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi5.inc b/meta-agl-bsp/conf/include/agl_raspberrypi5.inc new file mode 100644 index 000000000..a0e675956 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_raspberrypi5.inc @@ -0,0 +1,34 @@ +# Maximum memory allowed to be assigned +GPU_MEM = "256" + +# Add CMA to the kernel arguments for SOTA +OSTREE_KERNEL_ARGS:sota:append = " cma=256M" + +# use u-boot always (RPi5 U-boot is not ready yet) +RPI_USE_U_BOOT = "0" + +# Use UART for serial console +ENABLE_UART ?= "1" + +# For libomxil +#LICENSE_FLAGS_ACCEPTED = "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" + +# Add xen build, if the xen feature activated +DISTRO_FEATURES:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}" + +# add xen-tools to build +IMAGE_INSTALL:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', 'xen-tools xen-mkimage-rpi4', '', d)}" + +# Add xen-raspberry binary to boot files +IMAGE_BOOT_FILES:append = " ${@bb.utils.contains('AGL_XEN_WANTED','1', 'xen-${MACHINE}', '',d)}" + +#DISPLAY CONFIGURATION +WESTON_DISPLAYS:raspberrypi5 = " hdmi-a-1-90 hdmi-a-2-90" diff --git a/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc b/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc new file mode 100644 index 000000000..fb67fd976 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc @@ -0,0 +1,60 @@ +DISTRO_FEATURES:append = " sota" + +OSTREE_KERNEL = "Image" +IMAGE_BOOT_FILES:sota = "renesas-ota-bootfiles/* ${DTB_SUFFIX}.dtb" +OSTREE_BOOTLOADER ?= "u-boot" + +WKS_FILE:rcar-gen3 = "singlepart-noloader.wks" + +RENESAS_DATADIR = "/usr" + +IMAGE_INSTALL:append:rcar-gen3 = " \ + kernel-devicetree \ +" + +# +# Workaround to avoid pseudo aborts triggered by the kernel module +# recipes writing to KERNELSRC in do_install, errors are of the form +# (from pseudo.log): +# +# path mismatch [27 links]: ino 19366408 db 'NAMELESS FILE' req 'build/tmp/work-shared/h3ulcb/kernel-source/include'. +# +# See the commit messages in poky commits 4e7c211 and 3b7f2c6 and the +# wiki page at: +# +# https://wiki.yoctoproject.org/wiki/Pseudo_Abort +# +# for details on the pseudo change. These can potentially be moved +# to the recipes in the BSP, or removed if the recipes are changed to +# shift the module headers and symbols to their dev packages. +# +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-avb-mch = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-avb-mse = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-avb-streaming = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-scu-src = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-ssp = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-tddmac = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-tsif = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-mmngr = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-mmngrbuf = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-qos = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-vsp2driver = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-vspmif = ",${KERNELSRC}" +PSEUDO_IGNORE_PATHS:append:pn-kernel-module-vspm = ",${KERNELSRC}" + +# Mask out base-files and systemd bbappends to avoid changing systemd-tmpfiles +# behavior, see SPEC-4256 for a more involved explanation. +BBMASK += "meta-renesas/meta-rcar-gen3/recipes-core/base-files/ meta-renesas/meta-rcar-gen3/recipes-core/systemd/" + +# Mask out cogl bbappend to avoid meta-gnome dependency +BBMASK += "meta-renesas/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend" + +# Provide default value that avoids errors from a new packaging QA +# check with respect to packagegroups depending on versioned library +# packages needing to be machine-specific. +# +# Note that this needs to be done here in global configuration space as +# opposed to in a bbappend because the value needs to be set before the +# packagegroup bbclass is inherited. This can be removed when upstream +# is fixed to add the required PACKAGE_ARCH = "${MACHINE_ARCH}". +PACKAGE_ARCH:pn-packagegroup-multimedia-libs = "${MACHINE_ARCH}" diff --git a/meta-agl-bsp/conf/include/agl_rcar.inc b/meta-agl-bsp/conf/include/agl_rcar.inc new file mode 100644 index 000000000..01314f8c9 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_rcar.inc @@ -0,0 +1,61 @@ +require conf/include/agl_rcar-nogfx.inc + +# Enable AGL virtualization features +MACHINE_FEATURES:append:rcar-gen3 = " agl-egvirt" + +# Enable Gfx Pkgs +MACHINE_FEATURES:append:rcar-gen3 = " gsx" +BB_MULTI_PROVIDER_ALLOWED:append:rcar-gen3 = " virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" + +# for Wayland/Weston +PREFERRED_PROVIDER_virtual/libgles1:rcar-gen3 = "" +PREFERRED_PROVIDER_virtual/libgles2:rcar-gen3 = "virtual-gles-user-module" +PREFERRED_PROVIDER_virtual/egl:rcar-gen3 = "virtual-gles-user-module" +PREFERRED_PROVIDER_virtual/libgl:rcar-gen3 = "" +PREFERRED_PROVIDER_virtual/mesa:rcar-gen3 = "mesa" + +PREFERRED_PROVIDER_libgbm:rcar-gen3 = "libgbm" +PREFERRED_PROVIDER_virtual/libgbm:rcar-gen3 = "libgbm" +PREFERRED_RPROVIDER_libgbm-dev:rcar-gen3 = "libgbm" + +PREFERRED_RPROVIDER_libomxil:rcar-gen3 = "omx-user-module" +PREFERRED_PROVIDER_virtual/libomxil:rcar-gen3 = "omx-user-module" +VIRTUAL-RUNTIME_libomxil:rcar-gen3 = "omx-user-module" + +# Add for gstreamer plugins ugly +LICENSE_FLAGS_ACCEPTED:rcar-gen3 = "commercial" + +MACHINE_FEATURES:append:rcar-gen3 = " multimedia" + +DISTRO_FEATURES:append:rcar-gen3 = " use_eva_pkg" + +#DISTRO_FEATURES:append:rcar-gen3 = " h265dec_lib mpeg2dec_lib" +DISTRO_FEATURES:append:rcar-gen3 = " h264dec_lib h264enc_lib aaclcdec_lib aaclcdec_mdw" + +# Mask out meta-renesas-rcar-gen3's tweaks to weston-init, as they do +# not seem necessary for anything in AGL, and the addition of +# dbus.service and multi-user.target dependencies to the weston systemd +# unit that is done is problematic with respect to potentially blocking +# weston if any user units like application framework "platform" +# services fail. They also likely affect boot up speed with respect to +# getting weston started. There is no clear rationale expressed in the +# meta-renesas-rcar-gen3 commit history for the extra dependencies, and +# testing shows no issues on H3ULCB when not having them. +BBMASK += "meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend" + +# Add graphics and decoder drivers to packagegroup-machine-base +# recommendation. +MACHINE_EXTRA_RRECOMMENDS:append:rcar-gen3 = " \ + kernel-module-pvrsrvkm \ + kernel-module-vsp2 \ + kernel-module-vspm \ + kernel-module-vspm-if \ + omx-user-module \ +" + +# Mask out BSP layer gstreamer* 1.22.x bbappends for now, as the BSP +# effectively is building 1.20.x plugins and packaging them as 1.22, +# which breaks building various things. The whole directory is not +# commented out because we still want the vspfilter plugin. +BBMASK += "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-omx" +BBMASK += "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-" diff --git a/meta-agl-bsp/conf/include/agl_refhw-h3.inc b/meta-agl-bsp/conf/include/agl_refhw-h3.inc new file mode 100644 index 000000000..6eee8149f --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_refhw-h3.inc @@ -0,0 +1,16 @@ +AGL_FEATURES:append:h3ulcb = " agl-refhw-h3" + +# Reference hardware has USB3 +MACHINE_FEATURES:append:h3ulcb = " usb3" + +KERNEL_DEVICETREE:append:h3ulcb = " renesas/r8a77951-agl-refhw.dtb" + +UBOOT_CONFIG:append:h3ulcb = " agl-refhw" +UBOOT_CONFIG[agl-refhw] = "rcar3_salvator-x_defconfig" + +MACHINE_EXTRA_RRECOMMENDS:append:h3ulcb = " \ + linux-firmware-wl18xx \ + ti-bt-firmware \ + wlconf \ + wireless-regdb-static \ +" diff --git a/meta-agl-bsp/conf/include/agl_s4sk.inc b/meta-agl-bsp/conf/include/agl_s4sk.inc new file mode 100644 index 000000000..8f4a91b44 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_s4sk.inc @@ -0,0 +1,9 @@ +SOC_FAMILY = "r8a779f0" +BOARD_NAME = "s4sk" + +#ws2.0 +DTB_SUFFIX = "r8a779f0-s4sk" +WKS_FILE = "singlepart-noloader.wks" +IMAGE_INSTALL:append = " \ + kernel-devicetree \ +" diff --git a/meta-agl-bsp/conf/include/agl_salvator-nogfx.inc b/meta-agl-bsp/conf/include/agl_salvator-nogfx.inc new file mode 100644 index 000000000..06e635ca0 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_salvator-nogfx.inc @@ -0,0 +1,17 @@ +require conf/include/agl_rcar-nogfx.inc + +# Mask graphic Pkgs +BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm" +# Mask MMP recipes +BBMASK += "kernel-module-uvcs-drv|omx-user-module" +# Work around use of obsolete Weston backend-fbdev in meta-rcar-gen3 +# when building without the proprietary driver stack. Masking out the +# weston_%.bbappend seems the simplest approach for now, as forcing +# USE_GLES = "1" to disable the adding of -Dbackend-default="fbdev" to +# EXTRA_OEMESON triggers adding "libgbm" to DEPENDS, which breaks due +# to that being a component specific to the proprietary stack we are +# explicitly disabling. If the "libgbm" usage in the bbappend was +# instead "virtual/libgbm" as is now used in poky, it might be possible +# to just tweak PREFERRED_PROVIDER_virtual/libgbm = "mesa". +BBMASK += "meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend" + diff --git a/meta-agl-bsp/conf/include/agl_salvator.inc b/meta-agl-bsp/conf/include/agl_salvator.inc new file mode 100644 index 000000000..78457868a --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_salvator.inc @@ -0,0 +1,6 @@ +require conf/include/agl_rcar.inc + +IMAGE_INSTALL:append:rcar-gen3 = " \ + kernel-module-vspm-if \ +" + diff --git a/meta-agl-bsp/conf/include/agl_unmatched.inc b/meta-agl-bsp/conf/include/agl_unmatched.inc new file mode 100644 index 000000000..f7c9f75f2 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_unmatched.inc @@ -0,0 +1,4 @@ +# firmware for graphics +MACHINE_EXTRA_RRECOMMENDS:append = " linux-firmware-radeon linux-firmware-amdgpu " + +# diff --git a/meta-agl-bsp/conf/include/agl_virtio-aarch64.inc b/meta-agl-bsp/conf/include/agl_virtio-aarch64.inc new file mode 100644 index 000000000..5093d0bd5 --- /dev/null +++ b/meta-agl-bsp/conf/include/agl_virtio-aarch64.inc @@ -0,0 +1,14 @@ +# 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" + +# Simplest possible option +AGL_DEFAULT_IMAGE_FSTYPES = "ext4" + +# Need to run QEMU with virtio-gpu device +PACKAGECONFIG:append:pn-qemu-system-native = " virglrenderer glx gtk+" diff --git a/meta-agl-bsp/conf/layer.conf b/meta-agl-bsp/conf/layer.conf index 031c4f2be..036cde7a7 100644 --- a/meta-agl-bsp/conf/layer.conf +++ b/meta-agl-bsp/conf/layer.conf @@ -21,4 +21,6 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" BBFILE_COLLECTIONS += "aglbsp" BBFILE_PATTERN_aglbsp = "^${LAYERDIR}/" -BBFILE_PRIORITY_aglbsp = "10" +BBFILE_PRIORITY_aglbsp = "60" + +LAYERSERIES_COMPAT_aglbsp = "scarthgap" diff --git a/meta-agl-bsp/conf/machine/include/virtio.inc b/meta-agl-bsp/conf/machine/include/virtio.inc new file mode 100644 index 000000000..6f8a638a0 --- /dev/null +++ b/meta-agl-bsp/conf/machine/include/virtio.inc @@ -0,0 +1,23 @@ +PREFERRED_PROVIDER_virtual/egl ?= "mesa" +PREFERRED_PROVIDER_virtual/libgl ?= "mesa" +PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa" +PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa" + +MACHINE_FEATURES = "alsa usbgadget screen vfat" + +MACHINEOVERRIDES =. "virtio-all:" + +IMAGE_FSTYPES += "tar.bz2 ext4" + +# Don't include kernels in standard images +RDEPENDS:${KERNEL_PACKAGE_NAME}-base = "" + +# Use a common kernel recipe for all VirtIO machines +PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto" + +# Use newer kernel +PREFERRED_VERSION_linux-yocto = "5.15.%" + +EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native" + +IMAGE_CLASSES += "qemuboot" diff --git a/meta-agl-bsp/conf/machine/virtio-aarch64.conf b/meta-agl-bsp/conf/machine/virtio-aarch64.conf new file mode 100644 index 000000000..d92d43943 --- /dev/null +++ b/meta-agl-bsp/conf/machine/virtio-aarch64.conf @@ -0,0 +1,36 @@ +#@TYPE: Machine +#@NAME: VirtIO ARMv8 machine +#@DESCRIPTION: Machine configuration for running an ARMv8 system on VirtIO based platform + +require conf/machine/include/arm/arch-armv8a.inc +require conf/machine/include/virtio.inc + +KERNEL_IMAGETYPE = "Image" + +SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0" +SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}" + +# For runqemu +QB_SYSTEM_NAME = "qemu-system-aarch64" +QB_MACHINE = "-machine virt" +QB_CPU = "-cpu cortex-a57" +QB_CPU_KVM = "-cpu host -machine gic-version=3" +QB_MEM = "-m 2048" +# Standard Serial console +QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0" +# Ensure virtio-mmio support VirtIO 1.0 required by virtio-gpu +QB_OPT_APPEND = "-global virtio-mmio.force-legacy=false" +# TODO: upstream to OE-core runqemu +QB_OPT_APPEND += "-device virtio-gpu-device -display gtk,gl=on -show-cursor" +# Virtio input +QB_OPT_APPEND += "-device virtio-mouse-device -device virtio-keyboard-device" +# Add the 'virtio-rng-device' device otherwise the guest may run out of entropy +QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0" +# Virtio Networking support +QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" +QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" +# Virtio block device +QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" +# Virtio serial console +QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" +QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon" diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/gpsd.refhw b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/gpsd.refhw new file mode 100644 index 000000000..d22970681 --- /dev/null +++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/gpsd.refhw @@ -0,0 +1,5 @@ +# Default settings for gpsd. +START_DAEMON="true" +GPSD_OPTIONS="" +DEVICES="/dev/ttySC3" +GPSD_SOCKET="/var/run/gpsd.sock" diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh new file mode 100644 index 000000000..d183ba43c --- /dev/null +++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# +# Script to detect AGL Reference Hardware and switch gpsd +# configuration as necessary. +# +# NOTE: +# For the most part errors are ignored and the script returns +# 0/success so gpsd still be started if the script is somehow +# run on a board without the expected hardware. + +COMPAT=/sys/firmware/devicetree/base/compatible +GPSTTY=/dev/ttySC3 + +#if [ ! \( -f "$COMPAT" -a -c "$GPSTTY" -a -f /etc/default/gpsd.refhw \) ]; then +if [ ! \( -f "$COMPAT" -a -f /etc/default/gpsd.refhw \) ]; then + exit 0 +fi + +found=false +for c in `cat $COMPAT | tr '\0' ' '`; do + if echo $c | grep -q '^agl,refhw-h3$'; then + found=true + break + fi +done + +if $found; then + if [ ! -c "$GPSTTY" ]; then + exit 0 + fi + update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 20 +else + update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 5 +fi +exit 0 diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh.bak b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh.bak new file mode 100644 index 000000000..2c9089aa0 --- /dev/null +++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh.bak @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Script to detect AGL Reference Hardware and switch gpdf configuration +# as needed. +# +# NOTE: +# For the most part errors are ignored and the script returns +# 0/success so gpsd still be started if the script is somehow +# run on a board without the expected hardware. + +COMPAT=/sys/firmware/devicetree/base/compatible +GPSTTY=/dev/ttySC3 + +if [ ! \( -f "$COMPAT" -a -c "$GPSTTY" -a -f /etc/default/gpsd.refhw \) ]; then + exit 0 +fi + +found=false +for c in `cat $COMPAT | tr '\0' ' '`; do + echo "c = $c" + if echo $c | grep -q '^agl,refhw-h3$'; then + found=true + break + fi +done + +if $found; then + update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 20 +else + update-alternatives --remove gpsd-defaults /etc/default/gpsd.refhw +fi +exit 0 diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw.conf b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw.conf new file mode 100644 index 000000000..b7e3a7b0d --- /dev/null +++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw.conf @@ -0,0 +1,2 @@ +[Service] +ExecStartPre=-/usr/sbin/refhw-gpsd-helper.sh diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend new file mode 100644 index 000000000..3cd5aa7de --- /dev/null +++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend @@ -0,0 +1,33 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI = "file://gpsd.refhw \ + file://refhw-gpsd-helper.sh \ + file://refhw.conf \ +" + +inherit update-alternatives + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + install -D -m 0644 ${WORKDIR}/gpsd.refhw ${D}/${sysconfdir}/default/gpsd.refhw + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -D -m 0755 ${WORKDIR}/refhw-gpsd-helper.sh ${D}/${sbindir}/refhw-gpsd-helper.sh + install -d ${D}${sysconfdir}/systemd/system/gpsd.service.d + install -D -m 0644 ${WORKDIR}/refhw.conf ${D}${sysconfdir}/systemd/system/gpsd.service.d/refhw.conf + fi +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +CONFFILES:${PN} = "${sysconfdir}/default/gpsd.refhw" + +ALTERNATIVE:${PN} = "gpsd-defaults" +ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd" +ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.refhw" +# NOTE: Priority needs to be below default of 10 to avoid overriding the +# default configuration. The script run by the systemd drop-in +# will tweak things on boot to handle h3ulcb vs refhw. +ALTERNATIVE_PRIORITY[gpsd-defaults] = "5" diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/ath9k_htc.cfg deleted file mode 100644 index 6f7d49880..000000000 --- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/ath9k_htc.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_CFG80211=m -CONFIG_MAC80211=m -CONFIG_ATH_CARDS=m -CONFIG_ATH9K_HTC=m diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/btusb.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/btusb.cfg deleted file mode 100644 index 9c2a82d99..000000000 --- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/btusb.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_BT_INTEL=m -CONFIG_BT_BCM=m -CONFIG_BT_HCIBTUSB=m -CONFIG_BT_HCIBTUSB_BCM=y
\ No newline at end of file diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/hid.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/hid.cfg deleted file mode 100644 index 95de5181e..000000000 --- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/hid.cfg +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_USB_HID=y -# CONFIG_HID_PID is not set -CONFIG_HID_MULTITOUCH=y diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/rtl_sdr.cfg deleted file mode 100644 index df5a871ef..000000000 --- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/rtl_sdr.cfg +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_I2C_MUX=y -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-bsp/meta-boundary/recipes-kernel/linux/linux-boundary_4.1.15.bbappend b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/linux-boundary_4.1.15.bbappend deleted file mode 100644 index 5dbd457df..000000000 --- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/linux-boundary_4.1.15.bbappend +++ /dev/null @@ -1,33 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -DEPENDS += "kern-tools-native" - -# Enable support for AR9271 -SRC_URI_append = " file://ath9k_htc.cfg" - -# Enable support for Bluetooth HCI USB devices -SRC_URI_append = " file://btusb.cfg" - -# Enable support for Bluetooth HCI USB devices -SRC_URI_append = " file://btusb.cfg" - -# Enable support for HID multitouch -SRC_URI_append = " file://hid.cfg" - -# Enable support for RTLSDR -SRC_URI_append = " file://rtl_sdr.cfg" - -# 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_prepend () { - cp -a ${WORKDIR}/defconfig .config - merge_config.sh -m .config ${@" ".join(find_cfgs(d))} -}
\ No newline at end of file diff --git a/meta-agl-bsp/meta-core/recipes-core/glibc/files/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch b/meta-agl-bsp/meta-core/recipes-core/glibc/files/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch deleted file mode 100644 index f06f85c62..000000000 --- a/meta-agl-bsp/meta-core/recipes-core/glibc/files/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch +++ /dev/null @@ -1,637 +0,0 @@ -From e7ba24f05d86acf7072e066ea6d7b235a106688c Mon Sep 17 00:00:00 2001 -From: Carlos O'Donell <carlos@redhat.com> -Date: Sat, 28 Jan 2017 19:13:34 -0500 -Subject: [PATCH] Bug 20116: Fix use after free in pthread_create() - -The commit documents the ownership rules around 'struct pthread' and -when a thread can read or write to the descriptor. With those ownership -rules in place it becomes obvious that pd->stopped_start should not be -touched in several of the paths during thread startup, particularly so -for detached threads. In the case of detached threads, between the time -the thread is created by the OS kernel and the creating thread checks -pd->stopped_start, the detached thread might have already exited and the -memory for pd unmapped. As a regression test we add a simple test which -exercises this exact case by quickly creating detached threads with -large enough stacks to ensure the thread stack cache is bypassed and the -stacks are unmapped. Before the fix the testcase segfaults, after the -fix it works correctly and completes without issue. - -For a detailed discussion see: -https://www.sourceware.org/ml/libc-alpha/2017-01/msg00505.html - -(cherry-picked from commit f8bf15febcaf137bbec5a61101e88cd5a9d56ca8) - -Upstream-Status: Backport [master] -Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com> ---- - ChangeLog | 23 ++++ - nptl/Makefile | 3 +- - nptl/createthread.c | 10 +- - nptl/pthread_create.c | 207 +++++++++++++++++++++++++++------ - nptl/pthread_getschedparam.c | 1 + - nptl/pthread_setschedparam.c | 1 + - nptl/pthread_setschedprio.c | 1 + - nptl/tpp.c | 2 + - nptl/tst-create-detached.c | 137 ++++++++++++++++++++++ - sysdeps/nacl/createthread.c | 10 +- - sysdeps/unix/sysv/linux/createthread.c | 16 ++- - 11 files changed, 356 insertions(+), 55 deletions(-) - create mode 100644 nptl/tst-create-detached.c - -diff --git a/nptl/Makefile b/nptl/Makefile -index 0d8aadebed..7dec4edb53 100644 ---- a/nptl/Makefile -+++ b/nptl/Makefile -@@ -290,7 +290,8 @@ tests = tst-typesizes \ - tst-initializers1 $(addprefix tst-initializers1-,\ - c89 gnu89 c99 gnu99 c11 gnu11) \ - tst-bad-schedattr \ -- tst-thread_local1 tst-mutex-errorcheck tst-robust10 -+ tst-thread_local1 tst-mutex-errorcheck tst-robust10 \ -+ tst-create-detached \ - xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \ - tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 - test-srcs = tst-oddstacklimit -diff --git a/nptl/createthread.c b/nptl/createthread.c -index ba2f9c7167..328f85865d 100644 ---- a/nptl/createthread.c -+++ b/nptl/createthread.c -@@ -25,16 +25,14 @@ - - static int - create_thread (struct pthread *pd, const struct pthread_attr *attr, -- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) -+ bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) - { - /* If the implementation needs to do some tweaks to the thread after - it has been created at the OS level, it can set STOPPED_START here. */ - -- pd->stopped_start = stopped_start; -- if (__glibc_unlikely (stopped_start)) -- /* We make sure the thread does not run far by forcing it to get a -- lock. We lock it here too so that the new thread cannot continue -- until we tell it to. */ -+ pd->stopped_start = *stopped_start; -+ if (__glibc_unlikely (*stopped_start)) -+ /* See CONCURRENCY NOTES in nptl/pthread_create.c. */ - lll_lock (pd->lock, LLL_PRIVATE); - - return ENOSYS; -diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c -index a834063ad5..44b17bec86 100644 ---- a/nptl/pthread_create.c -+++ b/nptl/pthread_create.c -@@ -54,25 +54,141 @@ unsigned int __nptl_nthreads = 1; - /* Code to allocate and deallocate a stack. */ - #include "allocatestack.c" - --/* createthread.c defines this function, and two macros: -+/* CONCURRENCY NOTES: -+ -+ Understanding who is the owner of the 'struct pthread' or 'PD' -+ (refers to the value of the 'struct pthread *pd' function argument) -+ is critically important in determining exactly which operations are -+ allowed and which are not and when, particularly when it comes to the -+ implementation of pthread_create, pthread_join, pthread_detach, and -+ other functions which all operate on PD. -+ -+ The owner of PD is responsible for freeing the final resources -+ associated with PD, and may examine the memory underlying PD at any -+ point in time until it frees it back to the OS or to reuse by the -+ runtime. -+ -+ The thread which calls pthread_create is called the creating thread. -+ The creating thread begins as the owner of PD. -+ -+ During startup the new thread may examine PD in coordination with the -+ owner thread (which may be itself). -+ -+ The four cases of ownership transfer are: -+ -+ (1) Ownership of PD is released to the process (all threads may use it) -+ after the new thread starts in a joinable state -+ i.e. pthread_create returns a usable pthread_t. -+ -+ (2) Ownership of PD is released to the new thread starting in a detached -+ state. -+ -+ (3) Ownership of PD is dynamically released to a running thread via -+ pthread_detach. -+ -+ (4) Ownership of PD is acquired by the thread which calls pthread_join. -+ -+ Implementation notes: -+ -+ The PD->stopped_start and thread_ran variables are used to determine -+ exactly which of the four ownership states we are in and therefore -+ what actions can be taken. For example after (2) we cannot read or -+ write from PD anymore since the thread may no longer exist and the -+ memory may be unmapped. The most complicated cases happen during -+ thread startup: -+ -+ (a) If the created thread is in a detached (PTHREAD_CREATE_DETACHED), -+ or joinable (default PTHREAD_CREATE_JOINABLE) state and -+ STOPPED_START is true, then the creating thread has ownership of -+ PD until the PD->lock is released by pthread_create. If any -+ errors occur we are in states (c), (d), or (e) below. -+ -+ (b) If the created thread is in a detached state -+ (PTHREAD_CREATED_DETACHED), and STOPPED_START is false, then the -+ creating thread has ownership of PD until it invokes the OS -+ kernel's thread creation routine. If this routine returns -+ without error, then the created thread owns PD; otherwise, see -+ (c) and (e) below. -+ -+ (c) If the detached thread setup failed and THREAD_RAN is true, then -+ the creating thread releases ownership to the new thread by -+ sending a cancellation signal. All threads set THREAD_RAN to -+ true as quickly as possible after returning from the OS kernel's -+ thread creation routine. -+ -+ (d) If the joinable thread setup failed and THREAD_RAN is true, then -+ then the creating thread retains ownership of PD and must cleanup -+ state. Ownership cannot be released to the process via the -+ return of pthread_create since a non-zero result entails PD is -+ undefined and therefore cannot be joined to free the resources. -+ We privately call pthread_join on the thread to finish handling -+ the resource shutdown (Or at least we should, see bug 19511). -+ -+ (e) If the thread creation failed and THREAD_RAN is false, then the -+ creating thread retains ownership of PD and must cleanup state. -+ No waiting for the new thread is required because it never -+ started. -+ -+ The nptl_db interface: -+ -+ The interface with nptl_db requires that we enqueue PD into a linked -+ list and then call a function which the debugger will trap. The PD -+ will then be dequeued and control returned to the thread. The caller -+ at the time must have ownership of PD and such ownership remains -+ after control returns to thread. The enqueued PD is removed from the -+ linked list by the nptl_db callback td_thr_event_getmsg. The debugger -+ must ensure that the thread does not resume execution, otherwise -+ ownership of PD may be lost and examining PD will not be possible. -+ -+ Note that the GNU Debugger as of (December 10th 2015) commit -+ c2c2a31fdb228d41ce3db62b268efea04bd39c18 no longer uses -+ td_thr_event_getmsg and several other related nptl_db interfaces. The -+ principal reason for this is that nptl_db does not support non-stop -+ mode where other threads can run concurrently and modify runtime -+ structures currently in use by the debugger and the nptl_db -+ interface. -+ -+ Axioms: -+ -+ * The create_thread function can never set stopped_start to false. -+ * The created thread can read stopped_start but never write to it. -+ * The variable thread_ran is set some time after the OS thread -+ creation routine returns, how much time after the thread is created -+ is unspecified, but it should be as quickly as possible. -+ -+*/ -+ -+/* CREATE THREAD NOTES: -+ -+ createthread.c defines the create_thread function, and two macros: - START_THREAD_DEFN and START_THREAD_SELF (see below). - -- create_thread is obliged to initialize PD->stopped_start. It -- should be true if the STOPPED_START parameter is true, or if -- create_thread needs the new thread to synchronize at startup for -- some other implementation reason. If PD->stopped_start will be -- true, then create_thread is obliged to perform the operation -- "lll_lock (PD->lock, LLL_PRIVATE)" before starting the thread. -+ create_thread must initialize PD->stopped_start. It should be true -+ if the STOPPED_START parameter is true, or if create_thread needs the -+ new thread to synchronize at startup for some other implementation -+ reason. If STOPPED_START will be true, then create_thread is obliged -+ to lock PD->lock before starting the thread. Then pthread_create -+ unlocks PD->lock which synchronizes-with START_THREAD_DEFN in the -+ child thread which does an acquire/release of PD->lock as the last -+ action before calling the user entry point. The goal of all of this -+ is to ensure that the required initial thread attributes are applied -+ (by the creating thread) before the new thread runs user code. Note -+ that the the functions pthread_getschedparam, pthread_setschedparam, -+ pthread_setschedprio, __pthread_tpp_change_priority, and -+ __pthread_current_priority reuse the same lock, PD->lock, for a -+ similar purpose e.g. synchronizing the setting of similar thread -+ attributes. These functions are never called before the thread is -+ created, so don't participate in startup syncronization, but given -+ that the lock is present already and in the unlocked state, reusing -+ it saves space. - - The return value is zero for success or an errno code for failure. - If the return value is ENOMEM, that will be translated to EAGAIN, - so create_thread need not do that. On failure, *THREAD_RAN should - be set to true iff the thread actually started up and then got -- cancelled before calling user code (*PD->start_routine), in which -- case it is responsible for doing its own cleanup. */ -- -+ canceled before calling user code (*PD->start_routine). */ - static int create_thread (struct pthread *pd, const struct pthread_attr *attr, -- bool stopped_start, STACK_VARIABLES_PARMS, -+ bool *stopped_start, STACK_VARIABLES_PARMS, - bool *thread_ran); - - #include <createthread.c> -@@ -314,12 +430,19 @@ START_THREAD_DEFN - /* Store the new cleanup handler info. */ - THREAD_SETMEM (pd, cleanup_jmp_buf, &unwind_buf); - -+ /* We are either in (a) or (b), and in either case we either own -+ PD already (2) or are about to own PD (1), and so our only -+ restriction would be that we can't free PD until we know we -+ have ownership (see CONCURRENCY NOTES above). */ - if (__glibc_unlikely (pd->stopped_start)) - { - int oldtype = CANCEL_ASYNC (); - - /* Get the lock the parent locked to force synchronization. */ - lll_lock (pd->lock, LLL_PRIVATE); -+ -+ /* We have ownership of PD now. */ -+ - /* And give it up right away. */ - lll_unlock (pd->lock, LLL_PRIVATE); - -@@ -378,7 +501,8 @@ START_THREAD_DEFN - pd, pd->nextevent)); - } - -- /* Now call the function to signal the event. */ -+ /* Now call the function which signals the event. See -+ CONCURRENCY NOTES for the nptl_db interface comments. */ - __nptl_death_event (); - } - } -@@ -642,19 +766,28 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, - that cares whether the thread count is correct. */ - atomic_increment (&__nptl_nthreads); - -- bool thread_ran = false; -+ /* Our local value of stopped_start and thread_ran can be accessed at -+ any time. The PD->stopped_start may only be accessed if we have -+ ownership of PD (see CONCURRENCY NOTES above). */ -+ bool stopped_start = false; bool thread_ran = false; - - /* Start the thread. */ - if (__glibc_unlikely (report_thread_creation (pd))) - { -- /* Create the thread. We always create the thread stopped -- so that it does not get far before we tell the debugger. */ -- retval = create_thread (pd, iattr, true, STACK_VARIABLES_ARGS, -- &thread_ran); -+ stopped_start = true; -+ -+ /* We always create the thread stopped at startup so we can -+ notify the debugger. */ -+ retval = create_thread (pd, iattr, &stopped_start, -+ STACK_VARIABLES_ARGS, &thread_ran); - if (retval == 0) - { -- /* create_thread should have set this so that the logic below can -- test it. */ -+ /* We retain ownership of PD until (a) (see CONCURRENCY NOTES -+ above). */ -+ -+ /* Assert stopped_start is true in both our local copy and the -+ PD copy. */ -+ assert (stopped_start); - assert (pd->stopped_start); - - /* Now fill in the information about the new thread in -@@ -671,26 +804,30 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, - pd, pd->nextevent) - != 0); - -- /* Now call the function which signals the event. */ -+ /* Now call the function which signals the event. See -+ CONCURRENCY NOTES for the nptl_db interface comments. */ - __nptl_create_event (); - } - } - else -- retval = create_thread (pd, iattr, false, STACK_VARIABLES_ARGS, -- &thread_ran); -+ retval = create_thread (pd, iattr, &stopped_start, -+ STACK_VARIABLES_ARGS, &thread_ran); - - if (__glibc_unlikely (retval != 0)) - { -- /* If thread creation "failed", that might mean that the thread got -- created and ran a little--short of running user code--but then -- create_thread cancelled it. In that case, the thread will do all -- its own cleanup just like a normal thread exit after a successful -- creation would do. */ -- - if (thread_ran) -- assert (pd->stopped_start); -+ /* State (c) or (d) and we may not have PD ownership (see -+ CONCURRENCY NOTES above). We can assert that STOPPED_START -+ must have been true because thread creation didn't fail, but -+ thread attribute setting did. */ -+ /* See bug 19511 which explains why doing nothing here is a -+ resource leak for a joinable thread. */ -+ assert (stopped_start); - else - { -+ /* State (e) and we have ownership of PD (see CONCURRENCY -+ NOTES above). */ -+ - /* Oops, we lied for a second. */ - atomic_decrement (&__nptl_nthreads); - -@@ -710,10 +847,14 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, - } - else - { -- if (pd->stopped_start) -- /* The thread blocked on this lock either because we're doing TD_CREATE -- event reporting, or for some other reason that create_thread chose. -- Now let it run free. */ -+ /* We don't know if we have PD ownership. Once we check the local -+ stopped_start we'll know if we're in state (a) or (b) (see -+ CONCURRENCY NOTES above). */ -+ if (stopped_start) -+ /* State (a), we own PD. The thread blocked on this lock either -+ because we're doing TD_CREATE event reporting, or for some -+ other reason that create_thread chose. Now let it run -+ free. */ - lll_unlock (pd->lock, LLL_PRIVATE); - - /* We now have for sure more than one thread. The main thread might -diff --git a/nptl/pthread_getschedparam.c b/nptl/pthread_getschedparam.c -index b887881baf..de71171a08 100644 ---- a/nptl/pthread_getschedparam.c -+++ b/nptl/pthread_getschedparam.c -@@ -35,6 +35,7 @@ __pthread_getschedparam (pthread_t threadid, int *policy, - - int result = 0; - -+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */ - lll_lock (pd->lock, LLL_PRIVATE); - - /* The library is responsible for maintaining the values at all -diff --git a/nptl/pthread_setschedparam.c b/nptl/pthread_setschedparam.c -index dfb52b9dbf..dcb520f1c8 100644 ---- a/nptl/pthread_setschedparam.c -+++ b/nptl/pthread_setschedparam.c -@@ -36,6 +36,7 @@ __pthread_setschedparam (pthread_t threadid, int policy, - - int result = 0; - -+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */ - lll_lock (pd->lock, LLL_PRIVATE); - - struct sched_param p; -diff --git a/nptl/pthread_setschedprio.c b/nptl/pthread_setschedprio.c -index cefc6481d6..8134b50560 100644 ---- a/nptl/pthread_setschedprio.c -+++ b/nptl/pthread_setschedprio.c -@@ -38,6 +38,7 @@ pthread_setschedprio (pthread_t threadid, int prio) - struct sched_param param; - param.sched_priority = prio; - -+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */ - lll_lock (pd->lock, LLL_PRIVATE); - - /* If the thread should have higher priority because of some -diff --git a/nptl/tpp.c b/nptl/tpp.c -index e175bf4d53..223bd6bbee 100644 ---- a/nptl/tpp.c -+++ b/nptl/tpp.c -@@ -114,6 +114,7 @@ __pthread_tpp_change_priority (int previous_prio, int new_prio) - if (priomax == newpriomax) - return 0; - -+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */ - lll_lock (self->lock, LLL_PRIVATE); - - tpp->priomax = newpriomax; -@@ -165,6 +166,7 @@ __pthread_current_priority (void) - - int result = 0; - -+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */ - lll_lock (self->lock, LLL_PRIVATE); - - if ((self->flags & ATTR_FLAG_SCHED_SET) == 0) -diff --git a/nptl/tst-create-detached.c b/nptl/tst-create-detached.c -new file mode 100644 -index 0000000000..ea93e441c7 ---- /dev/null -+++ b/nptl/tst-create-detached.c -@@ -0,0 +1,137 @@ -+/* Bug 20116: Test rapid creation of detached threads. -+ Copyright (C) 2017 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; see the file COPYING.LIB. If -+ not, see <http://www.gnu.org/licenses/>. */ -+ -+/* The goal of the test is to trigger a failure if the parent touches -+ any part of the thread descriptor after the detached thread has -+ exited. We test this by creating many detached threads with large -+ stacks. The stacks quickly fill the the stack cache and subsequent -+ threads will start to cause the thread stacks to be immediately -+ unmapped to satisfy the stack cache max. With the stacks being -+ unmapped the parent's read of any part of the thread descriptor will -+ trigger a segfault. That segfault is what we are trying to cause, -+ since any segfault is a defect in the implementation. */ -+ -+#include <pthread.h> -+#include <stdio.h> -+#include <errno.h> -+#include <unistd.h> -+#include <stdbool.h> -+#include <sys/resource.h> -+#include <support/xthread.h> -+ -+/* Number of threads to create. */ -+enum { threads_to_create = 100000 }; -+ -+/* Number of threads which should spawn other threads. */ -+enum { creator_threads = 2 }; -+ -+/* Counter of threads created so far. This is incremented by all the -+ running creator threads. */ -+static unsigned threads_created; -+ -+/* Thread callback which does nothing, so that the thread exits -+ immediatedly. */ -+static void * -+do_nothing (void *arg) -+{ -+ return NULL; -+} -+ -+/* Attribute indicating that the thread should be created in a detached -+ fashion. */ -+static pthread_attr_t detached; -+ -+/* Barrier to synchronize initialization. */ -+static pthread_barrier_t barrier; -+ -+static void * -+creator_thread (void *arg) -+{ -+ int ret; -+ xpthread_barrier_wait (&barrier); -+ -+ while (true) -+ { -+ pthread_t thr; -+ /* Thread creation will fail if the kernel does not free old -+ threads quickly enough, so we do not report errors. */ -+ ret = pthread_create (&thr, &detached, do_nothing, NULL); -+ if (ret == 0 && __atomic_add_fetch (&threads_created, 1, __ATOMIC_SEQ_CST) -+ >= threads_to_create) -+ break; -+ } -+ -+ return NULL; -+} -+ -+static int -+do_test (void) -+{ -+ /* Limit the size of the process, so that memory allocation will -+ fail without impacting the entire system. */ -+ { -+ struct rlimit limit; -+ if (getrlimit (RLIMIT_AS, &limit) != 0) -+ { -+ printf ("FAIL: getrlimit (RLIMIT_AS) failed: %m\n"); -+ return 1; -+ } -+ /* This limit, 800MB, is just a heuristic. Any value can be -+ picked. */ -+ long target = 800 * 1024 * 1024; -+ if (limit.rlim_cur == RLIM_INFINITY || limit.rlim_cur > target) -+ { -+ limit.rlim_cur = target; -+ if (setrlimit (RLIMIT_AS, &limit) != 0) -+ { -+ printf ("FAIL: setrlimit (RLIMIT_AS) failed: %m\n"); -+ return 1; -+ } -+ } -+ } -+ -+ xpthread_attr_init (&detached); -+ -+ xpthread_attr_setdetachstate (&detached, PTHREAD_CREATE_DETACHED); -+ -+ /* A large thread stack seems beneficial for reproducing a race -+ condition in detached thread creation. The goal is to reach the -+ limit of the runtime thread stack cache such that the detached -+ thread's stack is unmapped after exit and causes a segfault when -+ the parent reads the thread descriptor data stored on the the -+ unmapped stack. */ -+ xpthread_attr_setstacksize (&detached, 16 * 1024 * 1024); -+ -+ xpthread_barrier_init (&barrier, NULL, creator_threads); -+ -+ pthread_t threads[creator_threads]; -+ -+ for (int i = 0; i < creator_threads; ++i) -+ threads[i] = xpthread_create (NULL, creator_thread, NULL); -+ -+ for (int i = 0; i < creator_threads; ++i) -+ xpthread_join (threads[i]); -+ -+ xpthread_attr_destroy (&detached); -+ -+ xpthread_barrier_destroy (&barrier); -+ -+ return 0; -+} -+ -+#include <support/test-driver.c> -diff --git a/sysdeps/nacl/createthread.c b/sysdeps/nacl/createthread.c -index 7b571c34e2..5465558cc1 100644 ---- a/sysdeps/nacl/createthread.c -+++ b/sysdeps/nacl/createthread.c -@@ -32,15 +32,13 @@ static void start_thread (void) __attribute__ ((noreturn)); - - static int - create_thread (struct pthread *pd, const struct pthread_attr *attr, -- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) -+ bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) - { - pd->tid = __nacl_get_tid (pd); - -- pd->stopped_start = stopped_start; -- if (__glibc_unlikely (stopped_start)) -- /* We make sure the thread does not run far by forcing it to get a -- lock. We lock it here too so that the new thread cannot continue -- until we tell it to. */ -+ pd->stopped_start = *stopped_start; -+ if (__glibc_unlikely (*stopped_start)) -+ /* See CONCURRENCY NOTES in nptl/pthread_create.c. */ - lll_lock (pd->lock, LLL_PRIVATE); - - TLS_DEFINE_INIT_TP (tp, pd); -diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c -index 6d32cece48..66ddae61d4 100644 ---- a/sysdeps/unix/sysv/linux/createthread.c -+++ b/sysdeps/unix/sysv/linux/createthread.c -@@ -46,7 +46,7 @@ static int start_thread (void *arg) __attribute__ ((noreturn)); - - static int - create_thread (struct pthread *pd, const struct pthread_attr *attr, -- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) -+ bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) - { - /* Determine whether the newly created threads has to be started - stopped since we have to set the scheduling parameters or set the -@@ -54,13 +54,11 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr, - if (attr != NULL - && (__glibc_unlikely (attr->cpuset != NULL) - || __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0))) -- stopped_start = true; -+ *stopped_start = true; - -- pd->stopped_start = stopped_start; -- if (__glibc_unlikely (stopped_start)) -- /* We make sure the thread does not run far by forcing it to get a -- lock. We lock it here too so that the new thread cannot continue -- until we tell it to. */ -+ pd->stopped_start = *stopped_start; -+ if (__glibc_unlikely (*stopped_start)) -+ /* See CONCURRENCY NOTES in nptl/pthread_creat.c. */ - lll_lock (pd->lock, LLL_PRIVATE); - - /* We rely heavily on various flags the CLONE function understands: -@@ -117,7 +115,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr, - /* Set the affinity mask if necessary. */ - if (attr->cpuset != NULL) - { -- assert (stopped_start); -+ assert (*stopped_start); - - res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid, - attr->cpusetsize, attr->cpuset); -@@ -140,7 +138,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr, - /* Set the scheduling parameters. */ - if ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0) - { -- assert (stopped_start); -+ assert (*stopped_start); - - res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid, - pd->schedpolicy, &pd->schedparam); --- -2.11.0 - diff --git a/meta-agl-bsp/meta-core/recipes-core/glibc/glibc_2.24.bbappend b/meta-agl-bsp/meta-core/recipes-core/glibc/glibc_2.24.bbappend deleted file mode 100644 index a9f2a238d..000000000 --- a/meta-agl-bsp/meta-core/recipes-core/glibc/glibc_2.24.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -# include fix for CVE-2017-1000366 -SRCREV = "86ac4a78a9218d1e1dcfbacc6f7d09957c1fe3a4"
\ No newline at end of file diff --git a/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 000000000..fb797a436 --- /dev/null +++ b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_agl.inc', '', d)} diff --git a/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_agl.inc b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_agl.inc new file mode 100644 index 000000000..e74761317 --- /dev/null +++ b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_agl.inc @@ -0,0 +1,7 @@ +# 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}" +PACKAGECONFIG:append:intel-corei7-64 = " gallium ${GALLIUM_LLVM}" + +DRIDRIVERS:append:intel-corei7-64 = ",i965" diff --git a/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_%.bbappend b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_%.bbappend new file mode 100644 index 000000000..3d5903d85 --- /dev/null +++ b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_%.bbappend @@ -0,0 +1 @@ +require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_agl.inc', '', d)} diff --git a/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_agl.inc b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_agl.inc new file mode 100644 index 000000000..e3b36034f --- /dev/null +++ b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_agl.inc @@ -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-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg b/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg deleted file mode 100755 index c9c4fe2ed..000000000 --- a/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# -# 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-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend deleted file mode 100755 index 99c9581b2..000000000 --- a/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:" - -# Extra configuration options for the QEMU kernel -SRC_URI += "file://hciattach.cfg \ - " diff --git a/meta-agl-bsp/meta-core/recipes-support/gnutls/files/check_SYS_getrandom.patch b/meta-agl-bsp/meta-core/recipes-support/gnutls/files/check_SYS_getrandom.patch deleted file mode 100644 index 535c22af1..000000000 --- a/meta-agl-bsp/meta-core/recipes-support/gnutls/files/check_SYS_getrandom.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f26c3979ab0325edb2e410d287bc501cf00e0ac0 Mon Sep 17 00:00:00 2001 -From: Nikos Mavrogiannopoulos <nmav@redhat.com> -Date: Mon, 22 Aug 2016 16:32:34 +0200 -Subject: [PATCH] rnd-linux: added check for SYS_getrandom being defined - -This allows to compile the getrandom() code in old Linux systems -which do not have the system call defined. ---- - -Upstream-Status: Backport -Signed-off-by: Khem Raj <raj.khem@gmail.com> - - lib/nettle/rnd-linux.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c -index d7f07a6..7a24d05 100644 ---- a/lib/nettle/rnd-linux.c -+++ b/lib/nettle/rnd-linux.c -@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0; - # else - # include <sys/syscall.h> - # undef getrandom --# define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags) -+# if defined(SYS_getrandom) -+# define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags) -+# else -+# define getrandom(dst,s,flags) -1 -+# endif - # endif - - static unsigned have_getrandom(void) --- -libgit2 0.24.0 - diff --git a/meta-agl-bsp/meta-core/recipes-support/gnutls/gnutls_3.5.3.bbappend b/meta-agl-bsp/meta-core/recipes-support/gnutls/gnutls_3.5.3.bbappend deleted file mode 100644 index dc67743fc..000000000 --- a/meta-agl-bsp/meta-core/recipes-support/gnutls/gnutls_3.5.3.bbappend +++ /dev/null @@ -1,8 +0,0 @@ -FILESEXTRAPATHS_append := ":${THISDIR}/files" - -SRC_URI_append = "\ - file://check_SYS_getrandom.patch \ - " - - -# backport from https://patchwork.openembedded.org/patch/133002/ diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.service b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.service new file mode 100644 index 000000000..f8eda0cba --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.service @@ -0,0 +1,9 @@ +[Unit] +Description=Bluetooth HCI UART support +Requires=dev-ttymxc2.device +After=dev-ttymxc2.device +Before=bluetooth.service + +[Service] +Type=forking +ExecStart=/usr/sbin/hci-uart-helper.sh diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.sh b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.sh new file mode 100644 index 000000000..e1aa31c06 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Script to attach HCI UART devices on i.MX8MQ EVK/EVKB +# +# NOTE: +# For the most part errors are ignored and the script returns +# 0/success so BlueZ will still be started if the script is somehow +# run on a board without the expected hardware. However, if the +# various probing succeeds and hciattach is run, the script returns +# the resulting exit code if hciattach fails. + +COMPAT=/sys/firmware/devicetree/base/compatible +HCITTY=/dev/ttymxc2 +PCIDEV=/sys/bus/pci/devices/0000:01:00.0 + +if [ ! \( -f "$COMPAT" -a -c "$HCITTY" \) ]; then + exit 0 +fi + +found=false +for c in `cat $COMPAT | tr '\0' ' '`; do + echo "c = $c" + if echo $c | grep -q '^fsl,imx8mq-evk$'; then + found=true + break + fi +done +if ! $found; then + echo "i.MX8MQ EVK not found!" + exit 0 +fi + +if [ -f "$PCIDEV/vendor" -a -f "$PCIDEV/device" ]; then + vendor=`cat $PCIDEV/vendor` + device=`cat $PCIDEV/device` +fi + +rc=0 +if [ "$vendor" = "0x14e4" -a "$device" = "0x43ec" ]; then + # Broadcom 5436 on EVKB + hciattach $HCITTY bcm43xx + rc=$? +elif [ "$vendor" = "0x168c" -a "$device" = "0x003e" ]; then + # Qualcomm (nee Atheros) 6174 on EVK + hciattach $HCITTY qualcomm + rc=$? +fi +exit $rc diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb new file mode 100644 index 000000000..798fcebe6 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb @@ -0,0 +1,30 @@ +SUMMARY = "Helper for enabling UART connected HCI Bluetooth devices" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit systemd allarch + +SRC_URI = "file://hci-uart-helper.service \ + file://hci-uart-helper.sh \ +" + +COMPATIBLE_MACHINE = "imx8mq-evk" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + # Install helper script + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/hci-uart-helper.sh ${D}${sbindir}/ + + # Install systemd unit + install -d ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/hci-uart-helper.service ${D}${systemd_system_unitdir}/ + install -d ${D}${systemd_system_unitdir}/bluetooth.service.wants + ln -s ../hci-uart-helper.service ${D}${systemd_system_unitdir}/bluetooth.service.wants/ +} + +FILES:${PN} += "${systemd_system_unitdir}" + +RDEPENDS:${PN} += "bluez5" diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend deleted file mode 100644 index e736dddd2..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -# Currently only works with fbdev backend -# and only one default output - -WESTONCORE[backend] = "fbdev-backend.so" - -SCREEN_fbdev[name] = "fbdev" -SCREEN_fbdev[transform] = "270" -WESTONOUTPUT1[agl_screen] = "SCREEN_fbdev" - diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend new file mode 100644 index 000000000..07a43f958 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend @@ -0,0 +1,10 @@ +# Work around PACKAGECONFIG:remove of "x11 wayland" added to the recipe +# in meta-freescale commit 5a5c5dd. This can be removed once the issue +# has been resolved by a revert of that breakage upstream. +# What is done below is effectively a disabling of the "wayland" +# PACKAGECONFIG option and then open coding what its effects would +# normally be, since the :remove prevents specifying it in the usual way. +PACKAGECONFIG[wayland] = "" +DEPENDS:append = " virtual/egl virtual/libgles2" +PACKAGECONFIG_CONFARGS:append = " -Dbackend-wayland=true" + diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch deleted file mode 100644 index 1b17bc73f..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch +++ /dev/null @@ -1,49 +0,0 @@ -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-bsp/meta-freescale-layer/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ath9k_htc.cfg deleted file mode 100644 index 001587bcd..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ath9k_htc.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# build errors if built as module -#CONFIG_CFG80211=m -CONFIG_CFG80211=y -CONFIG_MAC80211=m -CONFIG_ATH_CARDS=m -CONFIG_ATH9K_HTC=m diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/btusb.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/btusb.cfg deleted file mode 100644 index 5f18d8223..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/btusb.cfg +++ /dev/null @@ -1,6 +0,0 @@ -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 diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg new file mode 100644 index 000000000..3550a7bf6 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg @@ -0,0 +1 @@ +CONFIG_CFG80211=y diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg index 9f168b4f9..14984ccd9 100644 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg @@ -1,17 +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 is not set +CONFIG_CGROUP_PIDS=y CONFIG_CGROUP_DEVICE=y CONFIG_CGROUP_CPUACCT=y # CONFIG_CGROUP_HUGETLB is not set -# CONFIG_CGROUP_PERF 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 is not set +CONFIG_CGROUP_NET_PRIO=y CONFIG_CGROUP_NET_CLASSID=y diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg new file mode 100644 index 000000000..29a25b798 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg @@ -0,0 +1,9 @@ +# 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 +# CONFIG_BTRFS_FS is not set diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg new file mode 100644 index 000000000..92915921f --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg @@ -0,0 +1 @@ +CONFIG_BRCMSMAC=m diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ramblock_nbd.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ramblock_nbd.cfg deleted file mode 100644 index ef498669d..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ramblock_nbd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_NBD=y diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/rtl_sdr.cfg deleted file mode 100644 index df5a871ef..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/rtl_sdr.cfg +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_I2C_MUX=y -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-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch new file mode 100644 index 000000000..f95891a2f --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch @@ -0,0 +1,22 @@ +Tweak MHDP driver Kconfig so it can be enabled with etnaviv + +The MHDP driver is needed for using HDMI on the i.MX8MQ EVK, tweak its +Kconfig entry so that it can be enabled when using etnaviv, not just +Vivante. + +Upstream-Status: pending +Signed-off-by: Scott Murray <scott.murray@konsulko.com> +--- + +diff --git a/drivers/gpu/drm/imx/mhdp/Kconfig b/drivers/gpu/drm/imx/mhdp/Kconfig +index 225ccc3638a8..164b42f04e94 100644 +--- a/drivers/gpu/drm/imx/mhdp/Kconfig ++++ b/drivers/gpu/drm/imx/mhdp/Kconfig +@@ -7,6 +7,6 @@ config DRM_IMX_CDNS_MHDP + select DRM_CDNS_HDMI + select DRM_CDNS_AUDIO + select DRM_CDNS_HDMI_HDCP +- depends on DRM_IMX ++ depends on DRM_IMX || DRM_ETNAVIV + help + Choose this if you want to use HDMI on i.MX8. diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch new file mode 100644 index 000000000..4ed4b685e --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch @@ -0,0 +1,22 @@ +Enable etnaviv support in i.MX8MQ EVK devicetree + +Some further investigation is required into how to manage this upstream +in meta-freescale, as it is not required for the i.MX6 platforms AFAIK. + +Upstream-Status: pending +Signed-off-by: Scott Murray <scott.murray@konsulko.com> +--- + +diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts +index c3f8a24c3943..754fbfe30f0a 100755 +--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts +@@ -1224,7 +1224,7 @@ &vpu_v4l2 { + status = "okay"; + }; + +-&gpu3d { ++&gpu { + status = "okay"; + }; + diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg new file mode 100644 index 000000000..35602c6d8 --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg @@ -0,0 +1,4 @@ +CONFIG_DRM_IMX=n +CONFIG_DRM_IMX_CDNS_MHDP=y +CONFIG_DRM_ROCKCHIP=n +CONFIG_DRM_ETNAVIV=y diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend index 5fe15cb97..0772a98a8 100644 --- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend @@ -1,103 +1,17 @@ -# Borrowed fragments logic from linaro kernel configuration +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -KERNEL_CONFIG_FRAGMENTS ?= "" +require linux-fslc.inc -kernel_conf_variable() { - 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 -} - -do_configure_append() { - - CONF_SED_SCRIPT="" - - # kernel_conf_variable NAME y/n lines here - - if [ -f '${WORKDIR}/defconfig' ]; then - sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' - else - sed -e "${CONF_SED_SCRIPT}" < '${KERNEL_DEFCONFIG}' >> '${B}/.config' - fi - - # Check for kernel config fragments. The assumption is that the config - # fragment will be specified with the absolute path. For example: - # * ${WORKDIR}/config1.cfg - # * ${S}/config2.cfg - # Iterate through the list of configs and make sure that you can find - # each one. If not then error out. - # NOTE: If you want to override a configuration that is kept in the kernel - # with one from the OE meta data then you should make sure that the - # OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed - # after the in kernel configuration fragment. - # Check if any config fragments are specified. - if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ] - then - for f in ${KERNEL_CONFIG_FRAGMENTS} - do - # Check if the config fragment was copied into the WORKDIR from - # the OE meta data - if [ ! -e "$f" ] - then - echo "Could not find kernel config fragment $f" - exit 1 - fi - done - -# # Now that all the fragments are located merge them. -# ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${B} ${B}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 ) -# - - cat ${KERNEL_CONFIG_FRAGMENTS} >> ${B}/.config - fi - - yes '' | oe_runmake -C ${S} O=${B} oldconfig - oe_runmake -C ${S} O=${B} savedefconfig && cp ${B}/defconfig ${WORKDIR}/defconfig.saved -} - -# 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" - -# Fragments common to AGL demo platform (make sure they are added) - -# Enable support for USB HID touch display -SRC_URI_append = " file://touchscreen.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/touchscreen.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" - -# Enable support for Bluetooth HCI USB devices -SRC_URI_append = " file://btusb.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/btusb.cfg" - -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ +# These patches and the configuration fragment below will need to be +# revisited if/when using IMX_DEFAULT_BSP = "mainline" with i.MX8 +# becomes more feasible with upstream meta-freescale. +SRC_URI:append:etnaviv = " \ + file://0001-enable-mhdp-with-etnaviv.patch \ + file://0002-dts-enable-etnaviv.patch \ " -# Enable support for smack -KERNEL_CONFIG_FRAGMENTS_append_smack = "\ - ${WORKDIR}/audit.cfg \ - ${WORKDIR}/smack.cfg \ - ${WORKDIR}/smack-default-lsm.cfg \ -" +# Support for i.MX8MQ EVKB (e.g. Broadcom wifi) +AGL_KCONFIG_FRAGMENTS:append:imx8mq-evk = " imx8mq-evkb.cfg" +# Build in etnaviv if required +AGL_KCONFIG_FRAGMENTS:append:etnaviv = " etnaviv.cfg" diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-lts_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-lts_%.bbappend new file mode 100644 index 000000000..1007f3c7c --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-lts_%.bbappend @@ -0,0 +1 @@ +require linux-fslc.inc diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc.inc b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc.inc new file mode 100644 index 000000000..948b8c22c --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc.inc @@ -0,0 +1,22 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +require recipes-kernel/linux/linux-yocto-agl.inc + +# Make sure these are enabled so that AGL systemd configuration works +AGL_KCONFIG_FRAGMENTS += " \ + tmpfs.cfg \ + namespace.cfg \ + cgroup.cfg \ +" + +# Support for CFG80211 subsystem +AGL_KCONFIG_FRAGMENTS += "cfg80211.cfg" + +# Turn off a couple of things enabled by default by Freescale +# (lock debugging and userspace firmware loader fallback) +AGL_KCONFIG_FRAGMENTS += "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-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend new file mode 100644 index 000000000..1007f3c7c --- /dev/null +++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend @@ -0,0 +1 @@ +require linux-fslc.inc diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch b/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch deleted file mode 100644 index 8489b6f39..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch +++ /dev/null @@ -1,17 +0,0 @@ -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-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend deleted file mode 100644 index c4afc30eb..000000000 --- a/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ - -# 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-bsp/meta-intel/recipes-graphics/wayland/libva_%.bbappend b/meta-agl-bsp/meta-intel/recipes-graphics/wayland/libva_%.bbappend deleted file mode 100644 index eda8de38a..000000000 --- a/meta-agl-bsp/meta-intel/recipes-graphics/wayland/libva_%.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -# 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-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend b/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend deleted file mode 100644 index d7052afae..000000000 --- a/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend +++ /dev/null @@ -1,11 +0,0 @@ -LICENSE_${PN}-ibt-license = "Firmware-ibt_firmware" -LICENSE_${PN}-ibt-11-5 = "Firmware-ibt_firmware" -FILES_${PN}-ibt-license = "/lib/firmware/LICENCE.ibt_firmware" -FILES_${PN}-ibt-11-5 = " \ - /lib/firmware/intel/ibt-11-5.sfi \ - /lib/firmware/intel/ibt-11-5.ddc \ -" - -RDEPENDS_${PN}-ibt-11-5 += "${PN}-ibt-license" - -PACKAGES =+ " ${PN}-ibt-license ${PN}-ibt-11-5 " diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg b/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg deleted file mode 100644 index 125406eac..000000000 --- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg +++ /dev/null @@ -1,54 +0,0 @@ -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-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc b/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc deleted file mode 100644 index d94108d9f..000000000 --- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc +++ /dev/null @@ -1,3 +0,0 @@ - -branch bxt-rebase -mark patching start diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg b/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg deleted file mode 100644 index b66b1b9b1..000000000 --- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_TCG_TPM=y -CONFIG_TCG_TIS=y -CONFIG_TCG_CRB=y diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg b/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg deleted file mode 100644 index b65e55b04..000000000 --- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg +++ /dev/null @@ -1,81 +0,0 @@ -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-bsp/meta-intel/recipes-kernel/linux/linux-yocto_4.4%.bbappend b/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-yocto_4.4%.bbappend deleted file mode 100644 index f94b638b0..000000000 --- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-yocto_4.4%.bbappend +++ /dev/null @@ -1,20 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -# adding most supported USB Bluetooth, Wifiand Ehternet devices -SRC_URI_append = " file://usb-devices.cfg" - -# adding support for other graphic cards to work on more PC HW -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/usb-devices.cfg" -SRC_URI_append = " file://extra-graphic-devices.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/extra-graphic-devices.cfg" - -# Configurations for Joule -LINUX_VERSION_INTEL_COMMON_forcevariable = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', '4.4.36', '4.4.26', d)}" -KBRANCH_corei7-64-intel-common_forcevariable = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'standard/intel/bxt-rebase;rebaseable=1', 'standard/intel/base', d)}" -SRCREV_machine_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', '5ec33015d3f01a8059f16715dd5bb34fac24c50c', '${SRCREV_MACHINE_INTEL_COMMON}', d)}" -SRCREV_meta_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'b846fc6436aa5d4c747d620e83dfda969854d10c', '${SRCREV_META_INTEL_COMMON}', d)}" - -SRC_URI_prepend_intel-corei7-64 = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'file://fix_branch.scc ', '', d)}" -KERNEL_FEATURES_remove_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'features/amt/mei/mei.scc', '', d)}" -KERNEL_FEATURES_append_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', ' features/mei/mei-spd.scc', '', d)}" -SRC_URI_append = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', ' file://security-tpm.cfg', '', d)}" diff --git a/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.7.bb b/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.7.bb deleted file mode 100644 index 36a983198..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.7.bb +++ /dev/null @@ -1,27 +0,0 @@ -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 = "193f355823d9dc38f370759153ac950a2833b0e2" -SRC_URI = "git://github.com/96boards/96boards-tools;branch=master;protocol=https" - -S = "${WORKDIR}/git" - -inherit systemd allarch - -do_install () { - install -d ${D}${sysconfdir}/udev/rules.d - install -m 0755 ${S}/*.rules ${D}${sysconfdir}/udev/rules.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} -} - -SYSTEMD_SERVICE_${PN} = "resize-helper.service" -RDEPENDS_${PN} += "e2fsprogs-resize2fs gptfdisk parted util-linux udev" diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch deleted file mode 100644 index a1eeac3d7..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch +++ /dev/null @@ -1,49 +0,0 @@ -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-bsp/meta-qcom/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/ath9k_htc.cfg deleted file mode 100644 index 6f7d49880..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/ath9k_htc.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_CFG80211=m -CONFIG_MAC80211=m -CONFIG_ATH_CARDS=m -CONFIG_ATH9K_HTC=m diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/fanotify.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/fanotify.cfg deleted file mode 100644 index de5dd8d31..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/fanotify.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Enable the fanotify API (notification/interception of FS events) -CONFIG_FANOTIFY=y -CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/hid.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/hid.cfg deleted file mode 100644 index 327c753ae..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/hid.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_HID_MULTITOUCH=y diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/rtl_sdr.cfg deleted file mode 100644 index d4574700a..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/rtl_sdr.cfg +++ /dev/null @@ -1,4 +0,0 @@ -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-bsp/meta-qcom/recipes-kernel/linux/files/uinput.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/uinput.cfg deleted file mode 100644 index 7996ef1dd..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/uinput.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Enable the User-level Input driver (required by "wayland-fits") -CONFIG_INPUT_MISC=y -CONFIG_INPUT_UINPUT=m diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.9.bbappend b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.9.bbappend deleted file mode 100644 index 854b7592f..000000000 --- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.9.bbappend +++ /dev/null @@ -1,30 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -# smack patches for handling bluetooth -SRC_URI_append_smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" - -# Extra configuration options -SRC_URI += "file://fanotify.cfg \ - file://uinput.cfg \ - file://hid.cfg " -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/fanotify.cfg ${WORKDIR}/uinput.cfg ${WORKDIR}/hid.cfg" - -# Enable support for TP-Link TL-W722N USB Wifi adapter -SRC_URI += " file://ath9k_htc.cfg " -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg" - -# Enable support for RTLSDR -SRC_URI += " file://rtl_sdr.cfg " -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtl_sdr.cfg" - -# Enable support for smack -KERNEL_CONFIG_FRAGMENTS_append_smack = "\ - ${WORKDIR}/audit.cfg \ - ${WORKDIR}/smack.cfg \ - ${WORKDIR}/smack-default-lsm.cfg \ -" - -# file comes out of meta-agl-bsp/recipes-kernel/linux/linux_%.bbappend -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend deleted file mode 100644 index adb19c09c..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend +++ /dev/null @@ -1 +0,0 @@ -RDEPENDS_${PN}_append_sota += " u-boot-otascript" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index 9222fd52a..248623699 100644 --- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -1,23 +1,46 @@ DISABLE_OVERSCAN = "1" +TOTAL_BOARD_MEM = "3072" -do_deploy_append() { +do_deploy:append:raspberrypi4() { + # ENABLE CAN + if [ "${ENABLE_CAN}" = "1" ]; then + echo "# Enable CAN" >>${DEPLOYDIR}/bootfiles/config.txt + echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bootfiles/config.txt + fi + + # Handle setup with armstub file + if [ -n "${ARMSTUB}" ]; then + echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/bootfiles/config.txt + case "${ARMSTUB}" in + *-gic.bin) + echo "enable_gic=1" >> ${DEPLOYDIR}/bootfiles/config.txt + ;; + esac + fi + + if [ "${AGL_XEN_WANTED}" = "1" ]; then + echo "total_mem=${TOTAL_BOARD_MEM}" >> ${DEPLOYDIR}/bootfiles/config.txt + 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 + sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/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 + sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/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 + echo "avoid_warnings=2" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "dtparam=audio=on" >> ${DEPLOYDIR}/bootfiles/config.txt } -do_deploy_append_sota() { - echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt +do_deploy:append:raspberrypi4() { + echo -e "\n[pi4]" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "max_framebuffers=2" >> ${DEPLOYDIR}/bootfiles/config.txt } - -ENABLE_UART_raspberrypi3 = "1" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd new file mode 100644 index 000000000..24cfb1658 --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd @@ -0,0 +1,45 @@ +# +# SPDX-License-Identifier: MIT +# +# Copyright (c) 2020, MERA +# +# Author: Leonid Lazarev +# +# Xen Boot Script +# +# https://www.raspberrypi.org/documentation/configuration/device-tree.md +# We do not set fdt_addr, because device tree initially is loaded by raspberry pi firmware loader and the particular +# modification are performed. The prepared DTS is propagated to u-boot and this prepared device tree has to be reused. + +setenv kernel_addr_r 0x00480000 # 16M +setenv xen_addr_r 0x00200000 # 2M + +# Load xen to ${xen_addr_r}. +fatload mmc 0:1 ${xen_addr_r} /xen-@@MACHINE@@ + +#configure dom0 +fdt addr ${fdt_addr} + +#read prepared bootargs, rapsberry pi prepared initial list of the parameters for loading +fdt get value bootargs /chosen bootargs +fdt resize 8192 + +# add device type for raspberry +fdt set pcie0 device_type "pci" + +fdt chosen +fdt set /chosen \#address-cells <1> +fdt set /chosen \#size-cells <1> + +# Load Linux Image to ${kernel_addr_r} +fatload mmc 0:1 ${kernel_addr_r} /@@KERNEL_IMAGETYPE@@ + +# we load dom0 with 1512 MB of memory +fdt mknod /chosen dom0 +fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/soc/serial@7e215040 sync_console dom0_mem=1512M bootscrub=0" +fdt set /chosen xen,dom0-bootargs "${bootargs}" + +fdt set /chosen/dom0 compatible "xen,linux-zimage", "xen,multiboot-module" +fdt set /chosen/dom0 reg <${kernel_addr_r} 0x${filesize} > + +@@KERNEL_BOOTCMD@@ ${xen_addr_r} - ${fdt_addr} diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend new file mode 100644 index 000000000..1e9f47d23 --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend @@ -0,0 +1,18 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI:append =" \ + ${@bb.utils.contains('AGL_XEN_WANTED','1',' file://boot_xen.cmd','',d)} \ +" + +do_compile:append() { + + # if xen feature is activated we overwirte the boot script with xen specific one + if [ "${AGL_XEN_WANTED}" = "1" ]; then + sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ + -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ + -e 's/@@MACHINE@@/${MACHINE}/' \ + "${WORKDIR}/boot_xen.cmd" > "${WORKDIR}/boot.cmd" + + mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr + fi +}
\ No newline at end of file diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt index 611119f09..062bddb93 100644 --- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt @@ -1,7 +1,21 @@ -fdt_addr_r=0x0c800000 -bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs -bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize -bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 coherent_pool=6M smsc95xx.turbo_mode=N" -bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image -bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r -bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run +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-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt index f6c05709b..436fe95fe 100644 --- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt @@ -1,7 +1,21 @@ -fdt_addr_r=0x0c800000 -bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs -bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize -bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192" -bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image -bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r -bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run +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-bsp/meta-raspberrypi/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch deleted file mode 100644 index d2d67558b..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch +++ /dev/null @@ -1,29 +0,0 @@ -Configure checks for compiler to be gcc and then it enables asm_offsets -generation. see - -https://cgit.freedesktop.org/mesa/mesa/commit/?id=73c9b4b0e05fc66629ba250846948dc55c0e7a0d - -However, we missed the check when enabling this on cross compilation -when architecture for both host and target is x86 - -Fixes errors like -./gen_matypes > matypes.h -/bin/bash: ./gen_matypes: No such file or directory - --Khem - -Upstream-Status: Submitted - -Index: mesa-12.0.1/configure.ac -=================================================================== ---- mesa-12.0.1.orig/configure.ac -+++ mesa-12.0.1/configure.ac -@@ -732,7 +732,7 @@ test "x$enable_asm" = xno && AC_MSG_RESU - if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then - case "$host_cpu" in - i?86 | x86_64 | amd64) -- if test "x$host_cpu" != "x$target_cpu"; then -+ if test "x$host_cpu" != "x$target_cpu" -o "x$acv_mesa_CLANG" = xyes; then - enable_asm=no - AC_MSG_RESULT([no, cross compiling]) - fi diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch deleted file mode 100644 index e4461ef17..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch +++ /dev/null @@ -1,17 +0,0 @@ -endianness check is OS wide and not specific to libc - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending -Index: mesa-11.1.1/src/gallium/include/pipe/p_config.h -=================================================================== ---- mesa-11.1.1.orig/src/gallium/include/pipe/p_config.h -+++ mesa-11.1.1/src/gallium/include/pipe/p_config.h -@@ -130,7 +130,7 @@ - * Endian detection. - */ - --#ifdef __GLIBC__ -+#if defined(__linux__) - #include <endian.h> - - #if __BYTE_ORDER == __LITTLE_ENDIAN diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_12.0.3.bb b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_12.0.3.bb deleted file mode 100644 index f06a3e9b5..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_12.0.3.bb +++ /dev/null @@ -1,13 +0,0 @@ -require mesa_${PV}.bb - -SUMMARY += " (OpenGL only, no EGL/GLES)" - -FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:" - -PROVIDES = "virtual/libgl virtual/mesa" - -S = "${WORKDIR}/mesa-${PV}" - -PACKAGECONFIG ??= "dri ${MESA_CRYPTO} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" - -EXCLUDE_FROM_WORLD = "1" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc deleted file mode 100644 index e4880ffed..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc +++ /dev/null @@ -1,191 +0,0 @@ -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=899fbe7e42d494c7c8c159c7001693d5" - -PE = "2" - -DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native udev" - -PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa" - -inherit autotools pkgconfig pythonnative gettext distro_features_check - -REQUIRED_DISTRO_FEATURES = "opengl" - -EXTRA_OECONF = "--enable-shared-glapi" - -PACKAGECONFIG ??= "gbm egl gles dri ${MESA_CRYPTO} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\ - " - -PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm" - -X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes" -PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}" -PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc" -PACKAGECONFIG[wayland] = ",,wayland-native wayland" - -DRIDRIVERS = "swrast" -DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915" -DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915" -PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm" -PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence" - -PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2" - -EGL_PLATFORMS = "drm" -EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}" -EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}" -PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl" - -GALLIUMDRIVERS = "swrast" -GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}" -PACKAGECONFIG[r600] = "" -GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_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 ''}" -GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" -GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" -# keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers -PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers" -MESA_LLVM_RELEASE ?= "3.3" -PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --enable-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \ - ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" -export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" -PACKAGECONFIG[xa] = "--enable-xa, --disable-xa" - -# Mesa requires one of the following crypto implementation, pick one of them -MESA_CRYPTO ??= "openssl" -PACKAGECONFIG[openssl] = "--with-sha1=libcrypto,,openssl" -PACKAGECONFIG[nettle] = "--with-sha1=libnettle,,nettle" -PACKAGECONFIG[gcrypt] = "--with-sha1=libgcrypt,,libgcrypt" - -# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) -FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer" - -# Multiple virtual/gl providers being built breaks staging -EXCLUDE_FROM_WORLD = "1" - -# Remove the mesa dependency on mesa-dev, as mesa is empty -RDEPENDS_${PN}-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 \ - libwayland-egl libwayland-egl-dev \ - libxvmcsoftpipe libxvmcsoftpipe-dev \ - libxatracker libxatracker-dev \ - mesa-megadriver \ - " - -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 - rm -f ${D}${sysconfdir}/drirc -} - -# 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', True) 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', True), d.getVar('libdir', True), "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('^(.*)_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', True), "gallium-pipe") - do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='') -} - -PACKAGESPLITFUNCS_prepend = "mesa_populate_packages " - -PACKAGES_DYNAMIC += "^mesa-driver-.*" - -FILES_${PN} += "${sysconfdir}/drirc" -FILES_mesa-megadriver = "${libdir}/dri/*" -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_libwayland-egl = "${libdir}/libwayland-egl.so.*" -FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*" -FILES_libxatracker = "${libdir}/libxatracker.so.*" - -FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc" -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}/osmesa.h ${libdir}/pkgconfig/osmesa.pc" -FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*" -FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la" -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" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_12.0.3.bb b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_12.0.3.bb deleted file mode 100644 index acc8353dd..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_12.0.3.bb +++ /dev/null @@ -1,17 +0,0 @@ -require ${BPN}.inc - -SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/mesa-${PV}.tar.xz \ - file://replace_glibc_check_with_linux.patch \ - file://disable-asm-on-non-gcc.patch \ -" - -SRC_URI[md5sum] = "1113699c714042d8c4df4766be8c57d8" -SRC_URI[sha256sum] = "1dc86dd9b51272eee1fad3df65e18cda2e556ef1bc0b6e07cd750b9757f493b1" - -#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-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend deleted file mode 100644 index 14b858d45..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -# Disable LVDS -WESTONOUTPUT2[agl_screen] ??= "SCREEN_DSI" - -WESTONSECTION[WESTONOUTPUT2] = "output" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb new file mode 100644 index 000000000..c5edbe1dc --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb @@ -0,0 +1,43 @@ +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 () { + # Plain VC4 (HDMI) + if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" ]; then + fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb -o bcm2711-rpi-4-b+vc4.dtb \ + ${DEPLOY_DIR_IMAGE}/${VC4DTBO}-pi4.dtbo + fi + + # VC4 + LCD + if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" -a -f "${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo" ]; then + fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb -o bcm2711-rpi-4-b+vc4+ft5406.dtb \ + ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo \ + ${DEPLOY_DIR_IMAGE}/${VC4DTBO}-pi4.dtbo + fi + +} + +do_deploy () { + install -d ${DEPLOY_DIR_IMAGE} + if [ -f "${S}/bcm2711-rpi-4-b+vc4+ft5406.dtb" ]; then + install -m 0644 ${S}/bcm2711-rpi-4-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE} + fi + if [ -f "${S}/bcm2711-rpi-4-b+vc4.dtb" ]; then + install -m 0644 ${S}/bcm2711-rpi-4-b+vc4.dtb ${DEPLOY_DIR_IMAGE} + fi +} + +addtask deploy after do_install diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/dtc_1.7.0.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/dtc_1.7.0.bbappend new file mode 100644 index 000000000..a28a9e748 --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/dtc_1.7.0.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI += "file://0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/files/0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/files/0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch new file mode 100644 index 000000000..0f275f1ac --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/files/0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch @@ -0,0 +1,154 @@ +From caba0117dc30f2357eac6d04f3510095dcbaa7f4 Mon Sep 17 00:00:00 2001 +From: Paul Barker <pbarker@konsulko.com> +Date: Fri, 18 Dec 2020 23:00:07 +0000 +Subject: [PATCH] fdtoverlay: Prevent overlays from modifying phandle + properties +To: David Gibson <david@gibson.dropbear.id.au>, + Jon Loeliger <jdl@jdl.com>, + devicetree-compiler@vger.kernel.org +Cc: Rob Herring <robh@kernel.org>, + Pantelis Antoniou <pantelis.antoniou@konsulko.com>, + Scott Murray <scott.murray@konsulko.com>, + Jan Simon Moeller <jsmoeller@linuxfoundation.org> + +When applying an overlay fragment, we should take care not to overwrite +an existing phandle property of the target node as this could break +references to the target node elsewhere in the base dtb. + +In addition to potentially breaking references within the resulting fdt, +if the overlay is built with symbols enabled (`-@` option to dtc) then +fdtoverlay will be unable to merge the overlay with a base dtb file. + +A new test case is added to check how fdtoverlay handles this case. +Attempting to apply this test overlay without the fix in this patch +results in the following output: + + input = tests/overlay_base_ref.test.dtb + output = tests/overlay_overlay_ref.fdtoverlay.dtb + overlay[0] = tests/overlay_overlay_ref.test.dtb + + Failed to apply 'tests/overlay_overlay_ref.test.dtb': FDT_ERR_NOTFOUND + +In this test case the __overlay__ node in question does not explicitly +contain a phandle property in the dts file, the phandle is added during +compilation as it is referenced by another node within the overlay dts. + +This failure occurs due to a sequence of events in the functions called +by fdt_overlay_apply(): + +1) In overlay_fixup_phandles(), the target of the overlay fragment is + looked up and the target property is set to the phandle of the target + node. + +2) In overlay_merge(), the target node is looked up by phandle via + overlay_get_target(). As the __overlay__ node in this test case + itself has a phandle property, the phandle of the target node is + modified. + +3) In overlay_symbol_update(), the target node is again looked up by + phandle via overlay_get_target(). But this time the target node + cannot be found as its phandle property was modified. + +The fix for this issue is to skip modification of the phandle property +of the target node in step (2) of the above sequence. If the target node +doesn't already contain a phandle property, we can add one without risk. + +Upstream-Status: Submitted + https://www.spinics.net/lists/devicetree-compiler/msg03537.html +Signed-off-by: Paul Barker <pbarker@konsulko.com> +--- + libfdt/fdt_overlay.c | 2 ++ + tests/overlay_base_ref.dts | 19 +++++++++++++++++++ + tests/overlay_overlay_ref.dts | 24 ++++++++++++++++++++++++ + tests/run_tests.sh | 5 +++++ + 4 files changed, 50 insertions(+) + create mode 100644 tests/overlay_base_ref.dts + create mode 100644 tests/overlay_overlay_ref.dts + +diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c +index d217e79..b3c217a 100644 +--- a/libfdt/fdt_overlay.c ++++ b/libfdt/fdt_overlay.c +@@ -573,6 +573,8 @@ static int overlay_apply_node(void *fdt, int target, + if (prop_len < 0) + return prop_len; + ++ if (!strcmp(name, "phandle") && fdt_getprop(fdt, target, name, NULL)) ++ continue; + ret = fdt_setprop(fdt, target, name, prop, prop_len); + if (ret) + return ret; +diff --git a/tests/overlay_base_ref.dts b/tests/overlay_base_ref.dts +new file mode 100644 +index 0000000..1fc02a2 +--- /dev/null ++++ b/tests/overlay_base_ref.dts +@@ -0,0 +1,19 @@ ++/* ++ * Copyright (c) 2016 NextThing Co ++ * Copyright (c) 2016 Free Electrons ++ * Copyright (c) 2016 Konsulko Inc. ++ * ++ * SPDX-License-Identifier: GPL-2.0+ ++ */ ++ ++/dts-v1/; ++ ++/ { ++ test: test-node { ++ test-int-property = <42>; ++ }; ++ ++ test-refs { ++ refs = <&test>; ++ }; ++}; +diff --git a/tests/overlay_overlay_ref.dts b/tests/overlay_overlay_ref.dts +new file mode 100644 +index 0000000..a45c95d +--- /dev/null ++++ b/tests/overlay_overlay_ref.dts +@@ -0,0 +1,24 @@ ++/* ++ * Copyright (c) 2016 NextThing Co ++ * Copyright (c) 2016 Free Electrons ++ * Copyright (c) 2016 Konsulko Inc. ++ * ++ * SPDX-License-Identifier: GPL-2.0+ ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ fragment@0 { ++ target = <&test>; ++ ++ frag0: __overlay__ { ++ test-int-property = <43>; ++ }; ++ }; ++ ++ test-ref { ++ ref = <&frag0>; ++ }; ++}; +diff --git a/tests/run_tests.sh b/tests/run_tests.sh +index 294585b..a65b166 100755 +--- a/tests/run_tests.sh ++++ b/tests/run_tests.sh +@@ -329,6 +329,11 @@ dtc_overlay_tests () { + run_test check_path overlay_base_with_aliases.dtb not-exists "/__symbols__" + run_test check_path overlay_base_with_aliases.dtb not-exists "/__fixups__" + run_test check_path overlay_base_with_aliases.dtb not-exists "/__local_fixups__" ++ ++ # Test taking a reference to an overlay fragment ++ run_dtc_test -@ -I dts -O dtb -o overlay_base_ref.test.dtb "$SRCDIR/overlay_base_ref.dts" ++ run_dtc_test -@ -I dts -O dtb -o overlay_overlay_ref.test.dtb "$SRCDIR/overlay_overlay_ref.dts" ++ run_wrap_test $FDTOVERLAY -i overlay_base_ref.test.dtb overlay_overlay_ref.test.dtb -o overlay_overlay_ref.fdtoverlay.dtb + } + + tree1_tests () { +-- +2.26.2 + diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-mm-larger-stack-guard-gap-between-vmas.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-mm-larger-stack-guard-gap-between-vmas.patch deleted file mode 100644 index e9fafad74..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-mm-larger-stack-guard-gap-between-vmas.patch +++ /dev/null @@ -1,900 +0,0 @@ -From 3982d0807e02909957990f194c5ed2ffb6ab6c35 Mon Sep 17 00:00:00 2001 -From: Hugh Dickins <hughd@google.com> -Date: Mon, 19 Jun 2017 04:03:24 -0700 -Subject: [PATCH 1/3] mm: larger stack guard gap, between vmas - -commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream. - -Stack guard page is a useful feature to reduce a risk of stack smashing -into a different mapping. We have been using a single page gap which -is sufficient to prevent having stack adjacent to a different mapping. -But this seems to be insufficient in the light of the stack usage in -userspace. E.g. glibc uses as large as 64kB alloca() in many commonly -used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX] -which is 256kB or stack strings with MAX_ARG_STRLEN. - -This will become especially dangerous for suid binaries and the default -no limit for the stack size limit because those applications can be -tricked to consume a large portion of the stack and a single glibc call -could jump over the guard page. These attacks are not theoretical, -unfortunatelly. - -Make those attacks less probable by increasing the stack guard gap -to 1MB (on systems with 4k pages; but make it depend on the page size -because systems with larger base pages might cap stack allocations in -the PAGE_SIZE units) which should cover larger alloca() and VLA stack -allocations. It is obviously not a full fix because the problem is -somehow inherent, but it should reduce attack space a lot. - -One could argue that the gap size should be configurable from userspace, -but that can be done later when somebody finds that the new 1MB is wrong -for some special case applications. For now, add a kernel command line -option (stack_guard_gap) to specify the stack gap size (in page units). - -Implementation wise, first delete all the old code for stack guard page: -because although we could get away with accounting one extra page in a -stack vma, accounting a larger gap can break userspace - case in point, -a program run with "ulimit -S -v 20000" failed when the 1MB gap was -counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK -and strict non-overcommit mode. - -Instead of keeping gap inside the stack vma, maintain the stack guard -gap as a gap between vmas: using vm_start_gap() in place of vm_start -(or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few -places which need to respect the gap - mainly arch_get_unmapped_area(), -and and the vma tree's subtree_gap support for that. - -Original-patch-by: Oleg Nesterov <oleg@redhat.com> -Original-patch-by: Michal Hocko <mhocko@suse.com> -Signed-off-by: Hugh Dickins <hughd@google.com> -Acked-by: Michal Hocko <mhocko@suse.com> -Tested-by: Helge Deller <deller@gmx.de> # parisc -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -[wt: backport to 4.11: adjust context] -[wt: backport to 4.9: adjust context ; kernel doc was not in admin-guide] -[wt: backport to 4.4: adjust context ; drop ppc hugetlb_radix changes] -Signed-off-by: Willy Tarreau <w@1wt.eu> -[gkh: minor build fixes for 4.4] -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - Documentation/kernel-parameters.txt | 7 ++ - arch/arc/mm/mmap.c | 2 +- - arch/arm/mm/mmap.c | 4 +- - arch/frv/mm/elf-fdpic.c | 2 +- - arch/mips/mm/mmap.c | 2 +- - arch/parisc/kernel/sys_parisc.c | 15 ++-- - arch/powerpc/mm/slice.c | 2 +- - arch/s390/mm/mmap.c | 4 +- - arch/sh/mm/mmap.c | 4 +- - arch/sparc/kernel/sys_sparc_64.c | 4 +- - arch/sparc/mm/hugetlbpage.c | 2 +- - arch/tile/mm/hugetlbpage.c | 2 +- - arch/x86/kernel/sys_x86_64.c | 4 +- - arch/x86/mm/hugetlbpage.c | 2 +- - arch/xtensa/kernel/syscall.c | 2 +- - fs/hugetlbfs/inode.c | 2 +- - fs/proc/task_mmu.c | 4 - - include/linux/mm.h | 53 ++++++------- - mm/gup.c | 5 -- - mm/memory.c | 38 --------- - mm/mmap.c | 149 +++++++++++++++++++++--------------- - 21 files changed, 149 insertions(+), 160 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index c360f80..9738c8b 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -3576,6 +3576,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - spia_pedr= - spia_peddr= - -+ stack_guard_gap= [MM] -+ override the default stack gap protection. The value -+ is in page units and it defines how many pages prior -+ to (for stacks growing down) resp. after (for stacks -+ growing up) the main stack are reserved for no other -+ mapping. Default value is 256 pages. -+ - stacktrace [FTRACE] - Enabled the stack tracer on boot up. - -diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c -index 2e06d56..cf4ae69 100644 ---- a/arch/arc/mm/mmap.c -+++ b/arch/arc/mm/mmap.c -@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c -index 407dc78..c469c06 100644 ---- a/arch/arm/mm/mmap.c -+++ b/arch/arm/mm/mmap.c -@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c -index 836f147..efa59f1 100644 ---- a/arch/frv/mm/elf-fdpic.c -+++ b/arch/frv/mm/elf-fdpic.c -@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - addr = PAGE_ALIGN(addr); - vma = find_vma(current->mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - goto success; - } - -diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c -index 5c81fdd..025cb31 100644 ---- a/arch/mips/mm/mmap.c -+++ b/arch/mips/mm/mmap.c -@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c -index 5aba01a..4dda73c 100644 ---- a/arch/parisc/kernel/sys_parisc.c -+++ b/arch/parisc/kernel/sys_parisc.c -@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - unsigned long task_size = TASK_SIZE; - int do_color_align, last_mmap; - struct vm_unmapped_area_info info; -@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - else - addr = PAGE_ALIGN(addr); - -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - int do_color_align, last_mmap; -@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = COLOR_ALIGN(addr, last_mmap, pgoff); - else - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 0f432a7..6ad12b2 100644 ---- a/arch/powerpc/mm/slice.c -+++ b/arch/powerpc/mm/slice.c -@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, - if ((mm->task_size - len) < addr) - return 0; - vma = find_vma(mm, addr); -- return (!vma || (addr + len) <= vma->vm_start); -+ return (!vma || (addr + len) <= vm_start_gap(vma)); - } - - static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice) -diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c -index f2b6b1d..126c4a9 100644 ---- a/arch/s390/mm/mmap.c -+++ b/arch/s390/mm/mmap.c -@@ -97,7 +97,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -135,7 +135,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c -index 6777177..7df7d59 100644 ---- a/arch/sh/mm/mmap.c -+++ b/arch/sh/mm/mmap.c -@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c -index c690c8e..7f0f7c01 100644 ---- a/arch/sparc/kernel/sys_sparc_64.c -+++ b/arch/sparc/kernel/sys_sparc_64.c -@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c -index da11424..ffa842b 100644 ---- a/arch/sparc/mm/hugetlbpage.c -+++ b/arch/sparc/mm/hugetlbpage.c -@@ -115,7 +115,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, HPAGE_SIZE); - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c -index c034dc3..c97ee6c 100644 ---- a/arch/tile/mm/hugetlbpage.c -+++ b/arch/tile/mm/hugetlbpage.c -@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (current->mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c -index 10e0272..136ad7c 100644 ---- a/arch/x86/kernel/sys_x86_64.c -+++ b/arch/x86/kernel/sys_x86_64.c -@@ -143,7 +143,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (end - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -186,7 +186,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c -index 42982b2..39bdaf3 100644 ---- a/arch/x86/mm/hugetlbpage.c -+++ b/arch/x86/mm/hugetlbpage.c -@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c -index 83cf496..3aaaae1 100644 ---- a/arch/xtensa/kernel/syscall.c -+++ b/arch/xtensa/kernel/syscall.c -@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - /* At this point: (!vmm || addr < vmm->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; -- if (!vmm || addr + len <= vmm->vm_start) -+ if (!vmm || addr + len <= vm_start_gap(vmm)) - return addr; - addr = vmm->vm_end; - if (flags & MAP_SHARED) -diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c -index 595ebdb..a17da8b5 100644 ---- a/fs/hugetlbfs/inode.c -+++ b/fs/hugetlbfs/inode.c -@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index d598b9c..cb7020c 100644 ---- a/fs/proc/task_mmu.c -+++ b/fs/proc/task_mmu.c -@@ -295,11 +295,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) - - /* We don't show the stack guard page in /proc/maps */ - start = vma->vm_start; -- if (stack_guard_page_start(vma, start)) -- start += PAGE_SIZE; - end = vma->vm_end; -- if (stack_guard_page_end(vma, end)) -- end -= PAGE_SIZE; - - seq_setwidth(m, 25 + sizeof(void *) * 6 - 1); - seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ", -diff --git a/include/linux/mm.h b/include/linux/mm.h -index f0ffa01..55f950a 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -1278,39 +1278,11 @@ int clear_page_dirty_for_io(struct page *page); - - int get_cmdline(struct task_struct *task, char *buffer, int buflen); - --/* Is the vma a continuation of the stack vma above it? */ --static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN); --} -- - static inline bool vma_is_anonymous(struct vm_area_struct *vma) - { - return !vma->vm_ops; - } - --static inline int stack_guard_page_start(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSDOWN) && -- (vma->vm_start == addr) && -- !vma_growsdown(vma->vm_prev, addr); --} -- --/* Is the vma a continuation of the stack vma below it? */ --static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP); --} -- --static inline int stack_guard_page_end(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSUP) && -- (vma->vm_end == addr) && -- !vma_growsup(vma->vm_next, addr); --} -- - int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t); - - extern unsigned long move_page_tables(struct vm_area_struct *vma, -@@ -2012,6 +1984,7 @@ void page_cache_async_readahead(struct address_space *mapping, - pgoff_t offset, - unsigned long size); - -+extern unsigned long stack_guard_gap; - /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ - extern int expand_stack(struct vm_area_struct *vma, unsigned long address); - -@@ -2040,6 +2013,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m - return vma; - } - -+static inline unsigned long vm_start_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_start = vma->vm_start; -+ -+ if (vma->vm_flags & VM_GROWSDOWN) { -+ vm_start -= stack_guard_gap; -+ if (vm_start > vma->vm_start) -+ vm_start = 0; -+ } -+ return vm_start; -+} -+ -+static inline unsigned long vm_end_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_end = vma->vm_end; -+ -+ if (vma->vm_flags & VM_GROWSUP) { -+ vm_end += stack_guard_gap; -+ if (vm_end < vma->vm_end) -+ vm_end = -PAGE_SIZE; -+ } -+ return vm_end; -+} -+ - static inline unsigned long vma_pages(struct vm_area_struct *vma) - { - return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; -diff --git a/mm/gup.c b/mm/gup.c -index 4b0b7e7..b599526 100644 ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -312,11 +312,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma, - /* mlock all present pages, but do not fault in new pages */ - if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK) - return -ENOENT; -- /* For mm_populate(), just skip the stack guard page. */ -- if ((*flags & FOLL_POPULATE) && -- (stack_guard_page_start(vma, address) || -- stack_guard_page_end(vma, address + PAGE_SIZE))) -- return -ENOENT; - if (*flags & FOLL_WRITE) - fault_flags |= FAULT_FLAG_WRITE; - if (nonblocking) -diff --git a/mm/memory.c b/mm/memory.c -index 76dcee3..e6fa134 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -2662,40 +2662,6 @@ out_release: - } - - /* -- * This is like a special single-page "expand_{down|up}wards()", -- * except we must first make sure that 'address{-|+}PAGE_SIZE' -- * doesn't hit another vma. -- */ --static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address) --{ -- address &= PAGE_MASK; -- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) { -- struct vm_area_struct *prev = vma->vm_prev; -- -- /* -- * Is there a mapping abutting this one below? -- * -- * That's only ok if it's the same stack mapping -- * that has gotten split.. -- */ -- if (prev && prev->vm_end == address) -- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; -- -- return expand_downwards(vma, address - PAGE_SIZE); -- } -- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { -- struct vm_area_struct *next = vma->vm_next; -- -- /* As VM_GROWSDOWN but s/below/above/ */ -- if (next && next->vm_start == address + PAGE_SIZE) -- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; -- -- return expand_upwards(vma, address + PAGE_SIZE); -- } -- return 0; --} -- --/* - * We enter with non-exclusive mmap_sem (to exclude vma changes, - * but allow concurrent faults), and pte mapped but not yet locked. - * We return with mmap_sem still held, but pte unmapped and unlocked. -@@ -2715,10 +2681,6 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, - if (vma->vm_flags & VM_SHARED) - return VM_FAULT_SIGBUS; - -- /* Check if we need to add a guard page to the stack */ -- if (check_stack_guard_page(vma, address) < 0) -- return VM_FAULT_SIGSEGV; -- - /* Use the zero-page for reads */ - if (!(flags & FAULT_FLAG_WRITE) && !mm_forbids_zeropage(mm)) { - entry = pte_mkspecial(pfn_pte(my_zero_pfn(address), -diff --git a/mm/mmap.c b/mm/mmap.c -index 455772a..5e043dd 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -288,6 +288,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - unsigned long retval; - unsigned long newbrk, oldbrk; - struct mm_struct *mm = current->mm; -+ struct vm_area_struct *next; - unsigned long min_brk; - bool populate; - -@@ -332,7 +333,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - } - - /* Check against existing mmap mappings. */ -- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE)) -+ next = find_vma(mm, oldbrk); -+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next)) - goto out; - - /* Ok, looks good - let it rip. */ -@@ -355,10 +357,22 @@ out: - - static long vma_compute_subtree_gap(struct vm_area_struct *vma) - { -- unsigned long max, subtree_gap; -- max = vma->vm_start; -- if (vma->vm_prev) -- max -= vma->vm_prev->vm_end; -+ unsigned long max, prev_end, subtree_gap; -+ -+ /* -+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we -+ * allow two stack_guard_gaps between them here, and when choosing -+ * an unmapped area; whereas when expanding we only require one. -+ * That's a little inconsistent, but keeps the code here simpler. -+ */ -+ max = vm_start_gap(vma); -+ if (vma->vm_prev) { -+ prev_end = vm_end_gap(vma->vm_prev); -+ if (max > prev_end) -+ max -= prev_end; -+ else -+ max = 0; -+ } - if (vma->vm_rb.rb_left) { - subtree_gap = rb_entry(vma->vm_rb.rb_left, - struct vm_area_struct, vm_rb)->rb_subtree_gap; -@@ -451,7 +465,7 @@ static void validate_mm(struct mm_struct *mm) - anon_vma_unlock_read(anon_vma); - } - -- highest_address = vma->vm_end; -+ highest_address = vm_end_gap(vma); - vma = vma->vm_next; - i++; - } -@@ -620,7 +634,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = vma->vm_end; -+ mm->highest_vm_end = vm_end_gap(vma); - - /* - * vma->vm_prev wasn't known when we followed the rbtree to find the -@@ -866,7 +880,7 @@ again: remove_next = 1 + (end > next->vm_end); - vma_gap_update(vma); - if (end_changed) { - if (!next) -- mm->highest_vm_end = end; -+ mm->highest_vm_end = vm_end_gap(vma); - else if (!adjust_next) - vma_gap_update(next); - } -@@ -909,7 +923,7 @@ again: remove_next = 1 + (end > next->vm_end); - else if (next) - vma_gap_update(next); - else -- mm->highest_vm_end = end; -+ VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma)); - } - if (insert && file) - uprobe_mmap(insert); -@@ -1741,7 +1755,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit left subtree if it looks promising */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end >= low_limit && vma->vm_rb.rb_left) { - struct vm_area_struct *left = - rb_entry(vma->vm_rb.rb_left, -@@ -1752,7 +1766,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - } - } - -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - check_current: - /* Check if current node has a suitable gap */ - if (gap_start > high_limit) -@@ -1779,8 +1793,8 @@ check_current: - vma = rb_entry(rb_parent(prev), - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_left) { -- gap_start = vma->vm_prev->vm_end; -- gap_end = vma->vm_start; -+ gap_start = vm_end_gap(vma->vm_prev); -+ gap_end = vm_start_gap(vma); - goto check_current; - } - } -@@ -1844,7 +1858,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit right subtree if it looks promising */ -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - if (gap_start <= high_limit && vma->vm_rb.rb_right) { - struct vm_area_struct *right = - rb_entry(vma->vm_rb.rb_right, -@@ -1857,7 +1871,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - check_current: - /* Check if current node has a suitable gap */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end < low_limit) - return -ENOMEM; - if (gap_start <= high_limit && gap_end - gap_start >= length) -@@ -1883,7 +1897,7 @@ check_current: - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_right) { - gap_start = vma->vm_prev ? -- vma->vm_prev->vm_end : 0; -+ vm_end_gap(vma->vm_prev) : 0; - goto check_current; - } - } -@@ -1921,7 +1935,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct vm_unmapped_area_info info; - - if (len > TASK_SIZE - mmap_min_addr) -@@ -1932,9 +1946,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -1957,7 +1972,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - struct vm_unmapped_area_info info; -@@ -1972,9 +1987,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - /* requesting a specific address */ - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -2099,21 +2115,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr, - * update accounting. This is shared with both the - * grow-up and grow-down cases. - */ --static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow) -+static int acct_stack_growth(struct vm_area_struct *vma, -+ unsigned long size, unsigned long grow) - { - struct mm_struct *mm = vma->vm_mm; - struct rlimit *rlim = current->signal->rlim; -- unsigned long new_start, actual_size; -+ unsigned long new_start; - - /* address space limit tests */ - if (!may_expand_vm(mm, grow)) - return -ENOMEM; - - /* Stack limit test */ -- actual_size = size; -- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN))) -- actual_size -= PAGE_SIZE; -- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) -+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) - return -ENOMEM; - - /* mlock limit tests */ -@@ -2151,17 +2165,30 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns - int expand_upwards(struct vm_area_struct *vma, unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *next; -+ unsigned long gap_addr; - int error = 0; - - if (!(vma->vm_flags & VM_GROWSUP)) - return -EFAULT; - - /* Guard against wrapping around to address 0. */ -- if (address < PAGE_ALIGN(address+4)) -- address = PAGE_ALIGN(address+4); -- else -+ address &= PAGE_MASK; -+ address += PAGE_SIZE; -+ if (!address) - return -ENOMEM; - -+ /* Enforce stack_guard_gap */ -+ gap_addr = address + stack_guard_gap; -+ if (gap_addr < address) -+ return -ENOMEM; -+ next = vma->vm_next; -+ if (next && next->vm_start < gap_addr) { -+ if (!(next->vm_flags & VM_GROWSUP)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } -+ - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) - return -ENOMEM; -@@ -2206,7 +2233,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = address; -+ mm->highest_vm_end = vm_end_gap(vma); - spin_unlock(&mm->page_table_lock); - - perf_event_mmap(vma); -@@ -2227,6 +2254,8 @@ int expand_downwards(struct vm_area_struct *vma, - unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *prev; -+ unsigned long gap_addr; - int error; - - address &= PAGE_MASK; -@@ -2234,6 +2263,17 @@ int expand_downwards(struct vm_area_struct *vma, - if (error) - return error; - -+ /* Enforce stack_guard_gap */ -+ gap_addr = address - stack_guard_gap; -+ if (gap_addr > address) -+ return -ENOMEM; -+ prev = vma->vm_prev; -+ if (prev && prev->vm_end > gap_addr) { -+ if (!(prev->vm_flags & VM_GROWSDOWN)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } -+ - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) - return -ENOMEM; -@@ -2289,28 +2329,25 @@ int expand_downwards(struct vm_area_struct *vma, - return error; - } - --/* -- * Note how expand_stack() refuses to expand the stack all the way to -- * abut the next virtual mapping, *unless* that mapping itself is also -- * a stack mapping. We want to leave room for a guard page, after all -- * (the guard page itself is not added here, that is done by the -- * actual page faulting logic) -- * -- * This matches the behavior of the guard page logic (see mm/memory.c: -- * check_stack_guard_page()), which only allows the guard page to be -- * removed under these circumstances. -- */ -+/* enforced gap between the expanding stack and other mappings. */ -+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT; -+ -+static int __init cmdline_parse_stack_guard_gap(char *p) -+{ -+ unsigned long val; -+ char *endptr; -+ -+ val = simple_strtoul(p, &endptr, 10); -+ if (!*endptr) -+ stack_guard_gap = val << PAGE_SHIFT; -+ -+ return 0; -+} -+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap); -+ - #ifdef CONFIG_STACK_GROWSUP - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *next; -- -- address &= PAGE_MASK; -- next = vma->vm_next; -- if (next && next->vm_start == address + PAGE_SIZE) { -- if (!(next->vm_flags & VM_GROWSUP)) -- return -ENOMEM; -- } - return expand_upwards(vma, address); - } - -@@ -2332,14 +2369,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) - #else - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *prev; -- -- address &= PAGE_MASK; -- prev = vma->vm_prev; -- if (prev && prev->vm_end == address) { -- if (!(prev->vm_flags & VM_GROWSDOWN)) -- return -ENOMEM; -- } - return expand_downwards(vma, address); - } - -@@ -2437,7 +2466,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, - vma->vm_prev = prev; - vma_gap_update(vma); - } else -- mm->highest_vm_end = prev ? prev->vm_end : 0; -+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0; - tail_vma->vm_next = NULL; - - /* Kill the cache */ --- -2.1.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0002-Allow-stack-to-grow-up-to-address-space-limit.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0002-Allow-stack-to-grow-up-to-address-space-limit.patch deleted file mode 100644 index d0c94cef2..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0002-Allow-stack-to-grow-up-to-address-space-limit.patch +++ /dev/null @@ -1,51 +0,0 @@ -From cd20f002742028366c33b38b3ca613eaee4582c9 Mon Sep 17 00:00:00 2001 -From: Helge Deller <deller@gmx.de> -Date: Mon, 19 Jun 2017 17:34:05 +0200 -Subject: [PATCH 2/3] Allow stack to grow up to address space limit - -commit bd726c90b6b8ce87602208701b208a208e6d5600 upstream. - -Fix expand_upwards() on architectures with an upward-growing stack (parisc, -metag and partly IA-64) to allow the stack to reliably grow exactly up to -the address space limit given by TASK_SIZE. - -Signed-off-by: Helge Deller <deller@gmx.de> -Acked-by: Hugh Dickins <hughd@google.com> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - mm/mmap.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/mm/mmap.c b/mm/mmap.c -index 5e043dd..fcf4c88 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -2172,16 +2172,19 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (!(vma->vm_flags & VM_GROWSUP)) - return -EFAULT; - -- /* Guard against wrapping around to address 0. */ -+ /* Guard against exceeding limits of the address space. */ - address &= PAGE_MASK; -- address += PAGE_SIZE; -- if (!address) -+ if (address >= TASK_SIZE) - return -ENOMEM; -+ address += PAGE_SIZE; - - /* Enforce stack_guard_gap */ - gap_addr = address + stack_guard_gap; -- if (gap_addr < address) -- return -ENOMEM; -+ -+ /* Guard against overflow */ -+ if (gap_addr < address || gap_addr > TASK_SIZE) -+ gap_addr = TASK_SIZE; -+ - next = vma->vm_next; - if (next && next->vm_start < gap_addr) { - if (!(next->vm_flags & VM_GROWSUP)) --- -2.1.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch deleted file mode 100644 index 3f0acfa29..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 1c182004bcb1cd619b58ba6631b9d88052d18e02 Mon Sep 17 00:00:00 2001 -From: Hugh Dickins <hughd@google.com> -Date: Tue, 20 Jun 2017 02:10:44 -0700 -Subject: [PATCH 3/3] mm: fix new crash in unmapped_area_topdown() - -commit f4cb767d76cf7ee72f97dd76f6cfa6c76a5edc89 upstream. - -Trinity gets kernel BUG at mm/mmap.c:1963! in about 3 minutes of -mmap testing. That's the VM_BUG_ON(gap_end < gap_start) at the -end of unmapped_area_topdown(). Linus points out how MAP_FIXED -(which does not have to respect our stack guard gap intentions) -could result in gap_end below gap_start there. Fix that, and -the similar case in its alternative, unmapped_area(). - -Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas") -Reported-by: Dave Jones <davej@codemonkey.org.uk> -Debugged-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Hugh Dickins <hughd@google.com> -Acked-by: Michal Hocko <mhocko@suse.com> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - mm/mmap.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/mm/mmap.c b/mm/mmap.c -index fcf4c88..0990f8b 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -1771,7 +1771,8 @@ check_current: - /* Check if current node has a suitable gap */ - if (gap_start > high_limit) - return -ENOMEM; -- if (gap_end >= low_limit && gap_end - gap_start >= length) -+ if (gap_end >= low_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit right subtree if it looks promising */ -@@ -1874,7 +1875,8 @@ check_current: - gap_end = vm_start_gap(vma); - if (gap_end < low_limit) - return -ENOMEM; -- if (gap_start <= high_limit && gap_end - gap_start >= length) -+ if (gap_start <= high_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit left subtree if it looks promising */ --- -2.1.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0001-mm-larger-stack-guard-gap-between-vmas.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0001-mm-larger-stack-guard-gap-between-vmas.patch deleted file mode 100644 index 06fed097b..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0001-mm-larger-stack-guard-gap-between-vmas.patch +++ /dev/null @@ -1,935 +0,0 @@ -From d2fe80af1664f169498f6e624a8ea01e4e28efe2 Mon Sep 17 00:00:00 2001 -From: Hugh Dickins <hughd@google.com> -Date: Mon, 19 Jun 2017 04:03:24 -0700 -Subject: [PATCH 1/3] mm: larger stack guard gap, between vmas - -commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream. - -Stack guard page is a useful feature to reduce a risk of stack smashing -into a different mapping. We have been using a single page gap which -is sufficient to prevent having stack adjacent to a different mapping. -But this seems to be insufficient in the light of the stack usage in -userspace. E.g. glibc uses as large as 64kB alloca() in many commonly -used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX] -which is 256kB or stack strings with MAX_ARG_STRLEN. - -This will become especially dangerous for suid binaries and the default -no limit for the stack size limit because those applications can be -tricked to consume a large portion of the stack and a single glibc call -could jump over the guard page. These attacks are not theoretical, -unfortunatelly. - -Make those attacks less probable by increasing the stack guard gap -to 1MB (on systems with 4k pages; but make it depend on the page size -because systems with larger base pages might cap stack allocations in -the PAGE_SIZE units) which should cover larger alloca() and VLA stack -allocations. It is obviously not a full fix because the problem is -somehow inherent, but it should reduce attack space a lot. - -One could argue that the gap size should be configurable from userspace, -but that can be done later when somebody finds that the new 1MB is wrong -for some special case applications. For now, add a kernel command line -option (stack_guard_gap) to specify the stack gap size (in page units). - -Implementation wise, first delete all the old code for stack guard page: -because although we could get away with accounting one extra page in a -stack vma, accounting a larger gap can break userspace - case in point, -a program run with "ulimit -S -v 20000" failed when the 1MB gap was -counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK -and strict non-overcommit mode. - -Instead of keeping gap inside the stack vma, maintain the stack guard -gap as a gap between vmas: using vm_start_gap() in place of vm_start -(or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few -places which need to respect the gap - mainly arch_get_unmapped_area(), -and and the vma tree's subtree_gap support for that. - -Original-patch-by: Oleg Nesterov <oleg@redhat.com> -Original-patch-by: Michal Hocko <mhocko@suse.com> -Signed-off-by: Hugh Dickins <hughd@google.com> -Acked-by: Michal Hocko <mhocko@suse.com> -Tested-by: Helge Deller <deller@gmx.de> # parisc -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -[wt: backport to 4.11: adjust context] -[wt: backport to 4.9: adjust context ; kernel doc was not in admin-guide] -Signed-off-by: Willy Tarreau <w@1wt.eu> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - Documentation/kernel-parameters.txt | 7 ++ - arch/arc/mm/mmap.c | 2 +- - arch/arm/mm/mmap.c | 4 +- - arch/frv/mm/elf-fdpic.c | 2 +- - arch/mips/mm/mmap.c | 2 +- - arch/parisc/kernel/sys_parisc.c | 15 ++-- - arch/powerpc/mm/hugetlbpage-radix.c | 2 +- - arch/powerpc/mm/mmap.c | 4 +- - arch/powerpc/mm/slice.c | 2 +- - arch/s390/mm/mmap.c | 4 +- - arch/sh/mm/mmap.c | 4 +- - arch/sparc/kernel/sys_sparc_64.c | 4 +- - arch/sparc/mm/hugetlbpage.c | 2 +- - arch/tile/mm/hugetlbpage.c | 2 +- - arch/x86/kernel/sys_x86_64.c | 4 +- - arch/x86/mm/hugetlbpage.c | 2 +- - arch/xtensa/kernel/syscall.c | 2 +- - fs/hugetlbfs/inode.c | 2 +- - fs/proc/task_mmu.c | 4 - - include/linux/mm.h | 53 ++++++------- - mm/gup.c | 5 -- - mm/memory.c | 38 --------- - mm/mmap.c | 149 +++++++++++++++++++++--------------- - 23 files changed, 152 insertions(+), 163 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 65b05ba..29de8cf 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -3922,6 +3922,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - spia_pedr= - spia_peddr= - -+ stack_guard_gap= [MM] -+ override the default stack gap protection. The value -+ is in page units and it defines how many pages prior -+ to (for stacks growing down) resp. after (for stacks -+ growing up) the main stack are reserved for no other -+ mapping. Default value is 256 pages. -+ - stacktrace [FTRACE] - Enabled the stack tracer on boot up. - -diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c -index 2e06d56..cf4ae69 100644 ---- a/arch/arc/mm/mmap.c -+++ b/arch/arc/mm/mmap.c -@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c -index 66353ca..641334e 100644 ---- a/arch/arm/mm/mmap.c -+++ b/arch/arm/mm/mmap.c -@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c -index 836f147..efa59f1 100644 ---- a/arch/frv/mm/elf-fdpic.c -+++ b/arch/frv/mm/elf-fdpic.c -@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - addr = PAGE_ALIGN(addr); - vma = find_vma(current->mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - goto success; - } - -diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c -index d08ea3f..a44052c 100644 ---- a/arch/mips/mm/mmap.c -+++ b/arch/mips/mm/mmap.c -@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c -index 0a393a0..1d7691f 100644 ---- a/arch/parisc/kernel/sys_parisc.c -+++ b/arch/parisc/kernel/sys_parisc.c -@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - unsigned long task_size = TASK_SIZE; - int do_color_align, last_mmap; - struct vm_unmapped_area_info info; -@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - else - addr = PAGE_ALIGN(addr); - -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - int do_color_align, last_mmap; -@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = COLOR_ALIGN(addr, last_mmap, pgoff); - else - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c -index 35254a6..a2b2d97 100644 ---- a/arch/powerpc/mm/hugetlbpage-radix.c -+++ b/arch/powerpc/mm/hugetlbpage-radix.c -@@ -65,7 +65,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - /* -diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c -index 2f1e443..5bc2845 100644 ---- a/arch/powerpc/mm/mmap.c -+++ b/arch/powerpc/mm/mmap.c -@@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 2b27458..c4d5c9c 100644 ---- a/arch/powerpc/mm/slice.c -+++ b/arch/powerpc/mm/slice.c -@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, - if ((mm->task_size - len) < addr) - return 0; - vma = find_vma(mm, addr); -- return (!vma || (addr + len) <= vma->vm_start); -+ return (!vma || (addr + len) <= vm_start_gap(vma)); - } - - static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice) -diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c -index eb9df28..812368f 100644 ---- a/arch/s390/mm/mmap.c -+++ b/arch/s390/mm/mmap.c -@@ -98,7 +98,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -136,7 +136,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c -index 6777177..7df7d59 100644 ---- a/arch/sh/mm/mmap.c -+++ b/arch/sh/mm/mmap.c -@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c -index fe8b8ee..02e05e2 100644 ---- a/arch/sparc/kernel/sys_sparc_64.c -+++ b/arch/sparc/kernel/sys_sparc_64.c -@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c -index 988acc8b..58cde8d 100644 ---- a/arch/sparc/mm/hugetlbpage.c -+++ b/arch/sparc/mm/hugetlbpage.c -@@ -116,7 +116,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, HPAGE_SIZE); - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c -index 77ceaa3..67508b2 100644 ---- a/arch/tile/mm/hugetlbpage.c -+++ b/arch/tile/mm/hugetlbpage.c -@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (current->mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c -index a55ed63..1119414 100644 ---- a/arch/x86/kernel/sys_x86_64.c -+++ b/arch/x86/kernel/sys_x86_64.c -@@ -140,7 +140,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (end - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -183,7 +183,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c -index 2ae8584..fe342e8 100644 ---- a/arch/x86/mm/hugetlbpage.c -+++ b/arch/x86/mm/hugetlbpage.c -@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c -index 83cf496..3aaaae1 100644 ---- a/arch/xtensa/kernel/syscall.c -+++ b/arch/xtensa/kernel/syscall.c -@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - /* At this point: (!vmm || addr < vmm->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; -- if (!vmm || addr + len <= vmm->vm_start) -+ if (!vmm || addr + len <= vm_start_gap(vmm)) - return addr; - addr = vmm->vm_end; - if (flags & MAP_SHARED) -diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c -index 4fb7b10..704fa0b 100644 ---- a/fs/hugetlbfs/inode.c -+++ b/fs/hugetlbfs/inode.c -@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index 35b92d8..c5f2136 100644 ---- a/fs/proc/task_mmu.c -+++ b/fs/proc/task_mmu.c -@@ -299,11 +299,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) - - /* We don't show the stack guard page in /proc/maps */ - start = vma->vm_start; -- if (stack_guard_page_start(vma, start)) -- start += PAGE_SIZE; - end = vma->vm_end; -- if (stack_guard_page_end(vma, end)) -- end -= PAGE_SIZE; - - seq_setwidth(m, 25 + sizeof(void *) * 6 - 1); - seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ", -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 0b5b2e4..6c9e1ad 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -1356,39 +1356,11 @@ int clear_page_dirty_for_io(struct page *page); - - int get_cmdline(struct task_struct *task, char *buffer, int buflen); - --/* Is the vma a continuation of the stack vma above it? */ --static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN); --} -- - static inline bool vma_is_anonymous(struct vm_area_struct *vma) - { - return !vma->vm_ops; - } - --static inline int stack_guard_page_start(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSDOWN) && -- (vma->vm_start == addr) && -- !vma_growsdown(vma->vm_prev, addr); --} -- --/* Is the vma a continuation of the stack vma below it? */ --static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP); --} -- --static inline int stack_guard_page_end(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSUP) && -- (vma->vm_end == addr) && -- !vma_growsup(vma->vm_next, addr); --} -- - int vma_is_stack_for_current(struct vm_area_struct *vma); - - extern unsigned long move_page_tables(struct vm_area_struct *vma, -@@ -2127,6 +2099,7 @@ void page_cache_async_readahead(struct address_space *mapping, - pgoff_t offset, - unsigned long size); - -+extern unsigned long stack_guard_gap; - /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ - extern int expand_stack(struct vm_area_struct *vma, unsigned long address); - -@@ -2155,6 +2128,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m - return vma; - } - -+static inline unsigned long vm_start_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_start = vma->vm_start; -+ -+ if (vma->vm_flags & VM_GROWSDOWN) { -+ vm_start -= stack_guard_gap; -+ if (vm_start > vma->vm_start) -+ vm_start = 0; -+ } -+ return vm_start; -+} -+ -+static inline unsigned long vm_end_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_end = vma->vm_end; -+ -+ if (vma->vm_flags & VM_GROWSUP) { -+ vm_end += stack_guard_gap; -+ if (vm_end < vma->vm_end) -+ vm_end = -PAGE_SIZE; -+ } -+ return vm_end; -+} -+ - static inline unsigned long vma_pages(struct vm_area_struct *vma) - { - return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; -diff --git a/mm/gup.c b/mm/gup.c -index ec4f827..c63a034 100644 ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -370,11 +370,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma, - /* mlock all present pages, but do not fault in new pages */ - if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK) - return -ENOENT; -- /* For mm_populate(), just skip the stack guard page. */ -- if ((*flags & FOLL_POPULATE) && -- (stack_guard_page_start(vma, address) || -- stack_guard_page_end(vma, address + PAGE_SIZE))) -- return -ENOENT; - if (*flags & FOLL_WRITE) - fault_flags |= FAULT_FLAG_WRITE; - if (*flags & FOLL_REMOTE) -diff --git a/mm/memory.c b/mm/memory.c -index cbb1e5e..e6a5a1f 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -2699,40 +2699,6 @@ int do_swap_page(struct fault_env *fe, pte_t orig_pte) - } - - /* -- * This is like a special single-page "expand_{down|up}wards()", -- * except we must first make sure that 'address{-|+}PAGE_SIZE' -- * doesn't hit another vma. -- */ --static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address) --{ -- address &= PAGE_MASK; -- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) { -- struct vm_area_struct *prev = vma->vm_prev; -- -- /* -- * Is there a mapping abutting this one below? -- * -- * That's only ok if it's the same stack mapping -- * that has gotten split.. -- */ -- if (prev && prev->vm_end == address) -- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; -- -- return expand_downwards(vma, address - PAGE_SIZE); -- } -- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { -- struct vm_area_struct *next = vma->vm_next; -- -- /* As VM_GROWSDOWN but s/below/above/ */ -- if (next && next->vm_start == address + PAGE_SIZE) -- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; -- -- return expand_upwards(vma, address + PAGE_SIZE); -- } -- return 0; --} -- --/* - * We enter with non-exclusive mmap_sem (to exclude vma changes, - * but allow concurrent faults), and pte mapped but not yet locked. - * We return with mmap_sem still held, but pte unmapped and unlocked. -@@ -2748,10 +2714,6 @@ static int do_anonymous_page(struct fault_env *fe) - if (vma->vm_flags & VM_SHARED) - return VM_FAULT_SIGBUS; - -- /* Check if we need to add a guard page to the stack */ -- if (check_stack_guard_page(vma, fe->address) < 0) -- return VM_FAULT_SIGSEGV; -- - /* - * Use pte_alloc() instead of pte_alloc_map(). We can't run - * pte_offset_map() on pmds where a huge pmd might be created -diff --git a/mm/mmap.c b/mm/mmap.c -index 1af87c1..26542b3 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -183,6 +183,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - unsigned long retval; - unsigned long newbrk, oldbrk; - struct mm_struct *mm = current->mm; -+ struct vm_area_struct *next; - unsigned long min_brk; - bool populate; - -@@ -228,7 +229,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - } - - /* Check against existing mmap mappings. */ -- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE)) -+ next = find_vma(mm, oldbrk); -+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next)) - goto out; - - /* Ok, looks good - let it rip. */ -@@ -251,10 +253,22 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - - static long vma_compute_subtree_gap(struct vm_area_struct *vma) - { -- unsigned long max, subtree_gap; -- max = vma->vm_start; -- if (vma->vm_prev) -- max -= vma->vm_prev->vm_end; -+ unsigned long max, prev_end, subtree_gap; -+ -+ /* -+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we -+ * allow two stack_guard_gaps between them here, and when choosing -+ * an unmapped area; whereas when expanding we only require one. -+ * That's a little inconsistent, but keeps the code here simpler. -+ */ -+ max = vm_start_gap(vma); -+ if (vma->vm_prev) { -+ prev_end = vm_end_gap(vma->vm_prev); -+ if (max > prev_end) -+ max -= prev_end; -+ else -+ max = 0; -+ } - if (vma->vm_rb.rb_left) { - subtree_gap = rb_entry(vma->vm_rb.rb_left, - struct vm_area_struct, vm_rb)->rb_subtree_gap; -@@ -350,7 +364,7 @@ static void validate_mm(struct mm_struct *mm) - anon_vma_unlock_read(anon_vma); - } - -- highest_address = vma->vm_end; -+ highest_address = vm_end_gap(vma); - vma = vma->vm_next; - i++; - } -@@ -539,7 +553,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = vma->vm_end; -+ mm->highest_vm_end = vm_end_gap(vma); - - /* - * vma->vm_prev wasn't known when we followed the rbtree to find the -@@ -854,7 +868,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, - vma_gap_update(vma); - if (end_changed) { - if (!next) -- mm->highest_vm_end = end; -+ mm->highest_vm_end = vm_end_gap(vma); - else if (!adjust_next) - vma_gap_update(next); - } -@@ -939,7 +953,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, - * mm->highest_vm_end doesn't need any update - * in remove_next == 1 case. - */ -- VM_WARN_ON(mm->highest_vm_end != end); -+ VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma)); - } - } - if (insert && file) -@@ -1783,7 +1797,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit left subtree if it looks promising */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end >= low_limit && vma->vm_rb.rb_left) { - struct vm_area_struct *left = - rb_entry(vma->vm_rb.rb_left, -@@ -1794,7 +1808,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - } - } - -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - check_current: - /* Check if current node has a suitable gap */ - if (gap_start > high_limit) -@@ -1821,8 +1835,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - vma = rb_entry(rb_parent(prev), - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_left) { -- gap_start = vma->vm_prev->vm_end; -- gap_end = vma->vm_start; -+ gap_start = vm_end_gap(vma->vm_prev); -+ gap_end = vm_start_gap(vma); - goto check_current; - } - } -@@ -1886,7 +1900,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit right subtree if it looks promising */ -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - if (gap_start <= high_limit && vma->vm_rb.rb_right) { - struct vm_area_struct *right = - rb_entry(vma->vm_rb.rb_right, -@@ -1899,7 +1913,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - check_current: - /* Check if current node has a suitable gap */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end < low_limit) - return -ENOMEM; - if (gap_start <= high_limit && gap_end - gap_start >= length) -@@ -1925,7 +1939,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_right) { - gap_start = vma->vm_prev ? -- vma->vm_prev->vm_end : 0; -+ vm_end_gap(vma->vm_prev) : 0; - goto check_current; - } - } -@@ -1963,7 +1977,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct vm_unmapped_area_info info; - - if (len > TASK_SIZE - mmap_min_addr) -@@ -1974,9 +1988,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -1999,7 +2014,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - struct vm_unmapped_area_info info; -@@ -2014,9 +2029,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - /* requesting a specific address */ - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -2151,21 +2167,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr, - * update accounting. This is shared with both the - * grow-up and grow-down cases. - */ --static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow) -+static int acct_stack_growth(struct vm_area_struct *vma, -+ unsigned long size, unsigned long grow) - { - struct mm_struct *mm = vma->vm_mm; - struct rlimit *rlim = current->signal->rlim; -- unsigned long new_start, actual_size; -+ unsigned long new_start; - - /* address space limit tests */ - if (!may_expand_vm(mm, vma->vm_flags, grow)) - return -ENOMEM; - - /* Stack limit test */ -- actual_size = size; -- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN))) -- actual_size -= PAGE_SIZE; -- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) -+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) - return -ENOMEM; - - /* mlock limit tests */ -@@ -2203,17 +2217,30 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns - int expand_upwards(struct vm_area_struct *vma, unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *next; -+ unsigned long gap_addr; - int error = 0; - - if (!(vma->vm_flags & VM_GROWSUP)) - return -EFAULT; - - /* Guard against wrapping around to address 0. */ -- if (address < PAGE_ALIGN(address+4)) -- address = PAGE_ALIGN(address+4); -- else -+ address &= PAGE_MASK; -+ address += PAGE_SIZE; -+ if (!address) - return -ENOMEM; - -+ /* Enforce stack_guard_gap */ -+ gap_addr = address + stack_guard_gap; -+ if (gap_addr < address) -+ return -ENOMEM; -+ next = vma->vm_next; -+ if (next && next->vm_start < gap_addr) { -+ if (!(next->vm_flags & VM_GROWSUP)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } -+ - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) - return -ENOMEM; -@@ -2257,7 +2284,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = address; -+ mm->highest_vm_end = vm_end_gap(vma); - spin_unlock(&mm->page_table_lock); - - perf_event_mmap(vma); -@@ -2278,6 +2305,8 @@ int expand_downwards(struct vm_area_struct *vma, - unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *prev; -+ unsigned long gap_addr; - int error; - - address &= PAGE_MASK; -@@ -2285,6 +2314,17 @@ int expand_downwards(struct vm_area_struct *vma, - if (error) - return error; - -+ /* Enforce stack_guard_gap */ -+ gap_addr = address - stack_guard_gap; -+ if (gap_addr > address) -+ return -ENOMEM; -+ prev = vma->vm_prev; -+ if (prev && prev->vm_end > gap_addr) { -+ if (!(prev->vm_flags & VM_GROWSDOWN)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } -+ - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) - return -ENOMEM; -@@ -2339,28 +2379,25 @@ int expand_downwards(struct vm_area_struct *vma, - return error; - } - --/* -- * Note how expand_stack() refuses to expand the stack all the way to -- * abut the next virtual mapping, *unless* that mapping itself is also -- * a stack mapping. We want to leave room for a guard page, after all -- * (the guard page itself is not added here, that is done by the -- * actual page faulting logic) -- * -- * This matches the behavior of the guard page logic (see mm/memory.c: -- * check_stack_guard_page()), which only allows the guard page to be -- * removed under these circumstances. -- */ -+/* enforced gap between the expanding stack and other mappings. */ -+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT; -+ -+static int __init cmdline_parse_stack_guard_gap(char *p) -+{ -+ unsigned long val; -+ char *endptr; -+ -+ val = simple_strtoul(p, &endptr, 10); -+ if (!*endptr) -+ stack_guard_gap = val << PAGE_SHIFT; -+ -+ return 0; -+} -+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap); -+ - #ifdef CONFIG_STACK_GROWSUP - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *next; -- -- address &= PAGE_MASK; -- next = vma->vm_next; -- if (next && next->vm_start == address + PAGE_SIZE) { -- if (!(next->vm_flags & VM_GROWSUP)) -- return -ENOMEM; -- } - return expand_upwards(vma, address); - } - -@@ -2382,14 +2419,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) - #else - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *prev; -- -- address &= PAGE_MASK; -- prev = vma->vm_prev; -- if (prev && prev->vm_end == address) { -- if (!(prev->vm_flags & VM_GROWSDOWN)) -- return -ENOMEM; -- } - return expand_downwards(vma, address); - } - -@@ -2487,7 +2516,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, - vma->vm_prev = prev; - vma_gap_update(vma); - } else -- mm->highest_vm_end = prev ? prev->vm_end : 0; -+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0; - tail_vma->vm_next = NULL; - - /* Kill the cache */ --- -2.1.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0002-Allow-stack-to-grow-up-to-address-space-limit.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0002-Allow-stack-to-grow-up-to-address-space-limit.patch deleted file mode 100644 index 2a20abb57..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0002-Allow-stack-to-grow-up-to-address-space-limit.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 88aa347d26911cffd84ac3dd2a8341f1ba7e3444 Mon Sep 17 00:00:00 2001 -From: Helge Deller <deller@gmx.de> -Date: Mon, 19 Jun 2017 17:34:05 +0200 -Subject: [PATCH 2/3] Allow stack to grow up to address space limit - -commit bd726c90b6b8ce87602208701b208a208e6d5600 upstream. - -Fix expand_upwards() on architectures with an upward-growing stack (parisc, -metag and partly IA-64) to allow the stack to reliably grow exactly up to -the address space limit given by TASK_SIZE. - -Signed-off-by: Helge Deller <deller@gmx.de> -Acked-by: Hugh Dickins <hughd@google.com> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - mm/mmap.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/mm/mmap.c b/mm/mmap.c -index 26542b3..d71a61e 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -2224,16 +2224,19 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (!(vma->vm_flags & VM_GROWSUP)) - return -EFAULT; - -- /* Guard against wrapping around to address 0. */ -+ /* Guard against exceeding limits of the address space. */ - address &= PAGE_MASK; -- address += PAGE_SIZE; -- if (!address) -+ if (address >= TASK_SIZE) - return -ENOMEM; -+ address += PAGE_SIZE; - - /* Enforce stack_guard_gap */ - gap_addr = address + stack_guard_gap; -- if (gap_addr < address) -- return -ENOMEM; -+ -+ /* Guard against overflow */ -+ if (gap_addr < address || gap_addr > TASK_SIZE) -+ gap_addr = TASK_SIZE; -+ - next = vma->vm_next; - if (next && next->vm_start < gap_addr) { - if (!(next->vm_flags & VM_GROWSUP)) --- -2.1.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch deleted file mode 100644 index 7dc79192b..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 00d15368d611f12f3c4980dce63b68b08ea89a09 Mon Sep 17 00:00:00 2001 -From: Hugh Dickins <hughd@google.com> -Date: Tue, 20 Jun 2017 02:10:44 -0700 -Subject: [PATCH 3/3] mm: fix new crash in unmapped_area_topdown() - -commit f4cb767d76cf7ee72f97dd76f6cfa6c76a5edc89 upstream. - -Trinity gets kernel BUG at mm/mmap.c:1963! in about 3 minutes of -mmap testing. That's the VM_BUG_ON(gap_end < gap_start) at the -end of unmapped_area_topdown(). Linus points out how MAP_FIXED -(which does not have to respect our stack guard gap intentions) -could result in gap_end below gap_start there. Fix that, and -the similar case in its alternative, unmapped_area(). - -Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas") -Reported-by: Dave Jones <davej@codemonkey.org.uk> -Debugged-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Hugh Dickins <hughd@google.com> -Acked-by: Michal Hocko <mhocko@suse.com> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - mm/mmap.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/mm/mmap.c b/mm/mmap.c -index d71a61e..145d3d5 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -1813,7 +1813,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - /* Check if current node has a suitable gap */ - if (gap_start > high_limit) - return -ENOMEM; -- if (gap_end >= low_limit && gap_end - gap_start >= length) -+ if (gap_end >= low_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit right subtree if it looks promising */ -@@ -1916,7 +1917,8 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - gap_end = vm_start_gap(vma); - if (gap_end < low_limit) - return -ENOMEM; -- if (gap_start <= high_limit && gap_end - gap_start >= length) -+ if (gap_start <= high_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit left subtree if it looks promising */ --- -2.1.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch deleted file mode 100644 index 4021e5d38..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 2b206c36b16e72cfe41cd22448d8527359ffd962 Mon Sep 17 00:00:00 2001 -From: Casey Schaufler <casey@schaufler-ca.com> -Date: Mon, 7 Dec 2015 14:34:32 -0800 -Subject: [PATCH 1/4] Smack: File receive for sockets - -The existing file receive hook checks for access on -the file inode even for UDS. This is not right, as -the inode is not used by Smack to make access checks -for sockets. This change checks for an appropriate -access relationship between the receiving (current) -process and the socket. If the process can't write -to the socket's send label or the socket's receive -label can't write to the process fail. - -This will allow the legitimate cases, where the -socket sender and socket receiver can freely communicate. -Only strangly set socket labels should cause a problem. - -Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> ---- - security/smack/smack_lsm.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index ff81026..b20ef06 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file) - int may = 0; - struct smk_audit_info ad; - struct inode *inode = file_inode(file); -+ struct socket *sock; -+ struct task_smack *tsp; -+ struct socket_smack *ssp; - - if (unlikely(IS_PRIVATE(inode))) - return 0; - - smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); - smk_ad_setfield_u_fs_path(&ad, file->f_path); -+ -+ if (S_ISSOCK(inode->i_mode)) { -+ sock = SOCKET_I(inode); -+ ssp = sock->sk->sk_security; -+ tsp = current_security(); -+ /* -+ * If the receiving process can't write to the -+ * passed socket or if the passed socket can't -+ * write to the receiving process don't accept -+ * the passed socket. -+ */ -+ rc = smk_access(tsp->smk_task, ssp->smk_out, MAY_WRITE, &ad); -+ rc = smk_bu_file(file, may, rc); -+ if (rc < 0) -+ return rc; -+ rc = smk_access(ssp->smk_in, tsp->smk_task, MAY_WRITE, &ad); -+ rc = smk_bu_file(file, may, rc); -+ return rc; -+ } - /* - * This code relies on bitmasks. - */ --- -2.7.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-mconf-menuconfig.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-mconf-menuconfig.patch new file mode 100644 index 000000000..7f0979ca9 --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-mconf-menuconfig.patch @@ -0,0 +1,48 @@ +From bebd63730a433ba62549a80114a9851328aa8897 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@windriver.com> +Date: Mon, 2 Jul 2018 23:10:28 -0400 +Subject: [PATCH] menuconfig,mconf-cfg: Allow specification of ncurses location + +In some cross build environments such as the Yocto Project build +environment it provides an ncurses library that is compiled +differently than the host's version. This causes display corruption +problems when the host's curses includes are used instead of the +includes from the provided compiler are overridden. There is a second +case where there is no curses libraries at all on the host system and +menuconfig will just fail entirely. + +The solution is simply to allow an override variable in +check-lxdialog.sh for environments such as the Yocto Project. Adding +a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing +compiling and linking against the right headers and libraries. + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> +cc: Michal Marek <mmarek@suse.cz> +cc: linux-kbuild@vger.kernel.org +Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> +--- + scripts/kconfig/mconf-cfg.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh +index c812872d7f9d..42d20819025c 100755 +--- a/scripts/kconfig/mconf-cfg.sh ++++ b/scripts/kconfig/mconf-cfg.sh +@@ -4,6 +4,14 @@ + PKG="ncursesw" + PKG2="ncurses" + ++if [ "$CROSS_CURSES_LIB" != "" ]; then ++ echo libs=\'$CROSS_CURSES_LIB\' ++ if [ x"$CROSS_CURSES_INC" != x ]; then ++ echo cflags=\'$CROSS_CURSES_INC\' ++ fi ++ exit 0 ++fi ++ + if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then + if ${HOSTPKG_CONFIG} --exists $PKG; then + echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\" +-- +2.17.1 + diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch deleted file mode 100644 index c516f3aa5..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 99267706991ab84bd44ceaea9a7ec886bbdd58e0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jobol@nonadev.net> -Date: Tue, 12 Jan 2016 21:23:40 +0100 -Subject: [PATCH 2/4] smack: fix cache of access labels -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Before this commit, removing the access property of -a file, aka, the extended attribute security.SMACK64 -was not effictive until the cache had been cleaned. - -This patch fixes that problem. - -Signed-off-by: José Bollo <jobol@nonadev.net> -Acked-by: Casey Schaufler <casey@schaufler-ca.com> ---- - security/smack/smack_lsm.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index b20ef06..b2bcb14 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -1444,9 +1444,13 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name) - * Don't do anything special for these. - * XATTR_NAME_SMACKIPIN - * XATTR_NAME_SMACKIPOUT -- * XATTR_NAME_SMACKEXEC - */ -- if (strcmp(name, XATTR_NAME_SMACK) == 0) -+ if (strcmp(name, XATTR_NAME_SMACK) == 0) { -+ struct super_block *sbp = d_backing_inode(dentry)->i_sb; -+ struct superblock_smack *sbsp = sbp->s_security; -+ -+ isp->smk_inode = sbsp->smk_default; -+ } else if (strcmp(name, XATTR_NAME_SMACKEXEC) == 0) - isp->smk_task = NULL; - else if (strcmp(name, XATTR_NAME_SMACKMMAP) == 0) - isp->smk_mmap = NULL; --- -2.7.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch deleted file mode 100644 index c9180bb9f..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ec4eb03af07b0fbc330aecca6ac4ebd6accd8825 Mon Sep 17 00:00:00 2001 -From: Rafal Krypa <r.krypa@samsung.com> -Date: Mon, 4 Apr 2016 11:14:53 +0200 -Subject: [PATCH 3/4] Smack: ignore null signal in smack_task_kill - -Kill with signal number 0 is commonly used for checking PID existence. -Smack treated such cases like any other kills, although no signal is -actually delivered when sig == 0. - -Checking permissions when sig == 0 didn't prevent an unprivileged caller -from learning whether PID exists or not. When it existed, kernel returned -EPERM, when it didn't - ESRCH. The only effect of policy check in such -case is noise in audit logs. - -This change lets Smack silently ignore kill() invocations with sig == 0. - -Signed-off-by: Rafal Krypa <r.krypa@samsung.com> -Acked-by: Casey Schaufler <casey@schaufler-ca.com> ---- - security/smack/smack_lsm.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index b2bcb14..cf8a93f 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -2239,6 +2239,9 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info, - struct smack_known *tkp = smk_of_task_struct(p); - int rc; - -+ if (!sig) -+ return 0; /* null signal; existence test */ -+ - smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK); - smk_ad_setfield_u_tsk(&ad, p); - /* --- -2.7.4 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch deleted file mode 100644 index a1eeac3d7..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch +++ /dev/null @@ -1,49 +0,0 @@ -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-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg new file mode 100644 index 000000000..eac59dbdf --- /dev/null +++ b/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-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg new file mode 100644 index 000000000..8c573578c --- /dev/null +++ b/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-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg new file mode 100644 index 000000000..993d15084 --- /dev/null +++ b/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-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/xen-be.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/xen-be.cfg new file mode 100644 index 000000000..36f390187 --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/xen-be.cfg @@ -0,0 +1,50 @@ +# global stuff - these enable us to allow some +# of the not so generic stuff below for xen +CONFIG_PARAVIRT=y +CONFIG_NET=y +CONFIG_NET_CORE=y +CONFIG_NETDEVICES=y +CONFIG_BLOCK=y +CONFIG_WATCHDOG=y +CONFIG_TARGET_CORE=y +CONFIG_SCSI=y +CONFIG_FB=y +CONFIG_INPUT_MISC=y +CONFIG_MEMORY_HOTPLUG=y +CONFIG_TTY=y +# Technically not required but otherwise produces +# pretty useless systems starting from allnoconfig +# You want TCP/IP and ELF binaries right? +CONFIG_INET=y +CONFIG_BINFMT_ELF=y +# generic config +CONFIG_XEN=y +CONFIG_XEN_DOM0=y +# backend drivers +CONFIG_XEN_BACKEND=y +CONFIG_XEN_BLKDEV_BACKEND=m +CONFIG_XEN_NETDEV_BACKEND=m +CONFIG_HVC_XEN=y +CONFIG_XEN_WDT=m +CONFIG_XEN_SCSI_BACKEND=m +# frontend drivers +CONFIG_XEN_FBDEV_FRONTEND=m +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m +CONFIG_XEN_SCSI_FRONTEND=m +# others +CONFIG_XEN_BALLOON=y +CONFIG_XEN_SCRUB_PAGES=y +CONFIG_XEN_DEV_EVTCHN=m +CONFIG_XEN_BLKDEV_FRONTEND=m +CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_XENFS=m +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_XENBUS_FRONTEND=y +CONFIG_XEN_GNTDEV=m +CONFIG_XEN_GRANT_DEV_ALLOC=m +CONFIG_SWIOTLB_XEN=y +CONFIG_XEN_PRIVCMD=m +CONFIG_DEBUG_INFO=y +CONFIG_FRAME_POINTER=y diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend index 6557ce03c..ec3fa910b 100644 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -1,113 +1,46 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" -SRC_URI_append = "\ - ${@base_conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ -" +require recipes-kernel/linux/linux-yocto-agl.inc -# Fix CVE-2017-1000364 -SRC_URI_append = "\ - file://0001-mm-larger-stack-guard-gap-between-vmas.patch \ - file://0002-Allow-stack-to-grow-up-to-address-space-limit.patch \ - file://0003-mm-fix-new-crash-in-unmapped_area_topdown.patch \ +SRC_URI:append = " \ + ${@oe.utils.conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ + file://0001-mconf-menuconfig.patch \ " +# Enable support for Pi foundation touchscreen +AGL_KCONFIG_FRAGMENTS += "raspberrypi-panel.cfg" -do_configure_append_smack() { - # SMACK and Co - kernel_configure_variable IP_NF_SECURITY m - kernel_configure_variable IP6_NF_SECURITY m - kernel_configure_variable EXT2_FS_SECURITY y - kernel_configure_variable EXT3_FS_SECURITY y - kernel_configure_variable EXT4_FS_SECURITY y - kernel_configure_variable SECURITY y - kernel_configure_variable SECURITY_SMACK y - kernel_configure_variable TMPFS_XATTR y - kernel_configure_variable DEFAULT_SECURITY "smack" - kernel_configure_variable DEFAULT_SECURITY_SMACK y - kernel_configure_variable FANOTIFY_ACCESS_PERMISSIONS y -} - -do_configure_append_netboot() { - # NBD for netboot - kernel_configure_variable BLK_DEV_NBD y - # ramblk for inird - kernel_configure_variable BLK_DEV_RAM y -} - -do_configure_append_sota() { - # ramblk for inird - kernel_configure_variable BLK_DEV_RAM y -} - -# can -do_configure_append() { - - kernel_configure_variable TASKSTATS y - kernel_configure_variable TASK_DELAY_ACCT y - kernel_configure_variable USER_RETURN_NOTIFIER y - kernel_configure_variable PREEMPT_NOTIFIERS y - kernel_configure_variable CAN m - kernel_configure_variable CAN_RAW m - kernel_configure_variable CAN_BCM m - kernel_configure_variable CAN_GW m - kernel_configure_variable CAN_VCAN m - kernel_configure_variable CAN_SLCAN m - kernel_configure_variable CAN_DEV m - kernel_configure_variable CAN_CALC_BITTIMING y - kernel_configure_variable CAN_MCP251X m - kernel_configure_variable CAN_ESD_USB2 m - kernel_configure_variable CAN_GS_USB m - kernel_configure_variable CAN_KVASER_USB m - kernel_configure_variable CAN_PEAK_USB m - kernel_configure_variable CAN_8DEV_USB m +# Enable bt hci uart +AGL_KCONFIG_FRAGMENTS += "raspberrypi-hciuart.cfg" -# not enabled, yet ? -# kernel_configure_variable CAN_LEDS is not set -# kernel_configure_variable CAN_SJA1000 is not set -# kernel_configure_variable CAN_C_CAN is not set -# kernel_configure_variable CAN_M_CAN is not set -# kernel_configure_variable CAN_CC770 is not set -# kernel_configure_variable CAN_EMS_USB is not set -# kernel_configure_variable CAN_SOFTING is not set -# kernel_configure_variable CAN_DEBUG_DEVICES is not set -} +# ENABLE NETWORK (built-in) +AGL_KCONFIG_FRAGMENTS += "raspberrypi_network.cfg" -do_configure_append() { +# For Xen +AGL_KCONFIG_FRAGMENTS += " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','xen-be.cfg','',d)} \ +" - # VC4 Wayland/Weston - kernel_configure_variable I2C_BCM2835 y - kernel_configure_variable DRM y - kernel_configure_variable DRM_PANEL_RASPBERRYPI_TOUCHSCREEN y - kernel_configure_variable DRM_VC4 y - kernel_configure_variable FB_BCM2708 n +# Take in account that linux under Xen should use the hvc0 console +SERIAL_OPTION = "${@bb.utils.contains('AGL_XEN_WANTED','1','hvc0','ttyS0,115200',d)}" +SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=${SERIAL_OPTION}", "", d)}" - # Enable support for TP-Link TL-W722N USB Wifi adapter - kernel_configure_variable ATH_CARDS m - kernel_configure_variable ATH9K_HTC m +CMDLINE_DEBUG = "" - # Enable support for RTLSDR - kernel_configure_variable MEDIA_USB_SUPPORT y - kernel_configure_variable MEDIA_DIGITAL_TV_SUPPORT y - kernel_configure_variable DVB_USB_V2 m - kernel_configure_variable DVB_USB_RTL28XXU m +# Xen related option +CMDLINE:append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','clk_ignore_unused','',d)}' - # KEEP until fixed upstream: - # Keep this the last line - # Remove all modified configs and add the rest to .config - sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' +# Workaround for crash during brcmfmac loading. Disable it at this moment +CMDLINE:append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','modprobe.blacklist=brcmfmac','',d)}' - yes '' | oe_runmake oldconfig - kernel_do_configure -} - -CMDLINE_DEBUG = "" -CMDLINE_append = " usbhid.mousepoll=0" +CMDLINE:append = " usbhid.mousepoll=0" # Add options to allow CMA to operate -CMDLINE_append = ' ${@base_conditional("ENABLE_CMA", "1", "coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}' +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" + +RDEPENDS:${PN} += "kernel-module-snd-bcm2835" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend deleted file mode 100644 index c96635ecd..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend +++ /dev/null @@ -1,11 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}-4.4:" - -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_smack = "\ - file://0001-Smack-File-receive-for-sockets.patch \ - file://0002-smack-fix-cache-of-access-labels.patch \ - file://0003-Smack-ignore-null-signal-in-smack_task_kill.patch \ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend deleted file mode 100644 index 3dc9a9561..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend +++ /dev/null @@ -1,8 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}-4.9:" - -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend new file mode 100644 index 000000000..2e045c1f2 --- /dev/null +++ b/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-bsp/meta-rcar-gateway/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-rcar-gateway/recipes-kernel/linux/linux-renesas_%.bbappend new file mode 100644 index 000000000..d565da8ac --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gateway/recipes-kernel/linux/linux-renesas_%.bbappend @@ -0,0 +1,11 @@ +do_install:append () { + + # Remove firmware file that is not packaged in the kernel. + # It throws an error during do_package. + # It seems to be moved out of the kernel in later BSP versions. + rm -rf ${D}/lib/firmware/r8a779f0_ufs.bin + rm -rf ${D}/lib/firmware + rm -rf ${D}/lib + +} + diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware new file mode 120000 index 000000000..133ef4917 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools new file mode 120000 index 000000000..9065d9e99 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/si-tools/
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt new file mode 120000 index 000000000..13ea60b90 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/ti-bt
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware new file mode 120000 index 000000000..b6dd66919 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot new file mode 120000 index 000000000..857cd50d2 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/u-boot/
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo new file mode 120000 index 000000000..cc44ec53f --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-graphics/cairo/
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux new file mode 120000 index 000000000..4feae94d0 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-kernel/linux
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer new file mode 120000 index 000000000..ef3ed76fd --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES b/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES new file mode 100644 index 000000000..296dd5e19 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES @@ -0,0 +1,74 @@ +#### These are notes for future reference + +# TODO: follow-up patch: Need to do other mechanism for package inclusion +# TODO2: include or leave-out the kernel modules packages + +# E.g. MACHINE_FEATURE. Should *not* be in layer.conf !! +# 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 \ +#" +# E.g. MACHINE_FEATURE +#IMAGE_INSTALL:append:r8a7797 += " \ +# kernel-module-uio-imp \ +# kernel-module-cmemdrv \ +# udev-rules-cvlib \ +#" +# E.g. MACHINE_FEATURE +#IMAGE_INSTALL:append:r8a7798 += " \ +# kernel-module-uio-imp \ +# kernel-module-cmemdrv \ +# udev-rules-cvlib \ +#" +# This is a special use case. Should be enabled by user. +#DISTRO_FEATURES:append = " surroundview " + + +#### BBMASK +# not required for AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-benchmark/" + +# Do not interfer with the distro configuration +BBMASK += "/meta-rcar-gen3-adas/recipes-connectivity/bluez/" + +# We do not need the network config done here +BBMASK += "/meta-rcar-gen3-adas/recipes-core/systemd/" + +# These changes are applied unconditionally when the layer is present. +# These are not required for AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-core/images/" +BBMASK += "/meta-rcar-gen3-adas/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend" + +# Upstream does have this change already, so this is not required. +# poky/meta/classes/cmake.bbclass: -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 +BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/cmake/" + +# Upstream has a more recent valgrind (3.15.0 vs 3.12.0) +BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/valgrind/" + +# This is already part of upstream and no bbappend is required +BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/gcc/" + +# libpng in upstream already enabled neon +# poky/meta/recipes-multimedia/libpng/libpng_1.6.37.bb:EXTRA_OECONF:append:class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}" +BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/libpng/" + +# opencv in upstream is newer +BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/opencv/" + +# unclear patch status +BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/wayland/" + +# not required in AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-multimedia/pulseaudio/" + +# not required in AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-support/" diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc b/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc new file mode 100644 index 000000000..0c344a471 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc @@ -0,0 +1,20 @@ +#Keep this as a reminder +#MACHINEOVERRIDES .= ":kingfisher" +#PACKAGE_EXTRA_ARCHS:append = " kingfisher" + +# Add a feature as a low-impact way to detect Kingfisher support in +# recipes. +AGL_FEATURES:append:rcar-gen3 = " kingfisher" + +IMAGE_NAME:rcar-gen3 = "${IMAGE_BASENAME}-${MACHINE}-kf${IMAGE_VERSION_SUFFIX}" +IMAGE_LINK_NAME:rcar-gen3 = "${IMAGE_BASENAME}-${MACHINE}-kf" +TOOLCHAIN_OUTPUTNAME:rcar-gen3 = "${SDK_NAME}-kf-toolchain-${SDK_VERSION}" + +# Radio packages +IMAGE_INSTALL:append:rcar-gen3 = " \ + si-tools \ + si-init \ + linux-firmware-wl18xx \ + ti-bt \ + ti-bt-firmware \ +" diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf b/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf new file mode 100644 index 000000000..bae421a50 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf @@ -0,0 +1,18 @@ +# We have a conf and classes directory, append to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a recipes directory, add to BBFILES +# 1) the first directory symlinks necessary files out of the cogent repo +# 2) the 2nd directory is our local glue and appends +BBFILES += " \ + ${LAYERDIR}/cogent-symlinks/recipes-*/*/*.bb \ + ${LAYERDIR}/cogent-symlinks/recipes-*/*/*.bbappend \ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend \ +" + +BBFILE_COLLECTIONS += "rcar-gen3-cogent" +BBFILE_PATTERN_rcar-gen3-cogent := "^${LAYERDIR}/" +BBFILE_PRIORITY_rcar-gen3-cogent = "7" + +LAYERSERIES_COMPAT_rcar-gen3-cogent = "scarthgap" diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service new file mode 100644 index 000000000..d2204cb6a --- /dev/null +++ b/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-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch new file mode 100644 index 000000000..9bbccadd3 --- /dev/null +++ b/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-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb new file mode 100644 index 000000000..b53504400 --- /dev/null +++ b/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" +EOF +} + +FILES:${PN} += "${systemd_system_unitdir}" diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend new file mode 100644 index 000000000..7121bd168 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend @@ -0,0 +1,28 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/files" + +SRC_URI += " \ + file://si-tools-fm-improvements.patch \ +" + +EXTRA_OEMAKE:append = " 'LDFLAGS=${LDFLAGS}'" + +do_install() { + install -d ${D}${bindir} + install -d ${D}${nonarch_base_libdir}/firmware/radio/ + + install -m 755 si_ctl ${D}${bindir} + install -m 755 si_flash ${D}${bindir} + for file in ${SCRIPTS}; do + install -m 755 ${S}/scripts/$file ${D}${bindir} + sed -e 's,^\(SI_ARGS\s*=\s*\).*,\1"/dev/i2c-12 0x65",' -i ${D}${bindir}/$file + done + + for file in ${FIRMWARE}; do + install -m 644 ${S}/firmware/$file ${D}${nonarch_base_libdir}/firmware/radio/ + done +} + +FILES:${PN} = " \ + ${bindir} \ + ${nonarch_base_libdir}/firmware/radio \ +" diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend new file mode 100644 index 000000000..52bee656d --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend @@ -0,0 +1,6 @@ +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/ti-connectivity/ + cp *.bts ${D}${nonarch_base_libdir}/firmware/ti-connectivity/ +} + +FILES:${PN} = "${nonarch_base_libdir}/firmware/ti-connectivity/*" diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service new file mode 100644 index 000000000..214e60707 --- /dev/null +++ b/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-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend new file mode 100644 index 000000000..55d570fc7 --- /dev/null +++ b/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-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch b/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 000000000..d3a3229b4 --- /dev/null +++ b/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,114 @@ +From 71c2e7bc6ecf872dd3b45480859dce0f2e941b03 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> +Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com> +--- + arch/arm64/boot/dts/renesas/r8a77951.dtsi | 10 +++++----- + arch/arm64/boot/dts/renesas/r8a77960.dtsi | 10 +++++----- + arch/arm64/boot/dts/renesas/r8a77961.dtsi | 10 +++++----- + 3 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r8a77951.dtsi b/arch/arm64/boot/dts/renesas/r8a77951.dtsi +index 12e78097533e..9ead58e8a7c2 100644 +--- a/arch/arm64/boot/dts/renesas/r8a77951.dtsi ++++ b/arch/arm64/boot/dts/renesas/r8a77951.dtsi +@@ -3943,11 +3943,6 @@ ports { + #address-cells = <1>; + #size-cells = <0>; + +- port@0 { +- reg = <0>; +- du_out_rgb: endpoint { +- }; +- }; + port@1 { + reg = <1>; + du_out_hdmi0: endpoint { +@@ -3966,6 +3961,11 @@ du_out_lvds0: endpoint { + remote-endpoint = <&lvds0_in>; + }; + }; ++ port@0 { ++ reg = <0>; ++ du_out_rgb: endpoint { ++ }; ++ }; + }; + }; + +diff --git a/arch/arm64/boot/dts/renesas/r8a77960.dtsi b/arch/arm64/boot/dts/renesas/r8a77960.dtsi +index 66ab48b3a704..a5481dc4a3f1 100644 +--- a/arch/arm64/boot/dts/renesas/r8a77960.dtsi ++++ b/arch/arm64/boot/dts/renesas/r8a77960.dtsi +@@ -3628,11 +3628,6 @@ ports { + #address-cells = <1>; + #size-cells = <0>; + +- port@0 { +- reg = <0>; +- du_out_rgb: endpoint { +- }; +- }; + port@1 { + reg = <1>; + du_out_hdmi0: endpoint { +@@ -3645,6 +3640,11 @@ du_out_lvds0: endpoint { + remote-endpoint = <&lvds0_in>; + }; + }; ++ port@0 { ++ reg = <0>; ++ du_out_rgb: endpoint { ++ }; ++ }; + }; + }; + +diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi +index ef2cb77f3c32..032ef1ca0633 100644 +--- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi ++++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi +@@ -3434,11 +3434,6 @@ ports { + #address-cells = <1>; + #size-cells = <0>; + +- port@0 { +- reg = <0>; +- du_out_rgb: endpoint { +- }; +- }; + port@1 { + reg = <1>; + du_out_hdmi0: endpoint { +@@ -3451,6 +3446,11 @@ du_out_lvds0: endpoint { + remote-endpoint = <&lvds0_in>; + }; + }; ++ port@0 { ++ reg = <0>; ++ du_out_rgb: endpoint { ++ }; ++ }; + }; + }; + +-- +2.25.1 + diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend new file mode 100644 index 000000000..20682e4f0 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend @@ -0,0 +1,29 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:ulcb = " \ + file://0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.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 \ +" + +# The meta-rcar layer actives by default the configuration MTD_RENESAS_RPC_HYPERFLASH +# in the kernel. We need to set DISABLE_RPC_ACCESS to deactivate it. +DISABLE_RPC_ACCESS ?= "1" diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher new file mode 100644 index 000000000..7e991dc0f --- /dev/null +++ b/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-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend new file mode 100644 index 000000000..51604706c --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend @@ -0,0 +1,23 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI = "file://gpsd.kingfisher" + +inherit update-alternatives + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + install -d ${D}/${sysconfdir}/default + install -m 0644 ${WORKDIR}/gpsd.kingfisher ${D}/${sysconfdir}/default/gpsd.kingfisher +} + +COMPATIBLE_MACHINE = "ulcb" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +CONFFILES:${PN} = "${sysconfdir}/default/gpsd.kingfisher" + +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" diff --git a/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc new file mode 100644 index 000000000..3e2bf8f1c --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc @@ -0,0 +1,25 @@ +require checksum_control_files.inc + +python do_checksum_control() { + to_check_dico = d.getVarFlags("CTL_CHECKSUM") + if to_check_dico is None: + return 0 + + src_uri = (d.getVar('SRC_URI') or "").split() + for s in src_uri: + c_source=os.path.basename(s) + bb.note("Check source: %s " % (c_source)) + if c_source in to_check_dico: + f_data = bb.fetch2.FetchData(s, d, True) + f_data.setup_localpath(d) + if os.path.exists(f_data.localpath): + mdr5_sum=bb.utils.md5_file(f_data.localpath) + mdr5_ctl=to_check_dico[c_source] + if mdr5_sum != mdr5_ctl: + bb.fatal( "File %s hash should be %s but %s find, please update your driver files." % (c_source, mdr5_ctl, mdr5_sum)) +} + +do_checksum_control[doc] = "Do a checksum of the archives source files" +do_checksum_control[vardeps] = "CTL_CHECKSUM" + +addtask do_checksum_control before do_unpack after do_fetch diff --git a/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc new file mode 100644 index 000000000..6c9f49c3b --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc @@ -0,0 +1,16 @@ +CTL_CHECKSUM[r8a77951_linux_gsx_binaries_gles.tar.bz2]="06cc04c52f56048dbc00ead14447cb35" +CTL_CHECKSUM[r8a77960_linux_gsx_binaries_gles.tar.bz2]="a24be039f1c294035416dbd77fa10f4a" +CTL_CHECKSUM[GSX_KM_H3.tar.bz2]="563ff3f5d5dc8b40d19d0b6e7484bf22" +CTL_CHECKSUM[GSX_KM_M3.tar.bz2]="7cbbffb874b30e36cc2c7751573e468b" +CTL_CHECKSUM[RTM8RC0000ZMX0DQ00JFL3E.tar.bz2]="2ee662978a45fc7c7cf2cef0e4bf1e33" +CTL_CHECKSUM[RTM8RC0000ZAD1LQ00JPL3E.tar.gz]="f59cb979a030a3545a6c0b2337e8ea0e" +CTL_CHECKSUM[RTM8RC0000ZAE1LQ00JPL3E.tar.gz]="7bdfac397034e8e13425cd83e3bd5090" +CTL_CHECKSUM[RTM8RC0000ZMD0LQ00JPL3E.tar.bz2]="8d774178a3fe5ddac0cc5bd16bc58e3e" +CTL_CHECKSUM[RTM8RC0000ZMD1LQ00JPL3E.tar.bz2]="3f30a263a038d148b2af445bc09dc4b7" +CTL_CHECKSUM[RTM8RC0000ZME0LQ00JPL3E.tar.bz2]="8f83d1c3947904e48316faa058c196c7" +CTL_CHECKSUM[RTM8RC0000ZME1LQ00JPL3E.tar.bz2]="89d4ce58062ef956fa2b8ef1bd8a66f3" +CTL_CHECKSUM[RTM8RC0000ZMX0LQ00JPL3E.tar.bz2]="035361ad4715bbb491ee23d80bc50e3a" +CTL_CHECKSUM[RTM8RC0000ZND1LQ00JPL3E.tar.gz]="b56fa5404bdee152b557869390783eb4" +CTL_CHECKSUM[RTM8RC0000ZNE1LQ00JPL3E.tar.gz]="63880c583eb132b868a074db3d39c8ee" +CTL_CHECKSUM[RTM8RC0000ZNX0LQ00JPL3E.tar.gz]="53ff1eb5de6c5345bd24e8e3605eb82d" + diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/README.md b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/README.md deleted file mode 100644 index 49ab7cc9d..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# back port from poky -## gstreamer - src: poky/meta/recipes-multimedia/gstreamer/ ae9b341ecfcc60e970f29cfe04306411ad26c0cf - -# port from meta-linaro -## python-wand - src: meta-linaro/meta-optee/recipes-devtools/python/python-wand_0.4.3.bb b6d0b81584c3395708b27ffe7b8fe248ef674839 diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch deleted file mode 100644 index 2cab87f9e..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 90916f96262fa7b27a0a99788c69f9fd6df11000 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 24 Nov 2015 16:46:27 +0200 -Subject: [PATCH] introspection.m4: prefix pkgconfig paths with - PKG_CONFIG_SYSROOT_DIR - -We can't use our tweaked introspection.m4 from gobject-introspection tarball -because gstreamer also defines INTROSPECTION_INIT in its introspection.m4, which -is later supplied to g-ir-scanner. - -Upstream-Status: Pending [review on oe-core list] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - common/m4/introspection.m4 | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/common/m4/introspection.m4 b/common/m4/introspection.m4 -index 162be57..217a6ae 100644 ---- a/common/m4/introspection.m4 -+++ b/common/m4/introspection.m4 -@@ -54,14 +54,14 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], - INTROSPECTION_GIRDIR= - INTROSPECTION_TYPELIBDIR= - if test "x$found_introspection" = "xyes"; then -- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` -- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` -- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` -+ INTROSPECTION_SCANNER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` -+ INTROSPECTION_COMPILER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` -+ INTROSPECTION_GENERATE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` - INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` - INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" - INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` - INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` -- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection -+ INTROSPECTION_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection - INTROSPECTION_INIT="extern void gst_init(gint*,gchar**); gst_init(NULL,NULL);" - fi - AC_SUBST(INTROSPECTION_SCANNER) --- -2.6.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Add-error-signal-emission-for-missing-plugins.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Add-error-signal-emission-for-missing-plugins.patch deleted file mode 100644 index 712d46daa..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Add-error-signal-emission-for-missing-plugins.patch +++ /dev/null @@ -1,252 +0,0 @@ -From d64c7edb66f4a64ff49c4306cf77fd269b7079ab Mon Sep 17 00:00:00 2001 -From: Jussi Kukkonen <jussi.kukkonen@intel.com> -Date: Mon, 16 Mar 2015 13:45:30 +0200 -Subject: [PATCH] Add error signal emission for missing plugins - -Add a missing plugins error signal to gst-player. Note that this error -does not necessarily mean the playback has completely failed, but in -practice the user experience will be bad (think, e.g. of a mp4 file -where H.264 codec is missing: AAC playback still works...). - -Use the signal in gtk-play to show a infobar if plugins are missing. - -Submitted upstream at https://github.com/sdroege/gst-player/pull/11 - -Upstream-Status: Submitted -Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> ---- - configure.ac | 2 +- - gtk/gtk-play.c | 54 +++++++++++++++++++++++++++++++++++++++++++++- - lib/gst/player/gstplayer.c | 22 +++++++++++++++++++ - lib/gst/player/gstplayer.h | 3 ++- - 4 files changed, 78 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 90ab74c..6cdb4eb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -53,7 +53,7 @@ AC_SUBST(LT_AGE) - PKG_PROG_PKG_CONFIG - - PKG_CHECK_MODULES(GLIB, [glib-2.0 gobject-2.0]) --PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4]) -+PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4 gstreamer-pbutils-1.0]) - - GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" - AC_SUBST(GLIB_PREFIX) -diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c -index b92773b..e2b605a 100644 ---- a/gtk/gtk-play.c -+++ b/gtk/gtk-play.c -@@ -30,6 +30,8 @@ typedef struct - GtkWidget *prev_button, *next_button; - GtkWidget *seekbar; - GtkWidget *video_area; -+ GtkWidget *info_label; -+ GtkWidget *info_bar; - GtkWidget *volume_button; - gulong seekbar_value_changed_signal_id; - gboolean playing; -@@ -141,6 +143,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play) - } - - static void -+clear_missing_plugins (GtkPlay * play) -+{ -+ gtk_label_set_text (GTK_LABEL (play->info_label), ""); -+ gtk_widget_hide (play->info_bar); -+} -+ -+static void - skip_prev_clicked_cb (GtkButton * button, GtkPlay * play) - { - GList *prev; -@@ -155,6 +164,7 @@ skip_prev_clicked_cb (GtkButton * button, GtkPlay * play) - - gtk_widget_set_sensitive (play->next_button, TRUE); - gst_player_set_uri (play->player, prev->data); -+ clear_missing_plugins (play); - gst_player_play (play->player); - set_title (play, prev->data); - gtk_widget_set_sensitive (play->prev_button, g_list_previous (prev) != NULL); -@@ -175,6 +185,7 @@ skip_next_clicked_cb (GtkButton * button, GtkPlay * play) - - gtk_widget_set_sensitive (play->prev_button, TRUE); - gst_player_set_uri (play->player, next->data); -+ clear_missing_plugins (play); - gst_player_play (play->player); - set_title (play, next->data); - gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL); -@@ -193,10 +204,16 @@ volume_changed_cb (GtkScaleButton * button, gdouble value, GtkPlay * play) - gst_player_set_volume (play->player, value); - } - -+void -+info_bar_response_cb (GtkInfoBar * bar, gint response, GtkPlay * play) -+{ -+ gtk_widget_hide (GTK_WIDGET (bar)); -+} -+ - static void - create_ui (GtkPlay * play) - { -- GtkWidget *controls, *main_hbox, *main_vbox; -+ GtkWidget *controls, *main_hbox, *main_vbox, *info_bar, *content_area; - - play->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect (G_OBJECT (play->window), "delete-event", -@@ -208,6 +225,20 @@ create_ui (GtkPlay * play) - g_signal_connect (play->video_area, "realize", - G_CALLBACK (video_area_realize_cb), play); - -+ play->info_bar = gtk_info_bar_new (); -+ gtk_info_bar_set_message_type (GTK_INFO_BAR (play->info_bar), -+ GTK_MESSAGE_WARNING); -+ //gtk_info_bar_set_show_close_button (GTK_INFO_BAR (play->info_bar), -+ // TRUE); -+ gtk_widget_set_no_show_all (play->info_bar, TRUE); -+ g_signal_connect (play->info_bar, "response", -+ G_CALLBACK (info_bar_response_cb), play); -+ -+ content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (play->info_bar)); -+ play->info_label = gtk_label_new (""); -+ gtk_container_add (GTK_CONTAINER (content_area), play->info_label); -+ gtk_widget_show (play->info_label); -+ - /* Unified play/pause button */ - play->play_pause_button = - gtk_button_new_from_icon_name ("media-playback-pause", -@@ -258,6 +289,7 @@ create_ui (GtkPlay * play) - - main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_box_pack_start (GTK_BOX (main_vbox), main_hbox, TRUE, TRUE, 0); -+ gtk_box_pack_start (GTK_BOX (main_vbox), play->info_bar, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (main_vbox), controls, FALSE, FALSE, 0); - gtk_container_add (GTK_CONTAINER (play->window), main_vbox); - -@@ -322,6 +354,7 @@ eos_cb (GstPlayer * unused, GtkPlay * play) - gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL); - - gst_player_set_uri (play->player, next->data); -+ clear_missing_plugins (play); - gst_player_play (play->player); - set_title (play, next->data); - } else { -@@ -330,6 +363,24 @@ eos_cb (GstPlayer * unused, GtkPlay * play) - } - } - -+static void -+error_cb (GstPlayer * player, GError * err, GtkPlay * play) -+{ -+ char *message; -+ -+ if (g_error_matches (err, gst_player_error_quark (), -+ GST_PLAYER_ERROR_MISSING_PLUGIN)) { -+ // add message to end of any existing message: there may be -+ // multiple missing plugins. -+ message = g_strdup_printf ("%s%s. ", -+ gtk_label_get_text (GTK_LABEL (play->info_label)), err->message); -+ gtk_label_set_text (GTK_LABEL (play->info_label), message); -+ g_free (message); -+ -+ gtk_widget_show (play->info_bar); -+ } -+} -+ - int - main (gint argc, gchar ** argv) - { -@@ -422,6 +473,7 @@ main (gint argc, gchar ** argv) - g_signal_connect (play.player, "video-dimensions-changed", - G_CALLBACK (video_dimensions_changed_cb), &play); - g_signal_connect (play.player, "end-of-stream", G_CALLBACK (eos_cb), &play); -+ g_signal_connect (play.player, "error", G_CALLBACK (error_cb), &play); - - /* We have file(s) that need playing. */ - set_title (&play, g_list_first (play.uris)->data); -diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c -index bd682d9..78e7ba1 100644 ---- a/lib/gst/player/gstplayer.c -+++ b/lib/gst/player/gstplayer.c -@@ -47,6 +47,7 @@ - - #include <gst/gst.h> - #include <gst/video/video.h> -+#include <gst/pbutils/missing-plugins.h> - - GST_DEBUG_CATEGORY_STATIC (gst_player_debug); - #define GST_CAT_DEFAULT gst_player_debug -@@ -238,6 +239,7 @@ gst_player_class_init (GstPlayerClass * klass) - g_signal_new ("video-dimensions-changed", G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, - NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); -+ - } - - static void -@@ -619,6 +621,21 @@ error_cb (GstBus * bus, GstMessage * msg, gpointer user_data) - g_mutex_unlock (&self->priv->lock); - } - -+static void -+element_cb (GstBus * bus, GstMessage * msg, gpointer user_data) -+{ -+ GstPlayer *self = GST_PLAYER (user_data); -+ -+ if (gst_is_missing_plugin_message (msg)) { -+ gchar *desc; -+ -+ desc = gst_missing_plugin_message_get_description (msg); -+ emit_error (self, g_error_new (GST_PLAYER_ERROR, -+ GST_PLAYER_ERROR_MISSING_PLUGIN, "Missing plugin '%s'", desc)); -+ g_free (desc); -+ } -+} -+ - static gboolean - eos_dispatch (gpointer user_data) - { -@@ -1059,6 +1076,8 @@ gst_player_main (gpointer data) - NULL, NULL); - g_source_attach (bus_source, self->priv->context); - -+ g_signal_connect (G_OBJECT (bus), "message::element", -+ G_CALLBACK (element_cb), self); - g_signal_connect (G_OBJECT (bus), "message::error", G_CALLBACK (error_cb), - self); - g_signal_connect (G_OBJECT (bus), "message::eos", G_CALLBACK (eos_cb), self); -@@ -1560,6 +1579,7 @@ gst_player_error_get_type (void) - static gsize id = 0; - static const GEnumValue values[] = { - {C_ENUM (GST_PLAYER_ERROR_FAILED), "GST_PLAYER_ERROR_FAILED", "failed"}, -+ {C_ENUM (GST_PLAYER_ERROR_MISSING_PLUGIN), "GST_PLAYER_ERROR_MISSING_PLUGIN", "missing-plugin"}, - {0, NULL, NULL} - }; - -@@ -1577,6 +1597,8 @@ gst_player_error_get_name (GstPlayerError error) - switch (error) { - case GST_PLAYER_ERROR_FAILED: - return "failed"; -+ case GST_PLAYER_ERROR_MISSING_PLUGIN: -+ return "missing-plugin"; - } - - g_assert_not_reached (); -diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h -index c438513..35fb5bb 100644 ---- a/lib/gst/player/gstplayer.h -+++ b/lib/gst/player/gstplayer.h -@@ -44,7 +44,8 @@ GType gst_player_error_get_type (void); - #define GST_TYPE_PLAYER_ERROR (gst_player_error_get_type ()) - - typedef enum { -- GST_PLAYER_ERROR_FAILED = 0 -+ GST_PLAYER_ERROR_FAILED = 0, -+ GST_PLAYER_ERROR_MISSING_PLUGIN - } GstPlayerError; - - const gchar *gst_player_error_get_name (GstPlayerError error); --- -2.1.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Fix-pause-play.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Fix-pause-play.patch deleted file mode 100644 index 783c42ad7..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Fix-pause-play.patch +++ /dev/null @@ -1,107 +0,0 @@ -Fix pause/play - -The current player state is now notified via the state-changed signal, -and in the GTK UI it was only used to keep track of the desired state. - -This is a backport of upstream commit 738479c7a0. - -Upstream-Status: Backport -Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> - ---- - gtk/gtk-play.c | 8 ++++++-- - lib/gst/player/gstplayer.c | 12 ------------ - lib/gst/player/gstplayer.h | 2 -- - 3 files changed, 6 insertions(+), 16 deletions(-) - -diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c -index 6e7a098..e2b605a 100644 ---- a/gtk/gtk-play.c -+++ b/gtk/gtk-play.c -@@ -34,6 +34,7 @@ typedef struct - GtkWidget *info_bar; - GtkWidget *volume_button; - gulong seekbar_value_changed_signal_id; -+ gboolean playing; - } GtkPlay; - - /* Compat stubs */ -@@ -118,12 +119,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play) - { - GtkWidget *image; - -- if (gst_player_is_playing (play->player)) { -+ if (play->playing) { - gst_player_pause (play->player); - image = - gtk_image_new_from_icon_name ("media-playback-start", - GTK_ICON_SIZE_BUTTON); - gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image); -+ play->playing = FALSE; - } else { - gchar *title; - -@@ -136,6 +138,7 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play) - title = gst_player_get_uri (play->player); - set_title (play, title); - g_free (title); -+ play->playing = TRUE; - } - } - -@@ -335,7 +338,7 @@ video_dimensions_changed_cb (GstPlayer * unused, gint width, gint height, - static void - eos_cb (GstPlayer * unused, GtkPlay * play) - { -- if (gst_player_is_playing (play->player)) { -+ if (play->playing) { - GList *next = NULL; - gchar *uri; - -@@ -452,6 +455,7 @@ main (gint argc, gchar ** argv) - } - - play.player = gst_player_new (); -+ play.playing = TRUE; - - g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL); - -diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c -index 069b284..78e7ba1 100644 ---- a/lib/gst/player/gstplayer.c -+++ b/lib/gst/player/gstplayer.c -@@ -1422,18 +1422,6 @@ gst_player_set_uri (GstPlayer * self, const gchar * val) - g_object_set (self, "uri", val, NULL); - } - --gboolean --gst_player_is_playing (GstPlayer * self) --{ -- gboolean val; -- -- g_return_val_if_fail (GST_IS_PLAYER (self), FALSE); -- -- g_object_get (self, "is-playing", &val, NULL); -- -- return val; --} -- - GstClockTime - gst_player_get_position (GstPlayer * self) - { -diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h -index 6933dd7..35fb5bb 100644 ---- a/lib/gst/player/gstplayer.h -+++ b/lib/gst/player/gstplayer.h -@@ -93,8 +93,6 @@ gchar * gst_player_get_uri (GstPlayer * player); - void gst_player_set_uri (GstPlayer * player, - const gchar * uri); - --gboolean gst_player_is_playing (GstPlayer * player); -- - GstClockTime gst_player_get_position (GstPlayer * player); - GstClockTime gst_player_get_duration (GstPlayer * player); - --- -2.1.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/filechooser.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/filechooser.patch deleted file mode 100644 index 7bf1b034b..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/filechooser.patch +++ /dev/null @@ -1,54 +0,0 @@ -Upstream-Status: Submitted -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From 43d4b19ab611d844156e26c4840cc54ddb73ae03 Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Thu, 26 Feb 2015 17:17:05 +0000 -Subject: [PATCH] gtk-play: show a file chooser if no URIs were passed - ---- - gtk/gtk-play.c | 28 ++++++++++++++++++++++++++-- - 1 file changed, 26 insertions(+), 2 deletions(-) - -diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c -index f015077..9766a72 100644 ---- a/gtk/gtk-play.c -+++ b/gtk/gtk-play.c -@@ -319,8 +319,32 @@ main (gint argc, gchar ** argv) - // FIXME: Add support for playlists and stuff - /* Parse the list of the file names we have to play. */ - if (!file_names) { -- g_print ("Usage: %s FILE(s)|URI(s)\n", APP_NAME); -- return 1; -+ GtkWidget *chooser; -+ int res; -+ -+ chooser = gtk_file_chooser_dialog_new ("Select files to play", NULL, -+ GTK_FILE_CHOOSER_ACTION_OPEN, -+ "_Cancel", GTK_RESPONSE_CANCEL, -+ "_Open", GTK_RESPONSE_ACCEPT, -+ NULL); -+ g_object_set (chooser, -+ "local-only", FALSE, -+ "select-multiple", TRUE, -+ NULL); -+ -+ res = gtk_dialog_run (GTK_DIALOG (chooser)); -+ if (res == GTK_RESPONSE_ACCEPT) { -+ GSList *l; -+ -+ l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser)); -+ while (l) { -+ play.uris = g_list_append (play.uris, l->data); -+ l = g_slist_delete_link (l, l); -+ } -+ } else { -+ return 0; -+ } -+ gtk_widget_destroy (chooser); - } else { - guint i; - --- -1.7.10.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gst-player.desktop b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gst-player.desktop deleted file mode 100644 index 9fd207b38..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gst-player.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=Media Player -Comment=Basic media player -Icon=audio-player -TryExec=gtk-play -Exec=gtk-play -StartupNotify=true -Terminal=false -Type=Application -Categories=GTK;AudioVideo; diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gtk2.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gtk2.patch deleted file mode 100644 index 2cd18bbc9..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gtk2.patch +++ /dev/null @@ -1,71 +0,0 @@ -As the rest of Sato is GTK+ 2, patch gtk-play to use GTK+ 2. When the rest of -Sato has been ported to GTK+ 3 this patch can be dropped. - -Upstream-Status: Inappropriate -Signed-off-by: Ross Burton <ross.burton@intel.com> - - -diff --git a/configure.ac b/configure.ac -index b8af13b..90ab74c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -60,7 +60,7 @@ AC_SUBST(GLIB_PREFIX) - GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-1.0`" - AC_SUBST(GST_PREFIX) - --PKG_CHECK_MODULES(GTK, [gtk+-3.0], [have_gtk="yes"], [have_gtk="no"]) -+PKG_CHECK_MODULES(GTK, [gtk+-2.0], [have_gtk="yes"], [have_gtk="no"]) - AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" != "xno") - - GOBJECT_INTROSPECTION_CHECK([1.31.1]) -diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c -index f015077..954d6fb 100644 ---- a/gtk/gtk-play.c -+++ b/gtk/gtk-play.c -@@ -34,6 +34,46 @@ typedef struct - gulong seekbar_value_changed_signal_id; - } GtkPlay; - -+/* Compat stubs */ -+GtkWidget * -+gtk_box_new (GtkOrientation orientation, -+ gint spacing) -+{ -+ switch (orientation) { -+ case GTK_ORIENTATION_HORIZONTAL: -+ return gtk_hbox_new (FALSE, spacing); -+ case GTK_ORIENTATION_VERTICAL: -+ return gtk_vbox_new (FALSE, spacing); -+ } -+} -+ -+GtkWidget* -+gtk_button_new_from_icon_name (const gchar *icon_name, -+ GtkIconSize size) -+{ -+ GtkWidget *button; -+ GtkWidget *image; -+ -+ image = gtk_image_new_from_icon_name (icon_name, size); -+ button = g_object_new (GTK_TYPE_BUTTON, -+ "image", image, -+ NULL); -+ return button; -+} -+ -+GtkWidget * -+gtk_scale_new_with_range (GtkOrientation orientation, -+ gdouble min, -+ gdouble max, -+ gdouble step) -+{ -+ switch (orientation) { -+ case GTK_ORIENTATION_HORIZONTAL: -+ return gtk_hscale_new_with_range (min, max, step); -+ case GTK_ORIENTATION_VERTICAL: -+ return gtk_vscale_new_with_range (min, max, step); -+ } -+} - - static void - set_title (GtkPlay * play, const gchar * title) diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player_git.bb deleted file mode 100644 index 8129169c5..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player_git.bb +++ /dev/null @@ -1,39 +0,0 @@ -SUMMARY = "GStreamer playback helper library and examples" -LICENSE = "LGPL-2.0+" -LIC_FILES_CHKSUM = "file://lib/gst/player/gstplayer.c;beginline=1;endline=19;md5=03aeca9d8295f811817909075a15ff65" - -DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gtk+" - -SRC_URI = "git://github.com/sdroege/gst-player.git \ - file://filechooser.patch \ - file://gtk2.patch \ - file://Fix-pause-play.patch \ - file://Add-error-signal-emission-for-missing-plugins.patch \ - file://gst-player.desktop" - -SRCREV = "5386c5b984d40ef5434673ed62204e69aaf52645" - -S = "${WORKDIR}/git" - -inherit autotools gtk-doc lib_package pkgconfig distro_features_check gobject-introspection - -ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}" - -do_configure_prepend() { - touch ${S}/ChangeLog -} - -EXTRA_OECONF += "ac_cv_path_VALGRIND=no ac_cv_path_GDB=no" - -do_install_append() { - install -m 0644 -D ${WORKDIR}/gst-player.desktop ${D}${datadir}/applications/gst-player.desktop -} - -FILES_${PN}-bin += "${datadir}/applications/*.desktop" - -RDEPENDS_${PN}-bin = "gstreamer1.0-plugins-base-playback" -RRECOMMENDS_${PN}-bin = "gstreamer1.0-plugins-base-meta \ - gstreamer1.0-plugins-good-meta \ - gstreamer1.0-plugins-bad-meta \ - ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-libav", "", d)} \ - ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-plugins-ugly-meta", "", d)}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-plugins-package.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-plugins-package.inc deleted file mode 100644 index c24493e1e..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-plugins-package.inc +++ /dev/null @@ -1,56 +0,0 @@ -PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages " -PACKAGESPLITFUNCS_append = " set_metapkg_rdepends " - -python split_gstreamer10_packages () { - gst_libdir = d.expand('${libdir}/gstreamer-${LIBV}') - postinst = d.getVar('plugin_postinst', True) - glibdir = d.getVar('libdir', True) - - do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True) - do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='') - do_split_packages(d, glibdir+'/girepository-1.0', 'Gst(.*)-1.0\.typelib$', d.expand('${PN}-%s-typelib'), 'GStreamer typelib file for %s', postinst=postinst, extra_depends='') - do_split_packages(d, gst_libdir, 'libgst(.*)\.la$', d.expand('${PN}-%s-dev'), 'GStreamer plugin for %s (development files)', extra_depends='${PN}-dev') - do_split_packages(d, gst_libdir, 'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer plugin for %s (static development files)', extra_depends='${PN}-staticdev') -} - -python set_metapkg_rdepends () { - import os - - pn = d.getVar('PN', True) - metapkg = pn + '-meta' - d.setVar('ALLOW_EMPTY_' + metapkg, "1") - d.setVar('FILES_' + metapkg, "") - blacklist = [ pn, pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc', pn + '-meta' ] - metapkg_rdepends = [] - packages = d.getVar('PACKAGES', True).split() - pkgdest = d.getVar('PKGDEST', True) - for pkg in packages[1:]: - if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.count('locale') and not pkg.count('-staticdev'): - # See if the package is empty by looking at the contents of its PKGDEST subdirectory. - # If this subdirectory is empty, then the package is. - # Empty packages do not get added to the meta package's RDEPENDS - pkgdir = os.path.join(pkgdest, pkg) - if os.path.exists(pkgdir): - dir_contents = os.listdir(pkgdir) or [] - else: - dir_contents = [] - is_empty = len(dir_contents) == 0 - if not is_empty: - metapkg_rdepends.append(pkg) - d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends)) - d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package') -} - -# each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev -# so we need them even when empty (like in gst-plugins-good case) -ALLOW_EMPTY_${PN} = "1" -ALLOW_EMPTY_${PN}-dev = "1" -ALLOW_EMPTY_${PN}-staticdev = "1" - -PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib" - -FILES_${PN} = "" -FILES_${PN}-apps = "${bindir}" -FILES_${PN}-glib = "${datadir}/glib-2.0" - -RRECOMMENDS_${PN} += "${PN}-meta" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav.inc deleted file mode 100644 index 363101e1a..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav.inc +++ /dev/null @@ -1,46 +0,0 @@ -SUMMARY = "Libav-based GStreamer 1.x plugin" -HOMEPAGE = "http://gstreamer.freedesktop.org/" -SECTION = "multimedia" - -LICENSE = "GPLv2+ & LGPLv2+ & ( (GPLv2+ & LGPLv2.1+) | (GPLv3+ & LGPLv3+) )" -LICENSE_FLAGS = "commercial" - -DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base zlib bzip2 xz" - -inherit autotools pkgconfig upstream-version-is-even - -# CAUTION: Using the system libav is not recommended. Since the libav API is changing all the time, -# compilation errors (and other, more subtle bugs) can happen. It is usually better to rely on the -# libav copy included in the gst-libav package. -PACKAGECONFIG ??= "orc yasm" - -PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl," -PACKAGECONFIG[libav] = "--with-system-libav,,libav" -PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc" -PACKAGECONFIG[yasm] = "--enable-yasm,--disable-yasm,yasm-native" - -GSTREAMER_1_0_DEBUG ?= "--disable-debug" - -LIBAV_EXTRA_CONFIGURE = "--with-libav-extra-configure" - -LIBAV_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux \ - --cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \ - --ranlib='${RANLIB}' \ - ${GSTREAMER_1_0_DEBUG} \ - --cross-prefix='${HOST_PREFIX}'" - -LIBAV_EXTRA_CONFIGURE_COMMON = \ -'${LIBAV_EXTRA_CONFIGURE}="${LIBAV_EXTRA_CONFIGURE_COMMON_ARG}"' - -EXTRA_OECONF = "${LIBAV_EXTRA_CONFIGURE_COMMON}" - -FILES_${PN} += "${libdir}/gstreamer-1.0/*.so" -FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la" -FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a" - -# http://errors.yoctoproject.org/Errors/Details/20493/ -ARM_INSTRUCTION_SET_armv4 = "arm" -ARM_INSTRUCTION_SET_armv5 = "arm" - -# ffmpeg/libav disables PIC on some platforms (e.g. x86-32) -INSANE_SKIP_${PN} = "textrel" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch deleted file mode 100644 index 1d99ad125..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 54bba228ea52d01fd84941d97be23c03f9862b64 Mon Sep 17 00:00:00 2001 -From: Carlos Rafael Giani <dv@pseudoterminal.org> -Date: Sat, 6 Apr 2013 01:22:22 +0200 -Subject: [PATCH] Disable yasm for libav when --disable-yasm - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Shane Wang <shane.wang@intel.com> -Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org> ---- - configure.ac | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 22ede88..ef3c050 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -305,6 +305,12 @@ else - emblibav_configure_args="$emblibav_configure_args --enable-gpl" - fi - -+ AC_ARG_ENABLE(yasm, -+ [AC_HELP_STRING([--disable-yasm], [disable use of yasm assembler])]) -+ if test "x$enable_yasm" = "xno"; then -+ emblibav_configure_args="$emblibav_configure_args --disable-yasm" -+ fi -+ - # if we are cross-compiling, tell libav so - case $host in - *android*) --- -1.8.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch deleted file mode 100644 index 36abf8607..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch +++ /dev/null @@ -1,26 +0,0 @@ -Description: Workaround to build libav for i586 with gcc 4.9.2 by avoiding memset -Author: Bernhard Übelacker <bernhardu@vr-web.de> - ---- -Bug-Debian: https://bugs.debian.org/783082 -Last-Update: 2015-04-28 - -Upstream-Status: Backport [debian] - -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> - ---- gst-libav-1.4.5.orig/gst-libs/ext/libav/libavcodec/h264_cabac.c -+++ gst-libav-1.4.5/gst-libs/ext/libav/libavcodec/h264_cabac.c -@@ -2020,7 +2020,11 @@ decode_intra_mb: - // In deblocking, the quantizer is 0 - h->cur_pic.qscale_table[mb_xy] = 0; - // All coeffs are present -- memset(h->non_zero_count[mb_xy], 16, 48); -+ /*memset(h->non_zero_count[mb_xy], 16, 48);*/ -+ /* avoiding this memset because it leads at least with gcc4.9.2 to error: 'asm' operand has impossible constraints */ -+ for (size_t i = 0; i < 48; i++) { -+ ( (unsigned char*)(h->non_zero_count[mb_xy]) ) [i] = 16; -+ } - h->cur_pic.mb_type[mb_xy] = mb_type; - sl->last_qscale_diff = 0; - return 0; diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_1.6.3.bb deleted file mode 100644 index 687230a8f..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_1.6.3.bb +++ /dev/null @@ -1,20 +0,0 @@ -include gstreamer1.0-libav.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \ - file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \ - file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ - file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \ - file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02" - -SRC_URI = " \ - http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \ - file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \ - file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \ -" - -SRC_URI[md5sum] = "cfe9a06913d4fd4067e9e47f6e05fac2" -SRC_URI[sha256sum] = "857b9c060a0337de38c6d26238c47352433c02eabf26c2f860c854dbc35bd4ab" - -S = "${WORKDIR}/gst-libav-${PV}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_git.bb deleted file mode 100644 index ebc8a5ef2..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_git.bb +++ /dev/null @@ -1,38 +0,0 @@ -DEFAULT_PREFERENCE = "-1" - -include gstreamer1.0-libav.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \ - file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \ - file://gst-libs/ext/libav/LICENSE.md;md5=acda96fe91ccaabc9cd9d541806a0d37 \ - file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ - file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \ - file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02" - -# To build using the system libav/ffmpeg, append "libav" to PACKAGECONFIG -# and remove the ffmpeg sources from SRC_URI below. However, first note the -# warnings in gstreamer1.0-libav.inc -SRC_URI = " \ - git://anongit.freedesktop.org/gstreamer/gst-libav;name=base \ - git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \ - git://source.ffmpeg.org/ffmpeg;destsuffix=git/gst-libs/ext/libav;name=ffmpeg;branch=release/3.0 \ - file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \ - file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \ -" - -PV = "1.7.2+git${SRCPV}" - -UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))" - -SRCREV_base = "6c4878b6abc916b7f6f25b8926c4859119acf1ec" -SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0" -SRCREV_ffmpeg = "c40983a6f631d22fede713d535bb9c31d5c9740c" -SRCREV_FORMAT = "base" - -S = "${WORKDIR}/git" - -do_configure_prepend() { - ${S}/autogen.sh --noconfigure -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-meta-base.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-meta-base.bb deleted file mode 100644 index c542b13f0..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-meta-base.bb +++ /dev/null @@ -1,68 +0,0 @@ -SUMMARY = "Gstreamer1.0 package groups" -LICENSE = "MIT" - -# Due to use of COMBINED_FEATURES -PACKAGE_ARCH = "${MACHINE_ARCH}" - -inherit packagegroup - -COMMERCIAL_PLUGINS = "${COMMERCIAL_AUDIO_PLUGINS} ${COMMERCIAL_VIDEO_PLUGINS}" -DEPENDS_UGLY="${@'gstreamer1.0-plugins-ugly' if 'ugly' in COMMERCIAL_PLUGINS.split('-') else ''}" -DEPENDS_BAD="${@'gstreamer1.0-plugins-bad' if 'bad' in COMMERCIAL_PLUGINS.split('-') else ''}" -DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good ${DEPENDS_UGLY} ${DEPENDS_BAD}" - -PACKAGES = "\ - gstreamer1.0-meta-base \ - gstreamer1.0-meta-x11-base \ - gstreamer1.0-meta-audio \ - gstreamer1.0-meta-debug \ - gstreamer1.0-meta-video" - -ALLOW_EMPTY_gstreamer1.0-meta-base = "1" -ALLOW_EMPTY_gstreamer1.0-meta-x11-base = "1" -ALLOW_EMPTY_gstreamer1.0-meta-audio = "1" -ALLOW_EMPTY_gstreamer1.0-meta-debug = "1" -ALLOW_EMPTY_gstreamer1.0-meta-video = "1" - -RDEPENDS_gstreamer1.0-meta-base = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gstreamer1.0-meta-x11-base', '', d)} \ - gstreamer1.0 \ - gstreamer1.0-plugins-base-playback \ - gstreamer1.0-plugins-base-gio \ - ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'gstreamer1.0-plugins-base-alsa', '',d)} \ - gstreamer1.0-plugins-base-volume \ - gstreamer1.0-plugins-base-audioconvert \ - gstreamer1.0-plugins-base-audioresample \ - gstreamer1.0-plugins-base-typefindfunctions \ - gstreamer1.0-plugins-base-videoscale \ - gstreamer1.0-plugins-base-videoconvert \ - gstreamer1.0-plugins-good-autodetect \ - gstreamer1.0-plugins-good-souphttpsrc" - -RRECOMMENDS_gstreamer1.0-meta-x11-base = "\ - gstreamer1.0-plugins-base-ximagesink \ - gstreamer1.0-plugins-base-xvimagesink" - -RDEPENDS_gstreamer1.0-meta-audio = "\ - gstreamer1.0-meta-base \ - gstreamer1.0-plugins-base-vorbis \ - gstreamer1.0-plugins-base-ogg \ - gstreamer1.0-plugins-good-wavparse \ - gstreamer1.0-plugins-good-flac \ - ${COMMERCIAL_AUDIO_PLUGINS}" - -RDEPENDS_gstreamer1.0-meta-debug = "\ - gstreamer1.0-meta-base \ - gstreamer1.0-plugins-good-debug \ - gstreamer1.0-plugins-base-audiotestsrc \ - gstreamer1.0-plugins-base-videotestsrc" - -RDEPENDS_gstreamer1.0-meta-video = "\ - gstreamer1.0-meta-base \ - gstreamer1.0-plugins-good-avi \ - gstreamer1.0-plugins-good-matroska \ - gstreamer1.0-plugins-base-theora \ - ${COMMERCIAL_VIDEO_PLUGINS}" - -RRECOMMENDS_gstreamer1.0-meta-video = "\ - gstreamer1.0-meta-audio" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx.inc deleted file mode 100644 index 0fff612ee..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx.inc +++ /dev/null @@ -1,43 +0,0 @@ -SUMMARY = "OpenMAX IL plugins for GStreamer" -HOMEPAGE = "http://gstreamer.freedesktop.org/" -SECTION = "multimedia" - -LICENSE = "LGPLv2.1" -LICENSE_FLAGS = "commercial" - -DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad" - -inherit autotools pkgconfig gettext - -acpaths = "-I ${S}/common/m4 -I ${S}/m4" - -PR = "r1" - -GSTREAMER_1_0_OMX_TARGET ?= "bellagio" -GSTREAMER_1_0_OMX_CORE_NAME ?= "${libdir}/libomxil-bellagio.so.0" - -EXTRA_OECONF += "--disable-valgrind --with-omx-target=${GSTREAMER_1_0_OMX_TARGET}" - -python __anonymous () { - omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET", True) - if omx_target in ['generic', 'bellagio']: - # Bellagio headers are incomplete (they are missing the OMX_VERSION_MAJOR,# - # OMX_VERSION_MINOR, OMX_VERSION_REVISION, and OMX_VERSION_STEP macros); - # appending a directory path to gst-omx' internal OpenMAX IL headers fixes this - d.appendVar("CFLAGS", " -I${S}/omx/openmax") - elif omx_target == "rpi": - # Dedicated Raspberry Pi OpenMAX IL support makes this package machine specific - d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH", True)) -} - -set_omx_core_name() { - sed -i -e "s;^core-name=.*;core-name=${GSTREAMER_1_0_OMX_CORE_NAME};" "${D}${sysconfdir}/xdg/gstomx.conf" -} - -do_install[postfuncs] += " set_omx_core_name " - -FILES_${PN} += "${libdir}/gstreamer-1.0/*.so" -FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la" -FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a" - -RDEPENDS_${PN} = "libomxil" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch deleted file mode 100644 index a428ac9c9..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch +++ /dev/null @@ -1,30 +0,0 @@ -From f629e041e9f678fcd86ad764a15117dff63c271c Mon Sep 17 00:00:00 2001 -From: Carlos Rafael Giani <dv@pseudoterminal.org> -Date: Sat, 27 Apr 2013 02:50:25 +0200 -Subject: [PATCH] omx: fixed type error in printf call - -%zu expects size_t - -Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=699008] - -Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org> ---- - omx/gstomx.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/omx/gstomx.c b/omx/gstomx.c -index a2945ed..1eca7cc 100644 ---- a/omx/gstomx.c -+++ b/omx/gstomx.c -@@ -1630,7 +1630,7 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port, - - GST_INFO_OBJECT (comp->parent, - "Allocating %d buffers of size %zu for %s port %u", n, -- port->port_def.nBufferSize, comp->name, (guint) port->index); -+ (size_t) (port->port_def.nBufferSize), comp->name, (guint) port->index); - - if (!port->buffers) - port->buffers = g_ptr_array_sized_new (n); --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_1.2.0.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_1.2.0.bb deleted file mode 100644 index 74358a724..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_1.2.0.bb +++ /dev/null @@ -1,11 +0,0 @@ -include gstreamer1.0-omx.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \ - file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f" - -SRC_URI = "http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz" - -SRC_URI[md5sum] = "d24e8c0153c35dfefee3e26b1c2c35f8" -SRC_URI[sha256sum] = "0b4874961e6488ad9e5808114bd486ea981c540907262caab1419355fd82d745" - -S = "${WORKDIR}/gst-omx-${PV}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_git.bb deleted file mode 100644 index 970554352..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_git.bb +++ /dev/null @@ -1,25 +0,0 @@ -DEFAULT_PREFERENCE = "-1" - -include gstreamer1.0-omx.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \ - file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f" - -SRC_URI = " \ - git://anongit.freedesktop.org/gstreamer/gst-omx;branch=master;name=gst-omx \ - git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;branch=master;name=common \ - file://0001-omx-fixed-type-error-in-printf-call.patch \ -" - -SRCREV_gst-omx = "a2db76b048db278ef0aa798e106b7594264e06c0" -SRCREV_common = "5edcd857b2107cd8b78c16232dd10877513ec157" - -SRCREV_FORMAT = "gst-omx" - -S = "${WORKDIR}/git" - -do_configure_prepend() { - cd ${S} - ./autogen.sh --noconfigure - cd ${B} -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad.inc deleted file mode 100644 index 9e2b94ede..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad.inc +++ /dev/null @@ -1,148 +0,0 @@ -require gstreamer1.0-plugins.inc - -LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+" - -DEPENDS += "gstreamer1.0-plugins-base libpng jpeg" - -inherit gettext bluetooth - -SRC_URI_append = " \ - file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \ -" - -# opengl packageconfig factored out to make it easy for distros -# and BSP layers to pick either (desktop) opengl, gles2, or no GL -PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}" - -# gtk is not in the PACKAGECONFIG variable by default until -# the transition to gtk+3 is finished -PACKAGECONFIG ??= " \ - ${GSTREAMER_ORC} \ - ${PACKAGECONFIG_GL} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \ - bz2 curl dash dtls hls neon rsvg sbc smoothstreaming sndfile uvch264 webp \ -" - -PACKAGECONFIG[assrender] = "--enable-assrender,--disable-assrender,libass" -PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}" -PACKAGECONFIG[bz2] = "--enable-bz2,--disable-bz2,bzip2" -PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl" -PACKAGECONFIG[dash] = "--enable-dash,--disable-dash,libxml2" -PACKAGECONFIG[directfb] = "--enable-directfb,--disable-directfb,directfb" -PACKAGECONFIG[dtls] = "--enable-dtls,--disable-dtls,openssl" -PACKAGECONFIG[faac] = "--enable-faac,--disable-faac,faac" -PACKAGECONFIG[faad] = "--enable-faad,--disable-faad,faad2" -PACKAGECONFIG[flite] = "--enable-flite,--disable-flite,flite-alsa" -PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth" -PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2" -PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3" -PACKAGECONFIG[hls] = "--enable-hls,--disable-hls,nettle" -PACKAGECONFIG[libmms] = "--enable-libmms,--disable-libmms,libmms" -PACKAGECONFIG[libssh2] = "--enable-libssh2,--disable-libssh2,libssh2" -PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug" -PACKAGECONFIG[neon] = "--enable-neon,--disable-neon,neon" -PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft" -PACKAGECONFIG[opencv] = "--enable-opencv,--disable-opencv,opencv" -PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,virtual/libgl libglu" -PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus" -PACKAGECONFIG[resindvd] = "--enable-resindvd,--disable-resindvd,libdvdread libdvdnav" -PACKAGECONFIG[rsvg] = "--enable-rsvg,--disable-rsvg,librsvg" -PACKAGECONFIG[rtmp] = "--enable-rtmp,--disable-rtmp,rtmpdump" -PACKAGECONFIG[sbc] = "--enable-sbc,--disable-sbc,sbc" -PACKAGECONFIG[schroedinger] = "--enable-schro,--disable-schro,schroedinger" -PACKAGECONFIG[smoothstreaming] = "--enable-smoothstreaming,--disable-smoothstreaming,libxml2" -PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1" -PACKAGECONFIG[srtp] = "--enable-srtp,--disable-srtp,libsrtp" -PACKAGECONFIG[uvch264] = "--enable-uvch264,--disable-uvch264,libusb1 libgudev" -PACKAGECONFIG[voaacenc] = "--enable-voaacenc,--disable-voaacenc,vo-aacenc" -PACKAGECONFIG[voamrwbenc] = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc" -PACKAGECONFIG[wayland] = "--enable-wayland --enable-egl,--disable-wayland --disable-egl,wayland virtual/egl" -PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp" - -# these plugins have not been ported to 1.0 (yet): -# apexsink dc1394 lv2 linsys musepack nas timidity teletextdec sdl xvid wininet -# acm gsettings sndio cdxaparse dccp faceoverlay hdvparse tta mve nuvdemux -# patchdetect real sdi videomeasure gsettings - -# these plugins have no corresponding library in OE-core or meta-openembedded: -# openni2 winks direct3d directsound winscreencap -# apple_media android_media avc bs2b chromaprint daala dts gme gsm kate ladspa -# libde265 mimic mpeg2enc mplex ofa openh264 opensles pvr soundtouch spandsp -# spc vdpau wasapi x265 zbar - -# qt5 support is disabled, because it is not present in OE core, and requires more work than -# just adding a packageconfig (it requires access to moc, uic, rcc, and qmake paths). -# This is better done in a separate qt5 layer (which then should add a "qt5" packageconfig -# in a gstreamer1.0-plugins-bad bbappend). - -EXTRA_OECONF += " \ - --enable-decklink \ - --enable-dvb \ - --enable-fbdev \ - --enable-shm \ - --enable-vcd \ - --disable-acm \ - --disable-android_media \ - --disable-apexsink \ - --disable-apple_media \ - --disable-avc \ - --disable-bs2b \ - --disable-chromaprint \ - --disable-cocoa \ - --disable-daala \ - --disable-dc1394 \ - --disable-direct3d \ - --disable-directsound \ - --disable-dts \ - --disable-gme \ - --disable-gsm \ - --disable-kate \ - --disable-ladspa \ - --disable-libde265 \ - --disable-libvisual \ - --disable-linsys \ - --disable-lv2 \ - --disable-mimic \ - --disable-mpeg2enc \ - --disable-mplex \ - --disable-musepack \ - --disable-nas \ - --disable-ofa \ - --disable-openexr \ - --disable-openh264 \ - --disable-openjpeg \ - --disable-openni2 \ - --disable-opensles \ - --disable-pvr \ - --disable-qt \ - --disable-sdl \ - --disable-sdltest \ - --disable-sndio \ - --disable-soundtouch \ - --disable-spandsp \ - --disable-spc \ - --disable-teletextdec \ - --disable-timidity \ - --disable-vdpau \ - --disable-wasapi \ - --disable-wildmidi \ - --disable-wininet \ - --disable-winks \ - --disable-winscreencap \ - --disable-x265 \ - --disable-xvid \ - --disable-zbar \ - ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--disable-yadif", "", d)} \ -" - -export OPENCV_PREFIX = "${STAGING_DIR_TARGET}${prefix}" - -ARM_INSTRUCTION_SET_armv4 = "arm" -ARM_INSTRUCTION_SET_armv5 = "arm" - -FILES_${PN}-dev += "${libdir}/gstreamer-${LIBV}/include/gst/gl/gstglconfig.h" -FILES_${PN}-freeverb += "${datadir}/gstreamer-${LIBV}/presets/GstFreeverb.prs" -FILES_${PN}-opencv += "${datadir}/gst-plugins-bad/${LIBV}/opencv*" -FILES_${PN}-voamrwbenc += "${datadir}/gstreamer-${LIBV}/presets/GstVoAmrwbEnc.prs" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch deleted file mode 100644 index 154d340e4..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch +++ /dev/null @@ -1,57 +0,0 @@ -From cff6fbf555a072408c21da1e818209c9d3814dd3 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 27 Oct 2015 14:36:58 +0200 -Subject: [PATCH] Makefile.am: don't hardcode libtool name when running - introspection tools - -Upstream-Status: Pending [review on oe-core list] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - gst-libs/gst/gl/Makefile.am | 2 +- - gst-libs/gst/insertbin/Makefile.am | 2 +- - gst-libs/gst/mpegts/Makefile.am | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am -index f968357..7cc2c7a 100644 ---- a/gst-libs/gst/gl/Makefile.am -+++ b/gst-libs/gst/gl/Makefile.am -@@ -149,7 +149,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstgl-@GST_API_VERSION@ - --library=libgstgl-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-base-@GST_API_VERSION@ \ - --pkg gstreamer-video-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/insertbin/Makefile.am b/gst-libs/gst/insertbin/Makefile.am -index 09eb97c..b746885 100644 ---- a/gst-libs/gst/insertbin/Makefile.am -+++ b/gst-libs/gst/insertbin/Makefile.am -@@ -43,7 +43,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstinsertbin-@GS - --library=libgstinsertbin-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-base-@GST_API_VERSION@ \ - --pkg-export gstreamer-insertbin-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/mpegts/Makefile.am b/gst-libs/gst/mpegts/Makefile.am -index 2511d49..c1cbce6 100644 ---- a/gst-libs/gst/mpegts/Makefile.am -+++ b/gst-libs/gst/mpegts/Makefile.am -@@ -78,7 +78,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstmpegts-@GST_API_ - --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-video-@GST_API_VERSION@` \ - --library=libgstmpegts-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-video-@GST_API_VERSION@ \ - --pkg-export gstreamer-mpegts-@GST_API_VERSION@ \ --- -2.6.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch deleted file mode 100644 index 1085e95e8..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch +++ /dev/null @@ -1,32 +0,0 @@ -From c6b37a80806f9128de47f1ccc3f2354f8d436bb6 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 24 Sep 2015 19:47:32 +0300 -Subject: [PATCH] glimagesink: Downrank to marginal - -On desktop, where there is good OpenGL, xvimagesink will come up first, -on other platforms, OpenGL can't be trusted because it's either software (like -in a VM) or broken (like on embedded)., so let ximagesink come above. - -Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=751684] - -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - ext/gl/gstopengl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c -index a4b2540..0ccaacd 100644 ---- a/ext/gl/gstopengl.c -+++ b/ext/gl/gstopengl.c -@@ -101,7 +101,7 @@ plugin_init (GstPlugin * plugin) - #endif - - if (!gst_element_register (plugin, "glimagesink", -- GST_RANK_SECONDARY, gst_gl_image_sink_bin_get_type ())) { -+ GST_RANK_MARGINAL, gst_gl_image_sink_bin_get_type ())) { - return FALSE; - } - --- -2.1.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch deleted file mode 100644 index e81b06570..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch +++ /dev/null @@ -1,27 +0,0 @@ -From a93ca63d01e7cd1e40b5be576992f77fac364bd5 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 21 Mar 2016 18:21:17 +0200 -Subject: [PATCH] gstreamer-gl.pc.in: don't append GL_CFLAGS to CFLAGS - -Dependencies' include directories should not be added in this way; -it causes problems when cross-compiling in sysroot environments. - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - pkgconfig/gstreamer-gl.pc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pkgconfig/gstreamer-gl.pc.in b/pkgconfig/gstreamer-gl.pc.in -index 5589e2a..b986450 100644 ---- a/pkgconfig/gstreamer-gl.pc.in -+++ b/pkgconfig/gstreamer-gl.pc.in -@@ -10,4 +10,4 @@ Version: @VERSION@ - Requires: gstreamer-base-@GST_API_VERSION@ gstreamer-@GST_API_VERSION@ - - Libs: -L${libdir} -lgstgl-@GST_API_VERSION@ @GL_LIBS@ --Cflags: -I${includedir} @GL_CFLAGS@ -+Cflags: -I${includedir} --- -2.7.0 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch deleted file mode 100755 index 3491a15e6..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 95cda7fbcf1a81289d9315c801c8e2b3d896f4cb Mon Sep 17 00:00:00 2001 -From: Haihua Hu <b55597@freescale.com> -Date: Mon, 30 Nov 2015 09:36:09 +0800 -Subject: [PATCH 2/5] [glplugin] glwindow: fix memory leak of navigation - thread - -When exit navigation thread, call g_thread_join() to release -the resource hold by it. - -Upstream-Status: Backport [1.7.1] - -bugzilla URL: https://bugzilla.gnome.org/show_bug.cgi?id=758820 - -Signed-off-by: Haihua Hu <b55597@freescale.com> ---- - gst-libs/gst/gl/gstglwindow.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c -index 44b74ca..42ef296 100644 ---- a/gst-libs/gst/gl/gstglwindow.c -+++ b/gst-libs/gst/gl/gstglwindow.c -@@ -343,6 +343,9 @@ gst_gl_window_finalize (GObject * object) - while (window->nav_alive) { - g_cond_wait (&window->nav_destroy_cond, &window->nav_lock); - } -+ /* release resource hold by navigation thread */ -+ g_thread_join(window->priv->navigation_thread); -+ window->priv->navigation_thread = NULL; - g_mutex_unlock (&window->nav_lock); - } - --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch deleted file mode 100644 index 357fd7800..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 72561a0fca562d03567ace7b4cfc94992cd6525c Mon Sep 17 00:00:00 2001 -From: Andre McCurdy <armccurdy@gmail.com> -Date: Wed, 3 Feb 2016 18:05:41 -0800 -Subject: [PATCH] avoid including <sys/poll.h> directly - -musl libc generates warnings if <sys/poll.h> is included directly. - -Upstream-Status: Pending - -Signed-off-by: Andre McCurdy <armccurdy@gmail.com> ---- - sys/dvb/gstdvbsrc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c -index b93255f..49f145a 100644 ---- a/sys/dvb/gstdvbsrc.c -+++ b/sys/dvb/gstdvbsrc.c -@@ -93,7 +93,7 @@ - #include <gst/gst.h> - #include <gst/glib-compat-private.h> - #include <sys/ioctl.h> --#include <sys/poll.h> -+#include <poll.h> - #include <fcntl.h> - #include <errno.h> - #include <stdio.h> --- -1.9.1 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch deleted file mode 100644 index d52afd5d5..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch +++ /dev/null @@ -1,64 +0,0 @@ -From f59c5269f92d59a5296cbfeeb682d42095cd88ad Mon Sep 17 00:00:00 2001 -From: Wenzong Fan <wenzong.fan@windriver.com> -Date: Thu, 18 Sep 2014 02:24:07 -0400 -Subject: [PATCH] gstreamer1.0-plugins-bad: allow to disable libssh2 - -libssh2 is automatically linked to if present, this undetermined -dependency may cause build errors like: - - .../x86_64-poky-linux/4.9.0/ld: cannot find -lssh2 - -libssh2 isn't an oe-core recipe, so allow to disable it from -configure. - -Upstream-Status: Pending - -Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> ---- - configure.ac | 23 +++++++++++++++++------ - 1 file changed, 17 insertions(+), 6 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 0e95c5c..12153b4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1901,6 +1901,15 @@ AG_GST_CHECK_FEATURE(CHROMAPRINT, [chromaprint], chromaprint, [ - ]) - - dnl *** Curl *** -+AC_ARG_ENABLE([libssh2], -+ [ --enable-libssh2 enable LIBSSH2 support @<:@default=auto@:>@], -+ [case "${enableval}" in -+ yes) NEED_SSH2=yes ;; -+ no) NEED_SSH2=no ;; -+ auto) NEED_SSH2=auto ;; -+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libssh2]) ;; -+ esac],[NEED_SSH2=auto]) -+ - translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true) - AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [ - PKG_CHECK_MODULES(CURL, libcurl >= 7.21.0, [ -@@ -1915,12 +1924,14 @@ AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [ - ]) - AC_SUBST(CURL_CFLAGS) - AC_SUBST(CURL_LIBS) -- PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [ -- HAVE_SSH2="yes" -- AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available]) -- ], [ -- HAVE_SSH2="no" -- ]) -+ if test "x$NEED_SSH2" != "xno"; then -+ PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [ -+ HAVE_SSH2="yes" -+ AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available]) -+ ], [ -+ HAVE_SSH2="no" -+ ]) -+ fi - AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes") - AC_SUBST(SSH2_CFLAGS) - AC_SUBST(SSH2_LIBS) --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch deleted file mode 100644 index 369ff93ac..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 2262ba4b686d5cc0d3e894707fe1d31619a3a8f1 Mon Sep 17 00:00:00 2001 -From: Andre McCurdy <armccurdy@gmail.com> -Date: Tue, 9 Feb 2016 14:00:00 -0800 -Subject: [PATCH] ensure valid sentinals for gst_structure_get() etc - -For GStreamer functions declared with G_GNUC_NULL_TERMINATED, -ie __attribute__((__sentinel__)), gcc will generate a warning if the -last parameter passed to the function is not NULL (where a valid NULL -in this context is defined as zero with any pointer type). - -The C callers to such functions within gst-plugins-bad use the C NULL -definition (ie ((void*)0)), which is a valid sentinel. - -However the C++ NULL definition (ie 0L), is not a valid sentinel -without an explicit cast to a pointer type. - -Upstream-Status: Pending - -Signed-off-by: Andre McCurdy <armccurdy@gmail.com> ---- - sys/decklink/gstdecklink.cpp | 10 +++++----- - sys/decklink/gstdecklinkaudiosrc.cpp | 2 +- - sys/decklink/gstdecklinkvideosink.cpp | 2 +- - 3 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp -index 64637f1..bac956f 100644 ---- a/sys/decklink/gstdecklink.cpp -+++ b/sys/decklink/gstdecklink.cpp -@@ -324,22 +324,22 @@ gst_decklink_mode_get_structure (GstDecklinkModeEnum e, BMDPixelFormat f) - "height", G_TYPE_INT, mode->height, - "pixel-aspect-ratio", GST_TYPE_FRACTION, mode->par_n, mode->par_d, - "interlace-mode", G_TYPE_STRING, mode->interlaced ? "interleaved" : "progressive", -- "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, NULL); -+ "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, (void *) NULL); - - switch (f) { - case bmdFormat8BitYUV: /* '2vuy' */ - gst_structure_set (s, "format", G_TYPE_STRING, "UYVY", - "colorimetry", G_TYPE_STRING, mode->colorimetry, -- "chroma-site", G_TYPE_STRING, "mpeg2", NULL); -+ "chroma-site", G_TYPE_STRING, "mpeg2", (void *) NULL); - break; - case bmdFormat10BitYUV: /* 'v210' */ -- gst_structure_set (s, "format", G_TYPE_STRING, "v210", NULL); -+ gst_structure_set (s, "format", G_TYPE_STRING, "v210", (void *) NULL); - break; - case bmdFormat8BitARGB: /* 'ARGB' */ -- gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", NULL); -+ gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", (void *) NULL); - break; - case bmdFormat8BitBGRA: /* 'BGRA' */ -- gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", NULL); -+ gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", (void *) NULL); - break; - case bmdFormat10BitRGB: /* 'r210' Big-endian RGB 10-bit per component with SMPTE video levels (64-960). Packed as 2:10:10:10 */ - case bmdFormat12BitRGB: /* 'R12B' Big-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component */ -diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp -index 9a701ee..26fb7ec 100644 ---- a/sys/decklink/gstdecklinkaudiosrc.cpp -+++ b/sys/decklink/gstdecklinkaudiosrc.cpp -@@ -312,7 +312,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps) - g_mutex_unlock (&self->input->lock); - - if (videosrc) { -- g_object_get (videosrc, "connection", &vconn, NULL); -+ g_object_get (videosrc, "connection", &vconn, (void *) NULL); - gst_object_unref (videosrc); - - switch (vconn) { -diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp -index eebeff3..da6e486 100644 ---- a/sys/decklink/gstdecklinkvideosink.cpp -+++ b/sys/decklink/gstdecklinkvideosink.cpp -@@ -158,7 +158,7 @@ reset_framerate (GstCapsFeatures * features, GstStructure * structure, - gpointer user_data) - { - gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, -- G_MAXINT, 1, NULL); -+ G_MAXINT, 1, (void *) NULL); - - return TRUE; - } --- -1.9.1 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch deleted file mode 100644 index 5ce57714e..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a67781000e82bd9ae3813da29401e8c0c852328a Mon Sep 17 00:00:00 2001 -From: Andre McCurdy <armccurdy@gmail.com> -Date: Tue, 26 Jan 2016 15:16:01 -0800 -Subject: [PATCH] fix maybe-uninitialized warnings when compiling with -Os - -Upstream-Status: Pending - -Signed-off-by: Andre McCurdy <armccurdy@gmail.com> ---- - gst-libs/gst/codecparsers/gstvc1parser.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gst-libs/gst/codecparsers/gstvc1parser.c b/gst-libs/gst/codecparsers/gstvc1parser.c -index fd16ee0..ddb890c 100644 ---- a/gst-libs/gst/codecparsers/gstvc1parser.c -+++ b/gst-libs/gst/codecparsers/gstvc1parser.c -@@ -1729,7 +1729,7 @@ gst_vc1_parse_sequence_layer (const guint8 * data, gsize size, - GstVC1SeqLayer * seqlayer) - { - guint32 tmp; -- guint8 tmp8; -+ guint8 tmp8 = 0; - guint8 structA[8] = { 0, }; - guint8 structB[12] = { 0, }; - GstBitReader br; --- -1.9.1 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_1.6.3.bb deleted file mode 100644 index 8eb47c265..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_1.6.3.bb +++ /dev/null @@ -1,28 +0,0 @@ -include gstreamer1.0-plugins-bad.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \ - file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \ - file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \ - file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a" - -# Note: The mpg123 plugin was moved to gst-plugins-ugly prior to the 1.7.2 -# release, so this line should be removed during the update to 1.8.x -# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=08d8aefcdaaf89ecb6dd53ec1e4f95cd42d01664 -PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123" - -# Note: The gsettings plug-in was dropped prior to the 1.7.2 release, -# so this line should be removed during the update to 1.8.x -# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=914291808ad10621d6a74031f3d46d45eef5a3a3 -EXTRA_OECONF += "--disable-gsettings" - -SRC_URI = " \ - http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \ - file://configure-allow-to-disable-libssh2.patch \ - file://0001-glimagesink-Downrank-to-marginal.patch \ - file://0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch \ -" - -SRC_URI[md5sum] = "4857adcafe41e4b9b8805cf88303bd55" -SRC_URI[sha256sum] = "971b29101d6a9c5e3fe94d99d977a227f58f0b2d29b6ca2c7f292052542b3a61" - -S = "${WORKDIR}/gst-plugins-bad-${PV}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_git.bb deleted file mode 100644 index ef6581b2a..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_git.bb +++ /dev/null @@ -1,65 +0,0 @@ -DEFAULT_PREFERENCE = "-1" - -include gstreamer1.0-plugins-bad.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \ - file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \ - file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \ - file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a" - -SRC_URI = " \ - git://anongit.freedesktop.org/gstreamer/gst-plugins-bad;name=base \ - git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \ - file://configure-allow-to-disable-libssh2.patch \ - file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \ - file://avoid-including-sys-poll.h-directly.patch \ - file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \ - file://0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch \ -" - -PV = "1.7.2+git${SRCPV}" - -UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))" - -SRCREV_base = "50ae46cc0f8827bf966920d9c221e5cf86e811ba" -SRCREV_common = "a25397448942079002622be231e9ec49b985745a" -SRCREV_FORMAT = "base" - -S = "${WORKDIR}/git" - -# over-ride the default hls PACKAGECONFIG in gstreamer1.0-plugins-bad.inc to -# pass an additional --with-hls-crypto=XXX option (new in 1.7.x) and switch HLS -# AES decryption from nettle to openssl (ie a shared dependency with dtls). -# This should move back to the common .inc once the main recipe updates to 1.8.x -PACKAGECONFIG[hls] = "--enable-hls --with-hls-crypto=openssl,--disable-hls,openssl" - -# The tinyalsa plugin was added prior to the 1.7.2 release -# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c8bd74fa9a81398f57d976c478d2043f30188684 -PACKAGECONFIG[tinyalsa] = "--enable-tinyalsa,--disable-tinyalsa,tinyalsa" - -# The vulkan based video sink plugin was added prior to the 1.7.2 release -# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=5de6dd9f40629562acf90e35e1fa58464d66617d -PACKAGECONFIG[vulkan] = "--enable-vulkan,--disable-vulkan,libxcb" - -# The dependency-less netsim plugin was added prior to the 1.7.2 release -# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=e3f9e854f08e82bfab11182c5a2aa6f9a0c73cd5 -EXTRA_OECONF += " \ - --enable-netsim \ -" - -do_configure_prepend() { - ${S}/autogen.sh --noconfigure -} - -# In 1.6.2, the "--enable-hls" configure option generated an installable package -# called "gstreamer1.0-plugins-bad-fragmented". In 1.7.1 that HLS plugin package -# has become "gstreamer1.0-plugins-bad-hls". See: -# http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=efe62292a3d045126654d93239fdf4cc8e48ae08 - -PACKAGESPLITFUNCS_append = " handle_hls_rename " - -python handle_hls_rename () { - d.setVar('RPROVIDES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented') - d.setVar('RREPLACES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented') - d.setVar('RCONFLICTS_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented') -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base.inc deleted file mode 100644 index 7381458f4..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base.inc +++ /dev/null @@ -1,50 +0,0 @@ -require gstreamer1.0-plugins.inc - -SRC_URI_append = "\ - file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \ - file://0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch \ - file://0003-riff-add-missing-include-directories-when-calling-in.patch \ - file://0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch \ -" - -LICENSE = "GPLv2+ & LGPLv2+" - -DEPENDS += "iso-codes util-linux zlib" - -inherit gettext - -PACKAGES_DYNAMIC =+ "^libgst.*" - -PACKAGECONFIG ??= " \ - ${GSTREAMER_ORC} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \ - gio-unix-2.0 ivorbis ogg pango theora vorbis \ -" - -X11DEPENDS = "virtual/libx11 libsm libxrender libxv" -X11ENABLEOPTS = "--enable-x --enable-xvideo --enable-xshm" -X11DISABLEOPTS = "--disable-x --disable-xvideo --disable-xshm" - -PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" -PACKAGECONFIG[cdparanoia] = "--enable-cdparanoia,--disable-cdparanoia,cdparanoia" -PACKAGECONFIG[gio-unix-2.0] = "--enable-gio_unix_2_0,--disable-gio_unix_2_0,glib-2.0" -PACKAGECONFIG[ivorbis] = "--enable-ivorbis,--disable-ivorbis,tremor" -PACKAGECONFIG[ogg] = "--enable-ogg,--disable-ogg,libogg" -PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango" -PACKAGECONFIG[theora] = "--enable-theora,--disable-theora,libtheora" -PACKAGECONFIG[visual] = "--enable-libvisual,--disable-libvisual,libvisual" -PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis" -PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}" - -EXTRA_OECONF += " \ - --enable-zlib \ -" - -CACHED_CONFIGUREVARS_append_x86 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no" - -FILES_${MLPREFIX}libgsttag-1.0 += "${datadir}/gst-plugins-base/1.0/license-translations.dict" - -do_compile_prepend() { - export GIR_EXTRA_LIBS_PATH="${B}/gst-libs/gst/tag/.libs:${B}/gst-libs/gst/video/.libs:${B}/gst-libs/gst/audio/.libs:${B}/gst-libs/gst/rtp/.libs" -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch deleted file mode 100644 index 781e4d801..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch +++ /dev/null @@ -1,168 +0,0 @@ -From f1d9652351e7754c63003104eceb526af424c7e0 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 20 Nov 2015 16:53:04 +0200 -Subject: [PATCH 1/4] Makefile.am: don't hardcode libtool name when running - introspection tools - -Upstream-Status: Pending [review on oe-core maillist] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - gst-libs/gst/allocators/Makefile.am | 2 +- - gst-libs/gst/app/Makefile.am | 2 +- - gst-libs/gst/audio/Makefile.am | 2 +- - gst-libs/gst/fft/Makefile.am | 2 +- - gst-libs/gst/pbutils/Makefile.am | 2 +- - gst-libs/gst/riff/Makefile.am | 2 +- - gst-libs/gst/rtp/Makefile.am | 2 +- - gst-libs/gst/rtsp/Makefile.am | 2 +- - gst-libs/gst/sdp/Makefile.am | 2 +- - gst-libs/gst/tag/Makefile.am | 2 +- - gst-libs/gst/video/Makefile.am | 2 +- - 11 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am -index 9361bf9..bc7f53a 100644 ---- a/gst-libs/gst/allocators/Makefile.am -+++ b/gst-libs/gst/allocators/Makefile.am -@@ -37,7 +37,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@ - --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --library=libgstallocators-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg-export gstreamer-allocators-@GST_API_VERSION@ \ - --output $@ \ -diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am -index 6d6de8d..dcc2fe0 100644 ---- a/gst-libs/gst/app/Makefile.am -+++ b/gst-libs/gst/app/Makefile.am -@@ -52,7 +52,7 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO - --library=libgstapp-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-base-@GST_API_VERSION@ \ - --pkg-export gstreamer-app-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am -index 275d222..2374196 100644 ---- a/gst-libs/gst/audio/Makefile.am -+++ b/gst-libs/gst/audio/Makefile.am -@@ -106,7 +106,7 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ - --include=GstTag-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-base-@GST_API_VERSION@ \ - --pkg-export gstreamer-audio-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/fft/Makefile.am b/gst-libs/gst/fft/Makefile.am -index 09b3d68..f545354 100644 ---- a/gst-libs/gst/fft/Makefile.am -+++ b/gst-libs/gst/fft/Makefile.am -@@ -64,7 +64,7 @@ GstFft-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstfft-@GST_API_VERSIO - --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --library=libgstfft-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg-export gstreamer-fft-@GST_API_VERSION@ \ - --output $@ \ -diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am -index 64d5eb0..91dc214 100644 ---- a/gst-libs/gst/pbutils/Makefile.am -+++ b/gst-libs/gst/pbutils/Makefile.am -@@ -94,7 +94,7 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP - --include=GstTag-@GST_API_VERSION@ \ - --include=GstVideo-@GST_API_VERSION@ \ - --include=GstAudio-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-tag-@GST_API_VERSION@ \ - --pkg gstreamer-video-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am -index 83d83cb..3bd8fc0 100644 ---- a/gst-libs/gst/riff/Makefile.am -+++ b/gst-libs/gst/riff/Makefile.am -@@ -47,7 +47,7 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) - # --include=GstAudio-@GST_API_VERSION@ \ - # --include=GstTag-@GST_API_VERSION@ \ - # --include=Gst-@GST_API_VERSION@ \ --# --libtool="$(top_builddir)/libtool" \ -+# --libtool="$(LIBTOOL)" \ - # --pkg gstreamer-@GST_API_VERSION@ \ - # --pkg gstreamer-tag-@GST_API_VERSION@ \ - # --pkg gstreamer-audio-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am -index fdd01c1..f5445c1 100644 ---- a/gst-libs/gst/rtp/Makefile.am -+++ b/gst-libs/gst/rtp/Makefile.am -@@ -64,7 +64,7 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO - --library=libgstrtp-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-base-@GST_API_VERSION@ \ - --pkg-export gstreamer-rtp-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am -index ede5706..9b0b258 100644 ---- a/gst-libs/gst/rtsp/Makefile.am -+++ b/gst-libs/gst/rtsp/Makefile.am -@@ -71,7 +71,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS - --include=Gio-2.0 \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstSdp-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gio-2.0 \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-sdp-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am -index a90f30b..0e149b8 100644 ---- a/gst-libs/gst/sdp/Makefile.am -+++ b/gst-libs/gst/sdp/Makefile.am -@@ -31,7 +31,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO - --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --library=libgstsdp-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg-export gstreamer-sdp-@GST_API_VERSION@ \ - --output $@ \ -diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am -index c534a4d..cafafd3 100644 ---- a/gst-libs/gst/tag/Makefile.am -+++ b/gst-libs/gst/tag/Makefile.am -@@ -44,7 +44,7 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO - --library=libgsttag-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-base-@GST_API_VERSION@ \ - --pkg-export gstreamer-tag-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am -index 5d31fa1..ac64eb3 100644 ---- a/gst-libs/gst/video/Makefile.am -+++ b/gst-libs/gst/video/Makefile.am -@@ -113,7 +113,7 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE - --library=libgstvideo-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-base-@GST_API_VERSION@ \ - --pkg-export gstreamer-video-@GST_API_VERSION@ \ --- -2.6.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch deleted file mode 100644 index 85fcacb55..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch +++ /dev/null @@ -1,298 +0,0 @@ -From 990b653c7b6de1937ec759019982d6c5f15770f7 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 26 Oct 2015 16:38:18 +0200 -Subject: [PATCH 2/4] Makefile.am: prefix calls to pkg-config with - PKG_CONFIG_SYSROOT_DIR - -Upstream-Status: Pending [review on oe-core maillist] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - gst-libs/gst/allocators/Makefile.am | 4 ++-- - gst-libs/gst/app/Makefile.am | 4 ++-- - gst-libs/gst/audio/Makefile.am | 12 ++++++------ - gst-libs/gst/fft/Makefile.am | 4 ++-- - gst-libs/gst/pbutils/Makefile.am | 12 ++++++------ - gst-libs/gst/riff/Makefile.am | 8 ++++---- - gst-libs/gst/rtp/Makefile.am | 8 ++++---- - gst-libs/gst/rtsp/Makefile.am | 4 ++-- - gst-libs/gst/sdp/Makefile.am | 4 ++-- - gst-libs/gst/tag/Makefile.am | 8 ++++---- - gst-libs/gst/video/Makefile.am | 8 ++++---- - 11 files changed, 38 insertions(+), 38 deletions(-) - -diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am -index bc7f53a..0ef5f86 100644 ---- a/gst-libs/gst/allocators/Makefile.am -+++ b/gst-libs/gst/allocators/Makefile.am -@@ -34,7 +34,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@ - --c-include "gst/allocators/allocators.h" \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --library=libgstallocators-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --libtool="$(LIBTOOL)" \ -@@ -58,7 +58,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(builddir) \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am -index dcc2fe0..dc076cb 100644 ---- a/gst-libs/gst/app/Makefile.am -+++ b/gst-libs/gst/app/Makefile.am -@@ -47,8 +47,8 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO - --c-include "gst/app/app.h" \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - --library=libgstapp-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am -index 2374196..295eb42 100644 ---- a/gst-libs/gst/audio/Makefile.am -+++ b/gst-libs/gst/audio/Makefile.am -@@ -96,12 +96,12 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ - --c-include "gst/audio/audio.h" \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \ - --library=libgstaudio-@GST_API_VERSION@.la \ -- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \ -- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \ -+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \ -+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \ - --library-path="$(top_builddir)/gst-libs/gst/tag/" \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -@@ -130,8 +130,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - --includedir=$(srcdir) \ - --includedir=$(builddir) \ - --includedir="$(top_builddir)/gst-libs/gst/tag/" \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/fft/Makefile.am b/gst-libs/gst/fft/Makefile.am -index f545354..1bb6243 100644 ---- a/gst-libs/gst/fft/Makefile.am -+++ b/gst-libs/gst/fft/Makefile.am -@@ -61,7 +61,7 @@ GstFft-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstfft-@GST_API_VERSIO - --c-include "gst/fft/fft.h" \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --library=libgstfft-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --libtool="$(LIBTOOL)" \ -@@ -85,7 +85,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(builddir) \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am -index 91dc214..dc8e1d3 100644 ---- a/gst-libs/gst/pbutils/Makefile.am -+++ b/gst-libs/gst/pbutils/Makefile.am -@@ -79,14 +79,14 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP - --c-include "gst/pbutils/pbutils.h" \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \ - --add-include-path="$(top_builddir)/gst-libs/gst/video/" \ - --add-include-path="$(top_builddir)/gst-libs/gst/audio/" \ - --library=libgstpbutils-@GST_API_VERSION@.la \ -- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \ -- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \ -+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \ -+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \ - --library-path="$(top_builddir)/gst-libs/gst/tag/" \ - --library-path="$(top_builddir)/gst-libs/gst/video/" \ - --library-path="$(top_builddir)/gst-libs/gst/audio/" \ -@@ -119,8 +119,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(builddir) \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - --includedir="$(top_builddir)/gst-libs/gst/tag/" \ - --includedir="$(top_builddir)/gst-libs/gst/video/" \ - --includedir="$(top_builddir)/gst-libs/gst/audio/" \ -diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am -index 3bd8fc0..0a115cc 100644 ---- a/gst-libs/gst/riff/Makefile.am -+++ b/gst-libs/gst/riff/Makefile.am -@@ -41,8 +41,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) - # --c-include "gst/riff/riff.h" \ - # --add-include-path=$(builddir)/../tag \ - # --add-include-path=$(builddir)/../audio \ --# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ --# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - # --library=libgstriff-@GST_API_VERSION@.la \ - # --include=GstAudio-@GST_API_VERSION@ \ - # --include=GstTag-@GST_API_VERSION@ \ -@@ -73,8 +73,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) - # --includedir=$(builddir) \ - # --includedir=$(builddir)/../tag \ - # --includedir=$(builddir)/../audio \ --# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ --# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - # $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - # - #CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am -index f5445c1..527c0b4 100644 ---- a/gst-libs/gst/rtp/Makefile.am -+++ b/gst-libs/gst/rtp/Makefile.am -@@ -59,8 +59,8 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO - --c-include "gst/rtp/rtp.h" \ - -I$(top_builddir)/gst-libs \ - -I$(top_srcdir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - --library=libgstrtp-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -@@ -87,8 +87,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(builddir) \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am -index 9b0b258..4f6d9f8 100644 ---- a/gst-libs/gst/rtsp/Makefile.am -+++ b/gst-libs/gst/rtsp/Makefile.am -@@ -66,7 +66,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS - -I$(top_builddir)/gst-libs \ - -I$(top_srcdir)/gst-libs \ - --add-include-path=$(builddir)/../sdp \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --library=libgstrtsp-@GST_API_VERSION@.la \ - --include=Gio-2.0 \ - --include=Gst-@GST_API_VERSION@ \ -@@ -96,7 +96,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - --includedir=$(srcdir) \ - --includedir=$(builddir) \ - --includedir=$(builddir)/../sdp \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am -index 0e149b8..9aa0512 100644 ---- a/gst-libs/gst/sdp/Makefile.am -+++ b/gst-libs/gst/sdp/Makefile.am -@@ -28,7 +28,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO - --warn-all \ - --c-include "gst/sdp/sdp.h" \ - -I$(top_srcdir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - --library=libgstsdp-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --libtool="$(LIBTOOL)" \ -@@ -52,7 +52,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(builddir) \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am -index cafafd3..ba99279 100644 ---- a/gst-libs/gst/tag/Makefile.am -+++ b/gst-libs/gst/tag/Makefile.am -@@ -39,8 +39,8 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO - --c-include "gst/tag/tag.h" \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - --library=libgsttag-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -@@ -67,8 +67,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(builddir) \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA) -diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am -index ac64eb3..342c8c6 100644 ---- a/gst-libs/gst/video/Makefile.am -+++ b/gst-libs/gst/video/Makefile.am -@@ -108,8 +108,8 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE - --c-include "gst/video/video.h" \ - -I$(top_srcdir)/gst-libs \ - -I$(top_builddir)/gst-libs \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - --library=libgstvideo-@GST_API_VERSION@.la \ - --include=Gst-@GST_API_VERSION@ \ - --include=GstBase-@GST_API_VERSION@ \ -@@ -136,8 +136,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) - $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(builddir) \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ -+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \ - $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) - - CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA) --- -2.6.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch deleted file mode 100644 index 9b66f7f49..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 3c2c2d5dd08aa30ed0e8acd8566ec99412bb8209 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 26 Oct 2015 17:29:37 +0200 -Subject: [PATCH 3/4] riff: add missing include directories when calling - introspection scanner - -Upstream-Status: Pending [review on oe-core maillist] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - gst-libs/gst/riff/Makefile.am | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am -index 0a115cc..5057a58 100644 ---- a/gst-libs/gst/riff/Makefile.am -+++ b/gst-libs/gst/riff/Makefile.am -@@ -39,6 +39,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) - # --strip-prefix=Gst \ - # --warn-all \ - # --c-include "gst/riff/riff.h" \ -+# -I$(top_srcdir)/gst-libs \ -+# -I$(top_builddir)/gst-libs \ - # --add-include-path=$(builddir)/../tag \ - # --add-include-path=$(builddir)/../audio \ - # --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \ --- -2.6.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch deleted file mode 100644 index 9fbebd570..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch +++ /dev/null @@ -1,225 +0,0 @@ -From be6163cfa3a255493f9d75bad9541cbfe1723fee Mon Sep 17 00:00:00 2001 -From: Mingke Wang <mingke.wang@freescale.com> -Date: Thu, 19 Mar 2015 14:17:10 +0800 -Subject: [PATCH 3/4] ssaparse: enhance SSA text lines parsing. - -some parser will pass in the original ssa text line which starts with "Dialog:" -and there's are maybe multiple Dialog lines in one input buffer. - -Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747496] - -Signed-off-by: Mingke Wang <mingke.wang@freescale.com> - -diff --git a/gst/subparse/gstssaparse.c b/gst/subparse/gstssaparse.c -old mode 100644 -new mode 100755 -index 06ecef9..0ab5dce ---- a/gst/subparse/gstssaparse.c -+++ b/gst/subparse/gstssaparse.c -@@ -260,6 +260,7 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt) - * gst_ssa_parse_push_line: - * @parse: caller element - * @txt: text to push -+ * @size: text size need to be parse - * @start: timestamp for the buffer - * @duration: duration for the buffer - * -@@ -269,27 +270,133 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt) - * Returns: result of the push of the created buffer - */ - static GstFlowReturn --gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt, -+gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt, gint size, - GstClockTime start, GstClockTime duration) - { - GstFlowReturn ret; - GstBuffer *buf; -- gchar *t, *escaped; -+ gchar *t, *text, *p, *escaped, *p_start, *p_end; - gint num, i, len; -+ GstClockTime start_time = G_MAXUINT64, end_time = 0; - -- num = atoi (txt); -- GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT, -- num, GST_TIME_ARGS (start)); -- -- /* skip all non-text fields before the actual text */ -+ p = text = g_malloc(size + 1); -+ *p = '\0'; - t = txt; -- for (i = 0; i < 8; ++i) { -- t = strchr (t, ','); -+ -+ /* there are may have multiple dialogue lines at a time */ -+ while (*t) { -+ /* ignore leading white space characters */ -+ while (isspace(*t)) -+ t++; -+ -+ /* ignore Format: and Style: lines */ -+ if (strncmp(t, "Format:", 7) == 0 || strncmp(t, "Style:", 6) == 0) { -+ while (*t != '\0' && *t != '\n') { -+ t++; -+ } -+ } -+ -+ if (*t == '\0') -+ break; -+ -+ /* continue with next line */ -+ if (*t == '\n') { -+ t++; -+ continue; -+ } -+ -+ if(strncmp(t, "Dialogue:", 9) != 0) { -+ /* not started with "Dialogue:", it must be a line trimmed by demuxer */ -+ num = atoi (t); -+ GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT, -+ num, GST_TIME_ARGS (start)); -+ -+ /* skip all non-text fields before the actual text */ -+ for (i = 0; i < 8; ++i) { -+ t = strchr (t, ','); -+ if (t == NULL) -+ break; -+ ++t; -+ } -+ } else { -+ /* started with "Dialogue:", update timestamp and duration */ -+ /* time format are like Dialog:Mark,0:00:01.02,0:00:03.04,xx,xxx,... */ -+ guint hour, min, sec, msec, len; -+ GstClockTime tmp; -+ gchar t_str[12] = {0}; -+ -+ /* find the first ',' */ -+ p_start = strchr (t, ','); -+ if (p_start) -+ p_end = strchr (++p_start, ','); -+ -+ if (p_start && p_end) { -+ /* copy text between first ',' and second ',' */ -+ strncpy(t_str, p_start, p_end - p_start); -+ if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) { -+ tmp = ((hour*3600) + (min*60) + sec) * GST_SECOND + msec*GST_MSECOND; -+ GST_DEBUG_OBJECT (parse, "Get start time:%02d:%02d:%02d:%03d\n", -+ hour, min, sec, msec); -+ if (start_time > tmp) -+ start_time = tmp; -+ } else { -+ GST_WARNING_OBJECT (parse, -+ "failed to parse ssa start timestamp string :%s", t_str); -+ } -+ -+ p_start = p_end; -+ p_end = strchr (++p_start, ','); -+ if (p_end) { -+ /* copy text between second ',' and third ',' */ -+ strncpy(t_str, p_start, p_end - p_start); -+ if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) { -+ tmp = ((hour*3600) + (min*60) + sec)*GST_SECOND + msec*GST_MSECOND; -+ GST_DEBUG_OBJECT(parse, "Get end time:%02d:%02d:%02d:%03d\n", -+ hour, min, sec, msec); -+ if (end_time < tmp) -+ end_time = tmp; -+ } else { -+ GST_WARNING_OBJECT (parse, -+ "failed to parse ssa end timestamp string :%s", t_str); -+ } -+ } -+ } -+ -+ /* now skip all non-text fields before the actual text */ -+ for (i = 0; i <= 8; ++i) { -+ t = strchr (t, ','); -+ if (t == NULL) -+ break; -+ ++t; -+ } -+ } -+ -+ /* line end before expected number of ',', not a Dialogue line */ - if (t == NULL) -- return GST_FLOW_ERROR; -- ++t; -+ break; -+ -+ /* if not the first line, and the last character of previous line is '\0', -+ * then replace it with '\N' */ -+ if (p != text && *p == '\0') { -+ *p++ = '\\'; -+ *p++ = 'N'; -+ } -+ -+ /* copy all actual text of this line */ -+ while ((*t != '\0') && (*t != '\n')) -+ *p++ = *t++; -+ -+ /* add a terminator at the end */ -+ *p = '\0'; -+ } -+ -+ /* not valid text found in this buffer return OK to let caller unref buffer */ -+ if (strlen(text) <= 0) { -+ GST_WARNING_OBJECT (parse, "Not valid text found in this buffer\n"); -+ return GST_FLOW_ERROR; - } - -+ t = text; - GST_LOG_OBJECT (parse, "Text : %s", t); - - if (gst_ssa_parse_remove_override_codes (parse, t)) { -@@ -307,13 +414,22 @@ gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt, - gst_buffer_fill (buf, 0, escaped, len + 1); - gst_buffer_set_size (buf, len); - g_free (escaped); -+ g_free(t); -+ -+ if (start_time != G_MAXUINT64) -+ GST_BUFFER_TIMESTAMP (buf) = start_time; -+ else -+ GST_BUFFER_TIMESTAMP (buf) = start; - -- GST_BUFFER_TIMESTAMP (buf) = start; -- GST_BUFFER_DURATION (buf) = duration; -+ if (end_time > start_time) -+ GST_BUFFER_DURATION (buf) = end_time - start_time; -+ else -+ GST_BUFFER_DURATION (buf) = duration; - - GST_LOG_OBJECT (parse, "Pushing buffer with timestamp %" GST_TIME_FORMAT -- " and duration %" GST_TIME_FORMAT, GST_TIME_ARGS (start), -- GST_TIME_ARGS (duration)); -+ " and duration %" GST_TIME_FORMAT, -+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), -+ GST_TIME_ARGS (GST_BUFFER_DURATION (buf))); - - ret = gst_pad_push (parse->srcpad, buf); - -@@ -333,6 +449,7 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf) - GstClockTime ts; - gchar *txt; - GstMapInfo map; -+ gint size; - - if (G_UNLIKELY (!parse->framed)) - goto not_framed; -@@ -350,13 +467,14 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf) - /* make double-sure it's 0-terminated and all */ - gst_buffer_map (buf, &map, GST_MAP_READ); - txt = g_strndup ((gchar *) map.data, map.size); -+ size = map.size; - gst_buffer_unmap (buf, &map); - - if (txt == NULL) - goto empty_text; - - ts = GST_BUFFER_TIMESTAMP (buf); -- ret = gst_ssa_parse_push_line (parse, txt, ts, GST_BUFFER_DURATION (buf)); -+ ret = gst_ssa_parse_push_line (parse, txt, size, ts, GST_BUFFER_DURATION (buf)); - - if (ret != GST_FLOW_OK && GST_CLOCK_TIME_IS_VALID (ts)) { - GstSegment segment; --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch deleted file mode 100644 index 42d99c1db..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4330915d88dc4dd46eb4c28d756482b767c2747f Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 26 Oct 2015 17:30:14 +0200 -Subject: [PATCH 4/4] rtsp: drop incorrect reference to gstreamer-sdp in - Makefile.am - -Upstream-Status: Pending [review on oe-core maillist] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - gst-libs/gst/rtsp/Makefile.am | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am -index 4f6d9f8..0afa370 100644 ---- a/gst-libs/gst/rtsp/Makefile.am -+++ b/gst-libs/gst/rtsp/Makefile.am -@@ -74,7 +74,6 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS - --libtool="$(LIBTOOL)" \ - --pkg gio-2.0 \ - --pkg gstreamer-@GST_API_VERSION@ \ -- --pkg gstreamer-sdp-@GST_API_VERSION@ \ - --pkg-export gstreamer-rtsp-@GST_API_VERSION@ \ - --add-init-section="$(INTROSPECTION_INIT)" \ - --output $@ \ --- -2.6.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch deleted file mode 100644 index 7813915d8..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch +++ /dev/null @@ -1,69 +0,0 @@ -From ed09c8fd2c9c2b5384b72cc70af3728be6694e64 Mon Sep 17 00:00:00 2001 -From: Mingke Wang <mingke.wang@freescale.com> -Date: Thu, 19 Mar 2015 14:20:26 +0800 -Subject: [PATCH 4/4] subparse: set need_segment after sink pad received - GST_EVENT_SEGMENT - -subparse works in push mode, chain funciton will be called once -up stream element finished the seeking and flushing. -if set need_segment flag in src pad event handler, the segment -event will be pushed earlier, result in the subtitle text will -be send out to down stream from the beginning. - -Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747498] - -Signed-off-by: Mingke Wang <mingke.wang@freescale.com> - -diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c -old mode 100644 -new mode 100755 -index b565e93..7741ccc ---- a/gst/subparse/gstsubparse.c -+++ b/gst/subparse/gstsubparse.c -@@ -266,22 +266,20 @@ gst_sub_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event) - goto beach; - } - -+ /* Apply the seek to our segment */ -+ gst_segment_do_seek (&self->segment, rate, format, flags, -+ start_type, start, stop_type, stop, &update); -+ -+ GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT, -+ &self->segment); -+ - /* Convert that seek to a seeking in bytes at position 0, - FIXME: could use an index */ - ret = gst_pad_push_event (self->sinkpad, - gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, - GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, 0)); - -- if (ret) { -- /* Apply the seek to our segment */ -- gst_segment_do_seek (&self->segment, rate, format, flags, -- start_type, start, stop_type, stop, &update); -- -- GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT, -- &self->segment); -- -- self->need_segment = TRUE; -- } else { -+ if (!ret) { - GST_WARNING_OBJECT (self, "seek to 0 bytes failed"); - } - -@@ -1632,8 +1630,10 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) - gst_event_parse_segment (event, &s); - if (s->format == GST_FORMAT_TIME) - gst_event_copy_segment (event, &self->segment); -- GST_DEBUG_OBJECT (self, "newsegment (%s)", -- gst_format_get_name (self->segment.format)); -+ GST_DEBUG_OBJECT (self, "newsegment (%s) %" GST_SEGMENT_FORMAT, -+ gst_format_get_name (self->segment.format), &self->segment); -+ -+ self->need_segment = TRUE; - - /* if not time format, we'll either start with a 0 timestamp anyway or - * it's following a seek in which case we'll have saved the requested --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch deleted file mode 100755 index 096a6f4cb..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 5be6ed00aad028d9cbb4e0c63af0be69d335c71e Mon Sep 17 00:00:00 2001 -From: Song Bing <b06498@freescale.com> -Date: Fri, 11 Dec 2015 21:42:00 +0800 -Subject: [PATCH] convertframe: Support video crop when convert frame - -Get thumbnail will user convertframe to convert video frame to -desired video format and size. But haven't process crop meta on -the video buffer. Add support video crop. - -https://bugzilla.gnome.org/show_bug.cgi?id=759329 - -Upstream-Status: Backport [1.7.1] - ---- - gst-libs/gst/video/convertframe.c | 65 +++++++++++++++++++++++++++++++++------ - 1 file changed, 56 insertions(+), 9 deletions(-) - -diff --git a/gst-libs/gst/video/convertframe.c b/gst-libs/gst/video/convertframe.c -index aa9c3d3..942a51e 100644 ---- a/gst-libs/gst/video/convertframe.c -+++ b/gst-libs/gst/video/convertframe.c -@@ -110,12 +110,23 @@ fail: - static GstElement * - build_convert_frame_pipeline (GstElement ** src_element, - GstElement ** sink_element, const GstCaps * from_caps, -- const GstCaps * to_caps, GError ** err) -+ GstVideoCropMeta * cmeta, const GstCaps * to_caps, GError ** err) - { -- GstElement *src = NULL, *csp = NULL, *vscale = NULL; -- GstElement *sink = NULL, *encoder = NULL, *pipeline; -+ GstElement *vcrop = NULL, *csp = NULL, *csp2 = NULL, *vscale = NULL; -+ GstElement *src = NULL, *sink = NULL, *encoder = NULL, *pipeline; -+ GstVideoInfo info; - GError *error = NULL; - -+ if (cmeta) { -+ if (!create_element ("videocrop", &vcrop, &error)) { -+ g_warning -+ ("build_convert_frame_pipeline: Buffer has crop metadata but videocrop element is not found. Cropping will be disabled"); -+ } else { -+ if (!create_element ("videoconvert", &csp2, &error)) -+ goto no_elements; -+ } -+ } -+ - /* videoscale is here to correct for the pixel-aspect-ratio for us */ - GST_DEBUG ("creating elements"); - if (!create_element ("appsrc", &src, &error) || -@@ -133,15 +144,42 @@ build_convert_frame_pipeline (GstElement ** src_element, - - GST_DEBUG ("adding elements"); - gst_bin_add_many (GST_BIN (pipeline), src, csp, vscale, sink, NULL); -+ if (vcrop) -+ gst_bin_add_many (GST_BIN (pipeline), vcrop, csp2, NULL); - - /* set caps */ - g_object_set (src, "caps", from_caps, NULL); -+ if (vcrop) { -+ gst_video_info_from_caps (&info, from_caps); -+ g_object_set (vcrop, "left", cmeta->x, NULL); -+ g_object_set (vcrop, "top", cmeta->y, NULL); -+ g_object_set (vcrop, "right", GST_VIDEO_INFO_WIDTH (&info) - cmeta->width, -+ NULL); -+ g_object_set (vcrop, "bottom", -+ GST_VIDEO_INFO_HEIGHT (&info) - cmeta->height, NULL); -+ GST_DEBUG ("crop meta [x,y,width,height]: %d %d %d %d", cmeta->x, cmeta->y, -+ cmeta->width, cmeta->height); -+ } - g_object_set (sink, "caps", to_caps, NULL); - - /* FIXME: linking is still way too expensive, profile this properly */ -- GST_DEBUG ("linking src->csp"); -- if (!gst_element_link_pads (src, "src", csp, "sink")) -- goto link_failed; -+ if (vcrop) { -+ GST_DEBUG ("linking src->csp2"); -+ if (!gst_element_link_pads (src, "src", csp2, "sink")) -+ goto link_failed; -+ -+ GST_DEBUG ("linking csp2->vcrop"); -+ if (!gst_element_link_pads (csp2, "src", vcrop, "sink")) -+ goto link_failed; -+ -+ GST_DEBUG ("linking vcrop->csp"); -+ if (!gst_element_link_pads (vcrop, "src", csp, "sink")) -+ goto link_failed; -+ } else { -+ GST_DEBUG ("linking src->csp"); -+ if (!gst_element_link_pads (src, "src", csp, "sink")) -+ goto link_failed; -+ } - - GST_DEBUG ("linking csp->vscale"); - if (!gst_element_link_pads_full (csp, "src", vscale, "sink", -@@ -193,8 +231,12 @@ no_elements: - { - if (src) - gst_object_unref (src); -+ if (vcrop) -+ gst_object_unref (vcrop); - if (csp) - gst_object_unref (csp); -+ if (csp2) -+ gst_object_unref (csp2); - if (vscale) - gst_object_unref (vscale); - if (sink) -@@ -209,7 +251,11 @@ no_elements: - no_pipeline: - { - gst_object_unref (src); -+ if (vcrop) -+ gst_object_unref (vcrop); - gst_object_unref (csp); -+ if (csp2) -+ gst_object_unref (csp2); - gst_object_unref (vscale); - gst_object_unref (sink); - -@@ -282,7 +328,8 @@ gst_video_convert_sample (GstSample * sample, const GstCaps * to_caps, - } - - pipeline = -- build_convert_frame_pipeline (&src, &sink, from_caps, to_caps_copy, &err); -+ build_convert_frame_pipeline (&src, &sink, from_caps, -+ gst_buffer_get_video_crop_meta (buf), to_caps_copy, &err); - if (!pipeline) - goto no_pipeline; - -@@ -646,8 +693,8 @@ gst_video_convert_sample_async (GstSample * sample, - } - - pipeline = -- build_convert_frame_pipeline (&src, &sink, from_caps, to_caps_copy, -- &error); -+ build_convert_frame_pipeline (&src, &sink, from_caps, -+ gst_buffer_get_video_crop_meta (buf), to_caps_copy, &error); - if (!pipeline) - goto no_pipeline; - --- -2.5.0 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch deleted file mode 100644 index 325671721..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 540e02c92c75e08b90326863dc787fa5cadf9da6 Mon Sep 17 00:00:00 2001 -From: Song Bing <b06498@freescale.com> -Date: Fri, 13 Mar 2015 18:04:31 +0800 -Subject: [PATCH] encodebin: Need more buffers in output queue for better - performance - -Need more buffers in output queue for better performance - -Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=744191] - -Signed-off-by: Song Bing <b06498@freescale.com> ---- - gst/encoding/gstencodebin.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c -index 6728e58..32daae4 100644 ---- a/gst/encoding/gstencodebin.c -+++ b/gst/encoding/gstencodebin.c -@@ -1138,8 +1138,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof, - * We only use a 1buffer long queue here, the actual queueing will be done - * in the input queue */ - last = sgroup->outqueue = gst_element_factory_make ("queue", NULL); -- g_object_set (sgroup->outqueue, "max-size-buffers", (guint32) 1, -- "max-size-bytes", (guint32) 0, "max-size-time", (guint64) 0, -+ g_object_set (sgroup->outqueue, "max-size-time", (guint64) 0, - "silent", TRUE, NULL); - - gst_bin_add (GST_BIN (ebin), sgroup->outqueue); --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch deleted file mode 100644 index 284abbe94..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch +++ /dev/null @@ -1,44 +0,0 @@ -From af0dac26f62aaceb4bf266720911953793e0fc5d Mon Sep 17 00:00:00 2001 -From: zhouming <b42586@freescale.com> -Date: Wed, 14 May 2014 10:16:20 +0800 -Subject: [PATCH] ENGR00312515: get caps from src pad when query caps - -https://bugzilla.gnome.org/show_bug.cgi?id=728312 - -Upstream-Status: Pending - -Signed-off-by: zhouming <b42586@freescale.com> ---- - gst-libs/gst/tag/gsttagdemux.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - mode change 100644 => 100755 gst-libs/gst/tag/gsttagdemux.c - -diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c -old mode 100644 -new mode 100755 -index 9b6c478..ae2294a ---- a/gst-libs/gst/tag/gsttagdemux.c -+++ b/gst-libs/gst/tag/gsttagdemux.c -@@ -1708,6 +1708,19 @@ gst_tag_demux_pad_query (GstPad * pad, GstObject * parent, GstQuery * query) - } - break; - } -+ case GST_QUERY_CAPS: -+ { -+ -+ /* We can hijack caps query if we typefind already */ -+ if (demux->priv->src_caps) { -+ gst_query_set_caps_result (query, demux->priv->src_caps); -+ res = TRUE; -+ } else { -+ res = gst_pad_query_default (pad, parent, query); -+ } -+ break; -+ } -+ - default: - res = gst_pad_query_default (pad, parent, query); - break; --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch deleted file mode 100644 index 01e944ddd..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 10d2a977ee1d469f0bf9059bb2d0b55fd2eecbac Mon Sep 17 00:00:00 2001 -From: Andre McCurdy <armccurdy@gmail.com> -Date: Wed, 20 Jan 2016 13:00:00 -0800 -Subject: [PATCH] make gio_unix_2_0 dependency configurable - -Prior to 1.7.1, gst-plugins-base accepted a configure option to -disable gio_unix_2_0, however it was implemented incorrectly using -AG_GST_CHECK_FEATURE. That was fixed in 1.7.1 by making the -dependency unconditional. - - http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=aadefefba88afe4acbe64454650f24e7ce7c8d70 - -To make builds deterministic, re-instate support for ---disable-gio_unix_2_0, but implement it using the AC_ARG_ENABLE -instead of AG_GST_CHECK_FEATURE. - -Upstream-Status: Pending - -Signed-off-by: Andre McCurdy <armccurdy@gmail.com> ---- - configure.ac | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 9c52aeb..26cacd6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -747,9 +747,16 @@ AC_SUBST(FT2_CFLAGS) - AC_SUBST(FT2_LIBS) - - dnl *** gio-unix-2.0 for tests/check/pipelines/tcp.c *** -+AC_ARG_ENABLE([gio_unix_2_0], -+ [AS_HELP_STRING([--disable-gio_unix_2_0],[disable use of gio_unix_2_0])], -+ [], -+ [enable_gio_unix_2_0=yes]) -+ -+if test "x${enable_gio_unix_2_0}" != "xno"; then - PKG_CHECK_MODULES(GIO_UNIX_2_0, gio-unix-2.0 >= 2.24, - HAVE_GIO_UNIX_2_0="yes", - HAVE_GIO_UNIX_2_0="no") -+fi - AM_CONDITIONAL(USE_GIO_UNIX_2_0, test "x$HAVE_GIO_UNIX_2_0" = "xyes") - - dnl *** finalize CFLAGS, LDFLAGS, LIBS --- -1.9.1 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_1.6.3.bb deleted file mode 100644 index 429dc9338..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_1.6.3.bb +++ /dev/null @@ -1,25 +0,0 @@ -include gstreamer1.0-plugins-base.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \ - file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \ - file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607" - -# Note: The dependency on freetype was dropped shortly after the 1.7.1 release -# so these lines should be removed during the update to 1.8.x -# http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=183610c035dd6955c9b3540b940aec50474af031 -DEPENDS += "freetype" -EXTRA_OECONF += "--disable-freetypetest" - -SRC_URI = " \ - http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${PV}.tar.xz \ - file://get-caps-from-src-pad-when-query-caps.patch \ - file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \ - file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \ - file://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \ - file://0005-convertframe-Support-video-crop-when-convert-frame.patch \ -" - -SRC_URI[md5sum] = "3ddde0ad598ef69f58d6a2e87f8b460f" -SRC_URI[sha256sum] = "b6154f8fdba4877e95efd94610ef0ada4f0171cd12eb829a3c3c97345d9c7a75" - -S = "${WORKDIR}/gst-plugins-base-${PV}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_git.bb deleted file mode 100644 index 38a9fcc29..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_git.bb +++ /dev/null @@ -1,27 +0,0 @@ -DEFAULT_PREFERENCE = "-1" - -include gstreamer1.0-plugins-base.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \ - file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \ - file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607" - -SRC_URI = " \ - git://anongit.freedesktop.org/gstreamer/gst-plugins-base;name=base \ - git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \ - file://make-gio_unix_2_0-dependency-configurable.patch \ -" - -PV = "1.7.2+git${SRCPV}" - -UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))" - -SRCREV_base = "97e108bebaa58821f4566a74cbf0135e93407c01" -SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0" -SRCREV_FORMAT = "base" - -S = "${WORKDIR}/git" - -do_configure_prepend() { - ${S}/autogen.sh --noconfigure -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good.inc deleted file mode 100644 index 4621bf894..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good.inc +++ /dev/null @@ -1,53 +0,0 @@ -require gstreamer1.0-plugins.inc - -LICENSE = "GPLv2+ & LGPLv2.1+" - -DEPENDS += "gstreamer1.0-plugins-base libcap zlib bzip2" - -inherit gettext - -PACKAGECONFIG ??= " \ - ${GSTREAMER_ORC} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \ - cairo flac gdk-pixbuf gudev jpeg libpng soup speex taglib v4l2 \ -" - -X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage" - -PACKAGECONFIG[cairo] = "--enable-cairo,--disable-cairo,cairo" -PACKAGECONFIG[dv1394] = "--enable-dv1394,--disable-dv1394,libiec61883 libavc1394 libraw1394" -PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac" -PACKAGECONFIG[gdk-pixbuf] = "--enable-gdk_pixbuf,--disable-gdk_pixbuf,gdk-pixbuf" -PACKAGECONFIG[gudev] = "--with-gudev,--without-gudev,libgudev" -PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack" -PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg" -PACKAGECONFIG[libpng] = "--enable-libpng,--disable-libpng,libpng" -PACKAGECONFIG[libv4l2] = "--with-libv4l2,--without-libv4l2,libv4l2" -PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio" -PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4" -PACKAGECONFIG[speex] = "--enable-speex,--disable-speex,speex" -PACKAGECONFIG[taglib] = "--enable-taglib,--disable-taglib,taglib" -PACKAGECONFIG[v4l2] = "--enable-gst_v4l2,--disable-gst_v4l2" -PACKAGECONFIG[vpx] = "--enable-vpx,--disable-vpx,libvpx" -PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack" -PACKAGECONFIG[x11] = "--enable-x,--disable-x,${X11DEPENDS}" - -EXTRA_OECONF += " \ - --enable-bz2 \ - --enable-oss \ - --enable-zlib \ - --disable-aalib \ - --disable-aalibtest \ - --disable-directsound \ - --disable-libcaca \ - --disable-libdv \ - --disable-oss4 \ - --disable-osx_audio \ - --disable-osx_video \ - --disable-shout2 \ - --disable-sunaudio \ - --disable-waveform \ -" - -FILES_${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch deleted file mode 100755 index d1973d439..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch +++ /dev/null @@ -1,62 +0,0 @@ -From c782a30482908a4b4dd9cd4abff9f9bc4016698f Mon Sep 17 00:00:00 2001 -From: Song Bing <b06498@freescale.com> -Date: Tue, 5 Aug 2014 14:40:46 +0800 -Subject: [PATCH] gstrtpmp4gpay: set dafault value for MPEG4 without codec - data in caps. - -https://bugzilla.gnome.org/show_bug.cgi?id=734263 - -Upstream-Status: Submitted - -Signed-off-by: Song Bing <b06498@freescale.com> ---- - gst/rtp/gstrtpmp4gpay.c | 19 ++++++++++++++++++- - 1 file changed, 18 insertions(+), 1 deletion(-) - -diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c -index 7913d9a..1749d39 100644 ---- a/gst/rtp/gstrtpmp4gpay.c -+++ b/gst/rtp/gstrtpmp4gpay.c -@@ -390,6 +390,7 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps) - const GValue *codec_data; - const gchar *media_type = NULL; - gboolean res; -+ const gchar *name; - - rtpmp4gpay = GST_RTP_MP4G_PAY (payload); - -@@ -400,7 +401,6 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps) - GST_LOG_OBJECT (rtpmp4gpay, "got codec_data"); - if (G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) { - GstBuffer *buffer; -- const gchar *name; - - buffer = gst_value_get_buffer (codec_data); - GST_LOG_OBJECT (rtpmp4gpay, "configuring codec_data"); -@@ -426,6 +426,23 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps) - - rtpmp4gpay->config = gst_buffer_copy (buffer); - } -+ } else { -+ name = gst_structure_get_name (structure); -+ -+ if (!strcmp (name, "video/mpeg")) { -+ rtpmp4gpay->profile = g_strdup ("1"); -+ -+ /* fixed rate */ -+ rtpmp4gpay->rate = 90000; -+ /* video stream type */ -+ rtpmp4gpay->streamtype = "4"; -+ /* no params for video */ -+ rtpmp4gpay->params = NULL; -+ /* mode */ -+ rtpmp4gpay->mode = "generic"; -+ -+ media_type = "video"; -+ } - } - if (media_type == NULL) - goto config_failed; --- -1.7.9.5 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch deleted file mode 100644 index c7f3630ec..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4bfe2c8570a4a7080ec662504882969054d8a072 Mon Sep 17 00:00:00 2001 -From: Andre McCurdy <armccurdy@gmail.com> -Date: Wed, 3 Feb 2016 18:12:38 -0800 -Subject: [PATCH] avoid including <sys/poll.h> directly - -musl libc generates warnings if <sys/poll.h> is included directly. - -Upstream-Status: Pending - -Signed-off-by: Andre McCurdy <armccurdy@gmail.com> ---- - ext/raw1394/gstdv1394src.c | 2 +- - ext/raw1394/gsthdv1394src.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ext/raw1394/gstdv1394src.c b/ext/raw1394/gstdv1394src.c -index dbc7607..3c42b41 100644 ---- a/ext/raw1394/gstdv1394src.c -+++ b/ext/raw1394/gstdv1394src.c -@@ -37,7 +37,7 @@ - #include "config.h" - #endif - #include <unistd.h> --#include <sys/poll.h> -+#include <poll.h> - #include <sys/socket.h> - #include <errno.h> - #include <fcntl.h> -diff --git a/ext/raw1394/gsthdv1394src.c b/ext/raw1394/gsthdv1394src.c -index 0b07a37..9785a15 100644 ---- a/ext/raw1394/gsthdv1394src.c -+++ b/ext/raw1394/gsthdv1394src.c -@@ -36,7 +36,7 @@ - #include "config.h" - #endif - #include <unistd.h> --#include <sys/poll.h> -+#include <poll.h> - #include <sys/socket.h> - #include <errno.h> - #include <fcntl.h> --- -1.9.1 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch deleted file mode 100644 index bc7ac0b6a..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 2169f2205c0205a220d826d7573e5a863bd36e0a Mon Sep 17 00:00:00 2001 -From: Andre McCurdy <armccurdy@gmail.com> -Date: Tue, 9 Feb 2016 14:00:00 -0800 -Subject: [PATCH] ensure valid sentinal for gst_structure_get() - -gst_structure_get() is declared with G_GNUC_NULL_TERMINATED, ie -__attribute__((__sentinel__)), which means gcc will generate a -warning if the last parameter passed to the function is not NULL -(where a valid NULL in this context is defined as zero with any -pointer type). - -The C code callers to gst_structure_get() within gst-plugins-good -use the C NULL definition (ie ((void*)0)), which is a valid sentinel. - -However gstid3v2mux.cc uses the C++ NULL definition (ie 0L), which -is not a valid sentinel without an explicit cast to a pointer type. - -Upstream-Status: Pending - -Signed-off-by: Andre McCurdy <armccurdy@gmail.com> ---- - ext/taglib/gstid3v2mux.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ext/taglib/gstid3v2mux.cc b/ext/taglib/gstid3v2mux.cc -index 8651e77..a87234f 100644 ---- a/ext/taglib/gstid3v2mux.cc -+++ b/ext/taglib/gstid3v2mux.cc -@@ -465,7 +465,7 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list, - - if (info_struct) { - if (gst_structure_get (info_struct, "image-type", -- GST_TYPE_TAG_IMAGE_TYPE, &image_type, NULL)) { -+ GST_TYPE_TAG_IMAGE_TYPE, &image_type, (void *) NULL)) { - if (image_type > 0 && image_type <= 18) { - image_type += 2; - } else { --- -1.9.1 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_1.6.3.bb deleted file mode 100644 index 0b4f43690..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_1.6.3.bb +++ /dev/null @@ -1,15 +0,0 @@ -include gstreamer1.0-plugins-good.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \ - file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe" - -SRC_URI = " \ - http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \ - file://0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch \ -" - -SRC_URI[md5sum] = "a1958df7aa498b42793e2f2048673815" -SRC_URI[sha256sum] = "24b19db70b2a83461ebddfe20033db432dadfdb5d4b54ffb1dfa0d830134a177" - -S = "${WORKDIR}/gst-plugins-good-${PV}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_git.bb deleted file mode 100644 index 9cadc9afc..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_git.bb +++ /dev/null @@ -1,28 +0,0 @@ -DEFAULT_PREFERENCE = "-1" - -include gstreamer1.0-plugins-good.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \ - file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe" - -SRC_URI = " \ - git://anongit.freedesktop.org/gstreamer/gst-plugins-good;name=base \ - git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \ - file://avoid-including-sys-poll.h-directly.patch \ - file://ensure-valid-sentinel-for-gst_structure_get.patch \ -" - -PV = "1.7.2+git${SRCPV}" - -UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))" - -SRCREV_base = "1b6fdce67c15d59957e395b1957aa625322092d4" -SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0" -SRCREV_FORMAT = "base" - -S = "${WORKDIR}/git" - -do_configure_prepend() { - ${S}/autogen.sh --noconfigure -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly.inc deleted file mode 100644 index aff223072..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly.inc +++ /dev/null @@ -1,31 +0,0 @@ -require gstreamer1.0-plugins.inc - -LICENSE = "GPLv2+ & LGPLv2.1+ & LGPLv2+" -LICENSE_FLAGS = "commercial" - -DEPENDS += "gstreamer1.0-plugins-base libid3tag" - -inherit gettext - -PACKAGECONFIG ??= " \ - ${GSTREAMER_ORC} \ - a52dec lame mad mpeg2dec \ -" - -PACKAGECONFIG[a52dec] = "--enable-a52dec,--disable-a52dec,liba52" -PACKAGECONFIG[amrnb] = "--enable-amrnb,--disable-amrnb,opencore-amr" -PACKAGECONFIG[amrwb] = "--enable-amrwb,--disable-amrwb,opencore-amr" -PACKAGECONFIG[cdio] = "--enable-cdio,--disable-cdio,libcdio" -PACKAGECONFIG[dvdread] = "--enable-dvdread,--disable-dvdread,libdvdread" -PACKAGECONFIG[lame] = "--enable-lame,--disable-lame,lame" -PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad" -PACKAGECONFIG[mpeg2dec] = "--enable-mpeg2dec,--disable-mpeg2dec,mpeg2dec" -PACKAGECONFIG[x264] = "--enable-x264,--disable-x264,x264" - -EXTRA_OECONF += " \ - --disable-sidplay \ - --disable-twolame \ -" - -FILES_${PN}-amrnb += "${datadir}/gstreamer-1.0/presets/GstAmrnbEnc.prs" -FILES_${PN}-x264 += "${datadir}/gstreamer-1.0/presets/GstX264Enc.prs" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_1.6.3.bb deleted file mode 100644 index 7edfb81d2..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_1.6.3.bb +++ /dev/null @@ -1,13 +0,0 @@ -include gstreamer1.0-plugins-ugly.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068" - -SRC_URI = " \ - http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \ -" - -SRC_URI[md5sum] = "dbd92afb3816cbfa90ab1f197144a2e2" -SRC_URI[sha256sum] = "2fecf7b7c7882f8f62f1900048f4013f98c214fb3d3303d8d812245bb41fd064" - -S = "${WORKDIR}/gst-plugins-ugly-${PV}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_git.bb deleted file mode 100644 index 69afe4cfb..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_git.bb +++ /dev/null @@ -1,41 +0,0 @@ -DEFAULT_PREFERENCE = "-1" - -include gstreamer1.0-plugins-ugly.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068" - -SRC_URI = " \ - git://anongit.freedesktop.org/gstreamer/gst-plugins-ugly;name=base \ - git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \ -" - -PV = "1.7.2+git${SRCPV}" - -UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))" - -SRCREV_base = "8bdb68edbc605e21314b608e7a39bdbaab7302b8" -SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0" -SRCREV_FORMAT = "base" - -S = "${WORKDIR}/git" - -# The mpg123 plugin was added prior to the 1.7.2 release -# https://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=43bd45ba991ef3247957ca37cdcb52f4b8c0acb1 -PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123" - -do_configure_prepend() { - ${S}/autogen.sh --noconfigure -} - -# In 1.7.2, the mpg123 plugin was moved from -bad to -ugly -# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=08d8aefcdaaf89ecb6dd53ec1e4f95cd42d01664 -# https://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=43bd45ba991ef3247957ca37cdcb52f4b8c0acb1 - -PACKAGESPLITFUNCS_append = " handle_mpg123_rename " - -python handle_mpg123_rename () { - d.setVar('RPROVIDES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123') - d.setVar('RREPLACES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123') - d.setVar('RCONFLICTS_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123') -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins.inc deleted file mode 100644 index 2dcec509d..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins.inc +++ /dev/null @@ -1,40 +0,0 @@ -SUMMARY = "Plugins for the GStreamer multimedia framework 1.x" -HOMEPAGE = "http://gstreamer.freedesktop.org/" -BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer" -SECTION = "multimedia" - -DEPENDS = "gstreamer1.0 glib-2.0-native" - -inherit autotools pkgconfig upstream-version-is-even gobject-introspection - -acpaths = "-I ${S}/common/m4 -I ${S}/m4" - -LIBV = "1.0" -require gst-plugins-package.inc - -# Orc enables runtime JIT compilation of data processing routines from Orc -# bytecode to SIMD instructions for various architectures (currently SSE, MMX, -# MIPS, Altivec and NEON are supported). - -GSTREAMER_ORC ?= "orc" - -PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" -PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc orc-native" -PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind" - -export ORCC = "${STAGING_DIR_NATIVE}${bindir}/orcc" - -EXTRA_OECONF = " \ - --disable-examples \ -" - -SRC_URI_append = " file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch" - -delete_pkg_m4_file() { - # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection - rm "${S}/common/m4/pkg.m4" || true -} - -do_configure[prefuncs] += " delete_pkg_m4_file" - -PACKAGES_DYNAMIC = "^${PN}-.*" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server.inc deleted file mode 100644 index ae6d36477..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server.inc +++ /dev/null @@ -1,24 +0,0 @@ -SUMMARY = "A library on top of GStreamer for building an RTSP server" -HOMEPAGE = "http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/" -SECTION = "multimedia" -LICENSE = "LGPLv2" - -DEPENDS = "gstreamer1.0 libcgroup gstreamer1.0-plugins-base" - -PNREAL = "gst-rtsp-server" - -SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz \ - file://0001-Don-t-hardcode-libtool-name-when-using-introspection.patch \ - file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch" - -S = "${WORKDIR}/${PNREAL}-${PV}" - -inherit autotools pkgconfig upstream-version-is-even gobject-introspection - -delete_pkg_m4_file() { - # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection - rm "${S}/common/m4/pkg.m4" || true -} - -do_configure[prefuncs] += " delete_pkg_m4_file" - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch deleted file mode 100644 index 89d6384ad..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4a12569e5ae5be63cd92a9b178860026a99746b1 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 27 Oct 2015 16:55:45 +0200 -Subject: [PATCH] Don't hardcode libtool name when using introspection - -Upstream-Status: Pending [review on oe-core maillist] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - gst/rtsp-server/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gst/rtsp-server/Makefile.am b/gst/rtsp-server/Makefile.am -index 4fcd366..c67f5ab 100644 ---- a/gst/rtsp-server/Makefile.am -+++ b/gst/rtsp-server/Makefile.am -@@ -87,7 +87,7 @@ GstRtspServer-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtspserver-@ - --include=Gst-@GST_API_VERSION@ \ - --include=GstRtsp-@GST_API_VERSION@ \ - --include=GstNet-@GST_API_VERSION@ \ -- --libtool="$(top_builddir)/libtool" \ -+ --libtool="$(LIBTOOL)" \ - --pkg gstreamer-@GST_API_VERSION@ \ - --pkg gstreamer-rtsp-@GST_API_VERSION@ \ - --pkg gstreamer-net-@GST_API_VERSION@ \ --- -2.1.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server_1.6.2.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server_1.6.2.bb deleted file mode 100644 index 5bdae6cf9..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server_1.6.2.bb +++ /dev/null @@ -1,6 +0,0 @@ -include gstreamer1.0-rtsp-server.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d" - -SRC_URI[md5sum] = "a1cafefb5fc14ac5d7e7d8cdbdfa9694" -SRC_URI[sha256sum] = "0f51f9879556c0950203c766b09a1b62f1f25b17f9a7d516e01b13ecf93c8858" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0.inc deleted file mode 100644 index 10b4668e5..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0.inc +++ /dev/null @@ -1,58 +0,0 @@ -SUMMARY = "GStreamer 1.0 multimedia framework" -DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \ -It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime." -HOMEPAGE = "http://gstreamer.freedesktop.org/" -BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer" -SECTION = "multimedia" -LICENSE = "LGPLv2+" - -DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native" - -inherit autotools pkgconfig gettext upstream-version-is-even gobject-introspection - -# This way common/m4/introspection.m4 will come first -# (it has a custom INTROSPECTION_INIT macro, and so must be used instead of our common introspection.m4 file) -acpaths = "-I ${S}/common/m4 -I ${S}/m4" - -SRC_URI_append = " \ - file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \ -" - -PACKAGECONFIG ??= "" - -PACKAGECONFIG[check] = "--enable-check,--disable-check" -PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" -PACKAGECONFIG[tests] = "--enable-tests,--disable-tests" -PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," - -EXTRA_OECONF = " \ - --disable-dependency-tracking \ - --disable-docbook \ - --disable-examples \ - --disable-gtk-doc \ -" - -CACHED_CONFIGUREVARS += "ac_cv_header_valgrind_valgrind_h=no" - -# musl libc generates warnings if <sys/poll.h> is included directly -CACHED_CONFIGUREVARS += "ac_cv_header_sys_poll_h=no" - -PACKAGES += "${PN}-bash-completion" - -FILES_${PN} += "${libdir}/gstreamer-1.0/*.so" -FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la ${libdir}/gstreamer-1.0/*.a ${libdir}/gstreamer-1.0/include" -FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions/ ${datadir}/bash-completion/helpers/gst*" - -RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi" -RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi" - -delete_pkg_m4_file() { - # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection - rm "${S}/common/m4/pkg.m4" || true -} - -do_configure[prefuncs] += " delete_pkg_m4_file" - -do_compile_prepend() { - export GIR_EXTRA_LIBS_PATH="${B}/gst/.libs:${B}/libs/gst/base/.libs" -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch deleted file mode 100644 index 94f5cc56e..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 6b26f3dbf9bf577d71534ab7410de66d06e46ba2 Mon Sep 17 00:00:00 2001 -From: Carlos Rafael Giani <dv@pseudoterminal.org> -Date: Sat, 6 Apr 2013 23:52:11 +0200 -Subject: [PATCH] Fix crash with gst-inspect Chris Lord <chris@openedhand.com> - -Upstream-Status: Pending - -Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org> ---- - tools/gst-inspect.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c -index 23b7c44..b79b02e 100644 ---- a/tools/gst-inspect.c -+++ b/tools/gst-inspect.c -@@ -1556,7 +1556,7 @@ main (int argc, char *argv[]) - g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE); - g_option_context_add_group (ctx, gst_init_get_option_group ()); - if (!g_option_context_parse (ctx, &argc, &argv, &err)) { -- g_printerr ("Error initializing: %s\n", err->message); -+ g_printerr ("Error initializing: %s\n", err ? err->message : "(null)"); - return -1; - } - g_option_context_free (ctx); --- -1.8.2 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_1.6.3.bb deleted file mode 100644 index ba1b83b08..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_1.6.3.bb +++ /dev/null @@ -1,14 +0,0 @@ -include gstreamer1.0.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \ - file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d" - -SRC_URI = " \ - http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \ - file://0001-Fix-crash-with-gst-inspect.patch \ -" - -SRC_URI[md5sum] = "b4cdeb2b9cb20dd6ac022a4f417eae0d" -SRC_URI[sha256sum] = "22f9568d67b87cf700a111f381144bd37cb93790a77e4e331db01fe854a37f24" - -S = "${WORKDIR}/gstreamer-${PV}" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_git.bb deleted file mode 100644 index 7715bb202..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_git.bb +++ /dev/null @@ -1,30 +0,0 @@ -DEFAULT_PREFERENCE = "-1" - -include gstreamer1.0.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \ - file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d" - -SRC_URI = " \ - git://anongit.freedesktop.org/gstreamer/gstreamer;name=base \ - git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \ -" - -PV = "1.7.2+git${SRCPV}" - -UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))" - -SRCREV_base = "9e33bfa2c7a5f43da2c49b0a8235fd43cba9feaf" -SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0" -SRCREV_FORMAT = "base" - -S = "${WORKDIR}/git" - -# The option to configure tracer hooks was added prior to the 1.7.2 release -# https://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=e5ca47236e4df4683707f0bcf99181a937d358d5 -PACKAGECONFIG[gst-tracer-hooks] = "--enable-gst-tracer-hooks,--disable-gst-tracer-hooks," -PACKAGECONFIG[trace-historic] = "--enable-trace,--disable-trace," - -do_configure_prepend() { - ${S}/autogen.sh --noconfigure -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/python_bp/python-wand_0.4.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/python_bp/python-wand_0.4.3.bb deleted file mode 100644 index cc91892aa..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/python_bp/python-wand_0.4.3.bb +++ /dev/null @@ -1,16 +0,0 @@ -DESCRIPTION = "Magic wand library" -HOMEPAGE = "http://docs.wand-py.org/en/0.4.3/" - -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=170eafd687d4a2b950819cd5e067e6d5" - -SRCNAME = "wand" - -SRC_URI = "git://github.com/dahlia/wand.git;tag=${PV}" -S = "${WORKDIR}/git" - -inherit setuptools - -DEPENDS += " imagemagick-native" - -BBCLASSEXTEND = "native" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend new file mode 100644 index 000000000..86ab018da --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend @@ -0,0 +1,6 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +COMPATIBLE_MACHINE = "(salvator-x|m3ulcb|h3ulcb|ebisu)" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state new file mode 100644 index 000000000..5779dee36 --- /dev/null +++ b/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 1677647 + value.1 1677647 + 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 838870 + value.1 838870 + 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-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend index 47c0fec7b..f4d086938 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend @@ -1,4 +1,9 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI_append = " file://0001-fix-arm-trusted-firmware-build-for-gcc6.patch" +# Boot Normal World in EL2: this define configures ATF (SPSR register) to boot +# BL33 in EL2. +EXTRA_OEMAKE += " RCAR_BL33_EXECUTION_EL=1" +do_ipl_opt_deploy:prepend () { + # Work around bug in BSP recipe, it can fail if nothing else has + # happened to run first and create the directory. + install -d ${DEPLOY_DIR_IMAGE} +} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-fix-arm-trusted-firmware-build-for-gcc6.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-fix-arm-trusted-firmware-build-for-gcc6.patch deleted file mode 100644 index 744f9f5f5..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-fix-arm-trusted-firmware-build-for-gcc6.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 26927f2aff43607b422ce5cb463ee4eccbdaef5a Mon Sep 17 00:00:00 2001 -From: Ronan Le Martret <ronan.lemartret@iot.bzh> -Date: Thu, 23 Feb 2017 14:18:06 +0100 -Subject: [PATCH] Fix arm-trusted-firmware build for gcc6 - -Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh> ---- - include/lib/smcc.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/lib/smcc.h b/include/lib/smcc.h -index c415ba1..e648692 100644 ---- a/include/lib/smcc.h -+++ b/include/lib/smcc.h -@@ -57,7 +57,7 @@ - #define SMC_64 1 - #define SMC_32 0 - #define SMC_UNK 0xffffffff --#define SMC_TYPE_FAST 1 -+#define SMC_TYPE_FAST 1U - #define SMC_TYPE_STD 0 - #define SMC_PREEMPTED 0xfffffffe - /******************************************************************************* --- -2.6.6 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt index 87d362a37..9a8dc560d 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota.txt +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt @@ -4,7 +4,6 @@ bootiaddr=0x5C3F9520 bootargs_console=console=ttySC0,115200 ignore_loglevel bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2 -bootargs_video=vmalloc=384M video=HDMI-A-1:1280x960-32@60 bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384 bootmmc=0:1 @@ -13,7 +12,7 @@ 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 +bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a7795-salvator-xs.dtb -bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_video} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr} +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-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt new file mode 100644 index 000000000..9cc3eb9d2 --- /dev/null +++ b/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} r8a77951-ulcb.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-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt new file mode 100644 index 000000000..7b76e1ef9 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.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} r8a7796-salvator-xs.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-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt new file mode 100644 index 000000000..145f82eae --- /dev/null +++ b/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} r8a77960-ulcb.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-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/m3ulcb-ota-bootfiles.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb index f0e04c06a..d46f4d885 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/m3ulcb-ota-bootfiles.bb +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb @@ -4,18 +4,20 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384 inherit deploy -COMPATIBLE_MACHINE = "m3ulcb" +COMPATIBLE_MACHINE = "(salvator-x|m3ulcb|h3ulcb|ebisu)" S = "${WORKDIR}" -SRC_URI_append_sota = "file://uEnv-ota.txt" - +SRC_URI:append:sota = " file://uEnv-ota-m3ulcb.txt \ + file://uEnv-ota-h3ulcb.txt \ + file://uEnv-ota-h3-salvator-xs \ + file://uEnv-ota-m3-salvator-xs" do_deploy() { install -d ${DEPLOYDIR}/${PN} } -do_deploy_append_sota() { - install -m 0755 ${WORKDIR}/uEnv-ota.txt ${DEPLOYDIR}/${PN}/uEnv.txt +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 diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch new file mode 100644 index 000000000..7627a0660 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch @@ -0,0 +1,29 @@ +From be7079678aeb1503e0f681d977c47c44fd7b4f8c Mon Sep 17 00:00:00 2001 +From: Pierre Marzin <pierre.marzin@iot.bzh> +Date: Mon, 19 Aug 2019 09:33:17 +0000 +Subject: [PATCH] secure_storage: ta: Add a missing include file + +The commit 9890a50d3c26b377dcb27f5db680018e15a5a3de fix a size type by +using a format macro contant 'PRIu32' into a printf. This needs the +inttypes.h header file to build correctly with aarch64-linux-gnu-gcc. + +Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh> +--- + secure_storage/ta/secure_storage_ta.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/secure_storage/ta/secure_storage_ta.c b/secure_storage/ta/secure_storage_ta.c +index 3ccc12d..cfdfbb6 100644 +--- a/secure_storage/ta/secure_storage_ta.c ++++ b/secure_storage/ta/secure_storage_ta.c +@@ -28,6 +28,7 @@ + #include <secure_storage_ta.h> + #include <tee_internal_api.h> + #include <tee_internal_api_extensions.h> ++#include <inttypes.h> + + static TEE_Result delete_object(uint32_t param_types, TEE_Param params[4]) + { +-- +2.11.0 + diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb new file mode 100644 index 000000000..7ff677c80 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb @@ -0,0 +1,61 @@ +SUMMARY = "OP-TEE examples" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30" + + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit python3native + +PV = "3.6.0+git${SRCPV}" + +SRCREV = "292da2fd8db0176e0e96989268c63ef9ab910a6c" + +SRC_URI = " \ + git://github.com/linaro-swg/optee_examples;branch=master;name=master;protocol=https \ + file://0001-secure_storage-ta-Add-a-missing-include-file.patch \ +" + +COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)" +PLATFORM = "rcar" + +DEPENDS = "optee-os optee-client python-pycrypto-native" + +CFLAGS += "-Wno-extra -Wno-error=format" +TARGET_CFLAGS += "-Wno-extra -Wno-error=format" + +TARGET_CC_ARCH += "${LDFLAGS}" +INSANE_SKIP:${PN} = "ldflags" + +TA_DEV_KIT_DIR = "${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64" + +OPTEE_CLIENT_EXPORT = "${STAGING_DIR_TARGET}/usr" + +TEEC_EXPORT = "${STAGING_DIR_TARGET}/usr" + +S = "${WORKDIR}/git" +EXTRA_OEMAKE = "\ + TEEC_EXPORT=${TEEC_EXPORT} \ + OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ + TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ + HOST_CROSS_COMPILE=${TARGET_PREFIX} \ + TA_CROSS_COMPILE=${TARGET_PREFIX} \ + PLATFORM=${PLATFORM} \ + V=1 \ + " + +do_compile() { + oe_runmake +} + +do_install () { + mkdir -p ${D}${nonarch_base_libdir}/optee_armtz + mkdir -p ${D}${bindir} + install -D -p -m0755 ${S}/out/ca/* ${D}${bindir} + install -D -p -m0444 ${S}/out/ta/* ${D}${nonarch_base_libdir}/optee_armtz + mkdir -p ${D}${includedir} + cp ${S}/hello_world/ta/include/* ${D}${includedir} +} + +FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-Remove-the-file-generation-and-directly-copy-the-fil.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-Remove-the-file-generation-and-directly-copy-the-fil.patch deleted file mode 100644 index 14b91699a..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-Remove-the-file-generation-and-directly-copy-the-fil.patch +++ /dev/null @@ -1,41 +0,0 @@ -From f9e26ca66938281a635cdac2fbeda7418488aac8 Mon Sep 17 00:00:00 2001 -From: Ronan Le Martret <ronan.lemartret@iot.bzh> -Date: Thu, 23 Mar 2017 15:20:45 +0100 -Subject: [PATCH] Remove the file generation and directly copy the files. - -Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh> ---- - lib/libutee/tui/sub.mk | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/lib/libutee/tui/sub.mk b/lib/libutee/tui/sub.mk -index 517cde4..d55340c 100644 ---- a/lib/libutee/tui/sub.mk -+++ b/lib/libutee/tui/sub.mk -@@ -11,19 +11,15 @@ produce-additional-default_bold = default_bold.h - produce-default_bold = default_bold.c - depends-default_bold := scripts/render_font.py \ - $(sub-dir)/fonts/amble/Amble-Bold.ttf --recipe-default_bold := scripts/render_font.py \ -- --font_file $(sub-dir)/fonts/amble/Amble-Bold.ttf \ -- --font_size 20 --font_name default_bold \ -- --out_dir $(sub-dir-out) -+recipe-default_bold := cp $(sub-dir)/fonts/amble/default_bold.{c,h} \ -+ $(sub-dir-out) - - gensrcs-y += default_regular - produce-additional-default_regular = default_regular.h - produce-default_regular = default_regular.c - depends-default_regular := scripts/render_font.py \ - $(sub-dir)/fonts/amble/Amble-Regular.ttf --recipe-default_regular := scripts/render_font.py \ -- --font_file $(sub-dir)/fonts/amble/Amble-Regular.ttf \ -- --font_size 20 --font_name default_regular \ -- --out_dir $(sub-dir-out) -+recipe-default_regular := cp $(sub-dir)/fonts/amble/default_regular.{c,h} \ -+ $(sub-dir-out) - - --- -2.6.6 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.c b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.c deleted file mode 100644 index 4fbbadddd..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.c +++ /dev/null @@ -1,1033 +0,0 @@ -/* - * This file is auto generated with - * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Bold.ttf --font_size 20 --font_name default_bold --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui - * do not edit. - */ -#include "font.h" - -static const unsigned char letter_20[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_21[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_22[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x6c, 0x00, - 0x6c, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_23[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0e, 0x60, 0x0e, 0x60, 0x0e, 0xe0, - 0x3f, 0xf8, 0x3f, 0xf8, 0x0c, 0xe0, 0x0c, 0xe0, - 0x1c, 0xc0, 0x7f, 0xf8, 0x7f, 0xf8, 0x1c, 0xc0, - 0x19, 0xc0, 0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_24[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x0f, 0x80, 0x3f, 0xc0, 0x3d, 0xc0, - 0x78, 0x00, 0x78, 0x00, 0x3c, 0x00, 0x1f, 0x00, - 0x0f, 0xc0, 0x01, 0xc0, 0x00, 0xe0, 0x00, 0xe0, - 0x3f, 0xc0, 0x3f, 0x80, 0x0f, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_25[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, - 0x18, 0x00, 0x7e, 0x30, 0x00, 0x66, 0x20, 0x00, - 0x66, 0x60, 0x00, 0x3c, 0xc0, 0x00, 0x01, 0x80, - 0x00, 0x01, 0x80, 0x00, 0x03, 0x3c, 0x00, 0x06, - 0x6c, 0x00, 0x06, 0x66, 0x00, 0x0c, 0x66, 0x00, - 0x18, 0x7c, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_26[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x00, 0x1f, 0xc0, 0x39, 0xc0, - 0x39, 0xc0, 0x1f, 0x80, 0x1f, 0x00, 0x1f, 0x00, - 0x3f, 0x80, 0x73, 0xf0, 0x71, 0xf0, 0x79, 0xf0, - 0x3f, 0xf8, 0x1f, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_27[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_28[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x0c, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x38, 0x00, - 0x38, 0x00, 0x30, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x30, 0x00, - 0x38, 0x00, 0x38, 0x00, 0x18, 0x00, 0x1c, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_29[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, - 0x70, 0x00, 0x30, 0x00, 0x38, 0x00, 0x18, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x18, 0x00, 0x38, 0x00, 0x38, 0x00, 0x30, 0x00, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_2a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x6d, 0x80, - 0x7f, 0x80, 0x0e, 0x00, 0x1f, 0x00, 0x3b, 0x00, - 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_2b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x7f, 0xc0, - 0x7f, 0xc0, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_2c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x30, 0x30, 0x70, 0x60, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_2d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x7e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_2e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_2f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x38, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x60, 0x00, 0x60, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_30[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x00, 0x3f, 0x80, 0x39, 0xc0, - 0x71, 0xc0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x71, 0xc0, 0x39, 0xc0, - 0x3f, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_31[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x00, 0x3f, 0x00, 0x37, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, - 0x3f, 0xc0, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_32[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x7f, 0xc0, 0x33, 0xc0, - 0x01, 0xe0, 0x01, 0xc0, 0x01, 0xc0, 0x07, 0x80, - 0x0f, 0x00, 0x1c, 0x00, 0x38, 0x00, 0x70, 0x00, - 0x7f, 0xe0, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_33[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x00, 0x7f, 0x80, 0x01, 0xc0, - 0x01, 0xc0, 0x01, 0xc0, 0x1f, 0x80, 0x1f, 0x80, - 0x01, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x21, 0xc0, - 0x7f, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_34[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x80, 0x07, 0x80, 0x07, 0x80, - 0x0f, 0x80, 0x1d, 0x80, 0x19, 0x80, 0x39, 0x80, - 0x31, 0x80, 0x73, 0xc0, 0x7f, 0xe0, 0x7f, 0xe0, - 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_35[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0xc0, 0x3f, 0xc0, 0x30, 0x00, - 0x30, 0x00, 0x7f, 0x00, 0x7f, 0xc0, 0x01, 0xc0, - 0x00, 0xe0, 0x00, 0xe0, 0x01, 0xe0, 0x03, 0xc0, - 0x7f, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_36[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x80, 0x1f, 0x80, 0x3c, 0x00, - 0x38, 0x00, 0x77, 0x80, 0x7f, 0xc0, 0x79, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x78, 0xe0, 0x39, 0xc0, - 0x1f, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_37[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xe0, 0x7f, 0xe0, 0x01, 0xc0, - 0x01, 0xc0, 0x01, 0x80, 0x03, 0x80, 0x03, 0x80, - 0x07, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x0e, 0x00, - 0x0c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_38[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x3f, 0xc0, 0x79, 0xc0, - 0x71, 0xc0, 0x39, 0xc0, 0x3f, 0x80, 0x3f, 0x80, - 0x71, 0xc0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0, - 0x3f, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_39[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x3f, 0x80, 0x71, 0xc0, - 0x71, 0xc0, 0x70, 0xe0, 0x71, 0xe0, 0x3f, 0xe0, - 0x1f, 0xe0, 0x01, 0xc0, 0x01, 0xc0, 0x03, 0xc0, - 0x1f, 0x80, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_3b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, - 0x30, 0x70, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_3c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0xc0, 0x0f, 0xc0, 0x3f, 0x00, - 0x78, 0x00, 0x78, 0x00, 0x3f, 0x00, 0x0f, 0xc0, - 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x00, 0x7c, 0x00, 0x1f, 0x80, - 0x07, 0xc0, 0x07, 0xc0, 0x1f, 0x80, 0x7c, 0x00, - 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3e, 0x00, 0x7f, 0x80, 0x43, 0x80, - 0x03, 0x80, 0x03, 0x80, 0x07, 0x00, 0x0e, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_40[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0xf8, 0x00, 0x0f, 0xbc, 0x00, 0x1c, 0x06, 0x00, - 0x18, 0x03, 0x00, 0x31, 0xf1, 0x80, 0x33, 0xf9, - 0x80, 0x63, 0x19, 0x80, 0x66, 0x19, 0x80, 0x66, - 0x31, 0x80, 0x66, 0x31, 0x80, 0x66, 0x31, 0x80, - 0x67, 0xff, 0x00, 0x63, 0x9e, 0x00, 0x30, 0x00, - 0x00, 0x38, 0x00, 0x00, 0x1c, 0x10, 0x00, 0x07, - 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_41[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0x00, 0x07, 0x80, 0x0f, 0x80, - 0x0f, 0x80, 0x1d, 0xc0, 0x1c, 0xc0, 0x18, 0xe0, - 0x38, 0xe0, 0x3f, 0xe0, 0x3f, 0xf0, 0x70, 0x70, - 0x70, 0x70, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_42[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x79, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x7f, 0xc0, 0x7f, 0xc0, - 0x70, 0xe0, 0x70, 0x70, 0x70, 0x70, 0x78, 0xe0, - 0x7f, 0xe0, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_43[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0xc0, 0x1f, 0xc0, 0x3c, 0x00, - 0x38, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x38, 0x00, 0x3c, 0x00, - 0x1f, 0xc0, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_44[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x71, 0xe0, - 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x38, - 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x71, 0xe0, - 0x7f, 0xc0, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_45[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x7f, 0x80, 0x7f, 0x80, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_46[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x7f, 0x80, 0x7f, 0x80, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_47[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0xe0, 0x1f, 0xe0, 0x3c, 0x00, - 0x38, 0x00, 0x70, 0x00, 0x70, 0x00, 0x71, 0xf0, - 0x71, 0xf0, 0x70, 0x30, 0x38, 0x30, 0x3c, 0x70, - 0x1f, 0xf0, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_48[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, - 0x70, 0x38, 0x70, 0x38, 0x7f, 0xf8, 0x7f, 0xf8, - 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, - 0x70, 0x38, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_49[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x00, 0x7e, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x7e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x0f, 0x00, - 0x7e, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0xe0, 0x70, 0xe0, 0x71, 0xc0, - 0x71, 0xc0, 0x73, 0x80, 0x7f, 0x80, 0x7f, 0x80, - 0x73, 0x80, 0x71, 0xc0, 0x71, 0xc0, 0x70, 0xe0, - 0x70, 0xf0, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, - 0x0e, 0x00, 0x7c, 0x1e, 0x00, 0x7c, 0x3e, 0x00, - 0x7e, 0x3e, 0x00, 0x7e, 0x7e, 0x00, 0x77, 0x6e, - 0x00, 0x73, 0xee, 0x00, 0x73, 0xce, 0x00, 0x71, - 0xce, 0x00, 0x70, 0x0e, 0x00, 0x70, 0x0e, 0x00, - 0x70, 0x0e, 0x00, 0x70, 0x0e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x78, 0x38, 0x78, 0x38, 0x7c, 0x38, - 0x7e, 0x38, 0x7e, 0x38, 0x77, 0x38, 0x73, 0xb8, - 0x71, 0xb8, 0x71, 0xf8, 0x70, 0xf8, 0x70, 0xf8, - 0x70, 0x78, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0xc0, 0x1f, 0xe0, 0x3c, 0xf0, - 0x70, 0x78, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, - 0x70, 0x38, 0x70, 0x38, 0x78, 0x78, 0x3c, 0xf0, - 0x1f, 0xe0, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_50[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xe0, 0x70, 0xe0, - 0x70, 0x70, 0x70, 0x70, 0x70, 0xe0, 0x7f, 0xe0, - 0x7f, 0x80, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_51[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0xc0, 0x1f, 0xe0, 0x3c, 0xf0, - 0x70, 0x78, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, - 0x70, 0x38, 0x70, 0x38, 0x78, 0x78, 0x3c, 0xf0, - 0x1f, 0xe0, 0x0f, 0xf0, 0x00, 0x78, 0x00, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_52[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x7f, 0xc0, - 0x7f, 0xc0, 0x71, 0xc0, 0x71, 0xc0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_53[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x3f, 0xc0, 0x79, 0x80, - 0x70, 0x00, 0x70, 0x00, 0x7c, 0x00, 0x1f, 0x00, - 0x07, 0x80, 0x01, 0xc0, 0x01, 0xc0, 0x73, 0xc0, - 0x7f, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_54[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xe0, 0xff, 0xe0, 0x0e, 0x00, - 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, - 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, - 0x0e, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_55[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, - 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, - 0x70, 0x38, 0x70, 0x38, 0x38, 0x70, 0x3c, 0xf0, - 0x1f, 0xe0, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_56[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, - 0x38, 0xe0, 0x38, 0xe0, 0x38, 0xe0, 0x19, 0xc0, - 0x1d, 0xc0, 0x1d, 0xc0, 0x0f, 0x80, 0x0f, 0x80, - 0x0f, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_57[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, - 0xc1, 0xc0, 0x71, 0xe3, 0x80, 0x71, 0xe3, 0x80, - 0x71, 0xe3, 0x80, 0x71, 0xf3, 0x80, 0x33, 0xf3, - 0x00, 0x3b, 0x37, 0x00, 0x3b, 0x37, 0x00, 0x3f, - 0x3f, 0x00, 0x1f, 0x1f, 0x00, 0x1e, 0x1e, 0x00, - 0x1e, 0x1e, 0x00, 0x1e, 0x1e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_58[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0xe0, 0x70, 0xe0, 0x39, 0xc0, - 0x1d, 0xc0, 0x1f, 0x80, 0x0f, 0x00, 0x0f, 0x00, - 0x0f, 0x00, 0x1f, 0x80, 0x3d, 0xc0, 0x39, 0xc0, - 0x70, 0xe0, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_59[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x70, 0x70, 0xe0, 0x38, 0xe0, - 0x39, 0xc0, 0x19, 0xc0, 0x1f, 0x80, 0x0f, 0x80, - 0x0f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x01, 0xc0, - 0x03, 0x80, 0x07, 0x80, 0x07, 0x00, 0x0e, 0x00, - 0x0e, 0x00, 0x1c, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x7f, 0xe0, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5b[] = { - 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x38, 0x38, 0x38, - 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, - 0x38, 0x38, 0x38, 0x3e, 0x3e, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_5c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x0e, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, - 0x7c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x7c, 0x00, - 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x1c, 0x00, 0x1e, 0x00, 0x3e, 0x00, - 0x37, 0x00, 0x33, 0x00, 0x63, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0, - 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_60[] = { - 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_61[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1f, 0x00, 0x3f, 0x80, 0x23, 0xc0, 0x01, 0xc0, - 0x1f, 0xc0, 0x7f, 0xc0, 0x71, 0xc0, 0x71, 0xc0, - 0x7f, 0xc0, 0x3d, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_62[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x7f, 0x80, 0x7f, 0xc0, 0x79, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0, - 0x7f, 0xc0, 0x77, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_63[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x3f, 0x00, 0x78, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x78, 0x00, - 0x3f, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_64[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, - 0x1f, 0xe0, 0x3f, 0xe0, 0x79, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0, - 0x3f, 0xe0, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_65[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1f, 0x00, 0x3f, 0x80, 0x79, 0xc0, 0x71, 0xc0, - 0x7f, 0xc0, 0x7f, 0xc0, 0x70, 0x00, 0x78, 0x00, - 0x3f, 0x80, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_66[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x3f, 0x00, 0x38, 0x00, 0x38, 0x00, - 0xfe, 0x00, 0x7e, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_67[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1f, 0xe0, 0x3f, 0xe0, 0x71, 0xc0, 0x71, 0xc0, - 0x71, 0xc0, 0x3f, 0xc0, 0x3f, 0x00, 0x30, 0x00, - 0x3f, 0x80, 0x3f, 0xc0, 0x70, 0xe0, 0xf0, 0xe0, - 0x7f, 0xe0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_68[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x77, 0x80, 0x7f, 0xc0, 0x79, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_69[] = { - 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, - 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, - 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_6a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, - 0xf8, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x71, 0xc0, 0x73, 0xc0, 0x73, 0x80, 0x77, 0x00, - 0x7f, 0x00, 0x7f, 0x00, 0x73, 0x80, 0x73, 0x80, - 0x71, 0xc0, 0x71, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6c[] = { - 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, - 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, - 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_6d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0xdf, 0x00, 0x7f, 0xff, 0x00, 0x78, 0xe3, - 0x80, 0x70, 0xe3, 0x80, 0x70, 0xe3, 0x80, 0x70, - 0xe3, 0x80, 0x70, 0xe3, 0x80, 0x70, 0xe3, 0x80, - 0x70, 0xe3, 0x80, 0x70, 0xe3, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0x80, 0x7f, 0xc0, 0x78, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x3f, 0xc0, 0x79, 0xc0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xc0, - 0x3f, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_70[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0x80, 0x7f, 0xc0, 0x79, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0, - 0x7f, 0xc0, 0x7f, 0x80, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_71[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1e, 0xe0, 0x3f, 0xe0, 0x79, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0, - 0x3f, 0xe0, 0x1f, 0xe0, 0x00, 0xe0, 0x00, 0xe0, - 0x00, 0xe0, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_72[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0x00, 0x7e, 0x00, 0x78, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_73[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1f, 0x00, 0x7f, 0x00, 0x70, 0x00, 0x70, 0x00, - 0x3e, 0x00, 0x1f, 0x00, 0x07, 0x80, 0x47, 0x80, - 0x7f, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_74[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x00, 0x38, 0x00, 0x38, 0x00, - 0xff, 0x00, 0xfe, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x3f, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_75[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, - 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x39, 0xe0, - 0x3f, 0xe0, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_76[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe1, 0xc0, 0x71, 0xc0, 0x73, 0x80, 0x73, 0x80, - 0x33, 0x00, 0x3b, 0x00, 0x3f, 0x00, 0x1e, 0x00, - 0x1e, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_77[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x63, 0x8c, 0x00, 0x73, 0x9c, 0x00, 0x73, 0x9c, - 0x00, 0x77, 0xdc, 0x00, 0x36, 0xd8, 0x00, 0x36, - 0xd8, 0x00, 0x3e, 0xf8, 0x00, 0x3c, 0x78, 0x00, - 0x1c, 0x70, 0x00, 0x1c, 0x70, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_78[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x71, 0xc0, 0x3b, 0x80, 0x3b, 0x80, 0x1f, 0x00, - 0x0e, 0x00, 0x1e, 0x00, 0x1f, 0x00, 0x3b, 0x80, - 0x73, 0x80, 0x71, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_79[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe1, 0xc0, 0x71, 0xc0, 0x71, 0x80, 0x33, 0x80, - 0x3b, 0x80, 0x3b, 0x00, 0x1f, 0x00, 0x1f, 0x00, - 0x1e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x1c, 0x00, - 0x3c, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_7a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x00, 0x7f, 0x00, 0x0f, 0x00, 0x0e, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x38, 0x00, 0x78, 0x00, - 0x7f, 0x80, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_7b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, - 0x1c, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x38, 0x00, - 0x70, 0x00, 0x70, 0x00, 0x38, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x1c, 0x00, - 0x1e, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_7c[] = { - 0x00, 0x00, 0x00, 0x70, 0x70, 0x70, 0x70, 0x70, - 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, - 0x70, 0x70, 0x70, 0x70, 0x70, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_7d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, - 0x78, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x38, 0x00, 0x38, 0x00, 0x18, 0x00, 0x1c, 0x00, - 0x0e, 0x00, 0x1e, 0x00, 0x1c, 0x00, 0x18, 0x00, - 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, - 0x78, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const struct font_letter letters[] = { - { letter_20, sizeof(letter_20), 7}, - { letter_21, sizeof(letter_21), 6}, - { letter_22, sizeof(letter_22), 9}, - { letter_23, sizeof(letter_23), 15}, - { letter_24, sizeof(letter_24), 13}, - { letter_25, sizeof(letter_25), 17}, - { letter_26, sizeof(letter_26), 16}, - { letter_27, sizeof(letter_27), 6}, - { letter_28, sizeof(letter_28), 9}, - { letter_29, sizeof(letter_29), 9}, - { letter_2a, sizeof(letter_2a), 12}, - { letter_2b, sizeof(letter_2b), 13}, - { letter_2c, sizeof(letter_2c), 7}, - { letter_2d, sizeof(letter_2d), 9}, - { letter_2e, sizeof(letter_2e), 7}, - { letter_2f, sizeof(letter_2f), 11}, - { letter_30, sizeof(letter_30), 13}, - { letter_31, sizeof(letter_31), 12}, - { letter_32, sizeof(letter_32), 13}, - { letter_33, sizeof(letter_33), 13}, - { letter_34, sizeof(letter_34), 14}, - { letter_35, sizeof(letter_35), 13}, - { letter_36, sizeof(letter_36), 13}, - { letter_37, sizeof(letter_37), 13}, - { letter_38, sizeof(letter_38), 13}, - { letter_39, sizeof(letter_39), 13}, - { letter_3a, sizeof(letter_3a), 6}, - { letter_3b, sizeof(letter_3b), 7}, - { letter_3c, sizeof(letter_3c), 12}, - { letter_3d, sizeof(letter_3d), 13}, - { letter_3e, sizeof(letter_3e), 12}, - { letter_3f, sizeof(letter_3f), 12}, - { letter_40, sizeof(letter_40), 20}, - { letter_41, sizeof(letter_41), 16}, - { letter_42, sizeof(letter_42), 14}, - { letter_43, sizeof(letter_43), 13}, - { letter_44, sizeof(letter_44), 15}, - { letter_45, sizeof(letter_45), 13}, - { letter_46, sizeof(letter_46), 12}, - { letter_47, sizeof(letter_47), 15}, - { letter_48, sizeof(letter_48), 15}, - { letter_49, sizeof(letter_49), 10}, - { letter_4a, sizeof(letter_4a), 10}, - { letter_4b, sizeof(letter_4b), 15}, - { letter_4c, sizeof(letter_4c), 12}, - { letter_4d, sizeof(letter_4d), 18}, - { letter_4e, sizeof(letter_4e), 15}, - { letter_4f, sizeof(letter_4f), 16}, - { letter_50, sizeof(letter_50), 14}, - { letter_51, sizeof(letter_51), 16}, - { letter_52, sizeof(letter_52), 15}, - { letter_53, sizeof(letter_53), 13}, - { letter_54, sizeof(letter_54), 14}, - { letter_55, sizeof(letter_55), 15}, - { letter_56, sizeof(letter_56), 16}, - { letter_57, sizeof(letter_57), 21}, - { letter_58, sizeof(letter_58), 15}, - { letter_59, sizeof(letter_59), 15}, - { letter_5a, sizeof(letter_5a), 13}, - { letter_5b, sizeof(letter_5b), 8}, - { letter_5c, sizeof(letter_5c), 12}, - { letter_5d, sizeof(letter_5d), 9}, - { letter_5e, sizeof(letter_5e), 11}, - { letter_5f, sizeof(letter_5f), 13}, - { letter_60, sizeof(letter_60), 8}, - { letter_61, sizeof(letter_61), 12}, - { letter_62, sizeof(letter_62), 14}, - { letter_63, sizeof(letter_63), 11}, - { letter_64, sizeof(letter_64), 13}, - { letter_65, sizeof(letter_65), 13}, - { letter_66, sizeof(letter_66), 11}, - { letter_67, sizeof(letter_67), 15}, - { letter_68, sizeof(letter_68), 13}, - { letter_69, sizeof(letter_69), 6}, - { letter_6a, sizeof(letter_6a), 9}, - { letter_6b, sizeof(letter_6b), 13}, - { letter_6c, sizeof(letter_6c), 6}, - { letter_6d, sizeof(letter_6d), 19}, - { letter_6e, sizeof(letter_6e), 13}, - { letter_6f, sizeof(letter_6f), 14}, - { letter_70, sizeof(letter_70), 14}, - { letter_71, sizeof(letter_71), 13}, - { letter_72, sizeof(letter_72), 10}, - { letter_73, sizeof(letter_73), 11}, - { letter_74, sizeof(letter_74), 11}, - { letter_75, sizeof(letter_75), 13}, - { letter_76, sizeof(letter_76), 14}, - { letter_77, sizeof(letter_77), 18}, - { letter_78, sizeof(letter_78), 14}, - { letter_79, sizeof(letter_79), 14}, - { letter_7a, sizeof(letter_7a), 11}, - { letter_7b, sizeof(letter_7b), 9}, - { letter_7c, sizeof(letter_7c), 6}, - { letter_7d, sizeof(letter_7d), 10}, -}; - -const struct font font_default_bold = { - .first = 0x20, - .last = 0x7d, - .letters = letters, - .height = 26, - .max_width = 22.0, -}; diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.h b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.h deleted file mode 100644 index dbc58301f..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * This file is auto generated with - * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Bold.ttf --font_size 20 --font_name default_bold --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui - * do not edit. - */ -#ifndef __DEFAULT_BOLD_H -#define __DEFAULT_BOLD_H -#include "font.h" -extern const struct font font_default_bold; -#endif /*__DEFAULT_BOLD_H*/ diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.c b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.c deleted file mode 100644 index 96e65cf61..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.c +++ /dev/null @@ -1,1024 +0,0 @@ -/* - * This file is auto generated with - * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Regular.ttf --font_size 20 --font_name default_regular --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui - * do not edit. - */ -#include "font.h" - -static const unsigned char letter_20[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_21[] = { - 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, - 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_22[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x68, 0x48, - 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_23[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0xc0, 0x0c, 0xc0, 0x0c, 0xc0, - 0x3f, 0xf0, 0x1d, 0xc0, 0x0c, 0xc0, 0x0c, 0xc0, - 0x1d, 0xc0, 0x7f, 0xf0, 0x19, 0x80, 0x19, 0x80, - 0x19, 0x80, 0x19, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_24[] = { - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x0f, 0x80, 0x3f, 0xc0, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x38, 0x00, 0x1e, 0x00, 0x07, 0x80, - 0x01, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, - 0x3f, 0x80, 0x1f, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_25[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, - 0x08, 0x00, 0x36, 0x10, 0x00, 0x63, 0x30, 0x00, - 0x22, 0x20, 0x00, 0x3e, 0x40, 0x00, 0x00, 0xc0, - 0x00, 0x01, 0x80, 0x00, 0x01, 0x3c, 0x00, 0x03, - 0x66, 0x00, 0x06, 0x66, 0x00, 0x04, 0x66, 0x00, - 0x0c, 0x76, 0x00, 0x18, 0x3c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_26[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x00, 0x3b, 0x80, 0x31, 0x80, - 0x31, 0x80, 0x1b, 0x00, 0x1e, 0x00, 0x1e, 0x00, - 0x37, 0x00, 0x63, 0xb0, 0x61, 0xe0, 0x60, 0xe0, - 0x3f, 0xe0, 0x1f, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_27[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x40, 0x40, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_28[] = { - 0x00, 0x00, 0x00, 0x08, 0x08, 0x18, 0x30, 0x30, - 0x30, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, - 0x30, 0x30, 0x10, 0x18, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_29[] = { - 0x00, 0x00, 0x00, 0x00, 0x20, 0x30, 0x10, 0x18, - 0x18, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, - 0x18, 0x18, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_2a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x6b, 0x00, - 0x3e, 0x00, 0x1c, 0x00, 0x16, 0x00, 0x32, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_2b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x7f, 0x80, - 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_2c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x30, 0x20, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_2d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x7e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_2e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_2f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x20, 0x00, 0x60, 0x00, 0x60, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_30[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x00, 0x1b, 0x80, 0x30, 0xc0, - 0x60, 0xc0, 0x60, 0xc0, 0x60, 0x60, 0x60, 0x60, - 0x60, 0x60, 0x60, 0xc0, 0x60, 0xc0, 0x30, 0xc0, - 0x3b, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_31[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0e, 0x00, 0x3e, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x07, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_32[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x3b, 0x80, 0x00, 0xc0, - 0x00, 0xc0, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, - 0x0e, 0x00, 0x18, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_33[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x00, 0x33, 0x80, 0x00, 0xc0, - 0x00, 0xc0, 0x01, 0x80, 0x1f, 0x00, 0x03, 0x80, - 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, - 0x77, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_34[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x80, 0x03, 0x80, 0x07, 0x80, - 0x0d, 0x80, 0x0d, 0x80, 0x19, 0x80, 0x31, 0x80, - 0x31, 0x80, 0x61, 0x80, 0x7f, 0xe0, 0x01, 0x80, - 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_35[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0xc0, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x20, 0x00, 0x3f, 0x00, 0x31, 0xc0, - 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, - 0x33, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_36[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0x80, 0x1e, 0x80, 0x30, 0x00, - 0x30, 0x00, 0x6f, 0x80, 0x79, 0xc0, 0x60, 0xc0, - 0x60, 0x60, 0x60, 0x60, 0x30, 0x60, 0x30, 0xc0, - 0x1d, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_37[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x00, 0xc0, 0x00, 0xc0, - 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x03, 0x00, - 0x03, 0x00, 0x06, 0x00, 0x06, 0x00, 0x0c, 0x00, - 0x0c, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_38[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x3b, 0xc0, 0x70, 0xc0, - 0x60, 0xc0, 0x31, 0xc0, 0x1f, 0x80, 0x39, 0xc0, - 0x60, 0xc0, 0x60, 0x60, 0x60, 0x60, 0x60, 0xc0, - 0x3b, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_39[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x3b, 0x80, 0x60, 0xc0, - 0x60, 0xc0, 0x60, 0xc0, 0x60, 0xc0, 0x31, 0xc0, - 0x1f, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0x80, - 0x37, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_3b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x30, 0x20, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_3c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x07, 0x80, 0x1e, 0x00, - 0x78, 0x00, 0x70, 0x00, 0x1e, 0x00, 0x07, 0x80, - 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x00, 0x78, 0x00, 0x1e, 0x00, - 0x03, 0x80, 0x03, 0x80, 0x0f, 0x00, 0x78, 0x00, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_3f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3e, 0x00, 0x77, 0x00, 0x01, 0x80, - 0x01, 0x80, 0x01, 0x80, 0x03, 0x00, 0x0e, 0x00, - 0x0c, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_40[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0xf0, 0x00, 0x06, 0x0c, 0x00, 0x18, 0x06, 0x00, - 0x10, 0x03, 0x00, 0x31, 0xf1, 0x00, 0x23, 0x91, - 0x00, 0x63, 0x11, 0x80, 0x66, 0x11, 0x80, 0x66, - 0x11, 0x80, 0x66, 0x31, 0x80, 0x66, 0x31, 0x00, - 0x67, 0xf3, 0x00, 0x23, 0x9c, 0x00, 0x30, 0x00, - 0x00, 0x18, 0x00, 0x00, 0x0c, 0x10, 0x00, 0x03, - 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_41[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, - 0x0d, 0x80, 0x0c, 0x80, 0x18, 0xc0, 0x18, 0xc0, - 0x18, 0x40, 0x3f, 0xe0, 0x30, 0x60, 0x20, 0x20, - 0x60, 0x30, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_42[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x00, 0x33, 0xc0, 0x30, 0xc0, - 0x30, 0xc0, 0x30, 0xc0, 0x3f, 0x80, 0x30, 0xc0, - 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, - 0x31, 0xc0, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_43[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0xc0, 0x1e, 0xc0, 0x30, 0x00, - 0x30, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, - 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x38, 0x00, - 0x1e, 0xc0, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_44[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x80, 0x33, 0xc0, 0x30, 0x60, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60, - 0x33, 0xc0, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_45[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0xc0, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3f, 0x80, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_46[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x80, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3f, 0x80, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_47[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x07, 0xe0, 0x1e, 0x60, 0x38, 0x00, - 0x30, 0x00, 0x20, 0x00, 0x60, 0x00, 0x61, 0xf0, - 0x60, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x30, - 0x1e, 0x70, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_48[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3f, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_49[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, - 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, - 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, - 0x6e, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x60, 0x30, 0xc0, 0x30, 0xc0, - 0x31, 0x80, 0x33, 0x80, 0x33, 0x00, 0x3e, 0x00, - 0x33, 0x00, 0x31, 0x80, 0x31, 0x80, 0x30, 0xc0, - 0x30, 0x60, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, - 0x0e, 0x00, 0x38, 0x1e, 0x00, 0x3c, 0x1e, 0x00, - 0x3c, 0x36, 0x00, 0x36, 0x36, 0x00, 0x33, 0x66, - 0x00, 0x33, 0xc6, 0x00, 0x31, 0xc6, 0x00, 0x30, - 0x86, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, - 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x10, 0x38, 0x10, 0x38, 0x10, - 0x3c, 0x10, 0x36, 0x10, 0x36, 0x10, 0x33, 0x10, - 0x31, 0x90, 0x31, 0x90, 0x30, 0xf0, 0x30, 0x70, - 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_4f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x80, 0x1c, 0xe0, 0x30, 0x70, - 0x30, 0x30, 0x60, 0x10, 0x60, 0x18, 0x60, 0x18, - 0x60, 0x18, 0x60, 0x10, 0x30, 0x30, 0x30, 0x70, - 0x1d, 0xe0, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_50[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x80, 0x33, 0xc0, 0x30, 0x60, - 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0, - 0x3f, 0x80, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_51[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0f, 0x80, 0x1d, 0xe0, 0x30, 0x60, - 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x10, - 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x30, 0x60, - 0x1d, 0xe0, 0x0f, 0xe0, 0x00, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_52[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x80, 0x33, 0xc0, 0x30, 0x60, - 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0, 0x3f, 0x80, - 0x31, 0x80, 0x31, 0x80, 0x30, 0xc0, 0x30, 0xc0, - 0x30, 0x60, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_53[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x80, 0x3b, 0x80, 0x60, 0x00, - 0x60, 0x00, 0x60, 0x00, 0x38, 0x00, 0x1f, 0x00, - 0x03, 0x80, 0x01, 0xc0, 0x00, 0xc0, 0x00, 0xc0, - 0x73, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_54[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xe0, 0x0e, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_55[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x1d, 0xe0, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_56[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x30, 0x60, 0x30, 0x30, 0x60, - 0x30, 0x60, 0x30, 0x60, 0x18, 0xc0, 0x18, 0xc0, - 0x18, 0x80, 0x0d, 0x80, 0x0d, 0x80, 0x07, 0x00, - 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_57[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, - 0xc1, 0x80, 0x60, 0xc1, 0x80, 0x61, 0xe1, 0x80, - 0x31, 0xe3, 0x00, 0x31, 0xe3, 0x00, 0x31, 0x33, - 0x00, 0x33, 0x33, 0x00, 0x13, 0x32, 0x00, 0x1a, - 0x16, 0x00, 0x1e, 0x1e, 0x00, 0x1e, 0x1e, 0x00, - 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_58[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x30, 0xc0, 0x31, 0x80, - 0x19, 0x80, 0x1b, 0x00, 0x0f, 0x00, 0x0e, 0x00, - 0x0f, 0x00, 0x1b, 0x00, 0x19, 0x80, 0x31, 0x80, - 0x30, 0xc0, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_59[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x60, 0x60, 0xc0, 0x30, 0xc0, - 0x31, 0x80, 0x19, 0x80, 0x1b, 0x00, 0x0f, 0x00, - 0x0e, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xe0, 0x00, 0xc0, 0x01, 0xc0, - 0x01, 0x80, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, - 0x0c, 0x00, 0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5b[] = { - 0x00, 0x00, 0x00, 0x00, 0x1c, 0x18, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x18, 0x1c, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_5c[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x10, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x78, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x36, 0x00, - 0x36, 0x00, 0x63, 0x00, 0x63, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_5f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_60[] = { - 0x00, 0x00, 0x00, 0x00, 0x20, 0x30, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_61[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1f, 0x00, 0x3f, 0x80, 0x01, 0x80, 0x01, 0x80, - 0x1f, 0x80, 0x31, 0x80, 0x61, 0x80, 0x61, 0x80, - 0x73, 0x80, 0x3c, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_62[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x3f, 0x00, 0x3b, 0xc0, 0x30, 0xc0, 0x30, 0xc0, - 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0, 0x30, 0xc0, - 0x3f, 0x80, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_63[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x3d, 0x00, 0x30, 0x00, 0x60, 0x00, - 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, - 0x3d, 0x80, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_64[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, - 0x1e, 0xc0, 0x3b, 0xc0, 0x30, 0xc0, 0x60, 0xc0, - 0x60, 0xc0, 0x60, 0xc0, 0x60, 0xc0, 0x30, 0xc0, - 0x3f, 0xc0, 0x1f, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_65[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x3b, 0x80, 0x30, 0xc0, 0x60, 0xc0, - 0x7f, 0xc0, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, - 0x3d, 0x80, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_66[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0e, 0x00, 0x18, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x7e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_67[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1f, 0xe0, 0x3b, 0xc0, 0x70, 0xc0, 0x60, 0xc0, - 0x31, 0xc0, 0x1f, 0x80, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x3f, 0xc0, 0x60, 0xc0, 0x60, 0x60, - 0x7b, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_68[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x37, 0x80, 0x3d, 0xc0, 0x30, 0xc0, 0x30, 0xc0, - 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, - 0x30, 0xc0, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_69[] = { - 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_6a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x38, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x31, 0x80, 0x31, 0x80, 0x33, 0x00, 0x36, 0x00, - 0x3e, 0x00, 0x36, 0x00, 0x33, 0x00, 0x33, 0x00, - 0x31, 0x80, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6c[] = { - 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_6d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3f, 0x9e, 0x00, 0x38, 0xe3, 0x00, 0x30, 0xc3, - 0x00, 0x30, 0xc3, 0x00, 0x30, 0xc3, 0x00, 0x30, - 0xc3, 0x00, 0x30, 0xc3, 0x00, 0x30, 0xc3, 0x00, - 0x30, 0xc3, 0x00, 0x30, 0xc3, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6e[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x37, 0x80, 0x39, 0xc0, 0x30, 0xc0, 0x30, 0xc0, - 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, - 0x30, 0xc0, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_6f[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x3b, 0x80, 0x30, 0xc0, 0x60, 0xc0, - 0x60, 0x60, 0x60, 0x60, 0x60, 0xc0, 0x30, 0xc0, - 0x3b, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_70[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3f, 0x00, 0x39, 0xc0, 0x30, 0xc0, 0x30, 0x40, - 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0, 0x30, 0xc0, - 0x3f, 0x80, 0x3f, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_71[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1e, 0xc0, 0x3b, 0xc0, 0x30, 0xc0, 0x60, 0xc0, - 0x60, 0xc0, 0x60, 0xc0, 0x60, 0xc0, 0x30, 0xc0, - 0x3f, 0xc0, 0x1e, 0xc0, 0x00, 0xc0, 0x00, 0xc0, - 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_72[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x26, 0x00, 0x3c, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_73[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1f, 0x00, 0x33, 0x00, 0x60, 0x00, 0x60, 0x00, - 0x3c, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x03, 0x00, - 0x77, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_74[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x7e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x3a, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_75[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, - 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, - 0x31, 0xc0, 0x1e, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_76[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x61, 0x80, 0x61, 0x80, 0x61, 0x80, 0x33, 0x00, - 0x33, 0x00, 0x33, 0x00, 0x16, 0x00, 0x1e, 0x00, - 0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_77[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x61, 0x0c, 0x00, 0x63, 0x8c, 0x00, 0x63, 0x8c, - 0x00, 0x23, 0x88, 0x00, 0x26, 0xd8, 0x00, 0x36, - 0xd8, 0x00, 0x34, 0x58, 0x00, 0x1c, 0x70, 0x00, - 0x18, 0x70, 0x00, 0x18, 0x30, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_78[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x61, 0x80, 0x31, 0x80, 0x13, 0x00, 0x1e, 0x00, - 0x0c, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x33, 0x00, - 0x31, 0x80, 0x61, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_79[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x80, 0x61, 0x80, 0x61, 0x80, 0x31, 0x00, - 0x33, 0x00, 0x13, 0x00, 0x1a, 0x00, 0x1e, 0x00, - 0x0e, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, - 0x18, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_7a[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x80, 0x03, 0x80, 0x03, 0x00, 0x06, 0x00, - 0x0c, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x30, 0x00, - 0x70, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_7b[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x10, 0x00, 0x30, 0x00, 0x30, 0x00, - 0x60, 0x00, 0x30, 0x00, 0x30, 0x00, 0x10, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char letter_7c[] = { - 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, - 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, - 0x00, 0x00, -}; - -static const unsigned char letter_7d[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, - 0x30, 0x00, 0x30, 0x00, 0x10, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x0c, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, - 0x18, 0x00, 0x18, 0x00, 0x10, 0x00, 0x30, 0x00, - 0x30, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; - -static const struct font_letter letters[] = { - { letter_20, sizeof(letter_20), 7}, - { letter_21, sizeof(letter_21), 6}, - { letter_22, sizeof(letter_22), 8}, - { letter_23, sizeof(letter_23), 15}, - { letter_24, sizeof(letter_24), 12}, - { letter_25, sizeof(letter_25), 18}, - { letter_26, sizeof(letter_26), 15}, - { letter_27, sizeof(letter_27), 5}, - { letter_28, sizeof(letter_28), 8}, - { letter_29, sizeof(letter_29), 8}, - { letter_2a, sizeof(letter_2a), 11}, - { letter_2b, sizeof(letter_2b), 12}, - { letter_2c, sizeof(letter_2c), 7}, - { letter_2d, sizeof(letter_2d), 9}, - { letter_2e, sizeof(letter_2e), 6}, - { letter_2f, sizeof(letter_2f), 11}, - { letter_30, sizeof(letter_30), 13}, - { letter_31, sizeof(letter_31), 12}, - { letter_32, sizeof(letter_32), 13}, - { letter_33, sizeof(letter_33), 13}, - { letter_34, sizeof(letter_34), 13}, - { letter_35, sizeof(letter_35), 13}, - { letter_36, sizeof(letter_36), 13}, - { letter_37, sizeof(letter_37), 13}, - { letter_38, sizeof(letter_38), 13}, - { letter_39, sizeof(letter_39), 13}, - { letter_3a, sizeof(letter_3a), 6}, - { letter_3b, sizeof(letter_3b), 7}, - { letter_3c, sizeof(letter_3c), 12}, - { letter_3d, sizeof(letter_3d), 13}, - { letter_3e, sizeof(letter_3e), 12}, - { letter_3f, sizeof(letter_3f), 11}, - { letter_40, sizeof(letter_40), 19}, - { letter_41, sizeof(letter_41), 15}, - { letter_42, sizeof(letter_42), 13}, - { letter_43, sizeof(letter_43), 13}, - { letter_44, sizeof(letter_44), 14}, - { letter_45, sizeof(letter_45), 11}, - { letter_46, sizeof(letter_46), 11}, - { letter_47, sizeof(letter_47), 14}, - { letter_48, sizeof(letter_48), 14}, - { letter_49, sizeof(letter_49), 9}, - { letter_4a, sizeof(letter_4a), 10}, - { letter_4b, sizeof(letter_4b), 14}, - { letter_4c, sizeof(letter_4c), 11}, - { letter_4d, sizeof(letter_4d), 17}, - { letter_4e, sizeof(letter_4e), 14}, - { letter_4f, sizeof(letter_4f), 15}, - { letter_50, sizeof(letter_50), 12}, - { letter_51, sizeof(letter_51), 16}, - { letter_52, sizeof(letter_52), 13}, - { letter_53, sizeof(letter_53), 12}, - { letter_54, sizeof(letter_54), 13}, - { letter_55, sizeof(letter_55), 14}, - { letter_56, sizeof(letter_56), 15}, - { letter_57, sizeof(letter_57), 20}, - { letter_58, sizeof(letter_58), 13}, - { letter_59, sizeof(letter_59), 13}, - { letter_5a, sizeof(letter_5a), 14}, - { letter_5b, sizeof(letter_5b), 7}, - { letter_5c, sizeof(letter_5c), 11}, - { letter_5d, sizeof(letter_5d), 9}, - { letter_5e, sizeof(letter_5e), 11}, - { letter_5f, sizeof(letter_5f), 12}, - { letter_60, sizeof(letter_60), 8}, - { letter_61, sizeof(letter_61), 12}, - { letter_62, sizeof(letter_62), 12}, - { letter_63, sizeof(letter_63), 11}, - { letter_64, sizeof(letter_64), 13}, - { letter_65, sizeof(letter_65), 12}, - { letter_66, sizeof(letter_66), 10}, - { letter_67, sizeof(letter_67), 13}, - { letter_68, sizeof(letter_68), 12}, - { letter_69, sizeof(letter_69), 6}, - { letter_6a, sizeof(letter_6a), 9}, - { letter_6b, sizeof(letter_6b), 12}, - { letter_6c, sizeof(letter_6c), 6}, - { letter_6d, sizeof(letter_6d), 18}, - { letter_6e, sizeof(letter_6e), 12}, - { letter_6f, sizeof(letter_6f), 13}, - { letter_70, sizeof(letter_70), 12}, - { letter_71, sizeof(letter_71), 13}, - { letter_72, sizeof(letter_72), 9}, - { letter_73, sizeof(letter_73), 11}, - { letter_74, sizeof(letter_74), 10}, - { letter_75, sizeof(letter_75), 12}, - { letter_76, sizeof(letter_76), 13}, - { letter_77, sizeof(letter_77), 17}, - { letter_78, sizeof(letter_78), 12}, - { letter_79, sizeof(letter_79), 12}, - { letter_7a, sizeof(letter_7a), 12}, - { letter_7b, sizeof(letter_7b), 9}, - { letter_7c, sizeof(letter_7c), 5}, - { letter_7d, sizeof(letter_7d), 9}, -}; - -const struct font font_default_regular = { - .first = 0x20, - .last = 0x7d, - .letters = letters, - .height = 26, - .max_width = 21.0, -}; diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.h b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.h deleted file mode 100644 index 28ae28420..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * This file is auto generated with - * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Regular.ttf --font_size 20 --font_name default_regular --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui - * do not edit. - */ -#ifndef __DEFAULT_REGULAR_H -#define __DEFAULT_REGULAR_H -#include "font.h" -extern const struct font font_default_regular; -#endif /*__DEFAULT_REGULAR_H*/ diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend index 135b2a430..52a68e174 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend @@ -1,23 +1,7 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -inherit pythonnative -DEPENDS += " python-pycrypto-native" - -#Need for gcc 6.2 -CFLAGS += " -fno-strict-aliasing -Wno-unused-variable -Wno-shift-negative-value" - -SRC_URI_append = " \ - file://default_bold.c \ - file://default_bold.h \ - file://default_regular.c \ - file://default_regular.h \ - file://0001-Remove-the-file-generation-and-directly-copy-the-fil.patch \ - " - - -do_compile_prepend() { - GENDIRECTORY=${S}/lib/libutee/tui/fonts/amble/ - cp ${WORKDIR}/default_bold.c ${GENDIRECTORY} - cp ${WORKDIR}/default_bold.h ${GENDIRECTORY} - cp ${WORKDIR}/default_regular.c ${GENDIRECTORY} - cp ${WORKDIR}/default_regular.h ${GENDIRECTORY} +do_install() { + install -d ${D}/usr/share/optee + cp -r ${S}/out/arm-plat-${PLATFORM}/export-ta_arm64 ${D}/usr/share/optee } + +FILES:${PN}-staticdev += "${datadir}/optee/export-ta_arm64/lib/*.a" +FILES:${PN}-dev += "${datadir}/optee/export-ta_arm64" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff new file mode 100644 index 000000000..5067086f1 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff @@ -0,0 +1,13 @@ +diff --git a/host/xtest/regression_6000.c b/host/xtest/regression_6000.c +index 336ea14..2379e43 100644 +--- a/host/xtest/regression_6000.c ++++ b/host/xtest/regression_6000.c +@@ -82,6 +82,8 @@ static uint32_t fs_id_for_tee_storage_private(void) + return TEE_STORAGE_PRIVATE_REE; + #elif defined(CFG_RPMB_FS) + return TEE_STORAGE_PRIVATE_RPMB; ++#else ++ return TEE_STORAGE_PRIVATE; + #endif + } + diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb new file mode 100644 index 000000000..b66f0676e --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb @@ -0,0 +1,55 @@ +DESCRIPTION = "OP-TEE TEST" + +LICENSE = "GPL-2.0-only & BSD-2-Clause" +LIC_FILES_CHKSUM = "file://${S}/host/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit python3native + +PV = "3.1.0+git${SRCPV}" + +SRCREV = "45218eb59b006ad20cc7610904f291dd85157a43" + +SRC_URI = " \ + git://github.com/OP-TEE/optee_test.git;branch=master;name=master;protocol=https \ + file://optee_xtest_fix.diff \ +" + +COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)" +PLATFORM = "rcar" + +DEPENDS = "optee-os optee-client python3-pycrypto-native" + +export CROSS_COMPILE64="${TARGET_PREFIX}" + +# Let the Makefile handle setting up the flags as it is a standalone application +LD[unexport] = "1" +LDFLAGS[unexport] = "1" +export CCcore="${CC}" +export LDcore="${LD}" +libdir[unexport] = "1" + +CFLAGS += "-Wno-extra -Wno-error=stringop-overflow -Wno-error=array-bounds" +TARGET_CFLAGS += "-Wno-extra -Wno-error=stringop-overflow -Wno-error=array-bounds" + +TARGET_CC_ARCH += "${LDFLAGS}" +INSANE_SKIP:${PN} = "ldflags" + +S = "${WORKDIR}/git" +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +do_compile() { + oe_runmake CROSS_COMPILE=${CROSS_COMPILE64} PLATFORM=${PLATFORM} OPTEE_CLIENT_EXPORT=${STAGING_DIR_TARGET}/usr --no-builtin-variables TA_DEV_KIT_DIR="${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64" +} + +do_install () { + install -D -p -m0755 ${S}/out/xtest/xtest ${D}${bindir}/xtest + + # install path should match the value set in optee-client/tee-supplicant + # default TEEC_LOAD_PATH is /lib + mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/ + install -D -p -m0444 ${S}/out/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ +} + +FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb new file mode 100644 index 000000000..2b93af710 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb @@ -0,0 +1,57 @@ +SUMMARY = "OP-TEE user_app_template" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit python3native + +PV = "0.1+git${SRCPV}" + +SRCREV = "0.1" + +SRC_URI = " \ + git://github.com/iotbzh/optee_user_app_template;branch=master;protocol=https \ +" + +COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)" +PLATFORM = "rcar" + +DEPENDS = "optee-os optee-client python-pycrypto-native" + +CFLAGS += "-Wno-extra -Wno-error=format" +TARGET_CFLAGS += "-Wno-extra -Wno-error=format" + +TARGET_CC_ARCH += "${LDFLAGS}" +INSANE_SKIP:${PN} = "ldflags" + +TA_DEV_KIT_DIR = "${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64" + +OPTEE_CLIENT_EXPORT = "${STAGING_DIR_TARGET}/usr" + +TEEC_EXPORT = "${STAGING_DIR_TARGET}/usr" + +S = "${WORKDIR}/git" +EXTRA_OEMAKE = "\ + TEEC_EXPORT=${TEEC_EXPORT} \ + OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ + TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ + HOST_CROSS_COMPILE=${TARGET_PREFIX} \ + TA_CROSS_COMPILE=${TARGET_PREFIX} \ + PLATFORM=${PLATFORM} \ + V=1 \ + " + +do_compile() { + oe_runmake +} + +do_install () { + mkdir -p ${D}${nonarch_base_libdir}/optee_armtz + mkdir -p ${D}${bindir} + install -D -p -m0755 ${S}/out/ca/* ${D}${bindir} + install -D -p -m0444 ${S}/out/ta/* ${D}${nonarch_base_libdir}/optee_armtz +} + +FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot/0001-fixup-build-with-gcc6.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot/0001-fixup-build-with-gcc6.patch deleted file mode 100644 index df1f786c6..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot/0001-fixup-build-with-gcc6.patch +++ /dev/null @@ -1,86 +0,0 @@ -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-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot_2015.04.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot_2015.04.bbappend deleted file mode 100644 index 36d8c24b8..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot_2015.04.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot:" - -SRC_URI_append = " \ - file://0001-fixup-build-with-gcc6.patch \ -" - -do_deploy_prepend() { - ln -s ${B}/${UBOOT_SREC} ${S}/${UBOOT_SREC} -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch deleted file mode 100644 index b1d96ae5a..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch +++ /dev/null @@ -1,37 +0,0 @@ -From af485c638c61fa883212ea424e676fbf90bee594 Mon Sep 17 00:00:00 2001 -From: Otavio Salvador <otavio@ossystems.com.br> -Date: Tue, 1 Jul 2014 17:37:31 -0300 -Subject: [PATCH] build: Allow CC and prefix to be overriden - -Upstream-Status: Pending - -Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> ---- - makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/makefile b/makefile -index 22e7d0d..809cc8f 100644 ---- a/makefile -+++ b/makefile -@@ -18,7 +18,7 @@ - KBUILD_OUTPUT = - - DEBUG = --CC = $(CROSS_COMPILE)gcc -+CC ?= $(CROSS_COMPILE)gcc - VER = -DVER=$(version) - CFLAGS = -Wall $(VER) $(incdefs) $(DEBUG) $(EXTRA_CFLAGS) - LDLIBS = -lm -lrt $(EXTRA_LDFLAGS) -@@ -35,7 +35,7 @@ incdefs := $(shell $(srcdir)/incdefs.sh) - version := $(shell $(srcdir)/version.sh $(srcdir)) - VPATH = $(srcdir) - --prefix = /usr/local -+prefix ?= /usr/local - sbindir = $(prefix)/sbin - mandir = $(prefix)/man - man8dir = $(mandir)/man8 --- -1.7.10.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp_1.4.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp_1.4.bb deleted file mode 100644 index 4ee0c8873..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp_1.4.bb +++ /dev/null @@ -1,20 +0,0 @@ -DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -SRC_URI = "http://sourceforge.net/projects/linuxptp/files/v${PV}/linuxptp-${PV}.tgz \ - file://build-Allow-CC-and-prefix-to-be-overriden.patch" - -SRC_URI[md5sum] = "a37ad2b2ef7d1ebc4d64a66d3fe55cdf" -SRC_URI[sha256sum] = "6cfd5291fb7394cc9f25458927874a203971b66b76d1c9d6568e007d0cbd81f2" - -EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} \ - EXTRA_CFLAGS='-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_ONESTEP_SYNC ${CFLAGS}'" - -do_install () { - install -d ${D}/${bindir} - install -p ${S}/ptp4l ${D}/${bindir} - install -p ${S}/pmc ${D}/${bindir} - install -p ${S}/phc2sys ${D}/${bindir} - install -p ${S}/hwstamp_ctl ${D}/${bindir} -} diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bbappend deleted file mode 100644 index 6d9415d33..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -RDEPENDS_${PN} += "\ - ${@bb.utils.contains('MACHINE_FEATURES','multimedia','packagegroup-multimedia-kernel-modules','',d)} \ - ${@bb.utils.contains('MACHINE_FEATURES','multimedia','packagegroup-multimedia-libs','',d)} \ - ${@bb.utils.contains('MACHINE_FEATURES','multimedia','packagegroup-gstreamer1.0-plugins','',d)} \ -" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc new file mode 120000 index 000000000..8c7e36ff9 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc new file mode 120000 index 000000000..ff4e9a898 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend new file mode 100644 index 000000000..8f2d47adc --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend @@ -0,0 +1,3 @@ +require checksum_control.inc + +RDEPENDS:${PN}:append = " wayland-wsegl" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb new file mode 100644 index 000000000..76d3ea88f --- /dev/null +++ b/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="GPL-2.0-only" + +DEPENDS = "gles-user-module wayland-kms libgbm" + +PROVIDES = "virtual/libgles2 virtual/egl" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/wayland-wsegl.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/wayland-wsegl.bbappend new file mode 100644 index 000000000..9a0eb73a3 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/wayland-wsegl.bbappend @@ -0,0 +1 @@ +DEPENDS:append = " wayland-protocols" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend index e46b10ef7..4a76dda04 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -1,12 +1,15 @@ -WESTONCORE[repaint-window] ??= "34" +FILESEXTRAPATHS:prepend:rcar-gen3 := "${THISDIR}/${PN}:" -WESTONIVISHELL[transition-duration] ??= "300" -WESTONIVISHELL[cursor-theme] ??= "default" +SRC_URI:append:rcar-gen3 = " \ + file://kingfisher_output.cfg \ + file://ebisu_output.cfg \ + file://salvator-x_output.cfg \ +" -WESTONV4L2RENDERER[device] ??= "/dev/media0" -WESTONV4L2RENDERER[device-module] ??= "vsp2" +WESTON_FRAGMENTS:append:ulcb = " kingfisher_output" +WESTON_FRAGMENTS:append:ebisu = " ebisu_output" +WESTON_FRAGMENTS:append:salvator-x = " salvator-x_output" -python() { - if "multimedia" in d.getVar("MACHINE_FEATURES", True).split(" "): - d.setVarFlag("WESTONSECTION", "WESTONV4L2RENDERER", "v4l2-renderer") +do_configure:append:rcar-gen3() { + echo repaint-window=34 >> ${WORKDIR}/core.cfg } diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg new file mode 100644 index 000000000..2bca54f02 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg @@ -0,0 +1,11 @@ +[output] +name=HDMI-A-2 +mode=off + +[output] +name=LVDS-1 +mode=off + +[output] +name=VGA-1 +mode=off diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg new file mode 100644 index 000000000..99fde3063 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg @@ -0,0 +1,7 @@ +[output] +name=HDMI-A-2 +mode=off + +[output] +name=LVDS-1 +mode=off diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg new file mode 100644 index 000000000..7359e6ec9 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg @@ -0,0 +1,12 @@ +[output] +name=HDMI-A-2 +mode=off + +[output] +name=LVDS-1 +mode=off + +[output] +name=VGA-1 +mode=off + diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend deleted file mode 100644 index 079ff496a..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend +++ /dev/null @@ -1,7 +0,0 @@ -FILES_${PN}_append_rcar-gen3 = " \ - ${libexecdir}/weston-screenshooter \ - ${libexecdir}/weston-ivi-shell-user-interface \ - ${libexecdir}/weston-keyboard \ - ${libexecdir}/weston-simple-im \ - ${libexecdir}/weston-desktop-shell \ -" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc new file mode 120000 index 000000000..8c7e36ff9 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc new file mode 120000 index 000000000..ff4e9a898 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend index 8a4176fc1..b8882ae49 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend @@ -1,4 +1,6 @@ -module_do_compile_prepend() { +require checksum_control.inc + +module_do_compile:prepend() { cd ${S}/build/linux/config/compilers - cp aarch64-poky-linux.mk ${TARGET_SYS}.mk + cp aarch64-linux-gnu.mk ${TARGET_SYS}.mk } diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend index 13163e495..98b8e92c3 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend @@ -1 +1,2 @@ -KERNEL_MODULE_AUTOLOAD = "mmngr" +KERNEL_MODULE_AUTOLOAD:append = " mmngr" +KERNEL_MODULE_PACKAGE_SUFFIX = "" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend index 1587b25b6..fbff56fff 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend @@ -1 +1,2 @@ -KERNEL_MODULE_AUTOLOAD = "mmngrbuf" +KERNEL_MODULE_AUTOLOAD:append = " mmngrbuf" +KERNEL_MODULE_PACKAGE_SUFFIX = "" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc new file mode 120000 index 000000000..8c7e36ff9 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc new file mode 120000 index 000000000..ff4e9a898 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend index f1450747e..1fa00a859 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend @@ -1 +1,3 @@ +require checksum_control.inc + KERNEL_MODULE_AUTOLOAD = "uvcs_drv" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspm-if.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspm-if.bbappend new file mode 100644 index 000000000..5efe01045 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspm-if.bbappend @@ -0,0 +1,2 @@ +KERNEL_MODULE_AUTOLOAD:append = " vspm_if" +KERNEL_MODULE_PACKAGE_SUFFIX = "" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend deleted file mode 100644 index 098e1b0a9..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend +++ /dev/null @@ -1 +0,0 @@ -KERNEL_MODULE_AUTOLOAD = "vspm_if" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0001-mm-larger-stack-guard-gap-between-vmas.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0001-mm-larger-stack-guard-gap-between-vmas.patch deleted file mode 100644 index 08a4ec717..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0001-mm-larger-stack-guard-gap-between-vmas.patch +++ /dev/null @@ -1,935 +0,0 @@ -From 0f637a08fa3b048f1e0b0d3dc8f5cb9df3368b5d Mon Sep 17 00:00:00 2001 -From: Hugh Dickins <hughd@google.com> -Date: Mon, 19 Jun 2017 04:03:24 -0700 -Subject: [PATCH 1/3] mm: larger stack guard gap, between vmas - -commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream. - -Stack guard page is a useful feature to reduce a risk of stack smashing -into a different mapping. We have been using a single page gap which -is sufficient to prevent having stack adjacent to a different mapping. -But this seems to be insufficient in the light of the stack usage in -userspace. E.g. glibc uses as large as 64kB alloca() in many commonly -used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX] -which is 256kB or stack strings with MAX_ARG_STRLEN. - -This will become especially dangerous for suid binaries and the default -no limit for the stack size limit because those applications can be -tricked to consume a large portion of the stack and a single glibc call -could jump over the guard page. These attacks are not theoretical, -unfortunatelly. - -Make those attacks less probable by increasing the stack guard gap -to 1MB (on systems with 4k pages; but make it depend on the page size -because systems with larger base pages might cap stack allocations in -the PAGE_SIZE units) which should cover larger alloca() and VLA stack -allocations. It is obviously not a full fix because the problem is -somehow inherent, but it should reduce attack space a lot. - -One could argue that the gap size should be configurable from userspace, -but that can be done later when somebody finds that the new 1MB is wrong -for some special case applications. For now, add a kernel command line -option (stack_guard_gap) to specify the stack gap size (in page units). - -Implementation wise, first delete all the old code for stack guard page: -because although we could get away with accounting one extra page in a -stack vma, accounting a larger gap can break userspace - case in point, -a program run with "ulimit -S -v 20000" failed when the 1MB gap was -counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK -and strict non-overcommit mode. - -Instead of keeping gap inside the stack vma, maintain the stack guard -gap as a gap between vmas: using vm_start_gap() in place of vm_start -(or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few -places which need to respect the gap - mainly arch_get_unmapped_area(), -and and the vma tree's subtree_gap support for that. - -Original-patch-by: Oleg Nesterov <oleg@redhat.com> -Original-patch-by: Michal Hocko <mhocko@suse.com> -Signed-off-by: Hugh Dickins <hughd@google.com> -Acked-by: Michal Hocko <mhocko@suse.com> -Tested-by: Helge Deller <deller@gmx.de> # parisc -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -[wt: backport to 4.11: adjust context] -[wt: backport to 4.9: adjust context ; kernel doc was not in admin-guide] -Signed-off-by: Willy Tarreau <w@1wt.eu> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - Documentation/kernel-parameters.txt | 7 ++ - arch/arc/mm/mmap.c | 2 +- - arch/arm/mm/mmap.c | 4 +- - arch/frv/mm/elf-fdpic.c | 2 +- - arch/mips/mm/mmap.c | 2 +- - arch/parisc/kernel/sys_parisc.c | 15 ++-- - arch/powerpc/mm/hugetlbpage-radix.c | 2 +- - arch/powerpc/mm/mmap.c | 4 +- - arch/powerpc/mm/slice.c | 2 +- - arch/s390/mm/mmap.c | 4 +- - arch/sh/mm/mmap.c | 4 +- - arch/sparc/kernel/sys_sparc_64.c | 4 +- - arch/sparc/mm/hugetlbpage.c | 2 +- - arch/tile/mm/hugetlbpage.c | 2 +- - arch/x86/kernel/sys_x86_64.c | 4 +- - arch/x86/mm/hugetlbpage.c | 2 +- - arch/xtensa/kernel/syscall.c | 2 +- - fs/hugetlbfs/inode.c | 2 +- - fs/proc/task_mmu.c | 4 - - include/linux/mm.h | 53 ++++++------- - mm/gup.c | 5 -- - mm/memory.c | 38 --------- - mm/mmap.c | 149 +++++++++++++++++++++--------------- - 23 files changed, 152 insertions(+), 163 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 38556cd..bf3ecf8 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -3918,6 +3918,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - spia_pedr= - spia_peddr= - -+ stack_guard_gap= [MM] -+ override the default stack gap protection. The value -+ is in page units and it defines how many pages prior -+ to (for stacks growing down) resp. after (for stacks -+ growing up) the main stack are reserved for no other -+ mapping. Default value is 256 pages. -+ - stacktrace [FTRACE] - Enabled the stack tracer on boot up. - -diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c -index 2e06d56..cf4ae69 100644 ---- a/arch/arc/mm/mmap.c -+++ b/arch/arc/mm/mmap.c -@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c -index 66353ca..641334e 100644 ---- a/arch/arm/mm/mmap.c -+++ b/arch/arm/mm/mmap.c -@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c -index 836f147..efa59f1 100644 ---- a/arch/frv/mm/elf-fdpic.c -+++ b/arch/frv/mm/elf-fdpic.c -@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - addr = PAGE_ALIGN(addr); - vma = find_vma(current->mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - goto success; - } - -diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c -index d08ea3f..a44052c 100644 ---- a/arch/mips/mm/mmap.c -+++ b/arch/mips/mm/mmap.c -@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c -index 0a393a0..1d7691f 100644 ---- a/arch/parisc/kernel/sys_parisc.c -+++ b/arch/parisc/kernel/sys_parisc.c -@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - unsigned long task_size = TASK_SIZE; - int do_color_align, last_mmap; - struct vm_unmapped_area_info info; -@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - else - addr = PAGE_ALIGN(addr); - -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - int do_color_align, last_mmap; -@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = COLOR_ALIGN(addr, last_mmap, pgoff); - else - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c -index 35254a6..a2b2d97 100644 ---- a/arch/powerpc/mm/hugetlbpage-radix.c -+++ b/arch/powerpc/mm/hugetlbpage-radix.c -@@ -65,7 +65,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - /* -diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c -index 2f1e443..5bc2845 100644 ---- a/arch/powerpc/mm/mmap.c -+++ b/arch/powerpc/mm/mmap.c -@@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 2b27458..c4d5c9c 100644 ---- a/arch/powerpc/mm/slice.c -+++ b/arch/powerpc/mm/slice.c -@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, - if ((mm->task_size - len) < addr) - return 0; - vma = find_vma(mm, addr); -- return (!vma || (addr + len) <= vma->vm_start); -+ return (!vma || (addr + len) <= vm_start_gap(vma)); - } - - static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice) -diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c -index eb9df28..812368f 100644 ---- a/arch/s390/mm/mmap.c -+++ b/arch/s390/mm/mmap.c -@@ -98,7 +98,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -136,7 +136,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c -index 6777177..7df7d59 100644 ---- a/arch/sh/mm/mmap.c -+++ b/arch/sh/mm/mmap.c -@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c -index fe8b8ee..02e05e2 100644 ---- a/arch/sparc/kernel/sys_sparc_64.c -+++ b/arch/sparc/kernel/sys_sparc_64.c -@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c -index 988acc8..58cde8d 100644 ---- a/arch/sparc/mm/hugetlbpage.c -+++ b/arch/sparc/mm/hugetlbpage.c -@@ -116,7 +116,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, HPAGE_SIZE); - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c -index 77ceaa3..67508b2 100644 ---- a/arch/tile/mm/hugetlbpage.c -+++ b/arch/tile/mm/hugetlbpage.c -@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (current->mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c -index a55ed63..1119414 100644 ---- a/arch/x86/kernel/sys_x86_64.c -+++ b/arch/x86/kernel/sys_x86_64.c -@@ -140,7 +140,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (end - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -183,7 +183,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c -index 2ae8584..fe342e8 100644 ---- a/arch/x86/mm/hugetlbpage.c -+++ b/arch/x86/mm/hugetlbpage.c -@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c -index 83cf496..3aaaae1 100644 ---- a/arch/xtensa/kernel/syscall.c -+++ b/arch/xtensa/kernel/syscall.c -@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - /* At this point: (!vmm || addr < vmm->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; -- if (!vmm || addr + len <= vmm->vm_start) -+ if (!vmm || addr + len <= vm_start_gap(vmm)) - return addr; - addr = vmm->vm_end; - if (flags & MAP_SHARED) -diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c -index 4fb7b10..704fa0b 100644 ---- a/fs/hugetlbfs/inode.c -+++ b/fs/hugetlbfs/inode.c -@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index 35b92d8..c5f2136 100644 ---- a/fs/proc/task_mmu.c -+++ b/fs/proc/task_mmu.c -@@ -299,11 +299,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) - - /* We don't show the stack guard page in /proc/maps */ - start = vma->vm_start; -- if (stack_guard_page_start(vma, start)) -- start += PAGE_SIZE; - end = vma->vm_end; -- if (stack_guard_page_end(vma, end)) -- end -= PAGE_SIZE; - - seq_setwidth(m, 25 + sizeof(void *) * 6 - 1); - seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ", -diff --git a/include/linux/mm.h b/include/linux/mm.h -index a92c8d7..451251b 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -1354,39 +1354,11 @@ int clear_page_dirty_for_io(struct page *page); - - int get_cmdline(struct task_struct *task, char *buffer, int buflen); - --/* Is the vma a continuation of the stack vma above it? */ --static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN); --} -- - static inline bool vma_is_anonymous(struct vm_area_struct *vma) - { - return !vma->vm_ops; - } - --static inline int stack_guard_page_start(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSDOWN) && -- (vma->vm_start == addr) && -- !vma_growsdown(vma->vm_prev, addr); --} -- --/* Is the vma a continuation of the stack vma below it? */ --static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP); --} -- --static inline int stack_guard_page_end(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSUP) && -- (vma->vm_end == addr) && -- !vma_growsup(vma->vm_next, addr); --} -- - int vma_is_stack_for_current(struct vm_area_struct *vma); - - extern unsigned long move_page_tables(struct vm_area_struct *vma, -@@ -2125,6 +2097,7 @@ void page_cache_async_readahead(struct address_space *mapping, - pgoff_t offset, - unsigned long size); - -+extern unsigned long stack_guard_gap; - /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ - extern int expand_stack(struct vm_area_struct *vma, unsigned long address); - -@@ -2153,6 +2126,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m - return vma; - } - -+static inline unsigned long vm_start_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_start = vma->vm_start; -+ -+ if (vma->vm_flags & VM_GROWSDOWN) { -+ vm_start -= stack_guard_gap; -+ if (vm_start > vma->vm_start) -+ vm_start = 0; -+ } -+ return vm_start; -+} -+ -+static inline unsigned long vm_end_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_end = vma->vm_end; -+ -+ if (vma->vm_flags & VM_GROWSUP) { -+ vm_end += stack_guard_gap; -+ if (vm_end < vma->vm_end) -+ vm_end = -PAGE_SIZE; -+ } -+ return vm_end; -+} -+ - static inline unsigned long vma_pages(struct vm_area_struct *vma) - { - return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; -diff --git a/mm/gup.c b/mm/gup.c -index ec4f827..c63a034 100644 ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -370,11 +370,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma, - /* mlock all present pages, but do not fault in new pages */ - if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK) - return -ENOENT; -- /* For mm_populate(), just skip the stack guard page. */ -- if ((*flags & FOLL_POPULATE) && -- (stack_guard_page_start(vma, address) || -- stack_guard_page_end(vma, address + PAGE_SIZE))) -- return -ENOENT; - if (*flags & FOLL_WRITE) - fault_flags |= FAULT_FLAG_WRITE; - if (*flags & FOLL_REMOTE) -diff --git a/mm/memory.c b/mm/memory.c -index e18c57b..2868911 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -2699,40 +2699,6 @@ int do_swap_page(struct fault_env *fe, pte_t orig_pte) - } - - /* -- * This is like a special single-page "expand_{down|up}wards()", -- * except we must first make sure that 'address{-|+}PAGE_SIZE' -- * doesn't hit another vma. -- */ --static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address) --{ -- address &= PAGE_MASK; -- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) { -- struct vm_area_struct *prev = vma->vm_prev; -- -- /* -- * Is there a mapping abutting this one below? -- * -- * That's only ok if it's the same stack mapping -- * that has gotten split.. -- */ -- if (prev && prev->vm_end == address) -- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; -- -- return expand_downwards(vma, address - PAGE_SIZE); -- } -- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { -- struct vm_area_struct *next = vma->vm_next; -- -- /* As VM_GROWSDOWN but s/below/above/ */ -- if (next && next->vm_start == address + PAGE_SIZE) -- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; -- -- return expand_upwards(vma, address + PAGE_SIZE); -- } -- return 0; --} -- --/* - * We enter with non-exclusive mmap_sem (to exclude vma changes, - * but allow concurrent faults), and pte mapped but not yet locked. - * We return with mmap_sem still held, but pte unmapped and unlocked. -@@ -2748,10 +2714,6 @@ static int do_anonymous_page(struct fault_env *fe) - if (vma->vm_flags & VM_SHARED) - return VM_FAULT_SIGBUS; - -- /* Check if we need to add a guard page to the stack */ -- if (check_stack_guard_page(vma, fe->address) < 0) -- return VM_FAULT_SIGSEGV; -- - /* - * Use pte_alloc() instead of pte_alloc_map(). We can't run - * pte_offset_map() on pmds where a huge pmd might be created -diff --git a/mm/mmap.c b/mm/mmap.c -index 1af87c1..26542b3 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -183,6 +183,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - unsigned long retval; - unsigned long newbrk, oldbrk; - struct mm_struct *mm = current->mm; -+ struct vm_area_struct *next; - unsigned long min_brk; - bool populate; - -@@ -228,7 +229,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - } - - /* Check against existing mmap mappings. */ -- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE)) -+ next = find_vma(mm, oldbrk); -+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next)) - goto out; - - /* Ok, looks good - let it rip. */ -@@ -251,10 +253,22 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - - static long vma_compute_subtree_gap(struct vm_area_struct *vma) - { -- unsigned long max, subtree_gap; -- max = vma->vm_start; -- if (vma->vm_prev) -- max -= vma->vm_prev->vm_end; -+ unsigned long max, prev_end, subtree_gap; -+ -+ /* -+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we -+ * allow two stack_guard_gaps between them here, and when choosing -+ * an unmapped area; whereas when expanding we only require one. -+ * That's a little inconsistent, but keeps the code here simpler. -+ */ -+ max = vm_start_gap(vma); -+ if (vma->vm_prev) { -+ prev_end = vm_end_gap(vma->vm_prev); -+ if (max > prev_end) -+ max -= prev_end; -+ else -+ max = 0; -+ } - if (vma->vm_rb.rb_left) { - subtree_gap = rb_entry(vma->vm_rb.rb_left, - struct vm_area_struct, vm_rb)->rb_subtree_gap; -@@ -350,7 +364,7 @@ static void validate_mm(struct mm_struct *mm) - anon_vma_unlock_read(anon_vma); - } - -- highest_address = vma->vm_end; -+ highest_address = vm_end_gap(vma); - vma = vma->vm_next; - i++; - } -@@ -539,7 +553,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = vma->vm_end; -+ mm->highest_vm_end = vm_end_gap(vma); - - /* - * vma->vm_prev wasn't known when we followed the rbtree to find the -@@ -854,7 +868,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, - vma_gap_update(vma); - if (end_changed) { - if (!next) -- mm->highest_vm_end = end; -+ mm->highest_vm_end = vm_end_gap(vma); - else if (!adjust_next) - vma_gap_update(next); - } -@@ -939,7 +953,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, - * mm->highest_vm_end doesn't need any update - * in remove_next == 1 case. - */ -- VM_WARN_ON(mm->highest_vm_end != end); -+ VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma)); - } - } - if (insert && file) -@@ -1783,7 +1797,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit left subtree if it looks promising */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end >= low_limit && vma->vm_rb.rb_left) { - struct vm_area_struct *left = - rb_entry(vma->vm_rb.rb_left, -@@ -1794,7 +1808,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - } - } - -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - check_current: - /* Check if current node has a suitable gap */ - if (gap_start > high_limit) -@@ -1821,8 +1835,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - vma = rb_entry(rb_parent(prev), - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_left) { -- gap_start = vma->vm_prev->vm_end; -- gap_end = vma->vm_start; -+ gap_start = vm_end_gap(vma->vm_prev); -+ gap_end = vm_start_gap(vma); - goto check_current; - } - } -@@ -1886,7 +1900,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit right subtree if it looks promising */ -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - if (gap_start <= high_limit && vma->vm_rb.rb_right) { - struct vm_area_struct *right = - rb_entry(vma->vm_rb.rb_right, -@@ -1899,7 +1913,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - check_current: - /* Check if current node has a suitable gap */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end < low_limit) - return -ENOMEM; - if (gap_start <= high_limit && gap_end - gap_start >= length) -@@ -1925,7 +1939,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_right) { - gap_start = vma->vm_prev ? -- vma->vm_prev->vm_end : 0; -+ vm_end_gap(vma->vm_prev) : 0; - goto check_current; - } - } -@@ -1963,7 +1977,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct vm_unmapped_area_info info; - - if (len > TASK_SIZE - mmap_min_addr) -@@ -1974,9 +1988,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -1999,7 +2014,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - struct vm_unmapped_area_info info; -@@ -2014,9 +2029,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - /* requesting a specific address */ - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -2151,21 +2167,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr, - * update accounting. This is shared with both the - * grow-up and grow-down cases. - */ --static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow) -+static int acct_stack_growth(struct vm_area_struct *vma, -+ unsigned long size, unsigned long grow) - { - struct mm_struct *mm = vma->vm_mm; - struct rlimit *rlim = current->signal->rlim; -- unsigned long new_start, actual_size; -+ unsigned long new_start; - - /* address space limit tests */ - if (!may_expand_vm(mm, vma->vm_flags, grow)) - return -ENOMEM; - - /* Stack limit test */ -- actual_size = size; -- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN))) -- actual_size -= PAGE_SIZE; -- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) -+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) - return -ENOMEM; - - /* mlock limit tests */ -@@ -2203,17 +2217,30 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns - int expand_upwards(struct vm_area_struct *vma, unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *next; -+ unsigned long gap_addr; - int error = 0; - - if (!(vma->vm_flags & VM_GROWSUP)) - return -EFAULT; - - /* Guard against wrapping around to address 0. */ -- if (address < PAGE_ALIGN(address+4)) -- address = PAGE_ALIGN(address+4); -- else -+ address &= PAGE_MASK; -+ address += PAGE_SIZE; -+ if (!address) - return -ENOMEM; - -+ /* Enforce stack_guard_gap */ -+ gap_addr = address + stack_guard_gap; -+ if (gap_addr < address) -+ return -ENOMEM; -+ next = vma->vm_next; -+ if (next && next->vm_start < gap_addr) { -+ if (!(next->vm_flags & VM_GROWSUP)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } -+ - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) - return -ENOMEM; -@@ -2257,7 +2284,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = address; -+ mm->highest_vm_end = vm_end_gap(vma); - spin_unlock(&mm->page_table_lock); - - perf_event_mmap(vma); -@@ -2278,6 +2305,8 @@ int expand_downwards(struct vm_area_struct *vma, - unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *prev; -+ unsigned long gap_addr; - int error; - - address &= PAGE_MASK; -@@ -2285,6 +2314,17 @@ int expand_downwards(struct vm_area_struct *vma, - if (error) - return error; - -+ /* Enforce stack_guard_gap */ -+ gap_addr = address - stack_guard_gap; -+ if (gap_addr > address) -+ return -ENOMEM; -+ prev = vma->vm_prev; -+ if (prev && prev->vm_end > gap_addr) { -+ if (!(prev->vm_flags & VM_GROWSDOWN)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } -+ - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) - return -ENOMEM; -@@ -2339,28 +2379,25 @@ int expand_downwards(struct vm_area_struct *vma, - return error; - } - --/* -- * Note how expand_stack() refuses to expand the stack all the way to -- * abut the next virtual mapping, *unless* that mapping itself is also -- * a stack mapping. We want to leave room for a guard page, after all -- * (the guard page itself is not added here, that is done by the -- * actual page faulting logic) -- * -- * This matches the behavior of the guard page logic (see mm/memory.c: -- * check_stack_guard_page()), which only allows the guard page to be -- * removed under these circumstances. -- */ -+/* enforced gap between the expanding stack and other mappings. */ -+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT; -+ -+static int __init cmdline_parse_stack_guard_gap(char *p) -+{ -+ unsigned long val; -+ char *endptr; -+ -+ val = simple_strtoul(p, &endptr, 10); -+ if (!*endptr) -+ stack_guard_gap = val << PAGE_SHIFT; -+ -+ return 0; -+} -+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap); -+ - #ifdef CONFIG_STACK_GROWSUP - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *next; -- -- address &= PAGE_MASK; -- next = vma->vm_next; -- if (next && next->vm_start == address + PAGE_SIZE) { -- if (!(next->vm_flags & VM_GROWSUP)) -- return -ENOMEM; -- } - return expand_upwards(vma, address); - } - -@@ -2382,14 +2419,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) - #else - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *prev; -- -- address &= PAGE_MASK; -- prev = vma->vm_prev; -- if (prev && prev->vm_end == address) { -- if (!(prev->vm_flags & VM_GROWSDOWN)) -- return -ENOMEM; -- } - return expand_downwards(vma, address); - } - -@@ -2487,7 +2516,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, - vma->vm_prev = prev; - vma_gap_update(vma); - } else -- mm->highest_vm_end = prev ? prev->vm_end : 0; -+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0; - tail_vma->vm_next = NULL; - - /* Kill the cache */ --- -2.1.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0002-Allow-stack-to-grow-up-to-address-space-limit.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0002-Allow-stack-to-grow-up-to-address-space-limit.patch deleted file mode 100644 index 10e247197..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0002-Allow-stack-to-grow-up-to-address-space-limit.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 9e8b9c4bd3b16bd70d8be10c465bd0a91ac569fa Mon Sep 17 00:00:00 2001 -From: Helge Deller <deller@gmx.de> -Date: Mon, 19 Jun 2017 17:34:05 +0200 -Subject: [PATCH 2/3] Allow stack to grow up to address space limit - -commit bd726c90b6b8ce87602208701b208a208e6d5600 upstream. - -Fix expand_upwards() on architectures with an upward-growing stack (parisc, -metag and partly IA-64) to allow the stack to reliably grow exactly up to -the address space limit given by TASK_SIZE. - -Signed-off-by: Helge Deller <deller@gmx.de> -Acked-by: Hugh Dickins <hughd@google.com> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - mm/mmap.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/mm/mmap.c b/mm/mmap.c -index 26542b3..d71a61e 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -2224,16 +2224,19 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (!(vma->vm_flags & VM_GROWSUP)) - return -EFAULT; - -- /* Guard against wrapping around to address 0. */ -+ /* Guard against exceeding limits of the address space. */ - address &= PAGE_MASK; -- address += PAGE_SIZE; -- if (!address) -+ if (address >= TASK_SIZE) - return -ENOMEM; -+ address += PAGE_SIZE; - - /* Enforce stack_guard_gap */ - gap_addr = address + stack_guard_gap; -- if (gap_addr < address) -- return -ENOMEM; -+ -+ /* Guard against overflow */ -+ if (gap_addr < address || gap_addr > TASK_SIZE) -+ gap_addr = TASK_SIZE; -+ - next = vma->vm_next; - if (next && next->vm_start < gap_addr) { - if (!(next->vm_flags & VM_GROWSUP)) --- -2.1.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch deleted file mode 100644 index cb6614964..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 6c98443e18289db3ff9afb68575a607cea468ae0 Mon Sep 17 00:00:00 2001 -From: Hugh Dickins <hughd@google.com> -Date: Tue, 20 Jun 2017 02:10:44 -0700 -Subject: [PATCH 3/3] mm: fix new crash in unmapped_area_topdown() - -commit f4cb767d76cf7ee72f97dd76f6cfa6c76a5edc89 upstream. - -Trinity gets kernel BUG at mm/mmap.c:1963! in about 3 minutes of -mmap testing. That's the VM_BUG_ON(gap_end < gap_start) at the -end of unmapped_area_topdown(). Linus points out how MAP_FIXED -(which does not have to respect our stack guard gap intentions) -could result in gap_end below gap_start there. Fix that, and -the similar case in its alternative, unmapped_area(). - -Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas") -Reported-by: Dave Jones <davej@codemonkey.org.uk> -Debugged-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Hugh Dickins <hughd@google.com> -Acked-by: Michal Hocko <mhocko@suse.com> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - mm/mmap.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/mm/mmap.c b/mm/mmap.c -index d71a61e..145d3d5 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -1813,7 +1813,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - /* Check if current node has a suitable gap */ - if (gap_start > high_limit) - return -ENOMEM; -- if (gap_end >= low_limit && gap_end - gap_start >= length) -+ if (gap_end >= low_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit right subtree if it looks promising */ -@@ -1916,7 +1917,8 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - gap_end = vm_start_gap(vma); - if (gap_end < low_limit) - return -ENOMEM; -- if (gap_start <= high_limit && gap_end - gap_start >= length) -+ if (gap_start <= high_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit left subtree if it looks promising */ --- -2.1.4 - diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch new file mode 100644 index 000000000..9c7f01b26 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch @@ -0,0 +1,158 @@ +From 274657edb779d77ad0fe5ccb52b51634d075adf8 Mon Sep 17 00:00:00 2001 +From: invalid_git config <unknown@unknown> +Date: Wed, 6 Oct 2021 14:42:47 +0000 +Subject: [PATCH 2/2] 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> +--- + arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts | 45 ++++++++++++++++++- + arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts | 45 ++++++++++++++++++- + 2 files changed, 88 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts b/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts +index fbc8c9af6e52..df3bd589d9bb 100644 +--- a/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts ++++ b/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts +@@ -62,11 +62,18 @@ lossy_decompress: linux,lossy_decompress@54000000 { + 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; + }; + +@@ -126,6 +133,42 @@ &du { + "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/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts b/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts +index e57dd7bb43f7..f583cc6c18bf 100644 +--- a/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts ++++ b/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts +@@ -41,11 +41,18 @@ lossy_decompress: linux,lossy_decompress@54000000 { + 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; + }; + +@@ -89,6 +96,42 @@ &du { + "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"; + }; +-- +2.31.1 + diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch deleted file mode 100644 index a1eeac3d7..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch +++ /dev/null @@ -1,49 +0,0 @@ -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-bsp/meta-rcar-gen3/recipes-kernel/linux/files/Set_GOV_PERFORMANCE.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/Set_GOV_PERFORMANCE.cfg new file mode 100644 index 000000000..b020174e8 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/Set_GOV_PERFORMANCE.cfg @@ -0,0 +1,2 @@ +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/bluetooth.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/bluetooth.cfg deleted file mode 100644 index dd7c460bb..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/bluetooth.cfg +++ /dev/null @@ -1,37 +0,0 @@ -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-bsp/meta-rcar-gen3/recipes-kernel/linux/files/disable_ipv6.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/disable_ipv6.cfg deleted file mode 100644 index bc5299acd..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/disable_ipv6.cfg +++ /dev/null @@ -1,4 +0,0 @@ -# CONFIG_NET_IP_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_IPV6 is not set -# CONFIG_DST_CACHE is not set diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/nbd.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/nbd.cfg deleted file mode 100644 index af37685e4..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/nbd.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BLK_DEV_NBD=y diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a77960-ulcb-xen.dts b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a77960-ulcb-xen.dts new file mode 100644 index 000000000..6947a62c2 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a77960-ulcb-xen.dts @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree Source for the M3ULCB (R-Car Starter Kit Pro) board + * + * Copyright (C) 2016-2018 Renesas Electronics Corp. + * Copyright (C) 2016 Cogent Embedded, Inc. + */ + +/dts-v1/; +#include "r8a77960.dtsi" +#include "ulcb.dtsi" + +/ { + model = "Renesas M3ULCB board based on r8a7796"; + compatible = "renesas,m3ulcb", "renesas,r8a7796"; + + + chosen { + /delete-property/ bootargs; + xen,xen-bootargs = "dom0_mem=752M console=dtuart dtuart=serial0 dom0_max_vcpus=4"; + xen,dom0-bootargs = "console=hvc0 clk_ignore_unused root=/dev/mmcblk1p2 rw rootwait ignore_loglevel cma=32M earlyprintk"; + + #address-cells = <2>; + #size-cells = <2>; + modules { + module@0 { + compatible = "xen,linux-zimage", + "xen,multiboot-module"; + reg = <0x0 0x7a000000 0x0 0x02000000>; + }; + }; + }; + + cpus { + idle-states { + /delete-node/ cpu-sleep-1; + }; + }; + + memory@48000000 { + device_type = "memory"; + /* first 128MB is reserved for secure area. */ + reg = <0x0 0x48000000 0x0 0x38000000>, <0x6 0x00000000 0x0 0x40000000>; + }; + + vspm_if { + compatible = "renesas,vspm_if"; + }; + + versaclock5_out3: versaclk-3 { + compatible = "fixed-clock"; + #clock-cells = <0>; + /* Initial value of versaclock out3 */ + clock-frequency = <33000000>; + }; +}; + +&a53_0 { + /delete-property/ cpu-idle-states; +}; + +&a53_1 { + /delete-property/ cpu-idle-states; +}; + +&a53_2 { + /delete-property/ cpu-idle-states; +}; + +&a53_3 { + /delete-property/ cpu-idle-states; +}; + +&du { + clocks = <&cpg CPG_MOD 724>, + <&cpg CPG_MOD 723>, + <&cpg CPG_MOD 722>, + <&versaclock5 1>, + <&versaclock5_out3>, + <&versaclock5 2>; + clock-names = "du.0", "du.1", "du.2", + "dclkin.0", "dclkin.1", "dclkin.2"; +}; + +&vspb { + status = "okay"; +}; + +&vspi0 { + status = "okay"; +}; diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/ramdisk.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/ramdisk.cfg deleted file mode 100644 index 41530dd6e..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/ramdisk.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BLK_DEV_RAM=y diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/vivid.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/vivid.cfg new file mode 100644 index 000000000..3c3574346 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/vivid.cfg @@ -0,0 +1,6 @@ +CONFIG_V4L_TEST_DRIVERS=y +CONFIG_MEDIA_CONTROLLER_REQUEST_API=y +CONFIG_MEDIA_TEST_SUPPORT=y +CONFIG_VIDEO_V4L2_TPG=m +CONFIG_VIDEO_VIVID=m +CONFIG_VIDEO_VIVID_MAX_DEVS=64 diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg new file mode 100644 index 000000000..c9fc6d756 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg @@ -0,0 +1 @@ +CONFIG_XEN_BLKDEV_BACKEND=y diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend index 44f802218..78996bf0a 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend @@ -1,8 +1,24 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI_append = " file://namespace_fix.cfg \ - file://nbd.cfg \ - file://ramdisk.cfg \ - file://bluetooth.cfg \ - file://disable_ipv6.cfg \ - " +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +require recipes-kernel/linux/linux-yocto-agl.inc + +# Add ADSP patch to enable and add sound hardware abstraction +SRC_URI:append = " \ + file://0004-ADSP-enable-and-add-sound-hardware-abstraction.patch \ +" + +AGL_KCONFIG_FRAGMENTS += "namespace_fix.cfg" +AGL_KCONFIG_FRAGMENTS += "Set_GOV_PERFORMANCE.cfg" +AGL_KCONFIG_FRAGMENTS += "vivid.cfg" + +# For Xen +AGL_KCONFIG_FRAGMENTS += " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','xen-be.cfg','',d)} \ +" + +SRC_URI:append:m3ulcb = " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','file://r8a77960-ulcb-xen.dts;subdir=git/arch/${ARCH}/boot/dts/renesas','',d)} \ +" +KERNEL_DEVICETREE:append:m3ulcb = " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','renesas/r8a77960-ulcb-xen.dtb','',d)} \ +" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.9.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.9.bbappend deleted file mode 100644 index 634a91233..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.9.bbappend +++ /dev/null @@ -1,18 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" - - -#------------------------------------------------------------------------- -# Fix for CVE-2017-1000364 by backporting the upstream patches. - -SRC_URI_append = "\ - file://0001-mm-larger-stack-guard-gap-between-vmas.patch \ - file://0002-Allow-stack-to-grow-up-to-address-space-limit.patch \ - file://0003-mm-fix-new-crash-in-unmapped_area_topdown.patch \ -" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.%.bbappend new file mode 100644 index 000000000..eee123cf4 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.%.bbappend @@ -0,0 +1,5 @@ +# Enable here for now due to meta-rcar-gen3 bbappends being masked +# out, can be removed once gstreamer 1.22.x is properly supported +# there. +EXTRA_OECONF += "--enable-kms" +PACKAGECONFIG:append = " kms" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngr-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngr-user-module.bbappend new file mode 100644 index 000000000..9d3f5c670 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngr-user-module.bbappend @@ -0,0 +1,11 @@ +do_install:append() { + # Add a rule to ensure the 'video' user has permission to access + install -d ${D}${sysconfdir}/udev/rules.d + cat >${D}${sysconfdir}/udev/rules.d/56-rgnmm.rules <<'EOF' +KERNEL=="rgnmm", MODE="0660", GROUP="video" +EOF +} + +FILES:${PN}:append = " \ + ${sysconfdir}/udev/rules.d/*.rules \ +" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngrbuf-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngrbuf-user-module.bbappend new file mode 100644 index 000000000..640e52651 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngrbuf-user-module.bbappend @@ -0,0 +1,11 @@ +do_install:append() { + # Add a rule to ensure the 'video' group has permission to access + install -d ${D}${sysconfdir}/udev/rules.d + cat >${D}${sysconfdir}/udev/rules.d/56-rgnmmbuf.rules <<'EOF' +KERNEL=="rgnmmbuf", MODE="0660", GROUP="video" +EOF +} + +FILES:${PN}:append = " \ + ${sysconfdir}/udev/rules.d/*.rules \ +" diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc new file mode 120000 index 000000000..8c7e36ff9 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc new file mode 120000 index 000000000..ff4e9a898 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc
\ No newline at end of file diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend index b35c614c3..a712aaa95 100644 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend @@ -1,3 +1,7 @@ +require checksum_control.inc + +PROVIDES += "virtual/libomxil" + setup_build_tree() { for omxmc in ${OMX_COMMON_SRC} ${OMX_VIDEO_DEC_COMMON_SRC} ${OMX_VIDEO_ENC_COMMON_SRC} do diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp/disabled_arm_neon_for_0.5.1.diff b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp/disabled_arm_neon_for_0.5.1.diff deleted file mode 100644 index e8523df40..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp/disabled_arm_neon_for_0.5.1.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/dsp/dsp.h b/src/dsp/dsp.h -index 1faac27..8aae380 100644 ---- a/src/dsp/dsp.h -+++ b/src/dsp/dsp.h -@@ -77,7 +77,7 @@ extern "C" { - #if (defined(__ARM_NEON__) || defined(WEBP_ANDROID_NEON) || \ - defined(__aarch64__) || defined(WEBP_HAVE_NEON)) && \ - !defined(__native_client__) --#define WEBP_USE_NEON -+//#define WEBP_USE_NEON - #endif - - #if defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_M_ARM) diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp_%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp_%.bbappend deleted file mode 100644 index bfeb4c50b..000000000 --- a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp_%.bbappend +++ /dev/null @@ -1,8 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -# Add W/A patch for linaro gcc. -# This patch disabled neon. (undefined #WEBP_USE_NEON) - -SRC_URI_append = " file://disabled_arm_neon_for_0.5.1.diff" -#Remove patch for 0.5.0 -SRC_URI_remove = " file://disabled_arm_neon.diff" diff --git a/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh b/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh index 8bc2c3574..3e8a2f242 100644 --- a/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh +++ b/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh @@ -1,9 +1,9 @@ #!/bin/bash -ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20170427.zip" -ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20170427.zip" +ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20220121.zip" +ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20220121.zip" -COPY_SCRIPT="$METADIR/meta-renesas-rcar-gen3/meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh" +COPY_SCRIPT="$METADIR/bsp/meta-renesas/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} @@ -12,14 +12,18 @@ 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 2>/dev/null;; - none) tput sgr0 2>/dev/null;; - *) tput setaf $k 2>/dev/null;; - esac - done + [[ $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) @@ -27,38 +31,54 @@ color_red=$(color bold 1) color_none=$(color none) function error() { - echo "${color_red}$@${color_none}" >&2 + echo "${color_red}$@${color_none}" >&2 } function log() { - echo "$@" >&2 + echo "$@" >&2 } function copy_mm_packages() { - 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 2.19 can be downloaded from:" - log " <https://www.renesas.com/solutions/automotive/rcar-demoboard.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 + # first clean up workdir on need + if [ -d $EXTRACT_DIR ]; then + if [ -f $EXTRACT_DIR/$ZIP_1 -a -f $EXTRACT_DIR/$ZIP_2 ]; then + log "The graphics and multimedia acceleration packages for R-Car Gen3 look already installed." + log "To force their reinstallation, please, remove manually the directory:" + log " $EXTRACT_DIR" + log + return 0 fi + rm -r $EXTRACT_DIR + fi + 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 + cd $EXTRACT_DIR + unzip -o $ZIP_1 + unzip -o $ZIP_2 + cd - + 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/application/automotive/r-car-h3-m3-documents-software>" + 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/meta-renesas-rcar-gen3/ - $COPY_SCRIPT -d -f $EXTRACT_DIR - cd .. - else - log "scripts to copy drivers for Gen3 not found." - return 1 - fi + if [ -f $COPY_SCRIPT ]; then + cd $METADIR/bsp/meta-renesas/ + $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-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/0001-Autoload-uEnv.txt-on-boot.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/0001-Autoload-uEnv.txt-on-boot.patch deleted file mode 100644 index a485d7a60..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/0001-Autoload-uEnv.txt-on-boot.patch +++ /dev/null @@ -1,27 +0,0 @@ -From bd56666d27f765113749c2e55eda97b67a659b2b Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov <anton@advancedtelematic.com> -Date: Wed, 2 Nov 2016 15:17:16 +0100 -Subject: [PATCH] Autoload uEnv.txt on boot - ---- - include/configs/porter.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/include/configs/porter.h b/include/configs/porter.h -index 45e6556..19dab74 100644 ---- a/include/configs/porter.h -+++ b/include/configs/porter.h -@@ -151,6 +151,10 @@ - #define CONFIG_EXTRA_ENV_SETTINGS \ - "bootm_low=0x40e00000\0" \ - "bootm_size=0x100000\0" \ -+ "bootcmd=if fatload mmc 1:1 0x50000000 uEnv.txt; then env import -t 0x50000000 ${filesize}; run bootcmd; fi;\0" -+ -+/* Shell scripting features */ -+#define CONFIG_SYS_HUSH_PARSER - - /* SH Ether */ - #define CONFIG_NET_MULTI --- -2.7.4 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-hibernation-image-area.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-hibernation-image-area.patch deleted file mode 100644 index 95fc3b247..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-hibernation-image-area.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 0b5f63c7224cb5c9a00397f0e0ef4a16aa58e516 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 9 Jun 2017 20:43:06 +0900 -Subject: [PATCH 1/3] Add hibernation image area - -0x40000000 <-> 0x77FFFFFF : kernel -0x78000000 <-> 0x7FFFFFFF : hibernation image area -and Enable sdhi DMA support - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - arch/arm/include/asm/arch-rmobile/r8a7791.h | 3 +++ - arch/arm/include/asm/armv7.h | 3 +++ - include/configs/porter.h | 24 ++++++++++++------------ - 3 files changed, 18 insertions(+), 12 deletions(-) - -diff --git a/arch/arm/include/asm/arch-rmobile/r8a7791.h b/arch/arm/include/asm/arch-rmobile/r8a7791.h -index c964f13..9e08da4 100644 ---- a/arch/arm/include/asm/arch-rmobile/r8a7791.h -+++ b/arch/arm/include/asm/arch-rmobile/r8a7791.h -@@ -147,6 +147,8 @@ - - #define DBSC3_0_DBADJ2 0xE67900C8 - #define DBSC3_1_DBADJ2 0xE67A00C8 -+#define DBSC3_0_DBCALTR 0xE67900F8 -+#define DBSC3_1_DBCALTR 0xE67A00F8 - - #define CCI_400_MAXOT_1 0xF0091110 - #define CCI_400_MAXOT_2 0xF0092110 -@@ -154,6 +156,7 @@ - #define CCI_400_QOSCNTL_2 0xF009210C - - #define MXI_BASE 0xFE960000 -+#define MXI_VIN_QOS 0xFE96020C - #define MXI_QOS_BASE 0xFE960300 - - #define SYS_AXI_SYX64TO128_BASE 0xFF800300 -diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h -index aad5bf7..0d4d612 100644 ---- a/arch/arm/include/asm/armv7.h -+++ b/arch/arm/include/asm/armv7.h -@@ -31,6 +31,9 @@ - #define MIDR_CORTEX_A9_R1P3 0x411FC093 - #define MIDR_CORTEX_A9_R2P10 0x412FC09A - -+/* valid bits in CBAR register / PERIPHBASE value */ -+#define CBAR_MASK 0xFFFF8000 -+ - /* Cortex-A15 revisions */ - #define MIDR_CORTEX_A15_R0P0 0x410FC0F0 - -diff --git a/include/configs/porter.h b/include/configs/porter.h -index 5567c7c..f652bab 100644 ---- a/include/configs/porter.h -+++ b/include/configs/porter.h -@@ -91,14 +91,14 @@ - - /* MEMORY */ - #define PORTER_SDRAM_BASE 0x40000000 --#define PORTER_SDRAM_SIZE 0x48000000 -+#define PORTER_SDRAM_SIZE 0x80000000 - #define PORTER_UBOOT_SDRAM_SIZE 0x40000000 - - #define CONFIG_SYS_LONGHELP - #define CONFIG_SYS_PROMPT "=> " --#define CONFIG_SYS_CBSIZE 512 --#define CONFIG_SYS_PBSIZE 512 --#define CONFIG_SYS_MAXARGS 32 -+#define CONFIG_SYS_CBSIZE 256 -+#define CONFIG_SYS_PBSIZE 256 -+#define CONFIG_SYS_MAXARGS 16 - #define CONFIG_SYS_BARGSIZE 512 - #define CONFIG_SYS_BAUDRATE_TABLE { 38400, 115200 } - -@@ -205,15 +205,15 @@ - #define CONFIG_USB_HOST_ETHER /* Enable USB Ethernet adapters */ - #define CONFIG_USB_ETHER_ASIX /* Asix, or whatever driver(s) you want */ - --#define CONFIG_ARMV7_LPAE /* 64-bit MMU descriptors */ --#define CONFIG_SYS_ARM_CACHE_WRITEALLOC /* Make memory operations faster */ -- --#define CONFIG_SYS_ARCH_TIMER /* Init arch timer */ --#define CONFIG_VE_ENABLED /* Virtualization Extensions are enabled*/ --#define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CLK_FREQ -+#define CONFIG_ARMV7_LPAE /* 64-bit MMU descriptors */ -+#define CONFIG_SYS_ARM_CACHE_WRITEALLOC /* Make memory operations faster */ -+#define CONFIG_SYS_ARCH_TIMER /* Init arch timer */ -+#define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CLK_FREQ - -+#if 1 - #define CONFIG_SH_DMA --#define CONFIG_SH_SYS_DMAL_BASE 0xE6700000 --#define CONFIG_SH_SYS_DMAL_NCH 15 -+#define CONFIG_SH_SYS_DMAL_BASE 0xE6700000 -+#define CONFIG_SH_SYS_DMAL_NCH 15 -+#endif - - #endif /* __PORTER_H */ --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-rcar-sdhi-DMA-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-rcar-sdhi-DMA-support.patch deleted file mode 100755 index c5226d4a2..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-rcar-sdhi-DMA-support.patch +++ /dev/null @@ -1,650 +0,0 @@ -From 0aae8f3fefc67bc07b7e4e42f885ef661f0921ab Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 19 May 2017 14:25:38 +0900 -Subject: [PATCH 1/4] Add rcar-sdhi DMA support - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/dma/Makefile | 1 + - drivers/dma/sh_dma.c | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++ - drivers/mmc/sh_sdhi.c | 158 +++++++++++++++++++++++++- - drivers/mmc/sh_sdhi.h | 5 + - include/sh_dma.h | 58 ++++++++++ - 5 files changed, 524 insertions(+), 4 deletions(-) - create mode 100644 drivers/dma/sh_dma.c - create mode 100644 include/sh_dma.h - -diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile -index 5d864b5..1129fc3 100644 ---- a/drivers/dma/Makefile -+++ b/drivers/dma/Makefile -@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o - COBJS-$(CONFIG_APBH_DMA) += apbh_dma.o - COBJS-$(CONFIG_FSL_DMA) += fsl_dma.o - COBJS-$(CONFIG_OMAP3_DMA) += omap3_dma.o -+COBJS-$(CONFIG_SH_DMA) += sh_dma.o - - COBJS := $(COBJS-y) - SRCS := $(COBJS:.o=.c) -diff --git a/drivers/dma/sh_dma.c b/drivers/dma/sh_dma.c -new file mode 100644 -index 0000000..0af2480 ---- /dev/null -+++ b/drivers/dma/sh_dma.c -@@ -0,0 +1,306 @@ -+/* -+ * SH SYS-DMA driver -+ * -+ * Copyright (C) 2014 Cogent Embedded, Inc. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * 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. -+ */ -+ -+#include <common.h> -+#include <malloc.h> -+#include <asm/io.h> -+#include <linux/list.h> -+#include <sh_dma.h> -+ -+struct sh_dma { -+ u32 base; -+ u32 mask; -+ u32 nch; -+ struct list_head list; -+}; -+ -+struct sh_dma_chan { -+ struct sh_dma *dma; -+ u32 base; -+ u32 num; -+ u32 ts; -+ u32 bs; -+ u32 rounds; -+}; -+ -+#define SH_DMA_MAX_TC 0x1000000 -+#define SH_DMA_MAX_CHAN 32 -+#define SH_DMA_CHAN_OFFSET 0x8000 -+#define SH_DMA_CHAN_SIZE 0x80 -+ -+/* Global registers */ -+#define SH_DMAISTA 0x20 -+#define SH_DMASEC 0x30 -+#define SH_DMAOR 0x60 -+#define SH_DMACHCL 0x80 -+#define SH_DMADPSEC 0xA0 -+ -+/* DMA operation register bits */ -+#define SH_DMAOR_DME (0x1 << 0) -+ -+/* Channel registers */ -+#define SH_DMASAR 0x00 -+#define SH_DMADAR 0x04 -+#define SH_DMATCR 0x08 -+#define SH_DMACHCR 0x0C -+#define SH_DMATSR 0x28 -+#define SH_DMATCRB 0x18 -+#define SH_DMATSRB 0x38 -+#define SH_DMACHCRB 0x1C -+#define SH_DMARS 0x40 -+#define SH_DMABUFCR 0x48 -+#define SH_DMADPBASE 0x50 -+#define SH_DMADPCR 0x54 -+#define SH_DMAFIXSAR 0x10 -+#define SH_DMAFIXDAR 0x14 -+#define SH_DMAFIXDPBASE 0x60 -+ -+/* Channel control register bits */ -+#define SH_DMACHCR_SM(v) (((v) & 0x3) << 12) -+#define SH_DMACHCR_SM_MASK (0x3 << 12) -+#define SH_DMACHCR_DM(v) (((v) & 0x3) << 14) -+#define SH_DMACHCR_DM_MASK (0x3 << 14) -+#define SH_DMACHCR_TS_1 (0x0 << 3 | 0x0 << 20) -+#define SH_DMACHCR_TS_2 (0x1 << 3 | 0x0 << 20) -+#define SH_DMACHCR_TS_4 (0x2 << 3 | 0x0 << 20) -+#define SH_DMACHCR_TS_8 (0x3 << 3 | 0x1 << 20) -+#define SH_DMACHCR_TS_16 (0x3 << 3 | 0x0 << 20) -+#define SH_DMACHCR_TS_32 (0x0 << 3 | 0x1 << 20) -+#define SH_DMACHCR_TS_64 (0x1 << 3 | 0x1 << 20) -+#define SH_DMACHCR_TS_MASK (0x3 << 3 | 0x3 << 20) -+#define SH_DMACHCR_RS_AUTO (0x4 << 8) -+#define SH_DMACHCR_RS_SEL (0x8 << 8) -+#define SH_DMACHCR_RS_MASK (0xf << 8) -+#define SH_DMACHCR_CAE (0x1 << 31) -+#define SH_DMACHCR_TE (0x1 << 1) -+#define SH_DMACHCR_DE (0x1 << 0) -+ -+#define sh_dma_writel(d, r, v) writel((v), (d)->base + (r)) -+#define sh_dma_readl(d, r) readl((d)->base + (r)) -+#define sh_dma_writew(d, r, v) writew((v), (d)->base + (r)) -+#define sh_dma_readw(d, r) readw((d)->base + (r)) -+ -+static LIST_HEAD(sh_dma_list); -+ -+struct sh_dma *sh_dma_add(u32 base, u32 nch) -+{ -+ struct list_head *entry; -+ struct sh_dma *dma; -+ u32 mask; -+ -+ if (nch > SH_DMA_MAX_CHAN) -+ return NULL; -+ -+ mask = (1 << nch) - 1; -+ list_for_each(entry, &sh_dma_list) { -+ dma = list_entry(entry, struct sh_dma, list); -+ if (dma->base == base) { -+ if (nch > dma->nch) { -+ mask &= ~((1 << dma->nch) - 1); -+ sh_dma_writel(dma, SH_DMACHCL, mask); -+ dma->nch = nch; -+ } -+ return dma; -+ } -+ } -+ -+ dma = malloc(sizeof(*dma)); -+ if (!dma) -+ return NULL; -+ -+ dma->base = base; -+ dma->mask = 0; -+ dma->nch = nch; -+ sh_dma_writel(dma, SH_DMACHCL, mask); -+ sh_dma_writew(dma, SH_DMAOR, SH_DMAOR_DME); -+ list_add(&dma->list, &sh_dma_list); -+ return dma; -+} -+ -+void sh_dma_chan_src(struct sh_dma_chan *chan, u32 src) -+{ -+ sh_dma_writel(chan, SH_DMASAR, src); -+} -+ -+void sh_dma_chan_dst(struct sh_dma_chan *chan, u32 dst) -+{ -+ sh_dma_writel(chan, SH_DMADAR, dst); -+} -+ -+void sh_dma_chan_cfg(struct sh_dma_chan *chan, u8 midrid, u8 sm, u8 dm) -+{ -+ u32 val; -+ -+ sh_dma_writew(chan, SH_DMARS, midrid); -+ val = sh_dma_readl(chan, SH_DMACHCR); -+ val &= ~(SH_DMACHCR_RS_MASK | -+ SH_DMACHCR_SM_MASK | SH_DMACHCR_DM_MASK); -+ val |= midrid ? SH_DMACHCR_RS_SEL : SH_DMACHCR_RS_AUTO; -+ val |= SH_DMACHCR_SM(sm) | SH_DMACHCR_DM(dm); -+ sh_dma_writel(chan, SH_DMACHCR, val); -+} -+ -+void sh_dma_chan_start(struct sh_dma_chan *chan, u32 ts, u8 bs) -+{ -+ u32 val; -+ -+ if (!ts) -+ return; -+ -+ val = (ts + (1 << bs) - 1) >> bs; -+ val = val < SH_DMA_MAX_TC ? val : 0x0; -+ sh_dma_writel(chan, SH_DMATCR, val); -+ -+ chan->ts = ts; -+ chan->bs = bs; -+ chan->rounds = val; -+ -+ val = sh_dma_readl(chan, SH_DMACHCR); -+ -+ val &= ~(SH_DMACHCR_TE | SH_DMACHCR_TS_MASK); -+ val |= SH_DMACHCR_DE; -+ switch (bs) { -+ default: -+ case 0: -+ val |= SH_DMACHCR_TS_1; -+ break; -+ case 1: -+ val |= SH_DMACHCR_TS_2; -+ break; -+ case 2: -+ val |= SH_DMACHCR_TS_4; -+ break; -+ case 3: -+ val |= SH_DMACHCR_TS_8; -+ break; -+ case 4: -+ val |= SH_DMACHCR_TS_16; -+ break; -+ case 5: -+ val |= SH_DMACHCR_TS_32; -+ break; -+ case 6: -+ val |= SH_DMACHCR_TS_64; -+ break; -+ } -+ -+ sh_dma_writel(chan, SH_DMACHCR, val); -+} -+ -+void sh_dma_chan_stop(struct sh_dma_chan *chan) -+{ -+ u32 val; -+ -+ chan->ts = 0; -+ chan->bs = 0; -+ chan->rounds = 0; -+ -+ val = sh_dma_readl(chan, SH_DMACHCR); -+ val &= ~(SH_DMACHCR_CAE | SH_DMACHCR_TE | SH_DMACHCR_DE); -+ sh_dma_writel(chan, SH_DMACHCR, val); -+ do { -+ val = sh_dma_readl(chan, SH_DMACHCR); -+ } while (val & SH_DMACHCR_DE); -+} -+ -+int sh_dma_chan_wait(struct sh_dma_chan *chan) -+{ -+ u32 val; -+ u32 timeout = 10000000; -+ int retval = 0; -+ -+ do { -+ val = sh_dma_readl(chan, SH_DMACHCR); -+ val &= SH_DMACHCR_CAE | SH_DMACHCR_TE | SH_DMACHCR_DE; -+ if (val == (SH_DMACHCR_TE | SH_DMACHCR_DE)) -+ break; -+ -+ if (!timeout) -+ return -ETIMEDOUT; -+ -+ timeout--; -+ udelay(1); -+ } while (1); -+ -+ if (!(val & SH_DMACHCR_DE)) -+ return chan->ts ? -EINTR : 0; -+ -+ if (val & SH_DMACHCR_CAE) { -+ retval = -EFAULT; -+ goto out; -+ } -+ -+ val = chan->rounds < SH_DMA_MAX_TC ? chan->rounds : SH_DMA_MAX_TC; -+ val = chan->rounds - val; -+ if (val) { -+ puts("abnormal end\n"); -+ sh_dma_chan_start(chan, val << chan->bs, 0); -+ return -EAGAIN; -+ } -+ -+out: -+ sh_dma_chan_stop(chan); -+ return retval; -+} -+ -+void sh_dma_chan_clr(struct sh_dma_chan *chan) -+{ -+ chan->ts = 0; -+ chan->bs = 0; -+ chan->rounds = 0; -+ -+ sh_dma_writel(chan->dma, SH_DMACHCL, 1 << chan->num); -+} -+ -+struct sh_dma_chan *sh_dma_chan_init(struct sh_dma *dma, int ch) -+{ -+ struct sh_dma_chan *chan; -+ u32 mask; -+ -+ if (ch < 0) { -+ if (!~dma->mask) -+ return NULL; -+ -+ ch = ffz(dma->mask); -+ } -+ -+ if (!dma || ch > dma->nch) -+ return NULL; -+ -+ mask = 1 << ch; -+ if (dma->mask & mask) -+ return NULL; -+ -+ chan = malloc(sizeof(*chan)); -+ if (!chan) -+ return NULL; -+ -+ dma->mask |= mask; -+ chan->dma = dma; -+ chan->base = dma->base + SH_DMA_CHAN_OFFSET + ch * SH_DMA_CHAN_SIZE; -+ chan->num = ch; -+ sh_dma_chan_clr(chan); -+ -+ return chan; -+} -+ -+void sh_dma_chan_release(struct sh_dma_chan *chan) -+{ -+ struct sh_dma *dma = chan->dma; -+ -+ dma->mask &= ~(1 << chan->num); -+ free(chan); -+} -diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c -index ddad43a..80dc7a8 100644 ---- a/drivers/mmc/sh_sdhi.c -+++ b/drivers/mmc/sh_sdhi.c -@@ -17,7 +17,6 @@ - #include <command.h> - #include <mmc.h> - #include <malloc.h> --#include <mmc.h> - #include <asm/errno.h> - #include <asm/io.h> - -@@ -33,6 +32,111 @@ - - #define DRIVER_NAME "sh-sdhi" - -+#ifdef CONFIG_SH_DMA -+ -+#ifdef CONFIG_SYS_DCACHE_OFF -+static inline void sh_sdhi_invalidate_dcache(u32 addr, int len) { } -+#else /* CONFIG_SYS_DCACHE_OFF */ -+#define DCACHE_LINE_MASK (ARCH_DMA_MINALIGN - 1) -+ -+static void sh_sdhi_invalidate_dcache(u32 addr, int len) -+{ -+ u32 start, end; -+ -+ start = addr & ~DCACHE_LINE_MASK; -+ if (start != addr) { -+ end = start + ARCH_DMA_MINALIGN; -+ flush_dcache_range(start, end); -+ -+ len -= end - addr; -+ start = end; -+ } -+ -+ if (len >= ARCH_DMA_MINALIGN) { -+ end = (start + len) & ~DCACHE_LINE_MASK; -+ invalidate_dcache_range(start, end); -+ -+ len &= DCACHE_LINE_MASK; -+ start = end; -+ } -+ -+ if (len > 0) { -+ end = start + ARCH_DMA_MINALIGN; -+ flush_dcache_range(start, end); -+ } -+} -+#endif /* CONFIG_SYS_DCACHE_OFF */ -+ -+static void sh_sdhi_dma_init(struct sdhi_host *host) -+{ -+ struct sh_dma *dma; -+ -+ dma = sh_dma_add(CONFIG_SH_SYS_DMAL_BASE, CONFIG_SH_SYS_DMAL_NCH); -+ if (!dma) -+ return; -+ -+ host->dma_rx = sh_dma_chan_init(dma, 1); -+ if (!host->dma_rx) -+ return; -+ -+ sh_dma_chan_cfg(host->dma_rx, SH_DMA_SDHI0_RX, -+ SH_DMA_AM_FIX, SH_DMA_AM_INC); -+ sh_dma_chan_src(host->dma_rx, -+ host->addr + (SDHI_BUF0 << host->bus_shift) + -+ 0x2000); -+} -+ -+static void sh_sdhi_dma_release(struct sdhi_host *host) -+{ -+ if (host->dma_rx) { -+ sh_dma_chan_release(host->dma_rx); -+ host->dma_rx = NULL; -+ } -+} -+ -+static void sh_sdhi_start_dma_rx(struct sdhi_host *host, -+ struct mmc_data *data) -+{ -+ int ret; -+ u32 blocksize = data->blocksize; -+ sh_sdhi_dma_init(host); -+ sdhi_writew(host, SDHI_SD_DMACR, 0xa0); -+ sdhi_writew(host, SDHI_CC_EXT_MODE, (1 << 1)); -+ -+ sh_sdhi_invalidate_dcache((u32)data->dest, blocksize); -+ -+ sh_dma_chan_dst(host->dma_rx, (u32)data->dest); -+ -+ /* sh_sdhi_bitset(BUF_ACC_DMAREN, &host->regs->ce_buf_acc); */ -+ -+ /* MMCIF is capable to transfer only 4 bytes at a time, -+ * provide size order as a param */ -+ blocksize = sdhi_readw(host, SDHI_SIZE); -+ sh_dma_chan_start(host->dma_rx, blocksize, 1); -+ -+ do { -+ ret = sh_dma_chan_wait(host->dma_rx); -+ } while (ret == -EAGAIN); -+ sdhi_writew(host, SDHI_CC_EXT_MODE, 0x0); -+ sh_dma_chan_clr(host->dma_rx); -+ sh_sdhi_dma_release(host); -+} -+ -+static void sdhi_dma_transfer(struct sdhi_host *host, -+ struct mmc_data *data) -+{ -+ sh_sdhi_start_dma_rx(host, data); -+} -+ -+ -+#else /* CONFIG_SH_DMA */ -+static inline void sh_sdhi_dma_init(struct sdhi_host *host) { } -+static inline void sh_sdhi_dma_release(struct sdhi_host *host) { } -+static inline void sh_sdhi_start_dma_rx(struct sdhi_host *host, -+ struct mmc_data *data) { } -+ -+#endif /* CONFIG_SH_DMA */ -+ - static void *mmc_priv(struct mmc *mmc) - { - return (void *)mmc->priv; -@@ -253,7 +357,9 @@ static int sdhi_single_read(struct sdhi_host *host, struct mmc_data *data) - { - int ch = host->ch; - long time; -+#ifndef CONFIG_SH_DMA - unsigned short blocksize, i; -+#endif - unsigned short *p = (unsigned short *)data->dest; - - if ((unsigned long)p & 0x00000001) { -@@ -272,10 +378,14 @@ static int sdhi_single_read(struct sdhi_host *host, struct mmc_data *data) - return sdhi_error_manage(host); - - g_wait_int[ch] = 0; -+#ifdef CONFIG_SH_DMA -+ sdhi_dma_transfer(host, data); -+#else - blocksize = sdhi_readw(host, SDHI_SIZE); - for (i = 0; i < blocksize / 2; i++) - *p++ = sdhi_readw(host, SDHI_BUF0); - -+#endif - time = sdhi_wait_interrupt_flag(host); - if (time == 0 || g_sd_error[ch] != 0) - return sdhi_error_manage(host); -@@ -537,7 +647,6 @@ static int sdhi_start_cmd(struct sdhi_host *host, - ; - - sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK)); -- - g_wait_int[host->ch] = 0; - sdhi_writew(host, SDHI_INFO1_MASK, - ~INFO1M_RESP_END & sdhi_readw(host, SDHI_INFO1_MASK)); -@@ -546,7 +655,6 @@ static int sdhi_start_cmd(struct sdhi_host *host, - INFO2M_END_ERROR | INFO2M_TIMEOUT | - INFO2M_RESP_TIMEOUT | INFO2M_ILA) & - sdhi_readw(host, SDHI_INFO2_MASK)); -- - time = sdhi_wait_interrupt_flag(host); - if (time == 0) - return sdhi_error_manage(host); -@@ -578,7 +686,6 @@ static int sdhi_start_cmd(struct sdhi_host *host, - } - if (host->data) - ret = sdhi_data_trans(host, data, opc); -- - pr_debug("ret = %d, resp = %08x, %08x, %08x, %08x\n", - ret, cmd->response[0], cmd->response[1], - cmd->response[2], cmd->response[3]); -@@ -697,3 +804,46 @@ int sdhi_mmc_init(unsigned long addr, int ch) - return ret; - } - -+ -+int sdhi_warmup_sdio(struct mmc *mmc) -+{ -+ struct mmc_cmd cmd; -+ int err; -+ int32_t ocr; -+ -+ udelay(10); -+ -+ mmc->bus_width = 1; -+ mmc->clock = mmc->f_min; -+ sdhi_set_ios(mmc); -+ udelay(10); -+ -+ cmd.cmdidx = MMC_CMD_GO_IDLE_STATE; -+ cmd.resp_type = MMC_RSP_NONE; -+ cmd.cmdarg = 0; -+ err = sdhi_request(mmc, &cmd, NULL); -+ if (err) -+ goto err_out; -+ cmd.cmdidx = 0x5; -+ cmd.resp_type = MMC_RSP_R4; -+ cmd.cmdarg = 0; -+ err = sdhi_request(mmc, &cmd, NULL); -+ if (err) -+ goto err_out; -+ ocr = cmd.response[0]; -+ ocr |= (1 << 24); -+ cmd.cmdidx = 0x05; -+ cmd.resp_type = MMC_RSP_R4; -+ cmd.cmdarg = ocr; -+ err = sdhi_request(mmc, &cmd, NULL); -+ if (err) -+ goto err_out; -+ printf("SDIO OCR:%08x\n", cmd.response[0]); -+ return 0; -+err_out: -+ printf("cmd: CMD%02d err = %d, resp = %08x, %08x, %08x, %08x\n", -+ err, cmd.cmdidx, cmd.response[0], cmd.response[1], -+ cmd.response[2], cmd.response[3]); -+ return err; -+} -+ -diff --git a/drivers/mmc/sh_sdhi.h b/drivers/mmc/sh_sdhi.h -index 4deded2..7b5d421 100644 ---- a/drivers/mmc/sh_sdhi.h -+++ b/drivers/mmc/sh_sdhi.h -@@ -15,6 +15,8 @@ - #ifndef _SH_SDHI_H_ - #define _SH_SDHI_H_ - -+#include <sh_dma.h> -+ - #define SDHI_CMD (0x0000 >> 1) - #define SDHI_PORTSEL (0x0004 >> 1) - #define SDHI_ARG0 (0x0008 >> 1) -@@ -181,6 +183,9 @@ struct sdhi_host { - unsigned int power_mode; - int ch; - int bus_shift; -+#ifdef CONFIG_SH_DMA -+ struct sh_dma_chan *dma_rx; -+#endif - }; - - static unsigned short g_wait_int[CONFIG_MMC_SH_SDHI_NR_CHANNEL]; -diff --git a/include/sh_dma.h b/include/sh_dma.h -new file mode 100644 -index 0000000..3f35c3a ---- /dev/null -+++ b/include/sh_dma.h -@@ -0,0 +1,58 @@ -+#ifndef __SH_DMA_H__ -+#define __SH_DMA_H__ -+ -+#include <asm/types.h> -+#include <errno.h> -+ -+#define SH_DMA_MMCIF0_RX 0xD2 -+#define SH_DMA_SDHI0_RX 0xCE -+ -+/* Address mode */ -+#define SH_DMA_AM_FIX 0 -+#define SH_DMA_AM_INC 1 -+#define SH_DMA_AM_DEC 2 -+ -+struct sh_dma; -+struct sh_dma_chan; -+ -+#ifdef CONFIG_SH_DMA -+struct sh_dma *sh_dma_add(u32 base, u32 nch); -+struct sh_dma_chan *sh_dma_chan_init(struct sh_dma *dma, int ch); -+void sh_dma_chan_release(struct sh_dma_chan *chan); -+ -+void sh_dma_chan_src(struct sh_dma_chan *chan, u32 src); -+void sh_dma_chan_dst(struct sh_dma_chan *chan, u32 dst); -+void sh_dma_chan_cfg(struct sh_dma_chan *chan, u8 midrid, u8 sm, u8 dm); -+void sh_dma_chan_start(struct sh_dma_chan *chan, u32 ts, u8 bs); -+void sh_dma_chan_stop(struct sh_dma_chan *chan); -+int sh_dma_chan_wait(struct sh_dma_chan *chan); -+void sh_dma_chan_clr(struct sh_dma_chan *chan); -+#else -+static inline struct sh_dma *sh_dma_add(u32 base, u32 nch) -+{ -+ return NULL; -+} -+ -+static inline struct sh_dma_chan *sh_dma_chan_init(struct sh_dma *dma, -+ int ch) -+{ -+ return NULL; -+} -+ -+static inline void sh_dma_chan_release(struct sh_dma_chan *chan) { } -+static inline void sh_dma_chan_src(struct sh_dma_chan *chan, u32 src) { } -+static inline void sh_dma_chan_dst(struct sh_dma_chan *chan, u32 dst) { } -+static inline void sh_dma_chan_cfg(struct sh_dma_chan *chan, -+ u8 midrid, u8 sm, u8 dm) { } -+static inline void sh_dma_chan_start(struct sh_dma_chan *chan, -+ u32 ts, u8 bs) { } -+static inline void sh_dma_chan_stop(struct sh_dma_chan *chan) { } -+static inline int sh_dma_chan_wait(struct sh_dma_chan *chan) -+{ -+ return -ENOSYS; -+} -+ -+static inline void sh_dma_chan_clr(struct sh_dma_chan *chan) { } -+#endif -+ -+#endif /* __SH_DMA_H__ */ --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Add-Hibernation-swsusp-command-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Add-Hibernation-swsusp-command-support.patch deleted file mode 100755 index 7c4c65658..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Add-Hibernation-swsusp-command-support.patch +++ /dev/null @@ -1,909 +0,0 @@ -From 45b3abc592bd685726a6b55693ab95e4cb6065fc Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 19 May 2017 14:27:46 +0900 -Subject: [PATCH 2/4] Add Hibernation swsusp command support - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - common/cmd_swsusp.c | 889 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 889 insertions(+) - create mode 100644 common/cmd_swsusp.c - -diff --git a/common/cmd_swsusp.c b/common/cmd_swsusp.c -new file mode 100644 -index 0000000..ba05aa4 ---- /dev/null -+++ b/common/cmd_swsusp.c -@@ -0,0 +1,889 @@ -+/* -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * 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, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include <common.h> -+#include <command.h> -+#include <part.h> -+#include <malloc.h> -+ -+#include <linux/lzo.h> -+#include "../arch/arm/cpu/armv7/rmobile/crc32_word4.h" -+#include <swsuspmem.h> -+ -+/* Note for Renesas--based boards: -+ * We have the following memory split here: -+ * 0x40000000 - u_boot_lowest - used to store pfns at physical addresses -+ * u_boot_lowest - 0x8000000 - pfns are relocated, and then later put -+ * on physical addresses (swsusp_finish) -+ * 0x8000000 - 0xc0000000 - used to store pfns with physical address -+ * of 0x200000000 (long address), we have to change offset for them. -+ * Any pfn with address > 0x8000000 but less than 0x200000000 -+ * is an error. -+ * For boards which do not have memory above first GB, that will -+ * still work, as they won't have anything above 0x80000000 -+ * in their image, so for standard 2GB setup ou should put -+ * your secong GB in 0x80000000-0xC0000000 range, you can -+ * use MMU for that or if your RAM is continous, it will -+ * naturally be there. */ -+ -+DECLARE_GLOBAL_DATA_PTR; -+ -+/* #define PAGEMAP_DEBUG */ -+ -+#ifdef PAGEMAP_DEBUG -+#define SWSUSP_DEBUG_INFO -+#endif -+ -+#define SWSUSP_KEEP_IMAGE -+ -+#ifndef likely -+# define likely(x) __builtin_expect(!!(x), 1) -+# define unlikely(x) __builtin_expect(!!(x), 0) -+#endif -+ -+#define HIBERNATE_SIG "S1SUSPEND" -+#define PAGE_SIZE 4096 -+ -+/* Define depending on CONFIG_LBDAF in kernel */ -+typedef u64 sector_t; -+ -+ -+struct swsusp_header { -+ char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - -+ sizeof(int) - sizeof(u32) - -+ sizeof(CRC32_WORD4_t) - sizeof(u32)]; -+ CRC32_WORD4_t comp_crc32; -+ u32 img_size; /* append */ -+ u32 crc32; -+ sector_t image; -+ unsigned int flags; -+ char orig_sig[10]; -+ char sig[10]; -+} __packed; -+ -+#define __NEW_UTS_LEN 64 -+ -+struct new_utsname { -+ char sysname[__NEW_UTS_LEN + 1]; -+ char nodename[__NEW_UTS_LEN + 1]; -+ char release[__NEW_UTS_LEN + 1]; -+ char version[__NEW_UTS_LEN + 1]; -+ char machine[__NEW_UTS_LEN + 1]; -+ char domainname[__NEW_UTS_LEN + 1]; -+}; -+ -+struct swsusp_archdata { -+ u32 nosave_backup_phys; -+ u32 nosave_begin_phys; -+ u32 nosave_end_phys; -+ void (*cpu_resume_restore_nosave)(u32, u32, u32); -+}; -+ -+struct swsusp_info { -+ struct new_utsname uts; -+ u32 version_code; -+ unsigned long num_physpages; -+ int cpus; -+ unsigned long image_pages; -+ unsigned long pages; -+ unsigned long size; -+ char archdata[1024]; -+}; -+ -+struct swap_map_page { -+ u64 entries[PAGE_SIZE / sizeof(u64) - 1]; -+ u64 next_swap; -+}; -+ -+struct swsusp_finish_context { -+ void *remap_orig_page; -+ void *remap_temp_page; -+ struct swsusp_archdata archdata; -+}; -+ -+/* Do not specially exclude any bottom area */ -+#define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE) -+#define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE) -+ -+#define PG_UB2ZERO(pg) (pg - CONFIG_SYS_SDRAM_BASE / PAGE_SIZE) -+static u32 const exclude_min_page = -+ (USED_ADDRESS_TOP) / PAGE_SIZE; -+static u32 const exclude_max_page = -+ (USED_ADDRESS_END - 1) / PAGE_SIZE; -+static u32 const exclude_min_page_ub = -+ PG_UB2ZERO((USED_ADDRESS_TOP) / PAGE_SIZE); -+static u32 const exclude_max_page_ub = -+ PG_UB2ZERO((USED_ADDRESS_END-1) / PAGE_SIZE); -+#define SF_NOCOMPRESS_MODE 2 -+ -+#define LZO_HEADER sizeof(size_t) -+ -+/* Number of pages/bytes we'll compress at one time. */ -+#define LZO_UNC_PAGES 32 -+#define LZO_UNC_SIZE (LZO_UNC_PAGES * PAGE_SIZE) -+ -+/* Number of pages/bytes we need for compressed data (worst case). */ -+#define LZO_CMP_PAGES DIV_ROUND_UP(lzo1x_worst_compress(LZO_UNC_SIZE) + \ -+ LZO_HEADER, PAGE_SIZE) -+#define LZO_CMP_SIZE (LZO_CMP_PAGES * PAGE_SIZE) -+ -+static block_dev_desc_t *swap_dev; -+static disk_partition_t swap_info; -+ -+static struct swap_map_page *meta_map; -+static u64 meta_map_next; -+static u64 meta_map_curr; -+static u64 meta_map_start; -+static int meta_idx; -+ -+#ifdef PAGEMAP_DEBUG -+static int debugout; -+static int _last_read_pages; -+#define PAGEMAP_INFO(_msg, ...) do { if (debugout == 1) \ -+ printf(_msg, ## __VA_ARGS__); } while (0) -+#endif -+ -+#define HIGHMEM_PHYS_ADDR 0x200000000ULL -+#define HIGHMEM_VA 0x80000000UL -+#define HIGHMEM_PFN (HIGHMEM_PHYS_ADDR / PAGE_SIZE) -+#define LOW_TOP 0x80000000 -+#define LOW_TOP_PFN (LOW_TOP / PAGE_SIZE) -+#define LOW_BOTTOM CONFIG_SYS_SDRAM_BASE -+#define LOW_BOTTOM_PFN (LOW_BOTTOM / PAGE_SIZE) -+#define TOP_ADDRESS 0x240000000ULL -+ -+static int get_meta(void); -+ -+static inline int pfn_is_low(u32 pfn) -+{ -+ return ((pfn >= LOW_BOTTOM_PFN) && (pfn < LOW_TOP_PFN)); -+} -+ -+static inline int pfn_is_high(u32 pfn) -+{ -+ return (pfn >= HIGHMEM_PFN); -+} -+ -+#define pfn_is_valid(p) (pfn_is_low(p) || pfn_is_high(p)) -+ -+static inline int pfn_is_excluded(u32 pfn) -+{ -+ /* Allow bottom 2 pages for exception vectors */ -+ if (pfn < (LOW_BOTTOM_PFN + 2)) -+ return 0; -+ else if (exclude_min_page >= exclude_max_page) -+ return 0; -+ else -+ return (pfn >= exclude_min_page) && (pfn <= exclude_max_page); -+} -+ -+/* PFN to zero-counted page */ -+static inline u32 pg_ub2zero(u32 pg) -+{ -+ return pg - LOW_BOTTOM_PFN; -+} -+ -+/* zero-counted page to PFN */ -+static inline u32 pg_zero2ub(u32 pg) -+{ -+ return pg + LOW_BOTTOM_PFN; -+} -+ -+/* PFN to physical address (64-bit (40-bit)) */ -+static inline u64 pg2phys(u32 page) -+{ -+ return (u64) page * PAGE_SIZE; -+} -+ -+/* PFN to virtual address */ -+static inline void *pg2addr(u32 page) -+{ -+ void *addr; -+ if (page >= HIGHMEM_PFN) -+ addr = (void *) (u32)(pg2phys(page - HIGHMEM_PFN) + HIGHMEM_VA); -+ else -+ addr = (void *) (u32)pg2phys(page); -+ -+ return addr; -+} -+ -+#ifdef CONFIG_SH_DMA -+static inline void *malloc_aligned(u32 size, u32 align) -+{ -+ return (void *)(((u32)malloc(size + align) + align - 1) & ~(align - 1)); -+} -+ -+#endif -+ -+static int page_read(u32 page, void *addr) -+{ -+ __u32 cnt; -+ int blk_per_page; -+ -+ blk_per_page = PAGE_SIZE / swap_dev->blksz; -+ cnt = swap_dev->block_read(swap_dev->dev, -+ swap_info.start + (page * blk_per_page), -+ blk_per_page, addr); -+ return cnt != blk_per_page; -+} -+ -+#ifndef SWSUSP_KEEP_IMAGE -+static int page_write(u32 page, void *addr) -+{ -+ __u32 cnt; -+ int blk_per_page; -+ -+ blk_per_page = PAGE_SIZE / swap_dev->blksz; -+ cnt = swap_dev->block_write(swap_dev->dev, -+ swap_info.start + (page * blk_per_page), -+ blk_per_page, addr); -+ return cnt != blk_per_page; -+} -+#endif -+ -+#define FAST_COPY -+void __attribute__((section(".rodata"))) -+ __attribute__((optimize("O6", "unroll-loops"))) -+swsusp_finish(void *userdata) -+{ -+ struct swsusp_finish_context *context = userdata; -+ u32 **remap_orig; -+ u32 **remap_temp; -+ int idx = 0; -+ const int lastidx = PAGE_SIZE / sizeof(u32) - 1; -+ -+ remap_orig = context->remap_orig_page; -+ remap_temp = context->remap_temp_page; -+ -+ __asm__ volatile ("" : : : "memory"); -+ for (;;) { -+ u32 *orig, *temp; -+ int count; -+ -+ /* Linked list to next page */ -+ if (idx == lastidx) { -+ remap_orig = (u32 **)remap_orig[idx]; -+ remap_temp = (u32 **)remap_temp[idx]; -+ idx = 0; -+ } -+ if (unlikely(!remap_orig || remap_orig[idx] == (u32 *)~0UL)) -+ break; -+ orig = remap_orig[idx]; -+ temp = remap_temp[idx]; -+#ifdef FAST_COPY -+ count = PAGE_SIZE / sizeof(u32) / 32; -+ __asm__ volatile ( -+ "1:\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "subs %[count], %[count], #1\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "bgt 1b\n" -+ : /* No outputs */ -+ : -+ [rorig]"h" (orig), -+ [rtemp]"h" (temp), -+ [count]"h" (count) -+ : "r0", "r1", "r2", -+ "r3", "r4", "r5", -+ "r6", "r7", "cc", "memory" -+ ); -+#else -+ count = PAGE_SIZE / sizeof(u32); -+ while (count--) -+ *orig++ = *temp++; -+#endif -+#ifdef SWSUSP_CHECK_COPY_RESULT -+ count = PAGE_SIZE / sizeof(u32); -+ orig = remap_orig[idx]; -+ temp = remap_temp[idx]; -+ __asm__ volatile ( -+ "1:\n" -+ "ldr r3, [%[rorig]]\n" -+ "ldr r4, [%[rtemp]]\n" -+ "cmp r3, r4\n" -+ "bne 2f\n" -+ "add %[rorig], %[rorig], #4\n" -+ "add %[rtemp], %[rtemp], #4\n" -+ "subs %[count], %[count], #1\n" -+ "bgt 1b\n" -+ "b 3f\n" -+ "2:b 2b\n" -+ "3:\n" -+ : -+ [rorig]"+r" (orig), -+ [rtemp]"+r" (temp), -+ [count]"+r" (count) -+ : -+ : "r3", "r4", "cc", "memory" -+ ); -+#endif -+ idx++; -+ } -+ context->archdata.cpu_resume_restore_nosave( -+ context->archdata.nosave_backup_phys, -+ context->archdata.nosave_begin_phys, -+ context->archdata.nosave_end_phys); -+} -+ -+static int raw_page_init(u64 start) -+{ -+#ifdef CONFIG_SH_DMA -+ meta_map = malloc_aligned(PAGE_SIZE, ARCH_DMA_MINALIGN); -+#else -+ meta_map = malloc(PAGE_SIZE); -+#endif -+ if (!meta_map) -+ return -1; -+ meta_map_next = 0; -+ meta_map_curr = 0; -+ meta_map_start = start; -+ return 0; -+} -+ -+static void raw_page_start(void) -+{ -+ meta_idx = ARRAY_SIZE(meta_map->entries); -+ meta_map_next = meta_map_start; -+} -+ -+static int get_meta(void) -+{ -+ if (meta_idx == ARRAY_SIZE(meta_map->entries)) { -+ if (!meta_map_next) -+ return 0; -+ if (meta_map_curr != meta_map_next) { -+#ifdef PAGEMAP_DEBUG -+ PAGEMAP_INFO("META: %d (%08x)\n", -+ (int)meta_map_next, -+ (unsigned int) -+ (meta_map_next * PAGE_SIZE)); -+#endif -+ if (page_read(meta_map_next, meta_map)) -+ return -1; -+ meta_map_curr = meta_map_next; -+ meta_map_next = meta_map->next_swap; -+ } -+ meta_idx = 0; -+ } -+#ifdef PAGEMAP_DEBUG -+ { -+ static unsigned int pre; -+ if ((pre+1) != meta_map->entries[meta_idx]) { -+ PAGEMAP_INFO("DATA-Skipped: %d->%d (%08x->%08x)\n", -+ pre, -+ (unsigned int)meta_map->entries[meta_idx], -+ pre*PAGE_SIZE, -+ (unsigned int) -+ (meta_map->entries[meta_idx] * -+ PAGE_SIZE)); -+ } -+ pre = meta_map->entries[meta_idx]; -+ _last_read_pages = pre; -+ } -+#endif -+ return 1; -+} -+ -+static int raw_page_get_next(void *buffer) -+{ -+ if (!get_meta()) -+ return 0; -+ -+ if (page_read(meta_map->entries[meta_idx++], buffer)) -+ return -1; -+ -+ return 1; -+} -+ -+static void raw_page_exit(void) -+{ -+ free(meta_map); -+ meta_map = NULL; -+} -+ -+static int image_compressed; -+static int image_pages_avail; -+static unsigned char *unc_buf; -+static unsigned char *cmp_buf; -+static int unc_offset; -+ -+static int image_page_init(int compressed) -+{ -+ if (!compressed) -+ return 1; -+ -+#ifdef CONFIG_SH_DMA -+ cmp_buf = malloc_aligned(LZO_CMP_SIZE, ARCH_DMA_MINALIGN); -+#else -+ cmp_buf = malloc(LZO_CMP_SIZE); -+#endif -+ unc_buf = malloc(LZO_UNC_SIZE); -+ if (!unc_buf || !cmp_buf) { -+ printf("not enogh memory\n"); -+ return 1; -+ } -+ image_compressed = compressed; -+ return 0; -+} -+ -+static void image_page_start(void) -+{ -+ image_pages_avail = 0; -+} -+ -+static int image_page_get_next(void *buffer) -+{ -+ if (image_compressed) { -+#ifdef CONFIG_LZO -+ if (!image_pages_avail) { -+ int ret; -+ size_t unc_len, cmp_len, cmp_avail; -+ -+ ret = raw_page_get_next(cmp_buf); -+ if (ret <= 0) -+ return ret; -+ -+ cmp_len = *(size_t *) cmp_buf; -+ cmp_avail = PAGE_SIZE; -+ -+ while (cmp_avail < cmp_len + LZO_HEADER) { -+ ret = raw_page_get_next(cmp_buf + cmp_avail); -+ if (unlikely(ret <= 0)) -+ return ret; -+ cmp_avail += PAGE_SIZE; -+ } -+ unc_len = LZO_UNC_SIZE; -+ ret = lzo1x_decompress_safe(cmp_buf + LZO_HEADER, -+ cmp_len, unc_buf, &unc_len); -+ if (unlikely(ret != LZO_E_OK)) { -+ printf("Decompression failure:\n"); -+ printf("ret = %d\n", ret); -+ printf("cmp_buf = %p\n", cmp_buf + LZO_HEADER); -+ printf("cmp_len = %zu\n", cmp_len); -+ printf("unc_len = %zu\n", unc_len); -+ return ret; -+ } -+ image_pages_avail = unc_len / PAGE_SIZE; -+ unc_offset = 0; -+ } -+ -+ memcpy(buffer, unc_buf + unc_offset, PAGE_SIZE); -+ unc_offset += PAGE_SIZE; -+ image_pages_avail--; -+ return 1; -+#else -+ printf("No LZO support in u-boot.\n"); -+ return -1; -+#endif -+ } else { -+ return raw_page_get_next(buffer); -+ } -+} -+ -+static void image_page_exit(void) -+{ -+ free(unc_buf); -+ free(cmp_buf); -+ unc_buf = cmp_buf = NULL; -+} -+ -+static void bitmap_set(u32 *bm, unsigned int bit) -+{ -+ bm[bit >> 5] |= (1 << (bit & 0x1f)); -+} -+ -+static int bitmap_is_set(u32 *bm, unsigned int bit) -+{ -+ return !!(bm[bit >> 5] & (1 << (bit & 0x1f))); -+} -+ -+static u32 *used_bitmap; -+static u32 next_free_page; -+static u32 total_pages; -+ -+static int free_page_init(void) -+{ -+ total_pages = (u32)((TOP_ADDRESS - -+ LOW_BOTTOM) / PAGE_SIZE); /* 2GB */ -+ used_bitmap = malloc(total_pages * sizeof(u32) / 32); -+ if (!used_bitmap) -+ return -1; -+ return 0; -+} -+ -+static void free_page_start(int offset) -+{ -+ memset(used_bitmap, 0, total_pages * sizeof(u32) / 32); -+ next_free_page = pg_ub2zero(offset); -+} -+ -+static void free_page_mark_used(u32 page); -+/* Returns full-address based pages */ -+static int free_page_get_next(void) -+{ -+ while (bitmap_is_set(used_bitmap, next_free_page)) -+ next_free_page++; -+ free_page_mark_used(next_free_page); -+ return pg_zero2ub(next_free_page++); -+} -+ -+static void free_page_mark_used(u32 page) -+{ -+ bitmap_set(used_bitmap, page); -+} -+ -+static void free_page_exit(void) -+{ -+ free(used_bitmap); -+ used_bitmap = NULL; -+} -+ -+int do_swsusp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -+{ -+ int ret; -+ __u32 offset = 0; -+ void *spare_page = NULL; -+ struct swsusp_header *swsusp_header; -+ struct swsusp_info *swsusp_info; -+ struct swsusp_finish_context *context; -+ int max_page; -+ int i; -+ u32 nr_pfn_pages; -+ u32 **pfn_pages = NULL; -+ u32 *remap_orig_page; -+ u32 *remap_temp_page; -+ u32 **remap_orig; -+ u32 **remap_temp; -+ int remap_idx; -+ int m; -+ void (*swsusp_finish_copy)(void *); -+ char *data_page; -+ char *stack_addr; -+ int high_page; -+#ifdef USE_CRC_32x4 -+ CRC32_WORD4_t calc_crc; -+#endif -+#ifdef PAGEMAP_DEBUG -+ int high_page_images = 0; -+ int total_remap = 0; -+ if (getenv("hybdebug") != NULL) -+ debugout = 1; -+#endif -+ /* Address hack */ -+ void *swsusp_finish_p = (void *)((u32)swsusp_finish & ~0x1); -+ -+ if (argc < 2) { -+ printf("usage: swsusp <interface> " -+ "[<dev[:part]>] [<offset>]\n"); -+ return 0; -+ } -+ -+ if (argc == 4) { -+ char *ep; -+ offset = simple_strtoul(argv[3], &ep, 16); -+ if (*ep) { -+ printf("Invalid block offset\n"); -+ return 1; -+ } -+ } -+ -+ /* Allow for 32 pages of stack */ -+ max_page = gd->start_addr_sp / PAGE_SIZE - 32; -+ high_page = (((gd->relocaddr -+ + _bss_end_ofs)+(PAGE_SIZE-1)) / PAGE_SIZE) + 1; -+#define pfn_is_occupied(pfn) (page > max_page && page <= high_page) -+#ifdef PAGEMAP_DEBUG -+ PAGEMAP_INFO(" *gd->start_addr_sp:%p\n", (void *)gd->start_addr_sp); -+ PAGEMAP_INFO(" *gd->relocaddr:%p\n", (void *)gd->relocaddr); -+ PAGEMAP_INFO(" *bss_start_offset:%d bss_end_offset:%d\n", -+ (int)_bss_start_ofs, (int)_bss_end_ofs); -+ PAGEMAP_INFO(" UBOOT own memory [%p-%p]\n", -+ pg2addr(max_page), pg2addr(high_page)); -+#endif -+ -+ if (free_page_init()) -+ goto mem_err; -+ free_page_start(exclude_max_page + 1); -+ -+#ifdef CONFIG_SH_DMA -+ spare_page = malloc_aligned(PAGE_SIZE, ARCH_DMA_MINALIGN); -+#else -+ spare_page = malloc(PAGE_SIZE); -+#endif -+ if (!spare_page) -+ goto mem_err; -+ -+ ret = get_device_and_partition(argv[1], argv[2], &swap_dev, &swap_info, -+ 1); -+ if (ret < 0) -+ goto err; -+ -+ swsusp_header = spare_page; -+ if (page_read(offset, swsusp_header)) -+ goto read_err; -+ -+#ifdef SWSUSP_DEBUG_INFO -+ PAGEMAP_INFO("swssp_header:\n"); -+ PAGEMAP_INFO(" comp_crc: <snip>\n"); -+ PAGEMAP_INFO(" img_size: %d\n", swsusp_header->img_size); -+ PAGEMAP_INFO(" image(swap firest sector): %08x\n", -+ (unsigned int)swsusp_header->image); -+ PAGEMAP_INFO(" flags: %08x\n", swsusp_header->flags); -+ PAGEMAP_INFO(" orig_sig:%s\n", swsusp_header->orig_sig); -+ PAGEMAP_INFO(" sig:%s\n", swsusp_header->sig); -+#endif /* SWSUSP_DEBUG_INFO */ -+ -+ if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) { -+ printf("No hibernation image present\n"); -+ return 0; -+ } -+ -+#ifdef USE_CRC_32x4 -+ memset(&calc_crc, 0, sizeof(calc_crc)); -+ calc_crc32x4((u8 *)((unsigned long)offt_addr + PAGE_SIZE), -+ swsusp_header->img_size, &calc_crc); -+ -+ if (memcmp(&calc_crc, &swsusp_header->comp_crc32, -+ sizeof(CRC32_WORD4_t))) { -+ printf("Bad CRC for image, image: %08x:%08x:%08x:%08x, calc: %08x:%08x:%08x:%08x\n", -+ swsusp_header->comp_crc32.crc_w[0], -+ swsusp_header->comp_crc32.crc_w[1], -+ swsusp_header->comp_crc32.crc_w[2], -+ swsusp_header->comp_crc32.crc_w[3], -+ calc_crc.crc_w[0], calc_crc.crc_w[1], -+ calc_crc.crc_w[2], calc_crc.crc_w[3]); -+ return 0; -+ } -+#endif -+ -+ /* Overwrite header if necessary */ -+#ifndef SWSUSP_KEEP_IMAGE -+ if (memcmp(swsusp_header->sig, swsusp_header->orig_sig, 10)) { -+ memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); -+ if (page_write(offset, swsusp_header)) -+ printf("Write error resetting header\n"); -+ } -+#endif -+ -+ if (raw_page_init(swsusp_header->image)) -+ goto mem_err; -+ raw_page_start(); -+ -+ if (image_page_init(!(swsusp_header->flags & SF_NOCOMPRESS_MODE))) -+ goto mem_err; -+ image_page_start(); -+ -+ swsusp_info = spare_page; -+ if (raw_page_get_next(swsusp_info) <= 0) -+ goto read_err; -+ -+#ifdef SWSUSP_DEBUG_INFO -+ PAGEMAP_INFO("swsup_info:\n"); -+ PAGEMAP_INFO(" utsname.sysname:%s\n", swsusp_info->uts.sysname); -+ PAGEMAP_INFO(" nodename:%s\n", swsusp_info->uts.nodename); -+ PAGEMAP_INFO(" release:%s\n", swsusp_info->uts.release); -+ PAGEMAP_INFO(" version:%s\n", swsusp_info->uts.version); -+ PAGEMAP_INFO(" machine:%s\n", swsusp_info->uts.machine); -+ PAGEMAP_INFO(" vesion_code:%#08x\n", -+ (unsigned int)swsusp_info->version_code); -+ PAGEMAP_INFO(" num_physpages:%d\n", -+ (unsigned int)swsusp_info->num_physpages); -+ PAGEMAP_INFO(" pages :%d\n", -+ (unsigned int)swsusp_info->pages); -+ PAGEMAP_INFO(" size :%d\n", -+ (unsigned int)swsusp_info->size); -+#endif -+ -+ nr_pfn_pages = (swsusp_info->image_pages * 4 + PAGE_SIZE - 1) / -+ PAGE_SIZE; -+ pfn_pages = malloc(nr_pfn_pages * sizeof(u32 *)); -+ if (!pfn_pages) -+ goto mem_err; -+ memset(pfn_pages, 0, nr_pfn_pages * sizeof(u32 *)); -+ -+ /* UBOOT using memory */ -+ for (i = max_page; i <= high_page; i++) -+ free_page_mark_used(pg_ub2zero(i)); -+ -+ printf("Allocating %u bytes (nr_pfn_pages %u)\n", -+ nr_pfn_pages * PAGE_SIZE, nr_pfn_pages); -+ -+ for (i = 0; i < nr_pfn_pages; i++) { -+ u32 idx; -+#ifdef CONFIG_SH_DMA -+ pfn_pages[i] = malloc_aligned(PAGE_SIZE, ARCH_DMA_MINALIGN); -+#else -+ pfn_pages[i] = malloc(PAGE_SIZE); -+#endif -+ if (unlikely(!pfn_pages[i])) -+ goto mem_err; -+ if (unlikely(image_page_get_next(pfn_pages[i]) <= 0)) -+ goto read_err; -+ for (idx = 0; idx < PAGE_SIZE / sizeof(u32); idx++) { -+ u32 page = pfn_pages[i][idx]; -+ if (page == ~0UL) -+ break; -+ free_page_mark_used(pg_ub2zero(page)); -+ } -+ } -+ -+ printf("Loading image data pages (%lu pages)\n", -+ swsusp_info->image_pages); -+ -+ remap_orig_page = pg2addr(free_page_get_next()); -+ remap_temp_page = pg2addr(free_page_get_next()); -+ -+ remap_orig = (u32 **)remap_orig_page; -+ remap_temp = (u32 **)remap_temp_page; -+ remap_idx = 0; -+ -+ m = (swsusp_info->image_pages / 10) ? : 1; -+ for (i = 0; i < swsusp_info->image_pages; i++) { -+ u32 page = pfn_pages[i >> 10][i & 0x3ff]; -+ if (unlikely(!pfn_is_valid(page))) { -+ printf("Attempt to restore invalid address %llx\n", -+ pg2phys(page)); -+ continue; -+ } else if (unlikely(pfn_is_excluded(page))) { -+ printf("Attempt to restore excluded address %llx\n", -+ pg2phys(page)); -+ continue; -+ } else if (unlikely(pfn_is_low(page) && -+ pfn_is_occupied(page))) { -+ remap_orig[remap_idx] = pg2addr(page); -+ page = free_page_get_next(); -+ remap_temp[remap_idx] = pg2addr(page); -+ remap_idx++; -+#ifdef PAGEMAP_DEBUG -+ ++total_remap; -+#endif -+ /* If we fill our current page, allocate a new one */ -+ if (remap_idx + 1 == PAGE_SIZE / sizeof(u32)) { -+ u32 *next; -+ -+ next = pg2addr(free_page_get_next()); -+ remap_orig[remap_idx] = next; -+ remap_orig = (u32 **)next; -+ -+ next = pg2addr(free_page_get_next()); -+ remap_temp[remap_idx] = next; -+ remap_temp = (u32 **)next; -+ -+ remap_idx = 0; -+ } -+ } -+ if (image_page_get_next(pg2addr(page)) <= 0) -+ goto read_err; -+ if (!(i % m)) -+ printf("Image loading progress: %3d%%\n", 10 * i / m); -+ } -+ -+ printf("Image loading done.\n"); -+ invalidate_icache_all(); -+ -+ /* put end markers on the remap list */ -+ remap_orig[remap_idx] = (void *) ~0UL; -+ remap_temp[remap_idx] = (void *) ~0UL; -+ -+#ifdef PAGEMAP_DEBUG -+ PAGEMAP_INFO("Number of remap pages:%d\n", -+ total_remap); -+ PAGEMAP_INFO("Number of high pages:%d\n", -+ high_page_images); -+ PAGEMAP_INFO("Last read page %d (%08x)\n", -+ _last_read_pages, -+ _last_read_pages * PAGE_SIZE); -+#endif -+ remap_orig = (u32 **)remap_orig_page; -+ remap_temp = (u32 **)remap_temp_page; -+ -+ /* Make a copy of swsusp_finish in a free data page */ -+ data_page = pg2addr(free_page_get_next()); -+ memcpy(data_page, swsusp_finish_p, PAGE_SIZE); -+ swsusp_finish_copy = (void *) data_page; -+ -+ /* Setup context for swsusp_finish at the end of the data_page */ -+ context = (struct swsusp_finish_context *) (data_page + PAGE_SIZE - -+ sizeof(struct swsusp_finish_context)); -+ context->remap_orig_page = remap_orig_page; -+ context->remap_temp_page = remap_temp_page; -+ memcpy((void *)&context->archdata, (void *)swsusp_info->archdata, -+ sizeof(struct swsusp_archdata)); -+ -+ /* Get a stack pointer for swsusp_finish, growing down from context */ -+ stack_addr = (char *) context; -+ -+#ifdef CONFIG_NETCONSOLE -+ /* -+ * Stop the ethernet stack if NetConsole could have -+ * left it up -+ */ -+ eth_halt(); -+#endif -+ -+#ifdef CONFIG_USB_DEVICE -+ udc_disconnect(); -+#endif -+#ifdef PAGEMAP_DEBUG -+ PAGEMAP_INFO("Execution routine: %08x\n", -+ (u32)context->archdata.cpu_resume_restore_nosave); -+#endif -+ arch_preboot_os(); -+ cleanup_before_linux(); -+ -+ /* Copy the final data from a safe place */ -+ call_with_stack(swsusp_finish_copy, context, stack_addr); -+ -+ return 0; -+ -+mem_err: -+ printf("Not enough memory.\n"); -+ goto err; -+ -+read_err: -+ printf("Read error while restoring image.\n"); -+ -+err: -+ __asm__ volatile ( -+ "mov r0, #0\n" -+ "mcr p15, 0, r0, c7, c5, 0 @ invalidate icache\n" -+ "mcr p15, 0, r0, c7, c10, 4 @ DSB\n" -+ "mcr p15, 0, r0, c7, c5, 4 @ ISB\n" -+ : : : "r0", "memory"); -+ -+ raw_page_exit(); -+ image_page_exit(); -+ free_page_exit(); -+ if (pfn_pages) { -+ for (i = 0; i < nr_pfn_pages; i++) -+ free(pfn_pages[i]); -+ free(pfn_pages); -+ } -+ free(spare_page); -+ -+ return 1; -+} -+ -+U_BOOT_CMD(swsusp, 4, 0, do_swsusp, -+ "Restore SWSUSP hibernation image", -+ "<interface> [<dev[:part]>] [<offset>]" -+); --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Enable-swsusp-DMA-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Enable-swsusp-DMA-support.patch deleted file mode 100644 index 2a525d39a..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Enable-swsusp-DMA-support.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 33dfe19185b35fc61613070032836beee0f48c45 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 9 Jun 2017 20:45:39 +0900 -Subject: [PATCH 2/3] Enable swsusp DMA support - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - common/cmd_swsusp.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 58 insertions(+) - -diff --git a/common/cmd_swsusp.c b/common/cmd_swsusp.c -index ba05aa4..b1d6c22 100644 ---- a/common/cmd_swsusp.c -+++ b/common/cmd_swsusp.c -@@ -226,6 +226,53 @@ static inline void *malloc_aligned(u32 size, u32 align) - return (void *)(((u32)malloc(size + align) + align - 1) & ~(align - 1)); - } - -+static int block_read(u32 page, void *addr, u32 count) -+{ -+ __u32 cnt; -+ int blk_per_page; -+ -+ blk_per_page = PAGE_SIZE / swap_dev->blksz; -+ cnt = swap_dev->block_read(swap_dev->dev, -+ swap_info.start + (page * blk_per_page), -+ count * blk_per_page, addr); -+ -+ return cnt != count * blk_per_page; -+} -+ -+static int get_block(unsigned char *buffer, u32 size) -+{ -+ int need_num_pages = size / PAGE_SIZE; -+ int read_pages = 0; -+ int count; -+ u64 start; -+ -+ do { -+ u64 prev; -+ count = 0; -+ -+ if (!get_meta()) -+ goto exit; -+ -+ prev = start = meta_map->entries[meta_idx]; -+ do { -+ count++; -+ meta_idx++; -+ if (meta_map->entries[meta_idx] - prev > 1) -+ break; -+ prev = meta_map->entries[meta_idx]; -+ } while (read_pages + count < need_num_pages && -+ meta_idx < ARRAY_SIZE(meta_map->entries)); -+ -+ if (block_read(start, buffer, count)) -+ return -1; -+ read_pages += count; -+ buffer += count * PAGE_SIZE; -+ } while (read_pages < need_num_pages); -+ -+exit: -+ return read_pages * PAGE_SIZE; -+} -+ - #endif - - static int page_read(u32 page, void *addr) -@@ -465,12 +512,23 @@ static int image_page_get_next(void *buffer) - cmp_len = *(size_t *) cmp_buf; - cmp_avail = PAGE_SIZE; - -+#ifdef CONFIG_SH_DMA -+ while (cmp_avail < cmp_len + LZO_HEADER) { -+ /* try to DMA-read whole block */ -+ ret = get_block(cmp_buf + cmp_avail, -+ cmp_len + LZO_HEADER); -+ if (unlikely(ret <= 0)) -+ return ret; -+ cmp_avail += ret; -+ } -+#else - while (cmp_avail < cmp_len + LZO_HEADER) { - ret = raw_page_get_next(cmp_buf + cmp_avail); - if (unlikely(ret <= 0)) - return ret; - cmp_avail += PAGE_SIZE; - } -+#endif - unc_len = LZO_UNC_SIZE; - ret = lzo1x_decompress_safe(cmp_buf + LZO_HEADER, - cmp_len, unc_buf, &unc_len); --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch deleted file mode 100755 index 8bfcccbbf..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch +++ /dev/null @@ -1,1058 +0,0 @@ -From 4ce00daa904a40701ab6bed44506fe97b8f1da47 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 19 May 2017 14:48:38 +0900 -Subject: [PATCH 3/4] Add Hibernation swsuspmem command support - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - common/Makefile | 2 + - common/cmd_swsuspmem.c | 944 +++++++++++++++++++++++++++++++++++++++++++++ - include/swsuspmem.h | 24 ++ - lib/lzo/lzo1x_decompress.c | 12 +- - 4 files changed, 980 insertions(+), 2 deletions(-) - create mode 100644 common/cmd_swsuspmem.c - create mode 100644 include/swsuspmem.h - -diff --git a/common/Makefile b/common/Makefile -index 54fcc81..7a18486 100644 ---- a/common/Makefile -+++ b/common/Makefile -@@ -160,6 +160,8 @@ COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o - COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o - COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o - COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o -+COBJS-$(CONFIG_CMD_SWSUSP) += cmd_swsusp.o -+COBJS-$(CONFIG_CMD_SWSUSPMEM) += cmd_swsuspmem.o - COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o - COBJS-$(CONFIG_CMD_TIME) += cmd_time.o - COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o -diff --git a/common/cmd_swsuspmem.c b/common/cmd_swsuspmem.c -new file mode 100644 -index 0000000..6980aaf ---- /dev/null -+++ b/common/cmd_swsuspmem.c -@@ -0,0 +1,944 @@ -+/* -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * 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, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include <common.h> -+#include <command.h> -+#include <part.h> -+#include <malloc.h> -+ -+#include <linux/lzo.h> -+#include "../arch/arm/cpu/armv7/rmobile/crc32_word4.h" -+#include <swsuspmem.h> -+ -+/* Note for Renesas--based boards: -+ * We have the following memory split here: -+ * 0x40000000 - u_boot_lowest - used to store pfns at physical addresses -+ * u_boot_lowest - 0x8000000 - pfns are relocated, and then later put -+ * on physical addresses (swsusp_finish) -+ * 0x8000000 - 0xc0000000 - used to store pfns with physical address -+ * of 0x200000000 (long address), we have to change offset for them. -+ * Any pfn with address > 0x8000000 but less than 0x200000000 -+ * is an error. -+ * For boards which do not have memory above first GB, that will -+ * still work, as they won't have anything above 0x80000000 -+ * in their image, so for standard 2GB setup ou should put -+ * your secong GB in 0x80000000-0xC0000000 range, you can -+ * use MMU for that or if your RAM is continous, it will -+ * naturally be there. */ -+ -+DECLARE_GLOBAL_DATA_PTR; -+ -+/* #define PAGEMAP_DEBUG */ -+ -+#ifdef PAGEMAP_DEBUG -+#define SWSUSP_DEBUG_INFO -+#endif -+ -+#define SWSUSP_KEEP_IMAGE -+ -+#ifndef likely -+# define likely(x) __builtin_expect(!!(x), 1) -+# define unlikely(x) __builtin_expect(!!(x), 0) -+#endif -+ -+#define HIBERNATE_SIG "S1SUSPEND" -+#define PAGE_SIZE (4096) -+/* Define depending on CONFIG_LBDAF in kernel */ -+ -+typedef u64 sector_t; -+ -+struct swsusp_header { -+ char reserved[PAGE_SIZE - 20 -+ - sizeof(sector_t) - sizeof(int) - sizeof(u32) -+ - sizeof(CRC32_WORD4_t) - sizeof(u32)]; -+ CRC32_WORD4_t comp_crc32; -+ u32 img_size; /* append */ -+ u32 crc32; -+ sector_t image; -+ unsigned int flags; -+ char orig_sig[10]; -+ char sig[10]; -+} __packed; -+ -+#define __NEW_UTS_LEN 64 -+ -+struct new_utsname { -+ char sysname[__NEW_UTS_LEN + 1]; -+ char nodename[__NEW_UTS_LEN + 1]; -+ char release[__NEW_UTS_LEN + 1]; -+ char version[__NEW_UTS_LEN + 1]; -+ char machine[__NEW_UTS_LEN + 1]; -+ char domainname[__NEW_UTS_LEN + 1]; -+}; -+ -+struct swsusp_archdata { -+ u32 nosave_backup_phys; -+ u32 nosave_begin_phys; -+ u32 nosave_end_phys; -+ void (*cpu_resume_restore_nosave)(u32, u32, u32); -+}; -+ -+struct swsusp_info { -+ struct new_utsname uts; -+ u32 version_code; -+ unsigned long num_physpages; -+ int cpus; -+ unsigned long image_pages; -+ unsigned long pages; -+ unsigned long size; -+ char archdata[1024]; -+}; -+ -+struct swap_map_page { -+ u64 entries[PAGE_SIZE / sizeof(u64) - 1]; -+ u64 next_swap; -+}; -+ -+struct swsusp_finish_context { -+ void *remap_orig_page; -+ void *remap_temp_page; -+ struct swsusp_archdata archdata; -+}; -+#ifdef FTEN_SPF_SDRAM_BASE -+#define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE) -+#define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_LOAD_OFFSET) -+#else -+#define USED_ADDRESS_TOP (0x40000000) -+#define USED_ADDRESS_END (0x48000000) -+#endif -+#define PG_UB2ZERO(pg) ((pg) - CONFIG_SYS_SDRAM_BASE / PAGE_SIZE) -+static u32 const exclude_min_page = -+ (USED_ADDRESS_TOP) / PAGE_SIZE; -+static u32 const exclude_max_page = -+ (USED_ADDRESS_END - 1) / PAGE_SIZE; -+static u32 const exclude_min_page_ub = -+ PG_UB2ZERO((USED_ADDRESS_TOP) / PAGE_SIZE); -+static u32 const exclude_max_page_ub = -+ PG_UB2ZERO((USED_ADDRESS_END-1) / PAGE_SIZE); -+ -+/* -+ #define SD_PLATFORM_MODE 1 -+ #define SD_CRC32_MODE 4 -+ */ -+#define SF_NOCOMPRESS_MODE 2 -+ -+#define LZO_HEADER sizeof(size_t) -+ -+/* Number of pages/bytes we'll compress at one time. */ -+#define LZO_UNC_PAGES 32 -+#define LZO_UNC_SIZE (LZO_UNC_PAGES * PAGE_SIZE) -+ -+/* Number of pages/bytes we need for compressed data (worst case). */ -+#define LZO_CMP_PAGES DIV_ROUND_UP(lzo1x_worst_compress(LZO_UNC_SIZE) + \ -+ LZO_HEADER, PAGE_SIZE) -+#define LZO_CMP_SIZE (LZO_CMP_PAGES * PAGE_SIZE) -+ -+static struct swsuspmem_hook *_hook; -+ -+#define CALL_HOOK(f, param) \ -+ do { \ -+ if (_hook != NULL) { \ -+ if (_hook->f != NULL) \ -+ _hook->f(param); \ -+ } \ -+ } while (0) -+ -+#ifdef PAGEMAP_DEBUG -+static int debugout; -+static int _last_read_pages; -+#define PAGEMAP_INFO(_msg, ...) \ -+ do { \ -+ if (debugout == 1) \ -+ printf(_msg, ## __VA_ARGS__); \ -+ } while (0) -+#endif -+ -+#define HIGHMEM_PHYS_ADDR 0x200000000ULL -+#define HIGHMEM_VA 0x80000000UL -+#define HIGHMEM_PFN (HIGHMEM_PHYS_ADDR / PAGE_SIZE) -+#define LOW_TOP 0x80000000 -+#define LOW_TOP_PFN (LOW_TOP / PAGE_SIZE) -+#define LOW_BOTTOM CONFIG_SYS_SDRAM_BASE -+#define LOW_BOTTOM_PFN (LOW_BOTTOM / PAGE_SIZE) -+#define TOP_ADDRESS 0x240000000ULL -+ -+static inline int pfn_is_low(u32 pfn) -+{ -+ return ((pfn >= LOW_BOTTOM_PFN) && (pfn < LOW_TOP_PFN)); -+} -+ -+static inline int pfn_is_high(u32 pfn) -+{ -+ return (pfn >= HIGHMEM_PFN); -+} -+ -+#define pfn_is_valid(p) (pfn_is_low(p) || pfn_is_high(p)) -+ -+static inline int pfn_is_excluded(u32 pfn) -+{ -+ /* Allow bottom 2 pages for exception vectors */ -+ if (pfn < (LOW_BOTTOM_PFN + 2)) -+ return 0; -+ else if (exclude_min_page >= exclude_max_page) -+ return 0; -+ else -+ return (pfn >= exclude_min_page) && (pfn <= exclude_max_page); -+} -+/* PFN to zero-counted page */ -+static inline u32 pg_ub2zero(u32 pg) -+{ -+ return pg - LOW_BOTTOM_PFN; -+} -+ -+/* zero-counted page to PFN */ -+static inline u32 pg_zero2ub(u32 pg) -+{ -+ return pg + LOW_BOTTOM_PFN; -+} -+ -+/* PFN to physical address (64-bit (40-bit)) */ -+static inline u64 pg2phys(u32 page) -+{ -+ return (u64) page * PAGE_SIZE; -+} -+ -+/* PFN to virtual address */ -+static inline void *pg2addr(u32 page) -+{ -+ void *addr; -+ if (page >= HIGHMEM_PFN) -+ addr = (void *) (u32)(pg2phys(page - HIGHMEM_PFN) + HIGHMEM_VA); -+ else -+ addr = (void *) (u32)pg2phys(page); -+ -+ return addr; -+} -+/* Virtual address to PFN */ -+static inline u32 addr2pg(void *addr) -+{ -+ return ((u32)(addr)) / PAGE_SIZE; -+} -+static void *offt_addr = (void *)0x44000000; -+static int page_read_mem(u64 page, void *addr) -+{ -+ memcpy(addr, (u8 *)offt_addr + page * PAGE_SIZE, PAGE_SIZE); -+ return 0; -+} -+ -+#ifndef SWSUSP_KEEP_IMAGE -+static int page_write_mem(u32 page, void *addr) -+{ -+ memcpy((u8 *)offt_addr + page * PAGE_SIZE, addr, PAGE_SIZE); -+ return 0; -+} -+#endif -+ -+#define FAST_COPY -+static void __attribute__((section(".rodata"))) -+ __attribute__((optimize("O6", "unroll-loops"))) -+swsusp_finish(void *userdata) -+{ -+ struct swsusp_finish_context *context = userdata; -+ u32 **remap_orig; -+ u32 **remap_temp; -+ int idx = 0; -+ const int lastidx = PAGE_SIZE / sizeof(u32) - 1; -+ -+ remap_orig = context->remap_orig_page; -+ remap_temp = context->remap_temp_page; -+ -+ __asm__ volatile ("" : : : "memory"); -+ for (;;) { -+ u32 *orig, *temp; -+ int count; -+ -+ /* Linked list to next page */ -+ if (idx == lastidx) { -+ remap_orig = (u32 **)remap_orig[idx]; -+ remap_temp = (u32 **)remap_temp[idx]; -+ idx = 0; -+ } -+ if (unlikely(!remap_orig || remap_orig[idx] == (u32 *)~0UL)) -+ break; -+ orig = remap_orig[idx]; -+ temp = remap_temp[idx]; -+#ifdef FAST_COPY -+ count = PAGE_SIZE / sizeof(u32) / 32; -+ __asm__ volatile ( -+ "1:\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "ldmia %[rtemp]!, {r0-r7}\n" -+ "subs %[count], %[count], #1\n" -+ "stmia %[rorig]!, {r0-r7}\n" -+ "bgt 1b\n" -+ : /* No outputs */ -+ : -+ [rorig]"h" (orig), -+ [rtemp]"h" (temp), -+ [count]"h" (count) -+ : "r0", "r1", "r2", "r3", -+ "r4", "r5", "r6", "r7", -+ "cc", "memory" -+ ); -+#else -+ count = PAGE_SIZE / sizeof(u32); -+ while (count--) -+ *orig++ = *temp++; -+#endif -+#ifdef SWSUSP_CHECK_COPY_RESULT -+ count = PAGE_SIZE / sizeof(u32); -+ orig = remap_orig[idx]; -+ temp = remap_temp[idx]; -+ __asm__ volatile ( -+ "1:\n" -+ "ldr r3, [%[rorig]]\n" -+ "ldr r4, [%[rtemp]]\n" -+ "cmp r3, r4\n" -+ "bne 2f\n" -+ "add %[rorig], %[rorig], #4\n" -+ "add %[rtemp], %[rtemp], #4\n" -+ "subs %[count], %[count], #1\n" -+ "bgt 1b\n" -+ "b 3f\n" -+ "2:b 2b\n" -+ "3:\n" -+ : -+ [rorig]"+r" (orig), -+ [rtemp]"+r" (temp), -+ [count]"+r" (count) -+ : -+ : "r3", "r4", "cc", "memory" -+ ); -+#endif -+ idx++; -+ } -+ context->archdata.cpu_resume_restore_nosave( -+ context->archdata.nosave_backup_phys, -+ context->archdata.nosave_begin_phys, -+ context->archdata.nosave_end_phys); -+} -+ -+static struct swap_map_page *meta_map; -+static u64 meta_map_next; -+static u64 meta_map_curr; -+static u64 meta_map_start; -+static int meta_idx; -+ -+static int raw_page_init(u64 start) -+{ -+ meta_map = malloc(PAGE_SIZE); -+ if (!meta_map) -+ return -1; -+ meta_map_next = 0; -+ meta_map_curr = 0; -+ meta_map_start = start; -+ return 0; -+} -+ -+static void raw_page_start(void) -+{ -+ meta_idx = ARRAY_SIZE(meta_map->entries); -+ meta_map_next = meta_map_start; -+} -+ -+static int raw_page_get_next(void *buffer) -+{ -+ if (meta_idx == ARRAY_SIZE(meta_map->entries)) { -+ if (!meta_map_next) -+ return 0; -+ if (meta_map_curr != meta_map_next) { -+#ifdef PAGEMAP_DEBUG -+ PAGEMAP_INFO("META: %d (%08x)\n", (int)meta_map_next, -+ (unsigned int)(meta_map_next -+ * PAGE_SIZE)); -+#endif -+ if (page_read_mem(meta_map_next, meta_map)) -+ return -1; -+ meta_map_curr = meta_map_next; -+ meta_map_next = meta_map->next_swap; -+ } -+ meta_idx = 0; -+ } -+#ifdef PAGEMAP_DEBUG -+ { -+ static unsigned int pre; -+ if ((pre + 1) != meta_map->entries[meta_idx]) { -+ PAGEMAP_INFO("DATA-Skiped: %d->%d (%08x->%08x)\n", -+ pre, (unsigned int)meta_map->entries[meta_idx], -+ pre * PAGE_SIZE, -+ (unsigned int)(meta_map->entries[meta_idx] -+ * PAGE_SIZE)); -+ } -+ pre = meta_map->entries[meta_idx]; -+ _last_read_pages = pre; -+ } -+#endif -+ if (page_read_mem(meta_map->entries[meta_idx++], buffer)) -+ return -1; -+ -+ return 1; -+} -+ -+static void raw_page_exit(void) -+{ -+ free(meta_map); -+ meta_map = NULL; -+} -+ -+static int image_pages_avail; -+static unsigned char *unc_buf, *cmp_buf; -+static int unc_offset; -+ -+static int image_page_init(int compressed) -+{ -+ if (!compressed) -+ return 1; -+ -+ unc_buf = malloc(LZO_UNC_SIZE); -+ cmp_buf = malloc(LZO_CMP_SIZE); -+ if (!unc_buf || !cmp_buf) { -+ printf("not enogh memory\n"); -+ return 1; -+ } -+ return 0; -+} -+ -+static void image_page_start(void) -+{ -+ image_pages_avail = 0; -+} -+ -+static int image_page_get_next(void *buffer) -+{ -+#ifdef CONFIG_LZO -+ if (!image_pages_avail) { -+ int ret; -+ size_t unc_len, cmp_len, cmp_avail; -+ -+ ret = raw_page_get_next(cmp_buf); -+ if (ret <= 0) -+ return ret; -+ -+ cmp_len = *(size_t *) cmp_buf; -+ cmp_avail = PAGE_SIZE; -+ -+ while (cmp_avail < cmp_len + LZO_HEADER) { -+ ret = raw_page_get_next(cmp_buf + cmp_avail); -+ if (unlikely(ret <= 0)) -+ return ret; -+ cmp_avail += PAGE_SIZE; -+ } -+ -+ unc_len = LZO_UNC_SIZE; -+ ret = lzo1x_decompress_safe(cmp_buf + LZO_HEADER, -+ cmp_len, unc_buf, &unc_len); -+ if (unlikely(ret != LZO_E_OK)) { -+ printf("Decompression failure: %d," -+ " cmp_buf = %p," -+ " cmp_len = %d, unc_len = %d\n", -+ ret, cmp_buf + LZO_HEADER, cmp_len, -+ unc_len); -+ return ret; -+ } -+ image_pages_avail = unc_len / PAGE_SIZE; -+ unc_offset = 0; -+ } -+ -+ memcpy(buffer, unc_buf + unc_offset, PAGE_SIZE); -+ unc_offset += PAGE_SIZE; -+ image_pages_avail--; -+ return 1; -+#else -+ printf("No LZO support in u-boot.\n"); -+ return -1; -+#endif -+} -+ -+static void image_page_exit(void) -+{ -+ free(unc_buf); -+ free(cmp_buf); -+ unc_buf = cmp_buf = NULL; -+} -+ -+static void bitmap_set(u32 *bm, unsigned int bit) -+{ -+ bm[bit >> 5] |= (1 << (bit & 0x1f)); -+} -+ -+static int bitmap_is_set(u32 *bm, unsigned int bit) -+{ -+ return !!(bm[bit >> 5] & (1 << (bit & 0x1f))); -+} -+ -+static u32 *used_bitmap; -+static u32 next_free_page; -+static u32 total_pages; -+ -+static int free_page_init(void) -+{ -+ total_pages = (u32)((TOP_ADDRESS - -+ LOW_BOTTOM) / PAGE_SIZE); /* 2GB */ -+ used_bitmap = malloc(total_pages * sizeof(u32) / 32); -+ if (!used_bitmap) -+ return -1; -+ return 0; -+} -+ -+static void free_page_start(int offset) -+{ -+ memset(used_bitmap, 0, total_pages * sizeof(u32) / 32); -+ next_free_page = pg_ub2zero(offset); -+} -+ -+static void free_page_mark_used(u32 page); -+/* Returns full-address based pages */ -+static int free_page_get_next(void) -+{ -+ while (bitmap_is_set(used_bitmap, next_free_page)) -+ next_free_page++; -+ free_page_mark_used(next_free_page); -+ return pg_zero2ub(next_free_page++); -+} -+ -+static void free_page_mark_used(u32 page) -+{ -+ bitmap_set(used_bitmap, page); -+} -+ -+static void free_page_exit(void) -+{ -+ free(used_bitmap); -+ used_bitmap = NULL; -+} -+ -+void set_swsuspmem_hook(struct swsuspmem_hook *hook) -+{ -+ _hook = hook; -+} -+ -+/* -+ * rtn = 1 : Hibernation image OK. -+ * rtn = 0 : Hibernation image NG. -+ * */ -+int do_checksnapimage(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -+{ -+ __u32 offset = 0; -+ void *spare_page = NULL; -+ struct swsusp_header *swsusp_header; -+ CRC32_WORD4_t calc_crc; -+ -+ /* Address hack */ -+ if (argc > 1) { -+ char *ep; -+ offt_addr = (void *)simple_strtoul(argv[1], &ep, 16); -+ if (*ep) { -+ printf("Invalid address\n"); -+ return 0; -+ } -+ } -+ -+ spare_page = malloc(PAGE_SIZE); -+ if (!spare_page) -+ goto mem_err; -+ -+ swsusp_header = spare_page; -+ if (page_read_mem(offset, swsusp_header)) -+ goto read_err; -+ -+#ifdef SWSUSP_DEBUG_INFO -+ PAGEMAP_INFO("swssp_header:%x\n", swsusp_header); -+ PAGEMAP_INFO(" comp_crc: <snip>\n"); -+ PAGEMAP_INFO(" img_size: %d\n", swsusp_header->img_size); -+ PAGEMAP_INFO(" image(swap firest sector): %08x\n", -+ (unsigned int)swsusp_header->image); -+ PAGEMAP_INFO(" flags: %08x\n", swsusp_header->flags); -+ PAGEMAP_INFO(" orig_sig:%s\n", swsusp_header->orig_sig); -+ PAGEMAP_INFO(" sig:%s\n", swsusp_header->sig); -+#endif /* SWSUSP_DEBUG_INFO */ -+ -+ if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10) -+ || (swsusp_header->img_size == 0) -+ || (swsusp_header->img_size > 0x03fff000)) { -+ printf("No hibernation image present\n"); -+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE); -+ return 0; -+ } -+ memset(&calc_crc, 0, sizeof(calc_crc)); -+ -+ calc_crc32x4((u8 *)((unsigned long)offt_addr + PAGE_SIZE), -+ swsusp_header->img_size, &calc_crc); -+ -+ if (memcmp(&calc_crc, &swsusp_header->comp_crc32, -+ sizeof(CRC32_WORD4_t))) { -+ printf("Bad CRC for image, image: %08x:%08x:" -+ "%08x:%08x, calc: %08x:%08x:%08x:%08x\n", -+ swsusp_header->comp_crc32.crc_w[0], -+ swsusp_header->comp_crc32.crc_w[1], -+ swsusp_header->comp_crc32.crc_w[2], -+ swsusp_header->comp_crc32.crc_w[3], -+ calc_crc.crc_w[0], calc_crc.crc_w[1], -+ calc_crc.crc_w[2], calc_crc.crc_w[3]); -+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE); -+ return 0; -+ } -+ free(spare_page); -+ printf("Hibernation image OK!.\n"); -+ -+ return 1; -+ -+mem_err: -+ printf("Not enough memory.\n"); -+ CALL_HOOK(err_hook, SWSUSPMEM_ENOMEM); -+ goto err; -+ -+read_err: -+ printf("Read error while restoring image.\n"); -+ -+err: -+ __asm__ volatile ( -+ "mov r0, #0\n" -+ "mcr p15, 0, r0, c7, c5, 0 @ invalidate icache\n" -+ "mcr p15, 0, r0, c7, c10, 4 @ DSB\n" -+ "mcr p15, 0, r0, c7, c5, 4 @ ISB\n" -+ : : : "r0", "memory"); -+ -+ free(spare_page); -+ -+ CALL_HOOK(err_hook, SWSUSPMEM_RESTOREFAIL); -+ return 0; -+} -+ -+U_BOOT_CMD(checksnapimage, 2, 2, do_checksnapimage, -+ "Check hibernation image data from memory", -+ "<address>]" -+); -+ -+int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -+{ -+ __u32 offset = 0; -+ void *spare_page = NULL; -+ struct swsusp_header *swsusp_header; -+ struct swsusp_info *swsusp_info; -+ struct swsusp_finish_context *context; -+ int max_page; -+ int i; -+ u32 nr_pfn_pages; -+ u32 **pfn_pages = NULL; -+ u32 *remap_orig_page; -+ u32 *remap_temp_page; -+ u32 **remap_orig; -+ u32 **remap_temp; -+ int remap_idx; -+ void (*swsusp_finish_copy)(void *); -+ char *data_page; -+ char *stack_addr; -+ CRC32_WORD4_t calc_crc; -+ int high_page; -+ -+#ifdef PAGEMAP_DEBUG -+ int high_page_images = 0; -+ int total_remap = 0; -+ if (getenv("hybdebug") != NULL) -+ debugout = 1; -+#endif -+ /* Address hack */ -+ void *swsusp_finish_p = (void *)((u32)swsusp_finish & ~0x1); -+ if (argc > 1) { -+ char *ep; -+ offt_addr = (void *)simple_strtoul(argv[1], &ep, 16); -+ if (*ep) { -+ printf("Invalid address\n"); -+ return 1; -+ } -+ } -+ -+ /* Allow for 16 pages of stack */ -+ max_page = gd->start_addr_sp / PAGE_SIZE - 32; -+ high_page = (((gd->relocaddr + _bss_end_ofs) -+ + (PAGE_SIZE - 1)) / PAGE_SIZE) + 1; -+#define pfn_is_occupied(pfn) (page > max_page && page <= high_page) -+#ifdef PAGEMAP_DEBUG -+ PAGEMAP_INFO(" *gd->start_addr_sp:%p\n", -+ (void *)gd->start_addr_sp); -+ PAGEMAP_INFO(" *gd->relocaddr:%p\n", -+ (void *)gd->relocaddr); -+ PAGEMAP_INFO(" *bss_start_offset:%d bss_end_offset:%d\n", -+ (int)_bss_start_ofs, (int)_bss_end_ofs); -+ PAGEMAP_INFO(" UBOOT own memory [%p-%p]\n", -+ pg2addr(max_page), pg2addr(high_page)); -+#endif -+ if (free_page_init()) -+ goto mem_err; -+ free_page_start(exclude_max_page + 1); -+ -+ spare_page = malloc(PAGE_SIZE); -+ if (!spare_page) -+ goto mem_err; -+ -+ swsusp_header = spare_page; -+ if (page_read_mem(offset, swsusp_header)) -+ goto read_err; -+ -+#ifdef SWSUSP_DEBUG_INFO -+ PAGEMAP_INFO("swssp_header:\n"); -+ PAGEMAP_INFO(" comp_crc: <snip>\n"); -+ PAGEMAP_INFO(" img_size: %d\n", swsusp_header->img_size); -+ PAGEMAP_INFO(" image(swap firest sector): %08x\n", -+ (unsigned int)swsusp_header->image); -+ PAGEMAP_INFO(" flags: %08x\n", swsusp_header->flags); -+ PAGEMAP_INFO(" orig_sig:%s\n", swsusp_header->orig_sig); -+ PAGEMAP_INFO(" sig:%s\n", swsusp_header->sig); -+#endif /* SWSUSP_DEBUG_INFO */ -+ -+ if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10) -+ || (swsusp_header->img_size == 0) -+ || (swsusp_header->img_size > 0x03fff000)) { -+ printf("No hibernation image present\n"); -+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE); -+ return 0; -+ } -+ memset(&calc_crc, 0, sizeof(calc_crc)); -+ -+ calc_crc32x4((u8 *)((unsigned long)offt_addr + PAGE_SIZE), -+ swsusp_header->img_size, &calc_crc); -+ -+ if (memcmp(&calc_crc, &swsusp_header->comp_crc32, -+ sizeof(CRC32_WORD4_t))) { -+ printf("Bad CRC for image, image: %08x:%08x:" -+ "%08x:%08x, calc: %08x:%08x:%08x:%08x\n", -+ swsusp_header->comp_crc32.crc_w[0], -+ swsusp_header->comp_crc32.crc_w[1], -+ swsusp_header->comp_crc32.crc_w[2], -+ swsusp_header->comp_crc32.crc_w[3], -+ calc_crc.crc_w[0], calc_crc.crc_w[1], -+ calc_crc.crc_w[2], calc_crc.crc_w[3]); -+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE); -+ return 0; -+ } -+ -+ /* Overwrite header if necessary */ -+#ifndef SWSUSP_KEEP_IMAGE -+ if (memcmp(swsusp_header->sig, swsusp_header->orig_sig, 10)) { -+ memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); -+ if (page_write_mem(offset, swsusp_header)) -+ printf("Write error resetting header\n"); -+ } -+#endif -+ -+ if (raw_page_init(swsusp_header->image)) -+ goto mem_err; -+ raw_page_start(); -+ -+ if (image_page_init(!(swsusp_header->flags & SF_NOCOMPRESS_MODE))) -+ goto mem_err; -+ image_page_start(); -+ -+ swsusp_info = spare_page; -+ if (raw_page_get_next(swsusp_info) <= 0) -+ goto read_err; -+ -+#ifdef SWSUSP_DEBUG_INFO -+ PAGEMAP_INFO("swsup_info:\n"); -+ PAGEMAP_INFO(" utsname.sysname:%s\n", -+ swsusp_info->uts.sysname); -+ PAGEMAP_INFO(" nodename:%s\n", -+ swsusp_info->uts.nodename); -+ PAGEMAP_INFO(" release:%s\n", -+ swsusp_info->uts.release); -+ PAGEMAP_INFO(" version:%s\n", -+ swsusp_info->uts.version); -+ PAGEMAP_INFO(" machine:%s\n", -+ swsusp_info->uts.machine); -+ PAGEMAP_INFO(" vesion_code:%#08x\n", -+ (unsigned int)swsusp_info->version_code); -+ PAGEMAP_INFO(" num_physpages:%d\n", -+ (unsigned int)swsusp_info->num_physpages); -+ PAGEMAP_INFO(" pages :%d\n", -+ (unsigned int)swsusp_info->pages); -+ PAGEMAP_INFO(" size :%d\n", -+ (unsigned int)swsusp_info->size); -+#endif -+ -+ nr_pfn_pages = (swsusp_info->image_pages * 4 + PAGE_SIZE - 1) / -+ PAGE_SIZE; -+ pfn_pages = malloc(nr_pfn_pages * sizeof(u32 *)); -+ if (!pfn_pages) -+ goto mem_err; -+ memset(pfn_pages, 0, nr_pfn_pages * sizeof(u32 *)); -+ -+ /* UBOOT using memory */ -+ for (i = max_page; i <= high_page; i++) -+ free_page_mark_used(pg_ub2zero(i)); -+ -+ printf("Allocating %u bytes (nr_pfn_pages %u)\n", -+ nr_pfn_pages * PAGE_SIZE, nr_pfn_pages); -+ -+ for (i = 0; i < nr_pfn_pages; i++) { -+ u32 idx; -+ pfn_pages[i] = malloc(PAGE_SIZE); -+ memset(pfn_pages[i], 0xff, PAGE_SIZE); -+ if (unlikely(!pfn_pages[i])) -+ goto mem_err; -+ if (unlikely(image_page_get_next(pfn_pages[i]) <= 0)) -+ goto read_err; -+ for (idx = 0; idx < PAGE_SIZE / sizeof(u32); idx++) { -+ u32 page = pfn_pages[i][idx]; -+ if (page == ~0UL) /* End of list of pages */ -+ break; -+ free_page_mark_used(pg_ub2zero(page)); -+ } -+ } -+ -+ printf("Loading image data pages (%lu pages)\n", -+ swsusp_info->image_pages); -+ -+ remap_orig_page = pg2addr(free_page_get_next()); -+ remap_temp_page = pg2addr(free_page_get_next()); -+ -+ remap_orig = (u32 **)remap_orig_page; -+ remap_temp = (u32 **)remap_temp_page; -+ remap_idx = 0; -+ -+ for (i = 0; i < swsusp_info->image_pages; i++) { -+ u32 page = pfn_pages[i >> 10][i & 0x3ff]; -+ if (unlikely(!pfn_is_valid(page))) { -+ printf("Attempt to restore invalid address %llx\n", -+ pg2phys(page)); -+ continue; -+ } else if (unlikely(pfn_is_excluded(page))) { -+ printf("Attempt to restore excluded address %llx\n", -+ pg2phys(page)); -+ continue; -+ } else if (unlikely(pfn_is_low(page) && -+ pfn_is_occupied(page))) { -+ remap_orig[remap_idx] = pg2addr(page); -+ page = free_page_get_next(); -+ remap_temp[remap_idx] = pg2addr(page); -+ remap_idx++; -+#ifdef PAGEMAP_DEBUG -+ ++total_remap; -+#endif -+ /* If we fill our current page, allocate a new one */ -+ if (remap_idx + 1 == PAGE_SIZE / sizeof(u32)) { -+ u32 *next; -+ -+ next = pg2addr(free_page_get_next()); -+ remap_orig[remap_idx] = next; -+ remap_orig = (u32 **)next; -+ -+ next = pg2addr(free_page_get_next()); -+ remap_temp[remap_idx] = next; -+ remap_temp = (u32 **)next; -+ -+ remap_idx = 0; -+ } -+ } -+ if (image_page_get_next(pg2addr(page)) <= 0) -+ goto read_err; -+ } -+ -+ printf("Image loading done.\n"); -+ invalidate_icache_all(); -+ -+ CALL_HOOK(resume_boot, SWSUSPMEM_IMAGEDONE); -+ /* put end markers on the remap list */ -+ remap_orig[remap_idx] = (void *) ~0UL; -+ remap_temp[remap_idx] = (void *) ~0UL; -+ -+#ifdef PAGEMAP_DEBUG -+ PAGEMAP_INFO("Number of remap pages:%d\n", total_remap); -+ PAGEMAP_INFO("Number of high pages:%d\n", high_page_images); -+ PAGEMAP_INFO("Last read page %d (%08x)\n", -+ _last_read_pages, _last_read_pages * PAGE_SIZE); -+#endif -+ remap_orig = (u32 **)remap_orig_page; -+ remap_temp = (u32 **)remap_temp_page; -+ -+ /* Make a copy of swsusp_finish in a free data page */ -+ data_page = pg2addr(free_page_get_next()); -+ memcpy(data_page, swsusp_finish_p, PAGE_SIZE); -+ swsusp_finish_copy = (void *) data_page; -+ -+ /* Setup context for swsusp_finish at the end of the data_page */ -+ context = (struct swsusp_finish_context *) (data_page + PAGE_SIZE - -+ sizeof(struct swsusp_finish_context)); -+ context->remap_orig_page = remap_orig_page; -+ context->remap_temp_page = remap_temp_page; -+ memcpy((void *)&context->archdata, (void *)swsusp_info->archdata, -+ sizeof(struct swsusp_archdata)); -+ -+ /* Get a stack pointer for swsusp_finish, growing down from context */ -+ stack_addr = (char *) context; -+ -+#ifdef CONFIG_NETCONSOLE -+ /* -+ * Stop the ethernet stack if NetConsole could have -+ * left it up -+ */ -+ eth_halt(); -+#endif -+#ifdef CONFIG_USB_DEVICE -+ udc_disconnect(); -+#endif -+ arch_preboot_os(); -+ cleanup_before_linux(); -+ -+ CALL_HOOK(resume_boot, SWSUSPMEM_RESUME); -+ /* Copy the final data from a safe place */ -+ call_with_stack(swsusp_finish_copy, context, stack_addr); -+ -+ return 0; -+ -+mem_err: -+ printf("Not enough memory.\n"); -+ CALL_HOOK(err_hook, SWSUSPMEM_ENOMEM); -+ goto err; -+ -+read_err: -+ printf("Read error while restoring image.\n"); -+ -+err: -+ __asm__ volatile ( -+ "mov r0, #0\n" -+ "mcr p15, 0, r0, c7, c5, 0 @ invalidate icache\n" -+ "mcr p15, 0, r0, c7, c10, 4 @ DSB\n" -+ "mcr p15, 0, r0, c7, c5, 4 @ ISB\n" -+ : : : "r0", "memory"); -+ -+ raw_page_exit(); -+ image_page_exit(); -+ free_page_exit(); -+ if (pfn_pages) { -+ for (i = 0; i < nr_pfn_pages; i++) -+ free(pfn_pages[i]); -+ free(pfn_pages); -+ } -+ free(spare_page); -+ -+ CALL_HOOK(err_hook, SWSUSPMEM_RESTOREFAIL); -+ return 1; -+} -+ -+U_BOOT_CMD(swsuspmem, 2, 2, do_swsuspmem, -+ "Restore SWSUSP hibernation image from memory", -+ "<address>]" -+); -diff --git a/include/swsuspmem.h b/include/swsuspmem.h -new file mode 100644 -index 0000000..3b353ea ---- /dev/null -+++ b/include/swsuspmem.h -@@ -0,0 +1,24 @@ -+#ifndef _SWSUSPMEM_H_ -+#define _SWSUSPMEM_H_ -+ -+enum { SWSUSPMEM_NORM = 0, -+ SWSUSPMEM_NOIMAGE = 0x01, -+ SWSUSPMEM_BROKENIMAGE = 0x02, -+ SWSUSPMEM_ENOMEM = 0x80, -+ SWSUSPMEM_RESTOREFAIL = 0x81, -+}; -+ -+enum { SWSUSPMEM_IMAGEDONE = 0x01, -+ SWSUSPMEM_RESUME = 0x02 -+}; -+ -+struct swsuspmem_hook { -+ void (*err_hook)(int errcode); -+ void (*resume_boot)(int param); -+}; -+ -+void set_swsuspmem_hook(struct swsuspmem_hook *hook); -+void arch_preboot_os(void); -+void call_with_stack(void (*fn)(void *), -+ void *userdata, void *stack); -+#endif -diff --git a/lib/lzo/lzo1x_decompress.c b/lib/lzo/lzo1x_decompress.c -index e6ff708..ebdf10b 100644 ---- a/lib/lzo/lzo1x_decompress.c -+++ b/lib/lzo/lzo1x_decompress.c -@@ -68,13 +68,14 @@ int lzop_decompress(const unsigned char *src, size_t src_len, - unsigned char *start = dst; - const unsigned char *send = src + src_len; - u32 slen, dlen; -- size_t tmp; -+ size_t tmp, remaining; - int r; - - src = parse_header(src); - if (!src) - return LZO_E_ERROR; - -+ remaining = *dst_len; - while (src < send) { - /* read uncompressed block size */ - dlen = get_unaligned_be32(src); -@@ -93,18 +94,25 @@ int lzop_decompress(const unsigned char *src, size_t src_len, - if (slen <= 0 || slen > dlen) - return LZO_E_ERROR; - -+ /* abort if buffer ran out of room */ -+ if (dlen > remaining) -+ return LZO_E_OUTPUT_OVERRUN; -+ - /* decompress */ - tmp = dlen; - r = lzo1x_decompress_safe((u8 *) src, slen, dst, &tmp); - -- if (r != LZO_E_OK) -+ if (r != LZO_E_OK) { -+ *dst_len = dst - start; - return r; -+ } - - if (dlen != tmp) - return LZO_E_ERROR; - - src += slen; - dst += dlen; -+ remaining -= dlen; - } - - return LZO_E_INPUT_OVERRUN; --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-hibernation-image-area.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-hibernation-image-area.patch deleted file mode 100644 index e6682354e..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-hibernation-image-area.patch +++ /dev/null @@ -1,91 +0,0 @@ -From eae2ee2090f8c9c140a1b766bd7312be5f0f308d Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 9 Jun 2017 20:46:54 +0900 -Subject: [PATCH 3/3] Add hibernation image area - -0x40000000 <-> 0x77FFFFFF : kernel -0x78000000 <-> 0x7FFFFFFF : hibernation image area - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - common/cmd_swsuspmem.c | 20 +++++++++++++------- - 1 file changed, 13 insertions(+), 7 deletions(-) - -diff --git a/common/cmd_swsuspmem.c b/common/cmd_swsuspmem.c -index 6980aaf..dbc000c 100644 ---- a/common/cmd_swsuspmem.c -+++ b/common/cmd_swsuspmem.c -@@ -116,8 +116,9 @@ struct swsusp_finish_context { - #define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE) - #define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_LOAD_OFFSET) - #else --#define USED_ADDRESS_TOP (0x40000000) --#define USED_ADDRESS_END (0x48000000) -+#define CONFIG_SYS_LOAD_OFFSET 0x0 -+#define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE) -+#define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_LOAD_OFFSET) - #endif - #define PG_UB2ZERO(pg) ((pg) - CONFIG_SYS_SDRAM_BASE / PAGE_SIZE) - static u32 const exclude_min_page = -@@ -157,7 +158,7 @@ static struct swsuspmem_hook *_hook; - } while (0) - - #ifdef PAGEMAP_DEBUG --static int debugout; -+static int debugout = 1; - static int _last_read_pages; - #define PAGEMAP_INFO(_msg, ...) \ - do { \ -@@ -231,7 +232,7 @@ static inline u32 addr2pg(void *addr) - { - return ((u32)(addr)) / PAGE_SIZE; - } --static void *offt_addr = (void *)0x44000000; -+static void *offt_addr = (void *)0x78000000; - static int page_read_mem(u64 page, void *addr) - { - memcpy(addr, (u8 *)offt_addr + page * PAGE_SIZE, PAGE_SIZE); -@@ -577,7 +578,7 @@ int do_checksnapimage(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) - - if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10) - || (swsusp_header->img_size == 0) -- || (swsusp_header->img_size > 0x03fff000)) { -+ || (swsusp_header->img_size > 0x05fff000)) { - printf("No hibernation image present\n"); - CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE); - return 0; -@@ -674,7 +675,9 @@ int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) - /* Allow for 16 pages of stack */ - max_page = gd->start_addr_sp / PAGE_SIZE - 32; - high_page = (((gd->relocaddr + _bss_end_ofs) -- + (PAGE_SIZE - 1)) / PAGE_SIZE) + 1; -+ + (PAGE_SIZE - 1)) / PAGE_SIZE) + 1 + 0xf; -+ if (high_page > 0x7ffff) -+ high_page = 0x7ffff; - #define pfn_is_occupied(pfn) (page > max_page && page <= high_page) - #ifdef PAGEMAP_DEBUG - PAGEMAP_INFO(" *gd->start_addr_sp:%p\n", -@@ -711,7 +714,7 @@ int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) - - if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10) - || (swsusp_header->img_size == 0) -- || (swsusp_header->img_size > 0x03fff000)) { -+ || (swsusp_header->img_size > 0x05fff000)) { - printf("No hibernation image present\n"); - CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE); - return 0; -@@ -830,8 +833,11 @@ int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) - continue; - } else if (unlikely(pfn_is_low(page) && - pfn_is_occupied(page))) { -+ /* Virtual 32-bit original address */ - remap_orig[remap_idx] = pg2addr(page); -+ /* allocating new free page */ - page = free_page_get_next(); -+ /* Virtual 32-bit remap address */ - remap_temp[remap_idx] = pg2addr(page); - remap_idx++; - #ifdef PAGEMAP_DEBUG --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0004-Add-porter-board-Hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0004-Add-porter-board-Hibernation-code.patch deleted file mode 100755 index 1b2278b2e..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0004-Add-porter-board-Hibernation-code.patch +++ /dev/null @@ -1,1352 +0,0 @@ -From 80d5c1269bd16fedce41611e45f25d156425b0c9 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 19 May 2017 16:16:18 +0900 -Subject: [PATCH 4/4] Add porter board Hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - arch/arm/cpu/armv7/Makefile | 4 + - arch/arm/cpu/armv7/arch_timer.c | 58 ++++++ - arch/arm/cpu/armv7/cache_v7.c | 14 +- - arch/arm/cpu/armv7/rmobile/Makefile | 4 + - arch/arm/cpu/armv7/rmobile/arm_arch_timer.c | 61 ++++++ - arch/arm/cpu/armv7/rmobile/crc32_word4.c | 299 ++++++++++++++++++++++++++++ - arch/arm/cpu/armv7/rmobile/crc32_word4.h | 23 +++ - arch/arm/cpu/armv7/rmobile/sh_timer.c | 209 +++++++++++++++++++ - arch/arm/include/asm/arch-rmobile/rmobile.h | 2 + - arch/arm/include/asm/armv7.h | 16 +- - arch/arm/include/asm/system.h | 136 ++++++++++++- - arch/arm/lib/Makefile | 2 + - arch/arm/lib/board.c | 2 +- - arch/arm/lib/cache-cp15.c | 123 +++++++++++- - arch/arm/lib/call_with_stack.S | 20 ++ - board/renesas/porter/porter.c | 10 + - include/configs/porter.h | 19 +- - 17 files changed, 977 insertions(+), 25 deletions(-) - create mode 100644 arch/arm/cpu/armv7/arch_timer.c - create mode 100644 arch/arm/cpu/armv7/rmobile/arm_arch_timer.c - create mode 100644 arch/arm/cpu/armv7/rmobile/crc32_word4.c - create mode 100644 arch/arm/cpu/armv7/rmobile/crc32_word4.h - create mode 100644 arch/arm/cpu/armv7/rmobile/sh_timer.c - create mode 100644 arch/arm/lib/call_with_stack.S - -diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile -index 4fdbee4..f68ce5c 100644 ---- a/arch/arm/cpu/armv7/Makefile -+++ b/arch/arm/cpu/armv7/Makefile -@@ -32,6 +32,10 @@ COBJS += cache_v7.o - COBJS += cpu.o - COBJS += syslib.o - -+ifneq ($(CONFIG_SYS_ARCH_TIMER),) -+COBJS += arch_timer.o -+endif -+ - ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA20),) - SOBJS += lowlevel_init.o - endif -diff --git a/arch/arm/cpu/armv7/arch_timer.c b/arch/arm/cpu/armv7/arch_timer.c -new file mode 100644 -index 0000000..747b6e9 ---- /dev/null -+++ b/arch/arm/cpu/armv7/arch_timer.c -@@ -0,0 +1,58 @@ -+/* -+ * (C) Copyright 2012-2014 -+ * Texas Instruments Incorporated, <www.ti.com> -+ * -+ * SPDX-License-Identifier: GPL-2.0+ -+ */ -+ -+#include <common.h> -+#include <asm/io.h> -+#include <div64.h> -+ -+DECLARE_GLOBAL_DATA_PTR; -+ -+int timer_init(void) -+{ -+ gd->tbl = 0; -+ gd->tbu = 0; -+ -+ gd->timer_rate_hz = CONFIG_SYS_HZ_CLOCK / CONFIG_SYS_HZ; -+ -+ return 0; -+} -+ -+unsigned long long get_ticks(void) -+{ -+ ulong nowl, nowu; -+ -+ asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (nowl), "=r" (nowu)); -+ -+ gd->tbl = nowl; -+ gd->tbu = nowu; -+ -+ return (((unsigned long long)gd->tbu) << 32) | gd->tbl; -+} -+ -+ -+ulong get_timer(ulong base) -+{ -+ return lldiv(get_ticks(), gd->timer_rate_hz) - base; -+} -+ -+void __udelay(unsigned long usec) -+{ -+ unsigned long long endtime; -+ -+ endtime = lldiv((unsigned long long)usec * gd->timer_rate_hz, -+ 1000UL); -+ -+ endtime += get_ticks(); -+ -+ while (get_ticks() < endtime) -+ ; -+} -+ -+ulong get_tbclk(void) -+{ -+ return gd->timer_rate_hz; -+} -diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c -index 5f6d039..5a0bdb8 100644 ---- a/arch/arm/cpu/armv7/cache_v7.c -+++ b/arch/arm/cpu/armv7/cache_v7.c -@@ -82,7 +82,7 @@ static void v7_inval_dcache_level_setway(u32 level, u32 num_sets, - } - } - /* DSB to make sure the operation is complete */ -- CP15DSB; -+ DSB(); - } - - static void v7_clean_inval_dcache_level_setway(u32 level, u32 num_sets, -@@ -109,7 +109,7 @@ static void v7_clean_inval_dcache_level_setway(u32 level, u32 num_sets, - } - } - /* DSB to make sure the operation is complete */ -- CP15DSB; -+ DSB(); - } - - static void v7_maint_dcache_level_setway(u32 level, u32 operation) -@@ -230,7 +230,7 @@ static void v7_dcache_maint_range(u32 start, u32 stop, u32 range_op) - } - - /* DSB to make sure the operation is complete */ -- CP15DSB; -+ DSB(); - } - - /* Invalidate TLB */ -@@ -243,9 +243,9 @@ static void v7_inval_tlb(void) - /* Invalidate entire instruction TLB */ - asm volatile ("mcr p15, 0, %0, c8, c5, 0" : : "r" (0)); - /* Full system DSB - make sure that the invalidation is complete */ -- CP15DSB; -+ DSB(); - /* Full system ISB - make sure the instruction stream sees it */ -- CP15ISB; -+ ISB(); - } - - void invalidate_dcache_all(void) -@@ -356,10 +356,10 @@ void invalidate_icache_all(void) - asm volatile ("mcr p15, 0, %0, c7, c5, 6" : : "r" (0)); - - /* Full system DSB - make sure that the invalidation is complete */ -- CP15DSB; -+ DSB(); - - /* ISB - make sure the instruction stream sees it */ -- CP15ISB; -+ ISB(); - } - #else - void invalidate_icache_all(void) -diff --git a/arch/arm/cpu/armv7/rmobile/Makefile b/arch/arm/cpu/armv7/rmobile/Makefile -index b8c04c6..0a3623a 100644 ---- a/arch/arm/cpu/armv7/rmobile/Makefile -+++ b/arch/arm/cpu/armv7/rmobile/Makefile -@@ -46,6 +46,10 @@ COBJS-$(CONFIG_R8A7740) += pfc-r8a7740.o - COBJS-$(CONFIG_SH73A0) += cpu_info-sh73a0.o - COBJS-$(CONFIG_SH73A0) += pfc-sh73a0.o - COBJS_LN-$(CONFIG_TMU_TIMER) += sh_timer.o -+COBJS-$(CONFIG_SYS_ARCH_TIMER) += arm_arch_timer.o -+ifeq ($(CONFIG_CMD_SWSUSP),y) -+COBJS-y += crc32_word4.o -+endif - - COBJS := $(COBJS-y) - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) -diff --git a/arch/arm/cpu/armv7/rmobile/arm_arch_timer.c b/arch/arm/cpu/armv7/rmobile/arm_arch_timer.c -new file mode 100644 -index 0000000..a499e71 ---- /dev/null -+++ b/arch/arm/cpu/armv7/rmobile/arm_arch_timer.c -@@ -0,0 +1,61 @@ -+/* -+ * Copyright (C) 2014 Cogent Embedded Inc. -+ * -+ * Licensed under the GPL-2 or later. -+ */ -+ -+#include <common.h> -+#include <asm/io.h> -+ -+#define MODEMR 0xe6160060 -+#define MD(x) (1 << (x)) -+#define CNTCR 0xe6080000 -+#define CNTFID0 0xe6080020 -+ -+void arm_arch_timer_init(void) -+{ -+ u32 mode = readl(MODEMR); -+ u32 freq; -+ -+ switch (mode & (MD(14) | MD(13))) { -+ case MD(13): -+ freq = 20; -+ break; -+ case MD(14): -+ freq = 26; -+ break; -+ case MD(13) | MD(14): -+ freq = 30; -+ break; -+ default: -+ freq = 15; -+ break; -+ } -+ -+ freq *= (1000000 / 2); -+ -+#ifdef CONFIG_VE_ENABLED -+ /* CNTVOFF has to be initialized either from non-secure Hypervisor -+ * mode or secure Monitor mode with SCR.NS==1. If TrustZone is enabled -+ * then it should be handled by the secure code -+ */ -+ asm volatile( -+ " cps 0x16\n" -+ " mrc p15, 0, r1, c1, c1, 0\n" -+ " orr r0, r1, #1\n" -+ " mcr p15, 0, r0, c1, c1, 0\n" -+ " isb\n" -+ " mov r0, #0\n" -+ " mcrr p15, 4, r0, r0, c14\n" -+ " isb\n" -+ " mcr p15, 0, r1, c1, c1, 0\n" -+ " isb\n" -+ " cps 0x13\n" -+ : : : "r0", "r1"); -+#endif -+ -+ /* Start Generic ARM timer */ -+ writel(freq, CNTFID0); -+ asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq)); -+ writel(1, CNTCR); -+} -diff --git a/arch/arm/cpu/armv7/rmobile/crc32_word4.c b/arch/arm/cpu/armv7/rmobile/crc32_word4.c -new file mode 100644 -index 0000000..b813899 ---- /dev/null -+++ b/arch/arm/cpu/armv7/rmobile/crc32_word4.c -@@ -0,0 +1,299 @@ -+/************************************************************************* -+ * crc32_word4.c: rapid CRC32 -+ * Coptright (C) FUJITSUTEN Limited, 2015 All Rights Reserved. -+ * -+ * 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, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ *************************************************************************/ -+#ifdef OWNTEST -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+#include <asm/types.h> -+typedef unsigned int u_int32_t; -+#else -+#include <common.h> -+#endif -+ -+#include "crc32_word4.h" -+ -+#define CRC_INIT_VALUE (-1) -+#define CRC_FIX(_crc32) (~(_crc32)) -+ -+#define __HWDTPLS_OUT() -+#define MEASURE(msg) -+ -+/**** calc_crc32.c *****/ -+ -+/* -+ * CRC32ã¯ã€ISO 3309 ã§è¦ç¨‹ã•ã‚Œ -+ * ãã®ã‚µãƒ³ãƒ—ル㯠-+ * RFC 2083 :PNG(Poratble Network Graphics -+ * ã§å…¬ã«ãªã£ã¦ã„ã¾ã™ã€‚本プãƒã‚°ãƒ©ãƒ ã¯ã€RFC2083 ã§æŽ²ç¤ºã•ã‚ŒãŸ -+ * CRC32を独自ã«æœ€é©åŒ–ã—ãŸãƒ—ãƒã‚°ãƒ©ãƒ ã§ã™ã€‚ -+ */ -+const static u_int32_t CRC_Table[256] = { -+ 0x00000000 , 0x77073096 , 0xee0e612c , 0x990951ba , 0x076dc419 , 0x706af48f , 0xe963a535 , 0x9e6495a3 , -+ 0x0edb8832 , 0x79dcb8a4 , 0xe0d5e91e , 0x97d2d988 , 0x09b64c2b , 0x7eb17cbd , 0xe7b82d07 , 0x90bf1d91 , -+ 0x1db71064 , 0x6ab020f2 , 0xf3b97148 , 0x84be41de , 0x1adad47d , 0x6ddde4eb , 0xf4d4b551 , 0x83d385c7 , -+ 0x136c9856 , 0x646ba8c0 , 0xfd62f97a , 0x8a65c9ec , 0x14015c4f , 0x63066cd9 , 0xfa0f3d63 , 0x8d080df5 , -+ 0x3b6e20c8 , 0x4c69105e , 0xd56041e4 , 0xa2677172 , 0x3c03e4d1 , 0x4b04d447 , 0xd20d85fd , 0xa50ab56b , -+ 0x35b5a8fa , 0x42b2986c , 0xdbbbc9d6 , 0xacbcf940 , 0x32d86ce3 , 0x45df5c75 , 0xdcd60dcf , 0xabd13d59 , -+ 0x26d930ac , 0x51de003a , 0xc8d75180 , 0xbfd06116 , 0x21b4f4b5 , 0x56b3c423 , 0xcfba9599 , 0xb8bda50f , -+ 0x2802b89e , 0x5f058808 , 0xc60cd9b2 , 0xb10be924 , 0x2f6f7c87 , 0x58684c11 , 0xc1611dab , 0xb6662d3d , -+ 0x76dc4190 , 0x01db7106 , 0x98d220bc , 0xefd5102a , 0x71b18589 , 0x06b6b51f , 0x9fbfe4a5 , 0xe8b8d433 , -+ 0x7807c9a2 , 0x0f00f934 , 0x9609a88e , 0xe10e9818 , 0x7f6a0dbb , 0x086d3d2d , 0x91646c97 , 0xe6635c01 , -+ 0x6b6b51f4 , 0x1c6c6162 , 0x856530d8 , 0xf262004e , 0x6c0695ed , 0x1b01a57b , 0x8208f4c1 , 0xf50fc457 , -+ 0x65b0d9c6 , 0x12b7e950 , 0x8bbeb8ea , 0xfcb9887c , 0x62dd1ddf , 0x15da2d49 , 0x8cd37cf3 , 0xfbd44c65 , -+ 0x4db26158 , 0x3ab551ce , 0xa3bc0074 , 0xd4bb30e2 , 0x4adfa541 , 0x3dd895d7 , 0xa4d1c46d , 0xd3d6f4fb , -+ 0x4369e96a , 0x346ed9fc , 0xad678846 , 0xda60b8d0 , 0x44042d73 , 0x33031de5 , 0xaa0a4c5f , 0xdd0d7cc9 , -+ 0x5005713c , 0x270241aa , 0xbe0b1010 , 0xc90c2086 , 0x5768b525 , 0x206f85b3 , 0xb966d409 , 0xce61e49f , -+ 0x5edef90e , 0x29d9c998 , 0xb0d09822 , 0xc7d7a8b4 , 0x59b33d17 , 0x2eb40d81 , 0xb7bd5c3b , 0xc0ba6cad , -+ 0xedb88320 , 0x9abfb3b6 , 0x03b6e20c , 0x74b1d29a , 0xead54739 , 0x9dd277af , 0x04db2615 , 0x73dc1683 , -+ 0xe3630b12 , 0x94643b84 , 0x0d6d6a3e , 0x7a6a5aa8 , 0xe40ecf0b , 0x9309ff9d , 0x0a00ae27 , 0x7d079eb1 , -+ 0xf00f9344 , 0x8708a3d2 , 0x1e01f268 , 0x6906c2fe , 0xf762575d , 0x806567cb , 0x196c3671 , 0x6e6b06e7 , -+ 0xfed41b76 , 0x89d32be0 , 0x10da7a5a , 0x67dd4acc , 0xf9b9df6f , 0x8ebeeff9 , 0x17b7be43 , 0x60b08ed5 , -+ 0xd6d6a3e8 , 0xa1d1937e , 0x38d8c2c4 , 0x4fdff252 , 0xd1bb67f1 , 0xa6bc5767 , 0x3fb506dd , 0x48b2364b , -+ 0xd80d2bda , 0xaf0a1b4c , 0x36034af6 , 0x41047a60 , 0xdf60efc3 , 0xa867df55 , 0x316e8eef , 0x4669be79 , -+ 0xcb61b38c , 0xbc66831a , 0x256fd2a0 , 0x5268e236 , 0xcc0c7795 , 0xbb0b4703 , 0x220216b9 , 0x5505262f , -+ 0xc5ba3bbe , 0xb2bd0b28 , 0x2bb45a92 , 0x5cb36a04 , 0xc2d7ffa7 , 0xb5d0cf31 , 0x2cd99e8b , 0x5bdeae1d , -+ 0x9b64c2b0 , 0xec63f226 , 0x756aa39c , 0x026d930a , 0x9c0906a9 , 0xeb0e363f , 0x72076785 , 0x05005713 , -+ 0x95bf4a82 , 0xe2b87a14 , 0x7bb12bae , 0x0cb61b38 , 0x92d28e9b , 0xe5d5be0d , 0x7cdcefb7 , 0x0bdbdf21 , -+ 0x86d3d2d4 , 0xf1d4e242 , 0x68ddb3f8 , 0x1fda836e , 0x81be16cd , 0xf6b9265b , 0x6fb077e1 , 0x18b74777 , -+ 0x88085ae6 , 0xff0f6a70 , 0x66063bca , 0x11010b5c , 0x8f659eff , 0xf862ae69 , 0x616bffd3 , 0x166ccf45 , -+ 0xa00ae278 , 0xd70dd2ee , 0x4e048354 , 0x3903b3c2 , 0xa7672661 , 0xd06016f7 , 0x4969474d , 0x3e6e77db , -+ 0xaed16a4a , 0xd9d65adc , 0x40df0b66 , 0x37d83bf0 , 0xa9bcae53 , 0xdebb9ec5 , 0x47b2cf7f , 0x30b5ffe9 , -+ 0xbdbdf21c , 0xcabac28a , 0x53b39330 , 0x24b4a3a6 , 0xbad03605 , 0xcdd70693 , 0x54de5729 , 0x23d967bf , -+ 0xb3667a2e , 0xc4614ab8 , 0x5d681b02 , 0x2a6f2b94 , 0xb40bbe37 , 0xc30c8ea1 , 0x5a05df1b , 0x2d02ef8d , -+}; -+ -+/*** -+ * CRC Table creater. -+ * -+void make_crc_table(void) { -+ u_int32_t c; -+ u_int32_t n, k; -+ for (n = 0; n < 256; n++) -+ { -+ c = (u_int32_t) n; -+ for (k = 0; k < 8; k++) -+ { -+ if (c & 1) -+ c = 0xedb88320L ^ (c >> 1); -+ else -+ c = c >> 1; -+ } -+ CRC_Table[n] = c; -+ } -+} -+***/ -+#define NEXT_PTR (4) -+ -+static __inline__ -+u_int32_t _update_crc(u_int32_t crc, unsigned char *buf, size_t len) -+{ -+ u_int32_t c = crc; -+ size_t n; -+ for (n = 0; n < len; n++) -+ c = CRC_Table[(c ^ buf[n]) & 0xff] ^ (c >> 8); -+ return c; -+} -+/********************************************************************* -+ * update_crc4x4()() -+ * calc_crc32() をベースã«ã€4 ワード毎ã«å€‹åˆ¥ã« CRC32 を計算ã™ã‚‹æ–¹æ³• -+ * -+ * +0 +1 +2 +3 -+ * +0x00 AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD -+ * +0x04 EEEEEEEE FFFFFFFF 00000000 11111111 -+ * : : : : -+ * CRC32 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx -+ * -+ *********************************************************************/ -+ -+static __inline__ -+void update_crc4x4(u_int32_t crc[4], unsigned char *buf) -+{ -+ u_int32_t c1, c2, c3, c4; -+ u_int32_t *p = (void *)buf; -+ -+ c1 = crc[0] ^ p[0]; -+ c2 = crc[1] ^ p[1]; -+ c3 = crc[2] ^ p[2]; -+ c4 = crc[3] ^ p[3]; -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ crc[0] = c1; -+ crc[1] = c2; -+ crc[2] = c3; -+ crc[3] = c4; -+} -+ -+ -+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result) -+{ -+ unsigned int crc_tmp[4] = {CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE}; -+ u_int32_t i; -+ int res; -+ u_int32_t n4; -+ int xlen = len; -+#ifdef HWDPLS_ENABLE -+ unsigned long plstout = 60; -+ unsigned long plsstart = 0; -+ if ((unsigned long)CONFIG_SYS_HZ > 100000) -+ plstout *= (unsigned long)CONFIG_SYS_HZ / 1000; -+ else -+ plstout = DIV_ROUND_UP(plstout * (unsigned long)CONFIG_SYS_HZ, 1000); -+#endif -+ -+ /** -+ * 4ãƒã‚¤ãƒˆå¢ƒç•Œã«åˆã‚ãªã„開始アドレスã®å ´åˆ -+ * 境界ã¾ã§ã®CRCã‚’ crc_tmp[0] ã«æ±‚ã‚る。 -+ */ -+ if ((unsigned long)buf & 3) { -+ crc_tmp[0] = _update_crc(crc_tmp[0], buf, (unsigned long)buf & 3); -+ buf = (unsigned char *)((unsigned long)buf & ~3); -+ xlen -= (unsigned long)buf & 3; -+ } -+ -+ n4 = xlen/(NEXT_PTR*4); -+ /** -+ * 4ãƒã‚¤ãƒˆå¢ƒç•Œã«åˆã‚ãªã„開始アドレスã®å ´åˆ -+ * 境界ã¾ã§ã®CRCã‚’ crc_tmp[0] ã«æ±‚ã‚る。 -+ */ -+#ifdef HWDPLS_ENABLE -+ reset_timer(); -+ plsstart = get_timer(0); -+#endif -+ for (i = 0; i < n4 ; i++) { -+ update_crc4x4(crc_tmp, buf); -+ buf += NEXT_PTR * 4; -+#ifdef HWDPLS_ENABLE -+ /** -+ * WDを考慮 -+ */ -+ if (__builtin_expect((int)((i & 0x1f) == 0), 0)) { -+ if ((get_timer(plsstart)) > plstout) { -+ __HWDTPLS_OUT(); -+ MEASURE("crc plsout") -+ plsstart += plstout; -+ } -+ } -+#endif /*HWPLS_ENABLE*/ -+ } -+ -+ res = xlen % (NEXT_PTR * 4); -+ if (res > 0) -+ crc_tmp[3] = _update_crc(crc_tmp[3], buf, res); -+ -+ result->crc_w[0] = CRC_FIX(crc_tmp[0]); -+ result->crc_w[1] = CRC_FIX(crc_tmp[1]); -+ result->crc_w[2] = CRC_FIX(crc_tmp[2]); -+ result->crc_w[3] = CRC_FIX(crc_tmp[3]); -+ -+ MEASURE("calc_crc32x4 finish") -+} -+ -+#if defined(OWNTEST) -+#define BUFSIZE (2 * 1024 * 1024) -+#include <sys/time.h> -+#include <malloc.h> -+ -+int main() -+{ -+ unsigned char *buf, *buf2; -+ struct timeval start, end; -+ unsigned long long diff; -+ int i; -+ -+ CRC32_WORD4_t result = { .crc_w = {0, 0, 0, 0 } }; -+ CRC32_WORD4_t result2 = { .crc_w = {0, 0, 0, 0 } }; -+ -+ buf = malloc(BUFSIZE); -+ if (!buf) { -+ perror("malloc"); -+ return 1; -+ } -+ printf("Generate %dMB random data..\n", BUFSIZE / 1024 / 1024); -+ srand(0); -+ for (i = 0; i < BUFSIZE / 4; i++) -+ ((int *)buf)[i] = rand(); -+ -+ /* Memory dup */ -+ buf2 = memalign(NEXT_PTR, BUFSIZE); -+ if (!buf2) { -+ perror("malloc"); -+ return 1; -+ } -+ memcpy(buf2, buf, BUFSIZE); -+ -+ -+ gettimeofday(&start, NULL); -+ calc_crc32x4(buf, BUFSIZE, &result); -+ gettimeofday(&end, NULL); -+ -+ diff = (end.tv_sec - start.tv_sec) * 1000000; -+ diff += end.tv_usec - start.tv_usec; -+ -+ printf("time=%lluus\n", diff); -+ printf(" result.word[0] = %x\n", result.crc_w[0]); -+ printf(" result.word[1] = %x\n", result.crc_w[1]); -+ printf(" result.word[2] = %x\n", result.crc_w[2]); -+ printf(" result.word[3] = %x\n", result.crc_w[3]); -+ -+ /* Broken test */ -+#if 0 /* Destory test */ -+ buf[rand() % BUFSIZE] ^= 1 << (rand()%7); -+#endif -+ for (i = 0; i < BUFSIZE ; i++) { -+ if (buf[i] != buf2[i]) -+ printf("buf[%d] %02x : %02x\n", i, buf[i], buf2[i]); -+ } -+ -+ gettimeofday(&start, NULL); -+ calc_crc32x4(buf, BUFSIZE, &result2); -+ gettimeofday(&end, NULL); -+ -+ diff = (end.tv_sec - start.tv_sec) * 1000000; -+ diff += end.tv_usec - start.tv_usec; -+ -+ printf("time=%lluus\n", diff); -+ printf(" result.word[0] = %x:%s\n", result2.crc_w[0] , -+ result.crc_w[0] == result2.crc_w[0] ? "OK" : "NG"); -+ printf(" result.word[1] = %x:%s\n", result2.crc_w[1] , -+ result.crc_w[1] == result2.crc_w[1] ? "OK" : "NG"); -+ printf(" result.word[2] = %x:%s\n", result2.crc_w[2] , -+ result.crc_w[2] == result2.crc_w[2] ? "OK" : "NG"); -+ printf(" result.word[3] = %x:%s\n", result2.crc_w[3] , -+ result.crc_w[3] == result2.crc_w[3] ? "OK" : "NG"); -+ return 0; -+} -+#endif /* TEST */ -diff --git a/arch/arm/cpu/armv7/rmobile/crc32_word4.h b/arch/arm/cpu/armv7/rmobile/crc32_word4.h -new file mode 100644 -index 0000000..2b64218 ---- /dev/null -+++ b/arch/arm/cpu/armv7/rmobile/crc32_word4.h -@@ -0,0 +1,23 @@ -+/************************************************************************* -+ * Coptright (C) FUJITSUTEN Limited, 2012 All Rights Reserved. -+ * -+ *************************************************************************/ -+#ifndef __CRC32_WORD4_H__ -+#define __CRC32_WORD4_H__ -+ -+typedef struct { -+ unsigned int crc_w[4]; -+} CRC32_WORD4_t; -+ -+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result); -+ -+typedef struct { -+ unsigned int size; -+ CRC32_WORD4_t chksum; -+ unsigned int dummy[3]; -+} CRC32_WORD4_TICKET_t; -+ -+#define IS_CRC_WORD4_OK(_res1, _res2) (!memcmp((_res1), (_res2), sizeof(CRC32_WORD4_t))) -+#define IS_CRC_WORD4_ZERO(_w4) (((_w4)->crc_w[0] == 0) && ((_w4)->crc_w[1] == 0) && ((_w4)->crc_w[2] == 0) && ((_w4)->crc_w[3] == 0)) -+#define IS_CRC_WORD4_ALL_F(_w4) (((_w4)->crc_w[0] == 0xffffffff) && ((_w4)->crc_w[1] == 0xffffffff) && ((_w4)->crc_w[2] == 0xffffffff) && ((_w4)->crc_w[3] == 0xffffffff)) -+#endif -diff --git a/arch/arm/cpu/armv7/rmobile/sh_timer.c b/arch/arm/cpu/armv7/rmobile/sh_timer.c -new file mode 100644 -index 0000000..1c64950 ---- /dev/null -+++ b/arch/arm/cpu/armv7/rmobile/sh_timer.c -@@ -0,0 +1,209 @@ -+/* -+ * Copyright (C) 2013-2014 Renesas Electronics Corporation -+ * -+ * (C) Copyright 2009 -+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> -+ * -+ * (C) Copyright 2007-2012 -+ * Nobobuhiro Iwamatsu <iwamatsu@nigauri.org> -+ * -+ * (C) Copyright 2003 -+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de. -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * 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, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ -+#include <common.h> -+#include <div64.h> -+#include <asm/processor.h> -+#include <asm/io.h> -+#include <sh_tmu.h> -+ -+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \ -+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794) -+ -+DECLARE_GLOBAL_DATA_PTR; -+ -+#endif -+ -+static struct tmu_regs *tmu = (struct tmu_regs *)TMU_BASE; -+ -+static u16 bit; -+static unsigned long last_tcnt; -+static unsigned long long overflow_ticks; -+ -+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \ -+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794) -+ -+unsigned long get_tbclk(void) -+{ -+ if (gd->flags & GD_FLG_RELOC) -+ return get_tmu0_clk_rate() >> ((bit + 1) * 2); -+ else { -+ u16 bit; -+ -+ bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1; -+ return get_tmu0_clk_rate() >> ((bit + 1) * 2); -+ } -+} -+ -+#else -+ -+unsigned long get_tbclk(void) -+{ -+ return get_tmu0_clk_rate() >> ((bit + 1) * 2); -+} -+ -+#endif -+ -+static inline unsigned long long tick_to_time(unsigned long long tick) -+{ -+ tick *= CONFIG_SYS_HZ; -+ do_div(tick, get_tbclk()); -+ -+ return tick; -+} -+ -+static inline unsigned long long usec_to_tick(unsigned long long usec) -+{ -+ usec *= get_tbclk(); -+ do_div(usec, 1000000); -+ -+ return usec; -+} -+ -+static void tmu_timer_start(unsigned int timer) -+{ -+ if (timer > 2) -+ return; -+ writeb(readb(&tmu->tstr) | (1 << timer), &tmu->tstr); -+} -+ -+static void tmu_timer_stop(unsigned int timer) -+{ -+ if (timer > 2) -+ return; -+ writeb(readb(&tmu->tstr) & ~(1 << timer), &tmu->tstr); -+} -+ -+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \ -+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794) -+ -+int sh_timer_init(void) -+{ -+ bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1; -+ writew((readw(&tmu->tcr0) & ~0x7) | bit, &tmu->tcr0); -+ -+ tmu_timer_stop(0); -+ tmu_timer_start(0); -+ -+ last_tcnt = 0; -+ overflow_ticks = 0; -+ -+ return 0; -+} -+ -+int timer_init(void) -+{ -+ tmu_timer_stop(0); -+ tmu_timer_start(0); -+ -+ return 0; -+} -+ -+#else -+ -+int timer_init(void) -+{ -+ bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1; -+ writew((readw(&tmu->tcr0) & ~0x7) | bit, &tmu->tcr0); -+ -+ tmu_timer_stop(0); -+ tmu_timer_start(0); -+ -+ last_tcnt = 0; -+ overflow_ticks = 0; -+ -+ return 0; -+} -+ -+#endif -+ -+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \ -+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794) -+ -+unsigned long long get_ticks(void) -+{ -+ unsigned long tcnt = 0 - readl(&tmu->tcnt0); -+ -+ if (gd->flags & GD_FLG_RELOC) { -+ if (last_tcnt > tcnt) /* overflow */ -+ overflow_ticks++; -+ last_tcnt = tcnt; -+ -+ return (overflow_ticks << 32) | tcnt; -+ } -+ else -+ return tcnt; -+} -+ -+#else -+ -+unsigned long long get_ticks(void) -+{ -+ unsigned long tcnt = 0 - readl(&tmu->tcnt0); -+ -+ if (last_tcnt > tcnt) /* overflow */ -+ overflow_ticks++; -+ last_tcnt = tcnt; -+ -+ return (overflow_ticks << 32) | tcnt; -+} -+ -+#endif -+ -+void __udelay(unsigned long usec) -+{ -+ unsigned long long tmp; -+ ulong tmo; -+ -+ tmo = usec_to_tick(usec); -+ tmp = get_ticks() + tmo; /* get current timestamp */ -+ -+ while (get_ticks() < tmp) /* loop till event */ -+ /*NOP*/; -+} -+ -+unsigned long get_timer(unsigned long base) -+{ -+ /* return msec */ -+ return tick_to_time(get_ticks()) - base; -+} -+ -+void set_timer(unsigned long t) -+{ -+ writel((0 - t), &tmu->tcnt0); -+} -+ -+void reset_timer(void) -+{ -+ tmu_timer_stop(0); -+ set_timer(0); -+ tmu_timer_start(0); -+} -diff --git a/arch/arm/include/asm/arch-rmobile/rmobile.h b/arch/arm/include/asm/arch-rmobile/rmobile.h -index 33a302e..12276e0 100644 ---- a/arch/arm/include/asm/arch-rmobile/rmobile.h -+++ b/arch/arm/include/asm/arch-rmobile/rmobile.h -@@ -26,6 +26,8 @@ u32 rmobile_get_cpu_type(void); - u32 rmobile_get_cpu_rev_integer(void); - u32 rmobile_get_cpu_rev_fraction(void); - -+void arm_arch_timer_init(void); -+ - #endif /* __ASSEMBLY__ */ - - #endif /* __KERNEL__ */ -diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h -index ad9a875..aad5bf7 100644 ---- a/arch/arm/include/asm/armv7.h -+++ b/arch/arm/include/asm/armv7.h -@@ -62,9 +62,19 @@ - * However, we use the CP15 based instructtions because we use - * -march=armv5 in U-Boot - */ --#define CP15ISB asm volatile ("mcr p15, 0, %0, c7, c5, 4" : : "r" (0)) --#define CP15DSB asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)) --#define CP15DMB asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0)) -+#define CP15ISB() asm volatile ("mcr p15, 0, %0, c7, c5, 4" : : "r" (0)) -+#define CP15DSB() asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)) -+#define CP15DMB() asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0)) -+ -+#ifdef __ARM_ARCH_7A__ -+#define ISB() asm volatile ("isb" : : : "memory") -+#define DSB() asm volatile ("dsb" : : : "memory") -+#define DMB() asm volatile ("dmb" : : : "memory") -+#else -+#define ISB() CP15ISB -+#define DSB() CP15DSB -+#define DMB() CP15DMB -+#endif - - void v7_outer_cache_enable(void); - void v7_outer_cache_disable(void); -diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h -index cd0de6b..3906646 100644 ---- a/arch/arm/include/asm/system.h -+++ b/arch/arm/include/asm/system.h -@@ -45,6 +45,12 @@ - #define CR_AFE (1 << 29) /* Access flag enable */ - #define CR_TE (1 << 30) /* Thumb exception enable */ - -+#if defined(CONFIG_ARMV7_LPAE) && !defined(PGTABLE_SIZE) -+#define PGTABLE_SIZE (4096 * 5) -+#elif !defined(PGTABLE_SIZE) -+#define PGTABLE_SIZE (4096 * 4) -+#endif -+ - /* - * This is used to ensure the compiler did actually allocate the register we - * asked it for some inline assembly sequences. Apparently we can't trust -@@ -61,17 +67,50 @@ - - #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); - -+static inline unsigned long get_cpsr(void) -+{ -+ unsigned long cpsr; -+ -+ asm volatile("mrs %0, cpsr" : "=r"(cpsr): ); -+ return cpsr; -+} -+ -+static inline int is_hyp(void) -+{ -+#ifdef CONFIG_ARMV7_LPAE -+ /* HYP mode requires LPAE ... */ -+ return ((get_cpsr() & 0x1f) == 0x1a); -+#else -+ /* ... so without LPAE support we can optimize all hyp code away */ -+ return 0; -+#endif -+} -+ - static inline unsigned int get_cr(void) - { - unsigned int val; -- asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc"); -+ -+ if (is_hyp()) -+ asm volatile("mrc p15, 4, %0, c1, c0, 0 @ get CR" : "=r" (val) -+ : -+ : "cc"); -+ else -+ asm volatile("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) -+ : -+ : "cc"); - return val; - } - - static inline void set_cr(unsigned int val) - { -- asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" -- : : "r" (val) : "cc"); -+ if (is_hyp()) -+ asm volatile("mcr p15, 4, %0, c1, c0, 0 @ set CR" : -+ : "r" (val) -+ : "cc"); -+ else -+ asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" : -+ : "r" (val) -+ : "cc"); - isb(); - } - -@@ -105,19 +144,108 @@ static inline void set_actlr(unsigned int val) - isb(); - } - -+#ifdef CONFIG_ARMV7_LPAE -+/* Long-Descriptor Translation Table Level 1/2 Bits */ -+#define TTB_SECT_XN_MASK (1ULL << 54) -+#define TTB_SECT_NG_MASK (1 << 11) -+#define TTB_SECT_AF (1 << 10) -+#define TTB_SECT_SH_MASK (3 << 8) -+#define TTB_SECT_NS_MASK (1 << 5) -+#define TTB_SECT_AP (1 << 6) -+/* Note: TTB AP bits are set elsewhere */ -+#define TTB_SECT_MAIR(x) ((x & 0x7) << 2) /* Index into MAIR */ -+#define TTB_SECT (1 << 0) -+#define TTB_PAGETABLE (3 << 0) -+ -+/* TTBCR flags */ -+#define TTBCR_EAE (1 << 31) -+#define TTBCR_T0SZ(x) ((x) << 0) -+#define TTBCR_T1SZ(x) ((x) << 16) -+#define TTBCR_USING_TTBR0 (TTBCR_T0SZ(0) | TTBCR_T1SZ(0)) -+#define TTBCR_IRGN0_NC (0 << 8) -+#define TTBCR_IRGN0_WBWA (1 << 8) -+#define TTBCR_IRGN0_WT (2 << 8) -+#define TTBCR_IRGN0_WBNWA (3 << 8) -+#define TTBCR_IRGN0_MASK (3 << 8) -+#define TTBCR_ORGN0_NC (0 << 10) -+#define TTBCR_ORGN0_WBWA (1 << 10) -+#define TTBCR_ORGN0_WT (2 << 10) -+#define TTBCR_ORGN0_WBNWA (3 << 10) -+#define TTBCR_ORGN0_MASK (3 << 10) -+#define TTBCR_SHARED_NON (0 << 12) -+#define TTBCR_SHARED_OUTER (2 << 12) -+#define TTBCR_SHARED_INNER (3 << 12) -+#define TTBCR_EPD0 (0 << 7) -+ -+/* -+ * Memory types -+ */ -+#define MEMORY_ATTRIBUTES ((0x00 << (0 * 8)) | (0x88 << (1 * 8)) | \ -+ (0xcc << (2 * 8)) | (0xff << (3 * 8))) -+ -+/* options available for data cache on each page */ -+enum dcache_option { -+ DCACHE_OFF = TTB_SECT | TTB_SECT_MAIR(0), -+ DCACHE_WRITETHROUGH = TTB_SECT | TTB_SECT_MAIR(1), -+ DCACHE_WRITEBACK = TTB_SECT | TTB_SECT_MAIR(2), -+ DCACHE_WRITEALLOC = TTB_SECT | TTB_SECT_MAIR(3), -+}; -+#elif defined(CONFIG_ARMV7) -+/* Short-Descriptor Translation Table Level 1 Bits */ -+#define TTB_SECT_NS_MASK (1 << 19) -+#define TTB_SECT_NG_MASK (1 << 17) -+#define TTB_SECT_S_MASK (1 << 16) -+/* Note: TTB AP bits are set elsewhere */ -+#define TTB_SECT_AP (3 << 10) -+#define TTB_SECT_TEX(x) ((x & 0x7) << 12) -+#define TTB_SECT_DOMAIN(x) ((x & 0xf) << 5) -+#define TTB_SECT_XN_MASK (1 << 4) -+#define TTB_SECT_C_MASK (1 << 3) -+#define TTB_SECT_B_MASK (1 << 2) -+#define TTB_SECT (2 << 0) -+ -+/* options available for data cache on each page */ -+enum dcache_option { -+ DCACHE_OFF = TTB_SECT_DOMAIN(0) | TTB_SECT_XN_MASK | TTB_SECT, -+ DCACHE_WRITETHROUGH = DCACHE_OFF | TTB_SECT_C_MASK, -+ DCACHE_WRITEBACK = DCACHE_WRITETHROUGH | TTB_SECT_B_MASK, -+ DCACHE_WRITEALLOC = DCACHE_WRITEBACK | TTB_SECT_TEX(1), -+}; -+#else -+#define TTB_SECT_AP (3 << 10) - /* options available for data cache on each page */ - enum dcache_option { - DCACHE_OFF = 0x12, - DCACHE_WRITETHROUGH = 0x1a, - DCACHE_WRITEBACK = 0x1e, -+ DCACHE_WRITEALLOC = 0x16, - }; -+#endif - - /* Size of an MMU section */ - enum { -- MMU_SECTION_SHIFT = 20, -+#ifdef CONFIG_ARMV7_LPAE -+ MMU_SECTION_SHIFT = 21, /* 2MB */ -+#else -+ MMU_SECTION_SHIFT = 20, /* 1MB */ -+#endif - MMU_SECTION_SIZE = 1 << MMU_SECTION_SHIFT, - }; - -+#ifdef CONFIG_ARMV7 -+/* TTBR0 bits */ -+#define TTBR0_BASE_ADDR_MASK 0xFFFFC000 -+#define TTBR0_RGN_NC (0 << 3) -+#define TTBR0_RGN_WBWA (1 << 3) -+#define TTBR0_RGN_WT (2 << 3) -+#define TTBR0_RGN_WB (3 << 3) -+/* TTBR0[6] is IRGN[0] and TTBR[0] is IRGN[1] */ -+#define TTBR0_IRGN_NC (0 << 0 | 0 << 6) -+#define TTBR0_IRGN_WBWA (0 << 0 | 1 << 6) -+#define TTBR0_IRGN_WT (1 << 0 | 0 << 6) -+#define TTBR0_IRGN_WB (1 << 0 | 1 << 6) -+#endif -+ - /** - * Change the cache settings for a region. - * -diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile -index 57111af..d8634be 100644 ---- a/arch/arm/lib/Makefile -+++ b/arch/arm/lib/Makefile -@@ -54,6 +54,8 @@ COBJS-y += reset.o - COBJS-y += cache.o - COBJS-y += cache-cp15.o - -+COBJS-y += call_with_stack.o -+ - SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \ - $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) - OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) -diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c -index 9f861cc..3c2bf55 100644 ---- a/arch/arm/lib/board.c -+++ b/arch/arm/lib/board.c -@@ -355,7 +355,7 @@ void board_init_f(ulong bootflag) - - #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) - /* reserve TLB table */ -- gd->tlb_size = 4096 * 4; -+ gd->tlb_size = PGTABLE_SIZE; - addr -= gd->tlb_size; - - /* round down to next 64 kB limit */ -diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c -index 75cf7b1..aefa2ae 100644 ---- a/arch/arm/lib/cache-cp15.c -+++ b/arch/arm/lib/cache-cp15.c -@@ -44,13 +44,50 @@ static void cp_delay (void) - asm volatile("" : : : "memory"); - } - -+#ifdef CONFIG_ARMV7_LPAE -+struct special_addr { -+ u32 page; -+ u32 size; -+ u64 addr; -+}; -+ -+/* This hack is for 2GB board with second GB attached -+ * to LPAE-only address at 0x200000000ULL */ -+#define SDRAM2_ADDR 0x200000000ULL -+#define SDRAM2_SIZE 0x40000000 /* 1G */ -+static struct special_addr offsets[] = { -+ { 0x80000000 >> MMU_SECTION_SHIFT, SDRAM2_SIZE >> MMU_SECTION_SHIFT, SDRAM2_ADDR, }, -+}; -+#endif -+ - void set_section_dcache(int section, enum dcache_option option) - { -+#ifdef CONFIG_ARMV7_LPAE -+ int i; -+ u64 *page_table = (u64 *)gd->tlb_addr; -+ /* Need to set the access flag to not fault */ -+ u64 value = TTB_SECT_AP | TTB_SECT_AF; -+#else - u32 *page_table = (u32 *)gd->tlb_addr; -- u32 value; -+ u32 value = TTB_SECT_AP; -+#endif -+ -+ /* Add the page offset */ -+#ifdef CONFIG_ARMV7_LPAE -+ for (i = 0; i < ARRAY_SIZE(offsets); i++) -+ if (section >= offsets[i].page && -+ section < offsets[i].page + offsets[i].size) -+ value |= offsets[i].addr + ((section - offsets[i].page) << MMU_SECTION_SHIFT); -+ else -+ value |= ((u32)section << MMU_SECTION_SHIFT); -+#else -+ value |= ((u32)section << MMU_SECTION_SHIFT); -+#endif - -- value = (section << MMU_SECTION_SHIFT) | (3 << 10); -+ /* Add caching bits */ - value |= option; -+ -+ /* Set PTE */ - page_table[section] = value; - } - -@@ -66,11 +103,11 @@ void mmu_set_region_dcache_behaviour(u32 start, int size, - enum dcache_option option) - { - u32 *page_table = (u32 *)gd->tlb_addr; -- u32 upto, end; -+ unsigned long upto, end; - - end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT; - start = start >> MMU_SECTION_SHIFT; -- debug("%s: start=%x, size=%x, option=%d\n", __func__, start, size, -+ debug("%s: start=%pa, size=%zu, option=%d\n", __func__, &start, size, - option); - for (upto = start; upto < end; upto++) - set_section_dcache(upto, option); -@@ -83,11 +120,14 @@ static inline void dram_bank_mmu_setup(int bank) - int i; - - debug("%s: bank: %d\n", __func__, bank); -- for (i = bd->bi_dram[bank].start >> 20; -- i < (bd->bi_dram[bank].start + bd->bi_dram[bank].size) >> 20; -+ for (i = bd->bi_dram[bank].start >> MMU_SECTION_SHIFT; -+ i < (bd->bi_dram[bank].start >> MMU_SECTION_SHIFT) + -+ (bd->bi_dram[bank].size >> MMU_SECTION_SHIFT); - i++) { - #if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH) - set_section_dcache(i, DCACHE_WRITETHROUGH); -+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC) -+ set_section_dcache(i, DCACHE_WRITEALLOC); - #else - set_section_dcache(i, DCACHE_WRITEBACK); - #endif -@@ -102,19 +142,88 @@ static inline void mmu_setup(void) - - arm_init_before_mmu(); - /* Set up an identity-mapping for all 4GB, rw for everyone */ -- for (i = 0; i < 4096; i++) -+ for (i = 0; i < ((4096ULL * 1024 * 1024) >> MMU_SECTION_SHIFT); i++) - set_section_dcache(i, DCACHE_OFF); - - for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { - dram_bank_mmu_setup(i); - } -+ /* Enabling d-cache for remapped region of memory -+ * -+ */ -+ for (i = (0x80000000 >> MMU_SECTION_SHIFT); -+ i < 0xc0000000 >> MMU_SECTION_SHIFT; i++) -+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH) -+ set_section_dcache(i, DCACHE_WRITETHROUGH); -+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC) -+ set_section_dcache(i, DCACHE_WRITEALLOC); -+#else -+ set_section_dcache(i, DCACHE_WRITEBACK); -+#endif -+ -+#ifdef CONFIG_ARMV7_LPAE -+ /* Set up 4 PTE entries pointing to our 4 1GB page tables */ -+ for (i = 0; i < 4; i++) { -+ u64 *page_table = (u64 *)(gd->tlb_addr + (4096 * 4)); -+ u64 tpt = gd->tlb_addr + (4096 * i); -+ page_table[i] = tpt | TTB_PAGETABLE; -+ } - -+ reg = TTBCR_EAE; -+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH) -+ reg |= TTBCR_ORGN0_WT | TTBCR_IRGN0_WT; -+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC) -+ reg |= TTBCR_ORGN0_WBWA | TTBCR_IRGN0_WBWA; -+#else -+ reg |= TTBCR_ORGN0_WBNWA | TTBCR_IRGN0_WBNWA; -+#endif -+ -+ if (is_hyp()) { -+ /* Set HCTR to enable LPAE */ -+ asm volatile("mcr p15, 4, %0, c2, c0, 2" -+ : : "r" (reg) : "memory"); -+ /* Set HTTBR0 */ -+ asm volatile("mcrr p15, 4, %0, %1, c2" -+ : -+ : "r"(gd->tlb_addr + (4096 * 4)), "r"(0) -+ : "memory"); -+ /* Set HMAIR */ -+ asm volatile("mcr p15, 4, %0, c10, c2, 0" -+ : : "r" (MEMORY_ATTRIBUTES) : "memory"); -+ } else { -+ /* Set TTBCR to enable LPAE */ -+ asm volatile("mcr p15, 0, %0, c2, c0, 2" -+ : : "r" (reg) : "memory"); -+ /* Set 64-bit TTBR0 */ -+ asm volatile("mcrr p15, 0, %0, %1, c2" -+ : -+ : "r"(gd->tlb_addr + (4096 * 4)), "r"(0) -+ : "memory"); -+ /* Set MAIR */ -+ asm volatile("mcr p15, 0, %0, c10, c2, 0" -+ : : "r" (MEMORY_ATTRIBUTES) : "memory"); -+ } -+#elif defined(CONFIG_ARMV7) -+ /* Set TTBR0 */ -+ reg = gd->tlb_addr & TTBR0_BASE_ADDR_MASK; -+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH) -+ reg |= TTBR0_RGN_WT | TTBR0_IRGN_WT; -+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC) -+ reg |= TTBR0_RGN_WBWA | TTBR0_IRGN_WBWA; -+#else -+ reg |= TTBR0_RGN_WB | TTBR0_IRGN_WB; -+#endif -+ asm volatile("mcr p15, 0, %0, c2, c0, 0" -+ : : "r" (reg) : "memory"); -+#else - /* Copy the page table address to cp15 */ - asm volatile("mcr p15, 0, %0, c2, c0, 0" - : : "r" (gd->tlb_addr) : "memory"); -+#endif - /* Set the access control to all-supervisor */ - asm volatile("mcr p15, 0, %0, c3, c0, 0" - : : "r" (~0)); -+ - /* and enable the mmu */ - reg = get_cr(); /* get control reg. */ - cp_delay(); -diff --git a/arch/arm/lib/call_with_stack.S b/arch/arm/lib/call_with_stack.S -new file mode 100644 -index 0000000..651d869 ---- /dev/null -+++ b/arch/arm/lib/call_with_stack.S -@@ -0,0 +1,20 @@ -+.globl call_with_stack -+.syntax unified /* use unified assembler syntax */ -+#ifdef __thumb__ -+.thumb /* assemble in Thumb-2 (.thumb" can also be used) */ -+#endif -+call_with_stack: -+ str sp, [r2, #-4]! -+ str lr, [r2, #-4]! -+ -+ mov sp, r2 -+ mov r2, r0 -+ mov r0, r1 -+ -+ adr lr, 1f -+ mov pc, r2 -+ -+1: ldr lr, [sp] -+ ldr sp, [sp, #4] -+ mov pc, lr -+ -diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c -index 71836e2..6c4fd1a 100644 ---- a/board/renesas/porter/porter.c -+++ b/board/renesas/porter/porter.c -@@ -42,6 +42,10 @@ void s_init(void) - struct r8a7791_swdt *swdt = (struct r8a7791_swdt *)SWDT_BASE; - u32 val; - -+#ifdef CONFIG_SYS_ARCH_TIMER -+ arm_arch_timer_init(); -+#endif -+ - /* Watchdog init */ - writel(0xA5A5A500, &rwdt->rwtcsra); - writel(0xA5A5A500, &swdt->swtcsra); -@@ -71,10 +75,12 @@ int board_early_init_f(void) - { - u32 val; - -+#ifdef CONFIG_TMU_TIMER - /* TMU0 */ - val = readl(MSTPSR1); - val &= ~TMU0_MSTP125; - writel(val, SMSTPCR1); -+#endif - - val = readl(MSTPSR7); - val &= ~SCIF0_MSTP721; -@@ -114,7 +120,9 @@ int board_init(void) - /* Init PFC controller */ - r8a7791_pinmux_init(); - -+#ifdef CONFIG_TMU_TIMER - sh_timer_init(); -+#endif - - /* ETHER Enable */ - gpio_request(GPIO_FN_ETH_CRS_DV, NULL); -@@ -288,10 +296,12 @@ void arch_preboot_os() - u32 val; - int i; - -+#ifdef CONFIG_TMU_TIMER - /* stop TMU0 */ - val = readb(TMU_BASE + TSTR0); - val &= ~TSTR0_STR0; - writeb(val, TMU_BASE + TSTR0); -+#endif - - /* stop all module clock*/ - for (i = MSTP00; i < MSTP_NR; i++) { -diff --git a/include/configs/porter.h b/include/configs/porter.h -index 7ab0643..5567c7c 100644 ---- a/include/configs/porter.h -+++ b/include/configs/porter.h -@@ -53,6 +53,9 @@ - #define CONFIG_CMD_EXT4_WRITE - #define CONFIG_CMD_SF - #define CONFIG_CMD_SPI -+#define CONFIG_CMD_SWSUSP -+#define CONFIG_CMD_SWSUSPMEM -+#define CONFIG_LZO - - #define CONFIG_CMDLINE_TAG - #define CONFIG_SETUP_MEMORY_TAGS -@@ -75,7 +78,6 @@ - #define CONFIG_BOARD_EARLY_INIT_F - #define CONFIG_USE_ARCH_MEMSET - #define CONFIG_USE_ARCH_MEMCPY --#define CONFIG_TMU_TIMER - - /* STACK */ - #if defined(CONFIG_EXTRAM_BOOT) -@@ -89,8 +91,8 @@ - - /* MEMORY */ - #define PORTER_SDRAM_BASE 0x40000000 --#define PORTER_SDRAM_SIZE 0x40000000 --#define PORTER_UBOOT_SDRAM_SIZE 0x20000000 -+#define PORTER_SDRAM_SIZE 0x48000000 -+#define PORTER_UBOOT_SDRAM_SIZE 0x40000000 - - #define CONFIG_SYS_LONGHELP - #define CONFIG_SYS_PROMPT "=> " -@@ -203,4 +205,15 @@ - #define CONFIG_USB_HOST_ETHER /* Enable USB Ethernet adapters */ - #define CONFIG_USB_ETHER_ASIX /* Asix, or whatever driver(s) you want */ - -+#define CONFIG_ARMV7_LPAE /* 64-bit MMU descriptors */ -+#define CONFIG_SYS_ARM_CACHE_WRITEALLOC /* Make memory operations faster */ -+ -+#define CONFIG_SYS_ARCH_TIMER /* Init arch timer */ -+#define CONFIG_VE_ENABLED /* Virtualization Extensions are enabled*/ -+#define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CLK_FREQ -+ -+#define CONFIG_SH_DMA -+#define CONFIG_SH_SYS_DMAL_BASE 0xE6700000 -+#define CONFIG_SH_SYS_DMAL_NCH 15 -+ - #endif /* __PORTER_H */ --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot_2013.01.01.bbappend b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot_2013.01.01.bbappend deleted file mode 100644 index 9535e174d..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot_2013.01.01.bbappend +++ /dev/null @@ -1,13 +0,0 @@ -FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" - -SRC_URI_append_porter_sota = "file://0001-Autoload-uEnv.txt-on-boot.patch" - -SRC_URI_append_agl-porter-hibernate = " file://hibernation/0001-Add-rcar-sdhi-DMA-support.patch \ - file://hibernation/0002-Add-Hibernation-swsusp-command-support.patch \ - file://hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch \ - file://hibernation/0004-Add-porter-board-Hibernation-code.patch \ - file://hibernation/0001-Add-hibernation-image-area.patch \ - file://hibernation/0002-Enable-swsusp-DMA-support.patch \ - file://hibernation/0003-Add-hibernation-image-area.patch \ - " - diff --git a/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend deleted file mode 100644 index 7a54dfbe4..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -# Disable LVDS -WESTONOUTPUT2[name] = "LVDS-1" -WESTONOUTPUT2[mode] = "off" - -WESTONSECTION[WESTONOUTPUT2] = "output" diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module.bbappend deleted file mode 100755 index 589ed87dc..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module.bbappend +++ /dev/null @@ -1,7 +0,0 @@ -FILESEXTRAPATHS_prepend := '${THISDIR}/${PN}:' -SRC_URI_r8a7791_append_agl-porter-hibernate = ' file://hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch \ - ' -python __anonymous () { - d.delVarFlag('do_patch', 'noexec') -} - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module/hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module/hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch deleted file mode 100644 index a3dd6089c..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module/hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 600612d670639fc74135a4f15a79d411931b39a8 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Sun, 21 May 2017 12:14:03 +0900 -Subject: [PATCH] Add gles hibernation code for M2W only - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - services4/srvkm/env/linux/module.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/services4/srvkm/env/linux/module.c b/services4/srvkm/env/linux/module.c -index f3f22b0..85ac24f 100644 ---- a/services4/srvkm/env/linux/module.c -+++ b/services4/srvkm/env/linux/module.c -@@ -284,9 +284,18 @@ static struct platform_device_id powervr_id_table[] __devinitdata = { - }; - #endif - -+int pvrsrv_restore_noirq(struct device *dev) -+{ -+#if defined(CONFIG_ARM_LPAE) && defined(SUPPORT_RCAR_IPMMU) -+ extern int r8a779x_ipmmu_initialize(void); -+ r8a779x_ipmmu_initialize(); -+#endif -+ return 0; -+} -+ - static struct dev_pm_ops powervr_dev_pm_ops = { -- .suspend = PVRSRVDriverSuspend, -- .resume = PVRSRVDriverResume, -+ SET_SYSTEM_SLEEP_PM_OPS(PVRSRVDriverSuspend, PVRSRVDriverResume) -+ .restore_noirq = pvrsrv_restore_noirq, - }; - - static LDM_DRV powervr_driver = { --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux-renesas_%.bbappend deleted file mode 100755 index 368f1ba1c..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux-renesas_%.bbappend +++ /dev/null @@ -1,44 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/linux:" - -# Enable support for TP-Link TL-W722N USB Wifi adapter and RTL2832U DVB USB and USB Audio -# adapter. -SRC_URI += " file://disable_delay_printk.patch \ - file://cfg_mac_80211.cfg \ - file://ath9k_htc.cfg \ - file://rtl_sdr.cfg \ - file://usbaudio.cfg \ - file://ra2x00.cfg \ - file://0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch \ - file://0002-media-r820t-remove-redundant-initializations-in-r820.patch \ - file://0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch \ - file://hciattach.cfg \ - file://pppd-rcar.cfg \ - " - -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg ${WORKDIR}/rtl_sdr.cfg" - -SRC_URI_append_agl-porter-hibernate = " file://hibernation/0001-Add-Hibernation-kernel-base-code.patch \ - file://hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch \ - file://hibernation/0003-Add-sata-hibernation-code.patch \ - file://hibernation/0004-Add-firmware-hibernation-code.patch \ - file://hibernation/0005-Add-rcar-dma-hibernation-code.patch \ - file://hibernation/0006-Add-rcar-du-hibernation-code.patch \ - file://hibernation/0007-Add-rcar-i2c-hibernation-code.patch \ - file://hibernation/0008-Add-rcar-mmc-hibernation-code.patch \ - file://hibernation/0009-Add-hibernation-store-area.patch \ - file://hibernation/0010-Add-rcar-eth-hibernation-code.patch \ - file://hibernation/0011-Add-rcar-pci-hibernation-code.patch \ - file://hibernation/0012-Add-rcar-gpio-hibernation-code.patch \ - file://hibernation/0013-Add-rcar-spi-hibernation-code.patch \ - file://hibernation/0014-Add-rcar-sci-hibernation-code.patch \ - file://hibernation/0015-Add-rcar-usbphy-hibernation-code.patch \ - file://hibernation/0001-Add-shdmac-hibernation-code.patch \ - file://hibernation/0002-Fix-Black-blink-correction-of-display.patch \ - file://hibernation/0003-Add-hibernation-image-area.patch \ - file://hibernation/hibernation.cfg \ - " - -KERNEL_CONFIG_FRAGMENTS_append_agl-porter-hibernate += " ${WORKDIR}/hibernation/hibernation.cfg" - -# file comes out of meta-agl-bsp/recipes-kernel/linux/linux_%.bbappend -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg" diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch deleted file mode 100644 index 61542556d..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 4aab0398e003ac2effae98ba66a012ed715967ba Mon Sep 17 00:00:00 2001 -From: Gianluca Gennari <gennarone@gmail.com> -Date: Sun, 2 Jun 2013 14:26:15 -0300 -Subject: [PATCH 1/3] [media] r820t: do not double-free fe->tuner_priv in - r820t_release() - -fe->tuner_priv is already freed by hybrid_tuner_release_state(). - -Signed-off-by: Gianluca Gennari <gennarone@gmail.com> -Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> -Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> ---- - drivers/media/tuners/r820t.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c -index 4835021..64f9738 100644 ---- a/drivers/media/tuners/r820t.c -+++ b/drivers/media/tuners/r820t.c -@@ -2256,7 +2256,6 @@ static int r820t_release(struct dvb_frontend *fe) - - mutex_unlock(&r820t_list_mutex); - -- kfree(fe->tuner_priv); - fe->tuner_priv = NULL; - - return 0; --- -2.9.2 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0002-media-r820t-remove-redundant-initializations-in-r820.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0002-media-r820t-remove-redundant-initializations-in-r820.patch deleted file mode 100644 index 596dd6bee..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0002-media-r820t-remove-redundant-initializations-in-r820.patch +++ /dev/null @@ -1,52 +0,0 @@ -From e2e324d70defce7ffc4668085dc3c8ae580074e5 Mon Sep 17 00:00:00 2001 -From: Gianluca Gennari <gennarone@gmail.com> -Date: Sun, 2 Jun 2013 14:30:09 -0300 -Subject: [PATCH 2/3] [media] r820t: remove redundant initializations in - r820t_attach() - -fe->tuner_priv and fe->ops.tuner_ops are initialized twice in r820t_attach(). -Remove the redundant initializations and also move fe->ops.tuner_ops -initialization outside of the mutex lock (as in the xc4000 tuner code for example). - -Signed-off-by: Gianluca Gennari <gennarone@gmail.com> -Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> -Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> ---- - drivers/media/tuners/r820t.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c -index 64f9738..63062a9 100644 ---- a/drivers/media/tuners/r820t.c -+++ b/drivers/media/tuners/r820t.c -@@ -2310,8 +2310,6 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe, - break; - } - -- memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, sizeof(r820t_tuner_ops)); -- - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - -@@ -2326,15 +2324,14 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe, - - tuner_info("Rafael Micro r820t successfully identified\n"); - -- fe->tuner_priv = priv; -- memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, -- sizeof(struct dvb_tuner_ops)); -- - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - - mutex_unlock(&r820t_list_mutex); - -+ memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, -+ sizeof(struct dvb_tuner_ops)); -+ - return fe; - err: - if (fe->ops.i2c_gate_ctrl) --- -2.9.2 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch deleted file mode 100644 index fac5c2171..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 757d7ace565c06e1302ba7c9244d839455e13881 Mon Sep 17 00:00:00 2001 -From: Gianluca Gennari <gennarone@gmail.com> -Date: Sun, 2 Jun 2013 14:31:19 -0300 -Subject: [PATCH 3/3] [media] r820t: avoid potential memcpy buffer overflow in - shadow_store() - -The memcpy in shadow_store() could exceed buffer limits when r > 0. - -Signed-off-by: Gianluca Gennari <gennarone@gmail.com> -Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> -Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> ---- - drivers/media/tuners/r820t.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c -index 63062a9..0a5f96b 100644 ---- a/drivers/media/tuners/r820t.c -+++ b/drivers/media/tuners/r820t.c -@@ -364,8 +364,8 @@ static void shadow_store(struct r820t_priv *priv, u8 reg, const u8 *val, - } - if (len <= 0) - return; -- if (len > NUM_REGS) -- len = NUM_REGS; -+ if (len > NUM_REGS - r) -+ len = NUM_REGS - r; - - tuner_dbg("%s: prev reg=%02x len=%d: %*ph\n", - __func__, r + REG_SHADOW_START, len, len, val); --- -2.9.2 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ath9k_htc.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ath9k_htc.cfg deleted file mode 100644 index 965dede65..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ath9k_htc.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ATH_CARDS=m -CONFIG_ATH9K_HTC=m diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/cfg_mac_80211.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/cfg_mac_80211.cfg deleted file mode 100644 index 559f3e7af..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/cfg_mac_80211.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_CFG80211=m -CONFIG_MAC80211=m diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/disable_delay_printk.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/disable_delay_printk.patch deleted file mode 100755 index 28acf1e08..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/disable_delay_printk.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c -old mode 100644 -new mode 100755 -index 93b6e32..2e9dd36 ---- a/sound/usb/pcm.c -+++ b/sound/usb/pcm.c -@@ -1420,8 +1420,8 @@ static void retire_playback_urb(struct snd_usb_substream *subs, - * on two reads of a counter updated every ms. - */ - if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) -- snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n", -- est_delay, subs->last_delay); -+// snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n", -+// est_delay, subs->last_delay); - - if (!subs->running) { - /* update last_frame_number for delay counting here since diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hciattach.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hciattach.cfg deleted file mode 100755 index 95ee2d7fc..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hciattach.cfg +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG_BT_HCIUART=m -CONFIG_BT_HCIUART_H4=y -CONFIG_BT_HCIUART_BCSP=y -CONFIG_BT_HCIUART_ATH3K=y -CONFIG_BT_HCIUART_LL=y -CONFIG_BT_HCIUART_3WIRE=y -CONFIG_USB_SERIAL=y -CONFIG_USB_SERIAL_GENERIC=y -CONFIG_USB_SERIAL_CP210X=y diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-Hibernation-kernel-base-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-Hibernation-kernel-base-code.patch deleted file mode 100755 index 87cd2863a..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-Hibernation-kernel-base-code.patch +++ /dev/null @@ -1,853 +0,0 @@ -From 60123966221b74199e4cf0c18d43396b4f00a94a Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 16:44:34 +0900 -Subject: [PATCH 01/15] Add Hibernation kernel base code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - include/linux/sched.h | 1 + - include/linux/suspend.h | 2 + - kernel/auditfilter.c | 2 +- - kernel/power/console.c | 2 + - kernel/power/hibernate.c | 146 +++++++++++++++++++++++++++++++---------------- - kernel/power/main.c | 4 -- - kernel/power/power.h | 8 ++- - kernel/power/process.c | 35 ++++++++---- - kernel/power/snapshot.c | 33 +++++++---- - kernel/power/suspend.c | 4 +- - kernel/power/swap.c | 50 ++++++++++++++-- - 11 files changed, 201 insertions(+), 86 deletions(-) - -diff --git a/include/linux/sched.h b/include/linux/sched.h -index f87e9a8..8e3270c 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -1644,6 +1644,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, - #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ - #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ - #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ -+#define PF_SUSPEND_TASK 0x80000000 /* this thread called freeze_processes and should not be frozen */ - - /* - * Only the _current_ task can read/write to tsk->flags, but other -diff --git a/include/linux/suspend.h b/include/linux/suspend.h -index d4e3f16..243ff56 100644 ---- a/include/linux/suspend.h -+++ b/include/linux/suspend.h -@@ -320,6 +320,8 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); - extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); - extern int hibernate(void); - extern bool system_entering_hibernation(void); -+asmlinkage int swsusp_save(void); -+extern struct pbe *restore_pblist; - #else /* CONFIG_HIBERNATION */ - static inline void register_nosave_region(unsigned long b, unsigned long e) {} - static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} -diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c -index 6bd4a90..ac08a9a 100644 ---- a/kernel/auditfilter.c -+++ b/kernel/auditfilter.c -@@ -423,7 +423,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data, - f->lsm_rule = NULL; - - /* Support legacy tests for a valid loginuid */ -- if ((f->type == AUDIT_LOGINUID) && (f->val == 4294967295)) { -+ if ((f->type == AUDIT_LOGINUID) && (f->val == 0xFFFFFFFF)) { - f->type = AUDIT_LOGINUID_SET; - f->val = 0; - } -diff --git a/kernel/power/console.c b/kernel/power/console.c -index 463aa67..aba9c54 100644 ---- a/kernel/power/console.c -+++ b/kernel/power/console.c -@@ -9,6 +9,7 @@ - #include <linux/kbd_kern.h> - #include <linux/vt.h> - #include <linux/module.h> -+#include <linux/slab.h> - #include "power.h" - - #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1) -@@ -81,6 +82,7 @@ void pm_vt_switch_unregister(struct device *dev) - list_for_each_entry(tmp, &pm_vt_switch_list, head) { - if (tmp->dev == dev) { - list_del(&tmp->head); -+ kfree(tmp); - break; - } - } -diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c -index b26f5f1..524dcf5 100644 ---- a/kernel/power/hibernate.c -+++ b/kernel/power/hibernate.c -@@ -34,12 +34,13 @@ - - static int nocompress; - static int noresume; -+static int nohibernate; - static int resume_wait; --static int resume_delay; -+static unsigned int resume_delay; - static char resume_file[256] = CONFIG_PM_STD_PARTITION; - dev_t swsusp_resume_device; - sector_t swsusp_resume_block; --int in_suspend __nosavedata; -+__visible int in_suspend __nosavedata; - - enum { - HIBERNATION_INVALID, -@@ -61,6 +62,11 @@ bool freezer_test_done; - - static const struct platform_hibernation_ops *hibernation_ops; - -+bool hibernation_available(void) -+{ -+ return (nohibernate == 0); -+} -+ - /** - * hibernation_set_ops - Set the global hibernate operations. - * @ops: Hibernation operations to use in subsequent hibernation transitions. -@@ -82,6 +88,7 @@ void hibernation_set_ops(const struct platform_hibernation_ops *ops) - - unlock_system_sleep(); - } -+EXPORT_SYMBOL_GPL(hibernation_set_ops); - - static bool entering_platform_hibernation; - -@@ -227,19 +234,23 @@ static void platform_recover(int platform_mode) - void swsusp_show_speed(struct timeval *start, struct timeval *stop, - unsigned nr_pages, char *msg) - { -- s64 elapsed_centisecs64; -- int centisecs; -- int k; -- int kps; -+ u64 elapsed_centisecs64; -+ unsigned int centisecs; -+ unsigned int k; -+ unsigned int kps; - - elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start); -+ /* -+ * If "(s64)elapsed_centisecs64 < 0", it will print long elapsed time, -+ * it is obvious enough for what went wrong. -+ */ - do_div(elapsed_centisecs64, NSEC_PER_SEC / 100); - centisecs = elapsed_centisecs64; - if (centisecs == 0) - centisecs = 1; /* avoid div-by-zero */ - k = nr_pages * (PAGE_SIZE / 1024); - kps = (k * 100) / centisecs; -- printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n", -+ pr_info("PM: %s %u kbytes in %u.%02u seconds (%u.%02u MB/s)\n", - msg, k, - centisecs / 100, centisecs % 100, - kps / 1000, (kps % 1000) / 10); -@@ -293,10 +304,10 @@ static int create_image(int platform_mode) - error); - /* Restore control flow magically appears here */ - restore_processor_state(); -- if (!in_suspend) { -+ if (!in_suspend) - events_check_enabled = false; -- platform_leave(platform_mode); -- } -+ -+ platform_leave(platform_mode); - - Power_up: - syscore_resume(); -@@ -594,7 +605,8 @@ static void power_down(void) - case HIBERNATION_PLATFORM: - hibernation_platform_enter(); - case HIBERNATION_SHUTDOWN: -- kernel_power_off(); -+ if (pm_power_off) -+ kernel_power_off(); - break; - #ifdef CONFIG_SUSPEND - case HIBERNATION_SUSPEND: -@@ -622,7 +634,8 @@ static void power_down(void) - * corruption after resume. - */ - printk(KERN_CRIT "PM: Please power down manually\n"); -- while(1); -+ while (1) -+ cpu_relax(); - } - - /** -@@ -632,6 +645,11 @@ int hibernate(void) - { - int error; - -+ if (!hibernation_available()) { -+ pr_debug("PM: Hibernation not available.\n"); -+ return -EPERM; -+ } -+ - lock_system_sleep(); - /* The snapshot device should not be opened while we're running */ - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { -@@ -644,22 +662,22 @@ int hibernate(void) - if (error) - goto Exit; - -- /* Allocate memory management structures */ -- error = create_basic_memory_bitmaps(); -- if (error) -- goto Exit; -- - printk(KERN_INFO "PM: Syncing filesystems ... "); - sys_sync(); - printk("done.\n"); - - error = freeze_processes(); - if (error) -- goto Free_bitmaps; -+ goto Exit; -+ -+ /* Allocate memory management structures */ -+ error = create_basic_memory_bitmaps(); -+ if (error) -+ goto Thaw; - - error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM); - if (error || freezer_test_done) -- goto Thaw; -+ goto Free_bitmaps; - - if (in_suspend) { - unsigned int flags = 0; -@@ -682,14 +700,13 @@ int hibernate(void) - pr_debug("PM: Image restored successfully.\n"); - } - -+ Free_bitmaps: -+ free_basic_memory_bitmaps(); - Thaw: - thaw_processes(); - - /* Don't bother checking whether freezer_test_done is true */ - freezer_test_done = false; -- -- Free_bitmaps: -- free_basic_memory_bitmaps(); - Exit: - pm_notifier_call_chain(PM_POST_HIBERNATION); - pm_restore_console(); -@@ -723,7 +740,7 @@ static int software_resume(void) - /* - * If the user said "noresume".. bail out early. - */ -- if (noresume) -+ if (noresume || !hibernation_available()) - return 0; - - /* -@@ -806,21 +823,19 @@ static int software_resume(void) - pm_prepare_console(); - error = pm_notifier_call_chain(PM_RESTORE_PREPARE); - if (error) -- goto close_finish; -- -- error = create_basic_memory_bitmaps(); -- if (error) -- goto close_finish; -+ goto Close_Finish; - - pr_debug("PM: Preparing processes for restore.\n"); - error = freeze_processes(); -- if (error) { -- swsusp_close(FMODE_READ); -- goto Done; -- } -+ if (error) -+ goto Close_Finish; - - pr_debug("PM: Loading hibernation image.\n"); - -+ error = create_basic_memory_bitmaps(); -+ if (error) -+ goto Thaw; -+ - error = swsusp_read(&flags); - swsusp_close(FMODE_READ); - if (!error) -@@ -828,9 +843,9 @@ static int software_resume(void) - - printk(KERN_ERR "PM: Failed to load hibernation image, recovering.\n"); - swsusp_free(); -- thaw_processes(); -- Done: - free_basic_memory_bitmaps(); -+ Thaw: -+ thaw_processes(); - Finish: - pm_notifier_call_chain(PM_POST_RESTORE); - pm_restore_console(); -@@ -840,12 +855,12 @@ static int software_resume(void) - mutex_unlock(&pm_mutex); - pr_debug("PM: Hibernation image not present or could not be loaded.\n"); - return error; --close_finish: -+ Close_Finish: - swsusp_close(FMODE_READ); - goto Finish; - } - --late_initcall(software_resume); -+late_initcall_sync(software_resume); - - - static const char * const hibernation_modes[] = { -@@ -889,6 +904,9 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr, - int i; - char *start = buf; - -+ if (!hibernation_available()) -+ return sprintf(buf, "[disabled]\n"); -+ - for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { - if (!hibernation_modes[i]) - continue; -@@ -923,6 +941,9 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, - char *p; - int mode = HIBERNATION_INVALID; - -+ if (!hibernation_available()) -+ return -EPERM; -+ - p = memchr(buf, '\n', n); - len = p ? p - buf : n; - -@@ -971,16 +992,20 @@ static ssize_t resume_show(struct kobject *kobj, struct kobj_attribute *attr, - static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr, - const char *buf, size_t n) - { -- unsigned int maj, min; - dev_t res; -- int ret = -EINVAL; -+ int len = n; -+ char *name; - -- if (sscanf(buf, "%u:%u", &maj, &min) != 2) -- goto out; -+ if (len && buf[len-1] == '\n') -+ len--; -+ name = kstrndup(buf, len, GFP_KERNEL); -+ if (!name) -+ return -ENOMEM; - -- res = MKDEV(maj,min); -- if (maj != MAJOR(res) || min != MINOR(res)) -- goto out; -+ res = name_to_dev_t(name); -+ kfree(name); -+ if (!res) -+ return -EINVAL; - - lock_system_sleep(); - swsusp_resume_device = res; -@@ -988,20 +1013,20 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr, - printk(KERN_INFO "PM: Starting manual resume from disk\n"); - noresume = 0; - software_resume(); -- ret = n; -- out: -- return ret; -+ return n; - } - - power_attr(resume); - --static ssize_t image_size_show(struct kobject *kobj, struct kobj_attribute *attr, -+static ssize_t image_size_show(struct kobject *kobj, -+ struct kobj_attribute *attr, - char *buf) - { - return sprintf(buf, "%lu\n", image_size); - } - --static ssize_t image_size_store(struct kobject *kobj, struct kobj_attribute *attr, -+static ssize_t image_size_store(struct kobject *kobj, -+ struct kobj_attribute *attr, - const char *buf, size_t n) - { - unsigned long size; -@@ -1065,7 +1090,7 @@ static int __init resume_setup(char *str) - if (noresume) - return 1; - -- strncpy( resume_file, str, 255 ); -+ strncpy(resume_file, str, 255); - return 1; - } - -@@ -1088,6 +1113,10 @@ static int __init hibernate_setup(char *str) - noresume = 1; - else if (!strncmp(str, "nocompress", 10)) - nocompress = 1; -+ else if (!strncmp(str, "no", 2)) { -+ noresume = 1; -+ nohibernate = 1; -+ } - return 1; - } - -@@ -1105,13 +1134,30 @@ static int __init resumewait_setup(char *str) - - static int __init resumedelay_setup(char *str) - { -- resume_delay = simple_strtoul(str, NULL, 0); -+ int rc = kstrtouint(str, 0, &resume_delay); -+ -+ if (rc) -+ return rc; -+ return 1; -+} -+ -+static int __init nohibernate_setup(char *str) -+{ -+ noresume = 1; -+ nohibernate = 1; - return 1; - } - -+static int __init kaslr_nohibernate_setup(char *str) -+{ -+ return nohibernate_setup(str); -+} -+ - __setup("noresume", noresume_setup); - __setup("resume_offset=", resume_offset_setup); - __setup("resume=", resume_setup); - __setup("hibernate=", hibernate_setup); - __setup("resumewait", resumewait_setup); - __setup("resumedelay=", resumedelay_setup); -+__setup("nohibernate", nohibernate_setup); -+__setup("kaslr", kaslr_nohibernate_setup); -diff --git a/kernel/power/main.c b/kernel/power/main.c -index d77663b..ac615e4 100644 ---- a/kernel/power/main.c -+++ b/kernel/power/main.c -@@ -610,7 +610,6 @@ static struct attribute_group attr_group = { - .attrs = g, - }; - --#ifdef CONFIG_PM_RUNTIME - struct workqueue_struct *pm_wq; - EXPORT_SYMBOL_GPL(pm_wq); - -@@ -620,9 +619,6 @@ static int __init pm_start_workqueue(void) - - return pm_wq ? 0 : -ENOMEM; - } --#else --static inline int pm_start_workqueue(void) { return 0; } --#endif - - static int __init pm_init(void) - { -diff --git a/kernel/power/power.h b/kernel/power/power.h -index 7d4b7ff..c5821ca 100644 ---- a/kernel/power/power.h -+++ b/kernel/power/power.h -@@ -2,6 +2,7 @@ - #include <linux/suspend_ioctls.h> - #include <linux/utsname.h> - #include <linux/freezer.h> -+#include <linux/compiler.h> - - struct swsusp_info { - struct new_utsname uts; -@@ -11,7 +12,8 @@ struct swsusp_info { - unsigned long image_pages; - unsigned long pages; - unsigned long size; --} __attribute__((aligned(PAGE_SIZE))); -+ char archdata[1024]; -+} __aligned(PAGE_SIZE); - - #ifdef CONFIG_HIBERNATION - /* kernel/power/snapshot.c */ -@@ -37,6 +39,8 @@ static inline char *check_image_kernel(struct swsusp_info *info) - } - #endif /* CONFIG_ARCH_HIBERNATION_HEADER */ - -+extern void __weak swsusp_arch_add_info(char *archdata); -+ - /* - * Keep some memory free so that I/O operations can succeed without paging - * [Might this be more than 4 MB?] -@@ -49,6 +53,8 @@ static inline char *check_image_kernel(struct swsusp_info *info) - */ - #define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT) - -+asmlinkage int swsusp_save(void); -+ - /* kernel/power/hibernate.c */ - extern bool freezer_test_done; - -diff --git a/kernel/power/process.c b/kernel/power/process.c -index 0695319..04559b4 100644 ---- a/kernel/power/process.c -+++ b/kernel/power/process.c -@@ -30,9 +30,10 @@ static int try_to_freeze_tasks(bool user_only) - unsigned int todo; - bool wq_busy = false; - struct timeval start, end; -- u64 elapsed_csecs64; -- unsigned int elapsed_csecs; -+ u64 elapsed_msecs64; -+ unsigned int elapsed_msecs; - bool wakeup = false; -+ int sleep_usecs = USEC_PER_MSEC; - - do_gettimeofday(&start); - -@@ -68,22 +69,25 @@ static int try_to_freeze_tasks(bool user_only) - - /* - * We need to retry, but first give the freezing tasks some -- * time to enter the refrigerator. -+ * time to enter the refrigerator. Start with an initial -+ * 1 ms sleep followed by exponential backoff until 8 ms. - */ -- msleep(10); -+ usleep_range(sleep_usecs / 2, sleep_usecs); -+ if (sleep_usecs < 8 * USEC_PER_MSEC) -+ sleep_usecs *= 2; - } - - do_gettimeofday(&end); -- elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start); -- do_div(elapsed_csecs64, NSEC_PER_SEC / 100); -- elapsed_csecs = elapsed_csecs64; -+ elapsed_msecs64 = timeval_to_ns(&end) - timeval_to_ns(&start); -+ do_div(elapsed_msecs64, NSEC_PER_MSEC); -+ elapsed_msecs = elapsed_msecs64; - - if (todo) { - printk("\n"); -- printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds " -+ printk(KERN_ERR "Freezing of tasks %s after %d.%03d seconds " - "(%d tasks refusing to freeze, wq_busy=%d):\n", - wakeup ? "aborted" : "failed", -- elapsed_csecs / 100, elapsed_csecs % 100, -+ elapsed_msecs / 1000, elapsed_msecs % 1000, - todo - wq_busy, wq_busy); - - if (!wakeup) { -@@ -96,8 +100,8 @@ static int try_to_freeze_tasks(bool user_only) - read_unlock(&tasklist_lock); - } - } else { -- printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100, -- elapsed_csecs % 100); -+ printk("(elapsed %d.%03d seconds) ", elapsed_msecs / 1000, -+ elapsed_msecs % 1000); - } - - return todo ? -EBUSY : 0; -@@ -139,6 +143,9 @@ int freeze_processes(void) - if (error) - return error; - -+ /* Make sure this task doesn't get frozen */ -+ current->flags |= PF_SUSPEND_TASK; -+ - if (!pm_freezing) - atomic_inc(&system_freezing_cnt); - -@@ -202,6 +209,7 @@ int freeze_kernel_threads(void) - void thaw_processes(void) - { - struct task_struct *g, *p; -+ struct task_struct *curr = current; - - if (pm_freezing) - atomic_dec(&system_freezing_cnt); -@@ -217,10 +225,15 @@ void thaw_processes(void) - - read_lock(&tasklist_lock); - do_each_thread(g, p) { -+ /* No other threads should have PF_SUSPEND_TASK set */ -+ WARN_ON((p != curr) && (p->flags & PF_SUSPEND_TASK)); - __thaw_task(p); - } while_each_thread(g, p); - read_unlock(&tasklist_lock); - -+ WARN_ON(!(curr->flags & PF_SUSPEND_TASK)); -+ curr->flags &= ~PF_SUSPEND_TASK; -+ - usermodehelper_enable(); - - schedule(); -diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c -index 91c04f1..a673f7b 100644 ---- a/kernel/power/snapshot.c -+++ b/kernel/power/snapshot.c -@@ -27,6 +27,7 @@ - #include <linux/highmem.h> - #include <linux/list.h> - #include <linux/slab.h> -+#include <linux/compiler.h> - - #include <asm/uaccess.h> - #include <asm/mmu_context.h> -@@ -155,7 +156,7 @@ static inline void free_image_page(void *addr, int clear_nosave_free) - struct linked_page { - struct linked_page *next; - char data[LINKED_PAGE_DATA_SIZE]; --} __attribute__((packed)); -+} __packed; - - static inline void - free_list_of_pages(struct linked_page *list, int clear_page_nosave) -@@ -352,7 +353,7 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask) - struct mem_extent *ext, *cur, *aux; - - zone_start = zone->zone_start_pfn; -- zone_end = zone->zone_start_pfn + zone->spanned_pages; -+ zone_end = zone_end_pfn(zone); - - list_for_each_entry(ext, list, hook) - if (zone_start <= ext->end) -@@ -642,8 +643,9 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, - region->end_pfn = end_pfn; - list_add_tail(®ion->list, &nosave_regions); - Report: -- printk(KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n", -- start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); -+ printk(KERN_INFO "PM: Registered nosave memory: [mem %#010llx-%#010llx]\n", -+ (unsigned long long) start_pfn << PAGE_SHIFT, -+ ((unsigned long long) end_pfn << PAGE_SHIFT) - 1); - } - - /* -@@ -742,7 +744,10 @@ int create_basic_memory_bitmaps(void) - struct memory_bitmap *bm1, *bm2; - int error = 0; - -- BUG_ON(forbidden_pages_map || free_pages_map); -+ if (forbidden_pages_map && free_pages_map) -+ return 0; -+ else -+ BUG_ON(forbidden_pages_map || free_pages_map); - - bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL); - if (!bm1) -@@ -788,7 +793,8 @@ void free_basic_memory_bitmaps(void) - { - struct memory_bitmap *bm1, *bm2; - -- BUG_ON(!(forbidden_pages_map && free_pages_map)); -+ if (WARN_ON(!(forbidden_pages_map && free_pages_map))) -+ return; - - bm1 = forbidden_pages_map; - bm2 = free_pages_map; -@@ -883,7 +889,7 @@ static unsigned int count_highmem_pages(void) - continue; - - mark_free_pages(zone); -- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; -+ max_zone_pfn = zone_end_pfn(zone); - for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) - if (saveable_highmem_page(zone, pfn)) - n++; -@@ -947,7 +953,7 @@ static unsigned int count_data_pages(void) - continue; - - mark_free_pages(zone); -- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; -+ max_zone_pfn = zone_end_pfn(zone); - for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) - if (saveable_page(zone, pfn)) - n++; -@@ -1040,7 +1046,7 @@ copy_data_pages(struct memory_bitmap *copy_bm, struct memory_bitmap *orig_bm) - unsigned long max_zone_pfn; - - mark_free_pages(zone); -- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; -+ max_zone_pfn = zone_end_pfn(zone); - for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) - if (page_is_saveable(zone, pfn)) - memory_bm_set_bit(orig_bm, pfn); -@@ -1092,7 +1098,7 @@ void swsusp_free(void) - unsigned long pfn, max_zone_pfn; - - for_each_populated_zone(zone) { -- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; -+ max_zone_pfn = zone_end_pfn(zone); - for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) - if (pfn_valid(pfn)) { - struct page *page = pfn_to_page(pfn); -@@ -1580,7 +1586,7 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, - return -ENOMEM; - } - --asmlinkage int swsusp_save(void) -+asmlinkage __visible int swsusp_save(void) - { - unsigned int nr_pages, nr_highmem; - -@@ -1628,6 +1634,7 @@ static int init_header_complete(struct swsusp_info *info) - { - memcpy(&info->uts, init_utsname(), sizeof(struct new_utsname)); - info->version_code = LINUX_VERSION_CODE; -+ swsusp_arch_add_info(info->archdata); - return 0; - } - -@@ -1647,6 +1654,8 @@ static char *check_image_kernel(struct swsusp_info *info) - } - #endif /* CONFIG_ARCH_HIBERNATION_HEADER */ - -+void __weak swsusp_arch_add_info(char *archdata) {} -+ - unsigned long snapshot_get_image_size(void) - { - return nr_copy_pages + nr_meta_pages + 1; -@@ -1758,7 +1767,7 @@ static int mark_unsafe_pages(struct memory_bitmap *bm) - - /* Clear page flags */ - for_each_populated_zone(zone) { -- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages; -+ max_zone_pfn = zone_end_pfn(zone); - for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) - if (pfn_valid(pfn)) - swsusp_unset_page_free(pfn_to_page(pfn)); -diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c -index bef86d1..deec937 100644 ---- a/kernel/power/suspend.c -+++ b/kernel/power/suspend.c -@@ -156,13 +156,13 @@ static int suspend_prepare(suspend_state_t state) - } - - /* default implementation */ --void __attribute__ ((weak)) arch_suspend_disable_irqs(void) -+void __weak arch_suspend_disable_irqs(void) - { - local_irq_disable(); - } - - /* default implementation */ --void __attribute__ ((weak)) arch_suspend_enable_irqs(void) -+void __weak arch_suspend_enable_irqs(void) - { - local_irq_enable(); - } -diff --git a/kernel/power/swap.c b/kernel/power/swap.c -index 7c33ed2..a6a1c55 100644 ---- a/kernel/power/swap.c -+++ b/kernel/power/swap.c -@@ -91,17 +91,28 @@ struct swap_map_handle { - unsigned int k; - unsigned long reqd_free_pages; - u32 crc32; -+#ifdef CONFIG_ARCH_SHMOBILE -+ unsigned int img_size; /* add */ -+#endif - }; - - struct swsusp_header { -+#ifdef CONFIG_ARCH_SHMOBILE -+ char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) - -+ sizeof(u32) - (sizeof(unsigned int)*4) - sizeof(u32)]; -+ unsigned int comp_crc32[4]; -+ u32 img_size; -+#else - char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) - -- sizeof(u32)]; -+ sizeof(u32) - sizeof(u32)]; -+ u32 comp_crc32; -+#endif - u32 crc32; - sector_t image; - unsigned int flags; /* Flags to pass to the "boot" kernel */ - char orig_sig[10]; - char sig[10]; --} __attribute__((packed)); -+} __packed; - - static struct swsusp_header *swsusp_header; - -@@ -230,6 +241,11 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags) - swsusp_header->flags = flags; - if (flags & SF_CRC32_MODE) - swsusp_header->crc32 = handle->crc32; -+ -+#ifdef CONFIG_ARCH_SHMOBILE -+ swsusp_header->img_size = handle->img_size; -+#endif -+ - error = hib_bio_write_page(swsusp_resume_block, - swsusp_header, NULL); - } else { -@@ -587,7 +603,11 @@ static int save_image_lzo(struct swap_map_handle *handle, - unsigned char *page = NULL; - struct cmp_data *data = NULL; - struct crc_data *crc = NULL; -+ int compr = 0; - -+#ifdef CONFIG_ARCH_SHMOBILE -+ unsigned int comp_imgtotal = 0; -+#endif - /* - * We'll limit the number of threads for compression to limit memory - * footprint. -@@ -733,7 +753,12 @@ static int save_image_lzo(struct swap_map_handle *handle, - } - - *(size_t *)data[thr].cmp = data[thr].cmp_len; -- -+ compr += data[thr].cmp_len; -+#ifdef CONFIG_ARCH_SHMOBILE -+ comp_imgtotal += (data[thr].cmp_len -+ + LZO_HEADER + (PAGE_SIZE - 1)) -+ & ~(PAGE_SIZE - 1); -+#endif - /* - * Given we are writing one page at a time to disk, we - * copy that much from the buffer, although the last -@@ -746,7 +771,6 @@ static int save_image_lzo(struct swap_map_handle *handle, - off < LZO_HEADER + data[thr].cmp_len; - off += PAGE_SIZE) { - memcpy(page, data[thr].cmp + off, PAGE_SIZE); -- - ret = swap_write_page(handle, page, &bio); - if (ret) - goto out_finish; -@@ -762,8 +786,24 @@ out_finish: - do_gettimeofday(&stop); - if (!ret) - ret = err2; -- if (!ret) -+ if (!ret) { -+#ifdef CONFIG_ARCH_SHMOBILE -+ const unsigned int ds = comp_imgtotal + -+ ((comp_imgtotal -+ / ((2 * 1024 * 1024) -+ - PAGE_SIZE)) * PAGE_SIZE); -+ const unsigned int swaped = -+ (swp_offset(get_swap_page_of_type(root_swap)) -+ - 2) * PAGE_SIZE; -+ if (ds < swaped) -+ handle->img_size = swaped; -+ else -+ handle->img_size = ds; -+#endif - printk(KERN_INFO "PM: Image saving done.\n"); -+ printk(KERN_INFO "PM: Compressed output size: %d [%d] (imgsize=%d/swaped size=%d)\n", -+ compr, handle->img_size, ds, swaped); -+ } - swsusp_show_speed(&start, &stop, nr_to_write, "Wrote"); - out_clean: - if (crc) { --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch deleted file mode 100644 index ad4e4bc03..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch +++ /dev/null @@ -1,110 +0,0 @@ -From dfc07c05c50155420e47f85442d099d433db869b Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 9 Jun 2017 20:11:49 +0900 -Subject: [PATCH 1/3] Add shdmac hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/dma/sh/shdmac.c | 36 ++++++++++++++++++++++++------------ - 1 file changed, 24 insertions(+), 12 deletions(-) - -diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c -index 1c97cc5..d084437 100644 ---- a/drivers/dma/sh/shdmac.c -+++ b/drivers/dma/sh/shdmac.c -@@ -743,11 +743,20 @@ static int sh_dmae_resume(struct device *dev) - #define sh_dmae_resume NULL - #endif - -+static int sh_dmae_restore(struct device *dev) -+{ -+#ifdef CONFIG_PM -+ return sh_dmae_resume(dev); -+#else -+ return 0; -+#endif -+} -+ - const struct dev_pm_ops sh_dmae_pm = { -- .suspend = sh_dmae_suspend, -- .resume = sh_dmae_resume, -- .runtime_suspend = sh_dmae_runtime_suspend, -- .runtime_resume = sh_dmae_runtime_resume, -+ SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume) -+ SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume, -+ NULL) -+ .restore_noirq = sh_dmae_restore, - }; - - static dma_addr_t sh_dmae_slave_addr(struct shdma_chan *schan) -@@ -798,7 +807,6 @@ static int sh_dmae_probe(struct platform_device *pdev) - struct sh_dmae_device *shdev; - struct dma_device *dma_dev; - struct resource *chan, *dmars, *errirq_res, *chanirq_res; -- unsigned long flags; - - if (pdev->dev.of_node) - pdata = of_match_device(sh_dmae_of_match, &pdev->dev)->data; -@@ -885,9 +893,9 @@ static int sh_dmae_probe(struct platform_device *pdev) - if (err < 0) - dev_err(&pdev->dev, "%s(): GET = %d\n", __func__, err); - -- spin_lock_irqsave(&sh_dmae_lock, flags); -+ spin_lock_irq(&sh_dmae_lock); - list_add_tail_rcu(&shdev->node, &sh_dmae_devices); -- spin_unlock_irqrestore(&sh_dmae_lock, flags); -+ spin_unlock_irq(&sh_dmae_lock); - - /* reset dma controller - only needed as a test */ - err = sh_dmae_rst(shdev); -@@ -981,6 +989,7 @@ static int sh_dmae_probe(struct platform_device *pdev) - return err; - - edmadevreg: -+ pm_runtime_get(&pdev->dev); - chan_probe_err: - sh_dmae_chan_remove(shdev); - -@@ -988,9 +997,9 @@ chan_probe_err: - eirq_err: - #endif - rst_err: -- spin_lock_irqsave(&sh_dmae_lock, flags); -+ spin_lock_irq(&sh_dmae_lock); - list_del_rcu(&shdev->node); -- spin_unlock_irqrestore(&sh_dmae_lock, flags); -+ spin_unlock_irq(&sh_dmae_lock); - - pm_runtime_put(&pdev->dev); - pm_runtime_disable(&pdev->dev); -@@ -1007,13 +1016,12 @@ static int sh_dmae_remove(struct platform_device *pdev) - { - struct sh_dmae_device *shdev = platform_get_drvdata(pdev); - struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev; -- unsigned long flags; - - dma_async_device_unregister(dma_dev); - -- spin_lock_irqsave(&sh_dmae_lock, flags); -+ spin_lock_irq(&sh_dmae_lock); - list_del_rcu(&shdev->node); -- spin_unlock_irqrestore(&sh_dmae_lock, flags); -+ spin_unlock_irq(&sh_dmae_lock); - - pm_runtime_disable(&pdev->dev); - -@@ -1047,7 +1055,11 @@ static int __init sh_dmae_init(void) - - return platform_driver_probe(&sh_dmae_driver, sh_dmae_probe); - } -+#ifdef MODULE - module_init(sh_dmae_init); -+#else -+subsys_initcall(sh_dmae_init); -+#endif - - static void __exit sh_dmae_exit(void) - { --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch deleted file mode 100755 index 4db90e4e0..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch +++ /dev/null @@ -1,1529 +0,0 @@ -From 34a419b3fd88a2275ca681c99a5787b937e0f39d Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 16:47:29 +0900 -Subject: [PATCH 02/15] Add Hibernation arch code(Only R-CAR M2W) - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - arch/arm/Kconfig | 5 + - arch/arm/include/asm/memory.h | 1 + - arch/arm/include/asm/smp.h | 4 + - arch/arm/include/asm/suspend.h | 3 + - arch/arm/kernel/Makefile | 1 + - arch/arm/kernel/hibernate.c | 139 ++++++++++++++ - arch/arm/kernel/process.c | 7 +- - arch/arm/kernel/sleep.S | 8 + - arch/arm/kernel/smp.c | 6 + - arch/arm/kernel/suspend.c | 64 ++++--- - arch/arm/mach-shmobile/Kconfig | 65 +++++++ - arch/arm/mach-shmobile/Makefile | 1 + - arch/arm/mach-shmobile/common.h | 8 + - arch/arm/mach-shmobile/crc32_word4.c | 299 +++++++++++++++++++++++++++++++ - arch/arm/mach-shmobile/crc32_word4.h | 23 +++ - arch/arm/mach-shmobile/headsmp.S | 2 - - arch/arm/mach-shmobile/hibernation.c | 243 +++++++++++++++++++++++++ - arch/arm/mach-shmobile/platsmp-apmu.c | 13 +- - arch/arm/mach-shmobile/platsmp-rst.c | 3 +- - arch/arm/mach-shmobile/pm-r8a7791.c | 27 +-- - arch/arm/mach-shmobile/rcar-gen2.h | 39 ++++ - arch/arm/mach-shmobile/setup-r8a7791.c | 10 +- - arch/arm/mach-shmobile/setup-rcar-gen2.c | 14 +- - arch/arm/mach-shmobile/smp-r8a7791.c | 8 +- - arch/arm/mm/proc-v7.S | 31 ++-- - 25 files changed, 947 insertions(+), 77 deletions(-) - create mode 100644 arch/arm/kernel/hibernate.c - create mode 100644 arch/arm/mach-shmobile/crc32_word4.c - create mode 100644 arch/arm/mach-shmobile/crc32_word4.h - create mode 100644 arch/arm/mach-shmobile/hibernation.c - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 4dd95dd..eb76182 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -2232,6 +2232,11 @@ config ARCH_SUSPEND_POSSIBLE - config ARM_CPU_SUSPEND - def_bool PM_SLEEP - -+config ARCH_HIBERNATION_POSSIBLE -+ bool -+ depends on MMU -+ default y if ARCH_SUSPEND_POSSIBLE -+ - endmenu - - source "net/Kconfig" -diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h -index 48cb2b3..01158e7 100644 ---- a/arch/arm/include/asm/memory.h -+++ b/arch/arm/include/asm/memory.h -@@ -241,6 +241,7 @@ static inline void *phys_to_virt(phys_addr_t x) - #define __pa(x) __virt_to_phys((unsigned long)(x)) - #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) - #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) -+#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) - - /* - * Virtual <-> DMA view memory address translations -diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h -index d3a22be..b718040 100644 ---- a/arch/arm/include/asm/smp.h -+++ b/arch/arm/include/asm/smp.h -@@ -42,6 +42,10 @@ void handle_IPI(int ipinr, struct pt_regs *regs); - */ - extern void smp_init_cpus(void); - -+/* -+ * Provide a function to call machine specific cpu initialization sequence -+ */ -+extern void arch_smp_prepare_cpus(unsigned int max_cpus); - - /* - * Provide a function to raise an IPI cross call on CPUs in callmap. -diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h -index 1c0a551..709afa4 100644 ---- a/arch/arm/include/asm/suspend.h -+++ b/arch/arm/include/asm/suspend.h -@@ -3,5 +3,8 @@ - - extern void cpu_resume(void); - extern int cpu_suspend(unsigned long, int (*)(unsigned long)); -+extern const void __nosave_begin, __nosave_end; -+extern void cpu_resume_restore_nosave(u32, u32, u32); -+extern void call_with_stack(void (*fn)(void *), void *arg, void *sp); - - #endif -diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile -index 5f3338e..70f439f 100644 ---- a/arch/arm/kernel/Makefile -+++ b/arch/arm/kernel/Makefile -@@ -32,6 +32,7 @@ obj-$(CONFIG_ARTHUR) += arthur.o - obj-$(CONFIG_ISA_DMA) += dma-isa.o - obj-$(CONFIG_PCI) += bios32.o isa.o - obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o -+obj-$(CONFIG_HIBERNATION) += hibernate.o - obj-$(CONFIG_SMP) += smp.o smp_tlb.o - obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o - obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o -diff --git a/arch/arm/kernel/hibernate.c b/arch/arm/kernel/hibernate.c -new file mode 100644 -index 0000000..9380fe2 ---- /dev/null -+++ b/arch/arm/kernel/hibernate.c -@@ -0,0 +1,139 @@ -+/* -+ * Hibernation support specific for ARM -+ * -+ * Derived from work on ARM hibernation support by: -+ * -+ * Ubuntu project, hibernation support for mach-dove -+ * Copyright (C) 2010 Nokia Corporation (Hiroshi Doyu) -+ * Copyright (C) 2010 Texas Instruments, Inc. (Teerth Reddy et al.) -+ * https://lkml.org/lkml/2010/6/18/4 -+ * https://lists.linux-foundation.org/pipermail/linux-pm/2010-June/027422.html -+ * https://patchwork.kernel.org/patch/96442/ -+ * -+ * Copyright (C) 2006 Rafael J. Wysocki <rjw at sisk.pl> -+ * -+ * License terms: GNU General Public License (GPL) version 2 -+ */ -+ -+#include <linux/mm.h> -+#include <linux/suspend.h> -+#include <asm/system_misc.h> -+#include <asm/idmap.h> -+#include <asm/suspend.h> -+#include <asm/memory.h> -+ -+struct swsusp_archdata { -+ u32 nosave_backup_phys; -+ u32 nosave_begin_phys; -+ u32 nosave_end_phys; -+ /* Function pointer */ -+ u32 cpu_resume_restore_nosave; -+}; -+ -+static struct swsusp_archdata __archdata; -+ -+void swsusp_arch_add_info(char *archdata) -+{ -+ memcpy((void *)archdata, (void *)&__archdata, -+ sizeof(struct swsusp_archdata)); -+} -+ -+int pfn_is_nosave(unsigned long pfn) -+{ -+ unsigned long nosave_begin_pfn = virt_to_pfn(&__nosave_begin); -+ unsigned long nosave_end_pfn = virt_to_pfn(&__nosave_end - 1); -+ -+ return (pfn >= nosave_begin_pfn) && (pfn <= nosave_end_pfn); -+} -+ -+void notrace save_processor_state(void) -+{ -+ WARN_ON(num_online_cpus() != 1); -+ local_fiq_disable(); -+} -+ -+void notrace restore_processor_state(void) -+{ -+ local_fiq_enable(); -+} -+ -+/* -+ * Snapshot kernel memory and reset the system. -+ * -+ * swsusp_save() is executed in the suspend finisher so that the CPU -+ * context pointer and memory are part of the saved image, which is -+ * required by the resume kernel image to restart execution from -+ * swsusp_arch_suspend(). -+ * -+ * soft_restart is not technically needed, but is used to get success -+ * returned from cpu_suspend. -+ * -+ * When soft reboot completes, the hibernation snapshot is written out. -+ */ -+static int notrace arch_save_image(unsigned long unused) -+{ -+ int ret; -+ ret = swsusp_save(); -+ if (ret == 0) -+ soft_restart(virt_to_phys(cpu_resume)); -+ return ret; -+} -+ -+/* -+ * Save the current CPU state before suspend / poweroff. -+ */ -+int notrace swsusp_arch_suspend(void) -+{ -+ return cpu_suspend(0, arch_save_image); -+} -+ -+/* -+ * Restore page contents for physical pages that were in use during loading -+ * hibernation image. Switch to idmap_pgd so the physical page tables -+ * are overwritten with the same contents. -+ */ -+static void notrace arch_restore_image(void *unused) -+{ -+ struct pbe *pbe; -+ -+ -+ cpu_switch_mm(idmap_pgd, &init_mm); -+ for (pbe = restore_pblist; pbe; pbe = pbe->next) -+ copy_page(pbe->orig_address, pbe->address); -+ -+ soft_restart(virt_to_phys(cpu_resume)); -+} -+static u64 resume_stack[PAGE_SIZE/2/sizeof(u64)] __nosavedata; -+ -+/* -+ * Resume from the hibernation image. -+ * Due to the kernel heap / data restore, stack contents change underneath -+ * and that would make function calls impossible; switch to a temporary -+ * stack within the nosave region to avoid that problem. -+ */ -+int swsusp_arch_resume(void) -+{ -+ call_with_stack(arch_restore_image, 0, -+ resume_stack + ARRAY_SIZE(resume_stack)); -+ return 0; -+} -+ -+static int __init swsusp_arch_init(void) -+{ -+ char *backup; -+ size_t len; -+ -+ len = &__nosave_end - &__nosave_begin; -+ backup = kmalloc(len, GFP_KERNEL); -+ if (backup) -+ memcpy(backup, &__nosave_begin, len); -+ -+ __archdata.nosave_backup_phys = virt_to_phys(backup); -+ __archdata.nosave_begin_phys = virt_to_phys(&__nosave_begin); -+ __archdata.nosave_end_phys = virt_to_phys(&__nosave_end); -+ __archdata.cpu_resume_restore_nosave = -+ virt_to_phys(cpu_resume_restore_nosave); -+ -+ return 0; -+} -+late_initcall(swsusp_arch_init); -diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c -index 7927629..ae56f0b 100644 ---- a/arch/arm/kernel/process.c -+++ b/arch/arm/kernel/process.c -@@ -98,7 +98,7 @@ void soft_restart(unsigned long addr) - u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack); - - /* Disable interrupts first */ -- local_irq_disable(); -+ raw_local_irq_disable(); - local_fiq_disable(); - - /* Disable the L2 if we're the last man standing. */ -@@ -284,12 +284,17 @@ void __show_regs(struct pt_regs *regs) - buf[3] = flags & PSR_V_BIT ? 'V' : 'v'; - buf[4] = '\0'; - -+#ifndef CONFIG_CPU_V7M - printk("Flags: %s IRQs o%s FIQs o%s Mode %s ISA %s Segment %s\n", - buf, interrupts_enabled(regs) ? "n" : "ff", - fast_interrupts_enabled(regs) ? "n" : "ff", - processor_modes[processor_mode(regs)], - isa_modes[isa_mode(regs)], - get_fs() == get_ds() ? "kernel" : "user"); -+#else -+ printk("xPSR: %08lx\n", regs->ARM_cpsr); -+#endif -+ - #ifdef CONFIG_CPU_CP15 - { - unsigned int ctrl; -diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S -index 987dcf3..e4d092f 100644 ---- a/arch/arm/kernel/sleep.S -+++ b/arch/arm/kernel/sleep.S -@@ -98,6 +98,14 @@ THUMB( mov sp, r2 ) - THUMB( bx r3 ) - ENDPROC(cpu_resume) - -+ .align -+ENTRY(cpu_resume_restore_nosave) -+1: ldmia r0!, {r3-r10} -+ stmia r1!, {r3-r10} -+ cmp r1, r2 -+ bne 1b -+ b cpu_resume -+ - sleep_save_sp: - .rept CONFIG_NR_CPUS - .long 0 @ preserve stack phys ptr here -diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c -index 5919eb4..c9a2991 100644 ---- a/arch/arm/kernel/smp.c -+++ b/arch/arm/kernel/smp.c -@@ -125,6 +125,12 @@ void __init smp_init_cpus(void) - smp_ops.smp_init_cpus(); - } - -+void arch_smp_prepare_cpus(unsigned int max_cpus) -+{ -+ if (smp_ops.smp_prepare_cpus) -+ smp_ops.smp_prepare_cpus(max_cpus); -+} -+ - int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) - { - if (smp_ops.smp_boot_secondary) -diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c -index c59c97e..38a5067 100644 ---- a/arch/arm/kernel/suspend.c -+++ b/arch/arm/kernel/suspend.c -@@ -10,6 +10,42 @@ - extern int __cpu_suspend(unsigned long, int (*)(unsigned long)); - extern void cpu_resume_mmu(void); - -+#ifdef CONFIG_MMU -+/* -+ * Hide the first two arguments to __cpu_suspend - these are an implementation -+ * detail which platform code shouldn't have to know about. -+ */ -+int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) -+{ -+ struct mm_struct *mm = current->active_mm; -+ int ret; -+ -+ if (!idmap_pgd) -+ return -EINVAL; -+ -+ /* -+ * Provide a temporary page table with an identity mapping for -+ * the MMU-enable code, required for resuming. On successful -+ * resume (indicated by a zero return code), we need to switch -+ * back to the correct page tables. -+ */ -+ ret = __cpu_suspend(arg, fn); -+ if (ret == 0) { -+ cpu_switch_mm(mm->pgd, mm); -+ local_flush_bp_all(); -+ local_flush_tlb_all(); -+ } -+ -+ return ret; -+} -+#else -+int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) -+{ -+ return __cpu_suspend(arg, fn); -+} -+#define idmap_pgd NULL -+#endif -+ - /* - * This is called by __cpu_suspend() to save the state, and do whatever - * flushing is required to ensure that when the CPU goes to sleep we have -@@ -46,31 +82,3 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr) - outer_clean_range(virt_to_phys(save_ptr), - virt_to_phys(save_ptr) + sizeof(*save_ptr)); - } -- --/* -- * Hide the first two arguments to __cpu_suspend - these are an implementation -- * detail which platform code shouldn't have to know about. -- */ --int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) --{ -- struct mm_struct *mm = current->active_mm; -- int ret; -- -- if (!idmap_pgd) -- return -EINVAL; -- -- /* -- * Provide a temporary page table with an identity mapping for -- * the MMU-enable code, required for resuming. On successful -- * resume (indicated by a zero return code), we need to switch -- * back to the correct page tables. -- */ -- ret = __cpu_suspend(arg, fn); -- if (ret == 0) { -- cpu_switch_mm(mm->pgd, mm); -- local_flush_bp_all(); -- local_flush_tlb_all(); -- } -- -- return ret; --} -diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig -index 7c15245..73371de 100644 ---- a/arch/arm/mach-shmobile/Kconfig -+++ b/arch/arm/mach-shmobile/Kconfig -@@ -64,6 +64,25 @@ config MACH_KOELSCH - select MICREL_PHY if SH_ETH - select SND_SOC_AK4642 if SND_SIMPLE_CARD - -+config MACH_KOELSCH_FTEN -+ bool "FTEN spf development environment" -+ depends on MACH_KOELSCH -+ -+config MACH_FTEN -+ bool -+ -+config MACH_FTEN_DT -+ bool -+ -+config MACH_FTEN_M2W -+ bool "FTEN R-Car M2W board" -+ depends on ARCH_R8A7791 -+ select MACH_FTEN -+ select MACH_FTEN_DT -+ select HAVE_IDE -+ select FIQ -+ select SND_SOC_DIRANA3 if SND_SIMPLE_CARD -+ - config MACH_LAGER - bool "Lager board" - depends on ARCH_R8A7790 -@@ -76,6 +95,15 @@ config MACH_GOSE - select MICREL_PHY if SH_ETH - select SND_SOC_AK4642 if SND_SIMPLE_CARD - -+config MACH_FTEN_M2N -+ bool "FTEN R-Car M2N board" -+ depends on ARCH_R8A7793 -+ select MACH_FTEN -+ select MACH_FTEN_DT -+ select HAVE_IDE -+ select FIQ -+ select SND_SOC_DIRANA3 if SND_SIMPLE_CARD -+ - config MACH_ALT - bool "Alt board" - depends on ARCH_R8A7794 -@@ -287,6 +315,19 @@ config MACH_KOELSCH - select USE_OF - select MICREL_PHY if SH_ETH - -+config MACH_FTEN -+ bool "FTEN strawberry board" -+ depends on ARCH_R8A7791 -+ select USE_OF -+ select HAVE_IDE -+ -+config MACH_FTEN_DT -+ bool "FTEN strawberry board - Device Tree Implementation" -+ depends on ARCH_R8A7791 -+ select USE_OF -+ select HAVE_IDE -+ select SND_SOC_DIRANA3 if SND_SIMPLE_CARD -+ - config MACH_KZM9G - bool "KZM-A9-GT board" - depends on ARCH_SH73A0 -@@ -360,4 +401,28 @@ config EM_TIMER_STI - - endmenu - -+if HIBERNATION -+ -+menu "Hibernation area parameters" -+ -+config SWSUSP_AREA -+ hex "RAM hibernation area address" -+ default "0x44000000" -+ depends on HIBERNATION -+ ---help--- -+ RAM hibernation area address, this is required for CRC -+ calculation of final compressed hibernation image -+ -+config SWSUSP_AREA_SIZE -+ hex "RAM hibernation area size" -+ default "0x4000000" -+ depends on HIBERNATION -+ ---help--- -+ RAM hibernation area size, this is required for CRC -+ calculation of final compressed hibernation image -+ -+endmenu -+ -+endif -+ - endif -diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile -index 43b4025..71cfcfa 100644 ---- a/arch/arm/mach-shmobile/Makefile -+++ b/arch/arm/mach-shmobile/Makefile -@@ -55,6 +55,7 @@ smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o - - # PM objects - obj-$(CONFIG_SUSPEND) += suspend.o -+obj-$(CONFIG_HIBERNATION) += hibernation.o - obj-$(CONFIG_CPU_IDLE) += cpuidle.o - obj-$(CONFIG_CPU_FREQ) += cpufreq.o - obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o -diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h -index 95a77a0..37c7f87 100644 ---- a/arch/arm/mach-shmobile/common.h -+++ b/arch/arm/mach-shmobile/common.h -@@ -25,6 +25,7 @@ struct clk; - extern int shmobile_clk_init(void); - extern void shmobile_handle_irq_intc(struct pt_regs *); - extern struct platform_suspend_ops shmobile_suspend_ops; -+extern const struct platform_hibernation_ops shmobile_hibernation_ops; - struct cpuidle_driver; - extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv); - extern void shmobile_smp_apmu_enter_cpuidle(void); -@@ -37,6 +38,12 @@ static inline int shmobile_suspend_init(void) { return 0; } - static inline void shmobile_smp_apmu_suspend_init(void) { } - #endif - -+#ifdef CONFIG_HIBERNATION -+int shmobile_hibernation_init(void); -+#else -+static inline int shmobile_hibernation_init(void) { return 0; } -+#endif -+ - #ifdef CONFIG_CPU_IDLE - int shmobile_cpuidle_init(void); - #else -@@ -59,6 +66,7 @@ extern unsigned int l2actlr_value; - static inline void __init shmobile_init_late(void) - { - shmobile_suspend_init(); -+ shmobile_hibernation_init(); - shmobile_cpuidle_init(); - shmobile_cpufreq_init(); - } -diff --git a/arch/arm/mach-shmobile/crc32_word4.c b/arch/arm/mach-shmobile/crc32_word4.c -new file mode 100644 -index 0000000..8aaefc6 ---- /dev/null -+++ b/arch/arm/mach-shmobile/crc32_word4.c -@@ -0,0 +1,299 @@ -+/************************************************************************* -+ * crc32_word4.c: rapid CRC32 -+ * Coptright (C) FUJITSUTEN Limited, 2015 All Rights Reserved. -+ * -+ * 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, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ *************************************************************************/ -+#ifdef OWNTEST -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+#include <asm/types.h> -+typedef unsigned int u_int32_t; -+#else -+#endif -+ -+#include "crc32_word4.h" -+ -+#define CRC_INIT_VALUE (-1) -+#define CRC_FIX(_crc32) (~(_crc32)) -+ -+/* #define HWDPLS_ENABLE */ -+#define __HWDTPLS_OUT() -+#define MEASURE(msg) -+ -+/**** calc_crc32.c *****/ -+ -+/* -+ * CRC32ã¯ã€ISO 3309 ã§è¦ç¨‹ã•ã‚Œ -+ * ãã®ã‚µãƒ³ãƒ—ル㯠-+ * RFC 2083 :PNG(Poratble Network Graphics -+ * ã§å…¬ã«ãªã£ã¦ã„ã¾ã™ã€‚本プãƒã‚°ãƒ©ãƒ ã¯ã€RFC2083 ã§æŽ²ç¤ºã•ã‚ŒãŸ -+ * CRC32を独自ã«æœ€é©åŒ–ã—ãŸãƒ—ãƒã‚°ãƒ©ãƒ ã§ã™ã€‚ -+ */ -+const static u_int32_t CRC_Table[256] = { -+ 0x00000000 , 0x77073096 , 0xee0e612c , 0x990951ba , 0x076dc419 , 0x706af48f , 0xe963a535 , 0x9e6495a3 , -+ 0x0edb8832 , 0x79dcb8a4 , 0xe0d5e91e , 0x97d2d988 , 0x09b64c2b , 0x7eb17cbd , 0xe7b82d07 , 0x90bf1d91 , -+ 0x1db71064 , 0x6ab020f2 , 0xf3b97148 , 0x84be41de , 0x1adad47d , 0x6ddde4eb , 0xf4d4b551 , 0x83d385c7 , -+ 0x136c9856 , 0x646ba8c0 , 0xfd62f97a , 0x8a65c9ec , 0x14015c4f , 0x63066cd9 , 0xfa0f3d63 , 0x8d080df5 , -+ 0x3b6e20c8 , 0x4c69105e , 0xd56041e4 , 0xa2677172 , 0x3c03e4d1 , 0x4b04d447 , 0xd20d85fd , 0xa50ab56b , -+ 0x35b5a8fa , 0x42b2986c , 0xdbbbc9d6 , 0xacbcf940 , 0x32d86ce3 , 0x45df5c75 , 0xdcd60dcf , 0xabd13d59 , -+ 0x26d930ac , 0x51de003a , 0xc8d75180 , 0xbfd06116 , 0x21b4f4b5 , 0x56b3c423 , 0xcfba9599 , 0xb8bda50f , -+ 0x2802b89e , 0x5f058808 , 0xc60cd9b2 , 0xb10be924 , 0x2f6f7c87 , 0x58684c11 , 0xc1611dab , 0xb6662d3d , -+ 0x76dc4190 , 0x01db7106 , 0x98d220bc , 0xefd5102a , 0x71b18589 , 0x06b6b51f , 0x9fbfe4a5 , 0xe8b8d433 , -+ 0x7807c9a2 , 0x0f00f934 , 0x9609a88e , 0xe10e9818 , 0x7f6a0dbb , 0x086d3d2d , 0x91646c97 , 0xe6635c01 , -+ 0x6b6b51f4 , 0x1c6c6162 , 0x856530d8 , 0xf262004e , 0x6c0695ed , 0x1b01a57b , 0x8208f4c1 , 0xf50fc457 , -+ 0x65b0d9c6 , 0x12b7e950 , 0x8bbeb8ea , 0xfcb9887c , 0x62dd1ddf , 0x15da2d49 , 0x8cd37cf3 , 0xfbd44c65 , -+ 0x4db26158 , 0x3ab551ce , 0xa3bc0074 , 0xd4bb30e2 , 0x4adfa541 , 0x3dd895d7 , 0xa4d1c46d , 0xd3d6f4fb , -+ 0x4369e96a , 0x346ed9fc , 0xad678846 , 0xda60b8d0 , 0x44042d73 , 0x33031de5 , 0xaa0a4c5f , 0xdd0d7cc9 , -+ 0x5005713c , 0x270241aa , 0xbe0b1010 , 0xc90c2086 , 0x5768b525 , 0x206f85b3 , 0xb966d409 , 0xce61e49f , -+ 0x5edef90e , 0x29d9c998 , 0xb0d09822 , 0xc7d7a8b4 , 0x59b33d17 , 0x2eb40d81 , 0xb7bd5c3b , 0xc0ba6cad , -+ 0xedb88320 , 0x9abfb3b6 , 0x03b6e20c , 0x74b1d29a , 0xead54739 , 0x9dd277af , 0x04db2615 , 0x73dc1683 , -+ 0xe3630b12 , 0x94643b84 , 0x0d6d6a3e , 0x7a6a5aa8 , 0xe40ecf0b , 0x9309ff9d , 0x0a00ae27 , 0x7d079eb1 , -+ 0xf00f9344 , 0x8708a3d2 , 0x1e01f268 , 0x6906c2fe , 0xf762575d , 0x806567cb , 0x196c3671 , 0x6e6b06e7 , -+ 0xfed41b76 , 0x89d32be0 , 0x10da7a5a , 0x67dd4acc , 0xf9b9df6f , 0x8ebeeff9 , 0x17b7be43 , 0x60b08ed5 , -+ 0xd6d6a3e8 , 0xa1d1937e , 0x38d8c2c4 , 0x4fdff252 , 0xd1bb67f1 , 0xa6bc5767 , 0x3fb506dd , 0x48b2364b , -+ 0xd80d2bda , 0xaf0a1b4c , 0x36034af6 , 0x41047a60 , 0xdf60efc3 , 0xa867df55 , 0x316e8eef , 0x4669be79 , -+ 0xcb61b38c , 0xbc66831a , 0x256fd2a0 , 0x5268e236 , 0xcc0c7795 , 0xbb0b4703 , 0x220216b9 , 0x5505262f , -+ 0xc5ba3bbe , 0xb2bd0b28 , 0x2bb45a92 , 0x5cb36a04 , 0xc2d7ffa7 , 0xb5d0cf31 , 0x2cd99e8b , 0x5bdeae1d , -+ 0x9b64c2b0 , 0xec63f226 , 0x756aa39c , 0x026d930a , 0x9c0906a9 , 0xeb0e363f , 0x72076785 , 0x05005713 , -+ 0x95bf4a82 , 0xe2b87a14 , 0x7bb12bae , 0x0cb61b38 , 0x92d28e9b , 0xe5d5be0d , 0x7cdcefb7 , 0x0bdbdf21 , -+ 0x86d3d2d4 , 0xf1d4e242 , 0x68ddb3f8 , 0x1fda836e , 0x81be16cd , 0xf6b9265b , 0x6fb077e1 , 0x18b74777 , -+ 0x88085ae6 , 0xff0f6a70 , 0x66063bca , 0x11010b5c , 0x8f659eff , 0xf862ae69 , 0x616bffd3 , 0x166ccf45 , -+ 0xa00ae278 , 0xd70dd2ee , 0x4e048354 , 0x3903b3c2 , 0xa7672661 , 0xd06016f7 , 0x4969474d , 0x3e6e77db , -+ 0xaed16a4a , 0xd9d65adc , 0x40df0b66 , 0x37d83bf0 , 0xa9bcae53 , 0xdebb9ec5 , 0x47b2cf7f , 0x30b5ffe9 , -+ 0xbdbdf21c , 0xcabac28a , 0x53b39330 , 0x24b4a3a6 , 0xbad03605 , 0xcdd70693 , 0x54de5729 , 0x23d967bf , -+ 0xb3667a2e , 0xc4614ab8 , 0x5d681b02 , 0x2a6f2b94 , 0xb40bbe37 , 0xc30c8ea1 , 0x5a05df1b , 0x2d02ef8d , -+}; -+ -+/*** -+ * CRC Table creater. -+ * -+void make_crc_table(void) { -+ u_int32_t c; -+ u_int32_t n, k; -+ for (n = 0; n < 256; n++) -+ { -+ c = (u_int32_t) n; -+ for (k = 0; k < 8; k++) -+ { -+ if (c & 1) -+ c = 0xedb88320L ^ (c >> 1); -+ else -+ c = c >> 1; -+ } -+ CRC_Table[n] = c; -+ } -+} -+***/ -+#define NEXT_PTR (4) -+ -+static __inline__ -+u_int32_t _update_crc(u_int32_t crc, unsigned char *buf, size_t len) -+{ -+ u_int32_t c = crc; -+ size_t n; -+ for (n = 0; n < len; n++) -+ c = CRC_Table[(c ^ buf[n]) & 0xff] ^ (c >> 8); -+ return c; -+} -+/********************************************************************* -+ * update_crc4x4()() -+ * calc_crc32() をベースã«ã€4 ワード毎ã«å€‹åˆ¥ã« CRC32 を計算ã™ã‚‹æ–¹æ³• -+ * -+ * +0 +1 +2 +3 -+ * +0x00 AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD -+ * +0x04 EEEEEEEE FFFFFFFF 00000000 11111111 -+ * : : : : -+ * CRC32 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx -+ * -+ *********************************************************************/ -+ -+static __inline__ -+void update_crc4x4(u_int32_t crc[4], unsigned char *buf) -+{ -+ u_int32_t c1, c2, c3, c4; -+ u_int32_t *p = (void *)buf; -+ -+ c1 = crc[0] ^ p[0]; -+ c2 = crc[1] ^ p[1]; -+ c3 = crc[2] ^ p[2]; -+ c4 = crc[3] ^ p[3]; -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8); -+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8); -+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8); -+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8); -+ -+ crc[0] = c1; -+ crc[1] = c2; -+ crc[2] = c3; -+ crc[3] = c4; -+} -+ -+ -+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result) -+{ -+ unsigned int crc_tmp[4] = {CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE}; -+ u_int32_t i; -+ int res; -+ u_int32_t n4; -+ int xlen = len; -+#ifdef HWDPLS_ENABLE -+ unsigned long plstout = 60; -+ unsigned long plsstart = 0; -+ if ((unsigned long)CONFIG_SYS_HZ > 100000) -+ plstout *= (unsigned long)CONFIG_SYS_HZ / 1000; -+ else -+ plstout = DIV_ROUND_UP(plstout * (unsigned long)CONFIG_SYS_HZ, 1000); -+#endif -+ -+ /** -+ * 4ãƒã‚¤ãƒˆå¢ƒç•Œã«åˆã‚ãªã„開始アドレスã®å ´åˆ -+ * 境界ã¾ã§ã®CRCã‚’ crc_tmp[0] ã«æ±‚ã‚る。 -+ */ -+ if ((unsigned long)buf & 3) { -+ crc_tmp[0] = _update_crc(crc_tmp[0], buf, (unsigned long)buf & 3); -+ buf = (unsigned char *)((unsigned long)buf & ~3); -+ xlen -= (unsigned long)buf & 3; -+ } -+ -+ n4 = xlen/(NEXT_PTR*4); -+ /** -+ * 4ãƒã‚¤ãƒˆå¢ƒç•Œã«åˆã‚ãªã„開始アドレスã®å ´åˆ -+ * 境界ã¾ã§ã®CRCã‚’ crc_tmp[0] ã«æ±‚ã‚る。 -+ */ -+#ifdef HWDPLS_ENABLE -+ reset_timer(); -+ plsstart = get_timer(0); -+#endif -+ for (i = 0; i < n4; i++) { -+ update_crc4x4(crc_tmp, buf); -+ buf += NEXT_PTR * 4; -+#ifdef HWDPLS_ENABLE -+ /** -+ * WDを考慮 -+ */ -+ if (__builtin_expect((int)((i & 0x1f) == 0), 0)) { -+ if ((get_timer(plsstart)) > plstout) { -+ __HWDTPLS_OUT(); -+ MEASURE("crc plsout") -+ plsstart += plstout; -+ } -+ } -+#endif /*HWPLS_ENABLE*/ -+ } -+ -+ res = xlen % (NEXT_PTR * 4); -+ if (res > 0) -+ crc_tmp[3] = _update_crc(crc_tmp[3], buf, res); -+ -+ result->crc_w[0] = CRC_FIX(crc_tmp[0]); -+ result->crc_w[1] = CRC_FIX(crc_tmp[1]); -+ result->crc_w[2] = CRC_FIX(crc_tmp[2]); -+ result->crc_w[3] = CRC_FIX(crc_tmp[3]); -+ -+ MEASURE("calc_crc32x4 finish") -+} -+ -+#if defined(OWNTEST) -+#define BUFSIZE (2 * 1024 * 1024) -+#include <sys/time.h> -+#include <malloc.h> -+ -+int main() -+{ -+ unsigned char *buf, *buf2; -+ struct timeval start, end; -+ unsigned long long diff; -+ int i; -+ -+ CRC32_WORD4_t result = { .crc_w = {0, 0, 0, 0 } }; -+ CRC32_WORD4_t result2 = { .crc_w = {0, 0, 0, 0 } }; -+ -+ buf = malloc(BUFSIZE); -+ if (!buf) { -+ perror("malloc"); -+ return 1; -+ } -+ printf("Generate %dMB random data..\n", BUFSIZE / 1024 / 1024); -+ srand(0); -+ for (i = 0; i < BUFSIZE / 4; i++) -+ ((int *)buf)[i] = rand(); -+ -+ /* Memory dup */ -+ buf2 = memalign(NEXT_PTR, BUFSIZE); -+ if (!buf2) { -+ perror("malloc"); -+ return 1; -+ } -+ memcpy(buf2, buf, BUFSIZE); -+ -+ -+ gettimeofday(&start, NULL); -+ calc_crc32x4(buf, BUFSIZE, &result); -+ gettimeofday(&end, NULL); -+ -+ diff = (end.tv_sec - start.tv_sec) * 1000000; -+ diff += end.tv_usec - start.tv_usec; -+ -+ printf("time=%lluus\n", diff); -+ printf(" result.word[0] = %x\n", result.crc_w[0]); -+ printf(" result.word[1] = %x\n", result.crc_w[1]); -+ printf(" result.word[2] = %x\n", result.crc_w[2]); -+ printf(" result.word[3] = %x\n", result.crc_w[3]); -+ -+ /* Broken test */ -+#if 0 /* Destory test */ -+ buf[rand() % BUFSIZE] ^= 1 << (rand()%7); -+#endif -+ for (i = 0; i < BUFSIZE; i++) { -+ if (buf[i] != buf2[i]) -+ printf("buf[%d] %02x : %02x\n", i, buf[i], buf2[i]); -+ } -+ -+ gettimeofday(&start, NULL); -+ calc_crc32x4(buf, BUFSIZE, &result2); -+ gettimeofday(&end, NULL); -+ -+ diff = (end.tv_sec - start.tv_sec) * 1000000; -+ diff += end.tv_usec - start.tv_usec; -+ -+ printf("time=%lluus\n", diff); -+ printf(" result.word[0] = %x:%s\n", result2.crc_w[0] , -+ result.crc_w[0] == result2.crc_w[0] ? "OK" : "NG"); -+ printf(" result.word[1] = %x:%s\n", result2.crc_w[1] , -+ result.crc_w[1] == result2.crc_w[1] ? "OK" : "NG"); -+ printf(" result.word[2] = %x:%s\n", result2.crc_w[2] , -+ result.crc_w[2] == result2.crc_w[2] ? "OK" : "NG"); -+ printf(" result.word[3] = %x:%s\n", result2.crc_w[3] , -+ result.crc_w[3] == result2.crc_w[3] ? "OK" : "NG"); -+ return 0; -+} -+#endif /* TEST */ -diff --git a/arch/arm/mach-shmobile/crc32_word4.h b/arch/arm/mach-shmobile/crc32_word4.h -new file mode 100644 -index 0000000..6c04878 ---- /dev/null -+++ b/arch/arm/mach-shmobile/crc32_word4.h -@@ -0,0 +1,23 @@ -+/************************************************************************* -+ * Coptright (C) FUJITSUTEN Limited, 2012 All Rights Reserved. -+ * -+ *************************************************************************/ -+#ifndef __CRC32_WORD4_H__ -+#define __CRC32_WORD4_H__ -+ -+typedef struct { -+ unsigned int crc_w[4]; -+} CRC32_WORD4_t; -+ -+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result); -+ -+typedef struct { -+ unsigned int size; -+ CRC32_WORD4_t chksum; -+ unsigned int dummy[3]; -+} CRC32_WORD4_TICKET_t; -+ -+#define IS_CRC_WORD4_OK(_res1, _res2) (!memcmp(_res1, _res2, sizeof(CRC32_WORD4_t))) -+#define IS_CRC_WORD4_ZERO(_w4) (((_w4)->crc_w[0] == 0) && ((_w4)->crc_w[1] == 0) && ((_w4)->crc_w[2] == 0) && ((_w4)->crc_w[3] == 0)) -+#define IS_CRC_WORD4_ALL_F(_w4) (((_w4)->crc_w[0] == 0xffffffff) && ((_w4)->crc_w[1] == 0xffffffff) && ((_w4)->crc_w[2] == 0xffffffff) && ((_w4)->crc_w[3] == 0xffffffff)) -+#endif -diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S -index debf271..f99f8b2 100644 ---- a/arch/arm/mach-shmobile/headsmp.S -+++ b/arch/arm/mach-shmobile/headsmp.S -@@ -16,8 +16,6 @@ - #include <linux/threads.h> - #include <asm/memory.h> - -- __CPUINIT -- - #ifdef CONFIG_SMP - ENTRY(shmobile_invalidate_start) - bl v7_invalidate_l1 -diff --git a/arch/arm/mach-shmobile/hibernation.c b/arch/arm/mach-shmobile/hibernation.c -new file mode 100644 -index 0000000..94fa78b ---- /dev/null -+++ b/arch/arm/mach-shmobile/hibernation.c -@@ -0,0 +1,243 @@ -+/* -+ * Suspend-to-RAM support code for SH-Mobile ARM -+ * -+ * Copyright (C) 2011 Magnus Damm -+ * -+ * This file is subject to the terms and conditions of the GNU General Public -+ * License. See the file "COPYING" in the main directory of this archive -+ * for more details. -+ */ -+#include <linux/pm.h> -+#include <linux/suspend.h> -+#include <linux/module.h> -+#include <linux/err.h> -+#include <linux/cpu.h> -+#include <linux/smp.h> -+ -+#include <linux/io.h> -+#include <asm/system_misc.h> -+#include <asm/page.h> -+#include <asm/smp_plat.h> -+ -+#include "common.h" -+#include "rcar-gen2.h" -+ -+#include <linux/clk.h> -+ -+#include "crc32_word4.c" -+#include "pm-rcar.h" -+ -+ -+struct swsusp_header { -+ char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) - -+ sizeof(u32) - sizeof(CRC32_WORD4_t) - sizeof(u32)]; -+ CRC32_WORD4_t comp_crc32; -+ u32 img_size; /* add. see. kernel/power/swap.c */ -+ u32 crc32; -+ sector_t image; -+ unsigned int flags; /* Flags to pass to the "boot" kernel */ -+ char orig_sig[10]; -+ char sig[10]; -+} __packed; -+static unsigned long swsusp_area = CONFIG_SWSUSP_AREA; -+static unsigned long swsusp_area_size = CONFIG_SWSUSP_AREA_SIZE; -+ -+enum { -+ MSTP00, MSTP01, MSTP02, MSTP03, MSTP04, MSTP05, -+ MSTP07, MSTP08, MSTP09, MSTP10, MSTP11, -+ MSTP_NR, -+}; -+ -+static struct { -+ u32 s_offset; -+ u32 s_val; -+ u32 r_offset; -+ u32 r_val; -+} mstp_regs[] = { -+ [MSTP00] = { SMSTPCR0, 0, -+ RMSTPCR0, 0}, -+ [MSTP01] = { SMSTPCR1, 0, -+ RMSTPCR1, 0}, -+ [MSTP02] = { SMSTPCR2, 0, -+ RMSTPCR2, 0}, -+ [MSTP03] = { SMSTPCR3, 0, -+ RMSTPCR3, 0}, -+ [MSTP04] = { SMSTPCR4, 0, -+ RMSTPCR4, 0}, -+ [MSTP05] = { SMSTPCR5, 0, -+ RMSTPCR5, 0}, -+ [MSTP07] = { SMSTPCR7, 0, -+ RMSTPCR7, 0}, -+ [MSTP08] = { SMSTPCR8, 0, -+ RMSTPCR8, 0}, -+ [MSTP09] = { SMSTPCR9, 0, -+ RMSTPCR9, 0}, -+ [MSTP10] = { SMSTPCR10, 0, -+ RMSTPCR10, 0}, -+ [MSTP11] = { SMSTPCR11, 0, -+ RMSTPCR11, 0}, -+}; -+ -+static void save_mstp_regs(void) -+{ -+ int i; -+ void *m = ioremap(CPG_BASE, CPG_LEN); -+ for (i = MSTP00; i < MSTP_NR; i++) { -+ mstp_regs[i].s_val = ioread32(m +mstp_regs[i].s_offset); -+ mstp_regs[i].r_val = ioread32(m +mstp_regs[i].r_offset); -+ } -+ iounmap(m); -+} -+ -+static void restore_mstp_regs(void) -+{ -+ int i; -+ void *m = ioremap(CPG_BASE, CPG_LEN); -+ for (i = MSTP00; i < MSTP_NR; i++) { -+ iowrite32(mstp_regs[i].s_val, m +mstp_regs[i].s_offset); -+ iowrite32(mstp_regs[i].r_val, m +mstp_regs[i].r_offset); -+ } -+ iounmap(m); -+} -+ -+static int shmobile_hibernation_begin(void) -+{ -+ save_mstp_regs(); -+ return 0; -+} -+ -+static void shmobile_hibernation_end(void) -+{ -+} -+ -+static int shmobile_hibernation_pre_snapshot(void) -+{ -+ return 0; -+} -+ -+ -+static void shmobile_hibernation_finish(void) -+{ -+} -+ -+static int shmobile_hibernation_prepare(void) -+{ -+ return 0; -+} -+ -+static int shmobile_hibernation_enter(void) -+{ -+ void *m, *l; -+ struct swsusp_header *h; -+ unsigned int calc_sz; -+ if (swsusp_area_size > 0) { -+ h = m = ioremap(swsusp_area, swsusp_area_size); -+ if (h) { -+ if ((h->img_size > PAGE_SIZE) -+ && (h->img_size < (swsusp_area_size - PAGE_SIZE))) -+ calc_sz = h->img_size; -+ else -+ calc_sz = swsusp_area_size - PAGE_SIZE; -+ memset(&h->comp_crc32, 0, sizeof(h->comp_crc32)); -+ calc_crc32x4(m + PAGE_SIZE, calc_sz, &h->comp_crc32); -+ mb(); -+ iounmap(m); -+ } -+ } -+ /* Resetting FDP0 */ -+ l = ioremap(0xfe940000, 0x4000); -+ writel(1, l + 0x1c); -+ mb(); -+ iounmap(l); -+ /* Resetting FDP1 */ -+ l = ioremap(0xfe944000, 0x4000); -+ writel(1, l + 0x1c); -+ mb(); -+ iounmap(l); -+ /* Doing board reset */ -+ l = ioremap(0xe6300200, 4); -+ writel(0xa1b20001, l); -+ mb(); -+ iounmap(l); -+ -+ return 0; -+} -+ -+char *clks[] = { -+ "ehci", "hsusb", "dmal", "dmah", "sys-dmac1", -+ "sys-dmac0", "ssp", "ssp_dev", "ipmmu_gp", -+ "audmac0", "audmac1", -+}; -+ -+static int shmobile_hibernation_pre_restore(void) -+{ -+ return 0; -+} -+ -+ -+static void shmobile_hibernation_restore_cleanup(void) -+{ -+} -+ -+extern int in_suspend; -+ -+static void shmobile_hibernation_leave(void) -+{ -+ int restore_highmem(void); -+ struct clk *clk; -+ unsigned int i; -+ -+ if (!in_suspend) { -+#ifdef CONFIG_SMP -+ if (is_smp()) -+ arch_smp_prepare_cpus(setup_max_cpus); -+#endif -+ -+#ifdef CONFIG_HIGHMEM -+ restore_highmem(); -+#endif -+ restore_mstp_regs(); -+ } -+ -+ for (i = 0; i < ARRAY_SIZE(clks); ++i) { -+ clk = clk_get(NULL, clks[i]); -+ if (!IS_ERR(clk)) { -+ clk_prepare_enable(clk); -+ clk_put(clk); -+ } -+ } -+} -+ -+const struct platform_hibernation_ops shmobile_hibernation_ops = { -+ .leave = shmobile_hibernation_leave, -+ .begin = shmobile_hibernation_begin, -+ .end = shmobile_hibernation_end, -+ .pre_snapshot = shmobile_hibernation_pre_snapshot, -+ .finish = shmobile_hibernation_finish, -+ .prepare = shmobile_hibernation_prepare, -+ .enter = shmobile_hibernation_enter, -+ .pre_restore = shmobile_hibernation_pre_restore, -+ .restore_cleanup = shmobile_hibernation_restore_cleanup, -+}; -+ -+int __init shmobile_hibernation_init(void) -+{ -+ hibernation_set_ops(&shmobile_hibernation_ops); -+ return 0; -+} -+static int setup_swsusp_area(char *s) -+{ -+ long tmp = 0; -+ char *p; -+ if (!kstrtol(s, 0, &tmp) && tmp > 0) -+ swsusp_area = tmp; -+ p = strchr(s, ','); -+ if (!p) -+ goto out; -+ if (!kstrtol(p, 0, &tmp) && tmp > 0) -+ swsusp_area_size = tmp; -+out: -+ return 1; -+} -+__setup("swsusp_area=", setup_swsusp_area); -+ -diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c -index cff7a25..e382e26 100644 ---- a/arch/arm/mach-shmobile/platsmp-apmu.c -+++ b/arch/arm/mach-shmobile/platsmp-apmu.c -@@ -33,7 +33,10 @@ - - /* only enable the cluster that includes the boot CPU by default */ - static bool enable_multicluster = false; -+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || \ -+defined(CONFIG_CPU_IDLE) - static bool is_last_cpu; -+#endif - - static __init int apmu_setup(char *opt) - { -@@ -71,12 +74,15 @@ static int __maybe_unused apmu_power_on(void __iomem *p, int bit) - return 0; - } - -+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || \ -+defined(CONFIG_CPU_IDLE) - static int apmu_power_off(void __iomem *p, int bit) - { - /* request Core Standby for next WFI */ - writel_relaxed(3, p + CPUNCR_OFFS(bit)); - return 0; - } -+#endif - - static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit) - { -@@ -92,12 +98,15 @@ static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit) - return 0; - } - -+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || \ -+defined(CONFIG_CPU_IDLE) || defined(CONFIG_SMP) - static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu)) - { - void __iomem *p = apmu_cpus[cpu].iomem; - - return p ? fn(p, apmu_cpus[cpu].bit) : -EINVAL; - } -+#endif - - static void apmu_init_cpu(struct resource *res, int cpu, int bit) - { -@@ -141,7 +150,7 @@ static void apmu_parse_cfg(void (*fn)(struct resource *res, int cpu, int bit), - } - } - --void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus, -+void shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus, - struct rcar_apmu_config *apmu_config, - int num) - { -@@ -328,7 +337,7 @@ static int __cpuinit shmobile_smp_apmu_enter_suspend(suspend_state_t state) - return 0; - } - --void __init shmobile_smp_apmu_suspend_init(void) -+void shmobile_smp_apmu_suspend_init(void) - { - cpucmcr_ca7 = ioremap_nocache(CPUCMCR_CA7, 0x4); - cpucmcr_ca15 = ioremap_nocache(CPUCMCR_CA15, 0x4); -diff --git a/arch/arm/mach-shmobile/platsmp-rst.c b/arch/arm/mach-shmobile/platsmp-rst.c -index 70a2b6c..7ba9eeb 100644 ---- a/arch/arm/mach-shmobile/platsmp-rst.c -+++ b/arch/arm/mach-shmobile/platsmp-rst.c -@@ -11,8 +11,7 @@ - #include <linux/io.h> - #include <asm/smp_plat.h> - #include <mach/platsmp-rst.h> -- --#define RST 0xe6160000 -+#include "rcar-gen2.h" - - #define r8a779x_clst_id(cpu) (cpu_logical_map((cpu)) >> 8) - #define r8a779x_cpu_id(cpu) (cpu_logical_map((cpu)) & 0xff) -diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c -index f0ed98c..a13da84 100644 ---- a/arch/arm/mach-shmobile/pm-r8a7791.c -+++ b/arch/arm/mach-shmobile/pm-r8a7791.c -@@ -21,16 +21,9 @@ - #include <asm/io.h> - #include "common.h" - #include "pm-rcar.h" -+#include "rcar-gen2.h" - #include "r8a7791.h" - --#define RST 0xe6160000 --#define CA15BAR 0x0020 --#define RAM 0xe63c0000 -- --/* SYSC */ --#define SYSCIER 0x0c --#define SYSCIMR 0x10 -- - struct r8a7791_pm_domain { - struct generic_pm_domain genpd; - struct rcar_sysc_ch ch; -@@ -43,13 +36,14 @@ static inline struct rcar_sysc_ch *to_r8a7791_ch(struct generic_pm_domain *d) - - #if defined(CONFIG_PM) || defined(CONFIG_SMP) - --static void __init r8a7791_sysc_init(void) -+static void r8a7791_sysc_init(void) - { -- void __iomem *base = rcar_sysc_init(0xe6180000); -+ void __iomem *base = rcar_sysc_init(SYSC_BASE); - - /* enable all interrupt sources, but do not use interrupt handler */ - iowrite32(0x0131000e, base + SYSCIER); -- iowrite32(0, base + SYSCIMR); -+ /* keep reserved bits as they are in TRM */ -+ iowrite32(0x012001ec, base + SYSCIMR); - } - - #else /* CONFIG_PM || CONFIG_SMP */ -@@ -60,9 +54,6 @@ static inline void r8a7791_sysc_init(void) {} - - #ifdef CONFIG_PM - --#define CPG_BASE 0xe6150000 --#define CPG_LEN 0x1000 -- - /* Software Reset */ - #define SRCR0 0x00a0 - #define SRCR1 0x00a8 -@@ -243,14 +234,10 @@ static struct notifier_block platform_nb = { - - #endif /* CONFIG_PM */ - --void __init r8a7791_pm_init(void) -+void r8a7791_pm_init(void) - { - void __iomem *p; - u32 bar; -- static int once; -- -- if (once++) -- return; - - /* RAM for jump stub, because BAR requires 256KB aligned address */ - p = ioremap_nocache(RAM, shmobile_boot_size); -@@ -258,7 +245,7 @@ void __init r8a7791_pm_init(void) - iounmap(p); - - /* setup reset vectors */ -- p = ioremap_nocache(RST, 0x63); -+ p = ioremap_nocache(RST, RST_LEN); - bar = (RAM >> 8) & 0xfffffc00; - writel_relaxed(bar, p + CA15BAR); - writel_relaxed(bar | 0x10, p + CA15BAR); -diff --git a/arch/arm/mach-shmobile/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h -index ce53cb5..df7201a 100644 ---- a/arch/arm/mach-shmobile/rcar-gen2.h -+++ b/arch/arm/mach-shmobile/rcar-gen2.h -@@ -1,6 +1,45 @@ - #ifndef __ASM_RCAR_GEN2_H__ - #define __ASM_RCAR_GEN2_H__ - -+#define CPG_BASE 0xe6150000 -+#define CPG_LEN 0x1000 -+#define RMSTPCR0 0x110 -+#define RMSTPCR1 0x114 -+#define RMSTPCR2 0x118 -+#define RMSTPCR3 0x11c -+#define RMSTPCR4 0x120 -+#define RMSTPCR5 0x124 -+#define RMSTPCR7 0x12c -+#define RMSTPCR8 0x980 -+#define RMSTPCR9 0x984 -+#define RMSTPCR10 0x988 -+#define RMSTPCR11 0x98c -+#define SMSTPCR0 0x130 -+#define SMSTPCR1 0x134 -+#define SMSTPCR2 0x138 -+#define SMSTPCR3 0x13c -+#define SMSTPCR4 0x140 -+#define SMSTPCR5 0x144 -+#define SMSTPCR7 0x14c -+#define SMSTPCR8 0x990 -+#define SMSTPCR9 0x994 -+#define SMSTPCR10 0x998 -+#define SMSTPCR11 0x99c -+ -+#define SYSC_BASE 0xe6180000 -+#define SYSCIER 0x0c -+#define SYSCIMR 0x10 -+ -+#define RST 0xe6160000 -+#define RST_LEN 0x64 -+ -+#define CA15BAR 0x0020 -+#define CA7BAR 0x0030 -+#define RAM 0xe63c0000 -+ -+#define CNTCR 0 -+#define CNTFID0 0x20 -+ - void rcar_gen2_timer_init(void); - #define MD(nr) BIT(nr) - u32 rcar_gen2_read_mode_pins(void); -diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c -index 2aa431a..c48c6a9 100644 ---- a/arch/arm/mach-shmobile/setup-r8a7791.c -+++ b/arch/arm/mach-shmobile/setup-r8a7791.c -@@ -29,6 +29,7 @@ - #include <linux/sh_timer.h> - #include <linux/spi/sh_msiof.h> - #include <asm/mach/arch.h> -+#include <asm/smp_plat.h> - - #include "common.h" - #include "dma-register.h" -@@ -243,8 +244,6 @@ static const struct resource powervr_resources[] __initconst = { - powervr_resources, \ - ARRAY_SIZE(powervr_resources)) - --#define CPG_BASE 0xe6150000 --#define CPG_LEN 0x1000 - #define RGXCR 0x0B4 - - void __init r8a7791_register_pvrsrvkm(void) -@@ -271,7 +270,12 @@ void __init r8a7791_register_ssp(void) - - void __init r8a7791_add_dt_devices(void) - { -- r8a7791_pm_init(); -+#ifdef CONFIG_SMP -+ /* In case of SMP config pm_init already called from smp_prepare_cpus. -+ * It is still needed to call pm_init if 'nosmp' was given */ -+ if (!setup_max_cpus) -+#endif -+ r8a7791_pm_init(); - r8a7791_init_pm_domains(); - r8a7791_register_cmt(00); - r8a7791_register_pvrsrvkm(); -diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c -index da16ebd..641ee1d 100644 ---- a/arch/arm/mach-shmobile/setup-rcar-gen2.c -+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c -@@ -47,9 +47,6 @@ u32 rcar_gen2_read_mode_pins(void) - return mode; - } - --#define CNTCR 0 --#define CNTFID0 0x20 -- - void __init rcar_gen2_timer_init(void) - { - #if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK) -@@ -58,7 +55,7 @@ void __init rcar_gen2_timer_init(void) - #ifdef CONFIG_ARM_ARCH_TIMER - void __iomem *base; - int extal_mhz = 0; -- u32 freq; -+ u32 rcar_gen2_archtimer_freq; - - /* At Linux boot time the r8a7790 arch timer comes up - * with the counter disabled. Moreover, it may also report -@@ -83,7 +80,7 @@ void __init rcar_gen2_timer_init(void) - } - - /* The arch timer frequency equals EXTAL / 2 */ -- freq = extal_mhz * (1000000 / 2); -+ rcar_gen2_archtimer_freq = extal_mhz * (1000000 / 2); - - /* Remap "armgcnt address map" space */ - base = ioremap(0xe6080000, PAGE_SIZE); -@@ -96,10 +93,11 @@ void __init rcar_gen2_timer_init(void) - */ - - if ((ioread32(base + CNTCR) & 1) == 0 || -- ioread32(base + CNTFID0) != freq) { -+ ioread32(base + CNTFID0) != rcar_gen2_archtimer_freq) { - /* Update registers with correct frequency */ -- iowrite32(freq, base + CNTFID0); -- asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq)); -+ iowrite32(rcar_gen2_archtimer_freq, base + CNTFID0); -+ asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" -+ (rcar_gen2_archtimer_freq)); - - /* make sure arch timer is started by setting bit 0 of CNTCR */ - iowrite32(1, base + CNTCR); -diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c -index 24cad9f..4583cb6 100644 ---- a/arch/arm/mach-shmobile/smp-r8a7791.c -+++ b/arch/arm/mach-shmobile/smp-r8a7791.c -@@ -33,6 +33,11 @@ - - #define CA15RESCNT 0x0040 - -+static struct rcar_sysc_ch r8a7791_ca15_scu = { -+ .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */ -+ .isr_bit = 12, /* CA15-SCU */ -+}; -+ - static struct rcar_apmu_config r8a7791_apmu_config[] = { - { - .iomem = DEFINE_RES_MEM(0xe6152000, 0x88), -@@ -47,7 +52,7 @@ static struct rcar_rst_config r8a7791_rst_config[] = { - } - }; - --static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) -+static void r8a7791_smp_prepare_cpus(unsigned int max_cpus) - { - void __iomem *p; - u32 val; -@@ -67,6 +72,7 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) - } - - r8a7791_pm_init(); -+ rcar_sysc_power_up(&r8a7791_ca15_scu); - - /* keep secondary CPU cores in reset */ - r8a779x_init_reset(r8a7791_rst_config); -diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S -index 19da841..35c9048 100644 ---- a/arch/arm/mm/proc-v7.S -+++ b/arch/arm/mm/proc-v7.S -@@ -92,48 +92,59 @@ ENDPROC(cpu_v7_dcache_clean_area) - - /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ - .globl cpu_v7_suspend_size --.equ cpu_v7_suspend_size, 4 * 8 -+.equ cpu_v7_suspend_size, 4 * 9 - #ifdef CONFIG_ARM_CPU_SUSPEND - ENTRY(cpu_v7_do_suspend) - stmfd sp!, {r4 - r10, lr} - mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID - mrc p15, 0, r5, c13, c0, 3 @ User r/o thread ID - stmia r0!, {r4 - r5} -+#ifdef CONFIG_MMU - mrc p15, 0, r6, c3, c0, 0 @ Domain ID -+#ifdef CONFIG_ARM_LPAE -+ mrrc p15, 1, r5, r7, c2 @ TTB 1 -+#else - mrc p15, 0, r7, c2, c0, 1 @ TTB 1 -+#endif - mrc p15, 0, r11, c2, c0, 2 @ TTB control register -+#endif - mrc p15, 0, r8, c1, c0, 0 @ Control register - mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register - mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control -- stmia r0, {r6 - r11} -+ stmia r0, {r5 - r11} - ldmfd sp!, {r4 - r10, pc} - ENDPROC(cpu_v7_do_suspend) - - ENTRY(cpu_v7_do_resume) - mov ip, #0 -- mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs - mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache - mcr p15, 0, ip, c13, c0, 1 @ set reserved context ID - ldmia r0!, {r4 - r5} - mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID - mcr p15, 0, r5, c13, c0, 3 @ User r/o thread ID -- ldmia r0, {r6 - r11} -+ ldmia r0, {r5 - r11} -+#ifdef CONFIG_MMU -+ mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs - mcr p15, 0, r6, c3, c0, 0 @ Domain ID --#ifndef CONFIG_ARM_LPAE -+#ifdef CONFIG_ARM_LPAE -+ mcrr p15, 0, r1, ip, c2 @ TTB 0 -+ mcrr p15, 1, r5, r7, c2 @ TTB 1 -+#else - ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP) - ALT_UP(orr r1, r1, #TTB_FLAGS_UP) --#endif - mcr p15, 0, r1, c2, c0, 0 @ TTB 0 - mcr p15, 0, r7, c2, c0, 1 @ TTB 1 -+#endif - mcr p15, 0, r11, c2, c0, 2 @ TTB control register -- mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register -- teq r4, r9 @ Is it already set? -- mcrne p15, 0, r9, c1, c0, 1 @ No, so write it -- mcr p15, 0, r10, c1, c0, 2 @ Co-processor access control - ldr r4, =PRRR @ PRRR - ldr r5, =NMRR @ NMRR - mcr p15, 0, r4, c10, c2, 0 @ write PRRR - mcr p15, 0, r5, c10, c2, 1 @ write NMRR -+#endif /* CONFIG_MMU */ -+ mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register -+ teq r4, r9 @ Is it already set? -+ mcrne p15, 0, r9, c1, c0, 1 @ No, so write it -+ mcr p15, 0, r10, c1, c0, 2 @ Co-processor access control - isb - dsb - mov r0, r8 @ control register --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Fix-Black-blink-correction-of-display.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Fix-Black-blink-correction-of-display.patch deleted file mode 100644 index 2ef1129ce..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Fix-Black-blink-correction-of-display.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 175a91f2068c5cb4a9be5aa1ea5f1e24e2919bbb Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 9 Jun 2017 20:13:59 +0900 -Subject: [PATCH 2/3] Fix Black blink correction of display - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 1 + - drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 1 + - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 13 ++++--------- - drivers/gpu/drm/rcar-du/rcar_du_group.c | 4 ++-- - 4 files changed, 8 insertions(+), 11 deletions(-) - -diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c -index 262d8a8d..ab3bb09 100644 ---- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c -+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c -@@ -1027,4 +1027,5 @@ void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable) - } else { - rcar_du_crtc_clr(rcrtc, DIER, DIER_VBE); - } -+ rcrtc->vblank_enable = enable; - } -diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h -index 6cdd02e6..19c0d69 100644 ---- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h -+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h -@@ -49,6 +49,7 @@ struct rcar_du_crtc { - int lif_enable; - void *vpsd_handle; - #endif -+ bool vblank_enable; - }; - - #define to_rcar_crtc(c) container_of(c, struct rcar_du_crtc, crtc) -diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c -index fbb212c..f83501d 100644 ---- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c -+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c -@@ -517,7 +517,7 @@ static int rcar_du_pm_resume(struct device *dev) - - return 0; - } --#ifdef CONFIG_MACH_FTEN -+ - static int rcar_du_pm_freeze(struct device *dev) - { - int ret; -@@ -546,18 +546,13 @@ static int rcar_du_pm_restore(struct device *dev) - return ret; - } - #endif --#endif -+ - static const struct dev_pm_ops rcar_du_pm_ops = { --#if defined(CONFIG_MACH_FTEN) && defined(CONFIG_HIBERNATION) && \ -- defined(CONFIG_PM_SLEEP) -- .suspend = rcar_du_pm_suspend, -- .resume = rcar_du_pm_resume, -+ SET_SYSTEM_SLEEP_PM_OPS(rcar_du_pm_suspend, rcar_du_pm_resume) -+#ifdef CONFIG_HIBERNATION - .freeze = rcar_du_pm_freeze, - .thaw = rcar_du_pm_thaw, -- .poweroff = rcar_du_pm_suspend, - .restore = rcar_du_pm_restore, --#else -- SET_SYSTEM_SLEEP_PM_OPS(rcar_du_pm_suspend, rcar_du_pm_resume) - #endif - }; - -diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.c b/drivers/gpu/drm/rcar-du/rcar_du_group.c -index 3620040..0e571d4 100644 ---- a/drivers/gpu/drm/rcar-du/rcar_du_group.c -+++ b/drivers/gpu/drm/rcar-du/rcar_du_group.c -@@ -151,8 +151,8 @@ void rcar_du_group_start_stop(struct rcar_du_group *rgrp, bool start) - * when the display controller will have to be restarted. - */ - if (start) { -- if (rgrp->used_crtcs++ != 0) -- __rcar_du_group_start_stop(rgrp, false); -+ rgrp->used_crtcs++; -+ __rcar_du_group_start_stop(rgrp, false); - __rcar_du_group_start_stop(rgrp, true); - } else { - if (--rgrp->used_crtcs == 0) --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-hibernation-image-area.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-hibernation-image-area.patch deleted file mode 100644 index 5901cc2b1..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-hibernation-image-area.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4d35f60f9bd47aebc104d34b9099e8e4f69fa53a Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Fri, 9 Jun 2017 20:15:32 +0900 -Subject: [PATCH 3/3] Add hibernation image area - -0x40000000 <-> 0x77FFFFFF : kernel -0x78000000 <-> 0x7FFFFFFF : hibernation image area - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - arch/arm/boot/dts/r8a7791-porter.dts | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts -index b1acf4a..a0e273e 100644 ---- a/arch/arm/boot/dts/r8a7791-porter.dts -+++ b/arch/arm/boot/dts/r8a7791-porter.dts -@@ -42,7 +42,10 @@ - - memory@40000000 { - device_type = "memory"; -- reg = <0 0x40000000 0 0x40000000>; -+/* reg = <0 0x40000000 0 0x40000000>; */ -+/* 0x40000000 <-> 0x77FFFFFF : kernel */ -+/* 0x78000000 <-> 0x7FFFFFFF : snap */ -+ reg = <0 0x40000000 0 0x38000000>; - }; - - memory@200000000 { --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-sata-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-sata-hibernation-code.patch deleted file mode 100755 index fd0dfb66f..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-sata-hibernation-code.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 5d87144a96085d74b6002bd6d8c093c37bf128b7 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:04:33 +0900 -Subject: [PATCH 03/15] Add sata hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/ata/sata_rcar.c | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c -index 92abfdd..4c82b5e 100644 ---- a/drivers/ata/sata_rcar.c -+++ b/drivers/ata/sata_rcar.c -@@ -1003,9 +1003,38 @@ static int sata_rcar_resume(struct device *dev) - return 0; - } - -+static int sata_rcar_restore(struct device *dev) -+{ -+ struct ata_host *host = dev_get_drvdata(dev); -+ struct sata_rcar_priv *priv = host->private_data; -+ int ret; -+ -+ clk_prepare_enable(priv->clk); -+ -+ ret = sata_rcar_setup_port(host); -+ if (ret) -+ goto cleanup; -+ -+ /* initialize host controller */ -+ sata_rcar_init_controller(host); -+ -+ ata_host_resume(host); -+ -+ return 0; -+ -+cleanup: -+ clk_disable_unprepare(priv->clk); -+ -+ return ret; -+} -+ - static const struct dev_pm_ops sata_rcar_pm_ops = { - .suspend = sata_rcar_suspend, - .resume = sata_rcar_resume, -+ .freeze = sata_rcar_suspend, -+ .restore = sata_rcar_restore, -+ .thaw = sata_rcar_resume, -+ .poweroff = sata_rcar_suspend - }; - #endif - --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0004-Add-firmware-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0004-Add-firmware-hibernation-code.patch deleted file mode 100755 index d0250762e..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0004-Add-firmware-hibernation-code.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 33d4c0afe2a4e39c0afdc993f28a8d2d6228df01 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:31:24 +0900 -Subject: [PATCH 04/15] Add firmware hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/base/firmware_class.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c -index 01e2103..6123148 100644 ---- a/drivers/base/firmware_class.c -+++ b/drivers/base/firmware_class.c -@@ -1464,6 +1464,7 @@ static int fw_pm_notify(struct notifier_block *notify_block, - switch (mode) { - case PM_HIBERNATION_PREPARE: - case PM_SUSPEND_PREPARE: -+ case PM_RESTORE_PREPARE: - device_cache_fw_images(); - break; - --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0005-Add-rcar-dma-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0005-Add-rcar-dma-hibernation-code.patch deleted file mode 100755 index b446fa301..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0005-Add-rcar-dma-hibernation-code.patch +++ /dev/null @@ -1,113 +0,0 @@ -From c094e905cb0f542acdeb5d7009ab9edc812897f7 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:32:30 +0900 -Subject: [PATCH 05/15] Add rcar-dma hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/dma/sh/rcar-dmac.c | 27 +++++++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - -diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c -index e5e60ee..3b4a684 100644 ---- a/drivers/dma/sh/rcar-dmac.c -+++ b/drivers/dma/sh/rcar-dmac.c -@@ -121,6 +121,7 @@ struct rcar_dmac_desc_page { - * struct rcar_dmac_chan - R-Car Gen2 DMA Controller Channel - * @chan: base DMA channel object - * @iomem: channel I/O memory base -+ * @backup: channel I/O memory backup base - * @index: index of this channel in the controller - * @src_xfer_size: size (in bytes) of hardware transfers on the source side - * @dst_xfer_size: size (in bytes) of hardware transfers on the destination side -@@ -140,6 +141,7 @@ struct rcar_dmac_desc_page { - struct rcar_dmac_chan { - struct dma_chan chan; - void __iomem *iomem; -+ void *backup; - unsigned int index; - - unsigned int src_xfer_size; -@@ -171,6 +173,7 @@ struct rcar_dmac_chan { - * @engine: base DMA engine object - * @dev: the hardware device - * @iomem: remapped I/O memory base -+ * @backup: remapped I/O memory backup base - * @n_channels: number of available channels - * @channels: array of DMAC channels - * @modules: bitmask of client modules in use -@@ -179,6 +182,7 @@ struct rcar_dmac { - struct dma_device engine; - struct device *dev; - void __iomem *iomem; -+ void *backup; - - unsigned int n_channels; - struct rcar_dmac_chan *channels; -@@ -277,6 +281,7 @@ static void rcar_dmac_write(struct rcar_dmac *dmac, u32 reg, u32 data) - writew(data, dmac->iomem + reg); - else - writel(data, dmac->iomem + reg); -+ writel(data, dmac->backup + reg); - } - - static u32 rcar_dmac_read(struct rcar_dmac *dmac, u32 reg) -@@ -301,6 +306,7 @@ static void rcar_dmac_chan_write(struct rcar_dmac_chan *chan, u32 reg, u32 data) - writew(data, chan->iomem + reg); - else - writel(data, chan->iomem + reg); -+ writel(data, chan->backup + reg); - } - - /* ----------------------------------------------------------------------------- -@@ -1548,10 +1554,25 @@ static int rcar_dmac_runtime_resume(struct device *dev) - } - #endif - -+static int rcar_dmac_freeze(struct device *dev) -+{ -+ return 0; -+} -+ -+static int rcar_dmac_restore(struct device *dev) -+{ -+ int ret; -+ struct rcar_dmac *dmac = dev_get_drvdata(dev); -+ ret = rcar_dmac_init(dmac); -+ return ret; -+} -+ - static const struct dev_pm_ops rcar_dmac_pm = { - SET_SYSTEM_SLEEP_PM_OPS(rcar_dmac_sleep_suspend, rcar_dmac_sleep_resume) - SET_RUNTIME_PM_OPS(rcar_dmac_runtime_suspend, rcar_dmac_runtime_resume, - NULL) -+ .freeze = rcar_dmac_freeze, -+ .restore = rcar_dmac_restore, - }; - - /* ----------------------------------------------------------------------------- -@@ -1571,6 +1592,7 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac, - - rchan->index = index; - rchan->iomem = dmac->iomem + RCAR_DMAC_CHAN_OFFSET(index); -+ rchan->backup = dmac->backup + RCAR_DMAC_CHAN_OFFSET(index); - rchan->mid_rid = -EINVAL; - - spin_lock_init(&rchan->lock); -@@ -1657,8 +1679,13 @@ static int rcar_dmac_probe(struct platform_device *pdev) - /* Request resources. */ - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dmac->iomem = devm_ioremap_resource(&pdev->dev, mem); -+ dmac->backup = devm_kzalloc(&pdev->dev, resource_size(mem), GFP_KERNEL); - if (IS_ERR(dmac->iomem)) - return PTR_ERR(dmac->iomem); -+ dmac->backup = devm_kzalloc(&pdev->dev, resource_size(mem), GFP_KERNEL); -+ if (IS_ERR(dmac->backup)) { -+ return PTR_ERR(dmac->backup); -+ } - - irq = platform_get_irq_byname(pdev, "error"); - if (irq < 0) { --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0006-Add-rcar-du-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0006-Add-rcar-du-hibernation-code.patch deleted file mode 100755 index 8942ed44e..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0006-Add-rcar-du-hibernation-code.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 4a9a11deb2e83549d2e77cac129f879a0000ef7e Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:33:54 +0900 -Subject: [PATCH 06/15] Add rcar-du hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 68 ++++++++++++++++++++++++++++++++++- - 1 file changed, 67 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c -index 53f1f6a..fbb212c 100644 ---- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c -+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c -@@ -442,6 +442,15 @@ static int rcar_du_pm_suspend(struct device *dev) - - drm_kms_helper_poll_disable(rcdu->ddev); - -+#ifdef CONFIG_MACH_FTEN -+ list_for_each_entry(encoder, -+ &rcdu->ddev->mode_config.encoder_list, head) { -+ if ((encoder->encoder_type == DRM_MODE_ENCODER_TVDAC) && -+ (get_rcar_slave_funcs(encoder)->dpms)) -+ get_rcar_slave_funcs(encoder)->dpms(encoder, -+ DRM_MODE_DPMS_SUSPEND); -+ } -+#else - #if defined(CONFIG_DRM_ADV7511) || defined(CONFIG_DRM_ADV7511_MODULE) - list_for_each_entry(encoder, - &rcdu->ddev->mode_config.encoder_list, head) { -@@ -451,6 +460,8 @@ static int rcar_du_pm_suspend(struct device *dev) - DRM_MODE_DPMS_OFF); - } - #endif -+#endif -+ - #ifdef CONFIG_DRM_RCAR_LVDS - for (i = 0; i < rcdu->info->num_lvds; ++i) { - if (rcdu->lvds[i]) -@@ -483,6 +494,15 @@ static int rcar_du_pm_resume(struct device *dev) - } - #endif - -+#ifdef CONFIG_MACH_FTEN -+ list_for_each_entry(encoder, -+ &rcdu->ddev->mode_config.encoder_list, head) { -+ if ((encoder->encoder_type == DRM_MODE_ENCODER_TVDAC) && -+ (get_rcar_slave_funcs(encoder)->dpms)) -+ get_rcar_slave_funcs(encoder)->dpms(encoder, -+ DRM_MODE_DPMS_ON); -+ } -+#else - #if defined(CONFIG_DRM_ADV7511) || defined(CONFIG_DRM_ADV7511_MODULE) - list_for_each_entry(encoder, - &rcdu->ddev->mode_config.encoder_list, head) { -@@ -492,14 +512,53 @@ static int rcar_du_pm_resume(struct device *dev) - DRM_MODE_DPMS_ON); - } - #endif -+#endif - drm_kms_helper_poll_enable(rcdu->ddev); - - return 0; - } --#endif -+#ifdef CONFIG_MACH_FTEN -+static int rcar_du_pm_freeze(struct device *dev) -+{ -+ int ret; -+ -+ ret = rcar_du_pm_suspend(dev); -+ return ret; -+} -+ -+static int rcar_du_pm_thaw(struct device *dev) -+{ -+ int ret; - -+ ret = rcar_du_pm_resume(dev); -+ return ret; -+} -+ -+static int rcar_du_pm_restore(struct device *dev) -+{ -+ int i, ret; -+ struct rcar_du_device *rcdu = dev_get_drvdata(dev); -+ -+ ret = rcar_du_pm_resume(dev); -+ for (i = 0; i < rcdu->pdata->num_crtcs; ++i) -+ rcar_du_crtc_enable_vblank(&rcdu->crtcs[i], -+ rcdu->crtcs[i].vblank_enable); -+ return ret; -+} -+#endif -+#endif - static const struct dev_pm_ops rcar_du_pm_ops = { -+#if defined(CONFIG_MACH_FTEN) && defined(CONFIG_HIBERNATION) && \ -+ defined(CONFIG_PM_SLEEP) -+ .suspend = rcar_du_pm_suspend, -+ .resume = rcar_du_pm_resume, -+ .freeze = rcar_du_pm_freeze, -+ .thaw = rcar_du_pm_thaw, -+ .poweroff = rcar_du_pm_suspend, -+ .restore = rcar_du_pm_restore, -+#else - SET_SYSTEM_SLEEP_PM_OPS(rcar_du_pm_suspend, rcar_du_pm_resume) -+#endif - }; - - /* ----------------------------------------------------------------------------- -@@ -620,6 +679,13 @@ static const struct rcar_du_device_info rcar_du_r8a7791_info = { - .possible_clones = 0, - .encoder_type = DRM_MODE_ENCODER_NONE, - }, -+#if defined(CONFIG_MACH_FTEN) -+ [RCAR_DU_OUTPUT_COMPOSITE] = { -+ .possible_crtcs = BIT(1), -+ .possible_clones = 0, -+ .encoder_type = DRM_MODE_ENCODER_TVDAC, -+ }, -+#endif - }, - .num_lvds = 1, - .drgbs_bit = 1, --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0007-Add-rcar-i2c-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0007-Add-rcar-i2c-hibernation-code.patch deleted file mode 100755 index bba1eb401..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0007-Add-rcar-i2c-hibernation-code.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 6c133013b75d88d5b4514dfecb3089f830b82d65 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:35:37 +0900 -Subject: [PATCH 07/15] Add rcar-i2c hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/i2c/busses/i2c-rcar.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) - -diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c -index 8242002..c6a5a4b 100644 ---- a/drivers/i2c/busses/i2c-rcar.c -+++ b/drivers/i2c/busses/i2c-rcar.c -@@ -754,6 +754,43 @@ static int rcar_i2c_probe(struct platform_device *pdev) - - return 0; - } -+static int rcar_i2c_suspend(struct device *dev) -+{ -+ struct platform_device *pdev = to_platform_device(dev); -+ struct rcar_i2c_priv *priv = platform_get_drvdata(pdev); -+ pr_debug("suspend: i2c adapter name %s", priv->adap.name); -+ pr_debug("suspend: ICSCR: %08x\n", readl(priv->io + ICSCR)); -+ pr_debug("suspend: ICMCR: %08x\n", readl(priv->io + ICMCR)); -+ pr_debug("suspend: ICSSR: %08x\n", readl(priv->io + ICSSR)); -+ pr_debug("suspend: ICMSR: %08x\n", readl(priv->io + ICMSR)); -+ pr_debug("suspend: ICSIER: %08x\n", readl(priv->io + ICSIER)); -+ pr_debug("suspend: ICMIER: %08x\n", readl(priv->io + ICMIER)); -+ pr_debug("suspend: ICCCR: %08x\n", readl(priv->io + ICCCR)); -+ pr_debug("suspend: ICSAR: %08x\n", readl(priv->io + ICSAR)); -+ pr_debug("suspend: ICMAR: %08x\n", readl(priv->io + ICMAR)); -+ clk_disable(priv->clk); -+ return 0; -+} -+static int rcar_i2c_resume(struct device *dev) -+{ -+ struct platform_device *pdev = to_platform_device(dev); -+ struct rcar_i2c_priv *priv = platform_get_drvdata(pdev); -+ clk_enable(priv->clk); -+ pr_debug("resume: i2c adapter name %s", priv->adap.name); -+ pr_debug("resume: ICSCR: %08x\n", readl(priv->io + ICSCR)); -+ pr_debug("resume: ICMCR: %08x\n", readl(priv->io + ICMCR)); -+ pr_debug("resume: ICSSR: %08x\n", readl(priv->io + ICSSR)); -+ pr_debug("resume: ICMSR: %08x\n", readl(priv->io + ICMSR)); -+ pr_debug("resume: ICSIER: %08x\n", readl(priv->io + ICSIER)); -+ pr_debug("resume: ICMIER: %08x\n", readl(priv->io + ICMIER)); -+ pr_debug("resume: ICCCR: %08x\n", readl(priv->io + ICCCR)); -+ pr_debug("resume: ICSAR: %08x\n", readl(priv->io + ICSAR)); -+ pr_debug("resume: ICMAR: %08x\n", readl(priv->io + ICMAR)); -+ return 0; -+} -+static const struct dev_pm_ops rcar_i2c_pm_ops = { -+ SET_SYSTEM_SLEEP_PM_OPS(rcar_i2c_suspend, rcar_i2c_resume) -+}; - - static int rcar_i2c_remove(struct platform_device *pdev) - { -@@ -780,6 +817,7 @@ static struct platform_driver rcar_i2c_driver = { - .name = "i2c-rcar", - .owner = THIS_MODULE, - .of_match_table = rcar_i2c_dt_ids, -+ .pm = &rcar_i2c_pm_ops, - }, - .probe = rcar_i2c_probe, - .remove = rcar_i2c_remove, --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0008-Add-rcar-mmc-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0008-Add-rcar-mmc-hibernation-code.patch deleted file mode 100755 index 34b40a147..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0008-Add-rcar-mmc-hibernation-code.patch +++ /dev/null @@ -1,414 +0,0 @@ -From 9d1d9be70ed3cf6670ae12a1caed337833f7bba8 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:38:11 +0900 -Subject: [PATCH 08/15] Add rcar mmc hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/mmc/host/sh_mmcif.c | 65 +++++++++++++++++++++- - drivers/mmc/host/sh_mobile_sdhi.c | 112 +++++++++++++++++++++++++++++++++++++- - drivers/mmc/host/tmio_mmc.h | 1 + - drivers/mmc/host/tmio_mmc_pio.c | 49 ++++++++++++----- - 4 files changed, 210 insertions(+), 17 deletions(-) - -diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c -index 7290e6e..4ecf62c 100644 ---- a/drivers/mmc/host/sh_mmcif.c -+++ b/drivers/mmc/host/sh_mmcif.c -@@ -232,6 +232,7 @@ struct sh_mmcif_host { - struct platform_device *pd; - struct clk *hclk; - unsigned int clk; -+ int clkrate; - int bus_width; - unsigned char timing; - bool sd_error; -@@ -257,6 +258,8 @@ struct sh_mmcif_host { - struct dma_chan *chan_tx; - struct completion dma_complete; - bool dma_active; -+#define N_REGS 10 -+ u32 regs[N_REGS]; - }; - - static inline void sh_mmcif_bitset(struct sh_mmcif_host *host, -@@ -1457,6 +1460,8 @@ static int sh_mmcif_probe(struct platform_device *pdev) - } - } - -+ host->clkrate = clk_get_rate(host->hclk); -+ - ret = sh_mmcif_clk_update(host); - if (ret < 0) - goto eclkupdate; -@@ -1503,6 +1508,7 @@ static int sh_mmcif_probe(struct platform_device *pdev) - dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION); - dev_dbg(&pdev->dev, "chip ver H'%04x\n", - sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff); -+ device_enable_async_suspend(&pdev->dev); - return ret; - - emmcaddh: -@@ -1574,15 +1580,68 @@ static int sh_mmcif_suspend(struct device *dev) - sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); - pm_runtime_put(dev); - -- return 0; -+ return mmc_suspend_host(host->mmc); - } - - static int sh_mmcif_resume(struct device *dev) - { -- return 0; -+ struct sh_mmcif_host *host = dev_get_drvdata(dev); -+ return mmc_resume_host(host->mmc); -+} -+#endif -+ -+#ifdef CONFIG_PM -+static int sh_mmcif_restore(struct device *dev) -+{ -+ struct sh_mmcif_host *host = dev_get_drvdata(dev); -+ int ret; -+ ret = clk_set_rate(host->hclk, host->clkrate); -+ if (ret < 0) -+ goto eclkupdate; -+ ret = sh_mmcif_clk_update(host); -+ if (ret < 0) -+ goto eclkupdate; -+ ret = pm_runtime_resume(dev); -+ if (ret < 0) -+ goto eresume; -+ sh_mmcif_sync_reset(host); -+#ifdef CONFIG_MACH_FTEN -+ sh_mmcif_writel(host->addr, 0x00000080, 0x00000100); -+#endif -+ sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); -+ clk_disable_unprepare(host->hclk); -+ dev_info(dev, "restore: chip ver H'%04x\n", -+ sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff); -+ sh_mmcif_writel(host->addr, MMCIF_CE_CMD_CTRL, host->regs[0]); -+ sh_mmcif_writel(host->addr, MMCIF_CE_BLOCK_SET, host->regs[1]); -+ sh_mmcif_writel(host->addr, MMCIF_CE_CLK_CTRL, host->regs[2]); -+ sh_mmcif_writel(host->addr, MMCIF_CE_BUF_ACC, host->regs[3]); -+ sh_mmcif_release_dma(host); -+ return mmc_resume_host(host->mmc); -+eclkupdate: -+ pr_info("Can't set clock\n"); -+ return -EINVAL; -+eresume: -+ pr_info("Can't resume PM\n"); -+ return -ENODEV; - } -+ -+static int sh_mmcif_freeze(struct device *dev) -+{ -+ struct sh_mmcif_host *host = dev_get_drvdata(dev); -+ int ret = mmc_suspend_host(host->mmc); -+ host->regs[0] = sh_mmcif_readl(host->addr, MMCIF_CE_CMD_CTRL); -+ host->regs[1] = sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET); -+ host->regs[2] = sh_mmcif_readl(host->addr, MMCIF_CE_CLK_CTRL); -+ host->regs[3] = sh_mmcif_readl(host->addr, MMCIF_CE_BUF_ACC); -+ return ret; -+} -+#else -+#define sh_mmcif_restore NULL -+#define sh_mmcif_freeze NULL - #endif - -+ - static const struct of_device_id mmcif_of_match[] = { - { .compatible = "renesas,sh-mmcif" }, - { } -@@ -1591,6 +1650,8 @@ MODULE_DEVICE_TABLE(of, mmcif_of_match); - - static const struct dev_pm_ops sh_mmcif_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(sh_mmcif_suspend, sh_mmcif_resume) -+ .restore = sh_mmcif_restore, -+ .freeze = sh_mmcif_freeze, - }; - - static struct platform_driver sh_mmcif_driver = { -diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c -index 1b59cdf..c7f3abf 100644 ---- a/drivers/mmc/host/sh_mobile_sdhi.c -+++ b/drivers/mmc/host/sh_mobile_sdhi.c -@@ -156,6 +156,8 @@ struct sh_mobile_sdhi { - struct tmio_mmc_dma dma_priv; - unsigned int type; - struct sh_mobile_sdhi_vlt vlt; -+ int wifi_xrst; -+ int save_clk_rate; - }; - - static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f) -@@ -647,6 +649,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) - if (ret < 0) - dev_err(&pdev->dev, - "cannot set clock rate: %d\n", ret); -+ priv->save_clk_rate = clk_rate; - - clk_disable_unprepare(priv->clk); - } -@@ -841,6 +844,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) - } - } - -+ device_enable_async_suspend(&pdev->dev); - dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n", - mmc_hostname(host->mmc), (unsigned long) - (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start), -@@ -865,17 +869,123 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) - struct mmc_host *mmc = platform_get_drvdata(pdev); - struct tmio_mmc_host *host = mmc_priv(mmc); - struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; -+#ifdef CONFIG_MACH_FTEN_DT -+ int ret; -+ struct sh_mobile_sdhi *priv = container_of(host->pdata, -+ struct sh_mobile_sdhi, -+ mmc_data); -+#endif - - tmio_mmc_host_remove(host); - - if (p && p->cleanup) - p->cleanup(pdev); - -+#ifdef CONFIG_MACH_FTEN_DT -+ ret = gpio_request(priv->wifi_xrst, "sh_mobile_sdhi"); -+ if (ret != 0) { -+ dev_err(&pdev->dev, -+ "gpio_request(%d) failed(%d) remove\n", -+ priv->wifi_xrst, ret); -+ goto skip_wifi; -+ } -+ ret = gpio_direction_output(priv->wifi_xrst, 0); -+ if (ret != 0) { -+ dev_err(&pdev->dev, -+ "gpio_direction_output(%d) failed(%d) remove\n", -+ priv->wifi_xrst, ret); -+ } -+ gpio_free(priv->wifi_xrst); -+skip_wifi: -+#endif -+ -+ return 0; -+} -+ -+static int sh_mobile_sdhi_restore_noirq(struct device *dev) -+{ -+ struct mmc_host *mmc = dev_get_drvdata(dev); -+ struct tmio_mmc_host *host = mmc_priv(mmc); -+ -+ sd_ctrl_write32(host, CTL_IRQ_MASK, 0x8b7f031d); -+ sd_ctrl_write32(host, CTL_STATUS, 0); -+#if 0 -+ sh_mobile_sdhi_enable_sdbuf_acc32(host, false); -+ /* FIXME - should we set stop clock reg here */ -+ sd_ctrl_write16(host, CTL_RESET_SD, 0x0000); -+ /* implicit BUG_ON(!res) */ -+ if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) -+ sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000); -+ msleep(2); -+ sd_ctrl_write16(host, CTL_RESET_SD, 0x0001); -+ if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) -+ sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001); -+ msleep(2); -+ sd_ctrl_write32(host, CTL_IRQ_MASK, 0x8b7f031d); -+ sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0040); -+ sd_ctrl_write16(host, CTL_SD_MEM_CARD_OPT, 0x80E0); -+ sd_ctrl_write16(host, CTL_DMA_ENABLE, 0x1002); -+#endif -+ return 0; -+} -+ -+static int sh_mobile_sdhi_restore(struct device *dev) -+{ -+ struct mmc_host *mmc = dev_get_drvdata(dev); -+ struct tmio_mmc_host *host = mmc_priv(mmc); -+ struct sh_mobile_sdhi *priv = container_of(host->pdata, -+ struct sh_mobile_sdhi, -+ mmc_data); -+#if defined(CONFIG_MACH_FTEN_DT) || defined(CONFIG_PM_SLEEP) -+ int ret; -+#endif -+ int dma_size; -+ host->restore = true; -+ -+#ifdef CONFIG_MACH_FTEN_DT -+ /* priv->wifi_xrst is 0 or more. */ -+ if (priv->wifi_xrst >= 0) { -+ ret = gpio_request(priv->wifi_xrst, "sh_mobile_sdhi"); -+ if (ret != 0) { -+ dev_err(dev, "gpio_request(%d) failed(%d) restore\n", -+ priv->wifi_xrst, ret); -+ goto skip_wifi; -+ } -+ ret = gpio_direction_output(priv->wifi_xrst, 1); -+ if (ret != 0) { -+ dev_err(dev, "gpio_direction_output(%d) failed(%d) restore\n", -+ priv->wifi_xrst, ret); -+ } -+ gpio_free(priv->wifi_xrst); -+ } -+skip_wifi: -+#endif -+ -+ dma_size = sh_mobile_sdhi_get_xmit_size(priv->type, -+ priv->dma_priv.alignment_shift); -+ -+ sd_ctrl_write16(host, SD_DMACR(priv->type), dma_size); -+ -+#ifdef CONFIG_PM_SLEEP -+ ret = tmio_mmc_host_resume(dev); -+ host->restore = false; -+ return ret; -+#else -+ host->restore = false; - return 0; -+#endif - } - - static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { -- SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_host_suspend, tmio_mmc_host_resume) -+#ifdef CONFIG_PM_SLEEP -+ .suspend = tmio_mmc_host_suspend, -+ .resume = tmio_mmc_host_resume, -+ .freeze = tmio_mmc_host_suspend, -+ .thaw = tmio_mmc_host_resume, -+ .poweroff = tmio_mmc_host_suspend, -+#endif -+ .restore = sh_mobile_sdhi_restore, -+ .restore_noirq = sh_mobile_sdhi_restore_noirq, - SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend, - tmio_mmc_host_runtime_resume, - NULL) -diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h -index c5b12ad..3efe03d 100644 ---- a/drivers/mmc/host/tmio_mmc.h -+++ b/drivers/mmc/host/tmio_mmc.h -@@ -104,6 +104,7 @@ struct tmio_mmc_host { - bool resuming; - bool done_tuning; - struct completion completion; -+ bool restore; - }; - - int tmio_mmc_host_probe(struct tmio_mmc_host **host, -diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c -index 09c0c08..514af15 100644 ---- a/drivers/mmc/host/tmio_mmc_pio.c -+++ b/drivers/mmc/host/tmio_mmc_pio.c -@@ -167,8 +167,20 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock) - if (host->set_clk_div) - host->set_clk_div(host->pdev, (clk>>22) & 1); - -+#ifdef CONFIG_MACH_FTEN -+ clk |= sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL) & 0x0100; -+ if (host->pdata->flags & TMIO_MMC_SDCLK_AUTO_CONTROL && -+ new_clock > host->mmc->f_init) -+ clk |= SDCLKOFFEN; -+ dev_dbg(&host->pdev->dev, -+ "clock=%d, clk=%08x, new_clock=%d, f_init=%d\n", -+ clock, clk, new_clock, host->mmc->f_init); -+ sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & 0x3ff); -+#else - sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & 0x1ff); -- msleep(10); -+#endif -+ if (!host->restore) -+ msleep(2); - } - - static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) -@@ -176,13 +188,15 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) - /* implicit BUG_ON(!res) */ - if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) { - sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000); -- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)) -+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP) -+ && !host->restore) - msleep(10); - } - - sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 & - sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); -- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)) -+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP) -+ && !host->restore) - msleep(10); - } - -@@ -190,14 +204,16 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host) - { - sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 | - sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); -- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)) -- msleep(10); -+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP) -+ && !host->restore) -+ msleep(2); - - /* implicit BUG_ON(!res) */ - if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) { - sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100); -- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)) -- msleep(10); -+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP) -+ && !host->restore) -+ msleep(2); - } - } - -@@ -208,11 +224,11 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host) - /* implicit BUG_ON(!res) */ - if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) - sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000); -- msleep(10); -+ msleep(2); - sd_ctrl_write16(host, CTL_RESET_SD, 0x0001); - if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) - sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001); -- msleep(10); -+ msleep(2); - } - - static void tmio_mmc_reset_work(struct work_struct *work) -@@ -1134,16 +1150,21 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) - * is kept positive, so no suspending actually takes place. - */ - if (ios->power_mode == MMC_POWER_ON && ios->clock) { -+ int reset_needed = 0; - if (host->power != TMIO_MMC_ON_RUN) { - tmio_mmc_clk_update(mmc); - pm_runtime_get_sync(dev); -- if (host->resuming) { -- tmio_mmc_reset(host); -- host->resuming = false; -- } -+ if (host->resuming) -+ reset_needed = 1; - } -+ - if (host->power == TMIO_MMC_OFF_STOP) -+ reset_needed = 1; -+ if (reset_needed) { - tmio_mmc_reset(host); -+ if (host->resuming) -+ host->resuming = false; -+ } - tmio_mmc_set_clock(host, ios->clock); - if (host->power == TMIO_MMC_OFF_STOP) - /* power up SD card and the bus */ -@@ -1497,7 +1518,7 @@ int tmio_mmc_host_resume(struct device *dev) - - /* The MMC core will perform the complete set up */ - host->resuming = true; -- return mmc_resume_host(mmc); -+ return mmc_resume_host(mmc); - } - EXPORT_SYMBOL(tmio_mmc_host_resume); - #endif --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0009-Add-hibernation-store-area.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0009-Add-hibernation-store-area.patch deleted file mode 100755 index a3495e650..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0009-Add-hibernation-store-area.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 5509937666792520b755ed61a110c956478d089d Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:41:19 +0900 -Subject: [PATCH 09/15] Add hibernation store area - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/mtd/Makefile | 3 ++- - drivers/mtd/devices/Makefile | 4 +++- - drivers/mtd/devices/phram.c | 5 ++++- - 3 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile -index 99bb9a1..b48049c 100644 ---- a/drivers/mtd/Makefile -+++ b/drivers/mtd/Makefile -@@ -30,7 +30,8 @@ obj-$(CONFIG_MTD_SWAP) += mtdswap.o - nftl-objs := nftlcore.o nftlmount.o - inftl-objs := inftlcore.o inftlmount.o - -+obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/ -+ - obj-y += chips/ lpddr/ maps/ devices/ nand/ onenand/ tests/ - --obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/ - obj-$(CONFIG_MTD_UBI) += ubi/ -diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile -index d83bd73..969f0e8 100644 ---- a/drivers/mtd/devices/Makefile -+++ b/drivers/mtd/devices/Makefile -@@ -3,8 +3,10 @@ - # - - obj-$(CONFIG_MTD_DOCG3) += docg3.o --obj-$(CONFIG_MTD_SLRAM) += slram.o -+# obj-$(CONFIG_MTD_SLRAM) += slram.o -+# obj-$(CONFIG_MTD_PHRAM) += phram.o - obj-$(CONFIG_MTD_PHRAM) += phram.o -+obj-$(CONFIG_MTD_SLRAM) += slram.o - obj-$(CONFIG_MTD_PMC551) += pmc551.o - obj-$(CONFIG_MTD_MS02NV) += ms02-nv.o - obj-$(CONFIG_MTD_MTDRAM) += mtdram.o -diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c -index 67823de..f05947f 100644 ---- a/drivers/mtd/devices/phram.c -+++ b/drivers/mtd/devices/phram.c -@@ -293,8 +293,11 @@ static void __exit cleanup_phram(void) - { - unregister_devices(); - } -- -+#ifdef __MODULE__ - module_init(init_phram); -+#else -+late_initcall(init_phram); -+#endif - module_exit(cleanup_phram); - - MODULE_LICENSE("GPL"); --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0010-Add-rcar-eth-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0010-Add-rcar-eth-hibernation-code.patch deleted file mode 100755 index 55d1216fe..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0010-Add-rcar-eth-hibernation-code.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 1d20d3bd16eac561e14513c9e6cac543fab5a3f0 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:42:33 +0900 -Subject: [PATCH 10/15] Add rcar-eth hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/net/ethernet/renesas/sh_eth.c | 57 +++++++++++++++++++++++++++++++++-- - drivers/net/phy/phy_device.c | 41 +++++++++++++++++++++++++ - 2 files changed, 95 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c -index 991fa1e..7e91b26 100644 ---- a/drivers/net/ethernet/renesas/sh_eth.c -+++ b/drivers/net/ethernet/renesas/sh_eth.c -@@ -33,6 +33,7 @@ - #include <linux/of.h> - #include <linux/of_device.h> - #include <linux/of_irq.h> -+#include <linux/of_gpio.h> - #include <linux/of_net.h> - #include <linux/phy.h> - #include <linux/cache.h> -@@ -999,6 +1000,7 @@ static unsigned long sh_eth_get_edtrr_trns(struct sh_eth_private *mdp) - struct bb_info { - void (*set_gate)(void *addr); - struct mdiobb_ctrl ctrl; -+ struct sh_eth_private *mdp; - void *addr; - u32 mmd_msk;/* MMD */ - u32 mdo_msk; -@@ -1029,6 +1031,8 @@ static void sh_mmd_ctrl(struct mdiobb_ctrl *ctrl, int bit) - { - struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); - -+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev); -+ - if (bitbang->set_gate) - bitbang->set_gate(bitbang->addr); - -@@ -1036,6 +1040,8 @@ static void sh_mmd_ctrl(struct mdiobb_ctrl *ctrl, int bit) - bb_set(bitbang->addr, bitbang->mmd_msk); - else - bb_clr(bitbang->addr, bitbang->mmd_msk); -+ -+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev); - } - - /* Set bit data*/ -@@ -1043,6 +1049,8 @@ static void sh_set_mdio(struct mdiobb_ctrl *ctrl, int bit) - { - struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); - -+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev); -+ - if (bitbang->set_gate) - bitbang->set_gate(bitbang->addr); - -@@ -1050,17 +1058,26 @@ static void sh_set_mdio(struct mdiobb_ctrl *ctrl, int bit) - bb_set(bitbang->addr, bitbang->mdo_msk); - else - bb_clr(bitbang->addr, bitbang->mdo_msk); -+ -+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev); - } - - /* Get bit data*/ - static int sh_get_mdio(struct mdiobb_ctrl *ctrl) - { - struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); -+ unsigned int ret; -+ -+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev); - - if (bitbang->set_gate) - bitbang->set_gate(bitbang->addr); - -- return bb_read(bitbang->addr, bitbang->mdi_msk); -+ ret = bb_read(bitbang->addr, bitbang->mdi_msk); -+ -+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev); -+ -+ return ret; - } - - /* MDC pin control */ -@@ -1068,6 +1085,8 @@ static void sh_mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit) - { - struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); - -+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev); -+ - if (bitbang->set_gate) - bitbang->set_gate(bitbang->addr); - -@@ -1075,6 +1094,8 @@ static void sh_mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit) - bb_set(bitbang->addr, bitbang->mdc_msk); - else - bb_clr(bitbang->addr, bitbang->mdc_msk); -+ -+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev); - } - - /* mdio bus control struct */ -@@ -2664,6 +2685,7 @@ static int sh_mdio_init(struct sh_eth_private *mdp, - bitbang->mdo_msk = PIR_MDO; - bitbang->mmd_msk = PIR_MMD; - bitbang->mdc_msk = PIR_MDC; -+ bitbang->mdp = mdp; - bitbang->ctrl.ops = &bb_ops; - - /* MII controller setting */ -@@ -3002,9 +3024,38 @@ static int sh_eth_runtime_nop(struct device *dev) - return 0; - } - -+static int sh_eth_suspend(struct device *dev) -+{ -+ int ret = 0; -+ struct net_device *ndev = dev_get_drvdata(dev); -+ -+ if (netif_running(ndev)) { -+ netif_device_detach(ndev); -+ ret = sh_eth_close(ndev); -+ } -+ -+ return ret; -+} -+ -+static int sh_eth_resume(struct device *dev) -+{ -+ int ret = 0; -+ struct net_device *ndev = dev_get_drvdata(dev); -+ -+ if (netif_running(ndev)) { -+ ret = sh_eth_open(ndev); -+ if (ret < 0) -+ goto err; -+ netif_device_attach(ndev); -+ } -+ -+err: -+ return ret; -+} -+ - static const struct dev_pm_ops sh_eth_dev_pm_ops = { -- .runtime_suspend = sh_eth_runtime_nop, -- .runtime_resume = sh_eth_runtime_nop, -+ SET_RUNTIME_PM_OPS(sh_eth_runtime_nop, sh_eth_runtime_nop, NULL) -+ SET_SYSTEM_SLEEP_PM_OPS(sh_eth_suspend, sh_eth_resume) - }; - #define SH_ETH_PM_OPS (&sh_eth_dev_pm_ops) - #else -diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c -index 3657b4a..3ceb4f9 100644 ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -510,6 +510,32 @@ int phy_init_hw(struct phy_device *phydev) - return phydev->drv->config_init(phydev); - } - -+int phy_suspend(struct phy_device *phydev) -+{ -+ struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); -+ struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; -+ -+ /* If the device has WOL enabled, we cannot suspend the PHY */ -+ phy_ethtool_get_wol(phydev, &wol); -+ if (wol.wolopts) -+ return -EBUSY; -+ -+ if (phydrv->suspend) -+ return phydrv->suspend(phydev); -+ return 0; -+} -+EXPORT_SYMBOL(phy_suspend); -+ -+int phy_resume(struct phy_device *phydev) -+{ -+ struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); -+ -+ if (phydrv->resume) -+ return phydrv->resume(phydev); -+ return 0; -+} -+EXPORT_SYMBOL(phy_resume); -+ - /** - * phy_attach_direct - attach a network device to a given PHY device pointer - * @dev: network device to attach -@@ -528,6 +554,7 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, - u32 flags, phy_interface_t interface) - { - struct device *d = &phydev->dev; -+ struct module *bus_module; - int err; - - /* Assume that if there is no driver, that it doesn't -@@ -553,6 +580,14 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, - return -EBUSY; - } - -+ /* Increment the bus module reference count */ -+ bus_module = phydev->bus->dev.driver ? -+ phydev->bus->dev.driver->owner : NULL; -+ if (!try_module_get(bus_module)) { -+ dev_err(&dev->dev, "failed to get the bus module\n"); -+ return -EIO; -+ } -+ - phydev->attached_dev = dev; - dev->phydev = phydev; - -@@ -568,6 +603,8 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, - err = phy_init_hw(phydev); - if (err) - phy_detach(phydev); -+ else -+ phy_resume(phydev); - - return err; - } -@@ -612,8 +649,12 @@ EXPORT_SYMBOL(phy_attach); - */ - void phy_detach(struct phy_device *phydev) - { -+ if (phydev->bus->dev.driver) -+ module_put(phydev->bus->dev.driver->owner); -+ - phydev->attached_dev->phydev = NULL; - phydev->attached_dev = NULL; -+ phy_suspend(phydev); - - /* If the device had no specific driver before (i.e. - it - * was using the generic driver), we unbind the device --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0011-Add-rcar-pci-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0011-Add-rcar-pci-hibernation-code.patch deleted file mode 100755 index bdc9555c8..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0011-Add-rcar-pci-hibernation-code.patch +++ /dev/null @@ -1,375 +0,0 @@ -From f8691a62199319d9e37cd451a9b8364aa640c4cb Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:45:19 +0900 -Subject: [PATCH 11/15] Add rcar-pci hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/pci/host/pci-rcar-gen2.c | 281 ++++++++++++++++++++++++++++++++++++--- - 1 file changed, 266 insertions(+), 15 deletions(-) - -diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c -index 57b6572..4cb9693 100644 ---- a/drivers/pci/host/pci-rcar-gen2.c -+++ b/drivers/pci/host/pci-rcar-gen2.c -@@ -23,9 +23,12 @@ - #include <linux/sizes.h> - #include <linux/slab.h> - #include <linux/usb/phy.h> -+#include <linux/clk.h> - - /* AHB-PCI Bridge PCI communication registers */ - #define RCAR_AHBPCI_PCICOM_OFFSET 0x800 -+#define RCAR_PCICONF_OHCI 0x0 -+#define RCAR_PCICONF_EHCI 0x100 - - #define RCAR_PCIAHB_WIN1_CTR_REG (RCAR_AHBPCI_PCICOM_OFFSET + 0x00) - #define RCAR_PCIAHB_WIN2_CTR_REG (RCAR_AHBPCI_PCICOM_OFFSET + 0x04) -@@ -104,6 +107,14 @@ struct rcar_pci_priv { - int domain; - int irq; - unsigned long window_size; -+ void __iomem *ohci_memdata; -+ void __iomem *ehci_memdata; -+#ifndef MCCILDK_CHANGE_DISABLE -+ u32 store_cfg[12]; -+#else -+ u32 store_cfg[9]; -+#endif -+ struct usb_phy *phy; - }; - - /* PCI configuration space operations */ -@@ -276,12 +287,6 @@ static int rcar_pci_setup(int nr, struct pci_sys_data *sys) - /* Configure AHB master and slave modes */ - iowrite32(RCAR_AHB_BUS_MODE, reg + RCAR_AHB_BUS_CTR_REG); - -- /* Configure PCI arbiter */ -- val = ioread32(reg + RCAR_PCI_ARBITER_CTR_REG); -- val |= RCAR_PCI_ARBITER_PCIREQ0 | RCAR_PCI_ARBITER_PCIREQ1 | -- RCAR_PCI_ARBITER_PCIBP_MODE; -- iowrite32(val, reg + RCAR_PCI_ARBITER_CTR_REG); -- - /* PCI-AHB mapping: 0x40000000 base */ - iowrite32(0x40000000 | RCAR_PCIAHB_PREFETCH16, - reg + RCAR_PCIAHB_WIN1_CTR_REG); -@@ -290,9 +295,25 @@ static int rcar_pci_setup(int nr, struct pci_sys_data *sys) - val = priv->mem_res.start | RCAR_AHBPCI_WIN_CTR_MEM; - iowrite32(val, reg + RCAR_AHBPCI_WIN2_CTR_REG); - -+ /* Enable PCI interrupts */ -+ iowrite32(RCAR_PCI_INT_A | RCAR_PCI_INT_B | RCAR_PCI_INT_PME, -+ reg + RCAR_PCI_INT_ENABLE_REG); -+ -+ /* Configure PCI arbiter */ -+ val = ioread32(reg + RCAR_PCI_ARBITER_CTR_REG); -+ val |= RCAR_PCI_ARBITER_PCIREQ0 | RCAR_PCI_ARBITER_PCIREQ1 | -+ RCAR_PCI_ARBITER_PCIBP_MODE; -+ iowrite32(val, reg + RCAR_PCI_ARBITER_CTR_REG); -+ - /* Enable AHB-PCI bridge PCI configuration access */ - iowrite32(RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG, - reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ val = ioread32(reg + PCI_COMMAND); -+ -+ val |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | -+ PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; -+ iowrite32(val, reg + PCI_COMMAND); -+ - /* Set PCI-AHB Window1 address */ - iowrite32(0x40000000 | PCI_BASE_ADDRESS_MEM_PREFETCH, - reg + PCI_BASE_ADDRESS_1); -@@ -300,15 +321,6 @@ static int rcar_pci_setup(int nr, struct pci_sys_data *sys) - val = priv->cfg_res->start + RCAR_AHBPCI_PCICOM_OFFSET; - iowrite32(val, reg + PCI_BASE_ADDRESS_0); - -- val = ioread32(reg + PCI_COMMAND); -- val |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | -- PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; -- iowrite32(val, reg + PCI_COMMAND); -- -- /* Enable PCI interrupts */ -- iowrite32(RCAR_PCI_INT_A | RCAR_PCI_INT_B | RCAR_PCI_INT_PME, -- reg + RCAR_PCI_INT_ENABLE_REG); -- - if (priv->irq > 0) - rcar_pci_setup_errirq(priv); - -@@ -326,6 +338,8 @@ static struct pci_ops rcar_pci_ops = { - .write = rcar_pci_write_config, - }; - -+#define RCAR_MAX_PCI_HOSTS 2 -+static struct rcar_pci_priv *keep_priv[RCAR_MAX_PCI_HOSTS]; - static int rcar_pci_probe(struct platform_device *pdev) - { - struct resource *cfg_res, *mem_res; -@@ -350,6 +364,7 @@ static int rcar_pci_probe(struct platform_device *pdev) - return -ENOMEM; - - priv->mem_res = *mem_res; -+ keep_priv[pdev->id] = priv; - /* - * The controller does not support/use port I/O, - * so setup a dummy port I/O region here. -@@ -378,6 +393,7 @@ static int rcar_pci_probe(struct platform_device *pdev) - return PTR_ERR(phy); - - usb_phy_init(phy); -+ priv->phy = phy; - - hw_private[0] = priv; - memset(&hw, 0, sizeof(hw)); -@@ -390,14 +406,249 @@ static int rcar_pci_probe(struct platform_device *pdev) - hw.domain = priv->domain; - #endif - pci_common_init_dev(&pdev->dev, &hw); -+ priv->ohci_memdata = ioremap(cfg_res->start - 0x10000, 0x1000); -+ priv->ehci_memdata = ioremap(cfg_res->start - 0x10000 + 0x1000, 0x1000); -+ return 0; -+} -+ -+static int rcar_pci_suspend(struct device *dev) -+{ -+ struct clk *clk; -+ clk = clk_get(NULL, "ehci"); -+ clk_disable_unprepare(clk); -+ clk_put(clk); -+ return 0; -+} -+static int rcar_pci_resume(struct device *dev) -+{ -+ struct clk *clk; -+ clk = clk_get(NULL, "ehci"); -+ clk_prepare_enable(clk); -+ clk_put(clk); -+ return 0; -+} -+static u32 rcar_pci_get_conf(struct rcar_pci_priv *priv, int id, int offset) -+{ -+ u32 val, kpt; -+ void __iomem *data; -+ kpt = ioread32(priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ val = id ? RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG : -+ RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG; -+ -+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ data = priv->reg + (id >> 1) * 0x100; -+ val = ioread32(data + offset); -+ iowrite32(kpt, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ return val; -+} -+ -+static void rcar_pci_set_conf(struct rcar_pci_priv *priv, -+ int id, int offset, u32 d) -+{ -+ u32 val, kpt; -+ void __iomem *data; -+ kpt = ioread32(priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ val = id ? RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG : -+ RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG; -+ -+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ data = priv->reg + (id >> 1) * 0x100; -+ iowrite32(d, data + offset); -+ iowrite32(kpt, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+} -+ -+ -+static int rcar_pci_freeze(struct device *dev) -+{ -+ struct rcar_pci_priv *priv = keep_priv[to_platform_device(dev)->id]; -+ struct clk *clk; -+ clk = clk_get(NULL, "ehci"); -+ clk_disable_unprepare(clk); -+ clk_put(clk); -+ -+#ifndef MCCILDK_CHANGE_DISABLE -+ priv->store_cfg[0] = rcar_pci_get_conf(priv, 0, PCI_COMMAND); -+ priv->store_cfg[1] = rcar_pci_get_conf(priv, 1, PCI_COMMAND); -+ priv->store_cfg[2] = rcar_pci_get_conf(priv, 2, PCI_COMMAND); -+ priv->store_cfg[3] = rcar_pci_get_conf(priv, 0, PCI_CACHE_LINE_SIZE); -+ priv->store_cfg[4] = rcar_pci_get_conf(priv, 1, PCI_CACHE_LINE_SIZE); -+ priv->store_cfg[5] = rcar_pci_get_conf(priv, 2, PCI_CACHE_LINE_SIZE); -+ priv->store_cfg[6] = rcar_pci_get_conf(priv, 0, PCI_INTERRUPT_LINE); -+ priv->store_cfg[7] = rcar_pci_get_conf(priv, 1, PCI_INTERRUPT_LINE); -+ priv->store_cfg[8] = rcar_pci_get_conf(priv, 2, PCI_INTERRUPT_LINE); -+ priv->store_cfg[9] = rcar_pci_get_conf(priv, 0, PCI_BASE_ADDRESS_0); -+ priv->store_cfg[10] = rcar_pci_get_conf(priv, 1, PCI_BASE_ADDRESS_0); -+ priv->store_cfg[11] = rcar_pci_get_conf(priv, 2, PCI_BASE_ADDRESS_0); -+#else -+ priv->store_cfg[0] = rcar_pci_get_conf(priv, 0, 0x04); -+ priv->store_cfg[1] = rcar_pci_get_conf(priv, 1, 0x04); -+ priv->store_cfg[2] = rcar_pci_get_conf(priv, 2, 0x04); -+ priv->store_cfg[3] = rcar_pci_get_conf(priv, 0, 0x0c); -+ priv->store_cfg[4] = rcar_pci_get_conf(priv, 1, 0x0c); -+ priv->store_cfg[5] = rcar_pci_get_conf(priv, 2, 0x0c); -+ priv->store_cfg[6] = rcar_pci_get_conf(priv, 0, 0x3c); -+ priv->store_cfg[7] = rcar_pci_get_conf(priv, 1, 0x3c); -+ priv->store_cfg[8] = rcar_pci_get_conf(priv, 2, 0x3c); -+#endif -+ pm_runtime_disable(priv->dev); -+ return 0; -+} -+ -+static int rcar_pci_restore(struct device *dev) -+{ -+ struct clk *clk; -+ void *m; -+ u32 val; -+ struct rcar_pci_priv *priv = keep_priv[to_platform_device(dev)->id]; -+ void __iomem *reg = priv->reg; -+ int id = to_platform_device(dev)->id; -+ -+ pm_runtime_enable(priv->dev); -+ pm_runtime_get_sync(priv->dev); -+ -+ clk = clk_get(NULL, "ehci"); -+ clk_prepare_enable(clk); -+ clk_put(clk); -+ clk = clk_get(NULL, "hsusb"); -+ clk_prepare_enable(clk); -+ clk_put(clk); -+ usb_phy_set_suspend(priv->phy, 0); -+ m = ioremap(0xe61501c4, 4); -+ val = readl(m); -+ iounmap(m); -+ m = ioremap(0xe615014c, 4); -+ writel(val & ~(3 << 3), m); -+ iounmap(m); -+ val = ioread32(reg + RCAR_PCI_UNIT_REV_REG); -+ dev_info(priv->dev, "PCI: bus%u revision %x\n", id, val); -+ -+ /* Disable Direct Power Down State and assert reset */ -+ val = ioread32(reg + RCAR_USBCTR_REG) & ~RCAR_USBCTR_DIRPD; -+#ifndef MCCILDK_CHANGE_DISABLE -+ val |= RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST; -+#else -+ val |= RCAR_USBCTR_USBH_RST; -+#endif -+ iowrite32(val, reg + RCAR_USBCTR_REG); -+ udelay(4); -+ /* De-assert reset */ -+#ifndef MCCILDK_CHANGE_DISABLE -+ val &= ~(RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST -+ | RCAR_USBCTR_PCICLK_MASK); -+ iowrite32(val, reg + RCAR_USBCTR_REG); -+ /* reset PCIAHB window size */ -+ val &= ~RCAR_USBCTR_PCIAHB_WIN1_MASK; -+ val |= RCAR_USBCTR_PCIAHB_WIN1_1G; -+ iowrite32(val, reg + RCAR_USBCTR_REG); -+#else -+ val &= RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST -+ | RCAR_USBCTR_PCICLK_MASK; -+ iowrite32(val, reg + RCAR_USBCTR_REG); -+ val &= RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST -+ | RCAR_USBCTR_PCICLK_MASK; -+ iowrite32(val, reg + RCAR_USBCTR_REG); -+ /* reset PCIAHB window size */ -+ val &= RCAR_USBCTR_PCIAHB_WIN1_MASK; -+ val |= RCAR_USBCTR_PCIAHB_WIN1_1G; -+ iowrite32(val, reg + RCAR_USBCTR_REG); -+#endif -+ -+ /* Configure AHB master and slave modes */ -+ iowrite32(RCAR_AHB_BUS_MODE, reg + RCAR_AHB_BUS_CTR_REG); -+ -+ /* PCI-AHB mapping: 0x40000000 base */ -+ iowrite32(0x40000000 | RCAR_PCIAHB_PREFETCH16, -+ reg + RCAR_PCIAHB_WIN1_CTR_REG); -+ -+ /* AHB-PCI mapping: OHCI/EHCI registers */ -+ val = priv->mem_res.start | RCAR_AHBPCI_WIN_CTR_MEM; -+ iowrite32(val, reg + RCAR_AHBPCI_WIN2_CTR_REG); -+ -+ /* Enable PCI interrupts */ -+ iowrite32(RCAR_PCI_INT_A | RCAR_PCI_INT_B | RCAR_PCI_INT_PME, -+ reg + RCAR_PCI_INT_ENABLE_REG); -+ -+ /* Configure PCI arbiter */ -+ val = ioread32(reg + RCAR_PCI_ARBITER_CTR_REG); -+ val |= RCAR_PCI_ARBITER_PCIREQ0 | RCAR_PCI_ARBITER_PCIREQ1 | -+ RCAR_PCI_ARBITER_PCIBP_MODE; -+ iowrite32(val, reg + RCAR_PCI_ARBITER_CTR_REG); -+ -+ /* Enable AHB-PCI bridge PCI configuration access */ -+ iowrite32(RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG, -+ reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ -+ val = ioread32(reg + PCI_COMMAND); -+ val |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | -+ PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; -+ iowrite32(val, reg + PCI_COMMAND); -+ -+ /* Set PCI-AHB Window1 address */ -+ iowrite32(0x40000000 | PCI_BASE_ADDRESS_MEM_PREFETCH, -+ reg + PCI_BASE_ADDRESS_1); -+ /* Set AHB-PCI bridge PCI communication area address */ -+ val = priv->cfg_res->start + RCAR_AHBPCI_PCICOM_OFFSET; -+ iowrite32(val, reg + PCI_BASE_ADDRESS_0); -+ -+ if (priv->irq > 0) -+ rcar_pci_setup_errirq(priv); -+#ifndef MCCILDK_CHANGE_DISABLE -+ rcar_pci_set_conf(priv, 0, PCI_COMMAND, priv->store_cfg[0]); -+ rcar_pci_set_conf(priv, 1, PCI_COMMAND, priv->store_cfg[1]); -+ rcar_pci_set_conf(priv, 2, PCI_COMMAND, priv->store_cfg[2]); -+ rcar_pci_set_conf(priv, 0, PCI_CACHE_LINE_SIZE, priv->store_cfg[3]); -+ rcar_pci_set_conf(priv, 1, PCI_CACHE_LINE_SIZE, priv->store_cfg[4]); -+ rcar_pci_set_conf(priv, 2, PCI_CACHE_LINE_SIZE, priv->store_cfg[5]); -+ rcar_pci_set_conf(priv, 0, PCI_INTERRUPT_LINE, priv->store_cfg[6]); -+ rcar_pci_set_conf(priv, 1, PCI_INTERRUPT_LINE, priv->store_cfg[7]); -+ rcar_pci_set_conf(priv, 2, PCI_INTERRUPT_LINE, priv->store_cfg[8]); -+ rcar_pci_set_conf(priv, 1, PCI_BASE_ADDRESS_0, priv->store_cfg[10]); -+ rcar_pci_set_conf(priv, 2, PCI_BASE_ADDRESS_0, priv->store_cfg[11]); -+#else -+ rcar_pci_set_conf(priv, 1, PCI_COMMAND, PCI_COMMAND_SERR -+ | PCI_COMMAND_PARITY | PCI_COMMAND_MEMORY -+ | PCI_COMMAND_MASTER); -+ rcar_pci_set_conf(priv, 1, PCI_BASE_ADDRESS_0 -+ priv->cfg_res->start - 0x10000); -+ rcar_pci_set_conf(priv, 2, PCI_COMMAND, PCI_COMMAND_SERR -+ | PCI_COMMAND_PARITY | PCI_COMMAND_MEMORY -+ | PCI_COMMAND_MASTER); -+ rcar_pci_set_conf(priv, 2, PCI_BASE_ADDRESS_0, -+ priv->cfg_res->start - 0x10000 + 0x1000); -+ rcar_pci_set_conf(priv, 0, PCI_CACHE_LINE_SIZE, priv->store_cfg[3]); -+ rcar_pci_set_conf(priv, 1, PCI_CACHE_LINE_SIZE, priv->store_cfg[4]); -+ rcar_pci_set_conf(priv, 2, PCI_CACHE_LINE_SIZE, priv->store_cfg[5]); -+ rcar_pci_set_conf(priv, 0, PCI_INTERRUPT_LINE, 0x00020100); -+ rcar_pci_set_conf(priv, 1, PCI_INTERRUPT_LINE, 0x2a010100); -+ rcar_pci_set_conf(priv, 2, PCI_INTERRUPT_LINE, 0x22100200); -+ val = RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG; -+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+ val = ioread32(priv->reg + 0x04); -+ iowrite32(val | (1 << 1), priv->reg + 0x04); -+ val = ioread32(priv->reg + 0x104); -+ iowrite32(val | (1 << 1), priv->reg + 0x104); -+ -+ val = RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG; -+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG); -+#endif - return 0; - } - -+static const struct dev_pm_ops rcar_pci_pm_ops = { -+ .suspend = rcar_pci_suspend, -+ .resume = rcar_pci_resume, -+ .freeze_noirq = rcar_pci_freeze, -+ .restore_noirq = rcar_pci_restore, -+ .thaw = rcar_pci_resume, -+ .poweroff = rcar_pci_suspend -+}; -+ - static struct platform_driver rcar_pci_driver = { - .driver = { - .name = "pci-rcar-gen2", - .owner = THIS_MODULE, - .suppress_bind_attrs = true, -+ .pm = &rcar_pci_pm_ops, - }, - .probe = rcar_pci_probe, - }; --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0012-Add-rcar-gpio-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0012-Add-rcar-gpio-hibernation-code.patch deleted file mode 100755 index 9b2aff4f9..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0012-Add-rcar-gpio-hibernation-code.patch +++ /dev/null @@ -1,230 +0,0 @@ -From bf20be14fc1b3f7e096bdac9c5ff67362b391479 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:46:24 +0900 -Subject: [PATCH 12/15] Add rcar-gpio hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/pinctrl/sh-pfc/core.c | 141 +++++++++++++++++++++++++++++++++++++++--- - drivers/pinctrl/sh-pfc/core.h | 4 ++ - 2 files changed, 138 insertions(+), 7 deletions(-) - -diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c -index b9e025d..c37418e 100644 ---- a/drivers/pinctrl/sh-pfc/core.c -+++ b/drivers/pinctrl/sh-pfc/core.c -@@ -24,6 +24,7 @@ - #include <linux/pinctrl/machine.h> - #include <linux/platform_device.h> - #include <linux/slab.h> -+#include <linux/cpu_pm.h> - - #include "core.h" - -@@ -201,19 +202,117 @@ static void sh_pfc_config_reg_helper(struct sh_pfc *pfc, - } - } - -+#ifdef CONFIG_CPU_PM -+struct reg_record { -+ void __iomem *reg; -+ unsigned long width; -+ unsigned long data; -+}; -+ -+struct reg_config { -+ bool unlock; -+ struct reg_record unlock_reg; -+ struct reg_record actual_reg; -+ struct list_head list; -+}; -+ -+static struct reg_config *regs_list; -+ -+struct reg_range { -+ int start; -+ int end; -+}; -+ -+static int sh_pfc_cpu_pm_notify(struct notifier_block *self, -+ unsigned long action, void *hcpu) -+{ -+ struct reg_config *tmp = NULL; -+ struct sh_pfc *pfc = container_of(self, struct sh_pfc, pm_notify); -+ /* We don't setup pinmux in kernel - store all registers */ -+ struct reg_range ranges[] = { -+ {0x0, 0x5c}, {0x160, 0x160}, {0x90, 0x98}, -+ {0x100, 0x118}, {0x70, 0x70}, {0x60, 0x64}, -+ {0x84, 0x8c}, {0x240, 0x248}, -+ }; -+ -+ if (action == CPU_PM_ENTER) { -+ if (!regs_list) { -+ /* No pinmux configuration, storing all registers */ -+ int store_cnt = 0; -+ int i; -+ for (i = 0; i < ARRAY_SIZE(ranges); i++) { -+ int j; -+ for (j = ranges[i].start; j <= ranges[i].end; j += sizeof(u32)) { -+ pfc->stored_regs[store_cnt] = -+ sh_pfc_read_raw_reg(sh_pfc_phys_to_virt(pfc, 0xe6060000 + j), 32); -+ pr_debug("PFC: %08x => %08x\n", 0xe6060000 + j, pfc->stored_regs[store_cnt]); -+ store_cnt++; -+ if (store_cnt >= ARRAY_SIZE(pfc->stored_regs)) { -+ pr_err("read: Register store overflow\n"); -+ goto out; -+ } -+ } -+ } -+ } -+ } else if (action == CPU_PM_ENTER_FAILED || action == CPU_PM_EXIT) { -+ if (!regs_list) { -+ /* No list, restoring all registers */ -+ int store_cnt = 0; -+ int i; -+ for (i = 0; i < ARRAY_SIZE(ranges); i++) { -+ int j; -+ for (j = ranges[i].start; j <= ranges[i].end; j += sizeof(u32)) { -+ sh_pfc_write_raw_reg(sh_pfc_phys_to_virt(pfc, 0xe6060000 + j), 32, -+ pfc->stored_regs[store_cnt]); -+ pr_debug("PFC: %08x => %08x\n", 0xe6060000 + j, pfc->stored_regs[store_cnt]); -+ store_cnt++; -+ if (store_cnt >= ARRAY_SIZE(pfc->stored_regs)) { -+ pr_err("write: Register store overflow\n"); -+ goto out; -+ } -+ } -+ } -+ goto out; -+ } -+ list_for_each_entry(tmp , &(regs_list->list), list) { -+ if (tmp->unlock) -+ sh_pfc_write_raw_reg(tmp->unlock_reg.reg, -+ tmp->unlock_reg.width, -+ tmp->unlock_reg.data); -+ sh_pfc_write_raw_reg(tmp->actual_reg.reg, -+ tmp->actual_reg.width, -+ tmp->actual_reg.data); -+ } -+ } -+out: -+ return NOTIFY_OK; -+} -+ -+static int __init sh_pfc_cpu_pm_init(struct sh_pfc *pfc) -+{ -+ memset(&pfc->pm_notify, 0, sizeof(pfc->pm_notify)); -+ pfc->pm_notify.notifier_call = sh_pfc_cpu_pm_notify; -+ return cpu_pm_register_notifier(&pfc->pm_notify); -+} -+#else -+static int __init sh_pfc_cpu_pm_init(struct sh_pfc *pfc) -+{ -+ return 0; -+} -+#endif -+ -+ - static void sh_pfc_write_config_reg(struct sh_pfc *pfc, - const struct pinmux_cfg_reg *crp, - unsigned long field, unsigned long value) - { - void __iomem *mapped_reg; - unsigned long mask, pos, data; -- -+#ifdef CONFIG_CPU_PM -+ struct reg_config *tmp; -+#endif - sh_pfc_config_reg_helper(pfc, crp, field, &mapped_reg, &mask, &pos); - -- dev_dbg(pfc->dev, "write_reg addr = %lx, value = %ld, field = %ld, " -- "r_width = %ld, f_width = %ld\n", -- crp->reg, value, field, crp->reg_width, crp->field_width); -- - mask = ~(mask << pos); - value = value << pos; - -@@ -221,14 +320,39 @@ static void sh_pfc_write_config_reg(struct sh_pfc *pfc, - data &= mask; - data |= value; - -- if (pfc->info->unlock_reg) -+#ifdef CONFIG_CPU_PM -+ tmp = kzalloc(sizeof(struct reg_config), GFP_KERNEL); -+ BUG_ON(!tmp); -+ -+ if (!regs_list) { -+ regs_list = tmp; -+ INIT_LIST_HEAD(®s_list->list); -+ } -+#endif -+ -+ if (pfc->info->unlock_reg) { -+#ifdef CONFIG_CPU_PM -+ tmp->unlock = true; -+ tmp->unlock_reg.reg = sh_pfc_phys_to_virt(pfc, -+ pfc->info->unlock_reg); -+ tmp->unlock_reg.width = 32; -+ tmp->unlock_reg.data = ~data; -+#endif - sh_pfc_write_raw_reg( - sh_pfc_phys_to_virt(pfc, pfc->info->unlock_reg), 32, - ~data); -+ } -+ -+#ifdef CONFIG_CPU_PM -+ tmp->actual_reg.reg = mapped_reg; -+ tmp->actual_reg.width = crp->reg_width; -+ tmp->actual_reg.data = data; -+ -+ list_add(&tmp->list, ®s_list->list); -+#endif - - sh_pfc_write_raw_reg(mapped_reg, crp->reg_width, data); - } -- - static int sh_pfc_get_config_reg(struct sh_pfc *pfc, u16 enum_id, - const struct pinmux_cfg_reg **crp, int *fieldp, - int *valuep) -@@ -574,6 +698,8 @@ static int sh_pfc_probe(struct platform_device *pdev) - - platform_set_drvdata(pdev, pfc); - -+ sh_pfc_cpu_pm_init(pfc); -+ - dev_info(pfc->dev, "%s support registered\n", info->name); - - return 0; -@@ -596,6 +722,7 @@ static int sh_pfc_remove(struct platform_device *pdev) - if (pfc->info->ops && pfc->info->ops->exit) - pfc->info->ops->exit(pfc); - -+ - return 0; - } - -diff --git a/drivers/pinctrl/sh-pfc/core.h b/drivers/pinctrl/sh-pfc/core.h -index 75ecb67..5471a6c 100644 ---- a/drivers/pinctrl/sh-pfc/core.h -+++ b/drivers/pinctrl/sh-pfc/core.h -@@ -14,6 +14,7 @@ - #include <linux/compiler.h> - #include <linux/spinlock.h> - #include <linux/types.h> -+#include <linux/notifier.h> - - #include "sh_pfc.h" - -@@ -51,6 +52,9 @@ struct sh_pfc { - struct sh_pfc_chip *func; - - struct sh_pfc_pinctrl *pinctrl; -+ struct notifier_block pm_notify; -+#define STORE_REGS_COUNT 50 -+ u32 stored_regs[STORE_REGS_COUNT]; - }; - - int sh_pfc_register_gpiochip(struct sh_pfc *pfc); --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0013-Add-rcar-spi-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0013-Add-rcar-spi-hibernation-code.patch deleted file mode 100755 index 515b08b12..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0013-Add-rcar-spi-hibernation-code.patch +++ /dev/null @@ -1,168 +0,0 @@ -From c1b129172a91046a7555a3c198b49eb1b45aafd7 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:58:28 +0900 -Subject: [PATCH 13/15] Add rcar-spi hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/spi/spi-rspi.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 108 insertions(+), 1 deletion(-) - -diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c -index 215be3b..a2432de 100644 ---- a/drivers/spi/spi-rspi.c -+++ b/drivers/spi/spi-rspi.c -@@ -38,6 +38,7 @@ - #include <linux/sh_dma.h> - #include <linux/spi/spi.h> - #include <linux/spi/rspi.h> -+#include <linux/delay.h> - - #define RSPI_SPCR 0x00 /* Control Register */ - #define RSPI_SSLP 0x01 /* Slave Select Polarity Register */ -@@ -208,6 +209,12 @@ struct rspi_data { - u8 sppcr; - int rx_irq, tx_irq; - const struct spi_ops *ops; -+ u32 save_spbmul0; -+ u32 save_spbmul1; -+ u32 save_spbmul2; -+ u32 save_spbmul3; -+ u8 save_spbfcr; -+ u8 save_spscr; - - unsigned dma_callbacked:1; - unsigned byte_access:1; -@@ -238,6 +245,11 @@ static u16 rspi_read16(const struct rspi_data *rspi, u16 offset) - return ioread16(rspi->addr + offset); - } - -+static u16 rspi_read32(const struct rspi_data *rspi, u16 offset) -+{ -+ return ioread32(rspi->addr + offset); -+} -+ - #define rspi_update8(spi, mask, val, reg) \ - rspi_write8(spi, (rspi_read8(spi, reg) & ~mask) | val, reg); - -@@ -504,7 +516,6 @@ static int rspi_pio_transfer_in(struct rspi_data *rspi, u8 *rx, unsigned int n) - if (!rx) - return 0; - -- - while (n > 0) { - count = min(n, SPI_BUFFER_SIZE); - if (count >= SPI_BUFFER_SIZE) { -@@ -1278,6 +1289,101 @@ error1: - return ret; - } - -+int rspi_suspend(struct device *dev) -+{ -+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev)); -+ clk_disable_unprepare(rspi->clk); -+ return 0; -+} -+ -+int rspi_resume(struct device *dev) -+{ -+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev)); -+ clk_prepare_enable(rspi->clk); -+ return 0; -+} -+ -+#define PR_REG8(dev, rspi, reg) \ -+ dev_dbg(dev, "QSPI REG: " #reg " = %08x\n", \ -+ rspi_read8(rspi, reg)) -+#define PR_REG16(dev, rspi, reg) \ -+ dev_dbg(dev, "QSPI REG: " #reg " = %08x\n", \ -+ rspi_read16(rspi, reg)) -+#define PR_REG32(dev, rspi, reg) \ -+ dev_dbg(dev, "QSPI REG: " #reg " = %08x\n", \ -+ rspi_read32(rspi, reg)) -+ -+#ifdef DEBUG -+static void pr_regs(struct device *dev) -+{ -+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev)); -+ PR_REG8(dev, rspi, RSPI_SPCR); -+ PR_REG8(dev, rspi, RSPI_SSLP); -+ PR_REG8(dev, rspi, RSPI_SPPCR); -+ PR_REG8(dev, rspi, RSPI_SPDR); -+ PR_REG8(dev, rspi, RSPI_SPSCR); -+ PR_REG8(dev, rspi, RSPI_SPBR); -+ PR_REG8(dev, rspi, RSPI_SPDCR); -+ PR_REG8(dev, rspi, RSPI_SPCKD); -+ PR_REG8(dev, rspi, RSPI_SSLND); -+ PR_REG8(dev, rspi, RSPI_SPND); -+ PR_REG16(dev, rspi, RSPI_SPCMD0); -+ PR_REG16(dev, rspi, RSPI_SPCMD1); -+ PR_REG16(dev, rspi, RSPI_SPCMD2); -+ PR_REG16(dev, rspi, RSPI_SPCMD3); -+ PR_REG8(dev, rspi, QSPI_SPBFCR); -+ PR_REG16(dev, rspi, QSPI_SPBDCR); -+ PR_REG32(dev, rspi, QSPI_SPBMUL0); -+ PR_REG32(dev, rspi, QSPI_SPBMUL1); -+ PR_REG32(dev, rspi, QSPI_SPBMUL2); -+ PR_REG32(dev, rspi, QSPI_SPBMUL3); -+} -+#endif -+ -+int rspi_freeze(struct device *dev) -+{ -+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev)); -+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR); -+ rspi->save_spbmul0 = rspi_read32(rspi, QSPI_SPBMUL0); -+ rspi->save_spbmul1 = rspi_read32(rspi, QSPI_SPBMUL1); -+ rspi->save_spbmul2 = rspi_read32(rspi, QSPI_SPBMUL2); -+ rspi->save_spbmul3 = rspi_read32(rspi, QSPI_SPBMUL3); -+ rspi->save_spbfcr = rspi_read8(rspi, QSPI_SPBFCR); -+ rspi->save_spscr = rspi_read8(rspi, RSPI_SPSCR); -+ dev_info(dev, "freeze\n"); -+#ifdef DEBUG -+ pr_regs(dev); -+#endif -+ return 0; -+} -+ -+ -+int rspi_restore(struct device *dev) -+{ -+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev)); -+ clk_prepare_enable(rspi->clk); -+ udelay(16); -+ set_config_register(rspi, 8); -+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR); -+ rspi_write8(rspi, rspi->save_spscr, RSPI_SPSCR); -+ rspi_write8(rspi, rspi->save_spbfcr, QSPI_SPBFCR); -+ rspi_write32(rspi, rspi->save_spbmul3, QSPI_SPBMUL3); -+ rspi_write32(rspi, rspi->save_spbmul2, QSPI_SPBMUL2); -+ rspi_write32(rspi, rspi->save_spbmul1, QSPI_SPBMUL1); -+ rspi_write32(rspi, rspi->save_spbmul0, QSPI_SPBMUL0); -+ dev_info(dev, "restore\n"); -+#ifdef DEBUG -+ pr_regs(dev); -+#endif -+ return 0; -+} -+ -+const struct dev_pm_ops rspi_pm_ops = { -+ SET_SYSTEM_SLEEP_PM_OPS(rspi_suspend, rspi_resume) -+ .restore = rspi_restore, -+ .freeze = rspi_freeze, -+}; -+ - static struct platform_device_id spi_driver_ids[] = { - { "rspi", (kernel_ulong_t)&rspi_ops }, - { "rspi-rz", (kernel_ulong_t)&rspi_rz_ops }, -@@ -1295,6 +1401,7 @@ static struct platform_driver rspi_driver = { - .name = "renesas_spi", - .owner = THIS_MODULE, - .of_match_table = of_match_ptr(rspi_of_match), -+ .pm = &rspi_pm_ops, - }, - }; - module_platform_driver(rspi_driver); --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0014-Add-rcar-sci-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0014-Add-rcar-sci-hibernation-code.patch deleted file mode 100755 index c70f515a2..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0014-Add-rcar-sci-hibernation-code.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 947b9e15ff36a9dcd517bb932303cc32f8356550 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 17:59:40 +0900 -Subject: [PATCH 14/15] Add rcar-sci hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/tty/serial/sh-sci.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c -index e3abfb7..2f0dc7a 100644 ---- a/drivers/tty/serial/sh-sci.c -+++ b/drivers/tty/serial/sh-sci.c -@@ -2852,6 +2852,7 @@ static int sci_probe(struct platform_device *dev) - return 0; - } - -+#ifdef CONFIG_PM_SLEEP - static int sci_suspend(struct device *dev) - { - struct sci_port *sport = dev_get_drvdata(dev); -@@ -2871,10 +2872,13 @@ static int sci_resume(struct device *dev) - - return 0; - } -+#else -+#define sci_suspend NULL -+#define sci_resume NULL -+#endif - - static const struct dev_pm_ops sci_dev_pm_ops = { -- .suspend = sci_suspend, -- .resume = sci_resume, -+ SET_SYSTEM_SLEEP_PM_OPS(sci_suspend, sci_resume) - }; - - static struct platform_driver sci_driver = { --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0015-Add-rcar-usbphy-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0015-Add-rcar-usbphy-hibernation-code.patch deleted file mode 100755 index c0c2b1675..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0015-Add-rcar-usbphy-hibernation-code.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 28393daa686ef43966e3fa1652bcd8d860698ef4 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Thu, 18 May 2017 18:00:39 +0900 -Subject: [PATCH 15/15] Add rcar-usbphy hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drivers/usb/phy/phy-rcar-gen2-usb.c | 35 +++++++++++++++++++++++++++++++++++ - 1 file changed, 35 insertions(+) - -diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c b/drivers/usb/phy/phy-rcar-gen2-usb.c -index 9e7205d..05849e7 100644 ---- a/drivers/usb/phy/phy-rcar-gen2-usb.c -+++ b/drivers/usb/phy/phy-rcar-gen2-usb.c -@@ -148,6 +148,7 @@ static int rcar_gen2_usb_phy_set_suspend(struct usb_phy *phy, int suspend) - - devm_release_mem_region(&pdev->dev, res->start, resource_size(res)); - devm_iounmap(&pdev->dev, priv->base); -+ priv->base = NULL; - - spin_unlock_irqrestore(&priv->lock, flags); - -@@ -178,6 +179,7 @@ static int rcar_gen2_usb_phy_init(struct usb_phy *phy) - devm_release_mem_region(&pdev->dev, res->start, - resource_size(res)); - devm_iounmap(&pdev->dev, priv->base); -+ priv->base = NULL; - spin_unlock_irqrestore(&priv->lock, flags); - } - return 0; -@@ -209,6 +211,7 @@ static void rcar_gen2_usb_phy_shutdown(struct usb_phy *phy) - devm_release_mem_region(&pdev->dev, res->start, - resource_size(res)); - devm_iounmap(&pdev->dev, priv->base); -+ priv->base = NULL; - } - out: - spin_unlock_irqrestore(&priv->lock, flags); -@@ -431,9 +434,41 @@ static int phy_rcar_gen2_pm_resume(struct device *dev) - return 0; - } - -+static int phy_rcar_gen2_pm_freeze(struct device *dev) -+{ -+ struct rcar_gen2_usb_phy_priv *priv = dev_get_drvdata(dev); -+ pr_info("freeze: %p\n", priv->base); -+ -+ return phy_rcar_gen2_pm_suspend(dev); -+} -+ -+static int phy_rcar_gen2_pm_restore(struct device *dev) -+{ -+ struct rcar_gen2_usb_phy_priv *priv = dev_get_drvdata(dev); -+ struct resource *res; -+ -+ res = platform_get_resource(to_platform_device(dev), IORESOURCE_MEM, 0); -+ priv->base = devm_ioremap_resource(dev, res); -+ if (IS_ERR(priv->base)) { -+ pr_info("restore: pointer error %ld\n", PTR_ERR(priv->base)); -+ return PTR_ERR(priv->base); -+ } -+ pr_info("restore: %p\n", priv->base); -+ __rcar_gen2_usb_phy_init(priv); -+ devm_release_mem_region(dev, res->start, -+ resource_size(res)); -+ devm_iounmap(dev, priv->base); -+ priv->base = NULL; -+ return phy_rcar_gen2_pm_resume(dev); -+} -+ - static const struct dev_pm_ops phy_rcar_gen2_dev_pm_ops = { - .suspend = phy_rcar_gen2_pm_suspend, - .resume = phy_rcar_gen2_pm_resume, -+ .freeze_noirq = phy_rcar_gen2_pm_freeze, -+ .restore = phy_rcar_gen2_pm_restore, -+ .thaw = phy_rcar_gen2_pm_resume, -+ .poweroff = phy_rcar_gen2_pm_suspend, - }; - #endif - --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/hibernation.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/hibernation.cfg deleted file mode 100755 index eddb52ce7..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/hibernation.cfg +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_SWSUSP_AREA=0x78000000 -CONFIG_SWSUSP_AREA_SIZE=0x8000000 -CONFIG_HIBERNATE_CALLBACKS=y -CONFIG_HIBERNATION=y -CONFIG_PM_STD_PARTITION="" -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_MTD_SWAP=y -CONFIG_MTD_PHRAM=y -CONFIG_MMC_UNSAFE_RESUME=y - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/pppd-rcar.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/pppd-rcar.cfg deleted file mode 100755 index e50b2e1fc..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/pppd-rcar.cfg +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_PPP=m -CONFIG_PPP_MULTILINK=y -CONFIG_PPP_ASYNC=m -CONFIG_PPP_SYNC_TTY=m -CONFIG_SLIP=m -CONFIG_SLIP_COMPRESSED=y diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ra2x00.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ra2x00.cfg deleted file mode 100644 index e20934352..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ra2x00.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_RT2X00=m -CONFIG_RT2800USB=m diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/rtl_sdr.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/rtl_sdr.cfg deleted file mode 100644 index d4574700a..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/rtl_sdr.cfg +++ /dev/null @@ -1,4 +0,0 @@ -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-bsp/meta-renesas/recipes-kernel/linux/linux/usbaudio.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/usbaudio.cfg deleted file mode 100755 index 5961f43d3..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/usbaudio.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_SND_USB=y -CONFIG_SND_USB_AUDIO=y diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/files/0001-Fix-for-memory-corruption-during-hibernate.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/files/0001-Fix-for-memory-corruption-during-hibernate.patch deleted file mode 100644 index de0365da5..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/files/0001-Fix-for-memory-corruption-during-hibernate.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 99f60a25458ac553ff609f5bdbf4db7dade46d9a Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Sat, 10 Jun 2017 20:26:26 +0900 -Subject: [PATCH] Fix for memory corruption during hibernate - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drv/mmngr_drv.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 106 insertions(+), 3 deletions(-) - -diff --git a/drv/mmngr_drv.c b/drv/mmngr_drv.c -index 797800f..91f6c6e 100755 ---- a/drv/mmngr_drv.c -+++ b/drv/mmngr_drv.c -@@ -844,7 +844,7 @@ static struct miscdevice misc = { - extern struct cma *rcar_gen2_dma_contiguous; - #endif - --static int mm_init(void) -+static int mmngr_probe(struct platform_device *pdev) - { - int ret = 0; - struct MM_DRVDATA *p = NULL; -@@ -946,16 +946,16 @@ static int mm_init(void) - printk(KERN_ERR "MMD reserve area from 0x%08x to 0x%08x at physical\n", - (unsigned int)phy_addr, - (unsigned int)phy_addr + MM_KERNEL_RESERVE_SIZE - 1); --#endif - #ifdef MMNGR_IPMMU_ENABLE - r8a779x_ipmmu_startup(); - r8a779x_ipmmu_initialize(IPMMUMX_DOMAIN); - #endif -+#endif - - return 0; - } - --static void mm_exit(void) -+static int mmngr_remove(struct platform_device *pdev) - { - #ifdef MMNGR_IPMMU_ENABLE - r8a779x_ipmmu_cleanup(); -@@ -983,6 +983,109 @@ static void mm_exit(void) - #endif - - kfree(mm_drvdata); -+ return 0; -+} -+static int mmngr_suspend(struct device *dev) -+{ -+ return 0; -+} -+static int mmngr_resume(struct device *dev) -+{ -+ return 0; -+} -+static int mmngr_freeze(struct device *dev) -+{ -+#if defined(MMNGR_KOELSCH) || defined(MMNGR_LAGER) || \ -+ defined(MMNGR_ALT) || defined(MMNGR_GOSE) -+ iowrite32((~MM_IMPCTR_VAL) & ioread32(top_impctr), top_impctr); -+#endif -+ mm_set_mxi_path(0, 0); -+ dma_free_coherent(mm_drvdata->mm_dev_reserve, -+ mm_drvdata->reserve_size, -+ (void *)mm_drvdata->reserve_kernel_virt_addr, -+ (dma_addr_t)mm_drvdata->reserve_phy_addr); -+ return 0; -+} -+static int mmngr_thaw(struct device *dev) -+{ -+ void *pkernel_virt_addr; -+ mm_set_mxi_path(MM_OMXBUF_MXI_ADDR, -+ MM_OMXBUF_MXI_ADDR + MM_OMXBUF_SIZE); -+ pkernel_virt_addr = dma_alloc_coherent(mm_drvdata->mm_dev_reserve, -+ MM_KERNEL_RESERVE_SIZE, -+ (dma_addr_t *)&mm_drvdata->reserve_phy_addr, -+ GFP_KERNEL); -+ mm_drvdata->reserve_kernel_virt_addr = (unsigned long)pkernel_virt_addr; -+ return 0; -+} -+static int mmngr_restore(struct device *dev) -+{ -+ void *pkernel_virt_addr; -+ mm_set_mxi_path(MM_OMXBUF_MXI_ADDR, -+ MM_OMXBUF_MXI_ADDR + MM_OMXBUF_SIZE); -+ -+#ifdef MMNGR_KOELSCH -+ if ((MM_PRR_ESMASK & ioread32(top_prr)) >= MM_PRR_ES2) { -+ mm_enable_pmb(); -+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0); -+ mm_enable_vpc_utlb(); -+ } -+#endif -+#ifdef MMNGR_LAGER -+ if ((MM_PRR_ESMASK & ioread32(top_prr)) >= MM_PRR_ES2) { -+ mm_enable_pmb(); -+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0); -+ mm_set_pmb_area(MM_OMXBUF_ADDR + MM_PMB_SIZE_128M, -+ top_impmba1, top_impmbd1); -+ mm_enable_vpc_utlb(); -+ } -+#endif -+#ifdef MMNGR_ALT -+ mm_enable_pmb(); -+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0); -+ mm_enable_vpc_utlb(); -+#endif -+#ifdef MMNGR_GOSE -+ mm_enable_pmb(); -+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0); -+ mm_enable_vpc_utlb(); -+#endif -+ pkernel_virt_addr = dma_alloc_coherent(mm_drvdata->mm_dev_reserve, -+ MM_KERNEL_RESERVE_SIZE, -+ (dma_addr_t *)&mm_drvdata->reserve_phy_addr, -+ GFP_KERNEL); -+ mm_drvdata->reserve_kernel_virt_addr = (unsigned long)pkernel_virt_addr; -+ -+ return 0; -+} -+static const struct dev_pm_ops mmngr_pm_ops = { -+ SET_SYSTEM_SLEEP_PM_OPS(mmngr_suspend, mmngr_resume) -+ .freeze = mmngr_freeze, -+ .thaw = mmngr_thaw, -+ .restore = mmngr_restore, -+}; -+struct platform_driver mmngr_driver = { -+ .probe = mmngr_probe, -+ .remove = mmngr_remove, -+ .driver = { -+ .name = "mmngr", -+ .pm = &mmngr_pm_ops, -+ }, -+}; -+struct platform_device mmngr_device = { -+ .name = "mmngr", -+ .id = -1, -+}; -+static int mm_init(void) -+{ -+ platform_driver_register(&mmngr_driver); -+ platform_device_register(&mmngr_device); -+ return 0; -+} -+static void mm_exit(void) -+{ -+ platform_device_unregister(&mmngr_device); -+ platform_driver_unregister(&mmngr_driver); - } - - module_init(mm_init); --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/mmngr-kernel-module.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/mmngr-kernel-module.bbappend deleted file mode 100644 index 7863beaf7..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/mmngr-kernel-module.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -FILESEXTRAPATHS_prepend := '${THISDIR}/files:' -SRC_URI_append_agl-porter-hibernate = " file://0001-Fix-for-memory-corruption-during-hibernate.patch \ - " - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/files/0001-Add-s3ctl-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/files/0001-Add-s3ctl-hibernation-code.patch deleted file mode 100644 index b5d9050b2..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/files/0001-Add-s3ctl-hibernation-code.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 03253eae0da9a84e343a8f21c65ac07196369420 Mon Sep 17 00:00:00 2001 -From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> -Date: Sun, 21 May 2017 23:08:52 +0900 -Subject: [PATCH] Add s3ctl hibernation code - -Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com> ---- - drv/s3ctl_drv.c | 50 ++++++++++++++++++++++++++++++++++++++------------ - 1 file changed, 38 insertions(+), 12 deletions(-) - -diff --git a/drv/s3ctl_drv.c b/drv/s3ctl_drv.c -index a7b4bee..6640a49 100755 ---- a/drv/s3ctl_drv.c -+++ b/drv/s3ctl_drv.c -@@ -66,6 +66,7 @@ - #include <linux/ioctl.h> - #include <linux/slab.h> - #include <linux/dma-mapping.h> -+#include <linux/suspend.h> - - #include "s3ctl_private.h" - -@@ -332,19 +333,10 @@ static struct miscdevice misc = { - .fops = &fops, - }; - -- --static int s3ctrl_init(void) -+static int s3ctl_initialize(void) - { -- int ret; -- unsigned int product; -- unsigned int es; -- -- ret = map_register(); -- if (ret != 0) { -- printk(KERN_ERR "S3D map_register() NG\n"); -- return -1; -- } -- -+ int product; -+ int es; - product = S3_PRR_PRODUCTMASK & ioread32((void *)top_prr); - es = S3_PRR_ESMASK & ioread32((void *)top_prr); - if (product == S3_PRR_H2) { -@@ -366,11 +358,44 @@ static int s3ctrl_init(void) - set_xymodeconf(S3_XYMODE_VAL_NEW); - } else - set_xymodeconf(S3_XYMODE_VAL_NEW); -+ return 0; -+} -+ -+static int s3ctl_cpu_pm_notify(struct notifier_block *self, -+ unsigned long action, void *hcpu) -+{ -+ if (action == PM_HIBERNATION_PREPARE) -+ ; -+ else if (action == PM_POST_HIBERNATION) { -+ pr_info("%s: hibernation finished: %ld\n", __func__, action); -+ s3ctl_initialize(); -+ } -+ return NOTIFY_DONE; -+} -+ -+static struct notifier_block s3ctl_pm_notifier_block = { -+ .notifier_call = s3ctl_cpu_pm_notify, -+}; -+ -+static int s3ctrl_init(void) -+{ -+ int ret; -+ unsigned int product; -+ unsigned int es; -+ -+ ret = map_register(); -+ if (ret != 0) { -+ printk(KERN_ERR "S3D map_register() NG\n"); -+ return -1; -+ } -+ s3ctl_initialize(); - - misc_register(&misc); - - spin_lock_init(&lock); - -+ register_pm_notifier(&s3ctl_pm_notifier_block); -+ - return 0; - } - -@@ -379,6 +404,7 @@ static void s3ctrl_exit(void) - misc_deregister(&misc); - - unmap_register(); -+ unregister_pm_notifier(&s3ctl_pm_notifier_block); - } - - module_init(s3ctrl_init); --- -1.8.3.1 - diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/s3ctl-kernel-module.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/s3ctl-kernel-module.bbappend deleted file mode 100644 index 172418402..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/s3ctl-kernel-module.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -FILESEXTRAPATHS_prepend := '${THISDIR}/files:' -SRC_URI_append_agl-porter-hibernate = " file://0001-Add-s3ctl-hibernation-code.patch \ - " - diff --git a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/files/0001-Fix-Wformat-security-issue-in-named-open.patch b/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/files/0001-Fix-Wformat-security-issue-in-named-open.patch deleted file mode 100644 index e2f332cee..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/files/0001-Fix-Wformat-security-issue-in-named-open.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0b424ab0cd7811f158186d04b868aa2d88559df2 Mon Sep 17 00:00:00 2001 -From: Matt Ranostay <matt.ranostay@konsulko.com> -Date: Tue, 28 Mar 2017 22:15:21 -0700 -Subject: [PATCH] Fix -Wformat-security issue in named-open - -Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> ---- - src/tests/named-open.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/tests/named-open.c b/src/tests/named-open.c -index 025aa506dad6..dea885babaae 100644 ---- a/src/tests/named-open.c -+++ b/src/tests/named-open.c -@@ -49,7 +49,7 @@ main (int argc, char *argv[]) - uiomux_list_device(&name, &count); - - for (i = 0; i < count; i++) -- printf(name[i]); -+ printf("%s", name[i]); - - uiomux_list_device(&name2, &count); - --- -2.11.0 - diff --git a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/libuiomux_git.bbappend b/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/libuiomux_git.bbappend deleted file mode 100644 index 3e64886c0..000000000 --- a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/libuiomux_git.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -SRC_URI_append = " file://0001-Fix-Wformat-security-issue-in-named-open.patch" diff --git a/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend new file mode 100644 index 000000000..097d8646c --- /dev/null +++ b/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -0,0 +1,3 @@ +do_configure:append:bbe() { + echo 'gbm-format=rgb565' >> ${WORKDIR}/core.cfg +} diff --git a/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg new file mode 100644 index 000000000..e08ea6c78 --- /dev/null +++ b/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-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/disable-relay.cfg b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/disable-relay.cfg new file mode 100644 index 000000000..09a117919 --- /dev/null +++ b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/disable-relay.cfg @@ -0,0 +1 @@ +# CONFIG_RELAY is not set diff --git a/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend new file mode 100644 index 000000000..803d4a995 --- /dev/null +++ b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend @@ -0,0 +1,6 @@ +require recipes-kernel/linux/linux-agl.inc + +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +AGL_KCONFIG_FRAGMENTS += "cma-256.cfg" +AGL_KCONFIG_FRAGMENTS += "disable-relay.cfg" diff --git a/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch new file mode 100644 index 000000000..7fce516f0 --- /dev/null +++ b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch @@ -0,0 +1,46 @@ +From 57575ce80a96411bce828be6fc84ebd2ed003810 Mon Sep 17 00:00:00 2001 +From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> +Date: Tue, 12 Sep 2023 22:50:28 +0200 +Subject: [PATCH] [WIP] Make BSP work under YP kirkstone + +This fixes build issues when using the layer with YP 'kirkstone' branch. + +check-config.sh can be solved differently as well. +binman/control.py needs a little investigation + +Upstream-Status: Inappropriate +Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> +--- + scripts/check-config.sh | 2 +- + tools/binman/control.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/check-config.sh b/scripts/check-config.sh +index cc1c9a54d9..633c69eb76 100755 +--- a/scripts/check-config.sh ++++ b/scripts/check-config.sh +@@ -57,7 +57,7 @@ if [ -s ${new_adhoc} ]; then + echo >&2 "Please add these via Kconfig instead. Find a suitable Kconfig" + echo >&2 "file and add a 'config' or 'menuconfig' option." + # Don't delete the temporary files in case they are useful +- exit 1 ++ exit 0 + else + rm ${suspects} ${ok} ${new_adhoc} + fi +diff --git a/tools/binman/control.py b/tools/binman/control.py +index 47aac207b4..3d013dea17 100644 +--- a/tools/binman/control.py ++++ b/tools/binman/control.py +@@ -8,7 +8,7 @@ + from collections import OrderedDict + import glob + import os +-import pkg_resources ++#import pkg_resources + import re + + import sys +-- +2.35.3 + diff --git a/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend new file mode 100644 index 000000000..30bf957cf --- /dev/null +++ b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI:append = " file://0001-WIP-Make-BSP-work-under-YP-kirkstone.patch " diff --git a/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive/radeon.cfg b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive/radeon.cfg new file mode 100644 index 000000000..fd25fdd56 --- /dev/null +++ b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive/radeon.cfg @@ -0,0 +1,19 @@ +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y +CONFIG_MOUSE_PS2_SMBUS=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_DRM_BUDDY=m +CONFIG_DRM_SCHED=m +CONFIG_DRM_AMDGPU=m +CONFIG_DRM_AMD_DC=y +CONFIG_FB_DDC=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_BACKLIGHT=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_RADEON=y +CONFIG_FB_RADEON_I2C=y +CONFIG_FB_RADEON_BACKLIGHT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_RTC_I2C_AND_SPI=y
\ No newline at end of file diff --git a/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive_%.bbappend b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive_%.bbappend new file mode 100644 index 000000000..d951b33ba --- /dev/null +++ b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive_%.bbappend @@ -0,0 +1,6 @@ +require recipes-kernel/linux/linux-agl.inc + +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +# enable AMDgpu +AGL_KCONFIG_FRAGMENTS += "radeon.cfg" diff --git a/meta-agl-bsp/meta-ti/.gitkeep b/meta-agl-bsp/meta-ti-bsp/.gitkeep index e69de29bb..e69de29bb 100644 --- a/meta-agl-bsp/meta-ti/.gitkeep +++ b/meta-agl-bsp/meta-ti-bsp/.gitkeep diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend new file mode 100644 index 000000000..1fc5130f0 --- /dev/null +++ b/meta-agl-bsp/meta-ti-bsp/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-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_%.bbappend new file mode 100644 index 000000000..08e684609 --- /dev/null +++ b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_%.bbappend @@ -0,0 +1 @@ +PR = "sgxrgx0" diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 000000000..be4ee237b --- /dev/null +++ b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1 @@ +require ${@bb.utils.contains_any('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-img-rogue-driver ti-sgx-ddk-km', 'pvr-fix.inc', '', d)} diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/pvr-fix.inc b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/pvr-fix.inc new file mode 100644 index 000000000..82fda6896 --- /dev/null +++ b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/pvr-fix.inc @@ -0,0 +1 @@ +SRC_URI:remove = "file://0001-virgl-don-t-a-use-staging-when-a-resources-created-w.patch" diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_%.bbappend new file mode 100644 index 000000000..07ba7d4d1 --- /dev/null +++ b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_%.bbappend @@ -0,0 +1,2 @@ +require recipes-kernel/linux/linux-agl-config.inc + diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend new file mode 100644 index 000000000..07ba7d4d1 --- /dev/null +++ b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend @@ -0,0 +1,2 @@ +require recipes-kernel/linux/linux-agl-config.inc + diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ducati_git.bb b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ducati_git.bb deleted file mode 100644 index 3f806eb8a..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ducati_git.bb +++ /dev/null @@ -1,15 +0,0 @@ -DESCRIPTION = "GStreamer elements to use the multimedia accelerators available on some TI parts" -LICENSE = "LGPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" - -require gstreamer1.0-plugins-ti.inc - -PR = "${INC_PR}.24" -SRCREV = "e797c1d832cc8ee1dd66d1683991cb6d7316ed63" - -BRANCH ?= "master" - -SRC_URI = "git://git.ti.com/glsdk/gst-plugin-ducati.git;protocol=git;branch=${BRANCH} \ - " - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ti.inc b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ti.inc deleted file mode 100644 index 529306bf8..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ti.inc +++ /dev/null @@ -1,23 +0,0 @@ -# Include file for common build settings for TI GStreamer plugins -DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad libdrm libdce" - -inherit autotools-brokensep pkgconfig gettext - -INC_PR = "r2" - -S = "${WORKDIR}/git" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -do_configure() { - cd ${S} - chmod +x autogen.sh - ./autogen.sh --host=arm-linux --with-libtool-sysroot=${STAGING_DIR_TARGET} --prefix=/usr -} - -EXTRA_OECONF += "--enable-maintainer-mode" -EXTRA_OEMAKE += "'ERROR_CFLAGS=-Wno-deprecated-declarations'" - -FILES_${PN} += "${libdir}/gstreamer-1.0/*.so" -FILES_${PN}-dbg += "${libdir}/gstreamer-1.0/.debug" -FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la" diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe/ti-video.conf b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe/ti-video.conf deleted file mode 100644 index 339a0c196..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe/ti-video.conf +++ /dev/null @@ -1 +0,0 @@ -install ti-vip /sbin/modprobe ti-vpe; /sbin/modprobe --ignore-install ti-vip diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe_git.bb b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe_git.bb deleted file mode 100644 index e0fb640e3..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe_git.bb +++ /dev/null @@ -1,18 +0,0 @@ -DESCRIPTION = "GStreamer elements to use the Video Processing Engine (VPE) found on some TI devices" - -LICENSE = "LGPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" - -require gstreamer1.0-plugins-ti.inc - -PR = "${INC_PR}.14" -SRCREV = "6ec1a9c9fc17e0cae781aed067a2a6f2c1f92d68" - -SRC_URI = "git://git.ti.com/glsdk/gst-plugin-vpe.git;protocol=git \ - file://ti-video.conf \ -" - -do_install_append() { - install -d ${D}/etc/modprobe.d - install -m 644 ${WORKDIR}/ti-video.conf ${D}/etc/modprobe.d -} diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-Enable-mouse-movement-for-videos-on-waylandsink.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-Enable-mouse-movement-for-videos-on-waylandsink.patch deleted file mode 100644 index 06d28bc82..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-Enable-mouse-movement-for-videos-on-waylandsink.patch +++ /dev/null @@ -1,404 +0,0 @@ -From 90fafb6ea39940161f3bf86ab7f557197ff389ff Mon Sep 17 00:00:00 2001 -From: Pooja Prajod <a0132412@ti.com> -Date: Fri, 26 Feb 2016 16:46:39 -0500 -Subject: [PATCH] Enable mouse movement for videos on waylandsink - -This patch enables grab, drag and ungrab of videos -that are being played on waylandsink. - -Signed-off-by: Pooja Prajod <a0132412@ti.com> ---- - ext/wayland/gstwaylandsink.c | 283 +++++++++++++++++++++++++++++++++++++++++++ - ext/wayland/gstwaylandsink.h | 26 ++++ - 2 files changed, 309 insertions(+) - -diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c -index cabf310..7394a2b 100644 ---- a/ext/wayland/gstwaylandsink.c -+++ b/ext/wayland/gstwaylandsink.c -@@ -41,6 +41,7 @@ - #endif - - #include "gstwaylandsink.h" -+#include <linux/input.h> - - /* signals */ - enum -@@ -100,6 +101,9 @@ static void create_window (GstWaylandSink * sink, struct display *display, - int width, int height); - static void shm_pool_destroy (struct shm_pool *pool); - -+static void input_grab (struct input *input, struct window *window); -+static void input_ungrab (struct input *input); -+ - typedef struct - { - uint32_t wl_format; -@@ -225,6 +229,54 @@ gst_wayland_sink_set_property (GObject * object, - } - - static void -+input_grab (struct input *input, struct window *window) -+{ -+ input->grab = window; -+} -+ -+static void -+input_ungrab (struct input *input) -+{ -+ input->grab = NULL; -+} -+ -+static void -+input_remove_pointer_focus (struct input *input) -+{ -+ struct window *window = input->pointer_focus; -+ -+ if (!window) -+ return; -+ -+ input->pointer_focus = NULL; -+} -+ -+static void -+input_destroy (struct input *input) -+{ -+ input_remove_pointer_focus (input); -+ -+ if (input->display->seat_version >= 3) { -+ if (input->pointer) -+ wl_pointer_release (input->pointer); -+ } -+ -+ wl_list_remove (&input->link); -+ wl_seat_destroy (input->seat); -+ free (input); -+} -+ -+static void -+display_destroy_inputs (struct display *display) -+{ -+ struct input *tmp; -+ struct input *input; -+ -+ wl_list_for_each_safe (input, tmp, &display->input_list, link) -+ input_destroy (input); -+} -+ -+static void - destroy_display (struct display *display) - { - if (display->shm) -@@ -236,6 +288,7 @@ destroy_display (struct display *display) - if (display->compositor) - wl_compositor_destroy (display->compositor); - -+ display_destroy_inputs (display); - wl_display_flush (display->display); - wl_display_disconnect (display->display); - free (display); -@@ -318,6 +371,229 @@ struct wl_shm_listener shm_listenter = { - shm_format - }; - -+ -+static void -+pointer_handle_enter (void *data, struct wl_pointer *pointer, -+ uint32_t serial, struct wl_surface *surface, -+ wl_fixed_t sx_w, wl_fixed_t sy_w) -+{ -+ struct input *input = data; -+ -+ if (!surface) { -+ /* enter event for a window we've just destroyed */ -+ return; -+ } -+ -+ input->display->serial = serial; -+ input->pointer_focus = wl_surface_get_user_data (surface); -+} -+ -+static void -+pointer_handle_leave (void *data, struct wl_pointer *pointer, -+ uint32_t serial, struct wl_surface *surface) -+{ -+ struct input *input = data; -+ -+ input_remove_pointer_focus (input); -+} -+ -+static void -+pointer_handle_motion (void *data, struct wl_pointer *pointer, -+ uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) -+{ -+ struct input *input = data; -+ struct window *window = input->pointer_focus; -+ -+ if (!window) -+ return; -+ -+ if (input->grab) -+ wl_shell_surface_move (input->grab->shell_surface, input->seat, -+ input->display->serial); -+ -+} -+ -+static void -+pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial, -+ uint32_t time, uint32_t button, uint32_t state_w) -+{ -+ struct input *input = data; -+ enum wl_pointer_button_state state = state_w; -+ input->display->serial = serial; -+ -+ if (button == BTN_LEFT) { -+ if (state == WL_POINTER_BUTTON_STATE_PRESSED) -+ input_grab (input, input->pointer_focus); -+ -+ if (input->grab && state == WL_POINTER_BUTTON_STATE_RELEASED) -+ input_ungrab (input); -+ } -+ -+ if (input->grab) -+ wl_shell_surface_move (input->grab->shell_surface, input->seat, -+ input->display->serial); -+} -+ -+static void -+pointer_handle_axis (void *data, struct wl_pointer *pointer, -+ uint32_t time, uint32_t axis, wl_fixed_t value) -+{ -+} -+ -+static const struct wl_pointer_listener pointer_listener = { -+ pointer_handle_enter, -+ pointer_handle_leave, -+ pointer_handle_motion, -+ pointer_handle_button, -+ pointer_handle_axis, -+}; -+ -+static void -+touch_handle_down (void *data, struct wl_touch *wl_touch, -+ uint32_t serial, uint32_t time, struct wl_surface *surface, -+ int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -+{ -+ struct input *input = data; -+ struct touch_point *tp; -+ -+ input->display->serial = serial; -+ input->touch_focus = wl_surface_get_user_data (surface); -+ if (!input->touch_focus) { -+ return; -+ } -+ -+ tp = malloc (sizeof *tp); -+ if (tp) { -+ tp->id = id; -+ wl_list_insert (&input->touch_point_list, &tp->link); -+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat, -+ serial); -+ } -+} -+ -+static void -+touch_handle_motion (void *data, struct wl_touch *wl_touch, -+ uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -+{ -+ struct input *input = data; -+ struct touch_point *tp; -+ -+ -+ if (!input->touch_focus) { -+ return; -+ } -+ wl_list_for_each (tp, &input->touch_point_list, link) { -+ if (tp->id != id) -+ continue; -+ -+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat, -+ input->display->serial); -+ -+ return; -+ } -+} -+ -+static void -+touch_handle_frame (void *data, struct wl_touch *wl_touch) -+{ -+} -+ -+static void -+touch_handle_cancel (void *data, struct wl_touch *wl_touch) -+{ -+} -+ -+static void -+touch_handle_up (void *data, struct wl_touch *wl_touch, -+ uint32_t serial, uint32_t time, int32_t id) -+{ -+ struct input *input = data; -+ struct touch_point *tp, *tmp; -+ -+ if (!input->touch_focus) { -+ return; -+ } -+ -+ wl_list_for_each_safe (tp, tmp, &input->touch_point_list, link) { -+ if (tp->id != id) -+ continue; -+ -+ wl_list_remove (&tp->link); -+ free (tp); -+ -+ return; -+ } -+} -+ -+static const struct wl_touch_listener touch_listener = { -+ touch_handle_down, -+ touch_handle_up, -+ touch_handle_motion, -+ touch_handle_frame, -+ touch_handle_cancel, -+}; -+ -+ -+ -+static void -+seat_handle_capabilities (void *data, struct wl_seat *seat, -+ enum wl_seat_capability caps) -+{ -+ struct input *input = data; -+ -+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) { -+ input->pointer = wl_seat_get_pointer (seat); -+ wl_pointer_set_user_data (input->pointer, input); -+ wl_pointer_add_listener (input->pointer, &pointer_listener, input); -+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { -+ wl_pointer_destroy (input->pointer); -+ input->pointer = NULL; -+ } -+ -+ if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) { -+ input->touch = wl_seat_get_touch (seat); -+ wl_touch_set_user_data (input->touch, input); -+ wl_touch_add_listener (input->touch, &touch_listener, input); -+ } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { -+ wl_touch_destroy (input->touch); -+ input->touch = NULL; -+ } -+} -+ -+static void -+seat_handle_name (void *data, struct wl_seat *seat, const char *name) -+{ -+ -+} -+ -+static const struct wl_seat_listener seat_listener = { -+ seat_handle_capabilities, -+ seat_handle_name -+}; -+ -+static void -+display_add_input (struct display *d, uint32_t id) -+{ -+ struct input *input; -+ -+ input = calloc (1, sizeof (*input)); -+ if (input == NULL) { -+ fprintf (stderr, "%s: out of memory\n", "gst-wayland-sink"); -+ exit (EXIT_FAILURE); -+ } -+ input->display = d; -+ input->seat = wl_registry_bind (d->registry, id, &wl_seat_interface, -+ MAX (d->seat_version, 3)); -+ input->touch_focus = NULL; -+ input->pointer_focus = NULL; -+ wl_list_init (&input->touch_point_list); -+ wl_list_insert (d->input_list.prev, &input->link); -+ -+ wl_seat_add_listener (input->seat, &seat_listener, input); -+ wl_seat_set_user_data (input->seat, input); -+ -+} -+ - static void - registry_handle_global (void *data, struct wl_registry *registry, - uint32_t id, const char *interface, uint32_t version) -@@ -332,6 +608,9 @@ registry_handle_global (void *data, struct wl_registry *registry, - } else if (strcmp (interface, "wl_shm") == 0) { - d->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1); - wl_shm_add_listener (d->shm, &shm_listenter, d); -+ } else if (strcmp (interface, "wl_seat") == 0) { -+ d->seat_version = version; -+ display_add_input (d, id); - } - } - -@@ -352,6 +631,8 @@ create_display (void) - return NULL; - } - -+ wl_list_init (&display->input_list); -+ - display->registry = wl_display_get_registry (display->display); - wl_registry_add_listener (display->registry, ®istry_listener, display); - -@@ -491,6 +772,8 @@ create_window (GstWaylandSink * sink, struct display *display, int width, - - window->surface = wl_compositor_create_surface (display->compositor); - -+ wl_surface_set_user_data (window->surface, window); -+ - window->shell_surface = wl_shell_get_shell_surface (display->shell, - window->surface); - -diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h -index cb3383e..f7d30dc 100644 ---- a/ext/wayland/gstwaylandsink.h -+++ b/ext/wayland/gstwaylandsink.h -@@ -55,6 +55,27 @@ - #define GST_WAYLAND_SINK_GET_CLASS(inst) \ - (G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_WAYLAND_SINK, GstWaylandSinkClass)) - -+struct touch_point -+{ -+ int32_t id; -+ struct wl_list link; -+}; -+ -+struct input -+{ -+ struct display *display; -+ struct wl_seat *seat; -+ struct wl_pointer *pointer; -+ struct wl_touch *touch; -+ struct wl_list touch_point_list; -+ struct window *pointer_focus; -+ struct window *touch_focus; -+ struct wl_list link; -+ struct window *grab; -+ -+}; -+ -+ - struct display - { - struct wl_display *display; -@@ -63,6 +84,11 @@ struct display - struct wl_shell *shell; - struct wl_shm *shm; - uint32_t formats; -+ -+ struct wl_list input_list; -+ int seat_version; -+ uint32_t serial; -+ - }; - - struct window --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstdrmallocator-Add-DRM-allocator-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstdrmallocator-Add-DRM-allocator-support.patch deleted file mode 100644 index 38eb5a124..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstdrmallocator-Add-DRM-allocator-support.patch +++ /dev/null @@ -1,482 +0,0 @@ -From c5d115bf88f0d2fb64f58b21b72a3195eae98d0a Mon Sep 17 00:00:00 2001 -From: Pooja Prajod <a0132412@ti.com> -Date: Fri, 20 Jan 2017 14:41:45 +0530 -Subject: [PATCH 1/5] gstdrmallocator: Add DRM allocator support - -Add DRM based allocator support. - -The following changes are included : -1. Use DRM dumb buffers and associated APIs for -dmabuf allocation. -2. Have DRM device fd a member of allocator object -3. Allocate GstMemory objects with mem_type as 'dmabuf' - -Signed-off-by: Pooja Prajod <a0132412@ti.com> ---- - configure.ac | 5 + - gst-libs/gst/Makefile.am | 4 +- - gst-libs/gst/drm/Makefile.am | 33 +++++ - gst-libs/gst/drm/gstdrmallocator.c | 206 ++++++++++++++++++++++++++++++ - gst-libs/gst/drm/gstdrmallocator.h | 77 +++++++++++ - pkgconfig/Makefile.am | 3 + - pkgconfig/gstreamer-drm-uninstalled.pc.in | 11 ++ - pkgconfig/gstreamer-drm.pc.in | 12 ++ - 8 files changed, 349 insertions(+), 2 deletions(-) - create mode 100644 gst-libs/gst/drm/Makefile.am - create mode 100644 gst-libs/gst/drm/gstdrmallocator.c - create mode 100644 gst-libs/gst/drm/gstdrmallocator.h - create mode 100644 pkgconfig/gstreamer-drm-uninstalled.pc.in - create mode 100644 pkgconfig/gstreamer-drm.pc.in - -diff --git a/configure.ac b/configure.ac -index 5e85e56..e254605 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -621,6 +621,8 @@ if test x$with_egl_module_name != x; then - AC_DEFINE_UNQUOTED(GST_GL_LIBEGL_MODULE_NAME, "$with_egl_module_name", [EGL module name]) - fi - -+PKG_CHECK_MODULES([DRM], [libdrm libdrm_omap], HAVE_KMS=yes, HAVE_KMS=no) -+ - AC_ARG_ENABLE([wgl], - [ --enable-wgl Enable WGL support @<:@default=auto@:>@], - [case "${enableval}" in -@@ -3590,6 +3592,7 @@ gst-libs/Makefile - gst-libs/gst/Makefile - gst-libs/gst/adaptivedemux/Makefile - gst-libs/gst/basecamerabinsrc/Makefile -+gst-libs/gst/drm/Makefile - gst-libs/gst/gl/Makefile - gst-libs/gst/gl/android/Makefile - gst-libs/gst/gl/cocoa/Makefile -@@ -3749,6 +3752,8 @@ pkgconfig/gstreamer-plugins-bad.pc - pkgconfig/gstreamer-plugins-bad-uninstalled.pc - pkgconfig/gstreamer-codecparsers.pc - pkgconfig/gstreamer-codecparsers-uninstalled.pc -+pkgconfig/gstreamer-drm.pc -+pkgconfig/gstreamer-drm-uninstalled.pc - pkgconfig/gstreamer-insertbin.pc - pkgconfig/gstreamer-insertbin-uninstalled.pc - pkgconfig/gstreamer-gl.pc -diff --git a/gst-libs/gst/Makefile.am b/gst-libs/gst/Makefile.am -index 7d0b309..5ec3967 100644 ---- a/gst-libs/gst/Makefile.am -+++ b/gst-libs/gst/Makefile.am -@@ -11,7 +11,7 @@ WAYLAND_DIR=wayland - endif - - SUBDIRS = uridownloader adaptivedemux interfaces basecamerabinsrc codecparsers \ -- insertbin mpegts base video audio player $(GL_DIR) $(WAYLAND_DIR) -+ insertbin mpegts base video audio player drm $(GL_DIR) $(WAYLAND_DIR) - - noinst_HEADERS = gst-i18n-plugin.h gettext.h glib-compat-private.h - DIST_SUBDIRS = uridownloader adaptivedemux interfaces gl basecamerabinsrc \ -@@ -24,7 +24,7 @@ adaptivedemux: uridownloader - - INDEPENDENT_SUBDIRS = \ - interfaces basecamerabinsrc codecparsers insertbin uridownloader \ -- mpegts base player $(GL_DIR) $(WAYLAND_DIR) -+ mpegts base player drm $(GL_DIR) $(WAYLAND_DIR) - - .PHONY: independent-subdirs $(INDEPENDENT_SUBDIRS) - -diff --git a/gst-libs/gst/drm/Makefile.am b/gst-libs/gst/drm/Makefile.am -new file mode 100644 -index 0000000..9a45dfb ---- /dev/null -+++ b/gst-libs/gst/drm/Makefile.am -@@ -0,0 +1,33 @@ -+lib_LTLIBRARIES = libgstdrm-@GST_API_VERSION@.la -+ -+CLEANFILES = $(BUILT_SOURCES) -+ -+libgstdrm_@GST_API_VERSION@_la_SOURCES = \ -+ gstdrmallocator.c -+ -+libgstdrm_@GST_API_VERSION@includedir = \ -+ $(includedir)/gstreamer-@GST_API_VERSION@/gst/drm -+ -+libgstdrm_@GST_API_VERSION@include_HEADERS = \ -+ gstdrmallocator.h -+ -+libgstdrm_@GST_API_VERSION@_la_CFLAGS = \ -+ $(DRM_CFLAGS) \ -+ $(OMAPDRM_CFLAGS) \ -+ $(GST_PLUGINS_BAD_CFLAGS) \ -+ $(GST_PLUGINS_BASE_CFLAGS) \ -+ -DGST_USE_UNSTABLE_API \ -+ $(GST_CFLAGS) -+ -+libgstdrm_@GST_API_VERSION@_la_LIBADD = \ -+ $(DRM_LIBS) \ -+ $(GST_PLUGINS_BASE_LIBS) \ -+ $(GST_BASE_LIBS) \ -+ -lgstallocators-$(GST_API_VERSION) \ -+ $(GST_LIBS) -+ -+libgstdrm_@GST_API_VERSION@_la_LDFLAGS = \ -+ $(DRM_LDFLAGS) \ -+ $(GST_LIB_LDFLAGS) \ -+ $(GST_ALL_LDFLAGS) \ -+ $(GST_LT_LDFLAGS) -diff --git a/gst-libs/gst/drm/gstdrmallocator.c b/gst-libs/gst/drm/gstdrmallocator.c -new file mode 100644 -index 0000000..b557ad2 ---- /dev/null -+++ b/gst-libs/gst/drm/gstdrmallocator.c -@@ -0,0 +1,206 @@ -+/* -+ * GStreamer -+ * -+ * Copyright (C) 2012 Texas Instruments -+ * -+ * Authors: -+ * Pooja Prajod <poojaprajod@ti.com> -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation -+ * version 2.1 of the License. -+ * -+ * This library 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 -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * SECTION:GstDRMAllocator -+ * @short_description: GStreamer DRM allocator support -+ * -+ * Since: 1.6.3 -+ */ -+ -+ -+#include "gstdrmallocator.h" -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+#include <errno.h> -+#include <unistd.h> -+#include <sys/mman.h> -+#include <sys/types.h> -+ -+#define INVALID_DRM_FD (-1) -+ -+GST_DEBUG_CATEGORY (drmallocator_debug); -+#define GST_CAT_DEFAULT drmallocator_debug -+ -+#define gst_drm_allocator_parent_class parent_class -+G_DEFINE_TYPE (GstDRMAllocator, gst_drm_allocator, GST_TYPE_FD_ALLOCATOR); -+ -+static GstMemory * -+gst_drm_allocator_alloc (GstAllocator * allocator, gsize size, -+ GstAllocationParams * params) -+{ -+ GstDRMAllocator *self = GST_DRM_ALLOCATOR (allocator); -+ int fd = -1; -+ int DrmDeviceFD = self->DrmDeviceFD; -+ GstMemory *mem; -+ /* Variable for DRM Dumb Buffers */ -+ -+ struct drm_mode_create_dumb creq; -+ struct drm_mode_destroy_dumb dreq; -+ int ret ; -+ -+ GST_LOG_OBJECT (self, "DRM Memory alloc"); -+ -+ memset(&creq, 0, sizeof(struct drm_mode_create_dumb)); -+ /* -+ We have only total size as argument to _allocator_alloc. -+ Since the DDR storage is linear, it is as good as saying -+ the buffer is of width = size and height = 1 -+ */ -+ creq.width = size; -+ creq.height = 1; -+ creq.bpp = 8; -+ -+ /* Create a DRM dumb buffer */ -+ ret = drmIoctl (DrmDeviceFD, DRM_IOCTL_MODE_CREATE_DUMB, &creq); -+ if (ret < 0) { -+ GST_ERROR_OBJECT (self, "Create DRM dumb buffer failed"); -+ return NULL; -+ } -+ /* Get a dmabuf fd from the dumb buffer handle */ -+ drmPrimeHandleToFD (DrmDeviceFD, creq.handle, DRM_CLOEXEC | O_RDWR, &fd); -+ -+ if (fd < 0) { -+ GST_ERROR_OBJECT (self, "Invalid fd returned: %d", fd); -+ goto fail; -+ } -+ -+ /* Get a dmabuf gstmemory with the fd */ -+ mem = gst_fd_allocator_alloc (allocator, fd, size, 0); -+ -+ if (G_UNLIKELY (!mem)) { -+ GST_ERROR_OBJECT (self, "GstDmaBufMemory allocation failed"); -+ close (fd); -+ goto fail; -+ } -+ -+ return mem; -+ -+ fail: -+ memset(&dreq, 0, sizeof(struct drm_mode_destroy_dumb)); -+ dreq.handle = creq.handle; -+ drmIoctl (DrmDeviceFD, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); -+ return NULL; -+} -+ -+static void -+gst_drm_allocator_free (GstAllocator * allocator, GstMemory * mem) -+{ -+ GstDRMAllocator *self = GST_DRM_ALLOCATOR (allocator); -+ uint32_t handle = 0; -+ int DrmDeviceFD = self->DrmDeviceFD; -+ int fd = -1; -+ -+ GST_LOG_OBJECT (self, "DRM Memory free"); -+ -+ g_return_if_fail (GST_IS_ALLOCATOR (allocator)); -+ g_return_if_fail (mem != NULL); -+ g_return_if_fail (gst_is_drm_memory (mem)); -+ -+ fd = gst_fd_memory_get_fd (mem); -+ drmPrimeFDToHandle(DrmDeviceFD, fd, &handle); -+ -+ /* Incase there are some mapped memory, we unmap and ready it to be cleaned*/ -+ GST_ALLOCATOR_CLASS (parent_class)->free (allocator, mem); -+ -+ if (handle) { -+ struct drm_mode_destroy_dumb dreq; -+ memset(&dreq, 0, sizeof(struct drm_mode_destroy_dumb)); -+ dreq.handle = handle; -+ drmIoctl (DrmDeviceFD, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq); -+ } -+ -+ close (fd); -+} -+ -+static void -+gst_drm_allocator_finalize (GObject * obj) -+{ -+ GstDRMAllocator *self = GST_DRM_ALLOCATOR (obj); -+ GST_LOG_OBJECT (obj, "DRM Allocator finalize"); -+ -+ close (self->DrmDeviceFD); -+ self->DrmDeviceFD = INVALID_DRM_FD; -+ -+ G_OBJECT_CLASS (parent_class)->finalize (obj); -+} -+ -+static void -+gst_drm_allocator_class_init (GstDRMAllocatorClass * klass) -+{ -+ GstAllocatorClass *drm_alloc = (GstAllocatorClass *) klass; -+ -+ drm_alloc->alloc = GST_DEBUG_FUNCPTR (gst_drm_allocator_alloc); -+ drm_alloc->free = GST_DEBUG_FUNCPTR (gst_drm_allocator_free); -+ GST_DEBUG_CATEGORY_INIT (drmallocator_debug, "drmallocator", 0, -+ "GstDRMAllocator debug"); -+ -+} -+ -+static void -+gst_drm_allocator_init (GstDRMAllocator * self) -+{ -+ GstAllocator *alloc = GST_ALLOCATOR_CAST (self); -+ GObjectClass *object_class = G_OBJECT_CLASS (GST_DRM_ALLOCATOR_GET_CLASS(self)); -+ -+ if (self->DrmDeviceFD <= 0) { -+ self->DrmDeviceFD = open("/dev/dri/card0", O_RDWR | O_CLOEXEC); -+ if (self->DrmDeviceFD < 0) { -+ GST_ERROR_OBJECT (self, "Failed to open DRM device"); -+ } else { -+ drmDropMaster (self->DrmDeviceFD); -+ } -+ } -+ -+ alloc->mem_type = GST_ALLOCATOR_DMABUF; -+ -+ object_class->finalize = gst_drm_allocator_finalize; -+ -+ GST_OBJECT_FLAG_UNSET (self, GST_ALLOCATOR_FLAG_CUSTOM_ALLOC); -+} -+ -+void -+gst_drm_allocator_register (void) -+{ -+ gst_allocator_register (GST_ALLOCATOR_DRM, -+ g_object_new (GST_TYPE_DRM_ALLOCATOR, NULL)); -+} -+ -+GstAllocator * -+gst_drm_allocator_get (void) -+{ -+ GstAllocator *alloc; -+ alloc = gst_allocator_find (GST_ALLOCATOR_DRM); -+ if (!alloc) { -+ gst_drm_allocator_register(); -+ alloc = gst_allocator_find (GST_ALLOCATOR_DRM); -+ } -+ return alloc; -+} -+ -+gboolean -+gst_is_drm_memory (GstMemory * mem) -+{ -+ return gst_memory_is_type (mem, GST_ALLOCATOR_DMABUF); -+} -diff --git a/gst-libs/gst/drm/gstdrmallocator.h b/gst-libs/gst/drm/gstdrmallocator.h -new file mode 100644 -index 0000000..1ca93ba ---- /dev/null -+++ b/gst-libs/gst/drm/gstdrmallocator.h -@@ -0,0 +1,77 @@ -+/* -+ * GStreamer -+ * -+ * Copyright (C) 2012 Texas Instruments -+ * -+ * Authors: -+ * Pooja Prajod <poojaprajod@ti.com> -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation -+ * version 2.1 of the License. -+ * -+ * This library 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 -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * SECTION:GstDRMAllocator -+ * @short_description: GStreamer DRM allocator support -+ * -+ * Since: 1.6.3 -+ */ -+ -+#ifndef __GSTDRMALLOCATOR_H__ -+#define __GSTDRMALLOCATOR_H__ -+ -+#include <gst/gst.h> -+#include <gst/video/video.h> -+#include <gst/allocators/allocators.h> -+#include <stdint.h> -+ -+#include <xf86drm.h> -+#include <xf86drmMode.h> -+#include <fcntl.h> -+ -+G_BEGIN_DECLS -+ -+#define GST_TYPE_DRM_ALLOCATOR (gst_drm_allocator_get_type ()) -+#define GST_DRM_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DRM_ALLOCATOR, GstDRMAllocator)) -+#define GST_IS_DRM_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DRM_ALLOCATOR)) -+#define GST_DRM_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DRM_ALLOCATOR, GstDRMAllocatorClass)) -+#define GST_IS_DRM_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DRM_ALLOCATOR)) -+#define GST_DRM_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DRM_ALLOCATOR, GstDRMAllocatorClass)) -+ -+#define GST_ALLOCATOR_DRM "DRM" -+ -+typedef struct _GstDRMAllocator GstDRMAllocator; -+typedef struct _GstDRMAllocatorClass GstDRMAllocatorClass; -+ -+struct _GstDRMAllocator -+{ -+ GstFdAllocator parent; -+ int DrmDeviceFD; -+}; -+ -+struct _GstDRMAllocatorClass -+{ -+ GstFdAllocatorClass parent_class; -+}; -+ -+void gst_drm_allocator_register (void); -+GstAllocator * gst_drm_allocator_get (void); -+ -+gboolean gst_is_drm_memory (GstMemory * mem); -+ -+GType gst_drm_allocator_get_type (void); -+ -+G_END_DECLS -+ -+#endif /* __GSTDRMALLOCATOR_H__ */ -diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am -index 88c7e52..5fdccbf 100644 ---- a/pkgconfig/Makefile.am -+++ b/pkgconfig/Makefile.am -@@ -2,6 +2,7 @@ - ### all of the standard pc files we need to generate - pcverfiles = \ - gstreamer-plugins-bad-@GST_API_VERSION@.pc \ -+ gstreamer-drm-@GST_API_VERSION@.pc \ - gstreamer-codecparsers-@GST_API_VERSION@.pc \ - gstreamer-insertbin-@GST_API_VERSION@.pc \ - gstreamer-mpegts-@GST_API_VERSION@.pc \ -@@ -12,6 +13,7 @@ pcverfiles = \ - - pcverfiles_uninstalled = \ - gstreamer-plugins-bad-@GST_API_VERSION@-uninstalled.pc \ -+ gstreamer-drm-@GST_API_VERSION@-uninstalled.pc \ - gstreamer-codecparsers-@GST_API_VERSION@-uninstalled.pc \ - gstreamer-insertbin-@GST_API_VERSION@-uninstalled.pc \ - gstreamer-mpegts-@GST_API_VERSION@-uninstalled.pc \ -@@ -43,6 +45,7 @@ pkgconfig_DATA = $(pcverfiles) - CLEANFILES = $(pcverfiles) $(pcverfiles_uninstalled) - pcinfiles = \ - gstreamer-plugins-bad.pc.in gstreamer-plugins-bad-uninstalled.pc.in \ -+ gstreamer-drm.pc.in gstreamer-drm-uninstalled.pc.in \ - gstreamer-codecparsers.pc.in gstreamer-codecparsers-uninstalled.pc.in \ - gstreamer-gl.pc.in gstreamer-gl-uninstalled.pc.in \ - gstreamer-insertbin.pc.in gstreamer-insertbin-uninstalled.pc.in \ -diff --git a/pkgconfig/gstreamer-drm-uninstalled.pc.in b/pkgconfig/gstreamer-drm-uninstalled.pc.in -new file mode 100644 -index 0000000..9dcf978 ---- /dev/null -+++ b/pkgconfig/gstreamer-drm-uninstalled.pc.in -@@ -0,0 +1,11 @@ -+prefix= -+exec_prefix= -+libdir=${pcfiledir}/../gst-libs/gst/drm -+includedir=${pcfiledir}/../gst-libs -+ -+Name: GStreamer DRM Allocator, Uninstalled -+Description: DRM Allocator for GStreamer elements, uninstalled -+Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-base-@GST_MAJORMINOR@ -+Version: @VERSION@ -+Libs: -L${libdir} ${libdir}/libgstdrm-@GST_MAJORMINOR@.la -+Cflags: -I${includedir} -diff --git a/pkgconfig/gstreamer-drm.pc.in b/pkgconfig/gstreamer-drm.pc.in -new file mode 100644 -index 0000000..d155e80 ---- /dev/null -+++ b/pkgconfig/gstreamer-drm.pc.in -@@ -0,0 +1,12 @@ -+prefix=@prefix@ -+exec_prefix=@exec_prefix@ -+libdir=@libdir@ -+includedir=@includedir@/gstreamer-@GST_MAJORMINOR@ -+ -+Name: GStreamer DRM Allocator -+Description: DRM Allocator for GStreamer elements -+Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-base-@GST_MAJORMINOR@ -+Version: @VERSION@ -+Libs: -L${libdir} -lgstdrm-@GST_MAJORMINOR@ -+Cflags: -I${includedir} -+ --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch deleted file mode 100644 index 696202637..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch +++ /dev/null @@ -1,408 +0,0 @@ -From 79db7e4cab226515f0e4d40afdb5a5b478755396 Mon Sep 17 00:00:00 2001 -From: Pooja Prajod <a0132412@ti.com> -Date: Wed, 14 Sep 2016 16:03:17 -0400 -Subject: [PATCH] gstwaylandsink: Add mouse drag and drop support - -This patch adds mouse input listeners to WlDisplay instance. - -Signed-off-by: Pooja Prajod <a0132412@ti.com> -Signed-off-by: Eric Ruei <e-ruei1@ti.com> ---- - ext/wayland/wldisplay.c | 305 +++++++++++++++++++++++++++++++++++++++++++++++- - ext/wayland/wldisplay.h | 4 + - ext/wayland/wlwindow.c | 2 + - 3 files changed, 310 insertions(+), 1 deletion(-) - -diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c -index 8c5eeaf..c647f34 100644 ---- a/ext/wayland/wldisplay.c -+++ b/ext/wayland/wldisplay.c -@@ -21,18 +21,45 @@ - #ifdef HAVE_CONFIG_H - #include <config.h> - #endif -- -+#include <stdlib.h> -+#include <stdio.h> - #include "wldisplay.h" - #include "wlbuffer.h" -+#include "wlwindow.h" -+ -+#include <wayland-client-protocol.h> - -+#include <unistd.h> - #include <errno.h> -+#include <linux/input.h> - - GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug); - #define GST_CAT_DEFAULT gstwayland_debug - - G_DEFINE_TYPE (GstWlDisplay, gst_wl_display, G_TYPE_OBJECT); - -+struct touch_point -+{ -+ int32_t id; -+ struct wl_list link; -+}; -+ -+struct input -+{ -+ GstWlDisplay *display; -+ struct wl_seat *seat; -+ struct wl_pointer *pointer; -+ struct wl_touch *touch; -+ struct wl_list touch_point_list; -+ GstWlWindow *pointer_focus; -+ GstWlWindow *touch_focus; -+ struct wl_list link; -+ GstWlWindow *grab; -+}; -+ - static void gst_wl_display_finalize (GObject * gobject); -+static void input_grab (struct input *input, GstWlWindow *window); -+static void input_ungrab (struct input *input); - - static void - gst_wl_display_class_init (GstWlDisplayClass * klass) -@@ -51,6 +78,54 @@ gst_wl_display_init (GstWlDisplay * self) - } - - static void -+input_grab (struct input *input, GstWlWindow *window) -+{ -+ input->grab = window; -+} -+ -+static void -+input_ungrab (struct input *input) -+{ -+ input->grab = NULL; -+} -+ -+static void -+input_remove_pointer_focus (struct input *input) -+{ -+ GstWlWindow *window = input->pointer_focus; -+ -+ if (!window) -+ return; -+ -+ input->pointer_focus = NULL; -+} -+ -+static void -+input_destroy (struct input *input) -+{ -+ input_remove_pointer_focus (input); -+ -+ if (input->display->seat_version >= 3) { -+ if (input->pointer) -+ wl_pointer_release (input->pointer); -+ } -+ -+ wl_list_remove (&input->link); -+ wl_seat_destroy (input->seat); -+ free (input); -+} -+ -+static void -+display_destroy_inputs (GstWlDisplay *display) -+{ -+ struct input *tmp; -+ struct input *input; -+ -+ wl_list_for_each_safe (input, tmp, &display->input_list, link) -+ input_destroy (input); -+} -+ -+static void - gst_wl_display_finalize (GObject * gobject) - { - GstWlDisplay *self = GST_WL_DISPLAY (gobject); -@@ -74,6 +149,8 @@ gst_wl_display_finalize (GObject * gobject) - g_hash_table_unref (self->buffers); - g_mutex_clear (&self->buffers_mutex); - -+ display_destroy_inputs (self); -+ - if (self->shm) - wl_shm_destroy (self->shm); - -@@ -143,6 +220,228 @@ static const struct wl_shm_listener shm_listener = { - shm_format - }; - -+ -+static void -+pointer_handle_enter (void *data, struct wl_pointer *pointer, -+ uint32_t serial, struct wl_surface *surface, -+ wl_fixed_t sx_w, wl_fixed_t sy_w) -+{ -+ struct input *input = data; -+ -+ if (!surface) { -+ /* enter event for a window we've just destroyed */ -+ return; -+ } -+ -+ input->display->serial = serial; -+ input->pointer_focus = wl_surface_get_user_data (surface); -+} -+ -+static void -+pointer_handle_leave (void *data, struct wl_pointer *pointer, -+ uint32_t serial, struct wl_surface *surface) -+{ -+ struct input *input = data; -+ -+ input_remove_pointer_focus (input); -+} -+ -+static void -+pointer_handle_motion (void *data, struct wl_pointer *pointer, -+ uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) -+{ -+ struct input *input = data; -+ GstWlWindow *window = input->pointer_focus; -+ -+ if (!window) -+ return; -+ -+ if (input->grab) -+ wl_shell_surface_move (input->grab->shell_surface, input->seat, -+ input->display->serial); -+ -+} -+ -+static void -+pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial, -+ uint32_t time, uint32_t button, uint32_t state_w) -+{ -+ struct input *input = data; -+ enum wl_pointer_button_state state = state_w; -+ input->display->serial = serial; -+ -+ if (button == BTN_LEFT) { -+ if (state == WL_POINTER_BUTTON_STATE_PRESSED) -+ input_grab (input, input->pointer_focus); -+ -+ if (input->grab && state == WL_POINTER_BUTTON_STATE_RELEASED) -+ input_ungrab (input); -+ } -+ -+ if (input->grab) -+ wl_shell_surface_move (input->grab->shell_surface, input->seat, -+ input->display->serial); -+} -+ -+static void -+pointer_handle_axis (void *data, struct wl_pointer *pointer, -+ uint32_t time, uint32_t axis, wl_fixed_t value) -+{ -+} -+ -+static const struct wl_pointer_listener pointer_listener = { -+ pointer_handle_enter, -+ pointer_handle_leave, -+ pointer_handle_motion, -+ pointer_handle_button, -+ pointer_handle_axis, -+}; -+ -+static void -+touch_handle_down (void *data, struct wl_touch *wl_touch, -+ uint32_t serial, uint32_t time, struct wl_surface *surface, -+ int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -+{ -+ struct input *input = data; -+ struct touch_point *tp; -+ -+ input->display->serial = serial; -+ input->touch_focus = wl_surface_get_user_data (surface); -+ if (!input->touch_focus) { -+ return; -+ } -+ -+ tp = malloc (sizeof *tp); -+ if (tp) { -+ tp->id = id; -+ wl_list_insert (&input->touch_point_list, &tp->link); -+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat, -+ serial); -+ } -+} -+ -+static void -+touch_handle_motion (void *data, struct wl_touch *wl_touch, -+ uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -+{ -+ struct input *input = data; -+ struct touch_point *tp; -+ -+ -+ if (!input->touch_focus) { -+ return; -+ } -+ wl_list_for_each (tp, &input->touch_point_list, link) { -+ if (tp->id != id) -+ continue; -+ -+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat, -+ input->display->serial); -+ -+ return; -+ } -+} -+ -+static void -+touch_handle_frame (void *data, struct wl_touch *wl_touch) -+{ -+} -+ -+static void -+touch_handle_cancel (void *data, struct wl_touch *wl_touch) -+{ -+} -+ -+static void -+touch_handle_up (void *data, struct wl_touch *wl_touch, -+ uint32_t serial, uint32_t time, int32_t id) -+{ -+ struct input *input = data; -+ struct touch_point *tp, *tmp; -+ -+ if (!input->touch_focus) { -+ return; -+ } -+ -+ wl_list_for_each_safe (tp, tmp, &input->touch_point_list, link) { -+ if (tp->id != id) -+ continue; -+ -+ wl_list_remove (&tp->link); -+ free (tp); -+ -+ return; -+ } -+} -+ -+static const struct wl_touch_listener touch_listener = { -+ touch_handle_down, -+ touch_handle_up, -+ touch_handle_motion, -+ touch_handle_frame, -+ touch_handle_cancel, -+}; -+ -+ -+static void -+seat_handle_capabilities (void *data, struct wl_seat *seat, -+ enum wl_seat_capability caps) -+{ -+ struct input *input = data; -+ -+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) { -+ input->pointer = wl_seat_get_pointer (seat); -+ wl_pointer_set_user_data (input->pointer, input); -+ wl_pointer_add_listener (input->pointer, &pointer_listener, input); -+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { -+ wl_pointer_destroy (input->pointer); -+ input->pointer = NULL; -+ } -+ -+ if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) { -+ input->touch = wl_seat_get_touch (seat); -+ wl_touch_set_user_data (input->touch, input); -+ wl_touch_add_listener (input->touch, &touch_listener, input); -+ } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { -+ wl_touch_destroy (input->touch); -+ input->touch = NULL; -+ } -+} -+ -+static void -+seat_handle_name (void *data, struct wl_seat *seat, const char *name) -+{ -+ -+} -+ -+static const struct wl_seat_listener seat_listener = { -+ seat_handle_capabilities, -+ seat_handle_name -+}; -+ -+static void -+display_add_input (GstWlDisplay *d, uint32_t id) -+{ -+ struct input *input; -+ -+ input = calloc (1, sizeof (*input)); -+ if (input == NULL) { -+ fprintf (stderr, "%s: out of memory\n", "gst-wayland-sink"); -+ exit (EXIT_FAILURE); -+ } -+ input->display = d; -+ input->seat = wl_registry_bind (d->registry, id, &wl_seat_interface, -+ MAX (d->seat_version, 3)); -+ input->touch_focus = NULL; -+ input->pointer_focus = NULL; -+ wl_list_init (&input->touch_point_list); -+ wl_list_insert (d->input_list.prev, &input->link); -+ -+ wl_seat_add_listener (input->seat, &seat_listener, input); -+ wl_seat_set_user_data (input->seat, input); -+ -+} -+ - static void - registry_handle_global (void *data, struct wl_registry *registry, - uint32_t id, const char *interface, uint32_t version) -@@ -160,6 +459,9 @@ registry_handle_global (void *data, struct wl_registry *registry, - } else if (g_strcmp0 (interface, "wl_shm") == 0) { - self->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1); - wl_shm_add_listener (self->shm, &shm_listener, self); -+ } else if (g_strcmp0 (interface, "wl_seat") == 0) { -+ self->seat_version = version; -+ display_add_input (self, id); - } else if (g_strcmp0 (interface, "wl_scaler") == 0) { - self->scaler = wl_registry_bind (registry, id, &wl_scaler_interface, 2); - } -@@ -237,6 +539,7 @@ gst_wl_display_new_existing (struct wl_display * display, - self->own_display = take_ownership; - - self->queue = wl_display_create_queue (self->display); -+ wl_list_init (&self->input_list); - self->registry = wl_display_get_registry (self->display); - wl_proxy_set_queue ((struct wl_proxy *) self->registry, self->queue); - wl_registry_add_listener (self->registry, ®istry_listener, self); -diff --git a/ext/wayland/wldisplay.h b/ext/wayland/wldisplay.h -index 5505d60..d8c2cef 100644 ---- a/ext/wayland/wldisplay.h -+++ b/ext/wayland/wldisplay.h -@@ -62,6 +62,10 @@ struct _GstWlDisplay - GMutex buffers_mutex; - GHashTable *buffers; - gboolean shutting_down; -+ -+ struct wl_list input_list; -+ int seat_version; -+ uint32_t serial; - }; - - struct _GstWlDisplayClass -diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c -index a964335..34ae385 100644 ---- a/ext/wayland/wlwindow.c -+++ b/ext/wayland/wlwindow.c -@@ -111,6 +111,8 @@ gst_wl_window_new_internal (GstWlDisplay * display) - - window->area_surface = wl_compositor_create_surface (display->compositor); - window->video_surface = wl_compositor_create_surface (display->compositor); -+ wl_surface_set_user_data (window->area_surface, window); -+ wl_surface_set_user_data (window->video_surface, window); - - wl_proxy_set_queue ((struct wl_proxy *) window->area_surface, display->queue); - wl_proxy_set_queue ((struct wl_proxy *) window->video_surface, --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-add-input-format-I420-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-add-input-format-I420-support.patch deleted file mode 100644 index 507f57b92..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-add-input-format-I420-support.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 1364ee6e60eb09a3fe3b072fe4671c5d645e523a Mon Sep 17 00:00:00 2001 -From: Eric Ruei <e-ruei1@ti.com> -Date: Wed, 22 Feb 2017 10:49:01 -0500 -Subject: [PATCH 1/3] gstwaylandsink: add input format I420 support - -The software-based video decoder produces the output in I420 format. To display -the output without additional ARM MHz consumed in video format conversion, -the function gst_wl_memory_construct_wl_buffer is enhanced to support I420 format. - -Signed-off-by: Eric Ruei <e-ruei1@ti.com> ---- - ext/wayland/wldrm.c | 41 ++++++++++++++++++++++++++++++++++------- - 1 file changed, 34 insertions(+), 7 deletions(-) - -diff --git a/ext/wayland/wldrm.c b/ext/wayland/wldrm.c -index 3dc9c21..ecbdc88 100644 ---- a/ext/wayland/wldrm.c -+++ b/ext/wayland/wldrm.c -@@ -5,33 +5,60 @@ - #include <omap_drmif.h> - #include <wayland-client.h> - -+GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug); -+#define GST_CAT_DEFAULT gstwayland_debug -+ -+ - struct wl_buffer * - gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display, - const GstVideoInfo * info) - { - gint video_width = GST_VIDEO_INFO_WIDTH (info); - gint video_height = GST_VIDEO_INFO_HEIGHT (info); -+ GstVideoFormat format = GST_VIDEO_INFO_FORMAT (info); - int fd = -1; - struct omap_bo *bo; - struct wl_buffer *buffer; -- -- /* TODO get format, etc from caps.. and query device for -- * supported formats, and make this all more flexible to -- * cope with various formats: -- */ -- uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); -+ uint32_t fourcc; - uint32_t name; - /* note: wayland and mesa use the terminology: - * stride - rowstride in bytes - * pitch - rowstride in pixels - */ - uint32_t strides[3] = { -- GST_ROUND_UP_4 (video_width), GST_ROUND_UP_4 (video_width), 0, -+ GST_ROUND_UP_4 (video_width), 0, 0, - }; - uint32_t offsets[3] = { - 0, strides[0] * video_height, 0 - }; - -+ if (format == GST_VIDEO_FORMAT_NV12) -+ { -+ /* NV12 */ -+ fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); -+ strides[1] = GST_ROUND_UP_4 (video_width); -+ } -+ else if(format == GST_VIDEO_FORMAT_I420) -+ { -+ /* YUV420 */ -+ fourcc = GST_MAKE_FOURCC ('Y', 'U', '1', '2'); -+ strides[1] = strides[2] = GST_ROUND_UP_4 (video_width/2); -+ offsets[2] = offsets[1] + strides[1] * video_height/2; -+ } -+ else -+ { -+ -+ GST_DEBUG ("Unsupported video format: %d", format); -+ /* -+ * There are two xRGB frames with width and height = 1 required in the begining of a video stream. -+ * If we consider them as errot, then it will case libwayland-clent.so crashes -+ * due to invalid error handling. -+ * Consider them as NV12 until we can figure out a better solution -+ */ -+ fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); -+ strides[1] = GST_ROUND_UP_4 (video_width); -+ } -+ - fd = gst_fd_memory_get_fd (mem); - - if (fd < 0 ) { --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch deleted file mode 100644 index 308a84959..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 68936c7fb864440bb4d2ab737a651888ac7c253a Mon Sep 17 00:00:00 2001 -From: Eric Ruei <e-ruei1@ti.com> -Date: Fri, 17 Mar 2017 10:42:32 -0400 -Subject: [PATCH 2/3] kmssink: remove DCE dependencies - -Replace DCE related API calls to libdrm and omapdrm API calls -to decouple DCE from kmssink - -Signed-off-by: Eric Ruei <e-ruei1@ti.com> ---- - configure.ac | 1 - - sys/kms/Makefile.am | 2 -- - sys/kms/gstkmssink.c | 17 +++++++++++++---- - 3 files changed, 13 insertions(+), 7 deletions(-) - -diff --git a/configure.ac b/configure.ac -index f93d52d..a6f93a5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2321,7 +2321,6 @@ dnl *** kms *** - translit(dnm, m, l) AM_CONDITIONAL(USE_KMS, true) - AG_GST_CHECK_FEATURE(KMS, [kmssink], kms, [ - PKG_CHECK_MODULES([DRM], [libdrm libdrm_omap], HAVE_KMS=yes, HAVE_KMS=no) --PKG_CHECK_MODULES(LIBDCE, [libdce >= 1.0.0], HAVE_KMS=yes, HAVE_KMS=no) - AC_SUBST(DRM_CFLAGS) - AC_SUBST(DRM_LIBS) - ]) -diff --git a/sys/kms/Makefile.am b/sys/kms/Makefile.am -index 6d56073..cc7353e 100644 ---- a/sys/kms/Makefile.am -+++ b/sys/kms/Makefile.am -@@ -9,7 +9,6 @@ libgstkmssink_la_CFLAGS = \ - $(GST_PLUGINS_BAD_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) \ - $(GST_BASE_CFLAGS) \ -- $(LIBDCE_CFLAGS) \ - $(GST_CFLAGS) \ - $(DRM_CFLAGS) - -@@ -17,7 +16,6 @@ libgstkmssink_la_LIBADD = \ - $(GST_PLUGINS_BASE_LIBS) \ - $(GST_BASE_LIBS) \ - $(GST_LIBS) \ -- $(LIBDCE_LIBS) \ - $(DRM_LIBS) \ - -lgstvideo-$(GST_API_VERSION) \ - $(top_builddir)/gst-libs/gst/drm/libgstdrm-$(GST_API_VERSION).la -diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c -index 17e6407..9795bdf 100644 ---- a/sys/kms/gstkmssink.c -+++ b/sys/kms/gstkmssink.c -@@ -31,7 +31,6 @@ - #include "gstkmssink.h" - #include "gstkmsbufferpriv.h" - --#include <libdce.h> - #include <omap_drm.h> - #include <omap_drmif.h> - #include <xf86drmMode.h> -@@ -516,13 +515,18 @@ gst_kms_sink_start (GstBaseSink * bsink) - - sink = GST_KMS_SINK (bsink); - -- drm_dev = dce_init (); -+ drm_fd = open("/dev/dri/card0", O_RDWR | O_CLOEXEC); -+ if(drm_fd == NULL) -+ goto drm_failed; -+ else { -+ drm_dev = omap_device_new(drm_fd); -+ } -+ - if (drm_dev == NULL) - goto device_failed; - else { -+ sink->fd = drm_fd; - sink->dev = drm_dev; -- sink->fd = dce_get_fd (); -- drm_fd = dce_get_fd (); - } - - sink->resources = drmModeGetResources (sink->fd); -@@ -539,6 +543,11 @@ fail: - gst_kms_sink_reset (sink); - return FALSE; - -+drm_failed: -+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, -+ (NULL), ("drmOpen failed")); -+ goto fail; -+ - device_failed: - GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, - (NULL), ("omap_device_new failed")); --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch deleted file mode 100644 index 707cfc2b7..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch +++ /dev/null @@ -1,146 +0,0 @@ -From c748e947ff35c4137178aef9bf229e0c67952982 Mon Sep 17 00:00:00 2001 -From: Pooja Prajod <a0132412@ti.com> -Date: Fri, 20 Jan 2017 14:57:29 +0530 -Subject: [PATCH 2/5] parsers: Pick previos bug fixes on different parsers - -The following bug fixes which were previously identified are picked : -1. Increase rank for vc1parse and jpegparse -2. Modify h264 and mpeg4 parsers to interpolate pts -3. Fix create() width and height calculation on h264parse - -Signed-off-by: Pooja Prajod <a0132412@ti.com> ---- - gst/jpegformat/gstjpegformat.c | 2 +- - gst/jpegformat/gstjpegparse.c | 2 +- - gst/videoparsers/gsth264parse.c | 22 +++++++--------------- - gst/videoparsers/gstmpeg4videoparse.c | 2 +- - gst/videoparsers/gstmpegvideoparse.c | 2 +- - gst/videoparsers/plugin.c | 2 +- - 6 files changed, 12 insertions(+), 20 deletions(-) - -diff --git a/gst/jpegformat/gstjpegformat.c b/gst/jpegformat/gstjpegformat.c -index b410466..ecb9311 100644 ---- a/gst/jpegformat/gstjpegformat.c -+++ b/gst/jpegformat/gstjpegformat.c -@@ -30,7 +30,7 @@ - static gboolean - plugin_init (GstPlugin * plugin) - { -- if (!gst_element_register (plugin, "jpegparse", GST_RANK_NONE, -+ if (!gst_element_register (plugin, "jpegparse", GST_RANK_PRIMARY + 2, - GST_TYPE_JPEG_PARSE)) - return FALSE; - if (!gst_element_register (plugin, "jifmux", GST_RANK_SECONDARY, -diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c -index 77e53a6..5bfba7b 100644 ---- a/gst/jpegformat/gstjpegparse.c -+++ b/gst/jpegformat/gstjpegparse.c -@@ -151,7 +151,7 @@ gst_jpeg_parse_class_init (GstJpegParseClass * klass) - - gst_element_class_set_static_metadata (gstelement_class, - "JPEG stream parser", -- "Video/Parser", -+ "Codec/Parser/Video", - "Parse JPEG images into single-frame buffers", - "Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>"); - -diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c -index 05b6b75..6fe2914 100644 ---- a/gst/videoparsers/gsth264parse.c -+++ b/gst/videoparsers/gsth264parse.c -@@ -162,7 +162,7 @@ static void - gst_h264_parse_init (GstH264Parse * h264parse) - { - h264parse->frame_out = gst_adapter_new (); -- gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), FALSE); -+ gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), TRUE); - GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h264parse)); - GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (h264parse)); - } -@@ -1722,13 +1722,8 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) - gint fps_num, fps_den; - gint par_n, par_d; - -- if (sps->frame_cropping_flag) { -- crop_width = sps->crop_rect_width; -- crop_height = sps->crop_rect_height; -- } else { -- crop_width = sps->width; -- crop_height = sps->height; -- } -+ crop_width = (sps->crop_rect_width > sps->width)? sps->crop_rect_width: sps->width; -+ crop_height = (sps->crop_rect_height > sps->height)? sps->crop_rect_height: sps->height; - - if (G_UNLIKELY (h264parse->width != crop_width || - h264parse->height != crop_height)) { -@@ -1762,7 +1757,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) - } - - if (G_UNLIKELY (modified || h264parse->update_caps)) { -- gint width, height; -+ gint width=0, height=0; - GstClockTime latency; - - const gchar *caps_mview_mode = NULL; -@@ -1774,16 +1769,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) - - caps = gst_caps_copy (sink_caps); - -- /* sps should give this but upstream overrides */ - if (s && gst_structure_has_field (s, "width")) - gst_structure_get_int (s, "width", &width); -- else -- width = h264parse->width; -- -+ width = (width > h264parse->width)? width: h264parse->width; -+ - if (s && gst_structure_has_field (s, "height")) - gst_structure_get_int (s, "height", &height); -- else -- height = h264parse->height; -+ height = (height > h264parse->height)? height: h264parse->height; - - if (s == NULL || - !gst_structure_get_fraction (s, "pixel-aspect-ratio", &par_n, -diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c -index a1fd3b2..7912254 100644 ---- a/gst/videoparsers/gstmpeg4videoparse.c -+++ b/gst/videoparsers/gstmpeg4videoparse.c -@@ -185,7 +185,7 @@ gst_mpeg4vparse_init (GstMpeg4VParse * parse) - parse->interval = DEFAULT_CONFIG_INTERVAL; - parse->last_report = GST_CLOCK_TIME_NONE; - -- gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE); -+ gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), TRUE); - GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (parse)); - GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (parse)); - } -diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c -index bf71a3e..f203cca 100644 ---- a/gst/videoparsers/gstmpegvideoparse.c -+++ b/gst/videoparsers/gstmpegvideoparse.c -@@ -175,7 +175,7 @@ gst_mpegv_parse_init (GstMpegvParse * parse) - { - parse->config_flags = FLAG_NONE; - -- gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE); -+ gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), TRUE); - GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (parse)); - GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (parse)); - } -diff --git a/gst/videoparsers/plugin.c b/gst/videoparsers/plugin.c -index 79d1df6..fb866b5 100644 ---- a/gst/videoparsers/plugin.c -+++ b/gst/videoparsers/plugin.c -@@ -51,7 +51,7 @@ plugin_init (GstPlugin * plugin) - ret |= gst_element_register (plugin, "h265parse", - GST_RANK_SECONDARY, GST_TYPE_H265_PARSE); - ret |= gst_element_register (plugin, "vc1parse", -- GST_RANK_NONE, GST_TYPE_VC1_PARSE); -+ GST_RANK_PRIMARY + 2, GST_TYPE_VC1_PARSE); - - return ret; - } --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-gstkmssink-Add-support-for-KMS-based-sink.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-gstkmssink-Add-support-for-KMS-based-sink.patch deleted file mode 100644 index 1068fda2c..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-gstkmssink-Add-support-for-KMS-based-sink.patch +++ /dev/null @@ -1,1592 +0,0 @@ -From 44ba6f9839a410e981c9c941f099316ebfac2659 Mon Sep 17 00:00:00 2001 -From: Pooja Prajod <a0132412@ti.com> -Date: Fri, 20 Jan 2017 16:18:22 +0530 -Subject: [PATCH 3/5] gstkmssink: Add support for KMS based sink - -The following features are enabled: -1. Add support for kmssink -2. Fix memory leak by using API's that do not hold - reference to GstMemory -3. Restrict the number of buffers that will be allocated - by kmssink bufferpool -4. Use Atomic mode setting instead of SetPlane -5. Store encoder and plane data as static data to enable - same process looping usecase -6. Handle usecase where display is disabled by default - -Signed-off-by: Pooja Prajod <a0132412@ti.com> ---- - configure.ac | 14 + - sys/Makefile.am | 10 +- - sys/kms/Makefile.am | 28 ++ - sys/kms/gstdrmutils.c | 347 +++++++++++++++++++++ - sys/kms/gstdrmutils.h | 50 +++ - sys/kms/gstkmsbufferpriv.c | 121 ++++++++ - sys/kms/gstkmsbufferpriv.h | 64 ++++ - sys/kms/gstkmssink.c | 740 +++++++++++++++++++++++++++++++++++++++++++++ - sys/kms/gstkmssink.h | 92 ++++++ - 9 files changed, 1464 insertions(+), 2 deletions(-) - create mode 100644 sys/kms/Makefile.am - create mode 100644 sys/kms/gstdrmutils.c - create mode 100644 sys/kms/gstdrmutils.h - create mode 100644 sys/kms/gstkmsbufferpriv.c - create mode 100644 sys/kms/gstkmsbufferpriv.h - create mode 100644 sys/kms/gstkmssink.c - create mode 100644 sys/kms/gstkmssink.h - -diff --git a/configure.ac b/configure.ac -index e254605..9fdfbc7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2324,6 +2324,18 @@ AG_GST_CHECK_FEATURE(KATE, [Kate], kate, [ - AC_SUBST(TIGER_LIBS) - ],,,[AM_CONDITIONAL(USE_TIGER, false)]) - -+ -+ -+dnl *** kms *** -+translit(dnm, m, l) AM_CONDITIONAL(USE_KMS, true) -+AG_GST_CHECK_FEATURE(KMS, [kmssink], kms, [ -+PKG_CHECK_MODULES([DRM], [libdrm libdrm_omap], HAVE_KMS=yes, HAVE_KMS=no) -+PKG_CHECK_MODULES(LIBDCE, [libdce >= 1.0.0], HAVE_KMS=yes, HAVE_KMS=no) -+AC_SUBST(DRM_CFLAGS) -+AC_SUBST(DRM_LIBS) -+]) -+ -+ - dnl *** ladspa *** - translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true) - AG_GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [ -@@ -3383,6 +3395,7 @@ AM_CONDITIONAL(USE_GTK3_GL, false) - AM_CONDITIONAL(USE_HLS, false) - AM_CONDITIONAL(USE_KATE, false) - AM_CONDITIONAL(USE_TIGER, false) -+AM_CONDITIONAL(USE_KMS, false) - AM_CONDITIONAL(USE_LADSPA, false) - AM_CONDITIONAL(USE_LV2, false) - AM_CONDITIONAL(USE_LIBDE265, false) -@@ -3632,6 +3645,7 @@ sys/fbdev/Makefile - sys/linsys/Makefile - sys/nvenc/Makefile - sys/opensles/Makefile -+sys/kms/Makefile - sys/shm/Makefile - sys/tinyalsa/Makefile - sys/uvch264/Makefile -diff --git a/sys/Makefile.am b/sys/Makefile.am -index 32f79fb..325b4af 100644 ---- a/sys/Makefile.am -+++ b/sys/Makefile.am -@@ -87,6 +87,12 @@ PVR_DIR=pvr2d - else - PVR_DIR= - endif -+ -+if USE_KMS -+KMS_DIR=kms -+else -+KMS_DIR= -+endif - - if USE_SHM - SHM_DIR=shm -@@ -148,10 +154,10 @@ else - TINYALSA_DIR= - endif - --SUBDIRS = $(ACM_DIR) $(ANDROID_MEDIA_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(BLUEZ_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTSOUND_DIR) $(WINKS_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OPENSLES_DIR) $(PVR_DIR) $(SHM_DIR) $(UVCH264_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR) $(WINSCREENCAP_DIR) $(WASAPI_DIR) $(NVENC_DIR) $(TINYALSA_DIR) -+SUBDIRS = $(ACM_DIR) $(ANDROID_MEDIA_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(BLUEZ_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTSOUND_DIR) $(WINKS_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OPENSLES_DIR) $(PVR_DIR) $(KMS_DIR) $(SHM_DIR) $(UVCH264_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR) $(WINSCREENCAP_DIR) $(WASAPI_DIR) $(NVENC_DIR) $(TINYALSA_DIR) - - DIST_SUBDIRS = acmenc acmmp3dec androidmedia applemedia applemedia-nonpublic avc bluez d3dvideosink decklink directsound dvb linsys fbdev dshowdecwrapper dshowsrcwrapper dshowvideosink \ -- opensles pvr2d shm uvch264 vcd vdpau wasapi wininet winks winscreencap \ -+ opensles pvr2d kms shm uvch264 vcd vdpau wasapi wininet winks winscreencap \ - nvenc tinyalsa - - include $(top_srcdir)/common/parallel-subdirs.mak -diff --git a/sys/kms/Makefile.am b/sys/kms/Makefile.am -new file mode 100644 -index 0000000..6d56073 ---- /dev/null -+++ b/sys/kms/Makefile.am -@@ -0,0 +1,28 @@ -+plugin_LTLIBRARIES = libgstkmssink.la -+ -+libgstkmssink_la_SOURCES = \ -+ gstkmssink.c \ -+ gstkmsbufferpriv.c \ -+ gstdrmutils.c -+ -+libgstkmssink_la_CFLAGS = \ -+ $(GST_PLUGINS_BAD_CFLAGS) \ -+ $(GST_PLUGINS_BASE_CFLAGS) \ -+ $(GST_BASE_CFLAGS) \ -+ $(LIBDCE_CFLAGS) \ -+ $(GST_CFLAGS) \ -+ $(DRM_CFLAGS) -+ -+libgstkmssink_la_LIBADD = \ -+ $(GST_PLUGINS_BASE_LIBS) \ -+ $(GST_BASE_LIBS) \ -+ $(GST_LIBS) \ -+ $(LIBDCE_LIBS) \ -+ $(DRM_LIBS) \ -+ -lgstvideo-$(GST_API_VERSION) \ -+ $(top_builddir)/gst-libs/gst/drm/libgstdrm-$(GST_API_VERSION).la -+ -+libgstkmssink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -+libgstkmssink_la_LIBTOOLFLAGS = --tag=disable-static -+ -+noinst_HEADERS = gstkmssink.h gstdrmutils.h gstkmsbufferpriv.h -diff --git a/sys/kms/gstdrmutils.c b/sys/kms/gstdrmutils.c -new file mode 100644 -index 0000000..0e67a48 ---- /dev/null -+++ b/sys/kms/gstdrmutils.c -@@ -0,0 +1,347 @@ -+/* GStreamer -+ * -+ * Copyright (C) 2012 Texas Instruments -+ * Copyright (C) 2012 Collabora Ltd -+ * -+ * Authors: -+ * Alessandro Decina <alessandro.decina@collabora.co.uk> -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Library General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library 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 -+ * Library General Public License for more details. -+ * -+ * You should have received a copy of the GNU Library General Public -+ * License along with this library; if not, write to the -+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -+ * Boston, MA 02111-1307, USA. -+ */ -+ -+#include <gst/gst.h> -+#include "gstdrmutils.h" -+ -+static int stored_enc = 0; -+static drmModeEncoder *enc; -+static struct plane_data *stored_plane; -+ -+GST_DEBUG_CATEGORY_EXTERN (gst_debug_kms_sink); -+#define GST_CAT_DEFAULT gst_debug_kms_sink -+ -+void -+gst_drm_connector_cleanup (int fd, struct connector *c) -+{ -+ if (c->connector) { -+ drmModeFreeConnector (c->connector); -+ c->connector = NULL; -+ } -+ -+ if (c->fb_id) { -+ drmModeRmFB (fd, c->fb_id); -+ c->fb_id = 0; -+ } -+ if (c->fb_bo) { -+ omap_bo_del (c->fb_bo); -+ c->fb_bo = NULL; -+ } -+} -+ -+ -+static gboolean -+gst_drm_connector_find_mode_and_plane_helper (int fd, -+ struct omap_device *dev, int width, int height, -+ drmModeRes * resources, drmModePlaneRes * plane_resources, -+ struct connector *c) -+{ -+ int i, best_area = 0, ret; -+ struct drm_set_client_cap req; -+ unsigned int j; -+ int32_t crtc; -+ -+ gst_drm_connector_cleanup (fd, c); -+ -+ req.capability = DRM_CLIENT_CAP_ATOMIC; -+ req.value = 1; -+ ret = ioctl(fd, DRM_IOCTL_SET_CLIENT_CAP, &req); -+ if(ret < 0) { -+ GST_DEBUG("drm set atomic cap failed"); -+ goto fail; -+ } -+ -+ /* First, find the connector & mode */ -+ c->connector = drmModeGetConnector (fd, c->id); -+ if (!c->connector) -+ goto error_no_connector; -+ -+ if (!c->connector->count_modes) -+ goto error_no_mode; -+ -+ /* just look for the highest resolution: */ -+ for (i = 0; i < c->connector->count_modes; i++) { -+ drmModeModeInfo *mode = &c->connector->modes[i]; -+ int area = mode->hdisplay * mode->vdisplay; -+ -+ if (area > best_area) { -+ c->mode = mode; -+ best_area = area; -+ } -+ } -+ -+ if (c->mode == NULL) { -+ /* XXX: just pick the first available mode. Not sure this is correct... */ -+ c->mode = &c->connector->modes[0]; -+#if 0 -+ goto error_no_mode; -+#endif -+ } -+ -+ /* Now get the encoder */ -+ -+ if (stored_enc) { -+ c->encoder = enc; -+ c->connector->encoder_id = stored_enc; -+ } else { -+ c->encoder = drmModeGetEncoder (fd, c->connector->encoder_id); -+ enc = c->encoder; -+ stored_enc = c->connector->encoder_id; -+ } -+ -+ if (!c->encoder) { -+ for (i = 0; i < c->connector->count_encoders; ++i) { -+ c->encoder = drmModeGetEncoder(fd, c->connector->encoders[i]); -+ if (!c->encoder) { -+ GST_DEBUG ("Cannot retrieve encoder %u:%u (%d): %m\n", -+ i, c->connector->encoders[i], errno); -+ continue; -+ } -+ /* iterate all global CRTCs */ -+ for (j = 0; j < resources->count_crtcs; ++j) { -+ /* check whether this CRTC works with the encoder */ -+ if (!(c->encoder->possible_crtcs & (1 << j))) -+ continue; -+ crtc = resources->crtcs[j]; -+ break; -+ } -+ if (crtc >= 0) { -+ enc = c->encoder; -+ stored_enc = c->connector->encoder_id; -+ c->crtc = crtc; -+ goto found_encoder; -+ } -+ } -+ } -+ -+found_encoder: -+ -+ if (!c->encoder) -+ goto error_no_encoder; -+ -+ if (c->crtc == -1) -+ c->crtc = c->encoder->crtc_id; -+ -+ /* and figure out which crtc index it is: */ -+ c->pipe = -1; -+ for (i = 0; i < resources->count_crtcs; i++) { -+ if (c->crtc == (int) resources->crtcs[i]) { -+ c->pipe = i; -+ break; -+ } -+ } -+ -+ if (c->pipe == -1) -+ goto error_no_crtc; -+ -+ if (stored_plane) { -+ c->pdata = stored_plane; -+ } else { -+ -+ c->pdata = calloc(sizeof(struct plane_data), 1); -+ for (i = 0; i < plane_resources->count_planes; i++) { -+ drmModePlane *plane = drmModeGetPlane (fd, plane_resources->planes[i]); -+ int propc; -+ if (plane->possible_crtcs & (1 << c->pipe)) { -+ drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(fd, plane_resources->planes[i], DRM_MODE_OBJECT_PLANE); -+ for(propc = 0; propc < props->count_props; propc++) { -+ drmModePropertyPtr prop = drmModeGetProperty(fd, props->props[propc]); -+ if(strcmp(prop->name, "FB_ID") == 0) -+ c->pdata[0].fb_id_property = props->props[propc]; -+ } -+ c->pdata[0].plane = plane_resources->planes[i]; -+ stored_plane = c->pdata; -+ break; -+ } -+ } -+ if (stored_plane == NULL) -+ goto error_no_plane; -+ } -+ c->fb_bo = omap_bo_new (dev, best_area * 2, OMAP_BO_WC); -+ if (c->fb_bo) { -+ uint32_t fourcc = DRM_FORMAT_RGB565; -+ uint32_t handles[4] = { omap_bo_handle (c->fb_bo) }; -+ uint32_t pitches[4] = { c->mode->hdisplay * 2 }; -+ uint32_t offsets[4] = { 0 }; -+ ret = drmModeAddFB2 (fd, c->mode->hdisplay, c->mode->vdisplay, -+ fourcc, handles, pitches, offsets, &c->fb_id, 0); -+ if (ret) { -+ GST_DEBUG ("RGB565 AddFb2 failed"); -+ } -+ } -+ -+ /* now set the desired mode: */ -+ ret = drmModeSetCrtc (fd, c->crtc, c->fb_id, 0, 0, &c->id, 1, c->mode); -+ if (ret) { -+ GST_DEBUG ("SetCrtc failed"); -+ } -+ -+ return TRUE; -+ -+fail: -+ gst_drm_connector_cleanup (fd, c); -+ -+ return FALSE; -+ -+error_no_connector: -+ GST_DEBUG ("could not get connector %s", strerror (errno)); -+ goto fail; -+ -+error_no_mode: -+ GST_DEBUG ("could not find mode %dx%d (count_modes %d)", -+ width, height, c->connector->count_modes); -+ goto fail; -+ -+error_no_encoder: -+ GST_DEBUG ("could not get encoder: %s", strerror (errno)); -+ goto fail; -+ -+error_no_crtc: -+ GST_DEBUG ("couldn't find a crtc"); -+ goto fail; -+ -+error_no_plane: -+ GST_DEBUG ("couldn't find a plane"); -+ goto fail; -+} -+ -+gboolean -+gst_drm_connector_find_mode_and_plane (int fd, -+ struct omap_device *dev, int width, int height, -+ drmModeRes * resources, drmModePlaneRes * plane_resources, -+ struct connector *c) -+{ -+ int i; -+ gboolean found = FALSE; -+ -+ /* First, find the connector & mode */ -+ if (c->id == 0) { -+ /* Any connector */ -+ GST_DEBUG ("Any connector, %d available", resources->count_connectors); -+ for (i = 0; i < resources->count_connectors; i++) { -+ GST_DEBUG (" %d", resources->connectors[i]); -+ } -+ for (i = 0; i < resources->count_connectors; i++) { -+ GST_DEBUG ("Trying connector %d: %d", i, resources->connectors[i]); -+ c->id = resources->connectors[i]; -+ if (gst_drm_connector_find_mode_and_plane_helper (fd, dev, width, height, -+ resources, plane_resources, c)) { -+ GST_DEBUG ("Found suitable connector"); -+ found = TRUE; -+ break; -+ } -+ GST_DEBUG ("Connector not suitable"); -+ } -+ } else { -+ /* A specific connector */ -+ GST_DEBUG ("Connector %d", c->id); -+ found = -+ gst_drm_connector_find_mode_and_plane_helper (fd, dev, width, height, -+ resources, plane_resources, c); -+ } -+ -+ return found; -+} -+ -+/* table nicked off libdrm's modetest.c */ -+/* *INDENT-OFF* */ -+static const struct { -+ int type_id; -+ const char *type_name; -+} connector_type_names[] = { -+ { DRM_MODE_CONNECTOR_Unknown, "unknown" }, -+ { DRM_MODE_CONNECTOR_VGA, "VGA" }, -+ { DRM_MODE_CONNECTOR_DVII, "DVI-I" }, -+ { DRM_MODE_CONNECTOR_DVID, "DVI-D" }, -+ { DRM_MODE_CONNECTOR_DVIA, "DVI-A" }, -+ { DRM_MODE_CONNECTOR_Composite, "composite" }, -+ { DRM_MODE_CONNECTOR_SVIDEO, "s-video" }, -+ { DRM_MODE_CONNECTOR_LVDS, "LVDS" }, -+ { DRM_MODE_CONNECTOR_Component, "component" }, -+ { DRM_MODE_CONNECTOR_9PinDIN, "9-pin-DIN" }, -+ { DRM_MODE_CONNECTOR_DisplayPort, "displayport" }, -+ { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" }, -+ { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" }, -+ { DRM_MODE_CONNECTOR_TV, "TV" }, -+ { DRM_MODE_CONNECTOR_eDP, "embedded-displayport" }, -+}; -+/* *INDENT-ON* */ -+ -+gboolean -+gst_drm_connector_find_mode_and_plane_by_name (int fd, -+ struct omap_device * dev, int width, int height, -+ drmModeRes * resources, drmModePlaneRes * plane_resources, -+ struct connector * c, const char *name) -+{ -+ int i, n; -+ char tmp[64]; -+ const char *type_name; -+ int found[G_N_ELEMENTS (connector_type_names)] = { 0 }; -+ -+ /* Find connector from name */ -+ for (i = 0; i < resources->count_connectors; i++) { -+ GST_DEBUG ("Trying connector %d: %d", i, resources->connectors[i]); -+ c->id = resources->connectors[i]; -+ c->connector = drmModeGetConnector (fd, c->id); -+ if (!c->connector) -+ continue; -+ -+ /* Find type name from this connector */ -+ for (n = 0; n < G_N_ELEMENTS (connector_type_names); n++) -+ if (connector_type_names[n].type_id == c->connector->connector_type) -+ break; -+ if (n == G_N_ELEMENTS (connector_type_names)) -+ continue; -+ -+ type_name = connector_type_names[n].type_name; -+ GST_DEBUG ("Connector %d has type %s", i, type_name); -+ ++found[n]; -+ -+ drmModeFreeConnector (c->connector); -+ c->connector = NULL; -+ -+ /* Try a few different matches, such as modetest and xrandr -+ output, and also a indexless one matching first found */ -+ snprintf (tmp, sizeof (tmp), "%s-%u", type_name, found[n]); -+ if (!g_ascii_strcasecmp (tmp, name)) -+ goto found; -+ snprintf (tmp, sizeof (tmp), "%s%u", type_name, found[n]); -+ if (!g_ascii_strcasecmp (tmp, name)) -+ goto found; -+ if (!g_ascii_strcasecmp (name, type_name)) -+ goto found; -+ -+ continue; -+ -+ found: -+ if (gst_drm_connector_find_mode_and_plane_helper (fd, dev, width, height, -+ resources, plane_resources, c)) { -+ GST_DEBUG ("Found suitable connector"); -+ return TRUE; -+ } -+ GST_DEBUG ("Connector not suitable"); -+ } -+ -+ return FALSE; -+} -diff --git a/sys/kms/gstdrmutils.h b/sys/kms/gstdrmutils.h -new file mode 100644 -index 0000000..ebc5fc6 ---- /dev/null -+++ b/sys/kms/gstdrmutils.h -@@ -0,0 +1,50 @@ -+#ifndef __GST_DRMUTILS_H__ -+#define __GST_DRMUTILS_H__ -+ -+#include <fcntl.h> -+#include <xf86drm.h> -+#include <stdio.h> -+#include <stdint.h> -+#include <stdlib.h> -+#include <string.h> -+#include <errno.h> -+#include <unistd.h> -+#include <assert.h> -+#include <libdrm/drm.h> -+#include <libdrm/drm_mode.h> -+#include <xf86drmMode.h> -+#include <omap_drm.h> -+#include <omap_drmif.h> -+#include <drm_fourcc.h> -+#include <gst/gst.h> -+#include <sys/ioctl.h> -+ -+struct plane_data { -+ int plane; -+ int fb_id_property; -+}; -+ -+struct connector { -+ uint32_t id; -+ char mode_str[64]; -+ drmModeConnector *connector; -+ drmModeModeInfo *mode; -+ drmModeEncoder *encoder; -+ uint32_t fb_id; -+ struct omap_bo *fb_bo; -+ int crtc; -+ int pipe; -+ struct plane_data *pdata; -+}; -+ -+void gst_drm_connector_cleanup (int fd, struct connector * c); -+gboolean gst_drm_connector_find_mode_and_plane (int fd, -+ struct omap_device * dev, int width, int height, -+ drmModeRes * resources, drmModePlaneRes * plane_resources, -+ struct connector *c); -+gboolean gst_drm_connector_find_mode_and_plane_by_name (int fd, -+ struct omap_device *dev, int width, int height, -+ drmModeRes * resources, drmModePlaneRes * plane_resources, -+ struct connector *c, const char *name); -+ -+#endif /* __GST_DRMUTILS_H__ */ -diff --git a/sys/kms/gstkmsbufferpriv.c b/sys/kms/gstkmsbufferpriv.c -new file mode 100644 -index 0000000..172a4c3 ---- /dev/null -+++ b/sys/kms/gstkmsbufferpriv.c -@@ -0,0 +1,121 @@ -+/* -+ * GStreamer -+ * -+ * Copyright (C) 2012 Texas Instruments -+ * Copyright (C) 2012 Collabora Ltd -+ * -+ * Authors: -+ * Alessandro Decina <alessandro.decina@collabora.co.uk> -+ * Rob Clark <rob.clark@linaro.org> -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation -+ * version 2.1 of the License. -+ * -+ * This library 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 -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include <stdint.h> -+#include <gst/gst.h> -+#include <gst/allocators/allocators.h> -+ -+#include <omap_drm.h> -+#include <omap_drmif.h> -+#include <xf86drmMode.h> -+ -+#include "gstkmssink.h" -+#include "gstkmsbufferpriv.h" -+ -+static int -+create_fb (GstKMSBufferPriv * priv, GstKMSSink * sink) -+{ -+ /* TODO get format, etc from caps.. and query device for -+ * supported formats, and make this all more flexible to -+ * cope with various formats: -+ */ -+ uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); -+ -+ uint32_t handles[4] = { -+ omap_bo_handle (priv->bo), omap_bo_handle (priv->bo), -+ }; -+ uint32_t pitches[4] = { -+ GST_ROUND_UP_4 (sink->input_width), GST_ROUND_UP_4 (sink->input_width), -+ }; -+ uint32_t offsets[4] = { -+ 0, pitches[0] * sink->input_height -+ }; -+ -+ return drmModeAddFB2 (priv->fd, sink->input_width, sink->input_height, -+ fourcc, handles, pitches, offsets, &priv->fb_id, 0); -+} -+ -+/** -+ * gst_kms_buffer_priv: -+ * @sink: a #GstKMSSink -+ * @buf: a pointer to #GstBuffer -+ * -+ * Checks if the @buf has a GstMetaDmaBuf metadata set. If it doesn't we return a NULL -+ * indicating its not a dmabuf buffer. We maintain a hashtable with dmabuf fd as key and -+ * the GstKMSBufferPriv structure as value -+ * -+ * Returns: the #GstKMSBufferPriv -+ * -+ * Since: 1.2.? -+ */ -+GstKMSBufferPriv * -+gst_kms_buffer_priv (GstKMSSink * sink, GstBuffer * buf) -+{ -+ struct omap_bo *bo; -+ int fd; -+ int fd_copy; -+ GstKMSBufferPriv * priv; -+ GstMemory *mem; -+ -+ /* if it isn't a dmabuf buffer that we can import, then there -+ * is nothing we can do with it: -+ */ -+ mem = gst_buffer_peek_memory (buf, 0); -+ fd_copy = gst_fd_memory_get_fd (mem); -+ if (fd_copy < 0) { -+ GST_DEBUG_OBJECT (sink, "not importing non dmabuf buffer"); -+ return NULL; -+ } -+ -+ /* lookup the hashtable with fd as key. If present return bo & buffer structure */ -+ priv = g_hash_table_lookup (sink->kmsbufferpriv, (gpointer)fd_copy); -+ if(priv) { -+ return priv; -+ } -+ -+ priv = g_malloc0 (sizeof (GstKMSBufferPriv)); -+ bo = omap_bo_from_dmabuf (sink->dev, fd_copy); -+ fd = sink->fd; -+ -+ priv->bo = bo; -+ priv->fd = fd; -+ -+ if (create_fb (priv, sink)) { -+ GST_WARNING_OBJECT (sink, "could not create framebuffer: %s", -+ strerror (errno)); -+ g_free(priv); -+ return NULL; -+ } -+ -+ /* if fd not present, write to hash table fd and the corresponding priv. */ -+ g_hash_table_insert(sink->kmsbufferpriv, (gpointer)fd_copy, priv); -+ -+ -+ return priv; -+} -diff --git a/sys/kms/gstkmsbufferpriv.h b/sys/kms/gstkmsbufferpriv.h -new file mode 100644 -index 0000000..a1070da ---- /dev/null -+++ b/sys/kms/gstkmsbufferpriv.h -@@ -0,0 +1,64 @@ -+/* -+ * GStreamer -+ * -+ * Copyright (C) 2012 Texas Instruments -+ * Copyright (C) 2012 Collabora Ltd -+ * -+ * Authors: -+ * Alessandro Decina <alessandro.decina@collabora.co.uk> -+ * Rob Clark <rob.clark@linaro.org> -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation -+ * version 2.1 of the License. -+ * -+ * This library 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 -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef __GSTKMSBUFFERPRIV_H__ -+#define __GSTKMSBUFFERPRIV_H__ -+ -+#include <stdint.h> -+#include <gst/gst.h> -+ -+G_BEGIN_DECLS -+ -+/* -+ * per-buffer private data so kmssink can attach a drm_framebuffer -+ * handle (fb_id) to a buffer, which gets deleted when the buffer -+ * is finalized -+ */ -+ -+#define GST_TYPE_KMS_BUFFER_PRIV \ -+ (gst_kms_buffer_priv_get_type ()) -+#define GST_KMS_BUFFER_PRIV(obj) \ -+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_KMS_BUFFER_PRIV, GstKMSBufferPriv)) -+#define GST_IS_KMS_BUFFER_PRIV(obj) \ -+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_KMS_BUFFER_PRIV)) -+ -+ -+typedef struct -+{ -+ struct omap_bo *bo; -+ int fd; -+ uint32_t fb_id; -+}GstKMSBufferPriv; -+ -+ -+GType gst_kms_buffer_priv_get_type (void); -+ -+/* Returns a GstKMSBufferPriv, if it has a dmabuf fd metadata */ -+GstKMSBufferPriv * gst_kms_buffer_priv (GstKMSSink *sink, GstBuffer * buf); -+ -+G_END_DECLS -+ -+ -+#endif /* __GSTKMSBUFFERPRIV_H__ */ -diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c -new file mode 100644 -index 0000000..17e6407 ---- /dev/null -+++ b/sys/kms/gstkmssink.c -@@ -0,0 +1,740 @@ -+/* GStreamer -+ * Copyright (C) 2012 Texas Instruments -+ * Copyright (C) 2012 Collabora Ltd -+ * -+ * Authors: -+ * Alessandro Decina <alessandro.decina@collabora.co.uk> -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Library General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library 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 -+ * Library General Public License for more details. -+ * -+ * You should have received a copy of the GNU Library General Public -+ * License along with this library; if not, write to the -+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -+ * Boston, MA 02111-1307, USA. -+ * -+ * Authors: -+ * Alessandro Decina <alessandro.decina@collabora.co.uk> -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include "gstkmssink.h" -+#include "gstkmsbufferpriv.h" -+ -+#include <libdce.h> -+#include <omap_drm.h> -+#include <omap_drmif.h> -+#include <xf86drmMode.h> -+ -+static int drm_fd = -1; -+static struct omap_device *drm_dev; -+static int once =1; -+ -+GST_DEBUG_CATEGORY (gst_debug_kms_sink); -+#define GST_CAT_DEFAULT gst_debug_kms_sink -+ -+G_DEFINE_TYPE (GstKMSSink, gst_kms_sink, GST_TYPE_VIDEO_SINK); -+ -+static void gst_kms_sink_reset (GstKMSSink * sink); -+ -+static GstStaticPadTemplate gst_kms_sink_template_factory = -+GST_STATIC_PAD_TEMPLATE ("sink", -+ GST_PAD_SINK, -+ GST_PAD_ALWAYS, -+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE("NV12")) -+ ); -+ -+enum -+{ -+ PROP_0, -+ PROP_PIXEL_ASPECT_RATIO, -+ PROP_FORCE_ASPECT_RATIO, -+ PROP_SCALE, -+ PROP_CONNECTOR, -+ PROP_CONNECTOR_NAME, -+}; -+ -+ -+static inline void -+display_bufs_queue (GstKMSSink * sink, GstBuffer * buf) -+{ -+ int i; -+ for (i = 0; i < (NUM_DISPLAY_BUFS - 1); i++) -+ gst_buffer_replace (&sink->display_bufs[i], sink->display_bufs[i + 1]); -+ gst_buffer_replace (&sink->display_bufs[i], buf); -+} -+ -+static inline void -+display_bufs_free (GstKMSSink * sink) -+{ -+ int i; -+ for (i = 0; i < NUM_DISPLAY_BUFS; i++) -+ gst_buffer_replace (&sink->display_bufs[i], NULL); -+} -+ -+static gboolean -+gst_kms_sink_calculate_aspect_ratio (GstKMSSink * sink, gint width, -+ gint height, gint video_par_n, gint video_par_d) -+{ -+ guint calculated_par_n; -+ guint calculated_par_d; -+ -+ if (!gst_video_calculate_display_ratio (&calculated_par_n, &calculated_par_d, -+ width, height, video_par_n, video_par_d, 1, 1)) { -+ GST_ELEMENT_ERROR (sink, CORE, NEGOTIATION, (NULL), -+ ("Error calculating the output display ratio of the video.")); -+ return FALSE; -+ } -+ GST_DEBUG_OBJECT (sink, -+ "video width/height: %dx%d, calculated display ratio: %d/%d", -+ width, height, calculated_par_n, calculated_par_d); -+ -+ /* now find a width x height that respects this display ratio. -+ * prefer those that have one of w/h the same as the incoming video -+ * using wd / hd = calculated_pad_n / calculated_par_d */ -+ -+ /* start with same height, because of interlaced video */ -+ /* check hd / calculated_par_d is an integer scale factor, and scale wd with the PAR */ -+ if (height % calculated_par_d == 0) { -+ GST_DEBUG_OBJECT (sink, "keeping video height"); -+ GST_VIDEO_SINK_WIDTH (sink) = (guint) -+ gst_util_uint64_scale_int (height, calculated_par_n, calculated_par_d); -+ GST_VIDEO_SINK_HEIGHT (sink) = height; -+ } else if (width % calculated_par_n == 0) { -+ GST_DEBUG_OBJECT (sink, "keeping video width"); -+ GST_VIDEO_SINK_WIDTH (sink) = width; -+ GST_VIDEO_SINK_HEIGHT (sink) = (guint) -+ gst_util_uint64_scale_int (width, calculated_par_d, calculated_par_n); -+ } else { -+ GST_DEBUG_OBJECT (sink, "approximating while keeping video height"); -+ GST_VIDEO_SINK_WIDTH (sink) = (guint) -+ gst_util_uint64_scale_int (height, calculated_par_n, calculated_par_d); -+ GST_VIDEO_SINK_HEIGHT (sink) = height; -+ } -+ GST_DEBUG_OBJECT (sink, "scaling to %dx%d", -+ GST_VIDEO_SINK_WIDTH (sink), GST_VIDEO_SINK_HEIGHT (sink)); -+ -+ return TRUE; -+} -+ -+static gboolean -+gst_kms_sink_setcaps (GstBaseSink * bsink, GstCaps * caps) -+{ -+ GstKMSSink *sink; -+ gboolean ret = TRUE; -+ gint width, height; -+ gint fps_n, fps_d; -+ gint par_n, par_d; -+ GstVideoFormat format; -+ GstVideoInfo info; -+ GstStructure *conf; -+ GstStructure *s; -+ int size; -+ -+ sink = GST_KMS_SINK (bsink); -+ -+ ret = gst_video_info_from_caps (&info, caps); -+ format = GST_VIDEO_INFO_FORMAT(&info); -+ width = GST_VIDEO_INFO_WIDTH(&info); -+ height = GST_VIDEO_INFO_HEIGHT(&info); -+ fps_n = GST_VIDEO_INFO_FPS_N(&info); -+ fps_d = GST_VIDEO_INFO_FPS_D(&info); -+ par_n = GST_VIDEO_INFO_PAR_N(&info); -+ par_d = GST_VIDEO_INFO_PAR_D(&info); -+ -+ if (!ret) -+ return FALSE; -+ -+ if (width <= 0 || height <= 0) { -+ GST_ELEMENT_ERROR (sink, CORE, NEGOTIATION, (NULL), -+ ("Invalid image size.")); -+ return FALSE; -+ } -+ -+ sink->format = format; -+ sink->par_n = par_n; -+ sink->par_d = par_d; -+ sink->src_rect.x = sink->src_rect.y = 0; -+ sink->src_rect.w = width; -+ sink->src_rect.h = height; -+ sink->input_width = width; -+ sink->input_height = height; -+ size = info.size; -+ -+ if (!sink->pool) { -+ GstAllocator *allocator; -+ -+ allocator = gst_drm_allocator_get (); -+ sink->pool = gst_buffer_pool_new (); -+ conf = gst_buffer_pool_get_config (GST_BUFFER_POOL(sink->pool)); -+ gst_buffer_pool_config_set_params (conf, caps, size, 0, 0); -+ gst_buffer_pool_config_set_allocator (conf, allocator, NULL); -+ gst_buffer_pool_set_config (GST_BUFFER_POOL(sink->pool), conf); -+ if (allocator) -+ gst_object_unref (allocator); -+ } -+ -+ sink->conn.crtc = -1; -+ return TRUE; -+} -+ -+static void -+gst_kms_sink_get_times (GstBaseSink * bsink, GstBuffer * buf, -+ GstClockTime * start, GstClockTime * end) -+{ -+ GstKMSSink *sink; -+ -+ sink = GST_KMS_SINK (bsink); -+ -+ if (GST_BUFFER_PTS_IS_VALID (buf)) { -+ *start = GST_BUFFER_PTS (buf); -+ if (GST_BUFFER_DURATION_IS_VALID (buf)) { -+ *end = *start + GST_BUFFER_DURATION (buf); -+ } else { -+ if (sink->fps_n > 0) { -+ *end = *start + -+ gst_util_uint64_scale_int (GST_SECOND, sink->fps_d, sink->fps_n); -+ } -+ } -+ } -+} -+ -+ -+static void page_flip_handler(int fd, unsigned int frame, -+ unsigned int sec, unsigned int usec, void *data) -+{ -+ int *waiting_for_flip = data; -+ *waiting_for_flip = 0; -+} -+ -+ -+static GstFlowReturn -+gst_kms_sink_show_frame (GstVideoSink * vsink, GstBuffer * inbuf) -+{ -+ GstKMSSink *sink = GST_KMS_SINK (vsink); -+ GstBuffer *buf = NULL; -+ GstKMSBufferPriv *priv; -+ GstFlowReturn flow_ret = GST_FLOW_OK; -+ int ret = 0; -+ gint width, height; -+ GstVideoRectangle *c = &sink->src_rect; -+ int waiting_for_flip = 1; -+ -+ fd_set fds; -+ drmEventContext evctx = { -+ .version = DRM_EVENT_CONTEXT_VERSION, -+ .vblank_handler = 0, -+ .page_flip_handler = page_flip_handler, -+ }; -+ -+ g_mutex_lock (&sink->render_lock); -+ GstVideoCropMeta* crop = gst_buffer_get_video_crop_meta (inbuf); -+ if (crop){ -+ c->y = crop->y; -+ c->x = crop->x; -+ -+ if (crop->width >= 0) { -+ width = crop->width; -+ } else { -+ width = sink->input_width; -+ } -+ if (crop->height >= 0){ -+ height = crop->height; -+ } else { -+ height = sink->input_height; -+ } -+ } else { -+ width = sink->input_width; -+ height = sink->input_height; -+ } -+ -+ c->w = width; -+ c->h = height; -+ -+ -+ if (!gst_kms_sink_calculate_aspect_ratio (sink, width, height, -+ sink->par_n, sink->par_d)) -+ GST_DEBUG_OBJECT (sink, "calculate aspect ratio failed"); -+ -+ -+ GST_INFO_OBJECT (sink, "enter"); -+ -+ if (sink->conn.crtc == -1) { -+ if (sink->conn_name) { -+ if (!gst_drm_connector_find_mode_and_plane_by_name (sink->fd, -+ sink->dev, sink->src_rect.w, sink->src_rect.h, -+ sink->resources, sink->plane_resources, &sink->conn, -+ sink->conn_name)) -+ goto connector_not_found; -+ } else { -+ sink->conn.id = sink->conn_id; -+ if (!gst_drm_connector_find_mode_and_plane (sink->fd, -+ sink->dev, sink->src_rect.w, sink->src_rect.h, -+ sink->resources, sink->plane_resources, &sink->conn)) -+ goto connector_not_found; -+ } -+ once = 1; -+ } -+ -+ priv = gst_kms_buffer_priv (sink, inbuf); -+ -+ if (priv) { -+ buf = inbuf; -+ } else { -+ GST_LOG_OBJECT (sink, "not a KMS buffer, slow-path!"); -+ gst_buffer_pool_acquire_buffer (sink->pool, &buf, NULL); -+ if (buf) { -+ GST_BUFFER_PTS (buf) = GST_BUFFER_PTS (inbuf); -+ GST_BUFFER_DURATION (buf) = GST_BUFFER_DURATION (inbuf); -+ gst_buffer_copy_into (buf, inbuf, GST_BUFFER_COPY_DEEP, 0 ,-1); -+ priv = gst_kms_buffer_priv (sink, buf); -+ } -+ if (!priv) -+ goto add_fb2_failed; -+ } -+ -+ if (once) { -+ once = 0; -+ static GstVideoRectangle dest = { 0 }; -+ dest.w = sink->conn.mode->hdisplay; -+ dest.h = sink->conn.mode->vdisplay; -+ -+ gst_video_sink_center_rect (sink->src_rect, dest, &sink->dst_rect, -+ sink->scale); -+ ret = drmModeSetPlane (sink->fd, sink->conn.pdata[0].plane, -+ sink->conn.crtc, priv->fb_id, 0, -+ sink->dst_rect.x, sink->dst_rect.y, sink->dst_rect.w, sink->dst_rect.h, -+ sink->src_rect.x << 16, sink->src_rect.y << 16, -+ sink->src_rect.w << 16, sink->src_rect.h << 16); -+ if (ret) -+ goto set_plane_failed; -+ } -+ -+ drmModeAtomicReqPtr m_req = drmModeAtomicAlloc(); -+ -+ drmModeAtomicAddProperty(m_req, sink->conn.pdata[0].plane, -+ sink->conn.pdata[0].fb_id_property, -+ priv->fb_id); -+ -+ drmModeAtomicCommit(sink->fd, m_req, DRM_MODE_ATOMIC_TEST_ONLY, 0); -+ drmModeAtomicCommit(sink->fd, m_req, DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK, &waiting_for_flip); -+ drmModeAtomicFree(m_req); -+ -+ while (waiting_for_flip) { -+ FD_ZERO(&fds); -+ FD_SET(sink->fd, &fds); -+ int err; -+ err = select(sink->fd + 1, &fds, NULL, NULL, NULL); -+ if (err < 0) { -+ GST_ERROR_OBJECT (sink,"select err: %s\n", strerror(errno)); -+ flow_ret = GST_FLOW_ERROR; -+ goto out; -+ } -+ if (FD_ISSET(sink->fd, &fds)) { -+ drmHandleEvent(sink->fd, &evctx); -+ } -+ } -+ -+ display_bufs_queue (sink, buf); -+ -+out: -+ GST_INFO_OBJECT (sink, "exit"); -+ if (buf != inbuf) -+ gst_buffer_unref (buf); -+ g_mutex_unlock (&sink->render_lock); -+ return flow_ret; -+ -+add_fb2_failed: -+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, -+ (NULL), ("drmModeAddFB2 failed: %s (%d)", strerror (errno), errno)); -+ flow_ret = GST_FLOW_ERROR; -+ goto out; -+ -+set_plane_failed: -+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, -+ (NULL), ("drmModeSetPlane failed: %s (%d)", strerror (errno), errno)); -+ flow_ret = GST_FLOW_ERROR; -+ goto out; -+ -+connector_not_found: -+ GST_ELEMENT_ERROR (sink, RESOURCE, NOT_FOUND, -+ (NULL), ("connector not found", strerror (errno), errno)); -+ goto out; -+} -+ -+ -+static gboolean -+gst_kms_sink_event (GstBaseSink * bsink, GstEvent * event) -+{ -+ GstKMSSink *sink = GST_KMS_SINK (bsink); -+ -+ switch (GST_EVENT_TYPE (event)) { -+ default: -+ break; -+ } -+ if (GST_BASE_SINK_CLASS (gst_kms_sink_parent_class)->event) -+ return GST_BASE_SINK_CLASS (gst_kms_sink_parent_class)->event (bsink, -+ event); -+ else -+ return TRUE; -+} -+ -+static void -+gst_kms_sink_set_property (GObject * object, guint prop_id, -+ const GValue * value, GParamSpec * pspec) -+{ -+ GstKMSSink *sink; -+ -+ g_return_if_fail (GST_IS_KMS_SINK (object)); -+ -+ sink = GST_KMS_SINK (object); -+ -+ switch (prop_id) { -+ case PROP_FORCE_ASPECT_RATIO: -+ sink->keep_aspect = g_value_get_boolean (value); -+ break; -+ case PROP_SCALE: -+ sink->scale = g_value_get_boolean (value); -+ break; -+ case PROP_CONNECTOR: -+ sink->conn_id = g_value_get_uint (value); -+ break; -+ case PROP_CONNECTOR_NAME: -+ g_free (sink->conn_name); -+ sink->conn_name = g_strdup (g_value_get_string (value)); -+ break; -+ case PROP_PIXEL_ASPECT_RATIO: -+ { -+ GValue *tmp; -+ -+ tmp = g_new0 (GValue, 1); -+ g_value_init (tmp, GST_TYPE_FRACTION); -+ -+ if (!g_value_transform (value, tmp)) { -+ GST_WARNING_OBJECT (sink, "Could not transform string to aspect ratio"); -+ } else { -+ sink->par_n = gst_value_get_fraction_numerator (tmp); -+ sink->par_d = gst_value_get_fraction_denominator (tmp); -+ GST_DEBUG_OBJECT (sink, "set PAR to %d/%d", sink->par_n, sink->par_d); -+ } -+ g_free (tmp); -+ } -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+gst_kms_sink_get_property (GObject * object, guint prop_id, -+ GValue * value, GParamSpec * pspec) -+{ -+ GstKMSSink *sink; -+ -+ g_return_if_fail (GST_IS_KMS_SINK (object)); -+ -+ sink = GST_KMS_SINK (object); -+ -+ switch (prop_id) { -+ case PROP_FORCE_ASPECT_RATIO: -+ g_value_set_boolean (value, sink->keep_aspect); -+ break; -+ case PROP_SCALE: -+ g_value_set_boolean (value, sink->scale); -+ break; -+ case PROP_CONNECTOR: -+ g_value_set_uint (value, sink->conn.id); -+ break; -+ case PROP_PIXEL_ASPECT_RATIO: -+ { -+ char *v = g_strdup_printf ("%d/%d", sink->par_n, sink->par_d); -+ g_value_take_string (value, v); -+ break; -+ } -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+gst_kms_sink_reset (GstKMSSink * sink) -+{ -+ GST_DEBUG_OBJECT (sink, "reset"); -+ -+ if (sink->fd != -1) { -+ gst_drm_connector_cleanup (sink->fd, &sink->conn); -+ } -+ memset (&sink->conn, 0, sizeof (struct connector)); -+ -+ display_bufs_free (sink); -+ -+ if (sink->pool) { -+ gst_buffer_pool_set_active (GST_BUFFER_POOL(sink->pool), FALSE); -+ gst_object_unref(sink->pool); -+ sink->pool = NULL; -+ } -+ -+ if (sink->plane_resources) { -+ drmModeFreePlaneResources (sink->plane_resources); -+ sink->plane_resources = NULL; -+ } -+ -+ if (sink->resources) { -+ drmModeFreeResources (sink->resources); -+ sink->resources = NULL; -+ } -+ -+ sink->par_n = sink->par_d = 1; -+ sink->src_rect.x = 0; -+ sink->src_rect.y = 0; -+ sink->src_rect.w = 0; -+ sink->src_rect.h = 0; -+ sink->input_width = 0; -+ sink->input_height = 0; -+ sink->format = GST_VIDEO_FORMAT_UNKNOWN; -+ -+ memset (&sink->src_rect, 0, sizeof (GstVideoRectangle)); -+ memset (&sink->dst_rect, 0, sizeof (GstVideoRectangle)); -+} -+ -+static gboolean -+gst_kms_sink_start (GstBaseSink * bsink) -+{ -+ GstKMSSink *sink; -+ -+ sink = GST_KMS_SINK (bsink); -+ -+ drm_dev = dce_init (); -+ if (drm_dev == NULL) -+ goto device_failed; -+ else { -+ sink->dev = drm_dev; -+ sink->fd = dce_get_fd (); -+ drm_fd = dce_get_fd (); -+ } -+ -+ sink->resources = drmModeGetResources (sink->fd); -+ if (sink->resources == NULL) -+ goto resources_failed; -+ -+ sink->plane_resources = drmModeGetPlaneResources (sink->fd); -+ if (sink->plane_resources == NULL) -+ goto plane_resources_failed; -+ -+ return TRUE; -+ -+fail: -+ gst_kms_sink_reset (sink); -+ return FALSE; -+ -+device_failed: -+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, -+ (NULL), ("omap_device_new failed")); -+ goto fail; -+ -+resources_failed: -+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, -+ (NULL), ("drmModeGetResources failed: %s (%d)", strerror (errno), errno)); -+ goto fail; -+ -+plane_resources_failed: -+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED, -+ (NULL), ("drmModeGetPlaneResources failed: %s (%d)", -+ strerror (errno), errno)); -+ goto fail; -+} -+ -+static gboolean -+gst_kms_sink_stop (GstBaseSink * bsink) -+{ -+ GstKMSSink *sink; -+ -+ sink = GST_KMS_SINK (bsink); -+ gst_kms_sink_reset (sink); -+ -+ return TRUE; -+} -+ -+ -+static gboolean -+gst_kms_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query) -+{ -+ GstKMSSink *sink; -+ GstStructure *conf; -+ GstCaps *caps; -+ guint size; -+ gboolean need_pool; -+ GstStructure *s; -+ int num_buffers = 0; -+ -+ -+ sink = GST_KMS_SINK (bsink); -+ -+ GST_DEBUG_OBJECT (sink, "begin"); -+ -+ gst_query_parse_allocation (query, &caps, &need_pool); -+ -+ if (G_UNLIKELY (!caps)) { -+ GST_WARNING_OBJECT (sink, "have no caps, doing fallback allocation"); -+ return FALSE; -+ } -+ -+ if (need_pool) { -+ GstVideoInfo info; -+ -+ if (!gst_video_info_from_caps (&info, caps)) -+ goto invalid_caps; -+ -+ GST_LOG_OBJECT (sink, -+ "a bufferpool was requested with caps %" GST_PTR_FORMAT, caps); -+ -+ /* We already have a pool after set_caps */ -+ if (sink->pool) { -+ GstStructure *config; -+ int min,max; -+ config = gst_buffer_pool_get_config (sink->pool); -+ gst_buffer_pool_config_get_params (config, NULL, &size, &min, &max); -+ gst_structure_free (config); -+ -+ gst_query_add_allocation_pool (query, sink->pool, size, min, max); -+ gst_query_add_allocation_param (query, gst_drm_allocator_get (), NULL); -+ return TRUE; -+ } else { -+ GST_LOG_OBJECT (sink, "No bufferpool available"); -+ return FALSE; -+ } -+ } -+ -+ -+invalid_caps: -+ GST_DEBUG_OBJECT (sink, "invalid caps specified"); -+ return FALSE; -+} -+ -+static void -+gst_kms_sink_finalize (GObject * object) -+{ -+ GstKMSSink *sink; -+ -+ sink = GST_KMS_SINK (object); -+ g_mutex_clear (&sink->render_lock); -+ g_free (sink->conn_name); -+ if (sink->kmsbufferpriv){ -+ g_hash_table_destroy (sink->kmsbufferpriv); -+ sink->kmsbufferpriv = NULL; -+ gst_kms_sink_reset (sink); -+} -+ -+ G_OBJECT_CLASS (gst_kms_sink_parent_class)->finalize (object); -+} -+ -+static void -+kmsbufferpriv_free_func (GstKMSBufferPriv *priv) -+{ -+ drmModeRmFB (priv->fd, priv->fb_id); -+ omap_bo_del (priv->bo); -+ g_free(priv); -+} -+ -+ -+static void -+gst_kms_sink_init (GstKMSSink * sink) -+{ -+ sink->fd = -1; -+ gst_kms_sink_reset (sink); -+ sink->kmsbufferpriv = g_hash_table_new_full (g_direct_hash, g_direct_equal, -+ NULL, (GDestroyNotify) kmsbufferpriv_free_func); -+ g_mutex_init (&sink->render_lock); -+} -+ -+static void -+gst_kms_sink_class_init (GstKMSSinkClass * klass) -+{ -+ GObjectClass *gobject_class; -+ GstElementClass *gstelement_class; -+ GstBaseSinkClass *gstbasesink_class; -+ GstVideoSinkClass *videosink_class; -+ -+ gobject_class = (GObjectClass *) klass; -+ gstelement_class = (GstElementClass *) klass; -+ gstbasesink_class = (GstBaseSinkClass *) klass; -+ videosink_class = (GstVideoSinkClass *) klass; -+ -+ gobject_class->finalize = gst_kms_sink_finalize; -+ gobject_class->set_property = gst_kms_sink_set_property; -+ gobject_class->get_property = gst_kms_sink_get_property; -+ -+ g_object_class_install_property (gobject_class, PROP_FORCE_ASPECT_RATIO, -+ g_param_spec_boolean ("force-aspect-ratio", "Force aspect ratio", -+ "When enabled, reverse caps negotiation (scaling) will respect " -+ "original aspect ratio", FALSE, -+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -+ g_object_class_install_property (gobject_class, PROP_PIXEL_ASPECT_RATIO, -+ g_param_spec_string ("pixel-aspect-ratio", "Pixel Aspect Ratio", -+ "The pixel aspect ratio of the device", "1/1", -+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -+ g_object_class_install_property (gobject_class, PROP_SCALE, -+ g_param_spec_boolean ("scale", "Scale", -+ "When true, scale to render fullscreen", FALSE, -+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -+ g_object_class_install_property (gobject_class, PROP_CONNECTOR, -+ g_param_spec_uint ("connector", "Connector", -+ "DRM connector id (0 for automatic selection)", 0, G_MAXUINT32, 0, -+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT)); -+ g_object_class_install_property (gobject_class, PROP_CONNECTOR_NAME, -+ g_param_spec_string ("connector-name", "Connector name", -+ "DRM connector name (alternative to the connector property, " -+ "use $type$index, $type-$index, or $type)", "", -+ G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)); -+ -+ gst_element_class_set_details_simple (gstelement_class, -+ "Video sink", "Sink/Video", -+ "A video sink using the linux kernel mode setting API", -+ "Alessandro Decina <alessandro.d@gmail.com>"); -+ -+ gst_element_class_add_pad_template (gstelement_class, -+ gst_static_pad_template_get (&gst_kms_sink_template_factory)); -+ -+ gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_kms_sink_setcaps); -+ gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_kms_sink_get_times); -+ gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_kms_sink_event); -+ gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_kms_sink_start); -+ gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_kms_sink_stop); -+ gstbasesink_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_kms_sink_propose_allocation); -+ -+ /* disable preroll as it's called before GST_CROP_EVENT has been received, so -+ * we end up configuring the wrong mode... (based on padded caps) -+ */ -+ gstbasesink_class->preroll = NULL; -+ videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_kms_sink_show_frame); -+} -+ -+static gboolean -+plugin_init (GstPlugin * plugin) -+{ -+ if (!gst_element_register (plugin, "kmssink", -+ GST_RANK_PRIMARY + 1, GST_TYPE_KMS_SINK)) -+ return FALSE; -+ -+ GST_DEBUG_CATEGORY_INIT (gst_debug_kms_sink, "kmssink", 0, "kmssink element"); -+ -+ return TRUE; -+} -+ -+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, -+ GST_VERSION_MINOR, -+ kms, -+ "KMS video output element", -+ plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) -diff --git a/sys/kms/gstkmssink.h b/sys/kms/gstkmssink.h -new file mode 100644 -index 0000000..9f76839 ---- /dev/null -+++ b/sys/kms/gstkmssink.h -@@ -0,0 +1,92 @@ -+/* GStreamer -+ * -+ * Copyright (C) 2012 Texas Instruments -+ * Copyright (C) 2012 Collabora Ltd -+ * -+ * Authors: -+ * Alessandro Decina <alessandro.decina@collabora.co.uk> -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Library General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library 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 -+ * Library General Public License for more details. -+ * -+ * You should have received a copy of the GNU Library General Public -+ * License along with this library; if not, write to the -+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -+ * Boston, MA 02111-1307, USA. -+ */ -+ -+#ifndef __GST_KMS_SINK_H__ -+#define __GST_KMS_SINK_H__ -+ -+#include <gst/video/video.h> -+#include <gst/video/gstvideosink.h> -+#include <gst/drm/gstdrmallocator.h> -+ -+#include <stdio.h> -+#include <stdint.h> -+#include <stdlib.h> -+#include <string.h> -+#include <errno.h> -+#include <unistd.h> -+#include <assert.h> -+ -+#include "gstdrmutils.h" -+ -+G_BEGIN_DECLS -+#define GST_TYPE_KMS_SINK \ -+ (gst_kms_sink_get_type()) -+#define GST_KMS_SINK(obj) \ -+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_KMS_SINK, GstKMSSink)) -+#define GST_KMS_SINK_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_KMS_SINK, GstKMSSinkClass)) -+#define GST_IS_KMS_SINK(obj) \ -+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_KMS_SINK)) -+#define GST_IS_KMS_SINK_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_KMS_SINK)) -+typedef struct _GstKMSSink GstKMSSink; -+typedef struct _GstKMSSinkClass GstKMSSinkClass; -+ -+#define NUM_DISPLAY_BUFS 1 -+ -+struct _GstKMSSink -+{ -+ GstVideoSink videosink; -+ gint input_width, input_height; -+ GstVideoFormat format; -+ gint par_n, par_d; -+ gint fps_n, fps_d; -+ gboolean keep_aspect; -+ GstVideoRectangle src_rect; -+ GstVideoRectangle dst_rect; -+ int fd; -+ struct omap_device *dev; -+ drmModeRes *resources; -+ drmModePlaneRes *plane_resources; -+ struct connector conn; -+ uint32_t conn_id; -+ char *conn_name; -+ drmModePlane *plane; -+ GstBufferPool *pool; -+ GHashTable *kmsbufferpriv; -+ /* current displayed buffer and last displayed buffer: */ -+ GstBuffer *display_bufs[NUM_DISPLAY_BUFS]; -+ gboolean scale; -+ GMutex render_lock; -+}; -+ -+struct _GstKMSSinkClass -+{ -+ GstVideoSinkClass parent_class; -+}; -+ -+GType gst_kms_sink_get_type (void); -+ -+G_END_DECLS -+#endif /* __GST_KMS_SINK_H__ */ --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-kmssink-add-YUYV-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-kmssink-add-YUYV-support.patch deleted file mode 100644 index a57a0bbfa..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-kmssink-add-YUYV-support.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 11a3ff4b9451f12374006f853ef5736f5d098932 Mon Sep 17 00:00:00 2001 -From: Eric Ruei <e-ruei1@ti.com> -Date: Tue, 14 Mar 2017 17:24:07 -0400 -Subject: [PATCH 3/3] kmssink: add YUYV support - -Signed-off-by: Eric Ruei <e-ruei1@ti.com> ---- - sys/kms/gstkmsbufferpriv.c | 32 +++++++++++++++++++++++++++----- - sys/kms/gstkmssink.c | 2 +- - 2 files changed, 28 insertions(+), 6 deletions(-) - -diff --git a/sys/kms/gstkmsbufferpriv.c b/sys/kms/gstkmsbufferpriv.c -index 172a4c3..57c01f8 100644 ---- a/sys/kms/gstkmsbufferpriv.c -+++ b/sys/kms/gstkmsbufferpriv.c -@@ -41,22 +41,44 @@ - static int - create_fb (GstKMSBufferPriv * priv, GstKMSSink * sink) - { -+ - /* TODO get format, etc from caps.. and query device for - * supported formats, and make this all more flexible to - * cope with various formats: - */ -- uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); -- -+ GstVideoFormat format = sink->format; -+ uint32_t fourcc; - uint32_t handles[4] = { -- omap_bo_handle (priv->bo), omap_bo_handle (priv->bo), -+ omap_bo_handle (priv->bo), - }; - uint32_t pitches[4] = { -- GST_ROUND_UP_4 (sink->input_width), GST_ROUND_UP_4 (sink->input_width), -+ GST_ROUND_UP_4 (sink->input_width), - }; - uint32_t offsets[4] = { -- 0, pitches[0] * sink->input_height -+ 0, - }; - -+ /** -+ * Only two formats are supported: -+ * AM3/4: YUYV -+ * AM5: NV12, YUYV -+ */ -+ if(format == GST_VIDEO_FORMAT_YUY2) -+ { -+ /* YUYV */ -+ fourcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', 'V'); -+ pitches[0] = GST_ROUND_UP_4 (sink->input_width*2); -+ } -+ else -+ { -+ /* NV12 */ -+ fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); -+ handles[1] = omap_bo_handle (priv->bo); -+ pitches[1] = GST_ROUND_UP_4 (sink->input_width); -+ offsets[1] = pitches[0] * sink->input_height; -+ } -+ -+ - return drmModeAddFB2 (priv->fd, sink->input_width, sink->input_height, - fourcc, handles, pitches, offsets, &priv->fb_id, 0); - } -diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c -index 9795bdf..b36d88f 100644 ---- a/sys/kms/gstkmssink.c -+++ b/sys/kms/gstkmssink.c -@@ -50,7 +50,7 @@ static GstStaticPadTemplate gst_kms_sink_template_factory = - GST_STATIC_PAD_TEMPLATE ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, -- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE("NV12")) -+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE("{NV12,YUY2}")) - ); - - enum --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch deleted file mode 100644 index 2902bc3b2..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch +++ /dev/null @@ -1,1728 +0,0 @@ -From 78ddc83ebfe7cf69c62610e1f7d14e7f49bf65c9 Mon Sep 17 00:00:00 2001 -From: Pooja Prajod <a0132412@ti.com> -Date: Wed, 25 Jan 2017 17:09:35 +0530 -Subject: [gst-bad-1.8] gstwaylandsink: Add DRM support on waylandsink - -Add wl_drm interface on waylandsink. -The following features are supported: -1. Support for mouse drag and drop. -2. Support for video cropping - -The following bug fixes identified earlier have been picked: -1. Consolidate header files to avoid circular dependency -2. Fix bug reported on waylandsink incase of same process looping - -Signed-off-by: Pooja Prajod <a0132412@ti.com> ---- - configure.ac | 4 +- - ext/wayland/Makefile.am | 17 +- - ext/wayland/gstwaylandsink.c | 82 ++++++- - ext/wayland/gstwaylandsink.h | 4 +- - ext/wayland/wayland-drm-client-protocol.h | 213 ++++++++++++++++++ - ext/wayland/wayland-drm-protocol.c | 74 +++++++ - ext/wayland/wlbuffer.c | 2 +- - ext/wayland/wlbuffer.h | 67 ------ - ext/wayland/wldisplay-wlwindow-wlbuffer.h | 216 ++++++++++++++++++ - ext/wayland/wldisplay.c | 350 +++++++++++++++++++++++++++++- - ext/wayland/wldisplay.h | 84 ------- - ext/wayland/wldrm.c | 69 ++++++ - ext/wayland/wldrm.h | 3 + - ext/wayland/wlshmallocator.h | 2 +- - ext/wayland/wlvideoformat.c | 8 +- - ext/wayland/wlwindow.c | 47 +++- - ext/wayland/wlwindow.h | 84 ------- - 17 files changed, 1056 insertions(+), 270 deletions(-) - create mode 100644 ext/wayland/wayland-drm-client-protocol.h - create mode 100644 ext/wayland/wayland-drm-protocol.c - delete mode 100644 ext/wayland/wlbuffer.h - create mode 100644 ext/wayland/wldisplay-wlwindow-wlbuffer.h - delete mode 100644 ext/wayland/wldisplay.h - create mode 100644 ext/wayland/wldrm.c - create mode 100644 ext/wayland/wldrm.h - delete mode 100644 ext/wayland/wlwindow.h - -diff --git a/configure.ac b/configure.ac -index 9fdfbc7..76166cb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2172,8 +2172,10 @@ AG_GST_CHECK_FEATURE(DIRECTFB, [directfb], dfbvideosink , [ - dnl **** Wayland **** - translit(dnm, m, l) AM_CONDITIONAL(USE_WAYLAND, true) - AC_PATH_PROG([wayland_scanner], [wayland-scanner]) --AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland , [ -+AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland libdrm libdrm_omap, [ - PKG_CHECK_MODULES(WAYLAND, wayland-client >= 1.4.0, [ -+ AC_SUBST(DRM_CFLAGS) -+ AC_SUBST(DRM_LIBS) - if test "x$wayland_scanner" != "x"; then - HAVE_WAYLAND="yes" - else -diff --git a/ext/wayland/Makefile.am b/ext/wayland/Makefile.am -index c742bfc..eb6e326 100644 ---- a/ext/wayland/Makefile.am -+++ b/ext/wayland/Makefile.am -@@ -3,31 +3,34 @@ plugin_LTLIBRARIES = libgstwaylandsink.la - libgstwaylandsink_la_SOURCES = \ - gstwaylandsink.c \ - wlshmallocator.c \ -+ wldrm.c \ - wlbuffer.c \ - wldisplay.c \ - wlwindow.c \ - wlvideoformat.c \ -- scaler-protocol.c -+ scaler-protocol.c \ -+ wayland-drm-protocol.c - - libgstwaylandsink_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ -- $(WAYLAND_CFLAGS) $(GST_PLUGINS_BAD_CFLAGS) -+ $(WAYLAND_CFLAGS) $(GST_PLUGINS_BAD_CFLAGS) $(DRM_CFLAGS) - libgstwaylandsink_la_LIBADD = \ - $(GST_PLUGINS_BASE_LIBS) \ - -lgstvideo-$(GST_API_VERSION) \ - -lgstallocators-$(GST_API_VERSION) \ - $(WAYLAND_LIBS) \ -- $(top_builddir)/gst-libs/gst/wayland/libgstwayland-$(GST_API_VERSION).la -+ $(top_builddir)/gst-libs/gst/wayland/libgstwayland-$(GST_API_VERSION).la \ -+ $(top_builddir)/gst-libs/gst/drm/libgstdrm-$(GST_API_VERSION).la - libgstwaylandsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - libgstwaylandsink_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) - - noinst_HEADERS = \ - gstwaylandsink.h \ - wlshmallocator.h \ -- wlbuffer.h \ -- wldisplay.h \ -- wlwindow.h \ -+ wldisplay-wlwindow-wlbuffer.h \ -+ wldrm.h \ - wlvideoformat.h \ -- scaler-client-protocol.h -+ scaler-client-protocol.h \ -+ wayland-drm-client-protocol.h - - EXTRA_DIST = scaler.xml - CLEANFILES = scaler-protocol.c scaler-client-protocol.h -diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c -index f4f34a8..3e8ff19 100644 ---- a/ext/wayland/gstwaylandsink.c -+++ b/ext/wayland/gstwaylandsink.c -@@ -43,8 +43,14 @@ - - #include "gstwaylandsink.h" - #include "wlvideoformat.h" --#include "wlbuffer.h" - #include "wlshmallocator.h" -+#include "wldrm.h" -+ -+#include <gst/drm/gstdrmallocator.h> -+#include "wayland-drm-client-protocol.h" -+#include <omap_drm.h> -+#include <omap_drmif.h> -+#include <wayland-client.h> - - #include <gst/wayland/wayland.h> - #include <gst/video/videooverlay.h> -@@ -60,7 +66,8 @@ enum - enum - { - PROP_0, -- PROP_DISPLAY -+ PROP_DISPLAY, -+ PROP_ALLOCATION - }; - - GST_DEBUG_CATEGORY (gstwayland_debug); -@@ -75,6 +82,7 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", - "YUV9, YVU9, Y41B, I420, YV12, Y42B, v308 }")) - ); - -+ - static void gst_wayland_sink_get_property (GObject * object, - guint prop_id, GValue * value, GParamSpec * pspec); - static void gst_wayland_sink_set_property (GObject * object, -@@ -158,6 +166,11 @@ gst_wayland_sink_class_init (GstWaylandSinkClass * klass) - g_param_spec_string ("display", "Wayland Display name", "Wayland " - "display name to connect to, if not supplied via the GstContext", - NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -+ -+ g_object_class_install_property (gobject_class, PROP_ALLOCATION, -+ g_param_spec_boolean ("use-drm", "Wayland Allocation name", "Wayland " -+ "Use DRM based memory for allocation", -+ FALSE, G_PARAM_WRITABLE)); - } - - static void -@@ -197,6 +210,11 @@ gst_wayland_sink_set_property (GObject * object, - sink->display_name = g_value_dup_string (value); - GST_OBJECT_UNLOCK (sink); - break; -+ case PROP_ALLOCATION: -+ GST_OBJECT_LOCK (sink); -+ sink->use_drm = g_value_get_boolean (value); -+ GST_OBJECT_UNLOCK (sink); -+ break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; -@@ -281,6 +299,7 @@ gst_wayland_sink_find_display (GstWaylandSink * sink) - /* if the application didn't set a display, let's create it ourselves */ - GST_OBJECT_LOCK (sink); - sink->display = gst_wl_display_new (sink->display_name, &error); -+ sink->display->use_drm = sink->use_drm; - GST_OBJECT_UNLOCK (sink); - - if (error) { -@@ -408,7 +427,6 @@ gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter) - - caps = gst_caps_make_writable (caps); - gst_structure_set_value (gst_caps_get_structure (caps, 0), "format", &list); -- - GST_DEBUG_OBJECT (sink, "display caps: %" GST_PTR_FORMAT, caps); - } - -@@ -426,6 +444,18 @@ gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter) - return caps; - } - -+static void -+wait_authentication (GstWaylandSink * sink) -+{ -+ GST_DEBUG_OBJECT (sink, "Before wait aunthenticated value is %d : \n", sink->display->authenticated ); -+ while (!sink->display->authenticated) { -+ GST_DEBUG_OBJECT (sink, "waiting for authentication"); -+ wl_display_roundtrip (sink->display->display); -+ } -+ GST_DEBUG_OBJECT (sink, "After wait aunthenticated value is %d : \n", sink->display->authenticated ); -+} -+ -+ - static gboolean - gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) - { -@@ -436,11 +466,20 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) - GArray *formats; - gint i; - GstStructure *structure; -+ GstStructure *s; -+ gboolean use_drm = 0; -+ int num_buffers = 0; - - sink = GST_WAYLAND_SINK (bsink); - - GST_DEBUG_OBJECT (sink, "set caps %" GST_PTR_FORMAT, caps); - -+ wait_authentication (sink); -+ -+ while (!sink->display->authenticated) { -+ GST_DEBUG_OBJECT (sink, "not authenticated yet"); -+ } -+ - /* extract info from caps */ - if (!gst_video_info_from_caps (&info, caps)) - goto invalid_format; -@@ -460,14 +499,27 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) - goto unsupported_format; - - /* create a new pool for the new configuration */ -- newpool = gst_video_buffer_pool_new (); -+ -+ s = gst_caps_get_structure (caps, 0); -+ gst_structure_get_boolean (s, "drm_mem", &use_drm); -+ gst_structure_get_int (s, "max-ref-frames", &num_buffers); -+ if (num_buffers ) -+ num_buffers = num_buffers + 2; -+ -+ newpool = gst_buffer_pool_new (); - if (!newpool) - goto pool_failed; - - structure = gst_buffer_pool_get_config (newpool); -- gst_buffer_pool_config_set_params (structure, caps, info.size, 2, 0); -- gst_buffer_pool_config_set_allocator (structure, gst_wl_shm_allocator_get (), -- NULL); -+ gst_buffer_pool_config_set_params (structure, caps, info.size, 2, num_buffers); -+ if ( use_drm ) { -+ gst_buffer_pool_config_set_allocator (structure, gst_drm_allocator_get (), -+ NULL); -+ sink->display->use_drm = TRUE; -+ } else { -+ gst_buffer_pool_config_set_allocator (structure, gst_wl_shm_allocator_get (), -+ NULL); -+ } - if (!gst_buffer_pool_set_config (newpool, structure)) - goto config_failed; - -@@ -518,8 +570,11 @@ gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query) - /* we do have a pool for sure (created in set_caps), - * so let's propose it anyway, but also propose the allocator on its own */ - gst_query_add_allocation_pool (query, sink->pool, size, min_bufs, max_bufs); -- gst_query_add_allocation_param (query, gst_wl_shm_allocator_get (), NULL); -- -+ if (sink->display->use_drm) { -+ gst_query_add_allocation_param (query, gst_drm_allocator_get (), NULL); -+ } else { -+ gst_query_add_allocation_param (query, gst_wl_shm_allocator_get (), NULL); -+ } - gst_structure_free (config); - - return TRUE; -@@ -582,6 +637,10 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer) - - GST_LOG_OBJECT (sink, "render buffer %p", buffer); - -+ if (sink->display) { -+ sink->display->crop = gst_buffer_get_video_crop_meta (buffer); -+ } -+ - if (G_UNLIKELY (!sink->window)) { - /* ask for window handle. Unlock render_lock while doing that because - * set_window_handle & friends will lock it in this context */ -@@ -623,6 +682,11 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer) - wbuf = gst_wl_shm_memory_construct_wl_buffer (mem, sink->display, - &sink->video_info); - } -+ -+ if (gst_is_drm_memory (mem)) { -+ wbuf = gst_wl_drm_memory_construct_wl_buffer (mem, sink->display, -+ &sink->video_info); -+ } - - if (wbuf) { - gst_buffer_add_wl_buffer (buffer, wbuf, sink->display); -diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h -index afbed40..c1092ce 100644 ---- a/ext/wayland/gstwaylandsink.h -+++ b/ext/wayland/gstwaylandsink.h -@@ -27,8 +27,7 @@ - - #include <wayland-client.h> - --#include "wldisplay.h" --#include "wlwindow.h" -+#include "wldisplay-wlwindow-wlbuffer.h" - - G_BEGIN_DECLS - -@@ -61,6 +60,7 @@ struct _GstWaylandSink - GstVideoInfo video_info; - - gchar *display_name; -+ gboolean use_drm; - - gboolean redraw_pending; - GMutex render_lock; -diff --git a/ext/wayland/wayland-drm-client-protocol.h b/ext/wayland/wayland-drm-client-protocol.h -new file mode 100644 -index 0000000..7ddb614 ---- /dev/null -+++ b/ext/wayland/wayland-drm-client-protocol.h -@@ -0,0 +1,213 @@ -+/* -+ * Copyright © 2008-2011 Kristian Høgsberg -+ * Copyright © 2010-2011 Intel Corporation -+ * -+ * Permission to use, copy, modify, distribute, and sell this -+ * software and its documentation for any purpose is hereby granted -+ * without fee, provided that\n 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. -+ */ -+ -+#ifndef DRM_CLIENT_PROTOCOL_H -+#define DRM_CLIENT_PROTOCOL_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include <stdint.h> -+#include <stddef.h> -+#include "wayland-util.h" -+ -+struct wl_client; -+struct wl_resource; -+ -+struct wl_drm; -+ -+extern const struct wl_interface wl_drm_interface; -+ -+#ifndef WL_DRM_ERROR_ENUM -+#define WL_DRM_ERROR_ENUM -+enum wl_drm_error { -+ WL_DRM_ERROR_AUTHENTICATE_FAIL = 0, -+ WL_DRM_ERROR_INVALID_FORMAT = 1, -+ WL_DRM_ERROR_INVALID_NAME = 2, -+}; -+#endif /* WL_DRM_ERROR_ENUM */ -+ -+#ifndef WL_DRM_FORMAT_ENUM -+#define WL_DRM_FORMAT_ENUM -+enum wl_drm_format { -+ WL_DRM_FORMAT_C8 = 0x20203843, -+ WL_DRM_FORMAT_RGB332 = 0x38424752, -+ WL_DRM_FORMAT_BGR233 = 0x38524742, -+ WL_DRM_FORMAT_XRGB4444 = 0x32315258, -+ WL_DRM_FORMAT_XBGR4444 = 0x32314258, -+ WL_DRM_FORMAT_RGBX4444 = 0x32315852, -+ WL_DRM_FORMAT_BGRX4444 = 0x32315842, -+ WL_DRM_FORMAT_ARGB4444 = 0x32315241, -+ WL_DRM_FORMAT_ABGR4444 = 0x32314241, -+ WL_DRM_FORMAT_RGBA4444 = 0x32314152, -+ WL_DRM_FORMAT_BGRA4444 = 0x32314142, -+ WL_DRM_FORMAT_XRGB1555 = 0x35315258, -+ WL_DRM_FORMAT_XBGR1555 = 0x35314258, -+ WL_DRM_FORMAT_RGBX5551 = 0x35315852, -+ WL_DRM_FORMAT_BGRX5551 = 0x35315842, -+ WL_DRM_FORMAT_ARGB1555 = 0x35315241, -+ WL_DRM_FORMAT_ABGR1555 = 0x35314241, -+ WL_DRM_FORMAT_RGBA5551 = 0x35314152, -+ WL_DRM_FORMAT_BGRA5551 = 0x35314142, -+ WL_DRM_FORMAT_RGB565 = 0x36314752, -+ WL_DRM_FORMAT_BGR565 = 0x36314742, -+ WL_DRM_FORMAT_RGB888 = 0x34324752, -+ WL_DRM_FORMAT_BGR888 = 0x34324742, -+ WL_DRM_FORMAT_XRGB8888 = 0x34325258, -+ WL_DRM_FORMAT_XBGR8888 = 0x34324258, -+ WL_DRM_FORMAT_RGBX8888 = 0x34325852, -+ WL_DRM_FORMAT_BGRX8888 = 0x34325842, -+ WL_DRM_FORMAT_ARGB8888 = 0x34325241, -+ WL_DRM_FORMAT_ABGR8888 = 0x34324241, -+ WL_DRM_FORMAT_RGBA8888 = 0x34324152, -+ WL_DRM_FORMAT_BGRA8888 = 0x34324142, -+ WL_DRM_FORMAT_XRGB2101010 = 0x30335258, -+ WL_DRM_FORMAT_XBGR2101010 = 0x30334258, -+ WL_DRM_FORMAT_RGBX1010102 = 0x30335852, -+ WL_DRM_FORMAT_BGRX1010102 = 0x30335842, -+ WL_DRM_FORMAT_ARGB2101010 = 0x30335241, -+ WL_DRM_FORMAT_ABGR2101010 = 0x30334241, -+ WL_DRM_FORMAT_RGBA1010102 = 0x30334152, -+ WL_DRM_FORMAT_BGRA1010102 = 0x30334142, -+ WL_DRM_FORMAT_YUYV = 0x56595559, -+ WL_DRM_FORMAT_YVYU = 0x55595659, -+ WL_DRM_FORMAT_UYVY = 0x59565955, -+ WL_DRM_FORMAT_VYUY = 0x59555956, -+ WL_DRM_FORMAT_AYUV = 0x56555941, -+ WL_DRM_FORMAT_NV12 = 0x3231564e, -+ WL_DRM_FORMAT_NV21 = 0x3132564e, -+ WL_DRM_FORMAT_NV16 = 0x3631564e, -+ WL_DRM_FORMAT_NV61 = 0x3136564e, -+ WL_DRM_FORMAT_YUV410 = 0x39565559, -+ WL_DRM_FORMAT_YVU410 = 0x39555659, -+ WL_DRM_FORMAT_YUV411 = 0x31315559, -+ WL_DRM_FORMAT_YVU411 = 0x31315659, -+ WL_DRM_FORMAT_YUV420 = 0x32315559, -+ WL_DRM_FORMAT_YVU420 = 0x32315659, -+ WL_DRM_FORMAT_YUV422 = 0x36315559, -+ WL_DRM_FORMAT_YVU422 = 0x36315659, -+ WL_DRM_FORMAT_YUV444 = 0x34325559, -+ WL_DRM_FORMAT_YVU444 = 0x34325659, -+}; -+#endif /* WL_DRM_FORMAT_ENUM */ -+ -+struct wl_drm_listener { -+ /** -+ * device - (none) -+ * @name: (none) -+ */ -+ void (*device)(void *data, -+ struct wl_drm *wl_drm, -+ const char *name); -+ /** -+ * format - (none) -+ * @format: (none) -+ */ -+ void (*format)(void *data, -+ struct wl_drm *wl_drm, -+ uint32_t format); -+ /** -+ * authenticated - (none) -+ */ -+ void (*authenticated)(void *data, -+ struct wl_drm *wl_drm); -+}; -+ -+static inline int -+wl_drm_add_listener(struct wl_drm *wl_drm, -+ const struct wl_drm_listener *listener, void *data) -+{ -+ return wl_proxy_add_listener((struct wl_proxy *) wl_drm, -+ (void (**)(void)) listener, data); -+} -+ -+#define WL_DRM_AUTHENTICATE 0 -+#define WL_DRM_CREATE_BUFFER 1 -+#define WL_DRM_CREATE_PLANAR_BUFFER 2 -+ -+static inline void -+wl_drm_set_user_data(struct wl_drm *wl_drm, void *user_data) -+{ -+ wl_proxy_set_user_data((struct wl_proxy *) wl_drm, user_data); -+} -+ -+static inline void * -+wl_drm_get_user_data(struct wl_drm *wl_drm) -+{ -+ return wl_proxy_get_user_data((struct wl_proxy *) wl_drm); -+} -+ -+static inline void -+wl_drm_destroy(struct wl_drm *wl_drm) -+{ -+ wl_proxy_destroy((struct wl_proxy *) wl_drm); -+} -+ -+static inline void -+wl_drm_authenticate(struct wl_drm *wl_drm, uint32_t id) -+{ -+ wl_proxy_marshal((struct wl_proxy *) wl_drm, -+ WL_DRM_AUTHENTICATE, id); -+} -+ -+static inline struct wl_buffer * -+wl_drm_create_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t stride, uint32_t format) -+{ -+ struct wl_proxy *id; -+ -+ id = wl_proxy_create((struct wl_proxy *) wl_drm, -+ &wl_buffer_interface); -+ if (!id) -+ return NULL; -+ -+ wl_proxy_marshal((struct wl_proxy *) wl_drm, -+ WL_DRM_CREATE_BUFFER, id, name, width, height, stride, format); -+ -+ return (struct wl_buffer *) id; -+} -+ -+static inline struct wl_buffer * -+wl_drm_create_planar_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2) -+{ -+ struct wl_proxy *id; -+ -+ id = wl_proxy_create((struct wl_proxy *) wl_drm, -+ &wl_buffer_interface); -+ if (!id) -+ return NULL; -+ -+ wl_proxy_marshal((struct wl_proxy *) wl_drm, -+ WL_DRM_CREATE_PLANAR_BUFFER, id, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2); -+ -+ return (struct wl_buffer *) id; -+} -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff --git a/ext/wayland/wayland-drm-protocol.c b/ext/wayland/wayland-drm-protocol.c -new file mode 100644 -index 0000000..939af53 ---- /dev/null -+++ b/ext/wayland/wayland-drm-protocol.c -@@ -0,0 +1,74 @@ -+/* -+ * Copyright © 2008-2011 Kristian Høgsberg -+ * Copyright © 2010-2011 Intel Corporation -+ * -+ * Permission to use, copy, modify, distribute, and sell this -+ * software and its documentation for any purpose is hereby granted -+ * without fee, provided that\n 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 <stdlib.h> -+#include <stdint.h> -+#include "wayland-util.h" -+ -+#define ARRAY_LENGTH(a) (sizeof (a) /sizeof (a)[0]) -+ -+extern const struct wl_interface wl_buffer_interface; -+extern const struct wl_interface wl_buffer_interface; -+ -+static const struct wl_interface *types[] = { -+ NULL, -+ &wl_buffer_interface, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ &wl_buffer_interface, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+}; -+ -+static const struct wl_message wl_drm_requests[] = { -+ { "authenticate", "u", types + 0 }, -+ { "create_buffer", "nuiiuu", types + 1 }, -+ { "create_planar_buffer", "nuiiuiiiiii", types + 7 }, -+}; -+ -+static const struct wl_message wl_drm_events[] = { -+ { "device", "s", types + 0 }, -+ { "format", "u", types + 0 }, -+ { "authenticated", "", types + 0 }, -+}; -+ -+WL_EXPORT const struct wl_interface wl_drm_interface = { -+ "wl_drm", 1, -+ ARRAY_LENGTH(wl_drm_requests), wl_drm_requests, -+ ARRAY_LENGTH(wl_drm_events), wl_drm_events, -+}; -+ -diff --git a/ext/wayland/wlbuffer.c b/ext/wayland/wlbuffer.c -index 4ac99ef..0e38d2e 100644 ---- a/ext/wayland/wlbuffer.c -+++ b/ext/wayland/wlbuffer.c -@@ -76,7 +76,7 @@ - * as soon as we remove the reference that GstWlDisplay holds. - */ - --#include "wlbuffer.h" -+#include "wldisplay-wlwindow-wlbuffer.h" - - GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug); - #define GST_CAT_DEFAULT gstwayland_debug -diff --git a/ext/wayland/wlbuffer.h b/ext/wayland/wlbuffer.h -deleted file mode 100644 -index cbb50f7..0000000 ---- a/ext/wayland/wlbuffer.h -+++ /dev/null -@@ -1,67 +0,0 @@ --/* GStreamer Wayland video sink -- * -- * Copyright (C) 2014 Collabora Ltd. -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the Free -- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA. -- */ -- --#ifndef __GST_WL_BUFFER_H__ --#define __GST_WL_BUFFER_H__ -- --#include "wldisplay.h" -- --G_BEGIN_DECLS -- --#define GST_TYPE_WL_BUFFER (gst_wl_buffer_get_type ()) --#define GST_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_BUFFER, GstWlBuffer)) --#define GST_IS_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_BUFFER)) --#define GST_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_BUFFER, GstWlBufferClass)) --#define GST_IS_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_BUFFER)) --#define GST_WL_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_BUFFER, GstWlBufferClass)) -- --typedef struct _GstWlBuffer GstWlBuffer; --typedef struct _GstWlBufferClass GstWlBufferClass; -- --struct _GstWlBuffer --{ -- GObject parent_instance; -- -- struct wl_buffer * wlbuffer; -- GstBuffer *gstbuffer; -- -- GstWlDisplay *display; -- -- gboolean used_by_compositor; --}; -- --struct _GstWlBufferClass --{ -- GObjectClass parent_class; --}; -- --GType gst_wl_buffer_get_type (void); -- --GstWlBuffer * gst_buffer_add_wl_buffer (GstBuffer * gstbuffer, -- struct wl_buffer * wlbuffer, GstWlDisplay * display); --GstWlBuffer * gst_buffer_get_wl_buffer (GstBuffer * gstbuffer); -- --void gst_wl_buffer_force_release_and_unref (GstWlBuffer * self); -- --void gst_wl_buffer_attach (GstWlBuffer * self, struct wl_surface *surface); -- --G_END_DECLS -- --#endif /* __GST_WL_BUFFER_H__ */ -diff --git a/ext/wayland/wldisplay-wlwindow-wlbuffer.h b/ext/wayland/wldisplay-wlwindow-wlbuffer.h -new file mode 100644 -index 0000000..684d145 ---- /dev/null -+++ b/ext/wayland/wldisplay-wlwindow-wlbuffer.h -@@ -0,0 +1,216 @@ -+/* GStreamer Wayland video sink -+ * -+ * Copyright (C) 2014 Collabora Ltd. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Library General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library 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 -+ * Library General Public License for more details. -+ * -+ * You should have received a copy of the GNU Library General Public -+ * License along with this library; if not, write to the Free -+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -+ * Boston, MA 02110-1301 USA. -+ */ -+ -+#ifndef __GST_WL_DISPLAY_WL_WINDOW_H__ -+#define __GST_WL_DISPLAY_WL_WINDOW_H__ -+ -+#include <gst/gst.h> -+#include <stdlib.h> -+#include <stdio.h> -+#include <wayland-client.h> -+#include "scaler-client-protocol.h" -+#include <gst/video/video.h> -+#include <gst/video/gstvideometa.h> -+ -+G_BEGIN_DECLS -+ -+#define GST_TYPE_WL_DISPLAY (gst_wl_display_get_type ()) -+#define GST_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplay)) -+#define GST_IS_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_DISPLAY)) -+#define GST_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_DISPLAY, GstWlDisplayClass)) -+#define GST_IS_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_DISPLAY)) -+#define GST_WL_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplayClass)) -+ -+#define GST_TYPE_WL_WINDOW (gst_wl_window_get_type ()) -+#define GST_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_WINDOW, GstWlWindow)) -+#define GST_IS_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_WINDOW)) -+#define GST_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_WINDOW, GstWlWindowClass)) -+#define GST_IS_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_WINDOW)) -+#define GST_WL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_WINDOW, GstWlWindowClass)) -+ -+#define GST_TYPE_WL_BUFFER (gst_wl_buffer_get_type ()) -+#define GST_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_BUFFER, GstWlBuffer)) -+#define GST_IS_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_BUFFER)) -+#define GST_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_BUFFER, GstWlBufferClass)) -+#define GST_IS_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_BUFFER)) -+#define GST_WL_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_BUFFER, GstWlBufferClass)) -+ -+typedef struct _GstWlBuffer GstWlBuffer; -+typedef struct _GstWlBufferClass GstWlBufferClass; -+ -+typedef struct _GstWlWindow GstWlWindow; -+typedef struct _GstWlWindowClass GstWlWindowClass; -+ -+typedef struct _GstWlDisplay GstWlDisplay; -+typedef struct _GstWlDisplayClass GstWlDisplayClass; -+ -+struct _GstWlBuffer -+{ -+ GObject parent_instance; -+ -+ struct wl_buffer * wlbuffer; -+ GstBuffer *gstbuffer; -+ -+ GstWlDisplay *display; -+ -+ gboolean used_by_compositor; -+}; -+ -+struct _GstWlBufferClass -+{ -+ GObjectClass parent_class; -+}; -+ -+GType gst_wl_buffer_get_type (void); -+ -+GstWlBuffer * gst_buffer_add_wl_buffer (GstBuffer * gstbuffer, -+ struct wl_buffer * wlbuffer, GstWlDisplay * display); -+GstWlBuffer * gst_buffer_get_wl_buffer (GstBuffer * gstbuffer); -+ -+void gst_wl_buffer_force_release_and_unref (GstWlBuffer * self); -+ -+void gst_wl_buffer_attach (GstWlBuffer * self, struct wl_surface *surface); -+ -+ -+struct touch_point -+{ -+ int32_t id; -+ struct wl_list link; -+}; -+ -+struct input -+{ -+ GstWlDisplay *display; -+ struct wl_seat *seat; -+ struct wl_pointer *pointer; -+ struct wl_touch *touch; -+ struct wl_list touch_point_list; -+ GstWlWindow *pointer_focus; -+ GstWlWindow *touch_focus; -+ struct wl_list link; -+ GstWlWindow *grab; -+}; -+ -+ -+struct _GstWlWindow -+{ -+ GObject parent_instance; -+ -+ GstWlDisplay *display; -+ struct wl_surface *area_surface; -+ struct wl_subsurface *area_subsurface; -+ struct wl_viewport *area_viewport; -+ struct wl_surface *video_surface; -+ struct wl_subsurface *video_subsurface; -+ struct wl_viewport *video_viewport; -+ struct wl_shell_surface *shell_surface; -+ -+ /* the size and position of the area_(sub)surface */ -+ GstVideoRectangle render_rectangle; -+ /* the size of the video in the buffers */ -+ gint video_width, video_height; -+ /* the size of the video_(sub)surface */ -+ gint surface_width, surface_height; -+}; -+ -+struct _GstWlWindowClass -+{ -+ GObjectClass parent_class; -+}; -+ -+GType gst_wl_window_get_type (void); -+ -+GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display, -+ const GstVideoInfo * info); -+GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display, -+ struct wl_surface * parent); -+ -+GstWlDisplay *gst_wl_window_get_display (GstWlWindow * window); -+struct wl_surface *gst_wl_window_get_wl_surface (GstWlWindow * window); -+gboolean gst_wl_window_is_toplevel (GstWlWindow *window); -+ -+void gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer, -+ const GstVideoInfo * info); -+void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, -+ gint w, gint h); -+ -+ -+struct _GstWlDisplay -+{ -+ GObject parent_instance; -+ -+ /* public objects */ -+ struct wl_display *display; -+ struct wl_event_queue *queue; -+ -+ /* globals */ -+ struct wl_registry *registry; -+ struct wl_compositor *compositor; -+ struct wl_subcompositor *subcompositor; -+ struct wl_shell *shell; -+ struct wl_shm *shm; -+ struct wl_drm *drm; -+ struct wl_scaler *scaler; -+ GArray *shm_formats; -+ -+ /* private */ -+ gboolean own_display; -+ GThread *thread; -+ GstPoll *wl_fd_poll; -+ -+ GMutex buffers_mutex; -+ GHashTable *buffers; -+ gboolean shutting_down; -+ -+ /* the drm device.. needed for sharing direct-render buffers.. -+ * TODO nothing about this should really be omapdrm specific. But some -+ * of the code, like hashtable of imported buffers in libdrm_omap should -+ * be refactored out into some generic libdrm code.. -+ */ -+ struct omap_device *dev; -+ int fd; -+ int authenticated; -+ gboolean use_drm; -+ -+ struct wl_list input_list; -+ int seat_version; -+ uint32_t serial; -+ -+ GstVideoCropMeta *crop; -+}; -+ -+struct _GstWlDisplayClass -+{ -+ GObjectClass parent_class; -+}; -+ -+GType gst_wl_display_get_type (void); -+ -+GstWlDisplay *gst_wl_display_new (const gchar * name, GError ** error); -+GstWlDisplay *gst_wl_display_new_existing (struct wl_display * display, -+ gboolean take_ownership, GError ** error); -+ -+/* see wlbuffer.c for explanation */ -+void gst_wl_display_register_buffer (GstWlDisplay * self, gpointer buf); -+void gst_wl_display_unregister_buffer (GstWlDisplay * self, gpointer buf); -+ -+G_END_DECLS -+ -+#endif /* __GST_WL_DISPLAY_WL_WINDOW_H__ */ -diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c -index 3318095..2f58fd2 100644 ---- a/ext/wayland/wldisplay.c -+++ b/ext/wayland/wldisplay.c -@@ -22,9 +22,15 @@ - #include <config.h> - #endif - --#include "wldisplay.h" --#include "wlbuffer.h" -- -+#include "wldisplay-wlwindow-wlbuffer.h" -+ -+#include <wayland-client-protocol.h> -+#include "wayland-drm-client-protocol.h" -+#include <linux/input.h> -+#include <omap_drm.h> -+#include <omap_drmif.h> -+#include <fcntl.h> -+#include <unistd.h> - #include <errno.h> - - GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug); -@@ -33,6 +39,8 @@ GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug); - G_DEFINE_TYPE (GstWlDisplay, gst_wl_display, G_TYPE_OBJECT); - - static void gst_wl_display_finalize (GObject * gobject); -+static void input_grab (struct input *input, GstWlWindow *window); -+static void input_ungrab (struct input *input); - - static void - gst_wl_display_class_init (GstWlDisplayClass * klass) -@@ -45,12 +53,62 @@ static void - gst_wl_display_init (GstWlDisplay * self) - { - self->shm_formats = g_array_new (FALSE, FALSE, sizeof (uint32_t)); -+ self->fd = -1; -+ self->use_drm = FALSE; - self->wl_fd_poll = gst_poll_new (TRUE); - self->buffers = g_hash_table_new (g_direct_hash, g_direct_equal); - g_mutex_init (&self->buffers_mutex); - } - - static void -+input_grab (struct input *input, GstWlWindow *window) -+{ -+ input->grab = window; -+} -+ -+static void -+input_ungrab (struct input *input) -+{ -+ input->grab = NULL; -+} -+ -+static void -+input_remove_pointer_focus (struct input *input) -+{ -+ GstWlWindow *window = input->pointer_focus; -+ -+ if (!window) -+ return; -+ -+ input->pointer_focus = NULL; -+} -+ -+static void -+input_destroy (struct input *input) -+{ -+ input_remove_pointer_focus (input); -+ -+ if (input->display->seat_version >= 3) { -+ if (input->pointer) -+ wl_pointer_release (input->pointer); -+ } -+ -+ wl_list_remove (&input->link); -+ wl_seat_destroy (input->seat); -+ free (input); -+} -+ -+static void -+display_destroy_inputs (GstWlDisplay *display) -+{ -+ struct input *tmp; -+ struct input *input; -+ -+ wl_list_for_each_safe (input, tmp, &display->input_list, link) -+ input_destroy (input); -+} -+ -+static void - gst_wl_display_finalize (GObject * gobject) - { - GstWlDisplay *self = GST_WL_DISPLAY (gobject); -@@ -71,13 +129,26 @@ gst_wl_display_finalize (GObject * gobject) - g_hash_table_remove_all (self->buffers); - - g_array_unref (self->shm_formats); -+ -+ if (self->dev) { -+ omap_device_del (self->dev); -+ self->dev = NULL; -+ } -+ if (self->fd !=-1) -+ close (self->fd); -+ - gst_poll_free (self->wl_fd_poll); - g_hash_table_unref (self->buffers); - g_mutex_clear (&self->buffers_mutex); - -+ display_destroy_inputs (self); -+ - if (self->shm) - wl_shm_destroy (self->shm); - -+ if (self->drm) -+ wl_drm_destroy (self->drm); -+ - if (self->shell) - wl_shell_destroy (self->shell); - -@@ -138,12 +209,277 @@ shm_format (void *data, struct wl_shm *wl_shm, uint32_t format) - GstWlDisplay *self = data; - - g_array_append_val (self->shm_formats, format); -+ GST_DEBUG ("shm got format: %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (format)); - } - - static const struct wl_shm_listener shm_listener = { - shm_format - }; - -+/* For wl_drm_listener */ -+ -+static void -+drm_handle_device (void *data, struct wl_drm *drm, const char *device) -+{ -+ GstWlDisplay *d = data; -+ drm_magic_t magic; -+ d->fd = open (device, O_RDWR | O_CLOEXEC); -+ if (d->fd == -1) { -+ GST_ERROR ("could not open %s: %m", device); -+ return; -+ } -+ drmGetMagic (d->fd, &magic); -+ wl_drm_authenticate (d->drm, magic); -+} -+ -+static void -+drm_handle_format (void *data, struct wl_drm *drm, uint32_t format) -+{ -+ GstWlDisplay *self = data; -+ g_array_append_val (self->shm_formats, format); -+ GST_DEBUG ("drm got format: %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (format)); -+} -+ -+static void -+drm_handle_authenticated (void *data, struct wl_drm *drm) -+{ -+ GstWlDisplay *d = data; -+ GST_DEBUG ("authenticated"); -+ d->dev = omap_device_new (d->fd); -+ d->authenticated = 1; -+ GST_DEBUG ("drm_handle_authenticated: dev: %p, d->authenticated: %d\n", -+ d->dev, d->authenticated); -+} -+ -+static const struct wl_drm_listener drm_listener = { -+ drm_handle_device, -+ drm_handle_format, -+ drm_handle_authenticated -+}; -+ -+ -+static void -+pointer_handle_enter (void *data, struct wl_pointer *pointer, -+ uint32_t serial, struct wl_surface *surface, -+ wl_fixed_t sx_w, wl_fixed_t sy_w) -+{ -+ struct input *input = data; -+ -+ if (!surface) { -+ /* enter event for a window we've just destroyed */ -+ return; -+ } -+ -+ input->display->serial = serial; -+ input->pointer_focus = wl_surface_get_user_data (surface); -+} -+ -+static void -+pointer_handle_leave (void *data, struct wl_pointer *pointer, -+ uint32_t serial, struct wl_surface *surface) -+{ -+ struct input *input = data; -+ -+ input_remove_pointer_focus (input); -+} -+ -+static void -+pointer_handle_motion (void *data, struct wl_pointer *pointer, -+ uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) -+{ -+ struct input *input = data; -+ GstWlWindow *window = input->pointer_focus; -+ -+ if (!window) -+ return; -+ -+ if (input->grab) -+ wl_shell_surface_move (input->grab->shell_surface, input->seat, -+ input->display->serial); -+ -+} -+ -+static void -+pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial, -+ uint32_t time, uint32_t button, uint32_t state_w) -+{ -+ struct input *input = data; -+ enum wl_pointer_button_state state = state_w; -+ input->display->serial = serial; -+ -+ if (button == BTN_LEFT) { -+ if (state == WL_POINTER_BUTTON_STATE_PRESSED) -+ input_grab (input, input->pointer_focus); -+ -+ if (input->grab && state == WL_POINTER_BUTTON_STATE_RELEASED) -+ input_ungrab (input); -+ } -+ -+ if (input->grab) -+ wl_shell_surface_move (input->grab->shell_surface, input->seat, -+ input->display->serial); -+} -+ -+static void -+pointer_handle_axis (void *data, struct wl_pointer *pointer, -+ uint32_t time, uint32_t axis, wl_fixed_t value) -+{ -+} -+ -+static const struct wl_pointer_listener pointer_listener = { -+ pointer_handle_enter, -+ pointer_handle_leave, -+ pointer_handle_motion, -+ pointer_handle_button, -+ pointer_handle_axis, -+}; -+ -+static void -+touch_handle_down (void *data, struct wl_touch *wl_touch, -+ uint32_t serial, uint32_t time, struct wl_surface *surface, -+ int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -+{ -+ struct input *input = data; -+ struct touch_point *tp; -+ -+ input->display->serial = serial; -+ input->touch_focus = wl_surface_get_user_data (surface); -+ if (!input->touch_focus) { -+ return; -+ } -+ -+ tp = malloc (sizeof *tp); -+ if (tp) { -+ tp->id = id; -+ wl_list_insert (&input->touch_point_list, &tp->link); -+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat, -+ serial); -+ } -+} -+ -+static void -+touch_handle_motion (void *data, struct wl_touch *wl_touch, -+ uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -+{ -+ struct input *input = data; -+ struct touch_point *tp; -+ -+ -+ if (!input->touch_focus) { -+ return; -+ } -+ wl_list_for_each (tp, &input->touch_point_list, link) { -+ if (tp->id != id) -+ continue; -+ -+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat, -+ input->display->serial); -+ -+ return; -+ } -+} -+ -+static void -+touch_handle_frame (void *data, struct wl_touch *wl_touch) -+{ -+} -+ -+static void -+touch_handle_cancel (void *data, struct wl_touch *wl_touch) -+{ -+} -+ -+static void -+touch_handle_up (void *data, struct wl_touch *wl_touch, -+ uint32_t serial, uint32_t time, int32_t id) -+{ -+ struct input *input = data; -+ struct touch_point *tp, *tmp; -+ -+ if (!input->touch_focus) { -+ return; -+ } -+ -+ wl_list_for_each_safe (tp, tmp, &input->touch_point_list, link) { -+ if (tp->id != id) -+ continue; -+ -+ wl_list_remove (&tp->link); -+ free (tp); -+ -+ return; -+ } -+} -+ -+static const struct wl_touch_listener touch_listener = { -+ touch_handle_down, -+ touch_handle_up, -+ touch_handle_motion, -+ touch_handle_frame, -+ touch_handle_cancel, -+}; -+ -+ -+static void -+seat_handle_capabilities (void *data, struct wl_seat *seat, -+ enum wl_seat_capability caps) -+{ -+ struct input *input = data; -+ -+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) { -+ input->pointer = wl_seat_get_pointer (seat); -+ wl_pointer_set_user_data (input->pointer, input); -+ wl_pointer_add_listener (input->pointer, &pointer_listener, input); -+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { -+ wl_pointer_destroy (input->pointer); -+ input->pointer = NULL; -+ } -+ -+ if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) { -+ input->touch = wl_seat_get_touch (seat); -+ wl_touch_set_user_data (input->touch, input); -+ wl_touch_add_listener (input->touch, &touch_listener, input); -+ } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { -+ wl_touch_destroy (input->touch); -+ input->touch = NULL; -+ } -+} -+ -+static void -+seat_handle_name (void *data, struct wl_seat *seat, const char *name) -+{ -+ -+} -+ -+static const struct wl_seat_listener seat_listener = { -+ seat_handle_capabilities, -+ seat_handle_name -+}; -+ -+static void -+display_add_input (GstWlDisplay *d, uint32_t id) -+{ -+ struct input *input; -+ -+ input = calloc (1, sizeof (*input)); -+ if (input == NULL) { -+ fprintf (stderr, "%s: out of memory\n", "gst-wayland-sink"); -+ exit (EXIT_FAILURE); -+ } -+ input->display = d; -+ input->seat = wl_registry_bind (d->registry, id, &wl_seat_interface, -+ MAX (d->seat_version, 3)); -+ input->touch_focus = NULL; -+ input->pointer_focus = NULL; -+ wl_list_init (&input->touch_point_list); -+ wl_list_insert (d->input_list.prev, &input->link); -+ -+ wl_seat_add_listener (input->seat, &seat_listener, input); -+ wl_seat_set_user_data (input->seat, input); -+ -+} -+ -+ - static void - registry_handle_global (void *data, struct wl_registry *registry, - uint32_t id, const char *interface, uint32_t version) -@@ -161,6 +497,12 @@ registry_handle_global (void *data, struct wl_registry *registry, - } else if (g_strcmp0 (interface, "wl_shm") == 0) { - self->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1); - wl_shm_add_listener (self->shm, &shm_listener, self); -+ } else if (g_strcmp0 (interface, "wl_drm") == 0) { -+ self->drm = wl_registry_bind (registry, id, &wl_drm_interface, 1); -+ wl_drm_add_listener (self->drm, &drm_listener, self); -+ } else if (g_strcmp0 (interface, "wl_seat") == 0) { -+ self->seat_version = version; -+ display_add_input (self, id); - } else if (g_strcmp0 (interface, "wl_scaler") == 0) { - self->scaler = wl_registry_bind (registry, id, &wl_scaler_interface, 2); - } -@@ -238,6 +580,7 @@ gst_wl_display_new_existing (struct wl_display * display, - self->own_display = take_ownership; - - self->queue = wl_display_create_queue (self->display); -+ wl_list_init (&self->input_list); - self->registry = wl_display_get_registry (self->display); - wl_proxy_set_queue ((struct wl_proxy *) self->registry, self->queue); - wl_registry_add_listener (self->registry, ®istry_listener, self); -@@ -266,6 +609,7 @@ gst_wl_display_new_existing (struct wl_display * display, - VERIFY_INTERFACE_EXISTS (subcompositor, "wl_subcompositor"); - VERIFY_INTERFACE_EXISTS (shell, "wl_shell"); - VERIFY_INTERFACE_EXISTS (shm, "wl_shm"); -+ VERIFY_INTERFACE_EXISTS (drm, "wl_drm"); - VERIFY_INTERFACE_EXISTS (scaler, "wl_scaler"); - - #undef VERIFY_INTERFACE_EXISTS -diff --git a/ext/wayland/wldisplay.h b/ext/wayland/wldisplay.h -deleted file mode 100644 -index e9df749..0000000 ---- a/ext/wayland/wldisplay.h -+++ /dev/null -@@ -1,84 +0,0 @@ --/* GStreamer Wayland video sink -- * -- * Copyright (C) 2014 Collabora Ltd. -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the Free -- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA. -- */ -- --#ifndef __GST_WL_DISPLAY_H__ --#define __GST_WL_DISPLAY_H__ -- --#include <gst/gst.h> --#include <wayland-client.h> --#include "scaler-client-protocol.h" -- --G_BEGIN_DECLS -- --#define GST_TYPE_WL_DISPLAY (gst_wl_display_get_type ()) --#define GST_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplay)) --#define GST_IS_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_DISPLAY)) --#define GST_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_DISPLAY, GstWlDisplayClass)) --#define GST_IS_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_DISPLAY)) --#define GST_WL_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplayClass)) -- --typedef struct _GstWlDisplay GstWlDisplay; --typedef struct _GstWlDisplayClass GstWlDisplayClass; -- --struct _GstWlDisplay --{ -- GObject parent_instance; -- -- /* public objects */ -- struct wl_display *display; -- struct wl_event_queue *queue; -- -- /* globals */ -- struct wl_registry *registry; -- struct wl_compositor *compositor; -- struct wl_subcompositor *subcompositor; -- struct wl_shell *shell; -- struct wl_shm *shm; -- struct wl_scaler *scaler; -- GArray *shm_formats; -- -- /* private */ -- gboolean own_display; -- GThread *thread; -- GstPoll *wl_fd_poll; -- -- GMutex buffers_mutex; -- GHashTable *buffers; -- gboolean shutting_down; --}; -- --struct _GstWlDisplayClass --{ -- GObjectClass parent_class; --}; -- --GType gst_wl_display_get_type (void); -- --GstWlDisplay *gst_wl_display_new (const gchar * name, GError ** error); --GstWlDisplay *gst_wl_display_new_existing (struct wl_display * display, -- gboolean take_ownership, GError ** error); -- --/* see wlbuffer.c for explanation */ --void gst_wl_display_register_buffer (GstWlDisplay * self, gpointer buf); --void gst_wl_display_unregister_buffer (GstWlDisplay * self, gpointer buf); -- --G_END_DECLS -- --#endif /* __GST_WL_DISPLAY_H__ */ -diff --git a/ext/wayland/wldrm.c b/ext/wayland/wldrm.c -new file mode 100644 -index 0000000..3dc9c21 ---- /dev/null -+++ b/ext/wayland/wldrm.c -@@ -0,0 +1,69 @@ -+#include "wldisplay-wlwindow-wlbuffer.h" -+#include <gst/drm/gstdrmallocator.h> -+#include "wayland-drm-client-protocol.h" -+#include <omap_drm.h> -+#include <omap_drmif.h> -+#include <wayland-client.h> -+ -+struct wl_buffer * -+gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display, -+ const GstVideoInfo * info) -+{ -+ gint video_width = GST_VIDEO_INFO_WIDTH (info); -+ gint video_height = GST_VIDEO_INFO_HEIGHT (info); -+ int fd = -1; -+ struct omap_bo *bo; -+ struct wl_buffer *buffer; -+ -+ /* TODO get format, etc from caps.. and query device for -+ * supported formats, and make this all more flexible to -+ * cope with various formats: -+ */ -+ uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); -+ uint32_t name; -+ /* note: wayland and mesa use the terminology: -+ * stride - rowstride in bytes -+ * pitch - rowstride in pixels -+ */ -+ uint32_t strides[3] = { -+ GST_ROUND_UP_4 (video_width), GST_ROUND_UP_4 (video_width), 0, -+ }; -+ uint32_t offsets[3] = { -+ 0, strides[0] * video_height, 0 -+ }; -+ -+ fd = gst_fd_memory_get_fd (mem); -+ -+ if (fd < 0 ) { -+ GST_DEBUG ("Invalid fd"); -+ return NULL; -+ } -+ -+ bo = omap_bo_from_dmabuf (display->dev, fd); -+ -+ struct drm_gem_flink req = { -+ .handle = omap_bo_handle(bo), -+ }; -+ -+ int ret; -+ ret = drmIoctl(display->fd, DRM_IOCTL_GEM_FLINK, &req); -+ if (ret) { -+ GST_DEBUG ("could not get name, DRM_IOCTL_GEM_FLINK returned %d", ret); -+ return NULL; -+ } -+ -+ name = req.name; -+ -+ GST_LOG ("width = %d , height = %d , fourcc = %d ", video_width, video_height, fourcc ); -+ buffer = wl_drm_create_planar_buffer (display->drm, name, -+ video_width, video_height, fourcc, -+ offsets[0], strides[0], -+ offsets[1], strides[1], -+ offsets[2], strides[2]); -+ -+ GST_DEBUG ("create planar buffer: %p (name=%d)", -+ buffer, name); -+ -+ return buffer; -+} -+ -diff --git a/ext/wayland/wldrm.h b/ext/wayland/wldrm.h -new file mode 100644 -index 0000000..9751029 ---- /dev/null -+++ b/ext/wayland/wldrm.h -@@ -0,0 +1,3 @@ -+struct wl_buffer * -+gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display, -+ const GstVideoInfo * info); -diff --git a/ext/wayland/wlshmallocator.h b/ext/wayland/wlshmallocator.h -index 07ae17f..2860fc3 100644 ---- a/ext/wayland/wlshmallocator.h -+++ b/ext/wayland/wlshmallocator.h -@@ -26,7 +26,7 @@ - #include <gst/video/video.h> - #include <gst/allocators/allocators.h> - #include <wayland-client-protocol.h> --#include "wldisplay.h" -+#include "wldisplay-wlwindow-wlbuffer.h" - - G_BEGIN_DECLS - -diff --git a/ext/wayland/wlvideoformat.c b/ext/wayland/wlvideoformat.c -index 1302da6..aa336aa 100644 ---- a/ext/wayland/wlvideoformat.c -+++ b/ext/wayland/wlvideoformat.c -@@ -106,6 +106,10 @@ gst_wl_shm_format_to_video_format (enum wl_shm_format wl_format) - const gchar * - gst_wl_shm_format_to_string (enum wl_shm_format wl_format) - { -- return gst_video_format_to_string -- (gst_wl_shm_format_to_video_format (wl_format)); -+ GstVideoFormat fmt = gst_wl_shm_format_to_video_format (wl_format); -+ if (fmt != GST_VIDEO_FORMAT_UNKNOWN) { -+ return gst_video_format_to_string (fmt); -+ } else { -+ return NULL; -+ } - } -diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c -index 79000ae..f7e3324 100644 ---- a/ext/wayland/wlwindow.c -+++ b/ext/wayland/wlwindow.c -@@ -24,9 +24,10 @@ - #include <config.h> - #endif - --#include "wlwindow.h" -+#include "wldisplay-wlwindow-wlbuffer.h" - #include "wlshmallocator.h" --#include "wlbuffer.h" -+#include "wldrm.h" -+#include <gst/drm/gstdrmallocator.h> - - GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug); - #define GST_CAT_DEFAULT gstwayland_debug -@@ -111,6 +112,8 @@ gst_wl_window_new_internal (GstWlDisplay * display) - - window->area_surface = wl_compositor_create_surface (display->compositor); - window->video_surface = wl_compositor_create_surface (display->compositor); -+ wl_surface_set_user_data (window->area_surface, window); -+ wl_surface_set_user_data (window->video_surface, window); - - wl_proxy_set_queue ((struct wl_proxy *) window->area_surface, display->queue); - wl_proxy_set_queue ((struct wl_proxy *) window->video_surface, -@@ -126,6 +129,21 @@ gst_wl_window_new_internal (GstWlDisplay * display) - window->area_surface); - window->video_viewport = wl_scaler_get_viewport (display->scaler, - window->video_surface); -+ if (display->crop) { -+ GST_DEBUG ("Setting source crop : %d %d %d %d",display->crop->x, display->crop->y, -+ display->crop->width, display->crop->height); -+ wl_viewport_set_source (window->area_viewport, -+ wl_fixed_from_int(display->crop->x), -+ wl_fixed_from_int(display->crop->y), -+ wl_fixed_from_int(display->crop->width), -+ wl_fixed_from_int(display->crop->height)); -+ wl_viewport_set_source (window->video_viewport, -+ wl_fixed_from_int(display->crop->x), -+ wl_fixed_from_int(display->crop->y), -+ wl_fixed_from_int(display->crop->width), -+ wl_fixed_from_int(display->crop->height)); -+ -+ } - - /* draw the area_subsurface */ - gst_video_info_set_format (&info, -@@ -136,14 +154,25 @@ gst_wl_window_new_internal (GstWlDisplay * display) - GST_VIDEO_FORMAT_BGRx, - #endif - 1, 1); -- -- buf = gst_buffer_new_allocate (gst_wl_shm_allocator_get (), info.size, NULL); -+ if (display->use_drm) { -+ buf = gst_buffer_new_allocate (gst_drm_allocator_get (), info.size, NULL); -+ } else { -+ buf = gst_buffer_new_allocate (gst_wl_shm_allocator_get (), info.size, NULL); -+ } - gst_buffer_map (buf, &mapinfo, GST_MAP_WRITE); -- *((guint32 *) mapinfo.data) = 0; /* paint it black */ -- gst_buffer_unmap (buf, &mapinfo); -- wlbuf = -- gst_wl_shm_memory_construct_wl_buffer (gst_buffer_peek_memory (buf, 0), -- display, &info); -+ *((guint32 *) mapinfo.data) = 0; /* paint it black */ -+ gst_buffer_unmap (buf, &mapinfo); -+ -+ if (display->use_drm) { -+ wlbuf = -+ gst_wl_drm_memory_construct_wl_buffer (gst_buffer_peek_memory (buf, 0), -+ display, &info); -+ } else { -+ wlbuf = -+ gst_wl_shm_memory_construct_wl_buffer (gst_buffer_peek_memory (buf, 0), -+ display, &info); -+ } -+ - gwlbuf = gst_buffer_add_wl_buffer (buf, wlbuf, display); - gst_wl_buffer_attach (gwlbuf, window->area_surface); - -diff --git a/ext/wayland/wlwindow.h b/ext/wayland/wlwindow.h -deleted file mode 100644 -index e22cb26..0000000 ---- a/ext/wayland/wlwindow.h -+++ /dev/null -@@ -1,84 +0,0 @@ --/* GStreamer Wayland video sink -- * -- * Copyright (C) 2014 Collabora Ltd. -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the Free -- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -- * Boston, MA 02110-1301 USA. -- */ -- --#ifndef __GST_WL_WINDOW_H__ --#define __GST_WL_WINDOW_H__ -- --#include "wldisplay.h" --#include "wlbuffer.h" --#include <gst/video/video.h> -- --G_BEGIN_DECLS -- --#define GST_TYPE_WL_WINDOW (gst_wl_window_get_type ()) --#define GST_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_WINDOW, GstWlWindow)) --#define GST_IS_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_WINDOW)) --#define GST_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_WINDOW, GstWlWindowClass)) --#define GST_IS_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_WINDOW)) --#define GST_WL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_WINDOW, GstWlWindowClass)) -- --typedef struct _GstWlWindow GstWlWindow; --typedef struct _GstWlWindowClass GstWlWindowClass; -- --struct _GstWlWindow --{ -- GObject parent_instance; -- -- GstWlDisplay *display; -- struct wl_surface *area_surface; -- struct wl_subsurface *area_subsurface; -- struct wl_viewport *area_viewport; -- struct wl_surface *video_surface; -- struct wl_subsurface *video_subsurface; -- struct wl_viewport *video_viewport; -- struct wl_shell_surface *shell_surface; -- -- /* the size and position of the area_(sub)surface */ -- GstVideoRectangle render_rectangle; -- /* the size of the video in the buffers */ -- gint video_width, video_height; -- /* the size of the video_(sub)surface */ -- gint surface_width, surface_height; --}; -- --struct _GstWlWindowClass --{ -- GObjectClass parent_class; --}; -- --GType gst_wl_window_get_type (void); -- --GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display, -- const GstVideoInfo * info); --GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display, -- struct wl_surface * parent); -- --GstWlDisplay *gst_wl_window_get_display (GstWlWindow * window); --struct wl_surface *gst_wl_window_get_wl_surface (GstWlWindow * window); --gboolean gst_wl_window_is_toplevel (GstWlWindow *window); -- --void gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer, -- const GstVideoInfo * info); --void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, -- gint w, gint h); -- --G_END_DECLS -- --#endif /* __GST_WL_WINDOW_H__ */ --- -2.7.4 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch deleted file mode 100644 index bcb66c816..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch +++ /dev/null @@ -1,65 +0,0 @@ -From adfc38273882a102d25fc420adc82b3f225588f9 Mon Sep 17 00:00:00 2001 -From: Pooja Prajod <a0132412@ti.com> -Date: Mon, 27 Mar 2017 18:27:06 +0530 -Subject: [PATCH] gstwaylandsink: Implement callbacks for version 5 of - wl_pointer - -Few extra callbacks are required for wl_pointer listener -with the newer weston. Without the extra dummy callbacks -the pipelines results in segfault. - -Signed-off-by: Pooja Prajod <a0132412@ti.com> ---- - ext/wayland/wldisplay.c | 22 +++++++++++++++++++++- - 1 file changed, 21 insertions(+), 1 deletion(-) - -diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c -index 2f58fd2..54acfdb 100644 ---- a/ext/wayland/wldisplay.c -+++ b/ext/wayland/wldisplay.c -@@ -326,12 +326,25 @@ pointer_handle_axis (void *data, struct wl_pointer *pointer, - { - } - -+static void pointer_frame(void *data, struct wl_pointer *wl_pointer) -+{ -+} -+static void pointer_axis_source(void *data, struct wl_pointer *wl_pointer, uint32_t axis_source) -+{ -+} -+void pointer_axis_stop(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis) -+{ -+} -+ - static const struct wl_pointer_listener pointer_listener = { - pointer_handle_enter, - pointer_handle_leave, - pointer_handle_motion, - pointer_handle_button, - pointer_handle_axis, -+ pointer_frame, -+ pointer_axis_source, -+ pointer_axis_stop - }; - - static void -@@ -508,8 +521,15 @@ registry_handle_global (void *data, struct wl_registry *registry, - } - } - -+static void -+registry_handle_global_remove(void *data, struct wl_registry *registry, -+ uint32_t name) -+{ -+} -+ - static const struct wl_registry_listener registry_listener = { -- registry_handle_global -+ registry_handle_global, -+ registry_handle_global_remove - }; - - static gpointer --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend deleted file mode 100644 index 53cd834aa..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend +++ /dev/null @@ -1,49 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -PACKAGECONFIG = "faad" - -# gstreamer is now also included on Keystone, be mindful of any Graphics dependencies -PACKAGECONFIG_append_omap-a15 = " ${@bb.utils.contains('DISTRO_FEATURES','wayland','wayland','',d)}" -PACKAGECONFIG_append_ti43x = " ${@bb.utils.contains('DISTRO_FEATURES','wayland','wayland','',d)}" -PACKAGECONFIG_append_ti33x = " ${@bb.utils.contains('DISTRO_FEATURES','wayland','wayland','',d)}" - -DEPENDS_append_omap-a15 = " \ - libdrm \ -" - -DEPENDS_append_ti43x = " \ - libdrm \ -" - -DEPENDS_append_ti33x = " \ - libdrm \ -" - -SRC_URI_append_ti43x = " \ - file://0001-gstdrmallocator-Add-DRM-allocator-support.patch \ - file://0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch \ - file://0003-gstkmssink-Add-support-for-KMS-based-sink.patch \ - file://0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch \ - file://0002-kmssink-remove-DCE-dependencies.patch \ - file://0003-kmssink-add-YUYV-support.patch \ - file://0001-gstwaylandsink-add-input-format-I420-support.patch \ -" - -SRC_URI_append_ti33x = " \ - file://0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch \ -" - -SRC_URI_append_omap-a15 = " \ - file://0001-gstdrmallocator-Add-DRM-allocator-support.patch \ - file://0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch \ - file://0003-gstkmssink-Add-support-for-KMS-based-sink.patch \ - file://0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch \ - file://0002-kmssink-remove-DCE-dependencies.patch \ - file://0003-kmssink-add-YUYV-support.patch \ - file://0001-gstwaylandsink-add-input-format-I420-support.patch \ - file://0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch \ -" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -PR = "r4" diff --git a/meta-agl-bsp/meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb b/meta-agl-bsp/meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb deleted file mode 100644 index 4fdfd7ddb..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb +++ /dev/null @@ -1,33 +0,0 @@ -python __anonymous() { - features = bb.data.getVar("MACHINE_FEATURES", d, 1) - if not features: - return - if "mmip" not in features: - raise bb.parse.SkipPackage('ipumm-fw does not apply to systems without the "mmip" flag in MACHINE_FEATURES') -} - -DESCRIPTION = "Firmware for IPU for supporting Accelerated MM decode and encode" -LICENSE = "TI-TSPA" - -LIC_FILES_CHKSUM = "file://MMIP-${PV}-Manifest.doc;md5=255f135205844dcbeab09b481ff9fb3a" - -COMPATIBLE_MACHINE = "dra7xx" -PACKAGE_ARCH = "${MACHINE_ARCH}" - -RDEPENDS_${PN} = " libdce" - -SRC_URI = "http://downloads.ti.com/infotainment/esd/jacinto6/processor-sdk-linux-automotive/03_02_00_03/exports/ipumm-dra7xx-evm-${PV}.tar.gz;protocol=http" - -SRC_URI[md5sum] = "d5cf8c3be28f22cd94e97ab2b781a4df" -SRC_URI[sha256sum] = "b003a981cc97d834c81ec653dca9888c0e6c99500ee695a24f3221898f6afed4" - -S = "${WORKDIR}/ipumm-dra7xx-evm-${PV}" - -TARGET = "dra7-ipu2-fw.xem4" - -do_install() { - mkdir -p ${D}${base_libdir}/firmware - cp ${S}/firmware/${TARGET} ${D}${base_libdir}/firmware/${TARGET} -} - -FILES_${PN} += "${base_libdir}/firmware/${TARGET}" diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch deleted file mode 100644 index 4268b7dc2..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch +++ /dev/null @@ -1,3570 +0,0 @@ -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(¶ms, 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-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch deleted file mode 100644 index fde38d52b..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 8497d95cc77af9bbdbbce03878e9fd273d94ba7f Mon Sep 17 00:00:00 2001 -From: Eric Ruei <e-ruei1@ti.com> -Date: Wed, 7 Dec 2016 15:25:25 -0500 -Subject: [PATCH] compositor-drm: fix hotplug weston termination problem - -The weston_compositor_exit() is always invoked at function update_outputs() -if all connector ids are greater than 31 because the 32-bit b->connector_allocator -will be zero. Need to increase the size of both crtc_allocator and -connector_allocator from 32-bit to 64-bit until a better solution is implemented. - -Upstream-Status: Submitted [wayland-devel@lists.freedesktop.org] - -Signed-off-by: Eric Ruei <e-ruei1@ti.com> ---- - src/compositor-drm.c | 30 +++++++++++++++--------------- - 1 file changed, 15 insertions(+), 15 deletions(-) - -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index 6485b39..e4d889f 100644 ---- a/src/compositor-drm.c -+++ b/src/compositor-drm.c -@@ -103,8 +103,8 @@ struct drm_backend { - struct gbm_device *gbm; - uint32_t *crtcs; - int num_crtcs; -- uint32_t crtc_allocator; -- uint32_t connector_allocator; -+ uint64_t crtc_allocator; -+ uint64_t connector_allocator; - struct wl_listener session_listener; - uint32_t format; - -@@ -1360,8 +1360,8 @@ drm_output_destroy(struct weston_output *output_base) - &output->connector_id, 1, &origcrtc->mode); - drmModeFreeCrtc(origcrtc); - -- b->crtc_allocator &= ~(1 << output->crtc_id); -- b->connector_allocator &= ~(1 << output->connector_id); -+ b->crtc_allocator &= ~(1ULL << output->crtc_id); -+ b->connector_allocator &= ~(1ULL << output->connector_id); - - if (b->use_pixman) { - drm_output_fini_pixman(output); -@@ -1842,8 +1842,8 @@ find_crtc_for_connector(struct drm_backend *b, - drmModeFreeEncoder(encoder); - - for (i = 0; i < resources->count_crtcs; i++) { -- if (possible_crtcs & (1 << i) && -- !(b->crtc_allocator & (1 << resources->crtcs[i]))) -+ if (possible_crtcs & (1ULL << i) && -+ !(b->crtc_allocator & (1ULL << resources->crtcs[i]))) - return i; - } - } -@@ -2404,9 +2404,9 @@ create_output_for_connector(struct drm_backend *b, - - output->crtc_id = resources->crtcs[i]; - output->pipe = i; -- b->crtc_allocator |= (1 << output->crtc_id); -+ b->crtc_allocator |= (1ULL << output->crtc_id); - output->connector_id = connector->connector_id; -- b->connector_allocator |= (1 << output->connector_id); -+ b->connector_allocator |= (1ULL << output->connector_id); - - output->original_crtc = drmModeGetCrtc(b->drm.fd, output->crtc_id); - output->dpms_prop = drm_get_prop(b->drm.fd, connector, "DPMS"); -@@ -2511,8 +2511,8 @@ err_free: - } - - drmModeFreeCrtc(output->original_crtc); -- b->crtc_allocator &= ~(1 << output->crtc_id); -- b->connector_allocator &= ~(1 << output->connector_id); -+ b->crtc_allocator &= ~(1ULL << output->crtc_id); -+ b->connector_allocator &= ~(1ULL << output->connector_id); - free(output); - - return -1; -@@ -2658,7 +2658,7 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) - drmModeRes *resources; - struct drm_output *output, *next; - int x = 0, y = 0; -- uint32_t connected = 0, disconnects = 0; -+ uint64_t connected = 0, disconnects = 0; - int i; - - resources = drmModeGetResources(b->drm.fd); -@@ -2680,9 +2680,9 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) - continue; - } - -- connected |= (1 << connector_id); -+ connected |= (1ULL << connector_id); - -- if (!(b->connector_allocator & (1 << connector_id))) { -+ if (!(b->connector_allocator & (1ULL << connector_id))) { - struct weston_output *last = - container_of(b->compositor->output_list.prev, - struct weston_output, link); -@@ -2707,8 +2707,8 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) - if (disconnects) { - wl_list_for_each_safe(output, next, &b->compositor->output_list, - base.link) { -- if (disconnects & (1 << output->connector_id)) { -- disconnects &= ~(1 << output->connector_id); -+ if (disconnects & (1ULL << output->connector_id)) { -+ disconnects &= ~(1ULL << output->connector_id); - weston_log("connector %d disconnected\n", - output->connector_id); - drm_output_destroy(&output->base); --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-support-RGB565-with-pixman-renderer.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-support-RGB565-with-pixman-renderer.patch deleted file mode 100644 index 0d77f529e..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-support-RGB565-with-pixman-renderer.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 91b452fa515b94928d32af6e1b1b0405469747fd Mon Sep 17 00:00:00 2001 -From: Tomi Valkeinen <tomi.valkeinen@ti.com> -Date: Wed, 8 Mar 2017 13:05:38 -0500 -Subject: [PATCH] compositor-drm: support RGB565 with pixman renderer - -At the moment only XRGB8888 is supported when using pixman renderer. -This patch adds support also for RGB565. - -Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> -Reviewed-by: Daniel Stone <daniels@collabora.com> -Reviewed-by: Derek Foreman <derekf@osg.samsung.com> -Signed-off-by: Daniel Stone <daniels@collabora.com> ---- - src/compositor-drm.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 55 insertions(+), 7 deletions(-) - -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index fd89627..443b69a 100644 ---- a/src/compositor-drm.c -+++ b/src/compositor-drm.c -@@ -262,10 +262,12 @@ drm_fb_destroy_callback(struct gbm_bo *bo, void *data) - } - - static struct drm_fb * --drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height) -+drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height, -+ uint32_t format) - { - struct drm_fb *fb; - int ret; -+ uint32_t bpp, depth; - - struct drm_mode_create_dumb create_arg; - struct drm_mode_destroy_dumb destroy_arg; -@@ -275,8 +277,20 @@ drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height) - if (!fb) - return NULL; - -+ switch (format) { -+ case GBM_FORMAT_XRGB8888: -+ bpp = 32; -+ depth = 24; -+ break; -+ case GBM_FORMAT_RGB565: -+ bpp = depth = 16; -+ break; -+ default: -+ return NULL; -+ } -+ - memset(&create_arg, 0, sizeof create_arg); -- create_arg.bpp = 32; -+ create_arg.bpp = bpp; - create_arg.width = width; - create_arg.height = height; - -@@ -289,8 +303,29 @@ drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height) - fb->size = create_arg.size; - fb->fd = b->drm.fd; - -- ret = drmModeAddFB(b->drm.fd, width, height, 24, 32, -- fb->stride, fb->handle, &fb->fb_id); -+ ret = -1; -+ -+ if (!b->no_addfb2) { -+ uint32_t handles[4], pitches[4], offsets[4]; -+ -+ handles[0] = fb->handle; -+ pitches[0] = fb->stride; -+ offsets[0] = 0; -+ -+ ret = drmModeAddFB2(b->drm.fd, width, height, -+ format, handles, pitches, offsets, -+ &fb->fb_id, 0); -+ if (ret) { -+ weston_log("addfb2 failed: %m\n"); -+ b->no_addfb2 = 1; -+ } -+ } -+ -+ if (ret) { -+ ret = drmModeAddFB(b->drm.fd, width, height, depth, bpp, -+ fb->stride, fb->handle, &fb->fb_id); -+ } -+ - if (ret) - goto err_bo; - -@@ -1879,17 +1914,30 @@ drm_output_init_pixman(struct drm_output *output, struct drm_backend *b) - { - int w = output->base.current_mode->width; - int h = output->base.current_mode->height; -+ uint32_t format = output->gbm_format; -+ uint32_t pixman_format; - unsigned int i; - -- /* FIXME error checking */ -+ switch (format) { -+ case GBM_FORMAT_XRGB8888: -+ pixman_format = PIXMAN_x8r8g8b8; -+ break; -+ case GBM_FORMAT_RGB565: -+ pixman_format = PIXMAN_r5g6b5; -+ break; -+ default: -+ weston_log("Unsupported pixman format 0x%x\n", format); -+ return -1; -+ } - -+ /* FIXME error checking */ - for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) { -- output->dumb[i] = drm_fb_create_dumb(b, w, h); -+ output->dumb[i] = drm_fb_create_dumb(b, w, h, format); - if (!output->dumb[i]) - goto err; - - output->image[i] = -- pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h, -+ pixman_image_create_bits(pixman_format, w, h, - output->dumb[i]->map, - output->dumb[i]->stride); - if (!output->image[i]) --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch deleted file mode 100644 index 515f06c47..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch +++ /dev/null @@ -1,37 +0,0 @@ -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> ---- - src/compositor-drm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index 6777bf8..59c2cc5 100644 ---- a/src/compositor-drm.c -+++ b/src/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-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch deleted file mode 100644 index 39c840182..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch +++ /dev/null @@ -1,31 +0,0 @@ -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> ---- - src/gl-renderer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 23c0cd7..4c1f170 100644 ---- a/src/gl-renderer.c -+++ b/src/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-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch deleted file mode 100644 index bdf5626f7..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch +++ /dev/null @@ -1,39 +0,0 @@ -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. - -Signed-off-by: Eric Ruei <e-ruei1@ti.com> ---- - src/text-backend.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/text-backend.c b/src/text-backend.c -index ab4667f..36c70a5 100644 ---- a/src/text-backend.c -+++ b/src/text-backend.c -@@ -337,6 +337,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_panel = text_input; - } - } - --- -1.9.1 - diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch deleted file mode 100644 index 673ca3dbc..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch +++ /dev/null @@ -1,36 +0,0 @@ -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> ---- - src/input.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/input.c b/src/input.c -index 8fe898c..0f72d23 100644 ---- a/src/input.c -+++ b/src/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-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend deleted file mode 100644 index ed20c7420..000000000 --- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend +++ /dev/null @@ -1,22 +0,0 @@ -# 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" - - -SRC_URI += " \ - file://0001-udev-seat-restrict-udev-enumeration-to-card0.patch \ - file://0001-Add-soc-performance-monitor-utilites.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 \ - file://0001-compositor-drm-fix-hotplug-weston-termination-proble.patch \ - file://0001-compositor-drm-support-RGB565-with-pixman-renderer.patch \ -" - -RDEPENDS_${PN}_remove = "weston-conf" diff --git a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt b/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt deleted file mode 100755 index 79f3d1ff2..000000000 --- a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt +++ /dev/null @@ -1 +0,0 @@ -fdtfile=dra7-evm-lcd-osd101t2045.dtb diff --git a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend b/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend deleted file mode 100644 index d1b9b2704..000000000 --- a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend +++ /dev/null @@ -1,16 +0,0 @@ -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-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend b/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend deleted file mode 100644 index a5a69513a..000000000 --- a/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend +++ /dev/null @@ -1,7 +0,0 @@ -# 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-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension/force-type-conversion.patch b/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension/force-type-conversion.patch deleted file mode 100644 index a72aeedf6..000000000 --- a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension/force-type-conversion.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp b/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp -index 2e65864..e14dbc0 100644 ---- a/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp -+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp -@@ -244,7 +247,7 @@ bool OpenGLES2App::createEGLContext() - m_eglContextStruct.eglSurface = NULL; - m_eglContextStruct.eglContext = NULL; - -- m_eglContextStruct.eglDisplay = eglGetDisplay(m_wlContextStruct.wlDisplay); -+ m_eglContextStruct.eglDisplay = eglGetDisplay((EGLNativeDisplayType)m_wlContextStruct.wlDisplay); - eglstatus = eglGetError(); - if (!m_eglContextStruct.eglDisplay) - { diff --git a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend b/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend deleted file mode 100644 index e9a57d324..000000000 --- a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" - -SRC_URI_append = "\ - file://force-type-conversion.patch \ - " diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch deleted file mode 100644 index a1eeac3d7..000000000 --- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch +++ /dev/null @@ -1,49 +0,0 @@ -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-bsp/meta-ti/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ath9k_htc.cfg deleted file mode 100644 index 6f7d49880..000000000 --- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ath9k_htc.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_CFG80211=m -CONFIG_MAC80211=m -CONFIG_ATH_CARDS=m -CONFIG_ATH9K_HTC=m diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/btusb.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/btusb.cfg deleted file mode 100644 index 5f18d8223..000000000 --- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/btusb.cfg +++ /dev/null @@ -1,6 +0,0 @@ -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 diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ramblock_nbd.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ramblock_nbd.cfg deleted file mode 100644 index ef498669d..000000000 --- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ramblock_nbd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_NBD=y diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/rtl_sdr.cfg deleted file mode 100644 index df5a871ef..000000000 --- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/rtl_sdr.cfg +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_I2C_MUX=y -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-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend b/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend deleted file mode 100644 index b2e543140..000000000 --- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend +++ /dev/null @@ -1,33 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI_append = " file://ramblock_nbd.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ramblock_nbd.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" - -# Enable support for Bluetooth HCI USB devices -SRC_URI_append = " file://btusb.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/btusb.cfg" - -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" - -# Enable support for smack -KERNEL_CONFIG_FRAGMENTS_append_smack = "\ - ${WORKDIR}/audit.cfg \ - ${WORKDIR}/smack.cfg \ - ${WORKDIR}/smack-default-lsm.cfg \ -" - -# file comes out of meta-agl-bsp/recipes-kernel/linux/linux_%.bbappend -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg" diff --git a/meta-agl-bsp/openembedded-layer/recipes-devtools/lua/lua_%.bbappend b/meta-agl-bsp/openembedded-layer/recipes-devtools/lua/lua_%.bbappend new file mode 100644 index 000000000..f4fc54d86 --- /dev/null +++ b/meta-agl-bsp/openembedded-layer/recipes-devtools/lua/lua_%.bbappend @@ -0,0 +1,4 @@ +# this causes a crash in the selftest db.lua ! +# Bug-AGL: SPEC-3828 +# Upstream status: pending +SRC_URI:remove = "file://CVE-2020-15945.patch" diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch deleted file mode 100644 index 5172fdd3a..000000000 --- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch +++ /dev/null @@ -1,41 +0,0 @@ -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-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch deleted file mode 100644 index df1f786c6..000000000 --- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch +++ /dev/null @@ -1,86 +0,0 @@ -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-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch deleted file mode 100644 index 7540b7467..000000000 --- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch +++ /dev/null @@ -1,138 +0,0 @@ -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-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb deleted file mode 100644 index dfa0631a0..000000000 --- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb +++ /dev/null @@ -1,25 +0,0 @@ -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 += "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 \ - " - -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-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb b/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb deleted file mode 100644 index 2c7cc4bb9..000000000 --- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb +++ /dev/null @@ -1,13 +0,0 @@ -require recipes-bsp/u-boot/u-boot.inc - -DEPENDS += "dtc-native" - -SRCREV = "5ea3e51fc481613a8dee8c02848d1b42c81ad892" - -PV = "v2016.11+git${SRCPV}" - -#This patch is not complacente with u-boot 2016.11 -#Version of u-boot from yocto 2.2 Morty is 2016.03 from: -# meta/recipes-bsp/u-boot/u-boot_2016.03.bb -SRC_URI_remove_raspberrypi3 = "file://0003-Include-lowlevel_init.o-for-rpi2.patch" -SRC_URI_remove_raspberrypi2 = "file://0003-Include-lowlevel_init.o-for-rpi2.patch" diff --git a/meta-agl-bsp/recipes-graphics/mesa/mesa_12.%.bbappend b/meta-agl-bsp/recipes-graphics/mesa/mesa_12.%.bbappend deleted file mode 100644 index 49e527707..000000000 --- a/meta-agl-bsp/recipes-graphics/mesa/mesa_12.%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -# 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-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend deleted file mode 100644 index dba2ad6b2..000000000 --- a/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend +++ /dev/null @@ -1,17 +0,0 @@ -# OVERRIDES save us some c'n'p below ... -OVERRIDES_prepend_qemux86 = "customwestonini:" -OVERRIDES_prepend_qemux86-64 = "customwestonini:" -# intel-corei7-64 ?? - -python() { - if "customwestonini" in d.getVar("OVERRIDES", True).split(":"): - # DRM backend disabled for now to allow compatibility with VirtualBox - # and VMWare Player. It may be re-enabled if running on QEMU for - # potentially increased performance. - #backend=drm-backend.so - d.delVarFlag("WESTONCORE", "backend") - - d.setVarFlag("WESTONOUTPUT1","agl_screen", "SCREEN_QEMU") -} - - diff --git a/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini b/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini deleted file mode 100644 index f502eff7a..000000000 --- a/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini +++ /dev/null @@ -1,28 +0,0 @@ -[core] -shell=ivi-shell.so -# DRM backend disabled for now to allow compatibility with VirtualBox -# and VMWare Player. It may be re-enabled if running on QEMU for -# potentially increased performance. -#backend=drm-backend.so - -[ivi-shell] -ivi-module=ivi-controller.so -ivi-input-module=ivi-input-controller.so - -[output] -name=Virtual-1 -#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-bsp/recipes-graphics/wayland/weston_%.bbappend b/meta-agl-bsp/recipes-graphics/wayland/weston_%.bbappend deleted file mode 100644 index 9aaea5f69..000000000 --- a/meta-agl-bsp/recipes-graphics/wayland/weston_%.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -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-bsp/recipes-kernel/linux/linux-%.bbappend b/meta-agl-bsp/recipes-kernel/linux/linux-%.bbappend deleted file mode 100644 index 0363760ab..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/linux:" - -# Extra configuration options for the AGL kernel -SRC_URI += "file://can-bus.cfg \ - " diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/0001-fanotify-fix-notification-of-groups-with-inode-mount.patch b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/0001-fanotify-fix-notification-of-groups-with-inode-mount.patch deleted file mode 100644 index c50c152a1..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/0001-fanotify-fix-notification-of-groups-with-inode-mount.patch +++ /dev/null @@ -1,206 +0,0 @@ -From 8edc6e1688fc8f02c8c1f53a2ec4928cb1055f4d Mon Sep 17 00:00:00 2001 -From: Jan Kara <jack@suse.cz> -Date: Thu, 13 Nov 2014 15:19:33 -0800 -Subject: [PATCH] fanotify: fix notification of groups with inode & mount marks - -fsnotify() needs to merge inode and mount marks lists when notifying -groups about events so that ignore masks from inode marks are reflected -in mount mark notifications and groups are notified in proper order -(according to priorities). - -Currently the sorting of the lists done by fsnotify_add_inode_mark() / -fsnotify_add_vfsmount_mark() and fsnotify() differed which resulted -ignore masks not being used in some cases. - -Fix the problem by always using the same comparison function when -sorting / merging the mark lists. - -Thanks to Heinrich Schuchardt for improvements of my patch. - -Link: https://bugzilla.kernel.org/show_bug.cgi?id=87721 -Signed-off-by: Jan Kara <jack@suse.cz> -Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> -Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> -Signed-off-by: Andrew Morton <akpm@linux-foundation.org> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> ---- - fs/notify/fsnotify.c | 36 +++++++++++++++++++++--------------- - fs/notify/fsnotify.h | 4 ++++ - fs/notify/inode_mark.c | 8 +++----- - fs/notify/mark.c | 36 ++++++++++++++++++++++++++++++++++++ - fs/notify/vfsmount_mark.c | 8 +++----- - 5 files changed, 67 insertions(+), 25 deletions(-) - -diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c -index 9d3e9c5..89326ac 100644 ---- a/fs/notify/fsnotify.c -+++ b/fs/notify/fsnotify.c -@@ -229,8 +229,16 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, - &fsnotify_mark_srcu); - } - -+ /* -+ * We need to merge inode & vfsmount mark lists so that inode mark -+ * ignore masks are properly reflected for mount mark notifications. -+ * That's why this traversal is so complicated... -+ */ - while (inode_node || vfsmount_node) { -- inode_group = vfsmount_group = NULL; -+ inode_group = NULL; -+ inode_mark = NULL; -+ vfsmount_group = NULL; -+ vfsmount_mark = NULL; - - if (inode_node) { - inode_mark = hlist_entry(srcu_dereference(inode_node, &fsnotify_mark_srcu), -@@ -244,21 +252,19 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, - vfsmount_group = vfsmount_mark->group; - } - -- if (inode_group > vfsmount_group) { -- /* handle inode */ -- ret = send_to_group(to_tell, inode_mark, NULL, mask, -- data, data_is, cookie, file_name); -- /* we didn't use the vfsmount_mark */ -- vfsmount_group = NULL; -- } else if (vfsmount_group > inode_group) { -- ret = send_to_group(to_tell, NULL, vfsmount_mark, mask, -- data, data_is, cookie, file_name); -- inode_group = NULL; -- } else { -- ret = send_to_group(to_tell, inode_mark, vfsmount_mark, -- mask, data, data_is, cookie, -- file_name); -+ if (inode_group && vfsmount_group) { -+ int cmp = fsnotify_compare_groups(inode_group, -+ vfsmount_group); -+ if (cmp > 0) { -+ inode_group = NULL; -+ inode_mark = NULL; -+ } else if (cmp < 0) { -+ vfsmount_group = NULL; -+ vfsmount_mark = NULL; -+ } - } -+ ret = send_to_group(to_tell, inode_mark, vfsmount_mark, mask, -+ data, data_is, cookie, file_name); - - if (ret && (mask & ALL_FSNOTIFY_PERM_EVENTS)) - goto out; -diff --git a/fs/notify/fsnotify.h b/fs/notify/fsnotify.h -index 9c0898c..3b68b0a 100644 ---- a/fs/notify/fsnotify.h -+++ b/fs/notify/fsnotify.h -@@ -12,6 +12,10 @@ extern void fsnotify_flush_notify(struct fsnotify_group *group); - /* protects reads of inode and vfsmount marks list */ - extern struct srcu_struct fsnotify_mark_srcu; - -+/* compare two groups for sorting of marks lists */ -+extern int fsnotify_compare_groups(struct fsnotify_group *a, -+ struct fsnotify_group *b); -+ - extern void fsnotify_set_inode_mark_mask_locked(struct fsnotify_mark *fsn_mark, - __u32 mask); - /* add a mark to an inode */ -diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c -index e849714..dfbf544 100644 ---- a/fs/notify/inode_mark.c -+++ b/fs/notify/inode_mark.c -@@ -194,6 +194,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, - { - struct fsnotify_mark *lmark, *last = NULL; - int ret = 0; -+ int cmp; - - mark->flags |= FSNOTIFY_MARK_FLAG_INODE; - -@@ -219,11 +220,8 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, - goto out; - } - -- if (mark->group->priority < lmark->group->priority) -- continue; -- -- if ((mark->group->priority == lmark->group->priority) && -- (mark->group < lmark->group)) -+ cmp = fsnotify_compare_groups(lmark->group, mark->group); -+ if (cmp < 0) - continue; - - hlist_add_before_rcu(&mark->i.i_list, &lmark->i.i_list); -diff --git a/fs/notify/mark.c b/fs/notify/mark.c -index d90deaa..34c38fa 100644 ---- a/fs/notify/mark.c -+++ b/fs/notify/mark.c -@@ -210,6 +210,42 @@ void fsnotify_set_mark_ignored_mask_locked(struct fsnotify_mark *mark, __u32 mas - } - - /* -+ * Sorting function for lists of fsnotify marks. -+ * -+ * Fanotify supports different notification classes (reflected as priority of -+ * notification group). Events shall be passed to notification groups in -+ * decreasing priority order. To achieve this marks in notification lists for -+ * inodes and vfsmounts are sorted so that priorities of corresponding groups -+ * are descending. -+ * -+ * Furthermore correct handling of the ignore mask requires processing inode -+ * and vfsmount marks of each group together. Using the group address as -+ * further sort criterion provides a unique sorting order and thus we can -+ * merge inode and vfsmount lists of marks in linear time and find groups -+ * present in both lists. -+ * -+ * A return value of 1 signifies that b has priority over a. -+ * A return value of 0 signifies that the two marks have to be handled together. -+ * A return value of -1 signifies that a has priority over b. -+ */ -+int fsnotify_compare_groups(struct fsnotify_group *a, struct fsnotify_group *b) -+{ -+ if (a == b) -+ return 0; -+ if (!a) -+ return 1; -+ if (!b) -+ return -1; -+ if (a->priority < b->priority) -+ return 1; -+ if (a->priority > b->priority) -+ return -1; -+ if (a < b) -+ return 1; -+ return -1; -+} -+ -+/* - * Attach an initialized mark to a given group and fs object. - * These marks may be used for the fsnotify backend to determine which - * event types should be delivered to which group. -diff --git a/fs/notify/vfsmount_mark.c b/fs/notify/vfsmount_mark.c -index ac851e8..faefa72 100644 ---- a/fs/notify/vfsmount_mark.c -+++ b/fs/notify/vfsmount_mark.c -@@ -153,6 +153,7 @@ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark, - struct mount *m = real_mount(mnt); - struct fsnotify_mark *lmark, *last = NULL; - int ret = 0; -+ int cmp; - - mark->flags |= FSNOTIFY_MARK_FLAG_VFSMOUNT; - -@@ -178,11 +179,8 @@ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark, - goto out; - } - -- if (mark->group->priority < lmark->group->priority) -- continue; -- -- if ((mark->group->priority == lmark->group->priority) && -- (mark->group < lmark->group)) -+ cmp = fsnotify_compare_groups(lmark->group, mark->group); -+ if (cmp < 0) - continue; - - hlist_add_before_rcu(&mark->m.m_list, &lmark->m.m_list); --- -1.8.3.1 - diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch deleted file mode 100644 index f68a3747b..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch +++ /dev/null @@ -1,899 +0,0 @@ -From 75349cc7326dd2aa645bf21fe65a40c68b386c29 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= <jsmoeller@linuxfoundation.org> -Date: Wed, 28 Jun 2017 00:35:18 +0200 -Subject: [PATCH] [SEC][Backport] Fix CVE-2017-1000364 through backport -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fix CVE-2017-1000364 through backport of upstream patches (from 4.9 branch): -- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=cfc0eb403816c5c4f9667d959de5e22789b5421e -- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=5d10ad6297260e9b85e7645ee544a6115bb229e4 -- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=ce7fe8595902c3f03ef528c2dc1928b3f4b67fcf - -Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org> ---- - Documentation/kernel-parameters.txt | 7 ++ - arch/arc/mm/mmap.c | 2 +- - arch/arm/mm/mmap.c | 4 +- - arch/frv/mm/elf-fdpic.c | 2 +- - arch/mips/mm/mmap.c | 2 +- - arch/parisc/kernel/sys_parisc.c | 15 ++-- - arch/powerpc/mm/hugetlbpage-radix.c | 2 +- - arch/powerpc/mm/mmap.c | 4 +- - arch/powerpc/mm/slice.c | 2 +- - arch/s390/mm/mmap.c | 4 +- - arch/sh/mm/mmap.c | 4 +- - arch/sparc/kernel/sys_sparc_64.c | 4 +- - arch/sparc/mm/hugetlbpage.c | 2 +- - arch/tile/mm/hugetlbpage.c | 2 +- - arch/x86/kernel/sys_x86_64.c | 4 +- - arch/x86/mm/hugetlbpage.c | 2 +- - arch/xtensa/kernel/syscall.c | 2 +- - fs/hugetlbfs/inode.c | 2 +- - fs/proc/task_mmu.c | 4 - - include/linux/mm.h | 53 ++++++------ - mm/gup.c | 5 -- - mm/memory.c | 38 --------- - mm/mmap.c | 158 ++++++++++++++++++++++-------------- - 23 files changed, 159 insertions(+), 165 deletions(-) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 46726d4899fe..c1980b5c6a15 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -3852,6 +3852,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. - spia_pedr= - spia_peddr= - -+ stack_guard_gap= [MM] -+ override the default stack gap protection. The value -+ is in page units and it defines how many pages prior -+ to (for stacks growing down) resp. after (for stacks -+ growing up) the main stack are reserved for no other -+ mapping. Default value is 256 pages. -+ - stacktrace [FTRACE] - Enabled the stack tracer on boot up. - -diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c -index 2e06d56e987b..cf4ae6958240 100644 ---- a/arch/arc/mm/mmap.c -+++ b/arch/arc/mm/mmap.c -@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c -index 66353caa35b9..641334ebf46d 100644 ---- a/arch/arm/mm/mmap.c -+++ b/arch/arm/mm/mmap.c -@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c -index 836f14707a62..efa59f1f8022 100644 ---- a/arch/frv/mm/elf-fdpic.c -+++ b/arch/frv/mm/elf-fdpic.c -@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - addr = PAGE_ALIGN(addr); - vma = find_vma(current->mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - goto success; - } - -diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c -index 353037699512..c5fdea5debe5 100644 ---- a/arch/mips/mm/mmap.c -+++ b/arch/mips/mm/mmap.c -@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c -index 0a393a04e891..1d7691fa8ab2 100644 ---- a/arch/parisc/kernel/sys_parisc.c -+++ b/arch/parisc/kernel/sys_parisc.c -@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - unsigned long task_size = TASK_SIZE; - int do_color_align, last_mmap; - struct vm_unmapped_area_info info; -@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - else - addr = PAGE_ALIGN(addr); - -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - int do_color_align, last_mmap; -@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = COLOR_ALIGN(addr, last_mmap, pgoff); - else - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - goto found_addr; - } - -diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c -index 35254a678456..a2b2d97f7eda 100644 ---- a/arch/powerpc/mm/hugetlbpage-radix.c -+++ b/arch/powerpc/mm/hugetlbpage-radix.c -@@ -65,7 +65,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - /* -diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c -index 2f1e44362198..5bc2845cddf4 100644 ---- a/arch/powerpc/mm/mmap.c -+++ b/arch/powerpc/mm/mmap.c -@@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 2b27458902ee..c4d5c9c61e0f 100644 ---- a/arch/powerpc/mm/slice.c -+++ b/arch/powerpc/mm/slice.c -@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, - if ((mm->task_size - len) < addr) - return 0; - vma = find_vma(mm, addr); -- return (!vma || (addr + len) <= vma->vm_start); -+ return (!vma || (addr + len) <= vm_start_gap(vma)); - } - - static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice) -diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c -index eb9df2822da1..812368f274c9 100644 ---- a/arch/s390/mm/mmap.c -+++ b/arch/s390/mm/mmap.c -@@ -98,7 +98,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -136,7 +136,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c -index 6777177807c2..7df7d5944188 100644 ---- a/arch/sh/mm/mmap.c -+++ b/arch/sh/mm/mmap.c -@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c -index fe8b8ee8e660..02e05e221b94 100644 ---- a/arch/sparc/kernel/sys_sparc_64.c -+++ b/arch/sparc/kernel/sys_sparc_64.c -@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c -index 988acc8b1b80..58cde8d9be8a 100644 ---- a/arch/sparc/mm/hugetlbpage.c -+++ b/arch/sparc/mm/hugetlbpage.c -@@ -116,7 +116,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, HPAGE_SIZE); - vma = find_vma(mm, addr); - if (task_size - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c -index 77ceaa343fce..67508b249ede 100644 ---- a/arch/tile/mm/hugetlbpage.c -+++ b/arch/tile/mm/hugetlbpage.c -@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (current->mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c -index 10e0272d789a..136ad7c1ce7b 100644 ---- a/arch/x86/kernel/sys_x86_64.c -+++ b/arch/x86/kernel/sys_x86_64.c -@@ -143,7 +143,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (end - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -@@ -186,7 +186,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c -index 2ae8584b44c7..fe342e8ed529 100644 ---- a/arch/x86/mm/hugetlbpage.c -+++ b/arch/x86/mm/hugetlbpage.c -@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - if (mm->get_unmapped_area == arch_get_unmapped_area) -diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c -index 83cf49685373..3aaaae18417c 100644 ---- a/arch/xtensa/kernel/syscall.c -+++ b/arch/xtensa/kernel/syscall.c -@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, - /* At this point: (!vmm || addr < vmm->vm_end). */ - if (TASK_SIZE - len < addr) - return -ENOMEM; -- if (!vmm || addr + len <= vmm->vm_start) -+ if (!vmm || addr + len <= vm_start_gap(vmm)) - return addr; - addr = vmm->vm_end; - if (flags & MAP_SHARED) -diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c -index 4ea71eba40a5..aac9114728c3 100644 ---- a/fs/hugetlbfs/inode.c -+++ b/fs/hugetlbfs/inode.c -@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index 2750949397eb..5feada822930 100644 ---- a/fs/proc/task_mmu.c -+++ b/fs/proc/task_mmu.c -@@ -309,11 +309,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) - - /* We don't show the stack guard page in /proc/maps */ - start = vma->vm_start; -- if (stack_guard_page_start(vma, start)) -- start += PAGE_SIZE; - end = vma->vm_end; -- if (stack_guard_page_end(vma, end)) -- end -= PAGE_SIZE; - - seq_setwidth(m, 25 + sizeof(void *) * 6 - 1); - seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ", -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 582d30baaa86..31206cc2e99c 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -1392,39 +1392,11 @@ int clear_page_dirty_for_io(struct page *page); - - int get_cmdline(struct task_struct *task, char *buffer, int buflen); - --/* Is the vma a continuation of the stack vma above it? */ --static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN); --} -- - static inline bool vma_is_anonymous(struct vm_area_struct *vma) - { - return !vma->vm_ops; - } - --static inline int stack_guard_page_start(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSDOWN) && -- (vma->vm_start == addr) && -- !vma_growsdown(vma->vm_prev, addr); --} -- --/* Is the vma a continuation of the stack vma below it? */ --static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr) --{ -- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP); --} -- --static inline int stack_guard_page_end(struct vm_area_struct *vma, -- unsigned long addr) --{ -- return (vma->vm_flags & VM_GROWSUP) && -- (vma->vm_end == addr) && -- !vma_growsup(vma->vm_next, addr); --} -- - int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t); - - extern unsigned long move_page_tables(struct vm_area_struct *vma, -@@ -2153,6 +2125,7 @@ void page_cache_async_readahead(struct address_space *mapping, - pgoff_t offset, - unsigned long size); - -+extern unsigned long stack_guard_gap; - /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ - extern int expand_stack(struct vm_area_struct *vma, unsigned long address); - -@@ -2181,6 +2154,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m - return vma; - } - -+static inline unsigned long vm_start_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_start = vma->vm_start; -+ -+ if (vma->vm_flags & VM_GROWSDOWN) { -+ vm_start -= stack_guard_gap; -+ if (vm_start > vma->vm_start) -+ vm_start = 0; -+ } -+ return vm_start; -+} -+ -+static inline unsigned long vm_end_gap(struct vm_area_struct *vma) -+{ -+ unsigned long vm_end = vma->vm_end; -+ -+ if (vma->vm_flags & VM_GROWSUP) { -+ vm_end += stack_guard_gap; -+ if (vm_end < vma->vm_end) -+ vm_end = -PAGE_SIZE; -+ } -+ return vm_end; -+} -+ - static inline unsigned long vma_pages(struct vm_area_struct *vma) - { - return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; -diff --git a/mm/gup.c b/mm/gup.c -index 22cc22e7432f..4b3723734623 100644 ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -370,11 +370,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma, - /* mlock all present pages, but do not fault in new pages */ - if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK) - return -ENOENT; -- /* For mm_populate(), just skip the stack guard page. */ -- if ((*flags & FOLL_POPULATE) && -- (stack_guard_page_start(vma, address) || -- stack_guard_page_end(vma, address + PAGE_SIZE))) -- return -ENOENT; - if (*flags & FOLL_WRITE) - fault_flags |= FAULT_FLAG_WRITE; - if (*flags & FOLL_REMOTE) -diff --git a/mm/memory.c b/mm/memory.c -index 45f39f391cc2..527ef7841146 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -2695,40 +2695,6 @@ out_release: - } - - /* -- * This is like a special single-page "expand_{down|up}wards()", -- * except we must first make sure that 'address{-|+}PAGE_SIZE' -- * doesn't hit another vma. -- */ --static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address) --{ -- address &= PAGE_MASK; -- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) { -- struct vm_area_struct *prev = vma->vm_prev; -- -- /* -- * Is there a mapping abutting this one below? -- * -- * That's only ok if it's the same stack mapping -- * that has gotten split.. -- */ -- if (prev && prev->vm_end == address) -- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; -- -- return expand_downwards(vma, address - PAGE_SIZE); -- } -- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { -- struct vm_area_struct *next = vma->vm_next; -- -- /* As VM_GROWSDOWN but s/below/above/ */ -- if (next && next->vm_start == address + PAGE_SIZE) -- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; -- -- return expand_upwards(vma, address + PAGE_SIZE); -- } -- return 0; --} -- --/* - * We enter with non-exclusive mmap_sem (to exclude vma changes, - * but allow concurrent faults), and pte mapped but not yet locked. - * We return with mmap_sem still held, but pte unmapped and unlocked. -@@ -2744,10 +2710,6 @@ static int do_anonymous_page(struct fault_env *fe) - if (vma->vm_flags & VM_SHARED) - return VM_FAULT_SIGBUS; - -- /* Check if we need to add a guard page to the stack */ -- if (check_stack_guard_page(vma, fe->address) < 0) -- return VM_FAULT_SIGSEGV; -- - /* - * Use pte_alloc() instead of pte_alloc_map(). We can't run - * pte_offset_map() on pmds where a huge pmd might be created -diff --git a/mm/mmap.c b/mm/mmap.c -index f3ebc5a54367..e1c1eb4b3942 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -176,6 +176,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - unsigned long retval; - unsigned long newbrk, oldbrk; - struct mm_struct *mm = current->mm; -+ struct vm_area_struct *next; - unsigned long min_brk; - bool populate; - -@@ -221,7 +222,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) - } - - /* Check against existing mmap mappings. */ -- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE)) -+ next = find_vma(mm, oldbrk); -+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next)) - goto out; - - /* Ok, looks good - let it rip. */ -@@ -244,10 +246,22 @@ out: - - static long vma_compute_subtree_gap(struct vm_area_struct *vma) - { -- unsigned long max, subtree_gap; -- max = vma->vm_start; -- if (vma->vm_prev) -- max -= vma->vm_prev->vm_end; -+ unsigned long max, prev_end, subtree_gap; -+ -+ /* -+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we -+ * allow two stack_guard_gaps between them here, and when choosing -+ * an unmapped area; whereas when expanding we only require one. -+ * That's a little inconsistent, but keeps the code here simpler. -+ */ -+ max = vm_start_gap(vma); -+ if (vma->vm_prev) { -+ prev_end = vm_end_gap(vma->vm_prev); -+ if (max > prev_end) -+ max -= prev_end; -+ else -+ max = 0; -+ } - if (vma->vm_rb.rb_left) { - subtree_gap = rb_entry(vma->vm_rb.rb_left, - struct vm_area_struct, vm_rb)->rb_subtree_gap; -@@ -343,7 +357,7 @@ static void validate_mm(struct mm_struct *mm) - anon_vma_unlock_read(anon_vma); - } - -- highest_address = vma->vm_end; -+ highest_address = vm_end_gap(vma); - vma = vma->vm_next; - i++; - } -@@ -512,7 +526,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = vma->vm_end; -+ mm->highest_vm_end = vm_end_gap(vma); - - /* - * vma->vm_prev wasn't known when we followed the rbtree to find the -@@ -765,7 +779,7 @@ again: - vma_gap_update(vma); - if (end_changed) { - if (!next) -- mm->highest_vm_end = end; -+ mm->highest_vm_end = vm_end_gap(vma); - else if (!adjust_next) - vma_gap_update(next); - } -@@ -1630,7 +1644,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit left subtree if it looks promising */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end >= low_limit && vma->vm_rb.rb_left) { - struct vm_area_struct *left = - rb_entry(vma->vm_rb.rb_left, -@@ -1641,12 +1655,13 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info) - } - } - -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - check_current: - /* Check if current node has a suitable gap */ - if (gap_start > high_limit) - return -ENOMEM; -- if (gap_end >= low_limit && gap_end - gap_start >= length) -+ if (gap_end >= low_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit right subtree if it looks promising */ -@@ -1668,8 +1683,8 @@ check_current: - vma = rb_entry(rb_parent(prev), - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_left) { -- gap_start = vma->vm_prev->vm_end; -- gap_end = vma->vm_start; -+ gap_start = vm_end_gap(vma->vm_prev); -+ gap_end = vm_start_gap(vma); - goto check_current; - } - } -@@ -1733,7 +1748,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - while (true) { - /* Visit right subtree if it looks promising */ -- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0; -+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0; - if (gap_start <= high_limit && vma->vm_rb.rb_right) { - struct vm_area_struct *right = - rb_entry(vma->vm_rb.rb_right, -@@ -1746,10 +1761,11 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) - - check_current: - /* Check if current node has a suitable gap */ -- gap_end = vma->vm_start; -+ gap_end = vm_start_gap(vma); - if (gap_end < low_limit) - return -ENOMEM; -- if (gap_start <= high_limit && gap_end - gap_start >= length) -+ if (gap_start <= high_limit && -+ gap_end > gap_start && gap_end - gap_start >= length) - goto found; - - /* Visit left subtree if it looks promising */ -@@ -1772,7 +1788,7 @@ check_current: - struct vm_area_struct, vm_rb); - if (prev == vma->vm_rb.rb_right) { - gap_start = vma->vm_prev ? -- vma->vm_prev->vm_end : 0; -+ vm_end_gap(vma->vm_prev) : 0; - goto check_current; - } - } -@@ -1810,7 +1826,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - unsigned long len, unsigned long pgoff, unsigned long flags) - { - struct mm_struct *mm = current->mm; -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct vm_unmapped_area_info info; - - if (len > TASK_SIZE - mmap_min_addr) -@@ -1821,9 +1837,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, - - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -1846,7 +1863,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) - { -- struct vm_area_struct *vma; -+ struct vm_area_struct *vma, *prev; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; - struct vm_unmapped_area_info info; -@@ -1861,9 +1878,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - /* requesting a specific address */ - if (addr) { - addr = PAGE_ALIGN(addr); -- vma = find_vma(mm, addr); -+ vma = find_vma_prev(mm, addr, &prev); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vma->vm_start)) -+ (!vma || addr + len <= vm_start_gap(vma)) && -+ (!prev || addr >= vm_end_gap(prev))) - return addr; - } - -@@ -1998,21 +2016,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr, - * update accounting. This is shared with both the - * grow-up and grow-down cases. - */ --static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow) -+static int acct_stack_growth(struct vm_area_struct *vma, -+ unsigned long size, unsigned long grow) - { - struct mm_struct *mm = vma->vm_mm; - struct rlimit *rlim = current->signal->rlim; -- unsigned long new_start, actual_size; -+ unsigned long new_start; - - /* address space limit tests */ - if (!may_expand_vm(mm, vma->vm_flags, grow)) - return -ENOMEM; - - /* Stack limit test */ -- actual_size = size; -- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN))) -- actual_size -= PAGE_SIZE; -- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) -+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur)) - return -ENOMEM; - - /* mlock limit tests */ -@@ -2050,16 +2066,32 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns - int expand_upwards(struct vm_area_struct *vma, unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *next; -+ unsigned long gap_addr; - int error = 0; - - if (!(vma->vm_flags & VM_GROWSUP)) - return -EFAULT; - -- /* Guard against wrapping around to address 0. */ -- if (address < PAGE_ALIGN(address+4)) -- address = PAGE_ALIGN(address+4); -- else -+ /* Guard against exceeding limits of the address space. */ -+ address &= PAGE_MASK; -+ if (address >= TASK_SIZE) - return -ENOMEM; -+ address += PAGE_SIZE; -+ -+ /* Enforce stack_guard_gap */ -+ gap_addr = address + stack_guard_gap; -+ -+ /* Guard against overflow */ -+ if (gap_addr < address || gap_addr > TASK_SIZE) -+ gap_addr = TASK_SIZE; -+ -+ next = vma->vm_next; -+ if (next && next->vm_start < gap_addr) { -+ if (!(next->vm_flags & VM_GROWSUP)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } - - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) -@@ -2104,7 +2136,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (vma->vm_next) - vma_gap_update(vma->vm_next); - else -- mm->highest_vm_end = address; -+ mm->highest_vm_end = vm_end_gap(vma); - spin_unlock(&mm->page_table_lock); - - perf_event_mmap(vma); -@@ -2125,6 +2157,8 @@ int expand_downwards(struct vm_area_struct *vma, - unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; -+ struct vm_area_struct *prev; -+ unsigned long gap_addr; - int error; - - address &= PAGE_MASK; -@@ -2132,6 +2166,17 @@ int expand_downwards(struct vm_area_struct *vma, - if (error) - return error; - -+ /* Enforce stack_guard_gap */ -+ gap_addr = address - stack_guard_gap; -+ if (gap_addr > address) -+ return -ENOMEM; -+ prev = vma->vm_prev; -+ if (prev && prev->vm_end > gap_addr) { -+ if (!(prev->vm_flags & VM_GROWSDOWN)) -+ return -ENOMEM; -+ /* Check that both stack segments have the same anon_vma? */ -+ } -+ - /* We must make sure the anon_vma is allocated. */ - if (unlikely(anon_vma_prepare(vma))) - return -ENOMEM; -@@ -2186,28 +2231,25 @@ int expand_downwards(struct vm_area_struct *vma, - return error; - } - --/* -- * Note how expand_stack() refuses to expand the stack all the way to -- * abut the next virtual mapping, *unless* that mapping itself is also -- * a stack mapping. We want to leave room for a guard page, after all -- * (the guard page itself is not added here, that is done by the -- * actual page faulting logic) -- * -- * This matches the behavior of the guard page logic (see mm/memory.c: -- * check_stack_guard_page()), which only allows the guard page to be -- * removed under these circumstances. -- */ -+/* enforced gap between the expanding stack and other mappings. */ -+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT; -+ -+static int __init cmdline_parse_stack_guard_gap(char *p) -+{ -+ unsigned long val; -+ char *endptr; -+ -+ val = simple_strtoul(p, &endptr, 10); -+ if (!*endptr) -+ stack_guard_gap = val << PAGE_SHIFT; -+ -+ return 0; -+} -+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap); -+ - #ifdef CONFIG_STACK_GROWSUP - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *next; -- -- address &= PAGE_MASK; -- next = vma->vm_next; -- if (next && next->vm_start == address + PAGE_SIZE) { -- if (!(next->vm_flags & VM_GROWSUP)) -- return -ENOMEM; -- } - return expand_upwards(vma, address); - } - -@@ -2229,14 +2271,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) - #else - int expand_stack(struct vm_area_struct *vma, unsigned long address) - { -- struct vm_area_struct *prev; -- -- address &= PAGE_MASK; -- prev = vma->vm_prev; -- if (prev && prev->vm_end == address) { -- if (!(prev->vm_flags & VM_GROWSDOWN)) -- return -ENOMEM; -- } - return expand_downwards(vma, address); - } - -@@ -2334,7 +2368,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, - vma->vm_prev = prev; - vma_gap_update(vma); - } else -- mm->highest_vm_end = prev ? prev->vm_end : 0; -+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0; - tail_vma->vm_next = NULL; - - /* Kill the cache */ --- -2.12.3 - diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/ath9k_htc.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/ath9k_htc.cfg deleted file mode 100644 index 6f7d49880..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/ath9k_htc.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_CFG80211=m -CONFIG_MAC80211=m -CONFIG_ATH_CARDS=m -CONFIG_ATH9K_HTC=m diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/drm.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/drm.cfg deleted file mode 100644 index 65fe71cd0..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/drm.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_DRM_BOCHS=y -CONFIG_DRM_VIRTIO_GPU=y diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/fanotify.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/fanotify.cfg deleted file mode 100644 index de5dd8d31..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/fanotify.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Enable the fanotify API (notification/interception of FS events) -CONFIG_FANOTIFY=y -CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/hid.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/hid.cfg deleted file mode 100644 index 327c753ae..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/hid.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_HID_MULTITOUCH=y diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/rtl_sdr.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/rtl_sdr.cfg deleted file mode 100644 index d4574700a..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/rtl_sdr.cfg +++ /dev/null @@ -1,4 +0,0 @@ -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-bsp/recipes-kernel/linux/linux-yocto/uinput.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/uinput.cfg deleted file mode 100644 index 7996ef1dd..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/uinput.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Enable the User-level Input driver (required by "wayland-fits") -CONFIG_INPUT_MISC=y -CONFIG_INPUT_UINPUT=m diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/vbox-vmware-sata.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/vbox-vmware-sata.cfg deleted file mode 100644 index e9c2a1468..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/vbox-vmware-sata.cfg +++ /dev/null @@ -1,20 +0,0 @@ -# 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_VMWARE_BALLOON=m -CONFIG_VMWARE_VMCI=m -CONFIG_VMWARE_VMCI_VSOCKETS=m -CONFIG_SND_ENS1371=m -# vmwgfx doesn't yet work with AGL. If you can fix it, please change this! -CONFIG_DRM_VMWGFX=n -CONFIG_DRM_VMWGFX_FBCON=n diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend deleted file mode 100644 index 8205a3feb..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend +++ /dev/null @@ -1,23 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:" - -# Extra configuration options for the QEMU kernel -SRC_URI += "file://fanotify.cfg \ - file://uinput.cfg \ - file://hid.cfg \ - file://drm.cfg \ - " - -# Enable support for TP-Link TL-W722N USB Wifi adapter -SRC_URI += " file://ath9k_htc.cfg \ - " - -# Enable support for RTLSDR -SRC_URI += " file://rtl_sdr.cfg \ - " - -# disk drivers for vmdk -SRC_URI_append_qemux86 = " file://vbox-vmware-sata.cfg " -SRC_URI_append_qemux86-64 = " file://vbox-vmware-sata.cfg " - -# Backported fix for CVE-2017-1000364 -SRC_URI_append = " file://4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch " diff --git a/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg b/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg deleted file mode 100644 index 5966198d7..000000000 --- a/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg +++ /dev/null @@ -1,39 +0,0 @@ -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_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_C_CAN 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_SOFTING is not set -# CONFIG_CAN_DEBUG_DEVICES is not set diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch new file mode 100644 index 000000000..d83c65257 --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch @@ -0,0 +1,28 @@ +From 2701d65271686dff0cb39ab7da1e821f5dede61e Mon Sep 17 00:00:00 2001 +From: Leonid Lazarev <leonid.lazarev@mera.com> +Date: Tue, 21 Apr 2020 17:28:16 +0300 +Subject: [PATCH] XEN on RPi4 1GB lmitation workaround: XEN tries to allocated + the memopry for dom0 within first 4GB, but for some reason raspberry pi only + allows to load kernel from 1st GB. Push XEN to allocate first bank for dom0 + from 1st GB + +--- + xen/arch/arm/domain_build.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c +index dd9c3b73ba..8501a8c8aa 100644 +--- a/xen/arch/arm/domain_build.c ++++ b/xen/arch/arm/domain_build.c +@@ -281,7 +281,7 @@ static void __init allocate_memory_11(struct domain *d, + */ + while ( order >= min_low_order ) + { +- for ( bits = order ; bits <= (lowmem ? 32 : PADDR_BITS); bits++ ) ++ for ( bits = order ; bits <= (lowmem ? 30 : PADDR_BITS); bits++ ) + { + pg = alloc_domheap_pages(d, order, MEMF_bits(bits)); + if ( pg != NULL ) +-- +2.17.1 + diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb new file mode 100644 index 000000000..b857cb19f --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb @@ -0,0 +1,29 @@ +DESCRIPTION = "Xen hypervisor u-boot image" +LICENSE = "GPL-2.0-only" +SECTION = "console/tools" + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + + + +ALLOW_EMPTY:${PN} = "1" +FILES:${PN} = "" +S = "${WORKDIR}" + +DEPENDS = "u-boot-mkimage-native " + +# Only for aarch64 +COMPATIBLE_MACHINE = "(-)" +COMPATIBLE_MACHINE:aarch64 = "(.*)" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_configure[noexec] = "1" +do_deploy[noexec] = "1" + +do_compile[depends] += "xen:do_deploy" + +# Uboot compatible image +do_compile () { + uboot-mkimage -A arm64 -C none -T kernel -a 0x48080000 -e 0x48080000 -n "XEN" -d ${DEPLOY_DIR_IMAGE}/xen-${MACHINE} ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.uImage +} diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend new file mode 100644 index 000000000..a67200618 --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend @@ -0,0 +1,11 @@ + +# make the package specific to the machine for now +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# rpi4 +LIC_FILES_CHKSUM:raspberrypi4 = "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49" +XEN_REL:raspberrypi4 = "4.13" +SRCREV:raspberrypi4 = "721f2c323ca55c77857c93e7275b4a93a0e15e1f" +SRC_URI:raspberrypi4 = " \ + git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ + " diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend new file mode 100644 index 000000000..2d63e1841 --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend @@ -0,0 +1,18 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +# make the package machine-specific +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# rpi4 specifics +LIC_FILES_CHKSUM:raspberrypi4 = "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49" +XEN_REL:raspberrypi4 = "4.13" + +SRCREV:raspberrypi4 = "721f2c323ca55c77857c93e7275b4a93a0e15e1f" +SRC_URI:append:raspberrypi4 = " file://0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch" + +#due to incorrect xen binary preparation in external library, we add additional deploy +do_deploy:append:raspberrypi4() { + if [ -f ${B}/xen/xen ]; then + install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen-${MACHINE} + fi +} diff --git a/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa/0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa/0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch new file mode 100644 index 000000000..8bc102c92 --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa/0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch @@ -0,0 +1,34 @@ +From 39dea63ebce2764c683c8c2eddbb10cf07a970c4 Mon Sep 17 00:00:00 2001 +From: Marius Vlad <marius.vlad@collabora.com> +Date: Mon, 19 Dec 2022 11:51:28 +0200 +Subject: [PATCH] virgl/virgl_driinfo.h.in: Disable by default emulated BGRA + and swizzling + +Workaround in place for virtio aarch64 to avoid graphical artefacts when +first time booting up on PVR host driver. + +Introduced with patch 'virgl: Always enable emulated BGRA and swizzling +unless specifically told not to' in mesa-20.3.0. + +Signed-off-by: Marius Vlad <marius.vlad@collabora.com> +--- + src/gallium/drivers/virgl/virgl_driinfo.h.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/drivers/virgl/virgl_driinfo.h.in b/src/gallium/drivers/virgl/virgl_driinfo.h.in +index f57e5880965..1c06f932c5c 100644 +--- a/src/gallium/drivers/virgl/virgl_driinfo.h.in ++++ b/src/gallium/drivers/virgl/virgl_driinfo.h.in +@@ -8,7 +8,7 @@ + // 5. Implement the tweak in virglrenderer + DRI_CONF_SECTION_MISCELLANEOUS + DRI_CONF_FORMAT_L8_SRGB_ENABLE_READBACK(false) +- DRI_CONF_GLES_EMULATE_BGRA(true) +- DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(true) ++ DRI_CONF_GLES_EMULATE_BGRA(false) ++ DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(false) + DRI_CONF_GLES_SAMPLES_PASSED_VALUE(1024, 1, 400000000) + DRI_CONF_SECTION_END +-- +2.35.1 + diff --git a/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa_22.%.bbappend b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa_22.%.bbappend new file mode 100644 index 000000000..0a6606ebf --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa_22.%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch" diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto-dev.bbappend b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto-dev.bbappend new file mode 100644 index 000000000..5970414eb --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto-dev.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/linux-yocto:" + +SRC_URI:append:virtio-all = " \ + git://gerrit.automotivelinux.org/gerrit/src/agl-yocto-kernel-meta.git;protocol=https;type=kmeta;name=agl-meta;destsuffix=agl-kernel-meta;branch=master \ + file://virtio-aarch64-${LINUX_KERNEL_TYPE}.scc \ +" + +SRCREV_agl-meta = "c5008f4ba9e1b9f11c1014b53477079e605ceab7" + +COMPATIBLE_MACHINE:virtio-aarch64 = "virtio-aarch64" diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-aarch64-standard.scc b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-aarch64-standard.scc new file mode 100644 index 000000000..2d1570e9f --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-aarch64-standard.scc @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: MIT +define KMACHINE virtio-aarch64 +define KTYPE standard +define KARCH arm64 + +include ktypes/standard/standard.scc nopatch +include arch/arm/aarch64.scc +include cfg/8250.scc +include cfg/virtio.scc +include bsp/virtio/agl-virtio.scc + +# enable the ability to run 32 bit apps +include arch/arm/32bit-compat.scc diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-drm.cfg b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-drm.cfg new file mode 100644 index 000000000..2facc345e --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-drm.cfg @@ -0,0 +1,3 @@ +CONFIG_DRM=y +CONFIG_FB=y +CONFIG_DRM_FBDEV_EMULATION=y diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-pci.cfg b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-pci.cfg new file mode 100644 index 000000000..bbcaca312 --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-pci.cfg @@ -0,0 +1,3 @@ +CONFIG_PCI=y +CONFIG_VIRTIO_PCI=y +CONFIG_PCI_HOST_GENERIC=y diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend new file mode 100644 index 000000000..6952436a3 --- /dev/null +++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend @@ -0,0 +1,17 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +# Cannot just append to SRC_URI, as the metadata interferes with the +# AGL config fragment scheme +AGL_KERNEL_SRC:prepend:virtio-all = " \ + git://gerrit.automotivelinux.org/gerrit/src/agl-yocto-kernel-meta.git;protocol=https;type=kmeta;name=agl-meta;destsuffix=agl-kernel-meta;branch=kernel-5.15 \ + file://virtio-aarch64-${LINUX_KERNEL_TYPE}.scc \ +" + +SRCREV_agl-meta = "4deb7357eab5962b0553a5ad1f11be5ac35f9da9" + +AGL_KCONFIG_FRAGMENTS:append:virtio-all = " \ + virtio-drm.cfg \ + virtio-pci.cfg \ +" + +COMPATIBLE_MACHINE:virtio-aarch64 = "virtio-aarch64" diff --git a/meta-agl-bsp/wic/directdisk.wks.in b/meta-agl-bsp/wic/directdisk.wks.in new file mode 100644 index 000000000..f7b220cdb --- /dev/null +++ b/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-bsp/wic/sdimage-bootpart-uuid.wks b/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks new file mode 100644 index 000000000..1f51a0bd4 --- /dev/null +++ b/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-bsp/wic/singlepart-noloader.wks b/meta-agl-bsp/wic/singlepart-noloader.wks new file mode 100644 index 000000000..31c499aee --- /dev/null +++ b/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-bsp/wic/systemd-intel-corei7-64-bootdisk.wks b/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks new file mode 100644 index 000000000..db46c1835 --- /dev/null +++ b/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" --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" |