linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 02/12] Kernel documentation for the PTI feature.
@ 2011-02-09  0:17 james_p_freyensee
  2011-02-09  0:17 ` [PATCH 03/12] Intel PTI implementaiton of 1149 james_p_freyensee
  0 siblings, 1 reply; 22+ messages in thread
From: james_p_freyensee @ 2011-02-09  0:17 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, suhail.ahmed, james_p_freyensee

From: J Freyensee <james_p_freyensee@linux.intel.com>

This provides Kernel documentation for the PTI
feature for Linux mobile solutions.

Signed-off-by: J Freyensee <james_p_freyensee@linux.intel.com>
---
 Documentation/pti/pti_intel_mid.txt |   89 +++++++++++++++++++++++++++++++++++
 1 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/pti/pti_intel_mid.txt

diff --git a/Documentation/pti/pti_intel_mid.txt b/Documentation/pti/pti_intel_mid.txt
new file mode 100644
index 0000000..b9c3f3a
--- /dev/null
+++ b/Documentation/pti/pti_intel_mid.txt
@@ -0,0 +1,89 @@
+The Intel MID PTI project is HW implemented in Intel Atom
+system-on-a-chip designs based on the Parallel Trace
+Interface for MIPI P1149.7 cJTAG standard.  The kernel solution
+for this platform involves the following files:
+
+./include/linux/pti.h
+./include/linux/n_tracesink.h
+./drivers/.../n_tracerouter.c
+./drivers/.../n_tracesink.c
+./drivers/.../pti.c
+
+pti.c is the driver that enables various debugging features
+popular on certain mobile manufacturers.  n_tracerouter.c
+and n_tracesink.c allow extra system information to be
+collected and routed to the pti driver, such as trace
+debugging data from a modem.  Altough n_tracerouter
+and n_tracesink are a part of the complete PTI solution,
+these two line disciplines can work separate from
+pti.c and route any data stream from one /dev/tty node
+to another /dev/tty node via kernel-space.  This provides
+a stable, reliable connection that will not break unless
+the user-space application shuts down (plus avoids
+kernel->user->kernel context switch overheads of routing
+data).
+
+An example debugging usage for this driver system:
+   *Hook /dev/ttyPTI0 to syslogd.  Opening this port will also start
+    a console device to further capture debugging messages to PTI.
+   *Hook /dev/ttyPTI1 to modem debugging data to write to PTI HW.
+    This is where n_tracerouter and n_tracesink are used.
+   *Hook /dev/pti to a user-level debugging application for writing
+    to PTI HW.
+   *Use mipi_* Kernel Driver API in other device drivers for
+    debugging to PTI by first requesting a PTI write address via
+    mipi_request_masterchannel(1).
+
+Example 'privileged' (normal user privileges are not enough)
+user-space code on how to setup the n_tracerouter and n_tracesink
+ldisc drivers (note: n_tracerouter depends on n_tracesink):
+
+/////////// To hook up n_tracerouter and n_tracesink /////////
+
+#include <errno.h>
+#define ONE_TTY "/dev/ttyOne"
+#define TWO_TTY "/dev/ttyTwo"
+
+// needed global to hand onto ldisc connection
+static int g_fd_source = -1;
+static int g_fd_sink  = -1;
+
+// grab LDISC values from loaded ldisc drivers from /proc/tty/ldiscs
+int source_ldisc_num, sink_ldisc_num = -1;
+int retval;
+
+g_fd_source = open(ONE_TTY, O_RDWR); // must be R/W
+g_fd_sink   = open(TWO_TTY, O_RDWR); // must be R/W
+
+if (g_fd_source <= 0) || (g_fd_sink <= 0) {
+   // doubt you'll want to use these exact error lines of code
+   printf("Error on open(). errno: %d\n",errno);
+   return errno;
+}
+
+retval = ioctl(g_fd_sink, TIOCSETD, &sink_ldisc_num);
+if (retval < 0) {
+   printf("Error on ioctl().  errno: %d\n", errno);
+   return errno;
+}
+
+retval = ioctl(g_fd_source, TIOCSETD, &source_ldisc_num);
+if (retval < 0) {
+   printf("Error on ioctl().  errno: %d\n", errno);
+   return errno;
+}
+
+/////////// To disconnect n_tracerouter and n_tracesink ////////
+
+// First make sure data through the ldiscs has stopped.
+
+// Second, disconnect ldiscs.  This provides a
+// little cleaner shutdown on tty stack.
+sink_ldisc_num = 0;
+source_ldisc_num = 0;
+ioctl(g_fd_uart, TIOCSETD, &sink_ldisc_num);
+ioctl(g_fd_gadget, TIOCSETD, &source_ldisc_num);
+
+// Three, program closes connection:
+close(g_fd_uart);
+close(g_fd_gadget);
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread
* Resend: Request for review and addition of PTI implementation into kernel
@ 2011-02-08 19:34 james_p_freyensee
  2011-02-08 19:34 ` [PATCH 01/12] export kernel call get_task_comm() james_p_freyensee
  0 siblings, 1 reply; 22+ messages in thread
