Example #1
0
/*main(int argc, char *argv[])*/
static int __pci_scan(pciinfo_t *pci_list,unsigned *num_pci)
{
    unsigned int idx;
    struct pci_config_reg pcr;
    int do_mode1_scan = 0, do_mode2_scan = 0;
    int func, hostbridges=0;
    int ret = -1;
    
    pci_lst = pci_list;
    pcicards = 0;
 
    ret = enable_app_io();
    if (ret != 0)
	return(ret);

    if((pcr._configtype = pci_config_type()) == 0xFFFF) return ENODEV;
 
    /* Try pci config 1 probe first */
 
    if ((pcr._configtype == 1) || do_mode1_scan) {
    /*printf("\nPCI probing configuration type 1\n");*/
 
    pcr._ioaddr = 0xFFFF;
 
    pcr._pcibuses[0] = 0;
    pcr._pcinumbus = 1;
    pcr._pcibusidx = 0;
    idx = 0;
 
    do {
        /*printf("Probing for devices on PCI bus %d:\n\n", pcr._pcibusidx);*/
 
        for (pcr._cardnum = 0x0; pcr._cardnum < MAX_PCI_DEVICES_PER_BUS;
		pcr._cardnum += 0x1) {
	  func = 0;
	  do { /* loop over the different functions, if present */
	    pcr._device_vendor = pci_get_vendor(pcr._pcibuses[pcr._pcibusidx], pcr._cardnum,
						func);
            if ((pcr._vendor == 0xFFFF) || (pcr._device == 0xFFFF))
                break;   /* nothing there */
 
	    /*printf("\npci bus 0x%x cardnum 0x%02x function 0x%04x: vendor 0x%04x device 0x%04x\n",
	        pcr._pcibuses[pcr._pcibusidx], pcr._cardnum, func,
		pcr._vendor, pcr._device);*/
	    pcibus = pcr._pcibuses[pcr._pcibusidx];
	    pcicard = pcr._cardnum;
	    pcifunc = func;
 
	    pcr._status_command = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_CMD_STAT_REG);
	    pcr._class_revision = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_CLASS_REG);
	    pcr._bist_header_latency_cache = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_HEADER_MISC);
	    pcr._base0 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAP_REG_START);
	    pcr._base1 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAP_REG_START+4);
	    pcr._base2 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAP_REG_START+8);
	    pcr._base3 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAP_REG_START+0x0C);
	    pcr._base4 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAP_REG_START+0x10);
	    pcr._base5 = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAP_REG_START+0x14);
	    pcr._baserom = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAP_ROM_REG);
#if 0
	    pcr._int_pin = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_INTERRUPT_PIN);
	    pcr._int_line = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_INTERRUPT_REG);
	    pcr._min_gnt = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MIN_GNT);
	    pcr._max_lat = pci_config_read_byte(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_MAX_LAT);
#else
	    pcr._max_min_ipin_iline = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_INTERRUPT_REG);
#endif
	    pcr._user_config = pci_config_read_long(pcr._pcibuses[pcr._pcibusidx],
					pcr._cardnum,func,PCI_REG_USERCONFIG);
            /* check for pci-pci bridges */
#define PCI_CLASS_MASK 		0xff000000
#define PCI_SUBCLASS_MASK 	0x00ff0000
#define PCI_CLASS_BRIDGE 	0x06000000
#define PCI_SUBCLASS_BRIDGE_PCI	0x00040000
	    switch(pcr._class_revision & (PCI_CLASS_MASK|PCI_SUBCLASS_MASK)) {
		case PCI_CLASS_BRIDGE|PCI_SUBCLASS_BRIDGE_PCI:
		    if (pcr._secondary_bus_number > 0) {
		        pcr._pcibuses[pcr._pcinumbus++] = pcr._secondary_bus_number;
		    }
			break;
		case PCI_CLASS_BRIDGE:
		    if ( ++hostbridges > 1) {
			pcr._pcibuses[pcr._pcinumbus] = pcr._pcinumbus;
			pcr._pcinumbus++;
		    }
			break;
		default:
			break;
	    }
	    if((func==0) && ((pcr._header_type & PCI_MULTIFUNC_DEV) == 0)) {
	        /* not a multi function device */
		func = 8;
	    } else {
	        func++;
	    }
 
	    if (idx++ >= MAX_PCI_DEVICES)
	        continue;
 
	    identify_card(&pcr);
	  } while( func < 8 );
        }
    } while (++pcr._pcibusidx < pcr._pcinumbus);
    }
 
