Instructions on EINT configuration for SIM hot swap for MT6575/MT6577 platforms

来源:互联网 发布:视频快速剪辑软件 编辑:程序博客网 时间:2024/06/07 06:51

方法如下:

For MT6575/MT6577 ICS2/JB version:

You need patch: ALPS00368898. Before configuring SIM hot swap, check if your company
has already applied the patch. According to hardware, configure “ALPS” AP side DCT
tool (the .dws file).
We suggest you:
1.Configure EINT to trigger “insert SIM card” state, H or L. For example: If “insert
SIM card” state is H (high), configure to trigger H (high).
2.Use level trigger (must be set to “Debounce time”; “Debounce time” must > 7). The
“Debounce time” value will be transferred to the Modemside then
“EINT_SW_Debounce_Modify()” for SW de-bounce time setting. The unit is 10ms.
“Debounce time: 7” -> 7*10=70ms. For modem side, the SW de-bounce time should be
longer than the default HW de-bounce time which is 63ms.
3.Modify source code “custom_sim_driver.c” of “modem”.
custom_sim_driver.c(MAUI\custom\drv\misc_drv\$(customer project)) 11AMDW**SP
sim_hot_plug_eint_cb_rm_h_common()
sim_hot_plug_eint_cb_rm_l_common()
Example:
GPI069 -> EINT3 mode
GPIO72 -> EINT4 mode
SIM1hot swap detect pin usesEINT No.3.
SIM2 hot swap detect pin uses EINT No.4.
High level -> Insert SIM card(card)
Low level -> Remove SIM card(no card)
 
Parameter Query   EINT number           Debounce time
s String          (EINT_NO)             (default:10)
                  SIM1_HOT_PLUG_EINT
                  SIM2_HOT_PLUG_EINT
AP SIM1_HOT_PLUG     3     10      
   SIM2_HOT_PLUG     4     10
 
