Commit Graph

228 Commits

Author SHA1 Message Date
Linux Build Service Account e44d09b906 Merge "coresight: configure gpio on cti trigger map and unmap" 2014-06-28 09:34:37 -07:00
Aparna Das a30a982169 coresight: add regulator support for hardware event driver
Add support to hardware event driver to be able to enable regulators
required for accessing certain hardware event mux registers.

Change-Id: I5fb2b7fa349d2d435b3fad33ce8d971ca00716ee
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-06-26 12:44:33 -07:00
Aparna Das 2849621f1b coresight: configure gpio on cti trigger map and unmap
Instead of configuring gpio on bootup, modify coresight cti
driver to allow configuring gpio when mapping or unmapping
cti trigin and trigout so that the gpio(s) are parked in a
functional state only when the mapping/use case is active
hence avoiding any potential power impact when not used.

Change-Id: I375253843210d3873d443e1da195c86927698167
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-06-26 10:23:13 -07:00
Aparna Das 9037f81c14 coresight: disable and enable etmv4 across cpu hotplug
Ensure CoreSight ETMv4 trace unit is disabled before core is
hotplugged off and subsequently enabled when core is online
to prevent race conditions which may arise between cpu hotplug
and enabling or disabling the trace unit.

Change-Id: I51dce88b22f8266d1bb14bc6c36c63c0f9bca0a6
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-06-25 18:40:11 -07:00
Linux Build Service Account 19452a7a83 Merge "coresight: fix cti gate enable disable apis functionalities" 2014-06-14 12:35:56 -07:00
Aparna Das 779c3c7b87 coresight: fix cti gate enable disable apis functionalities
Setting the CoreSight CTI Gate register enables CTI channel
propagation and clearing this register disables channel
propagation. Current implementation of CTI gate enable and
disable apis is not consistent with this channel propagation
behavior. Fix these api implementaions.

Change-Id: Ibe93f97a785c6c33753c18db4417997f9fbf5af1
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-06-12 14:46:24 -07:00
Aparna Das 0ba5b3748b coresight: add save restore support for multi cluster cpu ctis
Modify the CoreSight CTI driver to save and restore only those cpus
belonging to the cluster for which L2 SCU rail is powered off. Also
prevent access to CTI registers for those CPUs whose L2 rail is
powered down.

Change-Id: I4a7ba242b6897962e5cc414e94afc832c464e164
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-06-12 12:52:27 -07:00
Linux Build Service Account 1ffdc7ab58 Merge "coresight: use irqsave and restore version of spinlock for cti driver" 2014-06-10 11:55:03 -07:00
Linux Build Service Account 1cd5a8a177 Merge "usb: bam: Return usb_pipe_mem_type from get_bam2bam_connection_info()" 2014-06-09 18:24:56 -07:00
Jack Pham 8c9c7eb18f usb: bam: Return usb_pipe_mem_type from get_bam2bam_connection_info()
Some functions may need to know the pipe memory type, whether it
is allocated memory or a private region of internal peripheral
memory. Add an extra parameter to the get_bam2bam_connection_info()
function to return this value based on the preconfigured BAM pipes.

For most functions this info is unneeded. For QDSS, use this value
to determine whether to pass MSM_INTERNAL_MEM to the SPS params
when running on a device that requires it.

Change-Id: Ia9f5630b08a90cb66489a11707919d1855c36ec9
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2014-06-09 00:32:28 -07:00
Aparna Das a0ba4b28ce coresight: use irqsave and restore version of spinlock for cti driver
Modify spinlock usage in CoreSight CTI driver to irqsave and restore
version of spinlock to accomodate calling CTI interrupt acknowledge
api in atomic context.

Change-Id: Id0461aa086a60a0c0a6a9e0fba033e8b9e8a9885
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-06-06 10:04:20 -07:00
Linux Build Service Account c005503881 Merge "coresight: fix swd trace mode enable path" 2014-06-06 06:04:47 -07:00
Aparna Das f1181b5f67 coresight: fix swd trace mode enable path
Current code to enable CoreSight NIDnT serial wire debug trace mode
is incorrectly disabling all enabled components even on success. Fix
this to get trace in serial wire debug mode.

