msm: devices-msm7x27a: Add pl310 errp device for 8625

PL310 error reporting device registration for 8625

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit 364426eb6ed879669866b05a3a8e94a4e72b6322)

Change-Id: I4905eafb77f8ab46b506afa34b88d21b4ed5efc0
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
mm: cache-pl310-erp: Add support for PL310 Error Reporting

PL310 is an external L2 Cache controller which reports
any errors such as decode on master/slave, read/write
parity errors on data/tag RAM using the L2CC interrupt
connected to the processor.
Once we receive interrupt we can read the status register
to determine the type of error occurred.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit 263b7d6fa330db011e9f2fa05657ee5b619b9969)

Change-Id: I94dff25b5546123985bced271262b478ba0d3e77
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
defconfig: msm7627a: Enable pl310 err reporting module

Enable PL310 error reporting module, incase of any L2 errors
this driver will be able to catch those and show them as
interrupts.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit 663fbb56ca229f8cf5165b8cbfb8867ee8e4cbc0)

Change-Id: I807f94b485579f9bb8c58f2be93d14fe82fc17aa
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: memory: Use already defined MT_MEMORY_SO type

MT_MEMORY_SO is now defined in the kernel so replace the old
usage of the MT_DEVICE_STRONGLY_ORDERED type which is no
longer defined in the latest kernel revisions.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
(cherry picked from commit e4229bdeab0b842a43e7fcd0085ce123f6877d0f)

Change-Id: I85b2f82eb62d386c77f51f42e1577387bf99c325
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: memory: Enable map_page_strongly_ordered API for 7627a

Enable map_page_strongly_ordered() API for 7627a, since it
is required for the memory barrier implementation, like 7627.
Use iotable_init API to initialize the strongly ordered page
mapping since create_mapping() used in the older implementation
is no longer available outside mm/mmu.c implementation.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
(cherry picked from commit 80c1936c0ac369fc49bfba6ab132fb395759bd3a)

Change-Id: I43e28da51805d63391b4b54d7b315f81aa1834ba
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: Kconfig: Enable ARCH_HAS_BARRIERS flag for 7627a

Enable the custom barrier implementation for the 7627a
based targets.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
(cherry picked from commit 7ff06e05f2b1d4d093050374f302b7bdfa03f0d4)

Change-Id: Ib1d75ac896efc59b99ed692f264bab66fa178ba3
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm_fb: display: Add timeout for waiting on update

Content Adaptive BackLight userspace algo waits on UPDATE_NOTIFY to
get the screen updates. When turning off CABL, this blocking ioctl
causes the CABL threads to wait until next screen update, which may
take indefinite time.

Add timeout value to the wait_for_completion call, to make ioctl
call blocking for at most timeout value.

CRs-Fixed: 384026
Signed-off-by: Kinjal Bhavsar <kbhavsar@codeaurora.org>
(cherry picked from commit 1b6843a3a56e60e73305c66369f8ad806353e22d)

Change-Id: Ie9609b96bc19d8ec7630a35dfc0da5c79a5615c1
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm : camera : Correct mount angle value for OV7692

--correct the angle so that snapshot taken and
video recorded will not be 180 degrees rotated
--correcting mount angle so that the orientation
is proper for face detection by front sensor

CRs-Fixed: 401849
CRs-Fixed: 404489
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
(cherry picked from commit 2d57149ad900a5a3bccec0f749f87debd6dbfdfd)

Change-Id: I2f8c96f2ad3f6cccc5a201bc32b0477d93c62428
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: camera: Fix camcorder hang for 120 fps with aptina 8MP

Increasing the vfe_clk_rate to max in board file for streaming
HFR 120 fps.

CR Fixed:406997
Signed-off-by: Mayank Agarwal <magarw@codeaurora.org>
(cherry picked from commit 038bcce1eff978f4e506becf02f46b7bb9d2b0a3)

Change-Id: I49b01a1d8d3d63d7a9980622d2d2cc2592223621
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: Kconfig: Add support for MSM_FIQ for 8625

On 8x25 modem is the master processor and in case apps
is holding lock with irqs disabled then sending an SMSM reset
interrupt does not help and the state of Apps is not known
at all.Hence we are enabling a FIQ which will save the cpu context
of the apps and help debugging before going into SMSM reset.
In the current patch we are adding support for enabling the fiq
and defining the fiq offset number.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit 87628c186a29a4454fb3097631085e15543f6bbb)

