static unsigned last_heap_free = 0xffffffff;
-#define MSM_A2M_INT(n) (MSM_CSR_BASE + 0x400 + (n) * 4)
+static inline void msm_a2m_int(uint32_t irq)
+{
+#if defined(CONFIG_ARCH_MSM7X30)
+ writel(1 << irq, MSM_GCC_BASE + 0x8);
+#else
+ writel(1, MSM_CSR_BASE + 0x400 + (irq * 4));
+#endif
+}
+
static inline void notify_other_smsm(void)
{
- writel(1, MSM_A2M_INT(5));
+ msm_a2m_int(5);
#ifdef CONFIG_QDSP6
- writel(1, MSM_A2M_INT(8));
+ msm_a2m_int(8);
#endif
}
static inline void notify_modem_smd(void)
{
- writel(1, MSM_A2M_INT(0));
+ msm_a2m_int(0);
}
static inline void notify_dsp_smd(void)
{
- writel(1, MSM_A2M_INT(8));
+ msm_a2m_int(8);
}
static void smd_diag(void)
;
}
-extern int (*msm_check_for_modem_crash)(void);
-
uint32_t raw_smsm_get_state(enum smsm_state_item item)
{
return readl(smd_info.state + item * 4);
return r;
}
-static int smd_alloc_v2(struct smd_channel *ch)
-{
- struct smd_shared_v2 *shared2;
- void *buffer;
- unsigned buffer_sz;
-
- shared2 = smem_alloc(SMEM_SMD_BASE_ID + ch->n, sizeof(*shared2));
- buffer = smem_item(SMEM_SMD_FIFO_BASE_ID + ch->n, &buffer_sz);
-
- if (!buffer)
- return -1;
-
- /* buffer must be a power-of-two size */
- if (buffer_sz & (buffer_sz - 1))
- return -1;
-
- buffer_sz /= 2;
- ch->send = &shared2->ch0;
- ch->recv = &shared2->ch1;
- ch->send_data = buffer;
- ch->recv_data = buffer + buffer_sz;
- ch->fifo_size = buffer_sz;
- return 0;
-}
-
-static int smd_alloc_v1(struct smd_channel *ch)
-{
- struct smd_shared_v1 *shared1;
- shared1 = smem_alloc(ID_SMD_CHANNELS + ch->n, sizeof(*shared1));
- if (!shared1) {
- pr_err("smd_alloc_channel() cid %d does not exist\n", ch->n);
- return -1;
- }
- ch->send = &shared1->ch0;
- ch->recv = &shared1->ch1;
- ch->send_data = shared1->data0;
- ch->recv_data = shared1->data1;
- ch->fifo_size = SMD_BUF_SIZE;
- return 0;
-}
-
-
static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
{
struct smd_channel *ch;
}
ch->n = cid;
- if (smd_alloc_v2(ch) && smd_alloc_v1(ch)) {
+ if (_smd_alloc_channel(ch)) {
kfree(ch);
return -1;
}
if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
pr_info("<SM %08x %08x>\n", apps, modm);
- if (modm & SMSM_RESET) {
+ if (modm & SMSM_RESET)
handle_modem_crash();
- }
+
do_smd_probe();
spin_unlock_irqrestore(&smem_lock, flags);
return 0;
}
-extern void msm_init_last_radio_log(struct module *);
-
static int __init msm_smd_probe(struct platform_device *pdev)
{
pr_info("smd_init()\n");