⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cfwbvd1.c

📁 Xcale270Bsp包,wince平台
💻 C
📖 第 1 页 / 共 4 页
字号:
            break;

       case SYSINTR_ETHER:  // KITL

#ifndef IMGNOKITL
            //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDisable: SYSINTR_ETHER.\r\n"));
#if 0	//hzh
			if (v_pDriverGlobals->uninit_misc.EbootDevice == BOOT_DEVICE_SLOT0)
			{
				v_pBLReg->int_msk_en  = (v_pBLReg->int_msk_en & ~INTMSK_SETCLR_RESERVED_BITS) & ~PCMCIA_S0_IRQ_MASK; // socket 0
			}
			else if (v_pDriverGlobals->uninit_misc.EbootDevice == BOOT_DEVICE_SLOT1)
			{
				v_pBLReg->int_msk_en  = (v_pBLReg->int_msk_en & ~INTMSK_SETCLR_RESERVED_BITS) & ~PCMCIA_S1_IRQ_MASK; // socket 1
			}
#else
			if (v_pDriverGlobals->uninit_misc.EbootDevice == BOOT_DEVICE_SLOT0)
			{
				v_pGPIOReg->GFER2 &= ~(1<<17);			//nIRQ
			}
#endif
#else		//hzh
			v_pGPIOReg->GRER0 &= ~(1<<14);	//GPIO14
#endif
            break;

		case SYSINTR_SMSC:
			//lpWriteDebugStringFunc(TEXT("**************OEMInterruptDisable: SYSINTR_SMSC.\r\n"));
#if 0	//hzh
#ifdef BSP_MAINSTONE 
			v_pBLReg->int_msk_en  &= ~ETHERNET_IRQ_MASK;
#endif
#else
			v_pGPIOReg->GRER0 &= ~2;
			//v_pGPIOReg->GFER0 &= ~2;
			//RETAILMSG(1,(TEXT("Disable SYSINTR_SMSC\r\n")));
#endif
            break;

		//===hzh
		case SYSINTR_CS8900A:
            v_pGPIOReg->GRER0 &= ~(1<<14);	//GPIO14
			break;
		
		case SYSINTR_16550:
            v_pGPIOReg->GRER0 &= ~(1<<19);	//GPIO19
            //RETAILMSG(1,(TEXT("Disable SYSINTR_16550\r\n")));
			break;
		//===

		//If the PC Card Socket interrupt is either a CARD DETECT interrupt or a
		//STATUS CHANGE interrupt, then disable it here for both sockets
		case SYSINTR_PCMCIA_STATE:
#if 0	//hzh
			//Disable the BVD1STSCHG and CDVALID interrupts for both sockets
			v_pBLReg->int_msk_en  &= ~(PCMCIA_S0_STSCHG_MASK);
			v_pBLReg->int_msk_en  &= ~(PCMCIA_S0_CD_MASK);

			v_pBLReg->int_msk_en  &= ~(PCMCIA_S1_STSCHG_MASK);
			v_pBLReg->int_msk_en  &= ~(PCMCIA_S1_CD_MASK);
#else
			v_pGPIOReg->GFER2 &= ~((1<<19)|(1<<20));//nCD & nSTSCHG
			v_pGPIOReg->GRER2 &= ~(1<<19);			//nCD
			RETAILMSG(1,(TEXT("Disable SYSINTR_PCMCIA_STATE\r\n")));
#endif
		    break;

		//If the PC Card Socket interrupt is an IRQ interrupt, then
		//disable it here for both sockets
		case SYSINTR_PCMCIA_LEVEL:
#if 0	//hzh
			v_pBLReg->int_msk_en  &= ~(PCMCIA_S0_IRQ_MASK);
			v_pBLReg->int_msk_en  &= ~(PCMCIA_S1_IRQ_MASK);
#else
			v_pGPIOReg->GFER2 &= ~(1<<17);			//nIRQ
#endif
			 break;

		case SYSINTR_TIMING:
		     break;

		case SYSINTR_PMU:
            //
            // Currently PMU DCD does not need to do anything here.
            //
            break;
//xiexy in OEMInterruptDisenable
		case SYSINTR_IDE:
						v_pGPIOReg->GRER0 &= ~(1<<9);
						break;
//end xiexy
		
    }
    INTERRUPTS_ON();
}