From: james_p_freyensee @ 2011-02-08 19:34 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, suhail.ahmed, james_p_freyensee

I apologize if this winds up being a duplicate; I believe yesterday's email 
attempt never made it out completely.

This is a request for review and acceptance into the mainline kernel
for the Intel-Atom implementation of the MIPI P1149.7 compact JTAG
standard for mobile devices.  Complete documentation and background
has been provided in PATCH 02/12, "Kernel documentation for the PTI
feature".  PATCH 01/12 is a kernel fix to allow the PTI driver
to compile modularly; this is a fix Greg KH, Alan Cox, and Arjan
van de Ven and I talked about a while ago.  It's not techincally
related to PTI, but it is it's own separate patch so it can be
applied independent of any possible problems with the PTI submission.

Thanks for your help and time.  Regards,
J Freyensee


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2011-02-22 22:55 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-09  0:17 [PATCH 02/12] Kernel documentation for the PTI feature james_p_freyensee
2011-02-09  0:17 ` [PATCH 03/12] Intel PTI implementaiton of 1149 james_p_freyensee
2011-02-09  0:17   ` [PATCH 04/12] PTI Kconfig change in misc james_p_freyensee
2011-02-09  0:17     ` [PATCH 05/12] PTI misc Makefile addition james_p_freyensee
2011-02-09  0:17       ` [PATCH 06/12] PTI header file james_p_freyensee
2011-02-09  0:17         ` [PATCH 07/12] n_tracerouter and n_tracesink additions james_p_freyensee
2011-02-09  0:17           ` [PATCH 08/12] n_tracesink ldisc addition james_p_freyensee
2011-02-09  0:17             ` [PATCH 09/12] n_tracesink header file james_p_freyensee
2011-02-09  0:17               ` [PATCH 10/12] n_tracerouter ldisc driver james_p_freyensee
2011-02-09  0:17                 ` [PATCH 11/12] n_tracerouter and n_tracesink Kconfig james_p_freyensee
2011-02-09  0:17                   ` [PATCH 12/12] n_tracerouter and n_tracesink Makefile addition james_p_freyensee
2011-02-09  0:19                     ` james_p_freyensee
     [not found]                     ` <57934.10.23.16.85.1297210742.squirrel@linux.intel.com>
2011-02-09  0:34                       ` PTI- PLEASE IGNORE SECOND DUPLICATE 12 PATCH SET james_p_freyensee
  -- strict thread matches above, loose matches on Subject: below --
2011-02-08 19:34 Resend: Request for review and addition of PTI implementation into kernel james_p_freyensee
2011-02-08 19:34 ` [PATCH 01/12] export kernel call get_task_comm() james_p_freyensee
2011-02-08 19:34   ` [PATCH 02/12] Kernel documentation for the PTI feature james_p_freyensee
2011-02-08 19:34     ` [PATCH 03/12] Intel PTI implementaiton of 1149 james_p_freyensee
2011-02-08 19:34       ` [PATCH 04/12] PTI Kconfig change in misc james_p_freyensee
2011-02-08 19:34         ` [PATCH 05/12] PTI misc Makefile addition james_p_freyensee
2011-02-08 19:34           ` [PATCH 06/12] PTI header file james_p_freyensee
2011-02-08 19:34             ` [PATCH 07/12] n_tracerouter and n_tracesink additions james_p_freyensee
2011-02-08 19:34               ` [PATCH 08/12] n_tracesink ldisc addition james_p_freyensee
2011-02-08 19:34                 ` [PATCH 09/12] n_tracesink header file james_p_freyensee
2011-02-17 19:23                   ` Greg KH
2011-02-17 19:45                     ` J Freyensee
2011-02-17 19:54                       ` Greg KH
2011-02-17 20:10                         ` J Freyensee
2011-02-17 21:43                           ` Greg KH
2011-02-22 20:22                             ` J Freyensee
2011-02-22 20:26                               ` Greg KH
2011-02-22 22:55                                 ` J Freyensee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).