aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_data/modem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/platform_data/modem.h')
-rw-r--r--include/linux/platform_data/modem.h155
1 files changed, 91 insertions, 64 deletions
diff --git a/include/linux/platform_data/modem.h b/include/linux/platform_data/modem.h
index d66af9f..8eb949c 100644
--- a/include/linux/platform_data/modem.h
+++ b/include/linux/platform_data/modem.h
@@ -23,7 +23,10 @@ enum modem_t {
VIA_CBP72,
SEC_CMC221,
QC_MDM6600,
+ QC_ESC6270,
+ SPRD_SC8803,
DUMMY,
+ MAX_MODEM_TYPE
};
enum dev_format {
@@ -36,7 +39,8 @@ enum dev_format {
IPC_RAMDUMP,
MAX_DEV_FORMAT,
};
-#define MAX_IPC_DEV (IPC_RFS + 1)
+#define MAX_IPC_DEV (IPC_RFS + 1) /* FMT, RAW, RFS */
+#define MAX_SIPC5_DEV (IPC_RAW + 1) /* FMT, RAW */
enum modem_io {
IODEV_MISC,
@@ -52,6 +56,7 @@ enum modem_link {
LINKDEV_USB,
LINKDEV_HSIC,
LINKDEV_C2C,
+ LINKDEV_PLD,
LINKDEV_MAX,
};
#define LINKTYPE(modem_link) (1u << (modem_link))
@@ -59,6 +64,7 @@ enum modem_link {
enum modem_network {
UMTS_NETWORK,
CDMA_NETWORK,
+ TDSCDMA_NETWORK,
LTE_NETWORK,
};
@@ -108,15 +114,20 @@ struct modemlink_pm_data {
unsigned gpio_link_hostwake;
unsigned gpio_link_slavewake;
int (*link_reconnect)(void);
+
+ /* usb hub only */
int (*port_enable)(int, int);
- int *p_hub_status;
+ int (*hub_standby)(void *);
+ void *hub_pm_data;
bool has_usbhub;
+ /* cpu/bus frequency lock */
atomic_t freqlock;
- int (*cpufreq_lock)(void);
- int (*cpufreq_unlock)(void);
+ int (*freq_lock)(struct device *dev);
+ int (*freq_unlock)(struct device *dev);
int autosuspend_delay_ms; /* if zero, the default value is used */
+ void (*ehci_reg_dump)(struct device *);
};
struct modemlink_pm_link_activectl {
@@ -124,14 +135,25 @@ struct modemlink_pm_link_activectl {
int gpio_request_host_active;
};
+#define RES_CP_ACTIVE_IRQ_ID 0
+#define RES_DPRAM_MEM_ID 1
+#define RES_DPRAM_IRQ_ID 2
+#define RES_DPRAM_SFR_ID 3
+
enum dpram_type {
EXT_DPRAM,
- CP_IDPRAM,
AP_IDPRAM,
- C2C_DPRAM,
+ CP_IDPRAM,
+ SHM_DPRAM,
MAX_DPRAM_TYPE
};
+#define DPRAM_SIZE_8KB 0x02000
+#define DPRAM_SIZE_16KB 0x04000
+#define DPRAM_SIZE_32KB 0x08000
+#define DPRAM_SIZE_64KB 0x10000
+#define DPRAM_SIZE_128KB 0x20000
+
enum dpram_speed {
DPRAM_SPEED_LOW,
DPRAM_SPEED_MID,
@@ -159,6 +181,19 @@ struct dpram_ipc_device {
};
struct dpram_ipc_map {
+#if defined(CONFIG_LINK_DEVICE_PLD)
+ u16 __iomem *mbx_ap2cp;
+ u16 __iomem *magic_ap2cp;
+ u16 __iomem *access_ap2cp;
+
+ u16 __iomem *mbx_cp2ap;
+ u16 __iomem *magic_cp2ap;
+ u16 __iomem *access_cp2ap;
+
+ struct dpram_ipc_device dev[MAX_IPC_DEV];
+
+ u16 __iomem *address_buffer;
+#else
u16 __iomem *magic;
u16 __iomem *access;
@@ -166,75 +201,38 @@ struct dpram_ipc_map {
u16 __iomem *mbx_cp2ap;
u16 __iomem *mbx_ap2cp;
+#endif
};
struct modemlink_dpram_control {
void (*reset)(void);
- void (*setup_speed)(enum dpram_speed);
- int (*wakeup)(void);
- void (*sleep)(void);
-
void (*clear_intr)(void);
- u16 (*recv_intr)(void);
+ u16 (*recv_intr)(void);
void (*send_intr)(u16);
- u16 (*recv_msg)(void);
+ u16 (*recv_msg)(void);
void (*send_msg)(u16);
- u16 (*get_magic)(void);
- void (*set_magic)(u16);
-
- u16 (*get_access)(void);
- void (*set_access)(u16);
-
- u32 (*get_tx_head)(int);
- u32 (*get_tx_tail)(int);
- void (*set_tx_head)(int, u32);
- void (*set_tx_tail)(int, u32);
- u8 __iomem * (*get_tx_buff)(int);
- u32 (*get_tx_buff_size)(int);
- u16 (*get_mask_req_ack)(int);
- u16 (*get_mask_res_ack)(int);
- u16 (*get_mask_send)(int);
-
- u32 (*get_rx_head)(int);
- u32 (*get_rx_tail)(int);
- void (*set_rx_head)(int, u32);
- void (*set_rx_tail)(int, u32);
- u8 __iomem * (*get_rx_buff)(int);
- u32 (*get_rx_buff_size)(int);
-
- void (*log_disp)(struct modemlink_dpram_control *dpctl);
- int (*cpupload_step1)(struct modemlink_dpram_control *dpctl);
- int (*cpupload_step2)(void *arg, struct modemlink_dpram_control *dpctl);
- int (*cpimage_load_prepare)(struct modemlink_dpram_control *dpctl);
- int (*cpimage_load)(void *arg, struct modemlink_dpram_control *dpctl);
- int (*nvdata_load)(void *arg, struct modemlink_dpram_control *dpctl);
- int (*phone_boot_start)(struct modemlink_dpram_control *dpctl);
- int (*phone_boot_start_post_process)(void);
- void (*phone_boot_start_handler)(struct modemlink_dpram_control *dpctl);
- void (*dload_cmd_hdlr)(
- struct modemlink_dpram_control *dpctl, u16 cmd);
- void (*bt_map_init)(struct modemlink_dpram_control *dpctl);
- void (*load_init)(struct modemlink_dpram_control *dpctl);
-#if defined(CONFIG_MACH_M0_CTC)
- void (*terminate_link)(struct modemlink_dpram_control *dpctl);
-#endif
- u8 __iomem *dp_base;
- u32 dp_size;
- enum dpram_type dp_type; /* DPRAM type */
- int aligned; /* If aligned access is required, ... */
+ int (*wakeup)(void);
+ void (*sleep)(void);
- int dpram_irq;
- unsigned long dpram_irq_flags;
- char *dpram_irq_name;
- char *dpram_wlock_name;
+ void (*setup_speed)(enum dpram_speed);
- int max_ipc_dev;
+ enum dpram_type dp_type; /* DPRAM type */
+ int aligned; /* aligned access is required */
+ u8 __iomem *dp_base;
+ u32 dp_size;
+ int dpram_irq;
+ unsigned long dpram_irq_flags;
+
+ int max_ipc_dev;
struct dpram_ipc_map *ipc_map;
-};
-#define DPRAM_MAGIC_CODE 0xAA
+ unsigned boot_size_offset;
+ unsigned boot_tag_offset;
+ unsigned boot_count_offset;
+ unsigned max_boot_frame_size;
+};
/* platform data */
struct modem_data {
@@ -255,10 +253,22 @@ struct modem_data {
#endif
unsigned gpio_cp_warm_reset;
unsigned gpio_sim_detect;
-#ifdef CONFIG_LINK_DEVICE_DPRAM
+#if defined(CONFIG_LINK_DEVICE_DPRAM) || defined(CONFIG_LINK_DEVICE_PLD)
unsigned gpio_dpram_int;
#endif
+#ifdef CONFIG_LINK_DEVICE_PLD
+ unsigned gpio_fpga1_creset;
+ unsigned gpio_fpga1_cdone;
+ unsigned gpio_fpga1_rst_n;
+ unsigned gpio_fpga1_cs_n;
+
+ unsigned gpio_fpga2_creset;
+ unsigned gpio_fpga2_cdone;
+ unsigned gpio_fpga2_rst_n;
+ unsigned gpio_fpga2_cs_n;
+#endif
+
#ifdef CONFIG_LTE_MODEM_CMC221
unsigned gpio_dpram_status;
unsigned gpio_dpram_wakeup;
@@ -275,6 +285,21 @@ struct modem_data {
struct regulator *cp_vbus;
#endif
+#ifdef CONFIG_TDSCDMA_MODEM_SPRD8803
+ unsigned gpio_ipc_mrdy;
+ unsigned gpio_ipc_srdy;
+ unsigned gpio_ipc_sub_mrdy;
+ unsigned gpio_ipc_sub_srdy;
+ unsigned gpio_ap_cp_int1;
+ unsigned gpio_ap_cp_int2;
+#endif
+
+#ifdef CONFIG_SEC_DUAL_MODEM_MODE
+ unsigned gpio_sim_io_sel;
+ unsigned gpio_cp_ctrl1;
+ unsigned gpio_cp_ctrl2;
+#endif
+
/* Switch with 2 links in a modem */
unsigned gpio_dynamic_switching;
@@ -283,7 +308,7 @@ struct modem_data {
enum modem_t modem_type;
enum modem_link link_types;
char *link_name;
-#ifdef CONFIG_LINK_DEVICE_DPRAM
+#if defined(CONFIG_LINK_DEVICE_DPRAM) || defined(CONFIG_LINK_DEVICE_PLD)
/* Link to DPRAM control functions dependent on each platform */
struct modemlink_dpram_control *dpram_ctl;
#endif
@@ -306,6 +331,8 @@ struct modem_data {
/* Debugging option */
bool use_mif_log;
+ /* SIM Detect polarity */
+ bool sim_polarity;
};
#define LOG_TAG "mif: "