/* ************************************************************************* */
/*
    @func	BOOL | OEMInterruptDone | Signal completion of interrupt processing
    @rdesc	none
    @comm 	OEMInterruptDone is called by the Kernel when a device driver
            calls <f InterruptDone>. The system is not preemtible when this
            function is called.
    @xref   <l Overview.Kernel Interrupt Support> <f InterruptDone>
*/
void OEMInterruptDone(
                     DWORD idInt     // @parm Interrupt ID. See <t Interrupt ID's>
                     // for the list of possible values.
                     )
{
	volatile XLLP_GPIO_T *v_pGPIOReg;
	volatile XLLP_INTC_T  *v_pICReg;
	volatile PDRIVER_GLOBALS v_pDriverGlobals = (volatile PDRIVER_GLOBALS)DRIVER_GLOBALS_U_VIRTUAL;	
    volatile XLLP_OST_T    *v_pOSTReg;
#if 0	//hzh
#ifdef BSP_MAINSTONE
	volatile BLR_REGS   *v_pBLReg;
	v_pBLReg = (volatile BLR_REGS *)FPGA_REGS_BASE_U_VIRTUAL;
#endif
#endif
	v_pGPIOReg	= (volatile XLLP_GPIO_T *)GPIO_BASE_U_VIRTUAL;
	v_pICReg = (volatile XLLP_INTC_T *) INTC_BASE_U_VIRTUAL;
    v_pOSTReg = (volatile XLLP_OST_T *)OST_BASE_U_VIRTUAL;
   INTERRUPTS_OFF();
   switch(idInt)
   {
	    case SYSINTR_CAMERA_INTERFACE:
			 INTC_CAPTURE_INT_EN(v_pICReg->icmr2);
            break;

		// same issue as before.. this is going to enable all unmasked DMA interrupts again, when really, what
		// we want is to just enable the camera interface.  This has to be worked out with Audio.
	    case SYSINTR_CAMERA_DMAC:
			 INTC_DMAC_INT_EN(v_pICReg->icmr);
            break;

        case SYSINTR_OHCI_MDD:
			

			INTC_USBOHCI_INT_EN( v_pICReg->icmr );

            break;

        case SYSINTR_OHCI_PDD:
			RETAILMSG(1,(TEXT("OEMInterruptDone: done with OHCI PDD interrupt.\n\r")));

			INTC_USBNONOHCI_INT_EN( v_pICReg->icmr );

            break;


   
		case SYSINTR_KEYPAD:
			INTC_KEYPAD_INT_EN(v_pICReg->icmr);
			break;
		case SYSINTR_SDMMC:
			INTC_MMC_INT_EN(v_pICReg->icmr);
			break;
        case SYSINTR_DVM:
			 //TIMER_M3_INT_CLR(v_pOSTReg->ossr);
			 //INTC_M3_INT_EN(v_pICReg->icmr);     
            
             break;
	    case SYSINTR_MMCCD:
#if 0	//hzh
#ifdef BSP_MAINSTONE
			v_pBLReg->int_set_clr &= ~MMCCD_MASK;
			v_pBLReg->int_msk_en  |= MMCCD_MASK;
//			DEBUGMSG(1, (TEXT("**** FPGA set clear register is %x mask %x\r\n"),v_pBLReg->int_set_clr,v_pBLReg->int_msk_en));
#endif
#else
			v_pGPIOReg->GFER3 |= 1<<2;
			v_pGPIOReg->GRER3 |= 1<<2;
#endif
            break;

		case SYSINTR_TOUCH:
         //   lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_TOUCHpanel.\r\n"));
#if 0	//hzh
#ifdef BSP_MAINSTONE
			v_pBLReg->int_set_clr &= ~UCB1400_IRQ_MASK;
		    v_pBLReg->int_msk_en |= UCB1400_IRQ_MASK;   //enable interrupt
			
//			DEBUGMSG(1,(TEXT("****Interrupt Done: FPGA set clear register is %x mask %x\r\n"),v_pBLReg->int_set_clr,v_pBLReg->int_msk_en));
#endif
#else
//RETAILMSG(1,(TEXT("Touch interrupt done-----------\r\n")));
			v_pGPIOReg->GRER0 |= 1<<13;
#endif
            break;

        case SYSINTR_TOUCH_CHANGED:
          //  //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_TOUCH_CHANGEDpanel.\r\n"));
#if 0	//hzh
#ifdef BSP_MAINSTONE
			v_pBLReg->int_set_clr &= ~UCB1400_IRQ_MASK;
			v_pBLReg->int_msk_en |= UCB1400_IRQ_MASK;   //enable interrupt
		
//			DEBUGMSG(1,(TEXT("**** FPGA set clear register in InterruptDone is %x\r\n"),v_pBLReg->int_set_clr));
#endif
#else
			v_pGPIOReg->GRER0 |= 1<<13;
#endif
            break;

        case SYSINTR_POWER:
#if 0	//hzh
            //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_POWER.\r\n"));
		    INTC_GPIO1_INT_EN (v_pICReg->icmr);
		    GEDR_GPIO1_EDGE_CLR (v_pGPIOReg->GEDR0);
#else
			RETAILMSG(1,(TEXT("Done GP0 Irq\r\n")));
			v_pGPIOReg->GFER0 |= 1;
			v_pICReg->icmr |= 1<<8;
#endif
            break;

        case SYSINTR_SERIAL:
            // //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_SERIAL.\r\n"));
            // FFUART interrupt unmasked
		    INTC_FFUART_INT_EN(v_pICReg->icmr);
            break;

		case SYSINTR_SERIAL2:    
			//lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_SERIAL2.\r\n"));
            // BTUART interrupt unmasked
		    INTC_BTUART_INT_EN(v_pICReg->icmr);
            break;

        case SYSINTR_IR:
            //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_IR.\r\n"));
            // STUART interrupt unmasked
		    INTC_STUART_INT_EN(v_pICReg->icmr);
            break;

        case SYSINTR_USB_CLIENT:
            //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_USB_CLIENT.\r\n"));
            INTC_USBC_INT_EN(v_pICReg->icmr);

            break;

        case SYSINTR_AUDIO:
        case SYSINTR_DMA:
            //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SYSINTR_AUDIO.\r\n"));
            INTC_DMAC_INT_EN(v_pICReg->icmr);
            break;

       case SYSINTR_ETHER:  // KITL
#ifndef IMGNOKITL
#if 0	//hzh
           if (v_pDriverGlobals->uninit_misc.EbootDevice == BOOT_DEVICE_SLOT0)
           {
               //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SLOT0 for KITL.\r\n"));
               v_pBLReg->int_set_clr =  (v_pBLReg->int_set_clr & ~INTMSK_SETCLR_RESERVED_BITS) & ~PCMCIA_S0_IRQ_MASK;       // clear it
               v_pBLReg->int_msk_en  =  (v_pBLReg->int_msk_en  & ~INTMSK_SETCLR_RESERVED_BITS) | PCMCIA_S0_IRQ_MASK;        // unmask
           }
           else if (v_pDriverGlobals->uninit_misc.EbootDevice == BOOT_DEVICE_SLOT1)
           {
               //lpWriteDebugStringFunc(TEXT("**************OEMInterruptDone: SLOT1 for KITL.\r\n"));
               v_pBLReg->int_set_clr =  (v_pBLReg->int_set_clr & ~INTMSK_SETCLR_RESERVED_BITS) & ~PCMCIA_S1_IRQ_MASK;       // clear it
               v_pBLReg->int_msk_en  =  (v_pBLReg->int_msk_en  & ~INTMSK_SETCLR_RESERVED_BITS) | PCMCIA_S1_IRQ_MASK;        // unmask
           }
#else
			if (v_pDriverGlobals->uninit_misc.EbootDevice == BOOT_DEVICE_SLOT0)
			{
				v_pGPIOReg->GFER2 |= 1<<17;				//nIRQ
			}
#endif
#else		//hzh
			v_pGPIOReg->GRER0 |= 1<<14;		//GPIO14
#endif
            break;

        case SYSINTR_SMSC:
#if 0	//hzh
#ifdef BSP_MAINSTONE
			v_pBLReg->int_set_clr &= ~ETHERNET_IRQ_MASK;
			v_pBLReg->int_msk_en  |= ETHERNET_IRQ_MASK;
#endif
#else
			//RETAILMSG(1,(TEXT("Done SYSINTR_SMSC\r\n")));
			v_pGPIOReg->GRER0 |= 2;
			//v_pGPIOReg->GFER0 &= ~2;
#endif
            break;

		//===hzh
		case SYSINTR_CS8900A:
			//RETAILMSG(1,(TEXT("Done SYSINTR_CS8900A\r\n")));	
            v_pGPIOReg->GRER0 |= 1<<14;		//GPIO14
			break;
		
		case SYSINTR_16550:
			//RETAILMSG(1,(TEXT("Done SYSINTR_16550\r\n")));	
            v_pGPIOReg->GRER0 |= 1<<19;		//GPIO19
			break;
		//===

		//If the PC Card Socket interrupt is either a CARD DETECT interrupt or a
		//STATUS CHANGE interrupt, then re-enable it here for both sockets, after it has been serviced
        case SYSINTR_PCMCIA_STATE:
#if 0	//hzh
			//********** SOCKET 0 **********
			if(v_pDriverGlobals->pcm.slot0BVDStschgint) 
			{
        		v_pBLReg->int_set_clr &= ~(PCMCIA_S0_STSCHG_MASK);
        		v_pBLReg->int_msk_en |= PCMCIA_S0_STSCHG_MASK;
				v_pDriverGlobals->pcm.slot0BVDStschgint = 0;
			}

			if(v_pDriverGlobals->pcm.slot0CDvalidint) 
			{
        		v_pBLReg->int_set_clr &= ~(PCMCIA_S0_CD_MASK);
        		v_pBLReg->int_msk_en |= PCMCIA_S0_CD_MASK;
				v_pDriverGlobals->pcm.slot0CDvalidint = 0; 
			}

			//********** SOCKET 1 **********
            if (v_pDriverGlobals->pcm.slot1BVDStschgint) 
            {
        		v_pBLReg->int_set_clr &= ~(PCMCIA_S1_STSCHG_MASK);
        		v_pBLReg->int_msk_en |= PCMCIA_S1_STSCHG_MASK;
	            v_pDriverGlobals->pcm.slot1BVDStschgint = 0;
            }

            if (v_pDriverGlobals->pcm.slot1CDvalidint) 
            {
        		v_pBLReg->int_set_clr &= ~(PCMCIA_S1_CD_MASK);
        		v_pBLReg->int_msk_en |= PCMCIA_S1_CD_MASK;
	            v_pDriverGlobals->pcm.slot1CDvalidint = 0;
		    }
#else
			if(v_pDriverGlobals->pcm.slot0BVDStschgint)
			{
				v_pGPIOReg->GFER2 |= 1<<20;				//nSTSCHG
			}
			if(v_pDriverGlobals->pcm.slot0CDvalidint)
			{
				v_pGPIOReg->GFER2 |= 1<<19;
				v_pGPIOReg->GRER2 |= 1<<19;				//nCD
			}
			RETAILMSG(1,(TEXT("Done SYSINTR_PCMCIA_STATE\r\n")));
#endif
            break;

		//If the PC Card Socket interrupt is an IRQ interrupt, then
		//re-enable it here for both sockets, after it has been serviced
        case SYSINTR_PCMCIA_LEVEL:
#if 0	//hzh
			if(v_pDriverGlobals->pcm.slot0Enable) 
			{
        		v_pBLReg->int_set_clr &= ~(PCMCIA_S0_IRQ_MASK);
        		v_pBLReg->int_msk_en |= PCMCIA_S0_IRQ_MASK;
				v_pDriverGlobals->pcm.slot0Enable = 0;
			}

			if(v_pDriverGlobals->pcm.slot1Enable) 
			{
        		v_pBLReg->int_set_clr &= ~(PCMCIA_S1_IRQ_MASK);
        		v_pBLReg->int_msk_en |= PCMCIA_S1_IRQ_MASK;
				v_pDriverGlobals->pcm.slot1Enable = 0;
			}
#else
			if(v_pDriverGlobals->pcm.slot0Enable)
			{
				v_pGPIOReg->GFER2 |= 1<<17;				//nIRQ
			}
#endif
            break;

        case SYSINTR_PMU:
            //
            // Currently PMU DCD does not need to do anything here.
            //
            break;
//xiexy in OEMInterruptDone
				case SYSINTR_IDE:
						v_pGPIOReg->GRER0 |= (1<<9);
						INTC_GPIOXX_2_INT_EN(v_pICReg->icmr); 
						break;
//end xie
		            
    }
    INTERRUPTS_ON();
}



/* ************************************************************************* */
BOOL OEMGetExtensionDRAM(LPDWORD lpMemStart, LPDWORD lpMemLen)
{
    /*  This is called by the Kernel so see if there is any DRAM beyond
         what is reported through Config.bib
    */         
    return FALSE;   // no extension DRAM
}


/* ************************************************************************* */
/*
OEMQueryPerformanceCounter()

The OEMQueryPerformanceCounter function retrieves the current value of 
the high-resolution performance counter, if one exists. 


Parameters:

lpliPerformanceCount

Points to a variable that the function sets, in counts, to the current 
performance-counter value. If the installed hardware does not support 
a high-resolution performance counter, this parameter can be to zero. 

Return Value

If the installed hardware supports a high-resolution performance 
counter, the return value is TRUE.
If the installed hardware does not support a high-resolution 
performance counter, the return value is FALSE.   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -