Commit Graph

29 Commits

Author SHA1 Message Date
Xiaogang Cui 1daf7a8fef coresight: add attributes to show available modes and mem-type options
Add available_out_modes and available_mem_types device attributes to
provide information on available out modes and memory type options
supported for TPIU and TMC configurations.

Change-Id: Iec02c42877aa75f024590bf112d1c33eb4ad5e46
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
2014-10-21 13:53:36 -07:00
Xiaogang Cui 9ac709e17d coresight: enable SD only mode when hardware sensing is not enabled
cd_gpio is floating on some devices, then there is a possiblity
that a false CARD_DETECT toggle is created when software starts to
resume SD card from power collapse at the same time. SD driver resume
will fail due to collision.

Change-Id: I5b33da09fe8d71ea2fa381f98f1dd79286d28399
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
2014-09-29 10:37:29 +08: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
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
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
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
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
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
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
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
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
Pratik Patel 108dc514ac coresight: add coresight fuse state query
Add support to query CoreSight fuse state and fail the probe
if any of the required fuse(s) are disabled. This enables
a single image with CoreSight drivers compiled in to be run on
both Hardware that has CoreSight functionality disabled via fuse
or left enabled for use.

Change-Id: Ib770cc7f76e2b0644bda9600c92fc3a26823452d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 17:06:21 -07:00
Pratik Patel a70f107d4b coresight: free temporarily allocated memory when done using it
Free temporarily allocated memory pointed to by seta_cfgs and
setb_cfgs when we are done using it.

Change-Id: Id3b27277fe1ed1897acb49ac8593d295108f0472
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 16:35:04 -07:00
Pratik Patel 2d1c389ede coresight: release tpiu regulator of node only when done using it
Currently TPIU regualtor DT of node gets released on encountering
errors while reading voltage or current levels which can cause
use after free issues. Ensure the regulator of node gets released
only when we are completely done using it.

Change-Id: Ifaf8469aedb77e7d9fc6f71dab99417414f4e88d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 16:35:03 -07:00
Pratik Patel 57fe30be0b coresight: support sdc regulators without voltage/current levels
Add support for sdc regulators that don't have voltage or current
levels. This will allow tpiu output via sdc connector on chips
that power sdc connector with regulators without voltage and
current level support.

Change-Id: I03e9e94aebef3fc54a59922c50743ea8624bfdcf
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 16:33:11 -07:00
Aparna Das 23a951523e coresight: modify coresight drivers to use reg-names property
Modify coresight drivers to perform resource lookup by name. The
coresight drivers now use the reg-names property specified in dt
nodes to lookup for resources.

Change-Id: I986f9687be81706d2424e288b9875c3a93e12d11
Signed-off-by: Aparna Das <adas@codeaurora.org>
2013-09-04 16:13:53 -07:00
Pratik Patel 7d7b96f4ba coresight: support for tpiu output to mictor and sdc connectors
Add support to allow tpiu to output trace data to the mictor or
sdc connectors depending upon user configuration via sysfs nodes.
This will allow tpiu trace usage without JTag hence improving the
usability.

Change-Id: I905f1ae844eb46faa9d0fceb47cd89c425110305
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 16:12:54 -07:00
Pratik Patel 1847b5321c coresight: fix whitespace in coresight drivers
Add/remove whitespace to improve code readability.

Change-Id: Iade3100b7eb9a57f95849d6665257cffe85b26b3
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 15:08:57 -07:00
Pratik Patel 2cf0b0a1d7 coresight: implement coresight abort
Provide CoreSight abort debug api to stop the active trace sink
from any context. This is a best effort api that can be used to
abruptly stop and disable the current trace sink from anywhere
in the kernel to avoid tracing and hence polluting the trace data
after the point of interest has been executed.

Change-Id: I34c528d9febec4265088a7267dbcf0e7a1f87fcf
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 15:08:42 -07:00
Pratik Patel b98123a0a9 coresight: device tree support for coresight drivers
Support for reading hardware data for CoreSight devices from device
tree.

Change-Id: I4d149991c89b458384465d163386084f500a4028
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 15:08:32 -07:00
Pratik Patel 1d14fe6369 coresight: use devm apis in driver probe
Using devm_* apis helps in simplifying driver init and exit paths,
hence switch to using them in the driver probe calls.

Change-Id: I41aba1129f6638fcee859e57f957fa3f14c1c439
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 15:08:12 -07:00
Pratik Patel fa51345513 coresight: switch to use coresight core layer code
Switch all CoreSight drivers to start using the new CoreSight core
layer code. Remove obsolete qdss code.

Change-Id: I2d4496aea0ffd918e0bfbf4b4e58ad82ea634a59
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 15:07:49 -07:00
Pratik Patel 78653aca8c coresight: disable tpiu at init to support older targets
Some targets require tpiu is disabled before other sinks like ETB
get enabled to get proper ETM trace.

Change-Id: Idcacf7b6515fd17c3a49c74a338258f02631f7cc
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 15:04:26 -07:00
Pratik Patel 63a0ab6fe4 coresight: rename variables and functions from cs to coresight
Complete the rename by changing cs to coresight for variables,
functions and constants.

Change-Id: I506d5872e5c09f201c4f3674d7722d36eca26921
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 14:58:31 -07:00
Pratik Patel 30700919f3 coresight: rename directory and files from cs to coresight
Since cs is not a well known acronym for CoreSight, rename
directory and files from cs to coresight.

Change-Id: I5f9b12794b80b1c01c9ce0621d53ee6be408a361
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
2013-09-04 14:58:31 -07:00