static void met_smi_start(void)
{
	if (do_smi()) {
        //printk("do smi\n");
		smi_init();
		smi_stop();
		smi_start();
	}
}
Example #2
0
static void met_smi_start(void)
{
	/* HW setting */
	if (do_smi()) {
		smi_init();
		smi_stop();
		smi_start();
	}
}
static void met_smi_start(void)
{
#ifdef DEBUG_MET_SMI_TEST_PATTERN
	int i;

	for (i=0; i<SMI_LARB_NUMBER; i++) {
		printk("master = %d, "
			"port = %d, "
			"rwtype = %d, "
			"desttype = %d, "
			"bustype = %d, "
			"mode = %d\n",
			smi_larb[i].master,
			smi_larb[i].port,
			smi_larb[i].rwtype,
			smi_larb[i].desttype,
			smi_larb[i].bustype,
			smi_larb[i].mode);
	}
	for (i=0; i<SMI_COMM_NUMBER; i++) {
		printk("master = %d, "
			"port = %d, "
			"rwtype = %d, "
			"desttype = %d, "
			"bustype = %d, "
			"mode = %d\n",
			smi_comm[i].master,
			smi_comm[i].port,
			smi_comm[i].rwtype,
			smi_comm[i].desttype,
			smi_comm[i].bustype,
			smi_comm[i].mode);
	}
	printk("requesttype = %d, "
		"toggle_cnt = %d, "
		"count = %d, "
		"portnum = %d\n",
		monitorctrl.bRequestSelection,
		toggle_cnt,
		count,
		portnum);
#else
	//printk("do smi mode=%d, toggle_idx=%d, idx220_port=%lu\n", do_smi(), toggle_idx, allport[220].port);
	if (do_smi()) {
        //printk("do smi\n");
		smi_init();
		smi_stop();
		smi_start();
	}
#endif
}
static unsigned int smi_polling(unsigned int *smi_value)
{
	int i=0,j=-1;

	//return 0;
	for (i=0; i<SMI_LARB_NUMBER; i++) {
		SMI_Pause(i);
	}

	for (i=0; i<SMI_COMM_NUMBER; i++) {
		SMI_Comm_Disable(i);
	}
#if 0
	smi_value[++j] = SMI_LARB_NUMBER+SMI_COMM_NUMBER;
	smi_value[++j] = 7;
	// read counter
	for (i=0; i<SMI_LARB_NUMBER; i++) {
		if (smi_larb[i].mode == 1) {
			smi_value[++j] = smi_larb[i].master;   //master
			smi_value[++j] = smi_larb[i].port;   //portNo
			smi_value[++j] = SMI_GetActiveCnt(i);    //ActiveCnt
			smi_value[++j] = SMI_GetRequestCnt(i);    //RequestCnt
			smi_value[++j] = SMI_GetIdleCnt(i);      //IdleCnt
			smi_value[++j] = SMI_GetBeatCnt(i);    //BeatCnt
			smi_value[++j] = SMI_GetByteCnt(i);    //ByteCnt
		}
	}
	for (i=0; i<SMI_COMM_NUMBER; i++) {
		if (smi_comm[i].mode == 1) {
			smi_value[++j] = SMI_LARB_NUMBER+i;   //fake master
			smi_value[++j] = smi_comm[i].port;   //portNo
			smi_value[++j] = SMI_Comm_GetActiveCnt(i);    //ActiveCnt
			smi_value[++j] = SMI_Comm_GetRequestCnt(i);    //RequestCnt
			smi_value[++j] = SMI_Comm_GetIdleCnt(i);      //IdleCnt
			smi_value[++j] = SMI_Comm_GetBeatCnt(i);    //BeatCnt
			smi_value[++j] = SMI_Comm_GetByteCnt(i);    //ByteCnt
		}
	}
#else
	smi_value[++j] = enable_master_cnt;
	smi_value[++j] = 16;
	// read counter
	for (i=0; i<SMI_LARB_NUMBER; i++) {
		if (smi_larb[i].mode == 1) {
			smi_value[++j] = smi_larb[i].master;   //master
			smi_value[++j] = smi_larb[i].port;   //portNo
			smi_value[++j] = SMI_GetActiveCnt(i);    //ActiveCnt
			smi_value[++j] = SMI_GetRequestCnt(i);    //RequestCnt
			smi_value[++j] = SMI_GetIdleCnt(i);      //IdleCnt
			smi_value[++j] = SMI_GetBeatCnt(i);    //BeatCnt
			smi_value[++j] = SMI_GetByteCnt(i);    //ByteCnt

			smi_value[++j] = SMI_GetCPCnt(i);    //CPCnt
			smi_value[++j] = SMI_GetDPCnt(i);    //DPCnt
			smi_value[++j] = SMI_GetCDP_MAX(i);    //CDP_MAX
			smi_value[++j] = SMI_GetCOS_MAX(i);    //COS_MAX
			smi_value[++j] = SMI_GetBUS_REQ0(i);    //BUS_REQ0
			smi_value[++j] = SMI_GetBUS_REQ1(i);    //BUS_REQ1
			smi_value[++j] = SMI_GetWDTCnt(i);    //WDTCnt
			smi_value[++j] = SMI_GetRDTCnt(i);    //RDTCnt
			smi_value[++j] = SMI_GetOSTCnt(i);    //OSTCnt
		}
	}
	for (i=0; i<SMI_COMM_NUMBER; i++) {
		if (smi_comm[i].mode == 1) {
			smi_value[++j] = SMI_LARB_NUMBER+i;   //fake master
			smi_value[++j] = smi_comm[i].port;   //portNo
			smi_value[++j] = SMI_Comm_GetActiveCnt(i);    //ActiveCnt
			smi_value[++j] = SMI_Comm_GetRequestCnt(i);    //RequestCnt
			smi_value[++j] = SMI_Comm_GetIdleCnt(i);      //IdleCnt
			smi_value[++j] = SMI_Comm_GetBeatCnt(i);    //BeatCnt
			smi_value[++j] = SMI_Comm_GetByteCnt(i);    //ByteCnt

			smi_value[++j] = SMI_Comm_GetCPCnt(i);    //CPCnt
			smi_value[++j] = SMI_Comm_GetDPCnt(i);    //DPCnt
			smi_value[++j] = SMI_Comm_GetCDP_MAX(i);    //CDP_MAX
			smi_value[++j] = SMI_Comm_GetCOS_MAX(i);    //COS_MAX
			smi_value[++j] = 0;    //BUS_REQ0
			smi_value[++j] = 0;    //BUS_REQ1
			smi_value[++j] = 0;    //WDTCnt
			smi_value[++j] = 0;    //RDTCnt
			smi_value[++j] = 0;    //OSTCnt
		}
	}
#endif

	smi_stop();
	smi_start();

	return j+1;
}
Example #5
0
static unsigned int smi_polling(unsigned int *smi_value, unsigned int size)
{
	int i=0;
	int ret=0;

#ifdef MET_SMI_DEBUG
	for (i=0; i<SMI_LARB_NUMBER; i++) {
		printk("===SMI Larb[%d]: "
			"Ena = %x, "
			"Clr = %x, "
			"Port = %x, "
			"Ctrl = %x\n",
			i,
			MET_SMI_GetEna(i),
			MET_SMI_GetClr(i),
			MET_SMI_GetPortNo(i),
			MET_SMI_GetCon(i));
	}
#endif

	for (i=0; i<SMI_LARB_NUMBER; i++) {
		MET_SMI_Disable(i);
	}

#ifdef MET_SMI_DEBUG
	for (i=0; i<SMI_LARB_NUMBER; i++) {
		printk("SMI Larb[%d]: "
			"Ena = %x, "
			"Clr = %x, "
			"Port = %x, "
			"Ctrl = %x\n",
			i,
			MET_SMI_GetEna(i),
			MET_SMI_GetClr(i),
			MET_SMI_GetPortNo(i),
			MET_SMI_GetCon(i));
		printk("SMI Larb[%d]: "
			"mode = %x, "
			"master = %x, "
			"port = %x, "
			"rwtype = %x, "
			"desttype = %x, "
			"bustype = %x\n",
			i,
			smi_larb[i].mode,
			smi_larb[i].master,
			smi_larb[i].port,
			smi_larb[i].rwtype,
			smi_larb[i].desttype,
			smi_larb[i].bustype);
	}
#endif

#ifdef MET_SMI_DEBUG
	for (i=0; i<SMI_COMM_NUMBER; i++) {
		printk("===SMI Comm[%d]: "
			"Ena = %x, "
			"Clr = %x, "
			"Type = %x, "
			"Ctrl = %x\n",
			i,
			MET_SMI_Comm_GetEna(i),
			MET_SMI_Comm_GetClr(i),
			MET_SMI_Comm_GetType(i),
			MET_SMI_Comm_GetCon(i));
	}
#endif

	for (i=0; i<SMI_COMM_NUMBER; i++) {
		MET_SMI_Comm_Disable(i);
	}

#ifdef MET_SMI_DEBUG
	for (i=0; i<SMI_COMM_NUMBER; i++) {
		printk("SMI Comm[%d]: "
			"Ena = %x, "
			"Clr = %x, "
			"Type = %x, "
			"Ctrl = %x\n",
			i,
			MET_SMI_Comm_GetEna(i),
			MET_SMI_Comm_GetClr(i),
			MET_SMI_Comm_GetType(i),
			MET_SMI_Comm_GetCon(i));
		printk("SMI Comm[%d]: "
			"mode = %x, "
			"master = %x, "
			"port = %x, "
			"rwtype = %x, "
			"desttype = %x, "
			"bustype = %x\n",
			i,
			smi_comm[i].mode,
			smi_comm[i].master,
			smi_comm[i].port,
			smi_comm[i].rwtype,
			smi_comm[i].desttype,
			smi_comm[i].bustype);
	}
#endif

	if (parallel_mode == 0) {
		// Legacy mode
		ret += smi_lm_get_cnt(smi_value, size);
	} else {
		// Parallel mode
		ret += smi_pm_get_cnt(smi_value, size);
	}

	smi_stop();
	smi_start();

	return ret;
}