arm/dts: msm8974: Fix typo errors in DDR bus vector "ab" value

- Fix typo errors in bus vector "ab" value for
  VIDC DDR bus bandwidth

CRs-Fixed: 523603
Change-Id: I2f3d2628d56fe036ab016e71c9254eb7c403f5e7
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
USB: bam: Enable RAM12, RAM13 only for QDSS data & descriptor fifo

Currently for QDSS<->USB usecase, DWC3 core internal memory
(RAM11, RAM12, RAM13) is used for data & descriptor fifos. A data
fifo of 8KB size is enough for achieving maximum QDSS performance
instead of 16KB size. Hence enable only RAM12, RAM13 for QDSS<->USB
usecase so that remaining RAM10, RAM11 can be used for TX endpoint's
fifo allocation. This enables more fifo allocation for TX endpoints,
which will allow double buffering and results in better throughput
improvement.

CRs-Fixed: 532070
Change-Id: I7637bda9520b92537b9297f30d6003d2b6ceccf7
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
kernel: rng: Add IOCTL support to disable bus bandwidth

QRNG bus scale is set to high before qrng_read & set to
low after qrng_read, this impacts the performance during
boot-up, as there are various clients using qrng during
bootup. Inorder to fix this problem, a daemon is introduced
which calls into kernel module (that sets low bandwidth).
This change supports the IOCTL call to disable the bus bandwidth.

Change-Id: I386d1eb4c50c057ae2852e7f9d47c8db8e522ca5
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
msm: pil-msa: Fix authentication error path

Once the Q6 has booted, it is not possible to access
MSS registers. If there is an error during the auth
process, don't attempt to touch those registers.

Also, ensure that MSS_RESTART is re-asserted in the
error path as well.

Change-Id: I1e062f73f1dfdbf60c038c61f5ccd7358e81c702
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: Update Ion and IOMMU APIs to use dma_addr_t

The current APIs for Ion and the custom IOMMU mapping assume that
many parameters are unsigned long. This type is not big enough to
hold physical addresses on LPAE systems. Update the APIs to accomodate
these types. Because we are updating the APIs, all clients need to be
updated as well, either by using the correct type or using a cast
where necessary.

Change-Id: I12e6fb6ec8a8481a7eef374cb9316e5ccbc29090
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

Conflicts:
	drivers/media/v4l2-core/videobuf2-msm-mem.c
	drivers/video/msm/mdss/mdp3.c
	drivers/video/msm/mdss/mdp3_ctrl.c
	drivers/video/msm/mdss/mdp3_dma.c
Revert "msm: mdss: Use interruptible thread in mdss_fb"

This reverts commit fda2ee71d1d106ab113cccab071141922f9f0509.
mdss: display: add command mode mdp fifo underflow recovery

At command mode, mdp underflow can not be recovered but cause
mdp to hang up. Add mdp underflow recovery mechanism  when mdp
underflow detected.

Change-Id: I26fc64005ac247372257aa126f2c8c0076925bb9
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_ctl.c
	drivers/video/msm/mdss/mdss_panel.h
msm: mdss: Use interruptible threads

Based on @cyanogen's findings, use interruptible threads to reduce
cpu load.
msm: mdss: remove interruptible timeout waits

Currently display driver contexts are not utilizing interruptible
wake-ups while using wait_for_completion_interruptible_timeout. This
can lead to incorrect context wake-up and un-predictable outcome. Since
there is already a timeout attached to these kind of context sleeps, it
is safe to replace them with wait_for_completion_timeout.

Change-Id: Ia528debf34aef0acdda2bea1219a128c200c3651
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: Make notify update waits interruptible

Wait for completion in notify update call are uninterruptible
causing excessive delay during suspend cases. Making them
interruptible.

Change-Id: I1a4ff6ce3e0add21d4e46a41372b076b277d10f5
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: kgsl: Add CMA memory feature to support NOMMU for GPU

Reserves CMA memory for kgsl driver early during bootup and then
uses dma_alloc_coherent() to allocate physically contiguous memory
instead of using the MMU

Change-Id: Ica9b244fe9b9d8a902d670293a0bec2edf81bd5d
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>

Conflicts:
	drivers/gpu/msm/kgsl_sharedmem.c
msm: kgsl: remove or fix badly formated printk messages

Remove allocation failure errors, since we'll already get
plenty of notice from the kernel when this happens.

Use %zu when printing size_t values for portability.

Change-Id: I746043bd12116066e6b3c07a5fcabcbc9b00dba9
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>

Conflicts:
	drivers/gpu/msm/kgsl_sharedmem.c
msm: kgsl: sysfs store and show should return ssize_t

Some of these functions were declared to return int,
which isn't correct.

Change-Id: I428ba09bc8f70109eea2b7193b79cd9461d7f50a
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.c
msm: kgsl: Mark local functions as static and remove unused code

Mark a bunch of functions and structures as static and remove unused
functions.

Change-Id: Ic0dedbadd5520f95293905cf23afec835c786ed7
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.c
	drivers/gpu/msm/adreno.h
	drivers/gpu/msm/adreno_a3xx.c
	drivers/gpu/msm/kgsl.c
	drivers/gpu/msm/kgsl_sharedmem.c
	include/linux/msm_kgsl.h
msm: kgsl: Add struct kgsl_device to kgsl_allocate_contiguous API

We need to pass a non NULL struct device * for the call to
dma_alloc_coherent(). Change certain APIs to allow us to pass
down struct kgsl_device ptr so we can pass in a valid struct
device * to dma_alloc_coherent()

Change-Id: I24eaa2b7834b573b0520f6aa1f00447eb1f35dc6
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
msm: z180: Use kgsl_device when using kgsl_allocate_contiguous API

Signed-off-by: Kostas K <mpokwsths@gmail.com>
msm: kgsl: Add kgsl_malloc/kgsl_free helpers

Instead of constantly trying to reinvent the wheel when doing
kernel allocations of indeterminate size create a alloc/free
pair of functions that can do the magic for us. Replace all of
the existing bits and pieces with the new function calls.

Change-Id: Ic0dedbad349ce1196899f4c24a374e0bfed3a923
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Conflicts:
	drivers/gpu/msm/kgsl.h
	drivers/gpu/msm/kgsl_sharedmem.c
ARM: dts: msm: Add reservation for framebuffer memory

The framebuffer needs contiguous memory to work. Add a
dedicated CMA region for framebuffer. This region is
specified with a default size which works for most targets
and overridden for targets that have a larger screen and
therefore require a large framebuffer.

Change-Id: If5f23884f6779ed325be15ee2e16e3bd23ba3698
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
arm/dts: msm8974: Change qseecom device tree setting

set the flag of support-bus-scaling and change ab & ib
value to support bus bandwidth scaling.

Change-Id: Ia509729675b5c8ce13a9367f8909dc29a1c89944
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm: cachedump: Drop support for using IMEM

IMEM usage was only either enabled on older targets that we don't support
anymore or via a device tree property (qcom,use-imem-dump-offset) that
wasn't used.  Current and newer targets use TZ to handle this.

Change-Id: I22ada1475b12a66f39abf0525407df8282874536
Signed-off-by: Kumar Gala <galak@codeaurora.org>