Change-Id: I60547b96e7f84e479b1686481aa89295a3f313f0
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-06-05 11:27:46 -07:00
Pan Fang b553e574f5 coresight: disable the nidnt hardware sense as default
As the NIDnT hardware sense function use the same detecting gpio
with SD card, if the NIDnT driver directly use this gpio, it will
result in the sdcard can't use any more, need disable this feature
first.

Change-Id: I8743611055113c629b469007701c5b97ca8d411a
Signed-off-by: Pan Fang <fangpan@codeaurora.org>
2014-06-04 19:17:44 -07:00
Linux Build Service Account 6de1819bab Merge "coresight: stop copying etf contents when buffer size is reached" 2014-05-31 19:43:57 -07:00
Pratik Patel 94bec8c5bc coresight: stop copying etf contents when buffer size is reached
Currently we read the TMC ETF contents and copy them to DDR until
the end marker is seen. If for some reason HW doesn't provide the
end marker, this can result in memory corruption since the code
will end up in an infinite loop that keeps copying contents
beyond the TMC ETF buffer.

Add an additional check to stop copying TMC ETF contents to DDR
when buffer size is reached even if end marker is not seen due to
a potential HW misbehavior.

CRs-Fixed: 671604
Change-Id: I5a6ec1231371737b8e8c368ded75f5e73ac66095
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2014-05-28 17:47:31 -07:00
Aparna Das 05b36b0636 coresight: conditionally vote for cti clk in probe
To support acknowledging CTI interrupt from atomic context and/or CTI
save and restore in the absence of hardware clock vote, conditionally
vote for CTI clocks during CoreSight CTI driver probe.

Change-Id: I50d7ceb0381bdaca197ab483d5e2a51246d94b1b
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-05-28 17:40:12 -07:00
Aparna Das 03c4cda263 coresight: remove tlmm api references from tpiu driver
Modify CoreSight TPIU driver to use NIDnT apis to access TLMM
registers instead of TLMM apis used earlier which are now
deprecated. Also modify the TPIU device tree entry to support
this change.

Change-Id: I7ccfe0ac8383160e90219674de8871153cb0621e
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-05-19 22:38:58 -07:00
Aparna Das 1127d14ea7 coresight: handle error on failure to enable nidnt modes
Modify CoreSight TPIU driver to disable and release all resources that
have been already successfully enabled in case of an error in enabling
TPIU NIDnT modes.

Change-Id: Idd6ea0c07bf2f7596d79df4940273dd81a56fed2
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-05-19 17:46:52 -07:00
Linux Build Service Account 2cb4deb501 Merge "coresight: add support for coresight cti save and restore" 2014-05-15 19:53:51 -07:00
Pan Fang 3ed98cf7cb coresight: add support for coresight cti save and restore
Add support to save and restore the CTI state for those CTIs which does
not retain state on power collapse.

Change-Id: I5d729d364237d6af12bf9deca5b5173d06be5c13
Signed-off-by: Pan Fang <fangpan@codeaurora.org>
2014-05-15 10:32:35 +08:00
Aparna Das 908fd14a88 coresight: use pinctrl framework exclusively for tpiu mictor trace
Modify CoreSight TPIU driver to use pinctrl framework only and not
fall back on gpio lib to enable TPIU mictor trace since pinctrl
support is now available for all chipsets that support TPIU mictor
trace.

Change-Id: I44ff39679efe246c0edbe9f68590ba862e5d61df
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-05-13 10:23:29 -07:00
Aparna Das 21d4826a6f coresight: add cti support to acknowledge output trigger
Add support in the CoreSight CTI driver to be able to create
soft acknowledgement for output triggers.

Change-Id: I56db8dc4390d542ff197b48babef0f4498dcd942
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-05-10 18:30:56 -07:00
Aparna Das afc0d50889 coresight: support cti save and restore apis from atomic context
Modify CoreSight CTI driver to allow calling CTI save and restore
from atomic context.

Change-Id: Id8b90c19b5e2d84f4e7a794ccee6974e0de8cf24
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-05-10 18:30:56 -07:00
Xiaogang Cui 1e6812aa01 coresight: add support for fuse v2 layout
The OEM config register bit assignment changed for 8916. Add support
for this new register bit assignment as fuse v2 layout.

