msm: vidc: wfd: Add WFD support for msm8974

Adds three new subdevices:
- Encoder subdevice to interface with new venus driver
    o Renamed enc-subdev.c to enc-mfc-subdev.c which only
      compiles for targets using the Samsung MFC core.
- MDP subdevice to interface with new MDSS driver
    o Renamed mdp-subdev.c to mdp-4-subdev.c used for targets
      using MDP4.
- MDP subdevice for debugging purposes
- Introduce a Kconfig file to properly choose between subdevices
  according to target

Change-Id: I125b39cfdeb1fbb4adf7c15d0c4452146764f985
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: video: wfd: Move domain specific mappings into subdevices

Move the domain specific mappings into subdevices to abstract away iommu
from wfd-ioctl.c.  This is especially needed as the encoder subdevices
for MSM8x60 and MSM8x74 differ in the iommu domain to which they map the
buffer to.  This target specific handling needs to taken care of by the
respective subdevices rather than by wfd-ioctl which should be target
agnostic.

Change-Id: I050d38842b2f6568d77b9e6419b109e2cfdacb76
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
msm: video: wfd: Add Device Tree support

Define Device Tree bindings for wfd and update the driver to match the
specification.

Change-Id: I23d39d8227cf73d95e591e944235f04a0375b295
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
tracing: ftrace events for user faults and undefined instructions

New ftrace events (user_fault and undef_instr) for data, prefetch
or undefined instruction aborts. The new ftrace events are under
events/exception.

Change-Id: Iea328b71a1f623861cac9b45d858c3bbe09e1b82
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
coresight: use ETMPDCR instead of ETMCR for ETM power/clock control

Use ETMPDCR instead of ETMCR for ETM power/clock enable/disable. ETMPDCR
doesn't have corresponding cp14 access and hence will help with subsequent
multicore ETM support changes for 8974. ETMPDCR is available for PFTv1.1
and ETMv3.5 compliant ETM implementations.

Change-Id: I4b190b963cda29b406971cf075db36213b140495
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
jtag: make debug arch defines local to jtag.c

Move debug arch defines to jtag.c since they aren't used anywhere else.
Also rename ARM_DEBUG_ARCH_V7_1 to ARM_DEBUG_ARCH_V7p1 to avoid clashes
with similar define in hw_breakpoint.h that is enabled when hardware
breakpoints are enabled.

Change-Id: I5f4b24b7aec50413f97a5b1854e6fadf2e4ab514
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight: move cp14.h to include/asm/hardware

Move cp14.h to include/asm/hardware so that it can be used by code
inside mach-msm as well as drivers/coresight.

Change-Id: I3f5cd6e1768378ec26abcd1e7328977836dce60f
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Add build/clean kernel script

Change-Id: I50a9bff4031ed6fd2441d9dd6bba6b0a4ebef9f3
Kernel script: Change Toolchain to "arm-eabi-4.6"

Change-Id: Ic95350d9c743ed5d312e0fba11b4483654937d79
kernel scrypt: rename readme file.

msm8x60_readme.txt -> script_readme.txt

Change-Id: I3c14a64c26eeca8b7d0b557ba8bbfc3909dbb39d
kernel scrypt: change toolchain download link

Change-Id: I392e0cdc80a33c6714cf616440ded03add1f47f4
ASoC: msm8974: Audio ocmem driver changes to fix playback issues

Fix issues when alloc grow, shrink requests received while display
off/on. Add return statement to the audio/voice workqueue for the safe
exit.

Change-Id: Ifda7823f68ef0f26b9fe781c4c509c7633291169
CRs-fixed: 404445
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
kernel/msm: 8974: Audio ocmem driver changes to use bus dt APIs

Populate bus vectors for the audio ocmem driver with use of new
bus device tree APIs.

Change-Id: If965c269706763a3a67b22243f265429f23427d6
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
arm/dt: msm8974: Add bus scaling parameters for qseecom

Add the bus bandwidth request  parameters for optimal crypto
hardware performance on secure app. These parameters are issued
to the msm bus bandwidth driver to set the relevant clocks for
optimal crypto operation (needed when streaming encrypted
video/audio data). Without this request, the crypto operations
are quiet slow resulting in poor video performance.

Change-Id: I0d0f315ec4d888ea0bb05118d10a477ba5386ae8
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
msm: msm_bus: Add support for 64-bit bandwidth requests

With 8974, bandwidth requests are exceeding integer size.
Update ab and ib to ensure values over 4Gbps can be requested.

For 64-bit support, there are four changes in this patch:

Changes in the bus driver structures and functions to
update ab and ib values to uint64.

Updates in client drivers to ensure that the bus APIs
are called with the right types.

Updates to the device-tree. Device-tree nodes don't
provide a clean mechanism to read a combination of u32
and u64 variables within the same property name. So, the
ab and ib values must be specified in kbps instead of
bytes/sec from the device tree. The bus driver function
will convert the ab and ib values read from device-tree
to Mbps.

Change the existing property names to make them consistent
with the convention used by the new property  name, which
abides to the Device Tree convention.

Change-Id: Id37407c349a9cea17f6621d3bef2401b856f7b7d
CRs-Fixed: 408786
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
msm: iommu: Synchronize access to IOMMU cfg port

Add remote spinlock that allows CPU and GPU to
synchronize access to IOMMU hardware.

Add usage of remote spinlock to iommu driver and
add depenency on SFPB hardware mutex being enabled.`

This feature is not using SFPB hardware mutex. However,
SFPB hardware mutex must be enabled since the remote
spinlock implementation is making use of shared memory
that is normally used when SFPB hardware mutex is not enabled.

Change-Id: I42e11d742e295110843c4b45d6d27cc665d42b7b
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: Kconfig: Enable IOMMU CPU-GPU synchronization

Enable synchronization between CPU and GPU for
IOMMU configuration register accesses.

Change-Id: I2fd7ac22c32e31d22aa74eecdb11b7b8be6ca77a
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
iommu/msm: fix the include guard in iommu.h

msm_soc_version_supports_iommu_v1() was defined outside the guard.

Change-Id: I47a579cf14c159c4cbe44b855067c0b82da7b552
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Alex Wong <waiw@codeaurora.org>
msm: mpdecision: make runqueue divisor configurable via sysfs

The runqueue divisor controls how sensitive mpdecision is to
changes in runqueue depth - if the runqueue divisor is increased,
updates to TZ are made less frequently. It is desirable to be able
to easily change this parameter from userspace.

(cherry picked from commit f5d5d54a8c64337115a44d9d9292c677042c9fc1)

Change-Id: Ibfadc7fba413ae08467ded737e192fd918e97755
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
msm: dcvs: add ss_no_corr_below_freq parameter

The busy/idle behavior of different cores can be correlated by
DCVS when determining what frequency to run cores at. However,
this is not desirable below a certain frequency. Add a parameter
to establish what this frequency is. The parameter is configurable
in userspace via sysfs.

The ss_iobusy_conv parameter is currently unused, so it is
being replaced with ss_no_corr_below_freq.

(cherry picked from commit e8c6d615259af5fde8a6613f53c41c212407bda9)

Change-Id: Ibf814f3f93b92a532d7b3af80721a5bc7db1bd31
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>