#if !defined(__alpha__) && !defined(__powerpc__)
    /* Now try pci config 2 probe (deprecated) */
 
    if ((pcr._configtype == 2) || do_mode2_scan) {
    OUTPORT8(PCI_MODE2_ENABLE_REG, 0xF1);
    OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00); /* bus 0 for now */
 
    /*printf("\nPCI probing configuration type 2\n");*/
 
    pcr._pcibuses[0] = 0;
    pcr._pcinumbus = 1;
    pcr._pcibusidx = 0;
    idx = 0;
 
    do {
        for (pcr._ioaddr = 0xC000; pcr._ioaddr < 0xD000; pcr._ioaddr += 0x0100){
	    OUTPORT8(PCI_MODE2_FORWARD_REG, pcr._pcibuses[pcr._pcibusidx]); /* bus 0 for now */
            pcr._device_vendor = INPORT32(pcr._ioaddr);
	    OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00); /* bus 0 for now */
 
            if ((pcr._vendor == 0xFFFF) || (pcr._device == 0xFFFF))
                continue;
            if ((pcr._vendor == 0xF0F0) || (pcr._device == 0xF0F0))
                continue;  /* catch ASUS P55TP4XE motherboards */
 
	    /*printf("\npci bus 0x%x slot at 0x%04x, vendor 0x%04x device 0x%04x\n",
	        pcr._pcibuses[pcr._pcibusidx], pcr._ioaddr, pcr._vendor,
                pcr._device);*/
	    pcibus = pcr._pcibuses[pcr._pcibusidx] ;
	    pcicard = pcr._ioaddr ; pcifunc = 0 ;
 
	    OUTPORT8(PCI_MODE2_FORWARD_REG, pcr._pcibuses[pcr._pcibusidx]); /* bus 0 for now */
            pcr._status_command = INPORT32(pcr._ioaddr + 0x04);
            pcr._class_revision = INPORT32(pcr._ioaddr + 0x08);
            pcr._bist_header_latency_cache = INPORT32(pcr._ioaddr + 0x0C);
            pcr._base0 = INPORT32(pcr._ioaddr + 0x10);
            pcr._base1 = INPORT32(pcr._ioaddr + 0x14);
            pcr._base2 = INPORT32(pcr._ioaddr + 0x18);
            pcr._base3 = INPORT32(pcr._ioaddr + 0x1C);
            pcr._base4 = INPORT32(pcr._ioaddr + 0x20);
            pcr._base5 = INPORT32(pcr._ioaddr + 0x24);
            pcr._baserom = INPORT32(pcr._ioaddr + 0x30);
            pcr._max_min_ipin_iline = INPORT8(pcr._ioaddr + 0x3C);
            pcr._user_config = INPORT32(pcr._ioaddr + 0x40);
	    OUTPORT8(PCI_MODE2_FORWARD_REG, 0x00); /* bus 0 for now */
 
            /* check for pci-pci bridges (currently we only know Digital) */
            if ((pcr._vendor == 0x1011) && (pcr._device == 0x0001))
                if (pcr._secondary_bus_number > 0)
                    pcr._pcibuses[pcr._pcinumbus++] = pcr._secondary_bus_number;
 
	    if (idx++ >= MAX_PCI_DEVICES)
	        continue;
 
	    identify_card(&pcr);
	}
    } while (++pcr._pcibusidx < pcr._pcinumbus);
 
    OUTPORT8(PCI_MODE2_ENABLE_REG, 0x00);
    }
 