Change-Id: I41125fbba4e977eac3300037bddaf80113030475
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
2014-05-05 20:01:53 +08:00
Aparna Das dbfa7047b9 coresight: change magic number for memory dump v2
Memory dump v2 format uses magic number that is different from
what is used with earlier version. Add support for this change
so that the TMC ramdump can be correctly parsed.

Change-Id: Ib7f5478812e59a44c609fc433e8c742fe30488a9
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-04-16 09:47:07 -07:00
Linux Build Service Account b34ee0428b Merge "coresight: add support for resetting etm by default" 2014-04-15 12:56:45 -07:00
Linux Build Service Account dbf6354f89 Merge "coresight: add support for the nidnt mode in the tpiu driver" 2014-04-12 05:03:54 -07:00
Xiaogang Cui 9f4d99f364 coresight: change flush input from pre_ares to flush_etr
Change flush input signal from pre_ares to flush_etr. For ETF
to be consistent with the usage model for both ETF and ETR.
Remove property reset-flush-race which is a workaround for
MSM8974v1.

Change-Id: I077f5215e75024e484abb3b68d67372ae6ccd154
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
2014-04-09 11:23:48 +08:00
Pan Fang fa4748d1c5 coresight: add support for the nidnt mode in the tpiu driver
Add the Narrow Interface for Debug and Trace mode in the msm8916
platform which will provides nidnt hardware sensing to debug the
device online.

Change-Id: Ia169c805ea5ebe28ac483bff448e9495edb43811
Signed-off-by: Pan Fang <fangpan@codeaurora.org>
2014-04-09 11:01:48 +08:00
Linux Build Service Account f99a00a100 Merge "coresight: modify clock usage for cti driver" 2014-04-02 21:46:50 -07:00
Linux Build Service Account 8f23ff8bef Merge "coresight: add support to enable remote processor etm tracing on boot" 2014-04-02 21:44:51 -07:00
Aparna Das ddacec057a coresight: add support for resetting etm by default
Add support for resetting ETM parameters by default on bootup
which can otherwise be done using sysfs.

Change-Id: I098274a44dd9150ccbf3afd88654eb0a7eb74809
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-04-02 14:37:09 -07:00
Aparna Das 58626dd03f coresight: add support to enable remote processor etm tracing on boot
Add support to allow enabling remote processor etm tracing on boot by
default so users don't have to enable it explicitly from sysfs.

Change-Id: I7f719d0b5a504a35cba503c60a7d5d9f8434b309
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-04-02 09:39:32 -07:00
Aparna Das 8b4b8afff7 coresight: modify clock usage for cti driver
Enable CoreSight CTI clocks before CTI driver accesseses CTI registers
and disable them right after since these clocks are not required to be
on otherwise.

Change-Id: I23ec911b9471bbce2e91c38a1d049ca142a63aee
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-04-02 07:41:02 -07:00
Sarangdhar Joshi b0ffec3d7d coresight: add support for byte counter for scatter gather feature
Byte counter interrupt feature provides an interface to set byte counter
value and collect continuous trace data stream from userspace. Add support
to read this trace data stream when scatter gather feature is enabled for
TMC ETR configuration.

Change-Id: Ic755b7ae14b4bf13f7f28897ec8827476366eaf7
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
2014-03-28 18:02:17 -07:00
Sarangdhar Joshi fd7c7fc302 coresight: add driver support for scatter gather feature
Add driver support to enable scatter-gather feature with TMC configuration.
Scatter gather option for ETR DDR mode supports the use of a table of
locations of 4K blocks of physical memory. Since this memory is not
necessarily contiguous, user can increase the trace buffer size as long as
DDR memory is available.

Default memory option is "contig" for TMC ETR DDR configuration. User can
enable scatter gather feature dynamically.

Change-Id: I74136fb86fe751aa33607d3922dce5d572f0a4a2
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
2014-03-26 18:13:14 -07:00
Sarangdhar Joshi 2365442aa8 coresight: enable scatter gather feature based on dt entry
Based on sg-enable DT entry, enable scatter gather feature
for TMC ETR configuration. Scatter gather feature is not supported
on all targets. sg-enable entry will help to enable this feature
only on those targets which supports this feature.