Change-Id: Ia336272dcb01b7b71b0e0665aa754b69869779f9
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: Kconfig: Add GIC_SECURE support for 8625

GIC has to configure IRQ lines in group-1 and FIQ lines in
group-0, which  can be done once we enable GIC_SECURE

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit b6c26704cd34604880a584782561d5e99dddcf65)

Change-Id: I21e7c443905cb1b4be6ff619cc79418787eec7ea
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
ARM: fiq: Add fiq_set_type to configure lines for FIQ

The lines to be used as FIQ needs to be configured to be
set for the type as EGDE/LEVEL.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit 9502b0df023595c63dd60197204ae6b1001b7601)

Change-Id: I04a478c6d14e53624b01d652607d1734b554b008
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
ARM: gic: save/restore distributor ISR register values

Before going into power collapse we have to save/restore the ISR
registers in case we configure GIC to handle FIQ on apps side.
Otherwise we will end up in wrong ISR configurations after PC.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit cc721d47dfa3d040e7f78c5229bcb1af82076641)

Change-Id: I13c1c271142d4921bb46075a338268237dbd191e
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
defconfig: msm7627a: Enable FIQ for debugging

enable FIQ for debugging.

Signed-off-by: Taniya Das <tdas@codeaurora.org>
(cherry picked from commit cfa851d38028b4cd0ce5a602a88c128cece66446)

Change-Id: Id5ecb5d38cdabf97c159b2b2863f498dea2c94e6
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: 8625: Add support for the M2A_2 fiq handler

The FIQ handler gets triggered when the M2A_2
interrupt is fired by the NON-HLOS. The  FIQ
handler saves the CPU context and helps in
debugging the watch dog timeout issues.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
(cherry picked from commit 7fbd9b77bfb8ee1b00e683bc487e62b7eef2bfb5)

Change-Id: I6fdf279419a51c7ab95e0f15549283964e40a971
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: 8625: Initialise the FIQ Handler only for MSM8x25

Added a check to initialise the FIQ handler for MSM8x25 CPUs.

Change-Id: Ie8ece9480554436152b061526c642b074d11fb71
Signed-off-by: Aparna Mallavarapu <aparnam@codeaurora.org>
msm: acpuclock: Select proper target frequency row for update_jiffies

Update jiffies function is called with wrong target frequency which
could result in the incorrect udelay once the frequency is changed.
Select the final target row so that the lpj is updated properly.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
(cherry picked from commit 9d4c4f8bfa68aae7fc51d510387c2e9d7a4c4a14)

Change-Id: I643540bbbbbb197fcd3b08722bfef4b253049c5a
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm: board-msm7627a-wlan: Fix wlan gpio request failures in FFA platform

gpio request failures are seen in 7x27a FFA + AR600x wlan
chip combination while bringing WLAN down. The root cause is,
msm_AR600X_shutdown_power() function is trying to request
gpio line (gpio_wlan_sys_rest_en) which is already requested
in msm_AR600X_setup_power().

This patch removes gpio_request for 'gpio_wlan_sys_rest_en'
call in msm_AR600X_shutdown_power() and introduces new flag
'wlan_powered_up' to track wlan power on status.

In addition, Added new condition in msm_AR600X_setup_power()
and msm_AR600X_shutdown_power() function to perform
gpio_free(gpio_wlan_sys_rest_en) only for relevant platforms.

CRs-Fixed: 401855
Signed-off-by: Antony Thomas <athomas@codeaurora.org>
(cherry picked from commit 20c171d25473fc43ff7f30c0c5f18502f1f57350)

Change-Id: Ie2e9d7716fdbde463d9e269c8d0d2b0ff2ce5b43
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
ARM: gic: Fix saving/restore of ISR

Remove the ifdefer and save/restore ISR register values
if the cpu is secure.

Change-Id: Ie54bed6fc409c65d3428a75ddf3bc99adfb6aa52
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Revert "defconfig: msm7627a: Enable pl310 err reporting module"

This reverts commit 12baff2a6d2c8f0f295b24ae3c56be75812c7f08.

Signed-off-by: Taniya Das <tdas@codeaurora.org>