sim_hot_plug_eint_cb_rm_l_common()
sim_hot_plug_eint_cb_rm_h_common()
modify as:
void sim_hot_plug_eint_cb_rm_h_common(kal_uint32 idx, SIM_ICC_APPLICATION app) {
if (iccHotPlugTable[idx].polarity == LEVEL_HIGH)
{
#if 0
/* Remove card: polarity LEVEL_HIGH. When interrupt occurs, we should change it to
LEVEL_LOW
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_TRUE;
if (iccHotPlugTable[idx].plugOutcb != NULL)
iccHotPlugTable[idx].plugOutcb(app);
#if defined (TST_MODULE)
tst_sys_trace("remove SIM");
#elif defined(__mtk_TARGET__)
sim_dbg_print("remove SIM");
#endif
#else
/* Insert card: polarity LEVEL_LOW. When interrupt occurs, we should change it to
LEVEL_HIGH
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_FALSE;
if (iccHotPlugTable[idx].plugInCb!= NULL)
iccHotPlugTable[idx].plugInCb(app);
#if defined (TST_MODULE)
tst_sys_trace("insert SIM");
#elif defined(__MTK_TARGET__)
sim_dbg_print("insert SIM");
#endif
AP SIM1_HOT_PLUG
SIM2_HOT_PLUG
3
4
10
10
#endif
iccHotPlugTable[idx].polarity = LEVEL_LOW;
}
else
{
#if 0
/* Insert card: polarity LEVEL_LOW. When interrupt occurs, we should change it to
LEVEL_HIGH
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_FALSE;
if (iccHotPlugTable[idx].plugInCb!= NULL)
iccHotPlugTable[idx].plugInCb(app);
#if defined (TST_MODULE)
tst_sys_trace("insert SIM");
#elif defined(__MTK_TARGET__)
sim_dbg_print("insert SIM");
#endif
#else
/* Remove card: polarity LEVEL_HIGH. When interrupt occurs, we should change it to
LEVEL_LOW
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_TRUE;
if (iccHotPlugTable[idx].plugOutcb != NULL)
iccHotPlugTable[idx].plugOutcb(app);
#if defined (TST_MODULE)
tst_sys_trace("remove SIM");
#elif defined(__MTK_TARGET__)
sim_dbg_print("remove SIM");
#endif
#endif
iccHotPlugTable[idx].polarity = LEVEL_HIGH;
}
}
void sim_hot_plug_eint_cb_rm_l_common(kal_uint32 idx, SIM_ICC_APPLICATION app) {
if (iccHotPlugTable[idx].polarity == LEVEL_LOW)
{
#if 0
/* Remove card: polarity LEVEL_LOW. When interrupt occurs, we should change it to
LEVEL_HIGH
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_TRUE;
if (iccHotPlugTable[idx].plugOutcb != NULL)
iccHotPlugTable[idx].plugOutcb(app);
#if defined (TST_MODULE)
tst_sys_trace("remove SIM");
#elif defined(__MTK_TARGET__)
sim_dbg_print("remove SIM");
#endif
#else
/* Insert card: polarity LEVEL_HIGH. When interrupt occurs, we should change it to
LEVEL_LOW
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_FALSE;
if (iccHotPlugTable[idx].plugInCb != NULL)
iccHotPlugTable[idx].plugInCb(app);
#if defined (TST_MODULE)
tst_sys_trace("insert SIM");
#elif defined(__MTK_TARGET__)
sim_dbg_print("insert SIM");
#endif
#endif
iccHotPlugTable[idx].polarity = LEVEL_HIGH;
}
else
{
#if 0
/* Insert card: polarity LEVEL_HIGH. When interrupt occurs, we should change it to
LEVEL_LOW
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_FALSE;
if (iccHotPlugTable[idx].plugInCb != NULL)
iccHotPlugTable[idx].plugInCb(app);
#if defined (TST_MODULE)
tst_sys_trace("insert SIM");
#elif defined(__MTK_TARGET__)
sim_dbg_print("insert SIM");
#endif
#else
/* Remove card: polarity LEVEL_LOW. When interrupt occurs, we should change it to
LEVEL_HIGH
otherwise we will alwasy receive interrupt */
iccHotPlugTable[idx].removed = KAL_TRUE;
if (iccHotPlugTable[idx].plugOutcb != NULL)
iccHotPlugTable[idx].plugOutcb(app);
#if defined (TST_MODULE)
tst_sys_trace("remove SIM");
#elif defined(__MTK_TARGET__)
sim_dbg_print("remove SIM");
#endif
#endif
iccHotPlugTable[idx].polarity = LEVEL_LOW;
}
}
Note:
Only for MT65*5/MT65*7 ICS2/JB version.
- 1
Before configuring SIM hot swap, check if your company has already applied patch
ALPS00368898. If not, submit e-service to apply for the patch.
ALPS00368898 includes ALPS00368898 and MAUI_03236293. (Set SIM_HOT_SWAP = SIM_SLOT_1 in
modem makefile.)
After you get the patch, check modem patch makefile SIM_HOT_SWAP. If SIM_HOT_SWAP =
NONE, remind your MediaTek window that MAUI_03236293 should be set as SIM_HOT_SWAP =
SIM_SLOT_1 to build.
MAUI\make\**_**_HSPA(GPRS).mak (11AMDW**SP)
- 2
alps\mediatek\config\$(customer_project)\ProjectConfig.mk
AUTO_ADD_GLOBAL_DEFINE_BY_NAME_VALUE=......... MTK_SIM1_SOCKET_SUPPORT
MTK_SIM1_SOCKET_TYPE
MTK_SIM1_SOCKET_SUPPORT=1
MTK_SIM1_SOCKET_TYPE=1
- 3
alps\mediatek\platform\$(mt6577 or mt6575)\kernel\core\mt6577/5_eint.c(ICS2)
alps\mediatek\platform\$(mt6577 or mt6575)\kernel\core\mt_eint.c(JB)
 
MTK release hardcore, all"#if (CUST_EINT_SIM1_HOT_PLUG_NUM!=...)"/"#if
(CUST_EINT_SIM2_HOT_PLUG_NUM!=...)" need modify to “#if 0”
- 4
The definitions of AP and modem EINT pin on “level trigger” and “edge trigger” are
opposite.
AP:
level trigger(define: 1 -> TRUE)
edge trigger(define: 0 -> FALSE)
Modem:
level trigger(define: 0 -> FALSE)
edge trigger(define: 1 –> TRUE)
Modify function sim_reg_hot_plug_eint() of custom_sim_driver.c according to the AP
configuration in modem side hardcore.
EINT_Set_Sensitivity(eintNo, KAL_TRUE); -> edge
EINT_Set_Sensitivity(eintNo, KAL_FALSE); -> level
- 5
MTKmodem official release sim_reg_hot_plug_eint() of custom_sim_driver.c:
EINT_Registration(eintNo, KAL_TRUE, (kal_bool)polarity, sim1_hot_plug_eint_cb_rm_l,
KAL_TRUE);
EINT_Set_Sensitivity(eintNo,sensitivity)
EINT_SW_Debounce_Modify(eintNo, debounceTime);
modify to:
EINT_Set_Sensitivity(eintNo,sensitivity)
EINT_SW_Debounce_Modify(eintNo, debounceTime);
EINT_Registration(eintNo, KAL_TRUE, (kal_bool)polarity, sim1_hot_plug_eint_cb_rm_l,

KAL_TRUE)

资料来源:一牛网论坛 MT6577 http://bbs.16rd.com/thread-55282-1-1.html

阅读全文
0 0
原创粉丝点击