Change-Id: I66fe50c653ad9646104b9dc0d77a0fa6f82503dd
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
2014-03-24 10:52:01 -07:00
Linux Build Service Account 13807cea1a Merge "coresight: use dev_err_ratelimited for byte counter overflow message" 2014-03-15 10:09:18 -07:00
Linux Build Service Account eaf32dcae4 Merge "coresight: add device attribute for etr ddr mem type" 2014-03-15 10:08:52 -07:00
Linux Build Service Account b8360c9710 Merge "soc: qcom: memory_dump_v2: add client support for memory dump v2" 2014-03-14 07:45:03 -07:00
Linux Build Service Account c27becdfa1 Merge "soc: qcom: memory_dump: cleanup in preparation for memory dump v2" 2014-03-14 07:44:56 -07:00
Linux Build Service Account bd9fa0e149 Merge "coresight: add support for etmv4" 2014-03-13 19:40:27 -07:00
Sarang Joshi 9094a9bf20 coresight: add device attribute for etr ddr mem type
Add device attribute for memory type option with TMC ETR DDR configuration.
This is in preparation for scatter gather feature with TMC ETR
configuration.

Change-Id: If72078f89442e9c58e09392fbced362126dd15e7
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2014-03-13 17:14:03 -07:00
Pratik Patel 689346a4bf soc: qcom: memory_dump_v2: add client support for memory dump v2
Add client support to register with the memory dump v2 driver to
take advantage of the new enhanced memory dump format.

Change-Id: I8b05d92b3e9f4d1dcaa6dffec8fe05401d72a7ee
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2014-03-13 14:29:05 -07:00
Pratik Patel 1ec292845e soc: qcom: memory_dump: cleanup in preparation for memory dump v2
General cleanup to avoid global name space clashes. This is in
preparation for the memory dump v2 driver.

Change-Id: I884ff3a06c74166dc0cd9004085ab9b43646ef6a
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2014-03-13 14:29:05 -07:00
Linux Build Service Account e7ba90fd33 Merge "USB: usb_bam: Change the bam handle to ulong" 2014-03-12 20:12:41 -07:00
Aparna Das fbc618a08a coresight: add support for etmv4
Add support for Embedded Trace Macrocell v4 trace architecture
which is required for instruction trace on ARMv8 arctitecture.

Change-Id: Iff24690e3161eb12d6f0e09af0c45f9739c7ca66
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-03-12 18:21:58 -07:00
Sarang Joshi a748e7052d coresight: use dev_err_ratelimited for byte counter overflow message
When byte counter feature is enabled, if the rate at which we receive IRQs
is so high that userspace is unable to read the data fast enough, we
throw byte counter overflow error message. However these messages can cause
log spew resulting in watchdog bark/bite. Limit byte counter overflow
message spew by using rate limited function.

Change-Id: I714323893330368965f70a137aaef7ef7cd4029d
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2014-03-12 15:27:40 -07:00
Aparna Das cb3d90649a coresight: add pin control support for tpiu driver
Use pin control framework to configure pin resources for
obtaining TPIU trace via mictor instead of GPIO lib
implementations used earlier. Modify the CoreSight TPIU driver
to implement this change.

Change-Id: Ifc565994214ee7c4f7abb97b4222352becfdf2b4
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-03-10 16:17:22 -07:00
Sujeet Kumar 2d9e27fa48 USB: usb_bam: Change the bam handle to ulong
Change the bam handle data type from u32 to
unsigned long to match sps connect source
and destination.

Change-Id: I55ce477a40e4ab3d1306f8afd1acf491c22874e9
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
2014-03-08 05:22:15 +05:30
Aparna Das 4facbd0621 coresight: add support for qpdi driver
Add support for CoreSight QPDI driver which provides
controlled access to PMIC Debug Interface.

Change-Id: Ia2e6cc4e276923b55f34046a6a422e7533768e72
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-03-03 13:31:49 -08:00
Sarang Joshi b155399efd coresight: allocate etr ddr memory dynamically
Dynamically allocate ETR DDR memory so that user can specify
trace buffer size at runtime.

