コード例 #1
0
ファイル: ccci_md_main.c プロジェクト: wufuyue/TCL_S820
size_t ccci_ch_filter_store(char buf[], size_t len)
{
	unsigned long long lg_ch_tx_mask= 0;
	unsigned long long lg_ch_rx_mask= 0;
	unsigned int tty_mask= 0;
	unsigned int fs_tx_mask= 0;
	unsigned int fs_rx_mask = 0;
	unsigned int key = 0;
	int ret = 0;

	//ret = sscanf(buf, "-c=0x%x 0x%llX 0x%llX 0x%x 0x%x 0x%x", &key, &lg_ch_tx_mask, 
	//	&lg_ch_rx_mask, &fs_tx_mask, &fs_rx_mask, &tty_mask);
	ret = sscanf(buf, "-c=0x%x 0x%llx 0x%llx 0x%x 0x%x 0x%x ", &key, &lg_ch_tx_mask, &lg_ch_rx_mask, \
		&fs_tx_mask, &fs_rx_mask, &tty_mask);
	if(ret != 6){
		CCCI_MSG("Parse channel filter fail\n");
	}else if( key != 0x20111111){
		CCCI_MSG("Wrong key\n");
	}else{
		CCCI_MSG("%x %x %x %x %llx %llx\n", key, fs_tx_mask, fs_rx_mask, tty_mask, \
			lg_ch_tx_mask, lg_ch_rx_mask);
		lg_ch_tx_debug_enable = lg_ch_tx_mask;
		lg_ch_rx_debug_enable = lg_ch_rx_mask;
		fs_tx_debug_enable = fs_tx_mask;
		fs_rx_debug_enable = fs_rx_mask;
		tty_debug_enable = tty_mask;
	}
	return len;
}
コード例 #2
0
int get_md_wakeup_src(int md_id, char *buf, unsigned int len)
{
    unsigned int    i, rx, ch;
    ccif_msg_t        data;
    unsigned int    rx_ch[CCIF_STD_V1_MAX_CH_NUM][2] = {{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0}};
    char            str[64];
    char            log_buf[256] = "";
    int                ret = 0;
    char            *channel_name;
    ccif_t            *ccif;
    int                curr_str_len = 0;

    logic_dispatch_ctl_block_t    *ctlb;

    ctlb = logic_dispatch_ctlb[md_id];
    ccif = ctlb->m_ccif;

    rx = ccif->ccif_get_rx_ch(ccif);
    if(rx == 0)
        return ret;

    for (i = 0; i < CCIF_STD_V1_MAX_CH_NUM; i++) {
        if (rx&(1<<i)) {
            ccif->ccif_read_phy_ch_data(ccif, i, (unsigned int *)&data);
            for (ch = 0; ch < i; ch++)
                if (data.channel == rx_ch[ch][0])
                    break;

            rx_ch[ch][0] = data.channel;
            rx_ch[ch][1]++;
        }
    }

    for (i = 0; i < CCIF_STD_V1_MAX_CH_NUM ; i ++) {
        if (rx_ch[i][1]) {
            if ((rx_ch[i][0] >= 0) && (rx_ch[i][0] < MAX_LOGIC_CH_ID)){
                channel_name = logic_ch_static_info_tab[rx_ch[i][0]].m_ch_name;
                sprintf(str,"%s(%d,%d) ", channel_name, rx_ch[i][0], rx_ch[i][1]);
            }
            else 
                sprintf(str,"%s(%d,%d) ", "unknown", rx_ch[i][0], rx_ch[i][1]);

            curr_str_len += strlen(str);
            if( curr_str_len < 255) {
                strcat(log_buf, str);
            }
        }
    }
    if(curr_str_len > 255) {
        CCCI_MSG("[ccci/ctl] wakeup source buffer not enough(req:%d>255) for MD%d\n", curr_str_len, md_id+1);
    }

    CCCI_MSG("[ccci/ctl] (%d)CCIF_MD%d wakeup source: %s\n", md_id+1, md_id+1, log_buf);

    return ret;
}
コード例 #3
0
ファイル: ccmni_v2_net.c プロジェクト: Swapnil133609/Zeus_exp
static void ccmni_v2_reset_buffers(ccmni_v2_instance_t *ccmni)
{
	int *ccmni_rx_base_phy;
	int *ccmni_rx_base_virt;
	unsigned char *ptr_virt;
	int md_id;
	int count;
#if CCMNI_DBG_INFO
	dbg_info_ccmni_t *dbg_info;
#endif

	if(ccmni == NULL) {
		CCCI_MSG("[Error]CCMNI V2 get NULL pointer for buffer reset\n");
		return;
	}

	md_id = ccmni->m_md_id;
	// DL --RX
	ccmni->shared_mem->rx_control.read_out = 0;
	ccmni->shared_mem->rx_control.avai_out = 0;
	ccmni->shared_mem->rx_control.avai_in  = CCMNI_CTRL_Q_RX_SIZE_DEFAULT - 1;
	ccmni->shared_mem->rx_control.q_length = CCMNI_CTRL_Q_RX_SIZE;
	// UP -- TX
	memset(&ccmni->shared_mem->tx_control, 0, sizeof(buffer_control_ccmni_t));
	memset(ccmni->shared_mem->q_tx_ringbuff, 0, sizeof(q_ringbuf_ccmni_t)*CCMNI_CTRL_Q_TX_SIZE);

	memset(ccmni->shared_mem->q_rx_ringbuff, 0, ccmni->shared_mem->rx_control.q_length * sizeof(q_ringbuf_ccmni_t));
	ccmni_v2_dl_base_req(md_id, &ccmni_rx_base_virt, &ccmni_rx_base_phy);

	//Each channel has 100 RX buffers default
	for (count = 0; count < CCMNI_CTRL_Q_RX_SIZE_DEFAULT; count++)
	{
		ccmni->shared_mem->q_rx_ringbuff[count].ptr = \
			(CCMNI_CTRL_Q_RX_SIZE_DEFAULT * ccmni->channel + count ) * CCMNI_SINGLE_BUFF_SIZE + \
			(unsigned char *)ccmni_rx_base_phy + CCMNI_BUFF_HEADER_SIZE + CCMNI_BUFF_DBG_INFO_SIZE- md_2_ap_phy_addr_offset_fixed;

		ptr_virt = ccmni_v2_phys_to_virt(md_id, (unsigned char *)(ccmni->shared_mem->q_rx_ringbuff[count].ptr));
		
		//buffer header and footer init
		//Assume int to be 32bit. May need further modifying!!!!!
		*((int*)(ptr_virt - CCMNI_BUFF_HEADER_SIZE)) = CCMNI_BUFF_HEADER;
		*((int*)(ptr_virt + CCMNI_BUFF_DATA_FIELD_SIZE)) = CCMNI_BUFF_FOOTER;

#if CCMNI_DBG_INFO
		//debug info
		dbg_info = (dbg_info_ccmni_t *)(ptr_virt - CCMNI_BUFF_HEADER_SIZE - CCMNI_BUFF_DBG_INFO_SIZE);
		dbg_info->port        = ccmni->channel;
		dbg_info->avai_in_no  = count;
#endif
	}
	CCCI_MSG("ccmni_v2_reset_buffers\n");
}
コード例 #4
0
int get_logic_ch_data(logic_channel_info_t *ch_info, ccci_msg_t *msg)
{
	if (unlikely(ch_info == NULL)){
		CCCI_MSG("%s fail: get invalid ch info\n", __FUNCTION__);
		return -CCCI_ERR_GET_NULL_POINTER;
	}

	if (unlikely(ch_info->m_attrs&L_CH_ATTR_TX)){
		CCCI_MSG_INF(ch_info->m_md_id, "cci", "%s fail: %s(ch%d) is tx \n", \
						__FUNCTION__, ch_info->m_ch_name, msg->channel);
		return -CCCI_ERR_GET_RX_DATA_FROM_TX_CHANNEL;
	}

	// check whether fifo is ready
	if (unlikely(!ch_info->m_kfifo_ready)){
		CCCI_MSG_INF(ch_info->m_md_id, "cci", "%s fail: %s(ch%d) kfifo not ready\n", \
						__FUNCTION__, ch_info->m_ch_name, msg->channel);
		return -CCCI_ERR_KFIFO_IS_NOT_READY;
	}

	// Check fifo if has data
	if (kfifo_is_empty(&ch_info->m_kfifo))
	{
		return 0;
	}

	// Pop data
	return kfifo_out(&ch_info->m_kfifo, msg, sizeof(ccif_msg_t));
}
コード例 #5
0
ファイル: ccci_md_main.c プロジェクト: wufuyue/TCL_S820
size_t ccci_msg_filter_store(char buf[], size_t len)
{
	unsigned int msg_mask=0;
	unsigned int key;
	int ret;

	ret = sscanf(buf, "-l=0x%x 0x%x", &key, &msg_mask);
	if(ret != 2){
		CCCI_MSG("Parse msg filter fail\n");
	}else if( key != 0x20111111){
		CCCI_MSG("Wrong key\n");
	}else{
		ccci_msg_mask = msg_mask;
	}
	return len;
}
コード例 #6
0
ファイル: ccci_md_main.c プロジェクト: wufuyue/TCL_S820
int __init ccci_md_init_mod_init(void)
{
    int ret;

    CCCI_MSG("Ver. %s, @ %s %s\n",ccci_version, __DATE__, __TIME__); 
   
    ret = ccci_alloc_smem();
    if (ret)
	return ret;
	
    /*
     * IOREMAP the physical address where the modem firmware is stored.
     * We will need to dump this, when there's an exception.
     */
    //md_img_vir = (int *)ioremap_nocache(MODEM_REGION_BASE, MD_IMG_DUMP_SIZE);
//	 printk(KERN_ERR "----------->CCCI_MD: md_img_vir=%p.\n",md_img_vir);
    //if (!md_img_vir)
    //{
        //printk(KERN_ERR "[CCCI]:CCCI_MD[Exception] Mem dump ioremap failed\n");
        //return -ENOMEM;
    //}

    ret=platform_init();
    if (ret)
    {
	CCCI_MSG_INF("ctl", "platform_init failed.\n");
	//iounmap(md_img_vir);
	return ret;
    }
	
    ret=ccci_rpc_init();
    if (ret)
    {
	CCCI_MSG_INF("ctl", "rpc_init failed.\n");
	ccci_rpc_exit();
	//iounmap(md_img_vir);
	return ret;
    }
	
    // MUST register callbacks after memory is allocated
	boot_register_md_func(boot_md_show, boot_md_store);
	//slp_set_ccci_callback(ccci_dormancy);
	ccci_md_wdt_notify_register(reset_md);
	ccci_aed_cb_register(ccci_aed);
	register_resume_notify(RSM_ID_MD_LOCK_DORMANT, lock_md_dormant);
	register_suspend_notify(SLP_ID_MD_UNLOCK_DORMANT, unlock_md_dormant);
	register_ccci_kern_func(ID_CCCI_DORMANCY, ccci_dormancy);
    register_ccci_kern_func(ID_LOCK_MD_SLEEP, lock_md_sleep);
	register_ccci_kern_func(ID_ACK_MD_SLEEP, ack_md_sleep);
    
    register_filter_func("-l", ccci_msg_filter_store, ccci_msg_filter_show);
    register_filter_func("-c", ccci_ch_filter_store, ccci_ch_filter_show);
    wake_lock_init(&trm_wake_lock, WAKE_LOCK_SUSPEND, "ccci_trm");
    spin_lock_init(&md_slp_lock);
    
    return 0;
}
コード例 #7
0
ファイル: ccmni.c プロジェクト: Swapnil133609/Zeus_exp
int ccmni_ipo_h_restore(int md_id)
{
	int ccmni_version = 0;
	
	if(ccci_get_sub_module_cfg(md_id, "net", (char*)&ccmni_version, sizeof(int)) != sizeof(int)) {
		CCCI_MSG("Get ccmni verion fail\n");
		return -1;
	}
	
	switch(ccmni_version)
	{
		case 1:
			return ccmni_v1_ipo_h_restore(md_id);
		case 2:
			return ccmni_v2_ipo_h_restore(md_id);
		default:
			CCCI_MSG("[Error]CCMNI not support version\n");
			return -1;
	}
}
コード例 #8
0
void update_active_md_sys_state(int md_id, int active)
{
	if(md_enabled[md_id]) {
		active_md[md_id] = active;
		if(active){
			//CCCI_DBG_MSG(md_id, "cci", "enable modem intr\n");
			ccci_enable_md_intr(md_id);
		}
	} else {
		CCCI_MSG("md_sys%d is not enable\n", md_id);
	}
}
コード例 #9
0
ファイル: ccci_mk_node.c プロジェクト: Scorpio92/mediatek
/***************************************************************************
 * Make device node helper function section
 ***************************************************************************/
