Project

General

Profile

Qualcomm Kernel » History » Version 6

laforge, 12/16/2016 09:33 PM

1 6 laforge
{{>toc}}
2
3 1 laforge
h1. Qualcomm Kernel
4
5
Random notes about the Qualcomm Kernel as used on the MDM9615
6
7
h2. diag
8
9
h3. diag forwarding
10
11
<pre>
12
drivers/char/diag/diagfwd.[ch]
13
drivers/usb/gadget/f_diag.[ch]
14
drivers/usb/misc/diag_bridge.c
15
</pre>
16
17
* the usb diag gadget handles diag packet read/write over usb
18
* issues events like USB_DIAG_READ_DONE
19
* picked up by diagfwd.c
20
** can forward diag requests via SMD shared memory to other processors
21
22
h3. diag char
23
24 6 laforge
The kernel exports a /dev/diag char device which userspce processes can
25
use to register/listen for DIAG events from the system, or actually
26
register a DIAG 'subsystem' themselves which can then be controlled from
27
QXDM.
28
29 1 laforge
<pre>
30
drivers/char/diag/diagchar_core.c
31
</pre>
32
33
* ioctl()s for diag configuration
34
* supports several concurrent diag clients
35
* diag logging can be directed to USB/HSIC, character device and more
36
** {USB,CALLBACK,MEMORY_DEVICE,UART,NO_LOGGING}_MODE
37
38 5 laforge
drivers/char/diag/diag_dci.c
39 1 laforge
40
* DCI table is a routing table where pid/sockets can register for a
41
  given DCI.  socket close/cleanup code releases all DCI routes for
42
  that socket.
43
44 6 laforge
45
46 1 laforge
h2. SMD (shared memory)
47
48
* SMD sub-systems:
49
** Modem (assumed to be hexagon with modem firmware?)
50
** Q6 (formerly known as LPASS == Low Power Audio SubSystem)
51
** DSPS
52
** WCNSS (Wireless Connectivity Sub System) aka 'riva'
53
** RPM (Resource Power Manager)
54
* inter-processor-interrupts for various 'edges'
55
56
h3. core driver
57
58
* arch/arm/mach-msm/smd.c
59
60
h4. api
61 4 laforge
62 1 laforge
* smd_open()
63
* smd_close()
64
* smd_write*()
65
* smd_read*()
66
* smsm_*()
67
68 3 laforge
h3. MSM IPC socket
69 1 laforge
70
* arch/arm/mach-msm/ipc_socket.c
71
* AF_MSM_IPC
72
73 3 laforge
74
h3. packet ports
75 1 laforge
76
* Some kind of packet oriented interface towards the SMD
77
* msm_smd_pkt.c contains driver
78
** smdpkt0..7+smd22 devices, 2048 byte buffer
79
** open/release/read/write/poll syscalls implemented
80 6 laforge
81
h2. smem_log
82
83
This is some kidn of high speed shared memory based event log to which all processors can log events.
84
85
Userspace applications can use write() to @/dev/smem_log@ to add log entries.
86
87
Qualcomm uses a proprietary minimal shim layer offering SMEM_LOG_EVENT and SMEM_LOG_EVENT6 macros
88
that can be used to write events with an event ID plus three data words or six data words, respectively.
89
90
The shared memory log can be read from linux userspace via debugfs, see the devices in @/sys/kernel/debug/smem_log@
91
and simply use @cat@ on them. You will get lines like
92
<pre>
93
MODM: 3982377401 000d0000: 00000001: 03000019 01000028 01000015 53505041 00000061 5f696d71
94
MODM: 3982378159      QCSI: 00000004: 00040029 00240015 00000003 00000001 0000002b 00000000
95
MODM: 3982378619 000d0000: 00000001: 03000019 0100002b 01000015 53505041 00000061 5f696d71
96
APPS: 3982397356      QCCI: 00000005: 0004001d 0024000e 00000003 00000003 00000019 00000000
97
APPS: 3982400571      QCCI: 00000005: 00040029 0024000e 00000003 00000003 00000019 00000000
98
MODM: 1841235211      QCSI: 00000004: 0004001e 0024001c 00000003 00000001 00000028 00000000
99
MODM: 1841236665 000d0000: 00000001: 03000019 01000028 0101001c 53505041 00000061 5f696d71
100
MODM: 1841241411      QCSI: 00000004: 0004002a 0024001c 00000003 00000001 0000002b 00000000
101
MODM: 1841242246 000d0000: 00000001: 03000019 0100002b 0100001c 53505041 00000061 5f696d71
102
MODM: 1841243796      QCSI: 00000004: 0004002b 00660019 00000003 00000001 0000002b 00000000
103
MODM: 1841244286 000d0000: 00000001: 03000019 0100002b 01000019 53505041 00000061 5f696d71
104
APPS: 1841255456      QCCI: 00000005: 0004001e 00240015 00000003 00000003 00000019 00000000
105
MODM: 1841255335 000d0000: 00000002: 0100ffff 0300ffff 07000014 53505041 0000016c 74646d73
106
MODM: 1841255828 000d0000: 00000702: 00000001 00000028 00000007
107
APPS: 1841261430      QCCI: 00000005: 0004002a 00240015 00000003 00000003 00000019 00000000
108
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)