Change-Id: I081b017fa147d7c87789cc504cd9b61b7365c79f
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2014-02-28 13:09:09 -08:00
Linux Build Service Account 59acb37c59 Merge "coresight: add device attribute for etr ddr mem size" 2014-02-26 21:28:12 -08:00
Linux Build Service Account 78025e56f0 Merge "coresight: add event to abort tracing late on kernel panic" 2014-02-26 10:05:08 -08:00
Sujeet Kumar af110c4d33 USB: mach: Move the mach headers to common location
As part of moving the headers from mach directory
to a common location compilation issues are arising.

Make the changes which are relevant for USB with
its own header files and also dependent header
files.

Change-Id: Ieef7d04ffdfda249f434e0676fec6da8d8b9cf2c
Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org>
2014-02-25 05:53:32 +05:30
Sarang Joshi fdb945350e coresight: add event to abort tracing late on kernel panic
We call coresight_abort() early in panic pathway to avoid trace buffer
getting cluttered with uninteresting messages; however sometimes it tends
to loose important info such as kernel sending notification to all
peripheral subsystems since it happens after aborting of CoreSight trace.
Add trace event to abort tracing late in kernel panic.
trace_event_kernel_panic and trace_event_kernel_panic_late are mutually
exclusive and can be control using module parameter. With this change user
will be able to choose whether to abort CoreSight trace early or late on
kernel panic.

Change-Id: I84cc299823d929fdf8129c9c728282b32391b7c1
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2014-02-24 12:31:50 -08:00
Sarang Joshi 87d84607d7 coresight: add event to abort tracing on kernel panic
Add trace event to control aborting CoreSight trace
dynamically based on module parameter. This will help
user to enable/disable coresight_abort on kernel panic.
Also moved CREATE_TRACE_POINTS to panic.c from fault.c
since panic.c is common and shared between 32 and 64
bit platforms.

Change-Id: I51e4049b07adeca571b1a98cd90ff5f307d1d794
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2014-02-21 16:41:14 -08:00
Sarang Joshi 441ff248c2 coresight: add device attribute for etr ddr mem size
Add device attribute to control ETR DDR memory size dynamically
for TMC configuration. This will help users to specify DDR trace
buffer size at runtime.

Change-Id: Ie1edef7f972435193c96dafb8a94fd6cce97ce6c
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2014-02-18 23:27:02 -08:00
Linux Build Service Account 0b748d84eb Merge "coresight: configure funnels even if qmi service is not present" 2014-02-08 09:39:13 -08:00
Linux Build Service Account 0791dcb389 Merge "msm: memory_dump: move memory dump driver to drivers/soc/qcom" 2014-02-07 23:19:41 -08:00
Aparna Das 39bf86bbac coresight: configure funnels even if qmi service is not present
Allow configuring CoreSight funnels required for remote processor ETM
tracing even if QMI server is not available to handle QMI client
requests. This allows enabling ETM trace via other alternatives and
use CoreSight drivers to collect trace data.

Change-Id: I43ba5ba5050af23877ddc53694418c35356bae4f
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-02-06 08:34:47 -08:00
Xiaogang Cui cd76c0793d msm: memory_dump: move memory dump driver to drivers/soc/qcom
Architectural changes in the ARM Linux kernel tree mandate
the eventual removal of the mach-* directories. Move the
memory dump driver to drivers/soc/qcom and the memory dump header
to include/soc/qcom to support that removal.

Change-Id: If04f6a4fcd30c864321ac0ff8c6691fc20707cc1
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-02-05 18:32:30 -08:00
Dipen Parmar 7f918cb5c7 msm: sps: remove sps header file
Remove the sps header file from older location as sps
driver and clients need to use new header file from
new location include/linux.

Resolve the warnings/errors from client drivers due to
new sps header changes.

Change-Id: I1cdb87756abf3425a9bb5d8bf89cd1aa03a01716
Signed-off-by: Dipen Parmar <dipenp@codeaurora.org>
2014-02-05 15:31:11 -08:00
Xiaogang Cui c4bad5cccc coresight: Fix compile errors for gcc-4.8
Fix compilation errors to support gcc-4.8

There is compilation warnning when use '%d" to print a argument
which type is size_t.

In file included from kernel/include/linux/kernel.h:14:0,
	from kernel/drivers/coresight/coresight-tmc.c:13:
kernel/drivers/coresight/coresight-tmc.c: In function 'tmc_read':
kernel/include/linux/dynamic_debug.h:64:16: warning:
	format '%d' expects argument of type 'int', but argument 5 has type
	'size_t' [-Wformat=] error, forbidden warning: dynamic_debug.h:64

