Beispiel #1
0
u8 api_ReadConfig()
{
	u16 addr = 0;
	LOG_TRACE();
	log_SetVerboseWrite(1);
	for (addr = 0; addr < 0x8000; addr++)
	{
		if ((addr == 0x01FF || addr <= 0x0003) || /* ID */
		(addr >= 0x0100 && addr <= 0x0107) || /* IH */
		(addr >= 0x0200 && addr <= 0x0207) || /* TX */
		(addr >= 0x0800 && addr <= 0x0808) || /* VP */
		(addr >= 0x1000 && addr <= 0x10E0) || /* FC */
		(addr >= 0x1100 && addr <= 0x1120) || /* FC */
		(addr >= 0x1200 && addr <= 0x121B) || /* FC */
		(addr >= 0x3000 && addr <= 0x3007) || /* PHY */
		(addr >= 0x3100 && addr <= 0x3102) || /* AUD */
		(addr >= 0x3200 && addr <= 0x3206) || /* AUD */
		(addr >= 0x3300 && addr <= 0x3302) || /* AUD */
		(addr >= 0x3400 && addr <= 0x3404) || /* AUD */
		(addr >= 0x4000 && addr <= 0x4006) || /* MC */
		(addr >= 0x4100 && addr <= 0x4119) || /* CSC */
		(addr >= 0x5000 && addr <= 0x501A) || /* A */
		(addr >= 0x7000 && addr <= 0x7026) || /* VG */
		(addr >= 0x7100 && addr <= 0x7116) || /* AG */
		(addr >= 0x7D00 && addr <= 0x7D31) || /* CEC */
		(addr >= 0x7E00 && addr <= 0x7E0A)) /* EDID */
		{
			/* SRM and I2C slave not required */
			LOG_WRITE(addr, access_CoreReadByte(addr));
		}
	}
	log_SetVerboseWrite(0);
	return TRUE;
}
Beispiel #2
0
void api_EventHandler(void * param)
{
	u8 i = 0;
	u8 state = 0;
	u8 handled = FALSE;
	u8 oldHpd = (api_mCurrentState >= API_HPD);
	LOG_TRACE();
	//printk("======>enter api_EventHandler, api_mCurrentState = %d\n",
	//		api_mCurrentState);

	api_mHpd = (phy_HotPlugDetected(api_mBaseAddress) > 0);
#if 0
for (state = 0; state < 10; state++)
{
	LOG_NOTICE3("core read", 0x100 + state, access_CoreReadByte(api_mBaseAddress + 0x100 + state));
}
#endif
	/* if HPD always enter - all states */
	state = control_InterruptPhyState(api_mBaseAddress);
	//printk("======>state = 0x%02x, api_mHpd = %u, oldHpd = %u\n",
	//		state, api_mHpd, oldHpd);
	if ((state != 0) || (api_mHpd != oldHpd))
	{
		if (api_mHpd && !oldHpd)
		{
			api_mCurrentState = API_HPD;
			LOG_NOTICE("hot plug detected");
		}
		else if (!api_mHpd && oldHpd)
		{
			api_mCurrentState = API_NOT_INIT;
			LOG_NOTICE("hot plug lost");
		}
		//printk("=====>enter %s:%d\n", __func__, __LINE__);
		control_InterruptPhyClear(api_mBaseAddress, state);
		handled = TRUE;
		/* report HPD state to HDCP (after configuration) */
		if (api_mCurrentState == API_CONFIGURED)
		{
			//printk("=====>enter %s:%d\n", __func__, __LINE__);
			hdcp_RxDetected(api_mBaseAddress, api_mHpd);
		}
	}
	//printk("======>%s:%d api_mCurrentState = %d\n", __func__, __LINE__,
	//		api_mCurrentState);
	if (api_mCurrentState == API_CONFIGURED)
	{
		/* only report if configured
		 * (for modules enabled only at configuration stage)*/
		/* HDCP module */
		//printk("=====>enter %s:%d\n", __func__, __LINE__);
		state = hdcp_InterruptStatus(api_mBaseAddress);
		if ((state != 0) || (api_mHpd != oldHpd))
		{
			//printk("=====>enter %s:%d\n", __func__, __LINE__);
			hdcp_InterruptClear(api_mBaseAddress, state);
			handled = hdcp_EventHandler(api_mBaseAddress, api_mHpd, state, api_mEventRegistry[KSV_LIST_READY]);
		}
	}
	//printk("======>%s:%d api_mCurrentState = %d\n", __func__, __LINE__,
	//		api_mCurrentState);
	if (api_mCurrentState >= API_HPD)
	{
		/* only report if state is HPD, EDID_READ or CONFIGURED
		   for modules that can be enabled anytime there is HPD */
		/* EDID module */
		state = control_InterruptEdidState(api_mBaseAddress);
		//printk("=====>enter %s:%d, state = %02x\n",
		//		__func__, __LINE__, state);
		if ((state != 0) || (api_mHpd != oldHpd))
		{
			control_InterruptEdidClear(api_mBaseAddress, state);
//			printk("*****edid**********enter %s:%d\n", __func__, __LINE__);
			if (edid_EventHandler(api_mBaseAddress, api_mHpd, state) == EDID_DONE)
			{
#ifdef CONFIG_HMDI_JZ4780_DEBUG
			printk("*edid read done %s:%d\n", __func__, __LINE__);
#endif
				edid_Standby(api_mBaseAddress);
				api_mCurrentState = API_EDID_READ;
				if (api_mEventRegistry[EDID_READ_EVENT] != NULL)
				{
					//printk("=====>enter %s:%d\n", __func__, __LINE__);
					api_mEventRegistry[EDID_READ_EVENT](&api_mHpd);
				}
			}
			/* even if it is an error reading, it is has been handled!*/
			handled = TRUE;
		}
	}
	state = control_InterruptAudioDmaState(api_mBaseAddress);
	//printk("=====>%s:%d: state = 0x%02x\n", __func__, __LINE__, state);
	for (i = HPD_EVENT; i < DUMMY; i++)
	{
		/* mutex_Lock(&api_mMutex); */
		/* call registered user callbacks */
		//printk("=====>enter %s:%d\n", __func__, __LINE__);
		if (api_mEventRegistry[i] != NULL)
		{
			if ((i == HPD_EVENT) && (api_mHpd != oldHpd))
			{
				//printk("=====>enter %s:%d\n", __func__, __LINE__);
				api_mEventRegistry[i](&api_mHpd);
			}
			else if ((i == DMA_DONE) && (state & (1 << 7)))
			{
				//printk("=====>enter %s:%d\n", __func__, __LINE__);
				api_mEventRegistry[i](&api_mHpd);
			}
			else if ((i == DMA_ERROR) && (state & (1 << 4)))
			{
				//printk("=====>enter %s:%d\n", __func__, __LINE__);
				api_mEventRegistry[i](&api_mHpd);
			}

		}
		/* mutex_Unlock(&api_mMutex); */
	}

	//enable all fc interrupt ,lltang
	{
		state = control_InterruptAudioPacketsState(api_mBaseAddress);
		if(state){

/*
			access_CoreWriteByte(0x4, 0x10D2);
			printk("after clear Audio Sampler----> stat:%x\n",control_InterruptAudioSamplerState(api_mBaseAddress));
			control_InterruptAudioPacketsClear(api_mBaseAddress, state);
			printk("AudioPackets----> stat:%x\n",state);
			state = control_InterruptAudioPacketsState(api_mBaseAddress);
			access_CoreWriteByte(~0x4, 0x10D2);
			printk("0x10D2:%x\n",access_CoreReadByte(0x10D2));
			printk("0x0180:%x\n",access_CoreReadByte(0x0180));
			printk("0x3302:%x\n",access_CoreReadByte(0x3302));
*/
			handled = TRUE;
		}
		
		state = control_InterruptOtherPacketsState(api_mBaseAddress);
		if(state){
			access_CoreWriteByte(0xff, 0x10D6);
			control_InterruptOtherPacketsClear(api_mBaseAddress, state);
			printk("OtherPackets----> stat:%x\n",state);
			state = control_InterruptOtherPacketsState(api_mBaseAddress);
			printk("after clear OtherPackets----> stat:%x\n",state);
			handled = TRUE;
			access_CoreWriteByte(0x0, 0x10D6);
		}
		
		state = control_InterruptPacketsOverflowState(api_mBaseAddress);
		if(state){
			access_CoreWriteByte(0xff, 0x10DA);
			control_InterruptPacketsOverflowClear(api_mBaseAddress, state);
			printk("PacketsOverflow----> stat:%x\n",state);
			
			printk("after clear PacketsOverflow----> stat:%x\n",control_InterruptPacketsOverflowState(api_mBaseAddress));
			handled = TRUE;
			access_CoreWriteByte(0xff, 0x10DA);
		}
		state = control_InterruptAudioSamplerState(api_mBaseAddress);
		if(state){
			access_CoreWriteByte((0xc), 0x3302);
			control_InterruptAudioSamplerClear(api_mBaseAddress, state);
			printk("Audio Sampler----> stat:%x\n",state);
			
			printk("after clear Audio Sampler----> stat:%x\n",control_InterruptAudioSamplerState(api_mBaseAddress));
			handled = TRUE;
			access_CoreWriteByte(~(0xc), 0x3302);

		}
	}

	if (!handled)
	{
		printk("interrupt not handled");
#if 0
		for (state = 0; state < 10; state++)
		{
			LOG_NOTICE3("core read", 0x100 + state, access_CoreReadByte(api_mBaseAddress + 0x100 + state));
		}
#endif
		control_InterruptEdidClear(api_mBaseAddress, 0x3);
	}
	system_InterruptAcknowledge(TX_INT);
	//printk("======>leave api_EventHandler\n");
}
Beispiel #3
0
u8 api_CoreRead(u16 addr)
{
	return access_CoreReadByte(addr);
}
Beispiel #4
0
u8 halInterrupt_I2cDdcState(u16 baseAddr)

