Ejemplo n.º 1
0
void dmb_drv_check_overrun(u8 reset)
{
	u16 overrun;
	u16 temp = 0;

	bbm_com_word_read(NULL, BBM_BUF_OVERRUN, &overrun);

	if (overrun & dmb_mode) {
		/* overrun clear */
		bbm_com_word_write(NULL, BBM_BUF_OVERRUN, overrun);
		bbm_com_word_write(NULL, BBM_BUF_OVERRUN, 0x0000);

		if (reset) {
			/* buffer restore */
			bbm_com_word_read(NULL, BBM_BUF_ENABLE, &temp);
			temp &= ~dmb_mode;
			bbm_com_word_write(NULL, BBM_BUF_ENABLE, temp);
			temp |= dmb_mode;
			bbm_com_word_write(NULL, BBM_BUF_ENABLE, temp);

			/* external interrupt restore */
			fc8050_isr_interruptclear();
		}

		DPRINTK("FC8050 Overrun occured\n");
	}

}
Ejemplo n.º 2
0
void tdmb_fc8080_spi_write_read_test(void)
{
	uint16 i;
	uint32 wdata = 0;
	uint32 ldata = 0;
	uint32 data = 0;
	uint32 temp = 0;

#define TEST_CNT    5
	tdmb_fc8080_power_on();

	for(i=0;i<TEST_CNT;i++)
	{
		bbm_com_write(NULL, 0xa4, i & 0xff);
		bbm_com_read(NULL, 0xa4, (fci_u8*)&data);
		printk("FC8080 byte test (0x%x,0x%x)\n", i & 0xff, data);
		if((i & 0xff) != data)
			printk("FC8080 byte test (0x%x,0x%x)\n", i & 0xff, data);
	}

	for(i=0;i<TEST_CNT;i++)
	{
		bbm_com_word_write(NULL, 0xa4, i & 0xffff);
		bbm_com_word_read(NULL, 0xa4, (fci_u16*)&wdata);
		printk("FC8080 word test (0x%x,0x%x)\n", i & 0xffff, wdata);
		if((i & 0xffff) != wdata)
			printk("FC8080 word test (0x%x,0x%x)\n", i & 0xffff, wdata);
	}

	for(i=0;i<TEST_CNT;i++)
	{
		bbm_com_long_write(NULL, 0xa4, i & 0xffffffff);
		bbm_com_long_read(NULL, 0xa4, (fci_u32*)&ldata);
		printk("FC8080 long test (0x%x,0x%x)\n", i & 0xffffffff, ldata);
		if((i & 0xffffffff) != ldata)
			printk("FC8080 long test (0x%x,0x%x)\n", i & 0xffffffff, ldata);
	}

	data = 0;

	for(i=0;i<TEST_CNT;i++)
	{
		temp = i&0xff;
		bbm_com_tuner_write(NULL, 0x58, 0x01, (fci_u8*)&temp, 0x01);
		bbm_com_tuner_read(NULL, 0x58, 0x01, (fci_u8*)&data, 0x01);
		printk("FC8080 tuner test (0x%x,0x%x)\n", i & 0xff, data);
		if((i & 0xff) != data)
			printk("FC8080 tuner test (0x%x,0x%x)\n", i & 0xff, data);
	}
	tdmb_fc8080_power_off();
}
Ejemplo n.º 3
0
unsigned char dmb_drv_init(void)
{
#ifdef FEATURE_INTERFACE_TEST_MODE
	int i;
	u8 data;
	u16 wdata;
	u32 ldata;
	u8 temp = 0x1e;
#endif

#ifdef CONFIG_TDMB_SPI
	if (bbm_com_hostif_select(NULL, BBM_SPI))
		return TDMB_FAIL;
#elif defined(CONFIG_TDMB_EBI)
	if (bbm_com_hostif_select(NULL, BBM_PPI))
		return TDMB_FAIL;
#endif

	/* check for factory  chip interface test */
	if (bbm_com_probe(NULL) != BBM_OK) {
		DPRINTK("%s : BBM_PROBE fail\n", __func__);
		return TDMB_FAIL;
	}

	bbm_com_fic_callback_register(0, tdmb_interrupt_fic_callback);
	bbm_com_msc_callback_register(0, tdmb_interrupt_msc_callback);

	bbm_com_init(NULL);
	bbm_com_tuner_select(NULL, FC8050_TUNER, BAND3_TYPE);

#ifdef FEATURE_INTERFACE_TEST_MODE
	for (i = 0; i < 1000; i++) {
		bbm_com_write(NULL, 0x05, i & 0xff);
		bbm_com_read(NULL, 0x05, &data);
		if ((i & 0xff) != data)
			DPRINTK("FC8000 byte test (0x%x,0x%x)\r\n"
			, i & 0xff, data);
	}
	for (i = 0; i < 1000; i++) {
		bbm_com_word_write(NULL, 0x0210, i & 0xffff);
		bbm_com_word_read(NULL, 0x0210, &wdata);
		if ((i & 0xffff) != wdata)
			DPRINTK("FC8000 word test (0x%x,0x%x)\r\n"
			, i & 0xffff, wdata);
	}
	for (i = 0; i < 1000; i++) {
		bbm_com_long_write(NULL, 0x0210, i & 0xffffffff);
		bbm_com_long_read(NULL, 0x0210, &ldata);
		if ((i & 0xffffffff) != ldata)
			DPRINTK("FC8000 long test (0x%x,0x%x)\r\n"
			, i & 0xffffffff, ldata);
	}
	for (i = 0; i < 1000; i++) {
		temp = i&0xff;
		bbm_com_tuner_write(NULL, 0x12, 0x01, &temp, 0x01);
		bbm_com_tuner_read(NULL, 0x12, 0x01, &data, 0x01);
		if ((i & 0xff) != data)
			DPRINTK("FC8000 tuner test (0x%x,0x%x)\r\n"
			, i & 0xff, data);
	}
	temp = 0x51;
	bbm_com_tuner_write(NULL, 0x12, 0x01, &temp, 0x01);
#endif

	saved_ber = 3000;
	dmb_initialize = 1;

	return TDMB_SUCCESS;
}