Change format '%d' to '%zu' to fix this compilation error

Change-Id: Ia746033b76df7f06e860031ed8d3e249facbe2b5
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
2014-02-05 09:33:47 -08:00
Aparna Das 6f78c21df0 coresight: remove request for memory reservation using export_compat
The TMC driver now uses dma_alloc_coherent api to allocate contiguous
memory instead of allocate_contiguous_ebi when configured for ETR. This
eliminates the need for EXPORT_COMPAT support in the TMC driver.

Change-Id: I79550d2ff490c02329e4b860b8aa8816d4890d50
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-02-03 14:49:04 -08:00
Xiaocheng Li 5f441c883e msm: socinfo: Support multiplatform
Upstream prefers existing drivers be converted to support multiplatform
kernels.  This requires drivers to be located in directories that
contain generic functionality instead of specific mach directories.
Move the socinfo driver into drivers/soc/qcom and update the initcall
levels to satisfy dependencies.

Change-Id: If195cd793d84867d371f25136a88f2a7ce239500
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2014-01-30 19:08:34 -08:00
Aparna Das 2f2b31e76d coresight: add qmi message support for remote processor etm tracing
Add QMI messaging support to communicate with remote processors to
enable or disable ETM on remote processors.

Change-Id: I7018492284f1e5816302189f8c4f918b3ab79a64
Signed-off-by: Aparna Das <adas@codeaurora.org>
2014-01-24 06:40:58 -08:00
Sarang Joshi 2d5f553dc4 coresight: take lock before modifying byte cntr value
Byte counter overflow is computed based on byte counter value during
byte counter start routine. Two different threads running in parallel
can cause synchronization issue where one thread modifies overflow
based on byte counter value and other thread modifies byte counter
value at the same time. Take respective lock before setting byte
counter value.

Change-Id: I923a34bf918abe4d5e3b0d30ed4887a38db6f427
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2013-12-17 15:08:49 -08:00
Pratik Patel 2d85f9a856 coresight: initialize waitqueue before devm_request_irq
Initialize waitqueue before devm_request_irq to make static
analysis tools happy.

Change-Id: Iec85520453a4191a6e2e2abb0d4db8dc27b11533
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-12-02 15:18:46 -08:00
Ian Maund f06163e6d0 msm: reap unused kernel files
This change removes source files from the kernel tree that
were not being used during make. The list of used files
was generated using an annotated make log and was then
compared with new files added since the public release of
kernel version 3.10.00. New files which were added but
not used have been removed from the tree.

A diff was also run to determine the list of files that had
been modified since the release of kernel version 3.10.00.
These files were then scrubbed based on the current kernel
configuration, removing invalid and unused conditionals.

Some files which support planned functionality or are
useful in debugging have been excluded from this reap.

Change-Id: Ia44a224d3cea7bc78dd45e8a8279860d35d4b008
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2013-11-21 17:45:28 -08:00
Pratik Patel 5597394769 coresight: rearrange trigin and trigout show function locations
Rearrange show_trigin and show_trigout function locations to be
consistent with other CoreSight drivers.

Change-Id: Ic877155e49aa9379ba98e8473812b7f0359e8024
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-11-19 10:04:06 -08:00
Pratik Patel e8b35518bc coresight: add cti enable and disable gate functions
Add support for cti enable and disable functions to allow use
cases that require the ability to control the trigger outputs
independent of the trigger mapping and generation configuration.

Change-Id: Id94809be629bb3939a67e8f6711733810aeb1f37
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-11-19 10:04:06 -08:00
Pratik Patel d388cce171 coresight: add cti set and clear trigger functions
Add support for setting and clearing triggers to allow use cases
that require software based trigger setting and clearing
functionality.

Change-Id: I826b238f2cb1050394134030bd0810bbcdeb2662
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-11-19 10:04:05 -08:00
Pratik Patel 38a40145db coresight: add cti pulse trigger function
Add support for pulse triggering to allow uses cases that require
software based pulse trigger generation.

