aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/include
diff options
context:
space:
mode:
authorBrian Swetland <swetland@google.com>2008-09-29 19:00:48 -0400
committerDaniel Walker <dwalker@codeaurora.org>2010-05-12 12:14:52 -0400
commit2eb44eb9c8026f3f548bfbc903156b6aea54ed24 (patch)
tree77c5a94f893eba0f7aab3570fc74200fddface22 /arch/arm/mach-msm/include
parent830d843b75338b94b7c769a2c3b59b04744a9323 (diff)
[ARM] msm: shared memory interface for baseband processor ipc
This code provides the low level interface to the "shared memory state machine" (smsm), and the virtual serial channels (smd), used to communicate with the baseband processor. Higher level transports (rpc, ethernet, AT command channel, etc) ride on top of this. Signed-off-by: Brian Swetland <swetland@google.com>
Diffstat (limited to 'arch/arm/mach-msm/include')
-rw-r--r--arch/arm/mach-msm/include/mach/msm_smd.h107
-rw-r--r--arch/arm/mach-msm/include/mach/system.h5
2 files changed, 112 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
new file mode 100644
index 000000000000..bdf7731ab680
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/msm_smd.h
@@ -0,0 +1,107 @@
1/* linux/include/asm-arm/arch-msm/msm_smd.h
2 *
3 * Copyright (C) 2007 Google, Inc.
4 * Author: Brian Swetland <swetland@google.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef __ASM_ARCH_MSM_SMD_H
18#define __ASM_ARCH_MSM_SMD_H
19
20typedef struct smd_channel smd_channel_t;
21
22/* warning: notify() may be called before open returns */
23int smd_open(const char *name, smd_channel_t **ch, void *priv,
24 void (*notify)(void *priv, unsigned event));
25
26#define SMD_EVENT_DATA 1
27#define SMD_EVENT_OPEN 2
28#define SMD_EVENT_CLOSE 3
29
30int smd_close(smd_channel_t *ch);
31
32/* passing a null pointer for data reads and discards */
33int smd_read(smd_channel_t *ch, void *data, int len);
34
35/* Write to stream channels may do a partial write and return
36** the length actually written.
37** Write to packet channels will never do a partial write --
38** it will return the requested length written or an error.
39*/
40int smd_write(smd_channel_t *ch, const void *data, int len);
41
42int smd_write_avail(smd_channel_t *ch);
43int smd_read_avail(smd_channel_t *ch);
44
45/* Returns the total size of the current packet being read.
46** Returns 0 if no packets available or a stream channel.
47*/
48int smd_cur_packet_size(smd_channel_t *ch);
49
50/* used for tty unthrottling and the like -- causes the notify()
51** callback to be called from the same lock context as is used
52** when it is called from channel updates
53*/
54void smd_kick(smd_channel_t *ch);
55
56
57#if 0
58/* these are interruptable waits which will block you until the specified
59** number of bytes are readable or writable.
60*/
61int smd_wait_until_readable(smd_channel_t *ch, int bytes);
62int smd_wait_until_writable(smd_channel_t *ch, int bytes);
63#endif
64
65typedef enum
66{
67 SMD_PORT_DS = 0,
68 SMD_PORT_DIAG,
69 SMD_PORT_RPC_CALL,
70 SMD_PORT_RPC_REPLY,
71 SMD_PORT_BT,
72 SMD_PORT_CONTROL,
73 SMD_PORT_MEMCPY_SPARE1,
74 SMD_PORT_DATA1,
75 SMD_PORT_DATA2,
76 SMD_PORT_DATA3,
77 SMD_PORT_DATA4,
78 SMD_PORT_DATA5,
79 SMD_PORT_DATA6,
80 SMD_PORT_DATA7,
81 SMD_PORT_DATA8,
82 SMD_PORT_DATA9,
83 SMD_PORT_DATA10,
84 SMD_PORT_DATA11,
85 SMD_PORT_DATA12,
86 SMD_PORT_DATA13,
87 SMD_PORT_DATA14,
88 SMD_PORT_DATA15,
89 SMD_PORT_DATA16,
90 SMD_PORT_DATA17,
91 SMD_PORT_DATA18,
92 SMD_PORT_DATA19,
93 SMD_PORT_DATA20,
94 SMD_PORT_GPS_NMEA,
95 SMD_PORT_BRIDGE_1,
96 SMD_PORT_BRIDGE_2,
97 SMD_PORT_BRIDGE_3,
98 SMD_PORT_BRIDGE_4,
99 SMD_PORT_BRIDGE_5,
100 SMD_PORT_LOOPBACK,
101 SMD_PORT_CS_APPS_MODEM,
102 SMD_PORT_CS_APPS_DSP,
103 SMD_PORT_CS_MODEM_DSP,
104 SMD_NUM_PORTS,
105} smd_port_id_type;
106
107#endif
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h
index 574ccc493daf..d2e83f42ba16 100644
--- a/arch/arm/mach-msm/include/mach/system.h
+++ b/arch/arm/mach-msm/include/mach/system.h
@@ -21,3 +21,8 @@ static inline void arch_reset(char mode, const char *cmd)
21{ 21{
22 for (;;) ; /* depends on IPC w/ other core */ 22 for (;;) ; /* depends on IPC w/ other core */
23} 23}
24
25/* low level hardware reset hook -- for example, hitting the
26 * PSHOLD line on the PMIC to hard reset the system
27 */
28extern void (*msm_hw_reset_hook)(void);