static void* create_dev_class(struct module *owner, const char *name)
{
	int err = 0;
	
	struct class *dev_class = class_create(owner, name);
	if(IS_ERR(dev_class)){
		err = PTR_ERR(dev_class);
		CCCI_MSG("create %s class fail: %d\n", name, err);
		return NULL;
	}

	return dev_class;
}
コード例 #10
0
int get_logic_ch_data_len(logic_channel_info_t *ch_info)
{
	if (unlikely(ch_info == NULL)){
		CCCI_MSG("%s get invalid ch info\n", __FUNCTION__);
		return 0;
	}

	if (unlikely(ch_info->m_attrs&L_CH_ATTR_TX)){
		CCCI_MSG_INF(ch_info->m_md_id, "cci", "%s fail: %s(ch%d) is tx \n", \
						__FUNCTION__, ch_info->m_ch_name, ch_info->m_ch_id);
		return 0;
	}

	// check whether fifo is ready
	if (unlikely(!ch_info->m_kfifo_ready)){
		CCCI_MSG_INF(ch_info->m_md_id, "cci", "%s fail: %s(ch%d) kfifo not ready\n", \
						__FUNCTION__, ch_info->m_ch_name, ch_info->m_ch_id);
		return 0;
	}

	// Check fifo data length
	return kfifo_len(&ch_info->m_kfifo);
}
コード例 #11
0
ファイル: ccci_statistics.c プロジェクト: Lesozav25/mtk_6572
static int s_to_date(	long seconds, long usec, int *us, int *sec, int *min, int *hour,
						int *day, int *month, int *year)
{
#define  DAY_PER_LEAP_YEAR		366
#define  DAY_PER_NON_LEAP_YEAR	365

	unsigned int i = 0;
	unsigned long mins, hours, days, month_t, year_t;
	unsigned char m[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

	if(!sec || !min || !hour || !day || !month || !year)
	{
		CCCI_MSG("<ctl>%s invalid param!\n", __FUNCTION__);
		return (-1);
	}

	*us = usec;
	*sec = seconds % 60;
	mins = seconds / 60;
	*min = mins % 60;
	hours = mins / 60;
	*hour = hours % 24;
	days = hours / 24;
	
	year_t = 1970;

	while(1)
	{
		if(!(year_t % 4) && (year_t % 100))
		{
			if(days >= DAY_PER_LEAP_YEAR)
			{
				days -= DAY_PER_LEAP_YEAR;
				year_t ++;  
			}
			else
				break;
		}
		else
		{
			if(days >= DAY_PER_NON_LEAP_YEAR)
			{
				days -= DAY_PER_NON_LEAP_YEAR;
				year_t ++;  
			}
			else
				break;
		}
	}

	if(!(year_t % 4) && year_t % 100)
	{
		m[1] = 29;
	}

	month_t = 1;
	for(i=0; i < 12; i++)
	{
		if(days > m[i])
		{
			days -= m[i];
			month_t++;
		}
		else
		{
			break;
		}
	}

	*day = days;
	*year = year_t;
	*month = month_t;

	return 0;
}
コード例 #12
0
ファイル: ccci_chrdev.c プロジェクト: Elnter/j608_kernel
unsigned int __weak get_sim_switch_type(void)
{
	CCCI_MSG("%s is not implement!!! line:%d\n", __func__, __LINE__);
	return 0;
}
コード例 #13
0
static int __init ccci_init(void)
{
	int ret = CCCI_ERR_MODULE_INIT_OK;
	unsigned int md_num = 1;	
	int i = 0;
	int md_en[MAX_MD_NUM] = {0};
	
	//1. Get and set Support MD nmmber
	md_num = get_md_sys_max_num();
	set_md_sys_max_num(md_num);

	//2. Get and set MD enable table
	for(i = 0; i < md_num; i++) {
		if(get_modem_is_enabled(i)){
			md_en[i] = 1;
			set_md_enable(i, 1);
		} else {
			md_en[i] = 0;
			set_md_enable(i, 0);
		}
	}

#ifdef ENABLE_CCCI_DRV_BUILDIN
CCCI_MSG("ccci_init: device_initcall_sync\n");
#else  // MODULE
CCCI_MSG("ccci_init: module_init\n");
#endif

	//3. Init ccci device table	
    ret = init_ccci_dev_node();
	if(ret) {
		CCCI_MSG("init_ccci_dev_node fail: %d\n", ret);
		ret = -CCCI_ERR_INIT_DEV_NODE_FAIL;
		goto out;
	}

	//4. Init ccci driver for each modem
	for(i = 0; i < md_num; i++)
	{
		if(md_en[i] == 0) {
			CCCI_MSG_INF(i, "cci", "md initial fail: md%d is not enabled\n", i+1);
			continue;
		}
		
		// 4.0 Init platform support function
		ret = platform_init(i, !md_en[i]);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "platform_init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_PLATFORM_FAIL;
			goto platform_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "platform_init OK!\n");
		}

		// Make ccci device node
		ret = mk_ccci_dev_node(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "mk_ccci_dev_node fail: %d\n", ret);
			ret = -CCCI_ERR_MK_DEV_NODE_FAIL;
			goto mk_node_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "mk_ccci_dev_node OK!\n");
		}

		// Statistics init
		statistics_init(i);

		// 4.1 Init ccci logical layer
		ret = ccci_logic_layer_init(i);
		if(ret) {
			CCCI_MSG_INF(i, "cci", "ccci logical layer init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_LOGIC_LAYER_FAIL;
			goto logic_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_logic_layer_init OK!\n");
		}
		
		// 4.2 Init md ctrl
		ret = ccci_md_ctrl_init(i);
		if(ret) {
			CCCI_MSG_INF(i, "cci", "ccci md ctrl init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_MD_CTRL_FAIL;
			goto mdctl_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_md_ctrl_init OK!\n");
		}
		
		// 4.3 Init char dev
		ret = ccci_chrdev_init(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "ccci_chrdev_init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_CHAR_DEV_FAIL;
			goto char_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_chrdev_init OK!\n");
		}
		
		// 4.4 Init tty dev
		ret = ccci_tty_init(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "ccci_tty_init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_TTY_FAIL;
			goto tty_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_tty_init OK!\n");
		}
		
		// 4.5 Init ipc dev
		ret = ccci_ipc_init(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "ccci_ipc_init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_IPC_FAIL;
			goto ipc_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_ipc_init OK!\n");
		}
		
		// 4.6 Init rpc dev
		ret = ccci_rpc_init(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "ccci_rpc_init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_RPC_FAIL;
			goto rpc_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_rpc_init OK!\n");
		}
		
		// 4.7 Init fs dev
		ret = ccci_fs_init(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "ccci_fs_init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_FS_FAIL;
			goto fs_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_fs_init OK!\n");
		}
		
		// 4.8 Init ccmni dev
		ret = ccmni_init(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "ccmni_init fail: %d\n", ret);
			ret = -CCCI_ERR_INIT_CCMNI_FAIL;
			goto ccmni_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccmni_init OK!\n");
		}
		
		// 4.9 Init pmic dev
		// ....
		
		// 4.10 Init vir char dev
		ret = ccci_vir_chrdev_init(i);
		if (ret) {
			CCCI_MSG_INF(i, "cci", "ccci_vir_chrdev_init fail: %d\n", ret);		
			ret = -CCCI_ERR_INIT_VIR_CHAR_FAIL;
			goto virchar_out;
		} else {
			CCCI_DBG_MSG(i, "cci", "ccci_vir_chrdev_init OK!\n");
		}
		
		CCCI_MSG_INF(i, "cci", "md initial OK!\n");
	}

	// 5. Init common section
	ret = ccci_md_ctrl_common_init();
	if (ret == 0)
		goto out;
	else {
		i = md_num-1;
		CCCI_MSG_INF(i, "cci", "ccci_md_ctrl_common_init fail: %d\n", ret);
	}