Change-Id: I1ce8fd40cfd0622364c101f9d9bc8aa4540b0344
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-11-19 10:04:05 -08:00
Pratik Patel 1fe2a79766 coresight: split cti verify bounds function
Split cti_verify_bounds into cti_verify_trigger_bound and
cti_verify_channel_bound so that they can be used individually
when required.

Change-Id: Ic1cd6802b0f5f0e7d9d31da73b0817d8f1909c3d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-11-19 10:04:05 -08:00
Linux Build Service Account 428cfe3dbd Merge "coresight: abort tracing for unhandled aborts" 2013-11-11 22:15:51 -08:00
Linux Build Service Account 57c7765847 Merge "coresight: make coresight event module configurable" 2013-11-05 19:11:39 -08:00
Sarang Joshi 23925d1ee1 coresight: abort tracing for unhandled aborts
Add trace event to abort tracing for unhandled aborts such as
data abort and prefetch abort. A common event 'trace_unhandled_abort'
is shared for all unhandled aborts.

Change-Id: I6da9b30c74be48252402188a6f9a7703d21d6276
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2013-11-05 15:05:05 -08:00
Sarang Joshi 2019121d55 coresight: make coresight event module configurable
The coresight event module helps abort tracing on user fault
and undefined instruction exceptions. Add module parameter to
control it dynamically.

Change-Id: Iecaa144b99e3786c8c8f570f989f747be12c4fdc
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2013-11-04 19:28:50 -08:00
Linux Build Service Account 8cf6ee43b3 Merge "coresight: modify function names and messages" 2013-11-01 20:48:24 -07:00
Sarang Joshi 00d8d627f5 coresight: check if gpio count is positive before using
If gpio entries are not present in dt file, the resource query
function returns negative value for gpio count. Currently data
type for gpio count is unsigned int which wraps around and gives
positive result for negative value that causes failure while
probing the driver. Modify gpio count data type to integer and
check if it is positive before using it.

Change-Id: I1596f3d1090f5caa70735c66e10f82914ac7ab26
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2013-10-31 10:03:35 -07:00
Sarang Joshi 177fb74435 coresight: modify function names and messages
Modify function names and messages to be consistent with other
modules. Modify function names starting with control_* to
event_*, abort_control_tracing to event_trace_user_fault and
abort_tracing_undef_instr to event_trace_undef_instr.

Change-Id: Ic6101dc8024b8d10713c162ea93e268ba59eaf8a
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
2013-10-28 20:56:21 -07:00
Linux Build Service Account efe83c7f77 Merge "coresight: fix error checks for byte counter init code" 2013-10-25 08:19:00 -07:00
Pratik Patel 12f1c666d5 coresight: fix error checks for byte counter init code
Fix error checks for byte counter initialization functions that
are called during probe to avoid null pointer accesses.

CRs-Fixed: 562303
Change-Id: I8f7de6fc4b0658cf649e472d12a00ea5733a8b0a
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-10-23 17:34:51 -07:00
Aparna Das 9f167a15ac coresight: add support for NIDnT modes
Add support to switch between various Narrow Interface for Debug and
Trace (NIDnT) modes namely Serial Wire Debug, UART and Trace modes
through SD card interface.

Change-Id: I3d263fe7ec623b0d9c81021d79a69ba5b54ad7e0
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-10-23 17:13:12 -07:00
Aparna Das 0f610611d1 coresight: support etm tracing on remote processors
Currently the remote processors do not have access to CoreSight debug
and trace framework. Add support for configuring the required CoreSight
components to enable ETM tracing on these processors.

Change-Id: I1a2aa6567f26124124cf1c570575836e62519052
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-10-04 14:53:17 -07:00
Aparna Das 74b9664470 coresight: query cti mappings only when cti is enabled
Read cti mappings only when cti is enabled to ensure required cti clock
is enabled.

Change-Id: I7500b44a44c058f37497c2226b8e1b097e734b87
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-09-05 14:53:04 -07:00
Pratik Patel 38227b0337 coresight: use fixed clock rate for tpiu sdc use case
Vote for a fixed clock frequency for TPIU output to SD to
workaround trace data corruption issues across XO shutdown.

Change-Id: Iaa7e822899685c3b5d0cc01dea1090e817e9b129
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 17:28:38 -07:00
Aparna Das d0489e342b coresight: disable sdc io regulator when disabling tpiu
The sdc io regulator is configured and enabled when TPIU trace via sdc
is enabled. Disable this regulator when TPIU trace is disabled.

