aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/smd.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-msm/smd.c')
-rw-r--r--arch/arm/mach-msm/smd.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index 657be73297db..c5a2eddc6cdc 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -30,7 +30,6 @@
30#include <linux/delay.h> 30#include <linux/delay.h>
31 31
32#include <mach/msm_smd.h> 32#include <mach/msm_smd.h>
33#include <mach/system.h>
34 33
35#include "smd_private.h" 34#include "smd_private.h"
36#include "proc_comm.h" 35#include "proc_comm.h"
@@ -39,8 +38,6 @@
39#define CONFIG_QDSP6 1 38#define CONFIG_QDSP6 1
40#endif 39#endif
41 40
42void (*msm_hw_reset_hook)(void);
43
44#define MODULE_NAME "msm_smd" 41#define MODULE_NAME "msm_smd"
45 42
46enum { 43enum {
@@ -52,13 +49,14 @@ static int msm_smd_debug_mask;
52 49
53struct shared_info { 50struct shared_info {
54 int ready; 51 int ready;
55 unsigned state; 52 void __iomem *state;
56}; 53};
57 54
58static unsigned dummy_state[SMSM_STATE_COUNT]; 55static unsigned dummy_state[SMSM_STATE_COUNT];
59 56
60static struct shared_info smd_info = { 57static struct shared_info smd_info = {
61 .state = (unsigned) &dummy_state, 58 /* FIXME: not a real __iomem pointer */
59 .state = &dummy_state,
62}; 60};
63 61
64module_param_named(debug_mask, msm_smd_debug_mask, 62module_param_named(debug_mask, msm_smd_debug_mask,
@@ -101,10 +99,6 @@ static void handle_modem_crash(void)
101 pr_err("ARM9 has CRASHED\n"); 99 pr_err("ARM9 has CRASHED\n");
102 smd_diag(); 100 smd_diag();
103 101
104 /* hard reboot if possible */
105 if (msm_hw_reset_hook)
106 msm_hw_reset_hook();
107
108 /* in this case the modem or watchdog should reboot us */ 102 /* in this case the modem or watchdog should reboot us */
109 for (;;) 103 for (;;)
110 ; 104 ;
@@ -796,22 +790,22 @@ void *smem_alloc(unsigned id, unsigned size)
796 return smem_find(id, size); 790 return smem_find(id, size);
797} 791}
798 792
799void *smem_item(unsigned id, unsigned *size) 793void __iomem *smem_item(unsigned id, unsigned *size)
800{ 794{
801 struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE; 795 struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE;
802 struct smem_heap_entry *toc = shared->heap_toc; 796 struct smem_heap_entry *toc = shared->heap_toc;
803 797
804 if (id >= SMEM_NUM_ITEMS) 798 if (id >= SMEM_NUM_ITEMS)
805 return 0; 799 return NULL;
806 800
807 if (toc[id].allocated) { 801 if (toc[id].allocated) {
808 *size = toc[id].size; 802 *size = toc[id].size;
809 return (void *) (MSM_SHARED_RAM_BASE + toc[id].offset); 803 return (MSM_SHARED_RAM_BASE + toc[id].offset);
810 } else { 804 } else {
811 *size = 0; 805 *size = 0;
812 } 806 }
813 807
814 return 0; 808 return NULL;
815} 809}
816 810
817void *smem_find(unsigned id, unsigned size_in) 811void *smem_find(unsigned id, unsigned size_in)
@@ -857,7 +851,7 @@ static irqreturn_t smsm_irq_handler(int irq, void *data)
857int smsm_change_state(enum smsm_state_item item, 851int smsm_change_state(enum smsm_state_item item,
858 uint32_t clear_mask, uint32_t set_mask) 852 uint32_t clear_mask, uint32_t set_mask)
859{ 853{
860 unsigned long addr = smd_info.state + item * 4; 854 void __iomem *addr = smd_info.state + item * 4;
861 unsigned long flags; 855 unsigned long flags;
862 unsigned state; 856 unsigned state;
863 857
@@ -943,10 +937,10 @@ int smd_core_init(void)
943 /* wait for essential items to be initialized */ 937 /* wait for essential items to be initialized */
944 for (;;) { 938 for (;;) {
945 unsigned size; 939 unsigned size;
946 void *state; 940 void __iomem *state;
947 state = smem_item(SMEM_SMSM_SHARED_STATE, &size); 941 state = smem_item(SMEM_SMSM_SHARED_STATE, &size);
948 if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) { 942 if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) {
949 smd_info.state = (unsigned)state; 943 smd_info.state = state;
950 break; 944 break;
951 } 945 }
952 } 946 }