virchar_out:
	ccci_vir_chrdev_exit(i);
	
ccmni_out:
	ccmni_exit(i);

fs_out:
	ccci_fs_exit(i);
	
rpc_out:
	ccci_rpc_exit(i);

ipc_out:
	ccci_ipc_exit(i);
	
tty_out:
	ccci_tty_exit(i);
	
char_out:
	ccci_chrdev_exit(i);

mdctl_out:
	ccci_md_ctrl_exit(i);
	
logic_out:
	ccci_logic_layer_exit(i);
	
platform_out:
	platform_deinit(i);
	
mk_node_out:
	ccci_dev_node_exit(i);
	
out:
	if ((i == MD_SYS2) && (md_num > MD_SYS2)) {
		ccci_vir_chrdev_exit(MD_SYS1);
		ccmni_exit(MD_SYS1);
		ccci_fs_exit(MD_SYS1);
		ccci_rpc_exit(MD_SYS1);
		ccci_ipc_exit(MD_SYS1);
		ccci_tty_exit(MD_SYS1);
		ccci_chrdev_exit(MD_SYS1);
		ccci_md_ctrl_exit(MD_SYS1);
		ccci_logic_layer_exit(MD_SYS1);
		platform_deinit(MD_SYS1);
		ccci_dev_node_exit(MD_SYS1);
	}
	
	if (ret == CCCI_ERR_MODULE_INIT_OK)
		CCCI_MSG("ccci module init OK\n");
	else {		
		release_ccci_dev_node();
		ccci_helper_exit();
		CCCI_MSG("ccci module init fail: %d\n", ret);
	}
	
	return ret;
}
コード例 #14
0
ファイル: ccci_md_main.c プロジェクト: wufuyue/TCL_S820
static int boot_md(void)
{
    int ret=0;
    //struct image_info *pImg_info=NULL;
	
    if (md_boot_stage != MD_BOOT_STAGE_0)
    {
	CCCI_MSG_INF("ctl", "MD has boot up!\n");
	return 0;
    }
   
    CCCI_MSG("booting up MODEM: start to load firmware...\n");

    if(is_first_boot) {
        //if((ret = ccci_load_firmware(pImg_info)) <0) {
        if((ret = ccci_load_firmware(LOAD_MD_DSP)) <0) {
	    CCCI_MSG_INF("ctl", "load firmware fail, so modem boot fail!\n");
	    return ret;
        }
        else {
	    //when load firmware successfully, no need to load it again when reset modem
	    is_first_boot = 0;
	    CCCI_MSG_INF("ctl", "load firmware successful!\n");
        }
    }
    else {
	CCCI_MSG_INF("ctl", "modem&dsp firmware already exist, not load again!\n");
    }

    ret = ccci_register(CCCI_CONTROL_TX, NULL, NULL);
    if (ret != 0 && ret != CCCI_IN_USE) {
        CCCI_MSG_INF("ctl", "fail to register CCCI_CONTROL_TX\n");
        return ret;
    }
	
    ret = ccci_register(CCCI_CONTROL_RX, ccci_md_ctrl_cb, NULL);
    if (ret != 0 && ret != CCCI_IN_USE) {
        CCCI_MSG_INF("ctl", "fail to register CCCI_CONTROL_RX\n");
        ccci_unregister(CCCI_CONTROL_TX);
        return ret;
    }

    ret = ccci_register(CCCI_SYSTEM_TX, NULL, NULL);
    if (ret != 0 && ret != CCCI_IN_USE) {
        CCCI_MSG_INF("ctl", "fail to register CCCI_SYSTEM_TX\n");
    }

    /* step 1: ungate modem */
    ungate_md();

    /* step 2: get start-boot command from control channel */
    CCCI_MSG_INF("ctl", "wait MD_INIT_START_BOOT\n");

    #if 0
    time_out = jiffies + 6*HZ;
    do {
        if (md_boot_stage == MD_BOOT_STAGE_1) {
            CCCI_MSG_INF("ctl", "received MD_INIT_START_BOOT\n");
            break;
        }
	yield();
	if(time_after(jiffies, time_out)){
            CCCI_MSG_INF("ctl", "wait MD_INIT_START_BOOT time out, try to reboot MD again\n");
            CCCI_INIT_MAILBOX(&sys_msg, CCCI_MD_MSG_RESET_RETRY);
            ccci_system_message(&sys_msg);
            return ret;
        }
    } while (1);

    /* step 3: set runtime data and echo start-boot command */
    CCCI_MSG_INF("ctl", "set modem runtime\n");
    ret = set_md_runtime();
    if (ret != 0) {
        CCCI_MSG("fail to set MODEM runtime data\n");
        return ret;
    }
	
    //printk("echo MD_INIT_START_BOOT\n");
    CCCI_BUFF_T buff;
    CCCI_INIT_MAILBOX(&buff, MD_INIT_START_BOOT);
    buff.reserved = MD_INIT_CHK_ID;
    ccci_before_modem_start_boot();
    ret = ccci_write(CCCI_CONTROL_TX, &buff);
    if (ret != 0) {
        CCCI_MSG("fail to write CCCI_CONTROL_TX\n");
        return ret;
    }
    CCCI_MSG_INF("ctl", "wait for NORMAL_BOOT_ID\n");
    //if (end)   end();
    //Notes:after load dsp_rom, dsp will write data back to dsp region, so set protect region at last
    start_emi_mpu_protect();
    #endif

    return ret;
}
コード例 #15
0
ファイル: ccci_md_main.c プロジェクト: wufuyue/TCL_S820
static void dump_ccci_md_data(void)
{
	int i;
	struct modem_runtime_t *runtime = (struct modem_runtime_t *)MD_RUNTIME_ADDR;
	char ctmp[12];
	int *p;

	p = (int*)ctmp;
	*p = runtime->Prefix;
	p++;
	*p = runtime->Platform_L;
	p++;
	*p = runtime->Platform_H;

	CCCI_MSG("**********************************************\n");
	CCCI_MSG("Prefix\t\t%c%c%c%c\n", ctmp[0], ctmp[1], ctmp[2], ctmp[3]);
	CCCI_MSG("Platform_L\t\t%c%c%c%c\n", ctmp[4], ctmp[5], ctmp[6], ctmp[7]);
	CCCI_MSG("Platform_H\t\t%c%c%c%c\n", ctmp[8], ctmp[9], ctmp[10], ctmp[11]);

	CCCI_MSG("DriverVersion\t\t0x%x\n", runtime->DriverVersion);
	CCCI_MSG("BootChannel\t\t%d\n", runtime->BootChannel);
	CCCI_MSG("BootingStartID(Mode)\t\t%d\n", runtime->BootingStartID);
	CCCI_MSG("BootAttributes\t\t%d\n", runtime->BootAttributes);
	CCCI_MSG("BootReadyID\t\t%d\n", runtime->BootReadyID);
        CCCI_CTL_MSG("MdlogShareMemBase\t\t0x%x\n", runtime->MdlogShareMemBase);
	CCCI_CTL_MSG("MdlogShareMemSize\t\t%d\n", runtime->MdlogShareMemSize);
	CCCI_CTL_MSG("PcmShareMemBase\t\t0x%x\n", runtime->PcmShareMemBase);
	CCCI_CTL_MSG("PcmShareMemSize\t\t%d\n", runtime->PcmShareMemSize);

	CCCI_CTL_MSG("UartPortNum\t\t%d\n", runtime->UartPortNum);
	for (i = 0; i < UART_MAX_PORT_NUM; i++) {
		CCCI_CTL_MSG("UartShareMemBase[%d]\t0x%x\n", i, runtime->UartShareMemBase[i]);
		CCCI_CTL_MSG("UartShareMemSize[%d]\t%d\n", i, runtime->UartShareMemSize[i]);
	}

	CCCI_CTL_MSG("FileShareMemBase\t0x%x\n", runtime->FileShareMemBase);
	CCCI_CTL_MSG("FileShareMemSize\t%d\n", runtime->FileShareMemSize);
	CCCI_CTL_MSG("RpcShareMemBase\t0x%x\n", runtime->RpcShareMemBase);
	CCCI_CTL_MSG("RpcShareMemSize\t%d\n", runtime->RpcShareMemSize);
	CCCI_CTL_MSG("PmicShareMemBase\t0x%x\n", runtime->PmicShareMemBase);
	CCCI_CTL_MSG("PmicShareMemSize\t%d\n", runtime->PmicShareMemSize);
	CCCI_CTL_MSG("ExceShareMemBase\t0x%x\n", runtime->ExceShareMemBase);
	CCCI_CTL_MSG("ExceShareMemSize\t%d\n", runtime->ExceShareMemSize);
	CCCI_CTL_MSG("SysShareMemBase\t\t0x%x\n", runtime->SysShareMemBase);
	CCCI_CTL_MSG("SysShareMemSize\t\t%d\n", runtime->SysShareMemSize);
	CCCI_CTL_MSG("IPCShareMemBase\t\t0x%x\n",runtime->IPCShareMemBase);
	CCCI_CTL_MSG("IPCShareMemSize\t\t0x%x\n",runtime->IPCShareMemSize);
	CCCI_CTL_MSG("CheckSum\t\t%d\n", runtime->CheckSum);

	p = (int*)ctmp;
	*p = runtime->Postfix;
	CCCI_MSG("Postfix\t\t%c%c%c%c\n", ctmp[0], ctmp[1], ctmp[2], ctmp[3]);

	CCCI_MSG("----------------------------------------------\n");

	CCCI_MSG("ccci_smem_virt\t%x\n", (unsigned int)ccci_smem_virt);
	CCCI_MSG("ccci_smem_phy\t%x\n", (unsigned int)ccci_smem_phy);
	CCCI_MSG("ccci_smem_size\t%08x\n", ccci_smem_size);

	CCCI_MSG("ccci_pcm_smem_base_virt\t%x\n", ccci_pcm_smem_base_virt);
	CCCI_MSG("ccci_pcm_smem_base_phy\t%x\n", ccci_pcm_smem_base_phy);
	CCCI_MSG("ccci_pcm_smem_size\t%d\n", ccci_pcm_smem_size);

	CCCI_MSG("ccci_fs_smem_base_virt\t%x\n", ccci_fs_smem_base_virt);
	CCCI_MSG("ccci_fs_smem_base_phy\t%x\n", ccci_fs_smem_base_phy);
	CCCI_MSG("ccci_fs_smem_size\t%d\n", ccci_fs_smem_size);

	for (i = 0; i < UART_MAX_PORT_NUM; i++) {
		CCCI_MSG("ccci_tty_smem_base_virt[%d]\t%x\n", i, ccci_tty_smem_base_virt[i]);
		CCCI_MSG("ccci_tty_smem_base_phy[%d]\t%x\n", i, ccci_tty_smem_base_phy[i]);
		CCCI_MSG("ccci_tty_smem_size[%d]\t%d\n", i, ccci_tty_smem_size[i]);
	}

	CCCI_MSG("ccci_ipc_smem_base_virt\t%x\n", ccci_ipc_smem_base_virt);
	CCCI_MSG("ccci_ipc_smem_base_phy\t%x\n", ccci_ipc_smem_base_phy);
	CCCI_MSG("ccci_ipc_smem_size\t%d\n", ccci_ipc_smem_size);
	CCCI_MSG("**********************************************\n");
}