Change-Id: Ib1dfacb1c4977c74b1796f17f763f8abea583171
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-09-04 17:28:14 -07:00
Pratik Patel 234885a545 coresight: use no log version of readl while dumping etf
During kernel panic, coresight_abort is first called to stop
tracing to the default ETF (circular buffer mode) sink. This is
followed by stopping RTB as part of the panic handler.

Use no log version of readl while dumping ETF in circular buffer
mode to avoid polluting RTB logs with readls responsible for
dumping ETF during kernel panic.

Change-Id: I282516be458c8b38af20cb372803cdff9eb9e8f0
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 17:23:11 -07:00
Aparna Das 878e4c2b2b coresight: use dma_alloc_coherent for allocating tmc-etr memory
The CoreSight TMC driver when configured for ETR requires uncached
memory in RAM to which it routes trace data. In order to allocate
this memory replace existing allocate_contiguous_ebi api with
dma_alloc_coherent api which is the linux standard of allocating
memory.

Change-Id: I59f88009f2abed95fd9b81ea92a7d484b9d6b833
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-09-04 17:21:50 -07:00
Pratik Patel 126b76f777 coresight: enable flush-on-flushin for periodic flush to usb
Periodic flushing for ETR to USB uses ETR flush-on-FLUSHIN
external input. Hence, enable flush-on-FLUSHIN by default when
enabling ETR to USB transfers and work around the manual flush
failure by skipping it during ETR to USB disable. Adjust the
periodic flush threshold to the maximum value in order to
reduce the overhead when there is no data to be transferred.

CRs-Fixed: 461885
Change-Id: Ie3a1bbc80e017f187af56fcfdfb52297ba9aa72d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 17:21:38 -07:00
Pushkar Joshi 0d311f9f8d coresight: add lpae support for coresight tmc driver
Modify the CoreSight TMC driver for LPAE so that it can support
ETR physical addresses greater than 32 bits when LPAE is enabled.

Change-Id: I6db2c98c4db70262ab45f7ff11fe2a6846259f8a
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
2013-09-04 17:21:05 -07:00
Aparna Das 862a5d2926 coresight: add support to reset cti block
Add support to reset each CoreSight cti device through sysfs. This
disables all cross triggering functionality on cti device by
unmapping all mapped cti trigins and cti trigouts and disabling the
cti device.

Change-Id: I4d1f48ad63e1317c893471e1818cd529dd2b002b
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-09-04 17:19:22 -07:00
Pushkar Joshi 652e5255d4 coresight: disable byte counter if byte counter initialization fails
The byte counter feature is enabled only if all the components it relies
on can be succesfully enabled.

Change-Id: I09e9b78c21af66d8cfc7c94d286f5b61adb7f7d6
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
2013-09-04 17:19:11 -07:00
Aparna Das e0abee5ff2 coresight: configure sdc io regulator for tpiu trace via sdc
For trace via sdc the sdc io regulator needs to be configured and enabled.
Add support for this in CoreSight driver instead of depending upon the
configured values of sdc io regulator on bootup.

Change-Id: I65f341c1dde58ee5e66372bcfb11393fc33bef54
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-09-04 17:18:50 -07:00
Pushkar Joshi 73389e5ed3 coresight: perform byte counter value check only for non-zero values
A check for the byte counter interrupt value being such that it
divides the memory reserved into equal size blocks is necessary
only when a non-zero value is specified.

Change-Id: I424c09322f2ee82917359d871f0916b3fb50b0be
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
2013-09-04 17:17:25 -07:00
Pushkar Joshi 5913467ded coresight: appropriately handle hardware event mux control registers
Modify the hardware events driver so that it can handle the hardware event
mux control register addresses being greater than 32 bits.

Change-Id: Id41ce183fa946b14590947f21fbcea361393543f
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
2013-09-04 17:16:04 -07:00
Aparna Das 5c55e11a3d coresight: add support to query current cti mappings
Add support to show the CTI channels mapped onto CTI trigger inputs
and CTI trigger outputs via sysfs for each CTI block.

Change-Id: Ib105651f621516dc2055e72c371780cb4497e43a
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-09-04 17:15:30 -07:00