Add runtime control for enabling/disabling program counter save feature.
Enabling program counter save feature will enable pc to be saved on
reset but implies ETM being left powered on. So we provide user runtime
control to enable the feature when debugging or disable it while taking
power measurements.
Change-Id: Ib007da851ee7f3b0fac195da62aac7def68cc67a
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Explicitly clear and set ETMCR power down bit as part of the ETM
register programming sequence since if this bit is set, writes to
some registers and fields might be ignored.
Moreover, ETMCR prog and power down bits are not directly modifiable
via the sysfs based MODE selction code. Instead they can implicitly get
modified by other code. So always preserve their values while
enabling ETM trace since the ctrl is a shadow of ETMCR bits that
are only modifiable via the sysfs based MODE selection code.
Change-Id: I842a42acdafb112759a1787ec6fc41140812020d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Enable and disable STM during probe to undo the effect of RPM
temporarily turning on STM to ETF path. This ensures that all
the coresight components from STM to the default compile time
sink (ETF) get disabled in probe thereby resulting in their
states to more closely correspond to their reset states.
This is necessary since coresight drivers are designed to assume
reset state (on a power on boot) for the devices they control.
Change-Id: I8707f6134de2488754fb01b5e2830588efa729cc
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Initialize buf for TMC ETR to the virtual address of the allocated
buffer memory. This will ensure a read on TMC ETR device node when ETF
is the current sink doesn't fail.
Change-Id: Id23dd9502ec728567c5b137354ca2d734f9309dc
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
coresight_abort allows for abruptly stopping the current sink from
accepting new data hence avoiding polluting trace with information
after the point of interest.
Depending upon the call site, coresight_abort could end up getting
called more than once. This change will help with ignoring
subsequent calls to coresight_abort so that abort callback is
called just once. This is in line with treating abort as a one time
abrupt stop.
Change-Id: I634001e832ee7fa1b23f67698bd2d5dd12f8d65d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
This reverts commit 670627c323f1d6a72a35763d6b9dddca18f654df. We now
have cp14 based ETM support for Krait v3 so ETM tracing for Krait v3
can be turned on. This will enable ETM usage on Krait v3.
Change-Id: Ie7189c38d4aee43580ac145edceb8ffdbe8c9072
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Use cp14 accesses to ETM registers for Krait v3 to avoid
limitations with memory mapped accesses.
Change-Id: Ia956eb0f5b45c748ffb5dd13dd14dc9595b9c68a
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
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>
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>
A DLKM to abort tracing on an user space data, prefetch or
undefined instruction abort.
Change-Id: Iaba14628601ea6d3649e05423f8570131eea39f7
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
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>
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>
Move etm_arch_supported out of etm_init_arch_data to simplify the
init flow.
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Change-Id: I8a95f59e35e74c5af8c447abdc9f0dcd1682bce1
Add support to allow debug image to be able to dump ETF content
and ETM, TMC regsiters in case of apps proc bite or system hang
causing secure watchdog reset.
This will enable host parsing scripts to extract ETF and
ETR-memory trace data contents from RAM dumps.
Change-Id: Ie6f03bef7b4ccda7ea8d7709ee0c4808424c5b92
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Change the default sink from ETR to ETF since this means ETM tracing
can be enabled to the high bandwidth ETF without requiring sink
switching.
Change-Id: Ia4826a0dd76e208db9a9398278a688228e8c1304
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Instead of writing FFCR bits 12 and 6 at once, sequence them i.e.
write bit 12 first to set ETB to stop on flush and followed by
setting bit 6 to trigger manual flush.
This should avoid any possible race between flush completing
before bit 12 getting set.
Change-Id: I0567701d34cb33a35d6bd876636a296532b9e400
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Change STM traceid from 3 to 16 so that ETM and STM can be used
concurrently if required. ATIDs 0 to 15 are reserved for ETM - one
for each core.
Change-Id: Ic51cf3b8baa9c22be69c952a20281b238750de5d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Since we moved to separate enable nodes for each ETM, using pm_qos
to prevent power collapse of the target cpu while we enable or
disable ETM is less efficient and also susceptible to a race with
cpu hotplug.
Move to using smp call to enable and disable trace to avoid above
deficiencies with the newly re-structured code.
Change-Id: I65c726dbd6275af8db0d40db5034299287a02e91
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
8064 funnel has 8 ports so allow all to be used. Typo corrections.
Change-Id: I2a442048a2100ab07f34d453f538f89babd9d514
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Memory reservation is now required for carve outs. Add appropriate
memory reservation driver support for the TMC ETR carve out.
Change-Id: I31cda1317d31555b70a034eae4c6fdadacd36fdb
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
With maxcpus=1, only core0 will be running with other cores in
reset until they are explicitly hotplugged on. To avoid reading
ETM registers for cores that are in reset during probe, use only
ETM0 for populating configuration info. For other ETM probes,
copy the info from ETM0.
Change-Id: I9ae4539b004956a026e919323413f9e3c7d5ba4a
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Since we can use ftrace event to also log printk to STM, remove
direct logging of printk to STM.
Change-Id: I903e2584b40565513342864827455f0a6cbf2260
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Program STM to allow TRIGOUTHETE output (that feeds into the CTI input)
to be asserted when hardware events occur. Also program the STM sync
frequency to 1023 byte interval.
Change-Id: Ia4c9c73d61a50dfc5eb2df5f52921831b647df0e
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Ensure that buffer pointer points to the right location while
trying to read TMC in ETR circular buffer mode when we wrap
around.
TMC in ETR circular buffer mode tracks the physical address
in the RWP register (in contrast to pure offsets). Hence
subtract it from the base physical address to get the offset.
Change-Id: Ice1170dcd63928dd8304c421800848e036386b88
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Add coresight CSR (CoreSight Slave Registers) device and BAM register
definition for TMC-ETR to support ETR to USB output.
Change-Id: I1f9081a0a684a9a6d5b08361be1e09c323a2d4fe
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Support for etr to usb trace output using QDSS BAM to USB BAM
transfers.
Change-Id: Ibb6f8d0cf1d9799668cb22ccaa13966139c8dea5
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Change CONFIG_MSM_QDSS to granular CORESIGHT configs covering
various CoreSight drivers. This better represents the CoreSight
device topology and allows more flexibility in choosing the
drivers required for a particular platform or chip.
Conflicts:
arch/arm/configs/msm8960-perf_defconfig
arch/arm/configs/msm8960_defconfig
arch/arm/configs/msm8974-perf_defconfig
arch/arm/configs/msm8974_defconfig
arch/arm/configs/msm9625_defconfig
arch/arm/mach-msm/Kconfig
drivers/coresight/Kconfig
drivers/coresight/Makefile
drivers/coresight/coresight-etm.c
drivers/coresight/coresight-priv.h
Change-Id: I5ae44442c24c88673f2045ad24dc89e4d86d23cb
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
In cherry-picking patches from tip, the LTC charger driver and pm8921
BMS driver header were updated without updating the copyright
marking from "Code Aurora Forum" to "The Linux Foundation".
Fix this by updating the copyrights now
Change-Id: I3a24feaa6af5acbdca4fc6499398205a1c93dcfe
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Add minimum amount of wait period in adreno_waittimestamp
to avoid instances of malformed wait period (such as msecs=0)
arguments from userspace and in turn avoid false hang detections.
CRs-fixed: 437738
Change-Id: I5cd40dc7589747e7fffeb6d5cc2001b73d6d845e
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
Mutex should be released only if the function locked it
at the beginning.
Change-Id: If83d615a1777a1ccb2a13d070e1b67d002662cb8
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
With video layer in MDP composition, there is no need to apply destination
over blend rule, as z-order of layers take care of proper staging of layers
by default. Apply constant blend to the video layer when in MDP composition
CRs-fixed: 437965
Change-Id: I7476659f12cdf06018bf6ace829a836c86ae97e8
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Flushing an endpoint involve polling ENDPTFLUSH and ENDPTSTAT
registers. The worst case timeout is 100 msec for each endpoint.
The reason for failure is unknown. When flushing an endpoint
fails, successive flushing of remaining endpoints are also failing.
Hence skip flushing remaining endpoints. Reset this condition
upon USB bus reset.
(cherry picked from commit 2a630fb9b83b31e607ef61f3b61959cc1b095349)
CRs-Fixed: 445916
Change-Id: I54cf860c0d290ffa3fc0d7e41af32b4be48937ef
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
The endpoint must be flushed prior to retiring pending requests.
This is done during disabling an endpoint. Don't flush an endpoint
if there are no pending requests. According databook flushing
endpoint may take large amount of time. This optimization will
make USB disconnect/reset processing a little bit faster.
(cherry picked from commit 58db2c1f94451d7a352d2ad1a1b1e9732f4f0a11)
CRs-Fixed: 445916
Change-Id: I2a8b185d7f6f295485bc1d1b1794f42471149491
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
The ep_disable() function nukes all pending requests before
disabling the endpoint in hardware. The endpoint is flushed
during nuking. Don't flush the endpoint again.
(cherry picked from commit a89f80f9942e5dc2796ad742f9d01f6aa68e1267)
CRs-Fixed: 445916
Change-Id: I84020dceef751dbdde1233068a414a72d1c1b609
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This reverts commit 994ff121f0c2e3ff00fa38ae2f8dfde4bda1b332.
PM8921 MPP7 no longer must be kept high at all times for targets
using PCDDR3 memory because newer hardware ensures that memory is
always powered when necessary.
Change-Id: I4919abceb875b9ea22e6b2c0bd617280deb7e65b
Signed-off-by: David Collins <collinsd@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
The runtime PM is disabled for a device during suspend. It is
enabled again just before resuming the device. The resume method
of USB interface drivers are called while resuming a USB device. As
USB device is the parent of an interface, the interface resume is
blocked till USB device resume is completed. If interface driver
call any runtime PM API before interface runtime PM is enabled, it
fails with -EACCESS error.
The USB runtime wrapper usb_autopm_get_interface() decrements PM usage
counter when get_sync() is failed. The current code is decrementing
the PM usage counter even when an error code is returned from
usb_autopm_get_interface(). Due to this double decrementing, the KS
bridge interface PM usage counter is becoming negative after several
suspend and resume cycles. Once the PM usage counter becomes negative,
the interface runtime PM state will never become active. That means,
USB device suspend can happen even when a Tx URB is pending from ks
bridge driver.
The fix is trivial. Don't decrement PM usage counter when error code
is returned from usb_autopm_get_interface().
(cherry picked from commit 361d9af92470ebeeb0a42f73e6eb457ab279b282)
Conflicts:
drivers/usb/misc/ks_bridge.c
CRs-Fixed: 437214
Change-Id: I96c9e1797c137cd158c424ebf6342f607cee6d78
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
In Overlay_play , panel power on check was at wrong place
it has to be after Unblank.
Change-Id: If910f83ef57499b5f771bc7d3d1bdfa814d5c019
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Vote for SFAB clock when requesting to set to crypto high
performance mode.
The SFAB clock needs to be bumped up to its optimal
value when operating in high bandwidth mode (for max
crypto performance)
Change-Id: Ifea68a15d48f737a855acd05e59ac20d4438a9cd
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Give the correct address of shared virtual buffer
address to be used during start_app.
Change-Id: Iebe10304c9c295c34eb3e1aeba9255e7c91609cc
CRs-fixed: 434753
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Loading of app is stuck waiting for lock on app_access_lock
being released. This mutex is already locked prior to invoking
load_fw.
Removing the mutex lock (already called before invoking load_fw),
in load_fw, fixes the issue with the loading getting stuck.
Change-Id: Ia095bf268c6c1c08dfe1544280567ba4bd4661d6
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Add API to allow kernel space clients to bump up
CE clks for improved performance
Change-Id: Iecd13cf4efe9b2b1415be56d3ec9e4dc040918f8
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Add support for setting the Crypto HW to operate in
high bandwidth mode before issuing a request to load
image.
This is needed for better performance when using crypto
HW to authenticate the image before loading it.
Change-Id: Ib976d8227e605b9aad8191c6fe8f1dcc5d28e90e
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Add support for kernel space client:
- add support for starting secure app by kernel client
- add support for shutting down secure app by kernel client
- add support for sending command to secure app loaded by
kernel space client(s)
The above is needed for allowing kernel modules to communicate
with app running in secure domain.
Change-Id: I3ae3a7648714eb7d7f4801b2f8e7cd94b5c64bdf
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
All interactions with secure applications on TZ by non-secure
apps on HLOS need the crypto clocks on.
Without this, simple operations as loading secure apps in
Trust zone fail.
Change-Id: I37097cb401508f7582de014e502f3709170ca6b2
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
sdmx process should be invoked with the requested
number of bytes rather than with the number of bytes
available in the buffer.
Change-Id: I4541cc4ff15d5c23ca9aad6a85a4d815ece7b21c
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
secure-demux processing function expects to receive a fixed
start address aligned to 4KB along with a read pointer, the
code provided the current address along with a read pointer
set to 0 as fixed value. This may cause the start address not
to be aligned to 4KB.
Change-Id: Ibd4a4c70c3b874df328de9d3fea0437cbdf53028
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Secure mode should be set on feed basis therefore TS and section
feeds should expose API to to set their secure mode. The secure-mode
is saved as part of the feed structure which already exists
instead of allocating special memory to save this info.
Change-Id: Ib081ac893a1f0aa3ee4ac4f333459010b095d7fe
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>