#endif /* __alpha__ */
 
    disable_app_io();
    *num_pci = pcicards;
 
    return 0 ;
 
}
Example #2
0
void OEMPowerOff()
{
#if (BSP_TYPE == BSP_SMDK2443)
	static UINT32 saveArea[85];
#elif (BSP_TYPE == BSP_SMDK2450)
	static UINT32 saveArea[90];
#endif
	volatile S3C2450_INTR_REG *pIntr = (S3C2450_INTR_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_INTR, FALSE);
	volatile S3C2450_IOPORT_REG *pIOPort = (S3C2450_IOPORT_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_IOPORT, FALSE);
	volatile S3C2450_LCD_REG *pLCD = (S3C2450_LCD_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_LCD, FALSE);
	volatile S3C2450_CLKPWR_REG *pCLKPWR = (S3C2450_CLKPWR_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_CLOCK_POWER, FALSE);
	// First do platform specific actions
	//BSPPowerOff();
	RETAILMSG(1,(TEXT("\r\n --OEMPowerOff--\r\n")));

	g_pLCDReg = (volatile S3C2450_LCD_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_LCD, FALSE);
//	g_pMEMCTRLReg = (volatile S3C2450_MEMCTRL_REG *)OALPAtoVA(S3C2450_BASE_REG_PA_MEMCTRL, FALSE);
	g_pPWMRegs = (volatile S3C2450_PWM_REG *)OALPAtoVA(S3C2450_BASE_REG_PA_PWM, FALSE);
	g_pCLKPWRRegs = (volatile S3C2450_CLKPWR_REG *)OALPAtoVA(S3C2450_BASE_REG_PA_CLOCK_POWER, FALSE);
	g_pNandRegs = (volatile S3C2450_NAND_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_NAND, FALSE);
	g_pRTCRegs = (volatile S3C2450_RTC_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_RTC, FALSE);
	g_pIOPort = (volatile S3C2450_IOPORT_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_IOPORT, FALSE);
	g_pIntrRegs = (volatile S3C2450_INTR_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_INTR, FALSE);
	g_pBspArgs = (volatile BSP_ARGS *)OALPAtoVA(IMAGE_SHARE_ARGS_PA_START, FALSE);
	g_pADCReg = (S3C2450_ADC_REG*)OALPAtoVA(S3C2450_BASE_REG_PA_ADC, FALSE);


	
#ifdef DVS_EN
	RETAILMSG(1,(TEXT("DVS OFF\r\n")));		
	{
		int voltage_set[2] = HIGH_V_SET;
		ChangeVoltage(ARM_INT_VDD, voltage_set);
	}
	HCLK_RECOVERYUP();
	DVS_OFF();
	g_oalIoCtlClockSpeed = S3C2450_FCLK;
	CurrentState = Active;	

#endif //DVS_EN  

	// Then save system registers


#if (BSP_TYPE == BSP_SMDK2443)
#ifdef EVT1	
	pIOPort->GPACDL = 0xFFFF;
	pIOPort->GPACDH = 0x1FFFF;	
#else
	saveArea[0]  = INPORT32(&pIOPort->GPACON);
	saveArea[1]  = INPORT32(&pIOPort->GPADAT);
#endif
#elif (BSP_TYPE == BSP_SMDK2450)

#if 0
//[david.modify] 2008-06-04 18:26
// s805g  ÓÐÓõ½GPA
//=========================
	pIOPort->GPACON = 0xFFFFFFFF;
	pIOPort->GPADAT= 0x1FFFF;	
//ÔÚ´Ë´¦¹Ø±ÕGPA13 
//GPA14
	pIOPort->GPACON&=~( (1<<13)|(1<<14));
	pIOPort->GPADAT&=~( (1<<13)|(1<<14));
	
//=========================	
#endif
#endif

	saveArea[2]  = INPORT32(&pIOPort->GPBCON);
	saveArea[3]  = INPORT32(&pIOPort->GPBDAT);
	saveArea[4]  = INPORT32(&pIOPort->GPBUDP);
	saveArea[5]  = INPORT32(&pIOPort->GPCCON);
	saveArea[6]  = INPORT32(&pIOPort->GPCDAT);
	saveArea[7]  = INPORT32(&pIOPort->GPCUDP);
	saveArea[8]  = INPORT32(&pIOPort->GPDCON);
	saveArea[9]  = INPORT32(&pIOPort->GPDDAT);
	saveArea[10] = INPORT32(&pIOPort->GPDUDP);
	saveArea[11] = INPORT32(&pIOPort->GPECON);
	saveArea[12] = INPORT32(&pIOPort->GPEDAT);
	saveArea[13] = INPORT32(&pIOPort->GPEUDP);
	saveArea[14] = INPORT32(&pIOPort->GPFCON);
	saveArea[15] = INPORT32(&pIOPort->GPFDAT);
	saveArea[16] = INPORT32(&pIOPort->GPFUDP);
	saveArea[17] = INPORT32(&pIOPort->GPGCON);
	saveArea[18] = INPORT32(&pIOPort->GPGDAT);
	saveArea[19] = INPORT32(&pIOPort->GPGUDP);
	saveArea[20] = INPORT32(&pIOPort->GPHCON);
	saveArea[21] = INPORT32(&pIOPort->GPHDAT);
	saveArea[22] = INPORT32(&pIOPort->GPHUDP);
	saveArea[23] = INPORT32(&pIOPort->GPJCON);
	saveArea[24] = INPORT32(&pIOPort->GPJDAT);
	saveArea[25] = INPORT32(&pIOPort->GPJUDP);

#if (BSP_TYPE == BSP_SMDK2443)
#ifdef EVT1
	saveArea[26] = INPORT32(&pIOPort->GPKCON);
	saveArea[27] = INPORT32(&pIOPort->GPKDAT);
	saveArea[28] = INPORT32(&pIOPort->DATAPDEN);
#else
	saveArea[26] = INPORT32(&pIOPort->GPKCON);
	saveArea[27] = INPORT32(&pIOPort->GPKDAT);
	saveArea[28] = INPORT32(&pIOPort->GPKUDP);
#endif
#elif (BSP_TYPE == BSP_SMDK2450)
	saveArea[26] = INPORT32(&pIOPort->GPKCON);
	saveArea[27] = INPORT32(&pIOPort->GPKDAT);
	saveArea[28] = INPORT32(&pIOPort->GPKUDP);
#endif	

	saveArea[29] = INPORT32(&pIOPort->GPLCON);
	saveArea[30] = INPORT32(&pIOPort->GPLDAT);
	saveArea[31] = INPORT32(&pIOPort->GPLUDP);
	saveArea[32] = INPORT32(&pIOPort->GPMCON);
	saveArea[33] = INPORT32(&pIOPort->GPMDAT);
	saveArea[34] = INPORT32(&pIOPort->GPMUDP);	

	saveArea[35] = INPORT32(&pIOPort->MISCCR);
	saveArea[36] = INPORT32(&pIOPort->DCLKCON);
#if (BSP_TYPE == BSP_SMDK2443)
#ifdef EVT1		
	saveArea[37] = READEXTINT0(pIOPort->EXTINT0);
	saveArea[38] = READEXTINT1(pIOPort->EXTINT1);
	saveArea[39] = READEXTINT2(pIOPort->EXTINT2);
#else
	saveArea[37] = INPORT32(&pIOPort->EXTINT0);
	saveArea[38] = INPORT32(&pIOPort->EXTINT1);
	saveArea[39] = INPORT32(&pIOPort->EXTINT2);
#endif	
#elif (BSP_TYPE == BSP_SMDK2450)
	saveArea[37] = INPORT32(&pIOPort->EXTINT0);
	saveArea[38] = INPORT32(&pIOPort->EXTINT1);
	saveArea[39] = INPORT32(&pIOPort->EXTINT2);
#endif	
	saveArea[40] = INPORT32(&pIOPort->EINTFLT0);
	saveArea[41] = INPORT32(&pIOPort->EINTFLT1);
	saveArea[42] = INPORT32(&pIOPort->EINTFLT2);
	saveArea[43] = INPORT32(&pIOPort->EINTFLT3);
	saveArea[44] = INPORT32(&pIOPort->EINTMASK);

#if (BSP_TYPE == BSP_SMDK2443)
	saveArea[45] = INPORT32(&pIntr->INTMOD);
	saveArea[46] = INPORT32(&pIntr->INTMSK);
#elif (BSP_TYPE == BSP_SMDK2450)
	saveArea[45] = INPORT32(&pIntr->INTMOD1);
	saveArea[46] = INPORT32(&pIntr->INTMSK1);
#endif

	saveArea[47] = INPORT32(&pIntr->INTSUBMSK);

	saveArea[48] = INPORT32(&pLCD->VIDCON0);
	saveArea[49] = INPORT32(&pLCD->VIDCON1);
	saveArea[50] = INPORT32(&pLCD->VIDTCON0);
	saveArea[51] = INPORT32(&pLCD->VIDTCON1);
	saveArea[52] = INPORT32(&pLCD->VIDTCON2);
	saveArea[53] = INPORT32(&pLCD->WINCON0);
	saveArea[54] = INPORT32(&pLCD->WINCON1);
	saveArea[55] = INPORT32(&pLCD->VIDOSD0A);
	saveArea[56] = INPORT32(&pLCD->VIDOSD0B);
	saveArea[57] = INPORT32(&pLCD->VIDOSD0C);
	saveArea[58] = INPORT32(&pLCD->VIDOSD1A);
	saveArea[59] = INPORT32(&pLCD->VIDOSD1B);
	saveArea[60] = INPORT32(&pLCD->VIDOSD1C);
	saveArea[61] = INPORT32(&pLCD->VIDW00ADD0B0);
	saveArea[62] = INPORT32(&pLCD->VIDW00ADD0B1);
	saveArea[63] = INPORT32(&pLCD->VIDW01ADD0);
	saveArea[64] = INPORT32(&pLCD->VIDW00ADD1B0);
	saveArea[65] = INPORT32(&pLCD->VIDW00ADD1B1);
	saveArea[66] = INPORT32(&pLCD->VIDW01ADD1);
	saveArea[67] = INPORT32(&pLCD->VIDW00ADD2B0);
	saveArea[68] = INPORT32(&pLCD->VIDW00ADD2B1);
	saveArea[69] = INPORT32(&pLCD->VIDW01ADD2);
	saveArea[70] = INPORT32(&pLCD->VIDINTCON);	
	saveArea[71] = INPORT32(&pLCD->W1KEYCON0);	
	saveArea[72] = INPORT32(&pLCD->W1KEYCON1);	
	saveArea[73] = INPORT32(&pLCD->W2KEYCON0);	
	saveArea[74] = INPORT32(&pLCD->W2KEYCON1);	
	saveArea[75] = INPORT32(&pLCD->W3KEYCON0);	
	saveArea[76] = INPORT32(&pLCD->W3KEYCON1);	
	saveArea[77] = INPORT32(&pLCD->W4KEYCON0);	
	saveArea[78] = INPORT32(&pLCD->W4KEYCON1);	
	saveArea[79] = INPORT32(&pLCD->WIN0MAP);	
	saveArea[80] = INPORT32(&pLCD->WIN1MAP);	
	saveArea[81] = INPORT32(&pLCD->WPALCON);		
	saveArea[82] = INPORT32(&pLCD->SYSIFCON0);	
	saveArea[83] = INPORT32(&pLCD->SYSIFCON1);	
	saveArea[84] = INPORT32(&pLCD->DITHMODE);		

#if (BSP_TYPE == BSP_SMDK2443)

#elif (BSP_TYPE == BSP_SMDK2450)
	saveArea[85] = INPORT32(&pIntr->INTMOD2);
	saveArea[86] = INPORT32(&pIntr->INTMSK2);
#endif
	pLCD->VIDCON0   = 0;
	pLCD->VIDCON1   = 0;
	pLCD->VIDTCON0   = 0;
	pLCD->VIDTCON1   = 0;
	pLCD->VIDTCON2   = 0;
	pLCD->WINCON0 = 0;
	pLCD->WINCON1 = 0;
	pLCD->VIDOSD0A = 0;
	pLCD->VIDOSD0B    = 0;
	pLCD->VIDOSD0C      = 0;
	pLCD->VIDW00ADD0B0      = 0;
	pLCD->VIDW00ADD1B0      = 0;
	pLCD->VIDW00ADD2B0      = 0;	
//	ConfigStopGPIO();

#define NEW_BSP_MODIFY 1
#if NEW_BSP_MODIFY
    //EVT3 For IROM Boot, GPC is retention in sleep mode
    pIOPort->GPCCON    &= ~(0x3f<<10);
    pIOPort->GPCUDP &= ~(0x3f<<10);
#endif	
    
	// Switch off power for KITL device
	//OALKitlPowerOff();  // woo 1021

	 //[david.modify] 2008-07-04 11:19
	 //====================================
		DPNOK(g_pBspArgs->u32WakeupHoldTime);
		ConfigSleepGPIO_david();
	//[david.modify] 2008-07-23 18:49
	// ½«´ËÐÐÄõô£¬²âÊÔ´ËÐÐÊÇ·ñÓ°Ï쵽˯ÃߺóTOUCH²»ºÃʹµÄÎÊÌâ
	  	ConfigMiscReg_david();			

		// clear interrupt pending register
		g_pIOPort->EINTPEND = g_pIOPort->EINTPEND;
		g_pIntrRegs->SUBSRCPND = g_pIntrRegs->SUBSRCPND;
		g_pIntrRegs->SRCPND1 = g_pIntrRegs->SRCPND1;
		g_pIntrRegs->INTPND1 = g_pIntrRegs->INTPND1;
 //====================================		

 //[david.modify] 2008-07-08 15:07
 // ¸Ä³ÉÖ§³Ö³¤°´»½ÐѺͶ̰´»½ÐÑ
	if(WAKEUP_MODE1_SHORTPRESS==g_pBspArgs->u32WakeUpMode){
		// Go to power off mode
		OALCPUPowerOff();
	}
	else/* if(WAKEUP_MODE2_LONGPRESS==g_pBspArgs->u32WakeUpMode)*/
	{
		do {			

			g_stGPIOInfo[4].u32Stat = 1;
			SetGPIOInfo(&g_stGPIOInfo[4], g_pIOPort);

 //[david.modify] 2008-08-04 12:33
 // ÓÃÓÚ¼ì²â˯ÂÇÇ°CHARGERÊDz»ÊÇÒѾ­²åÈëµÄ
 //=================================
     if (IsChargerIn())
    {
     //[david.modify] 2008-08-19 00:31
        g_bAcAdapterInBeforeSleep = TRUE;
	  //[david.modify] 2008-08-19 00:31
//        g_bAcAdapterInBeforeSleep = FALSE;
    }
    else
    {
        g_bAcAdapterInBeforeSleep = FALSE;
    }
//======================================	

			
			// Go to power off mode
			OALCPUPowerOff();
		}while(!OALBspWakeupCheck());		
	}
 

	// Switch on power for KITL device
	// OALKitlPowerOn();
	/* Recover Process, Load CPU Regs       */
#if (BSP_TYPE == BSP_SMDK2443)
#ifdef EVT1
#else
	OUTPORT32(&pIOPort->GPACON,   saveArea[0]);
	OUTPORT32(&pIOPort->GPADAT,   saveArea[1]);
#endif
#elif (BSP_TYPE == BSP_SMDK2450)

#endif	
	//OUTPORT32(&pIOPort->GPACON,   saveArea[0]);
	//OUTPORT32(&pIOPort->GPADAT,   saveArea[1]);
	OUTPORT32(&pIOPort->GPBCON,   saveArea[2]);
	OUTPORT32(&pIOPort->GPBDAT,   saveArea[3]);
	OUTPORT32(&pIOPort->GPBUDP,    saveArea[4]);
	OUTPORT32(&pIOPort->GPCCON,   saveArea[5]);
	OUTPORT32(&pIOPort->GPCDAT,   saveArea[6]);
	OUTPORT32(&pIOPort->GPCUDP,    saveArea[7]);
	OUTPORT32(&pIOPort->GPDCON,   saveArea[8]);
	OUTPORT32(&pIOPort->GPDDAT,   saveArea[9]);
	OUTPORT32(&pIOPort->GPDUDP,    saveArea[10]);
	OUTPORT32(&pIOPort->GPECON,   saveArea[11]);
	OUTPORT32(&pIOPort->GPEDAT,   saveArea[12]);
	OUTPORT32(&pIOPort->GPEUDP,    saveArea[13]);
	OUTPORT32(&pIOPort->GPFCON,   saveArea[14]);
	OUTPORT32(&pIOPort->GPFDAT,   saveArea[15]);
	OUTPORT32(&pIOPort->GPFUDP,    saveArea[16]);
	OUTPORT32(&pIOPort->GPGCON,   saveArea[17]);
	OUTPORT32(&pIOPort->GPGDAT,   saveArea[18]);
	OUTPORT32(&pIOPort->GPGUDP,    saveArea[19]);
	OUTPORT32(&pIOPort->GPHCON,   saveArea[20]);
	OUTPORT32(&pIOPort->GPHDAT,   saveArea[21]);
	OUTPORT32(&pIOPort->GPHUDP,    saveArea[22]);
	OUTPORT32(&pIOPort->GPJCON,   saveArea[23]);
	OUTPORT32(&pIOPort->GPJDAT,   saveArea[24]);
	OUTPORT32(&pIOPort->GPJUDP,    saveArea[25]);
#if (BSP_TYPE == BSP_SMDK2443)
#ifdef EVT1
	OUTPORT32(&pIOPort->GPKCON,   saveArea[26]);
	OUTPORT32(&pIOPort->GPKDAT,   saveArea[27]);
	OUTPORT32(&pIOPort->DATAPDEN,    saveArea[28]);
#else
	OUTPORT32(&pIOPort->GPKCON,   saveArea[26]);
	OUTPORT32(&pIOPort->GPKDAT,   saveArea[27]);
	OUTPORT32(&pIOPort->GPKUDP,    saveArea[28]);
#endif
#elif (BSP_TYPE == BSP_SMDK2450)
	OUTPORT32(&pIOPort->GPKCON,   saveArea[26]);
	OUTPORT32(&pIOPort->GPKDAT,   saveArea[27]);
	OUTPORT32(&pIOPort->GPKUDP,    saveArea[28]);
#endif	
	OUTPORT32(&pIOPort->GPLCON,   saveArea[29]);
	OUTPORT32(&pIOPort->GPLDAT,   saveArea[30]);
	OUTPORT32(&pIOPort->GPLUDP,    saveArea[31]);
	OUTPORT32(&pIOPort->GPMCON,   saveArea[32]);
	OUTPORT32(&pIOPort->GPMDAT,   saveArea[33]);
	OUTPORT32(&pIOPort->GPMUDP,    saveArea[34]);	
								
	OUTPORT32(&pIOPort->MISCCR,   saveArea[35]);
	OUTPORT32(&pIOPort->DCLKCON,   saveArea[36]);
	
	OUTPORT32(&pIOPort->EXTINT0,  saveArea[37]);
	OUTPORT32(&pIOPort->EXTINT1,  saveArea[38]);
	OUTPORT32(&pIOPort->EXTINT2,  saveArea[39]);
	
	OUTPORT32(&pIOPort->EINTFLT0, saveArea[40]);
	OUTPORT32(&pIOPort->EINTFLT1, saveArea[41]);
	OUTPORT32(&pIOPort->EINTFLT2, saveArea[42]);
	OUTPORT32(&pIOPort->EINTFLT3, saveArea[43]);
	OUTPORT32(&pIOPort->EINTMASK, saveArea[44]);

#if NEW_BSP_MODIFY
	// retention release 
	pCLKPWR->RSTCON |= (1<<16);	
#endif

#if (BSP_TYPE == BSP_SMDK2443)
	OUTPORT32(&pIntr->INTMOD,     saveArea[45]);
	OUTPORT32(&pIntr->INTMSK,     saveArea[46]); 
#elif (BSP_TYPE == BSP_SMDK2450)
	OUTPORT32(&pIntr->INTMOD1,     saveArea[45]);
	OUTPORT32(&pIntr->INTMSK1,     saveArea[46]); 
#endif
	OUTPORT32(&pIntr->INTSUBMSK,  saveArea[47]);

//	InitDisplay2();	

	pLCD->VIDCON0    		=  saveArea[48]; 
	pLCD->VIDCON1 			=  saveArea[49];
	pLCD->VIDTCON0      		=  saveArea[50]; 
	pLCD->VIDTCON1  		=  saveArea[51]; 
	pLCD->VIDTCON2   		=  saveArea[52]; 
	pLCD->WINCON0  		=  saveArea[53];
	pLCD->WINCON1    		=  saveArea[54]; 
	pLCD->VIDOSD0A 		=  saveArea[55]; 
	pLCD->VIDOSD0B 		=  saveArea[56]; 
	pLCD->VIDOSD0C 		=  saveArea[57]; 
	pLCD->VIDOSD1A  		=  saveArea[58]; 
	pLCD->VIDOSD1B   		=  saveArea[59]; 
	pLCD->VIDOSD1C			=  saveArea[60]; 
	pLCD->VIDW00ADD0B0   	=  saveArea[61]; 
	pLCD->VIDW00ADD0B1  	=  saveArea[62];
	pLCD->VIDW01ADD0		=  saveArea[63];
	pLCD->VIDW00ADD1B0	=  saveArea[64];
	pLCD->VIDW00ADD1B1	=  saveArea[65];
	pLCD->VIDW01ADD1		=  saveArea[66];
	pLCD->VIDW00ADD2B0	=  saveArea[67];
	pLCD->VIDW00ADD2B1	=  saveArea[68];
	pLCD->VIDW01ADD2		=  saveArea[69];
	pLCD->VIDINTCON		=  saveArea[70]; 
	pLCD->W1KEYCON0		=  saveArea[71];
	pLCD->W1KEYCON1		=  saveArea[72];
	pLCD->W2KEYCON0		=  saveArea[73];
	pLCD->W2KEYCON1		=  saveArea[74];
	pLCD->W3KEYCON0		=  saveArea[75];
	pLCD->W3KEYCON1		=  saveArea[76];
	pLCD->W4KEYCON0		=  saveArea[77];
	pLCD->W4KEYCON1		=  saveArea[78];
	pLCD->WIN0MAP			=  saveArea[79];
	pLCD->WIN1MAP			=  saveArea[80];
	pLCD->WPALCON			=  saveArea[81];
	pLCD->SYSIFCON0		=  saveArea[82];
	pLCD->SYSIFCON1		=  saveArea[83];
	pLCD->DITHMODE			=  saveArea[84];

	 //[david.modify] 2008-06-19 15:21
//===========================	
#if 0

	delayLoop(100*LCD_DELAY_1MS);
#endif
//===========================

#if (BSP_TYPE == BSP_SMDK2443)

#elif (BSP_TYPE == BSP_SMDK2450)
	OUTPORT32(&pIntr->INTMOD2,     saveArea[85]);
	OUTPORT32(&pIntr->INTMSK2,     saveArea[86]); 
#endif



	pCLKPWR->RSTCON 	|= pCLKPWR->RSTCON;		// This is for control GPIO pads.	


#if (BSP_TYPE == BSP_SMDK2443)
	/* Interrupt Clear                      */
	//OUTPORT32(&pIOPort->EINTPEND, INPORT32(&pIOPort->EINTPEND));
	//OUTPORT32(&pIntr->SUBSRCPND, INPORT32(&pIntr->SUBSRCPND));

#elif (BSP_TYPE == BSP_SMDK2450)
	/* Interrupt Clear                      */
	OUTPORT32(&pIOPort->EINTPEND, INPORT32(&pIOPort->EINTPEND));
	OUTPORT32(&pIntr->SUBSRCPND, INPORT32(&pIntr->SUBSRCPND));
		/* Interrupt Clear                      */
	//OUTPORT32(&pIntr->SRCPND, INPORT32(&pIntr->SRCPND));
	//OUTPORT32(&pIntr->INTPND, INPORT32(&pIntr->INTPND));

#endif	

	//    pLCD->LCDSRCPND = pLCD->LCDSRCPND;
	//    pLCD->LCDINTPND = pLCD->LCDINTPND;

	// Do platform dependent power on actions
	
	BSPPowerOn();
	
}