{
    LOG_TRACE();
    return access_CoreReadByte(baseAddr + IH_I2CM_STAT0);
}
Beispiel #5
0
u8 halInterrupt_CecState(u16 baseAddr)
{
    LOG_TRACE();
    return access_CoreReadByte(baseAddr + IH_CEC_STAT0);
}
Beispiel #6
0
u8 halInterrupt_PacketsOverflowState(u16 baseAddr)
{
    LOG_TRACE();
    return access_CoreReadByte(baseAddr + IH_FC_STAT2);
}
Beispiel #7
0
u8 halInterrupt_AudioSamplerState(u16 baseAddr)
{
    LOG_TRACE();
    return access_CoreReadByte(baseAddr + IH_AS_STAT0);
}
Beispiel #8
0
u8 halInterrupt_AudioDmaState(u16 baseAddr)
{
    LOG_TRACE();
    return access_CoreReadByte(baseAddr + IH_AHBDMAAUD_STAT0);
}
Beispiel #9
0
u8 halInterrupt_OtherPacketsState(u16 baseAddr)
{
    LOG_TRACE();
    return access_CoreReadByte(baseAddr + IH_FC_STAT1);
}
Beispiel #10
0
u8 halSourcePhy_TestDataOut(u16 baseAddr)
{
	LOG_TRACE();
	return access_CoreReadByte(baseAddr + PHY_TST2);
}
Beispiel #11
0
u8 halInterrupt_VideoPacketizerState(u16 baseAddr)
{
    LOG_TRACE();
    return access_CoreReadByte(baseAddr + IH_VP_STAT0);
}
Beispiel #12
0
u8 halSourcePhy_InterruptPolarityStatus(u16 baseAddr, u8 mask)
{
	LOG_TRACE1(mask);
	return access_CoreReadByte(baseAddr + PHY_POL0) & mask;
}
Beispiel #13
0
u8 halSourcePhy_InterruptMaskStatus(u16 baseAddr, u8 mask)
{
	LOG_TRACE1(mask);
	return access_CoreReadByte(baseAddr + PHY_MASK0) & mask;
}
Beispiel #14
0
u8 halIdentification_ProductType(u16 baseAddr)
{
	LOG_TRACE();
	return access_CoreReadByte((baseAddr + PRODUCT_ID1));
}
Beispiel #15
0
u8 halIdentification_Revision(u16 baseAddr)
{
	LOG_TRACE();
	return access_CoreReadByte((baseAddr + REVISION_ID));
}
Beispiel #16
0
u8 halIdentification_Design(u16 baseAddr)
{
	LOG_TRACE();
	return access_CoreReadByte((baseAddr + DESIGN_ID));
}