Exemplo n.º 1
0
void spi_Open(void)
{
    HANDLE hGPIO;
    hGPIO = GPIOOpen(); 
    //Set the initialize status of each SPI interface, Ray 13-09-23
    GPIOSetBit(hGPIO, SPI_CS0_PIN);
    GPIOSetBit(hGPIO, SPI_CLK_PIN);
    GPIOSetBit(hGPIO, SPI_DOUT_PIN);

    GPIOClose(hGPIO);
}
Exemplo n.º 2
0
//------------------------------------------------------------------------------
//
//  Function:  configure_dss
//
//  This function configures the Display Sub System on omap35xx
//
void configure_dss( UINT32 framebuffer )
{
    OMAP_DSS_REGS   *pDSSRegs = OALPAtoUA(OMAP_DSS1_REGS_PA);
    OMAP_DISPC_REGS *pDisplayRegs = OALPAtoUA(OMAP_DISC1_REGS_PA);
    HANDLE hGpio = GPIOOpen();

    // OALMSG(OAL_INFO, (L"configure_dss+\r\n"));

    //  Configure the clock source
    OUTREG32( &pDSSRegs->DSS_CONTROL, 
                DSS_CONTROL_DISPC_CLK_SWITCH_DSS1_ALWON |
                DSS_CONTROL_DSI_CLK_SWITCH_DSS1_ALWON
                );
    
    //  Configure interconnect parameters
    OUTREG32( &pDSSRegs->DSS_SYSCONFIG, DISPC_SYSCONFIG_AUTOIDLE );
    OUTREG32( &pDisplayRegs->DISPC_SYSCONFIG, DISPC_SYSCONFIG_AUTOIDLE|SYSCONFIG_NOIDLE|SYSCONFIG_NOSTANDBY );

    // Not enabling any interrupts
    OUTREG32( &pDisplayRegs->DISPC_IRQENABLE, 0x00000000 );
    
    
    //  Configure the LCD
    LcdPdd_LCD_Initialize( pDSSRegs, pDisplayRegs, NULL, NULL);
    	
    //  Over-ride default LCD config
    OUTREG32(&pDisplayRegs->DISPC_CONFIG,BSP_LCD_CONFIG);
    
    
    // Configure Graphics Window
    //--------------------------
    
    OUTREG32(&pDisplayRegs->DISPC_GFX_BA0 ,framebuffer );
 
    // configure the position of graphics window
    OUTREG32(&pDisplayRegs->DISPC_GFX_POSITION,BSP_GFX_POS);
    
    // size of graphics window
    OUTREG32(&pDisplayRegs->DISPC_GFX_SIZE,BSP_GFX_SIZE);
    
    // GW Enabled, RGB24 packed, Little Endian
    OUTREG32(&pDisplayRegs->DISPC_GFX_ATTRIBUTES,LOGO_GFX_ATTRIBUTES);
    
    OUTREG32(&pDisplayRegs->DISPC_GFX_FIFO_THRESHOLD,BSP_GFX_FIFO_THRESHOLD);
    OUTREG32(&pDisplayRegs->DISPC_GFX_ROW_INC,BSP_GFX_ROW_INC); 
    OUTREG32(&pDisplayRegs->DISPC_GFX_PIXEL_INC,BSP_GFX_PIXEL_INC); 
    OUTREG32(&pDisplayRegs->DISPC_GFX_WINDOW_SKIP,BSP_GFX_WINDOW_SKIP);

    // OALMSG(OAL_INFO, (L"configure_dss-\r\n"));

	GPIOClose(hGpio);
}
Exemplo n.º 3
0
void spi_Low(void)
{
    //DWORD dTime = 5000000;

    HANDLE hGPIO;
    hGPIO = GPIOOpen(); 
    //Set the initialize status of each SPI interface, Ray 13-09-23
    GPIOClrBit(hGPIO, SPI_CS0_PIN);
    GPIOClrBit(hGPIO, SPI_CLK_PIN);
    GPIOClrBit(hGPIO, SPI_DOUT_PIN);

    //LcdStall(dTime);
    GPIOClose(hGPIO); 
}
Exemplo n.º 4
0
//------------------------------------------------------------------------------
//
//  Set up the "MCSPI1" function active, Ray 13-09-23
//
void spiWrBitHigh(void)
{
    DWORD delay = 10;
    HANDLE hGPIO;
    hGPIO = GPIOOpen(); 

    GPIOSetBit(hGPIO, SPI_DOUT_PIN);

    GPIOClrBit(hGPIO, SPI_CLK_PIN);
    LcdStall(delay);
    GPIOSetBit(hGPIO, SPI_CLK_PIN);
    LcdStall(delay);
    GPIOClrBit(hGPIO, SPI_CLK_PIN);
    GPIOClose(hGPIO); 
}
Exemplo n.º 5
0
void I2C3_Low(void)
{
    HANDLE hGPIO;
    hGPIO = GPIOOpen();
    GPIOClrBit(hGPIO, I2C3_SCL_GPIO);
    GPIOClrBit(hGPIO, I2C3_SDA_GPIO);

    /*HANDLE hI2C; 
    hI2C = I2COpen(OMAP_DEVICE_I2C3);
    GPIOSetBit(hI2C, I2C3_SCL_GPIO);
    GPIOSetBit(hI2C, I2C3_SDA_GPIO);*/

    LcdStall(dTime);
    GPIOClose(hGPIO);
    //I2CClose(hI2C);
}
Exemplo n.º 6
0
void spi_SendData(short iSendData)
{
    HANDLE hGPIO;
    short iCount = 0;
	
	hGPIO = GPIOOpen();
	GPIOClrBit(hGPIO, SPI_CS0_PIN);
    for(iCount=8; iCount>=0; iCount--)
    {
		if(iSendData & (1<<iCount)) 
			spiWrBitHigh();
		else 
			spiWrBitLow();
	}
	GPIOSetBit(hGPIO, SPI_CS0_PIN);
}
Exemplo n.º 7
0
void spiWrBitLow(void)
{
    int delay = 10;
    HANDLE hGPIO;
    hGPIO = GPIOOpen(); 
    
    GPIOClrBit(hGPIO, SPI_DOUT_PIN);

    GPIOClrBit(hGPIO, SPI_CLK_PIN);
    LcdStall(delay);
    //LcdStall(10);
    GPIOSetBit(hGPIO, SPI_CLK_PIN);
    LcdStall(delay);
    //LcdStall(10);
    GPIOClrBit(hGPIO, SPI_CLK_PIN);
    GPIOClose(hGPIO); 
}
Exemplo n.º 8
0
int _tmain(int argc, TCHAR *argv[], TCHAR *envp[])
{
    DWORD id = 168;
    if (argc == 2)
    {
        id = _wtoi(argv[1]);
    }
    _tprintf(_T("Hello World!\n"));
#if 0
    DWORD config[2] = {id,GPIO_DIR_OUTPUT};

    HANDLE h = CreateFile(L"GIO1:",0,0,NULL,OPEN_EXISTING,0,NULL);
    DeviceIoControl(h,IOCTL_GPIO_SETMODE,config,sizeof(config),NULL,0,NULL,NULL);

    for (;;)
    {
        DeviceIoControl(h,IOCTL_GPIO_SETBIT,config,sizeof(config),NULL,0,NULL,NULL);
        Sleep(10);
        DeviceIoControl(h,IOCTL_GPIO_CLRBIT,config,sizeof(config),NULL,0,NULL,NULL);
        Sleep(10);
    }
    CloseHandle(h);
#else
    HANDLE h = GPIOOpen();
    GPIOSetMode(h,id,GPIO_DIR_OUTPUT);
    for (;;)
    {
        GPIOSetBit(h,id);
        Sleep(10);
        GPIOClrBit(h,id);
        Sleep(10);
    }
    GPIOClose(h);
#endif
    return 0;
}
Exemplo n.º 9
0
//------------------------------------------------------------------------------
//
//  Function:  HDS_Init
//
//  Called by device manager to initialize device.
//
DWORD
HDS_Init(
    LPCTSTR szContext,
    LPCVOID pBusContext
    )
{
    DWORD rc = (DWORD)NULL;
    HeadsetDevice_t *pDevice = NULL;

	UNREFERENCED_PARAMETER(pBusContext);

    DEBUGMSG(ZONE_FUNCTION, (
        L"+HDS_Init(%s, 0x%08x)\r\n", szContext, pBusContext
        ));

    // Create device structure
    pDevice = (HeadsetDevice_t *)LocalAlloc(LPTR, sizeof(HeadsetDevice_t));
    if (pDevice == NULL)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: HDS_Init: "
            L"Failed allocate HDS driver structure\r\n"
            ));
        goto cleanUp;
        }

    // initialize memory
    //
    memset(pDevice, 0, sizeof(HeadsetDevice_t));

    // Set cookie & initialize critical section
    pDevice->cookie = HDS_DEVICE_COOKIE;

    // Initialize crit section
    InitializeCriticalSection(&pDevice->cs);

    // Read device parameters
    if (GetDeviceRegistryParams(
            szContext, pDevice, dimof(s_deviceRegParams), s_deviceRegParams)
            != ERROR_SUCCESS)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: HDS_Init: "
            L"Failed read HDS driver registry parameters\r\n"
            ));
        goto cleanUp;
        }

    // Open WAV device
    pDevice->hWAV = CreateFile(L"WAV1:", GENERIC_READ | GENERIC_WRITE, 0,
                        NULL, OPEN_EXISTING, 0, NULL);

    if (pDevice->hWAV == INVALID_HANDLE_VALUE)
        {
        pDevice->hWAV = NULL;
        DEBUGMSG(ZONE_WARN,
            (L"WARN: HDS_Init: Failed open WAV1: device driver\r\n"));
        }

    // Open GPIO bus
    pDevice->hGPIO = GPIOOpen();
    if (pDevice->hGPIO == NULL)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: HDS_Init: "
            L"Failed open GPIO bus driver\r\n"
            ));
        goto cleanUp;
        }

    // Configure GPIO mute as output high
    GPIOSetMode(pDevice->hGPIO, pDevice->hdstMuteGpio, GPIO_DIR_OUTPUT);
    GPIOSetBit(pDevice->hGPIO, pDevice->hdstMuteGpio);

    // Note that the headset detect GPIO pullup and pulldown configuration
    // is not handled in the \src\boot\twl4030\bsp_twl4020.c file

    // Configure GPIO headset as input with both edge interrupts
    GPIOSetMode(pDevice->hGPIO, pDevice->hdstDetGpio,
        GPIO_DIR_INPUT | GPIO_INT_LOW_HIGH | GPIO_INT_HIGH_LOW);

    // update plugged-in field
    pDevice->bPluggedIn = (BOOL)GPIOGetBit(pDevice->hGPIO,
        pDevice->hdstDetGpio);

    // Create interrupt event
    pDevice->hIntrEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    if (pDevice->hIntrEvent == NULL)
        {
        DEBUGMSG(ZONE_ERROR, (L"ERROR: HDS_Init: "
            L"Failed create interrupt event\r\n"
            ));
        goto cleanUp;
        }

    // Associate event with TWL headset interrupt
    if (!GPIOInterruptInitialize(pDevice->hGPIO, pDevice->hdstDetGpio,
		&pDevice->dwSysIntr, pDevice->hIntrEvent))
        {
        DEBUGMSG (ZONE_ERROR, (L"ERROR: HDS_Init: "
            L"Failed associate event with TWL headset interrupt\r\n"
            ));
        goto cleanUp;
        }

    // Start interrupt service thread
    pDevice->intrThreadExit = FALSE;
    pDevice->hIntrThread = CreateThread(
        NULL, 0, HDS_IntrThread, pDevice, 0,NULL
        );
    if (!pDevice->hIntrThread)
        {
        DEBUGMSG (ZONE_ERROR, (L"ERROR: HDS_Init: "
            L"Failed create interrupt thread\r\n"
            ));
        goto cleanUp;
        }

    // Set thread priority
    CeSetThreadPriority(pDevice->hIntrThread, pDevice->priority256);

    // Return non-null value
    rc = (DWORD)pDevice;

cleanUp:
    if (rc == 0)
        {
        HDS_Deinit((DWORD)pDevice);
        }
    DEBUGMSG(ZONE_FUNCTION, (L"-HDS_Init(rc = %d\r\n", rc));
    return rc;
}
Exemplo n.º 10
0
//------------------------------------------------------------------------------
//
//  Function:  OEMPlatformInit
//
//  This function provide platform initialization functions. It is called
//  from boot loader after OEMDebugInit is called.  Note that boot loader
//  BootloaderMain is called from  s/init.s code which is run after reset.
//
BOOL 
OEMPlatformInit(
    )
{
    OMAP_GPTIMER_REGS *pTimerRegs;
    UINT32 CpuRevision, version;
    HANDLE hTwl,hGPIO;
    static UCHAR allocationPool[512];
    static const PAD_INFO ebootPinMux[] = {
            DSS_PADS
            GPIO_PADS
			USBOTG_PADS
            END_OF_PAD_ARRAY
    };
    static const PAD_INFO ebootPinMux_37XX[] = {
            DSS_PADS_37XX
            GPIO_PADS_37XX
	     	USBOTG_PADS
            END_OF_PAD_ARRAY
    };
    
    OALLocalAllocInit(allocationPool,sizeof(allocationPool));

    // Get processor and companion chip versions
	g_CPUFamily = CPU_FAMILY_OMAP35XX;
    CpuRevision = Get_CPUVersion();
    version = CPU_REVISION(CpuRevision);
    g_CPUFamily = CPU_FAMILY(CpuRevision);

	// Set GPTIMER1 regs pointer
	pTimerRegs = OALPAtoUA(OMAP_GPTIMER1_REGS_PA);

    if(g_CPUFamily == CPU_FAMILY_DM37XX)
    {
        ConfigurePadArray(ebootPinMux_37XX);
    }
    else
    {
        ConfigurePadArray(ebootPinMux);
    }
    //OALLogSetZones( 
    //           (1<<OAL_LOG_VERBOSE)  |
    //           (1<<OAL_LOG_INFO)     |
    //           (1<<OAL_LOG_ERROR)    |
    //           (1<<OAL_LOG_WARN)     |
    //           (1<<OAL_LOG_FUNC)     |
    //           (1<<OAL_LOG_IO)     |
    //           0);

    OALLog(
        L"\r\nTexas Instruments Windows CE EBOOT for OMAP35xx/37xx, "
        L"Built %S at %S\r\n", __DATE__, __TIME__
        );
    OALLog(
        L"EBOOT Version %d.%d, BSP " BSP_VERSION_STRING L"\r\n", 
        EBOOT_VERSION_MAJOR, EBOOT_VERSION_MINOR        
        );

    // Soft reset GPTIMER1
    OUTREG32(&pTimerRegs->TIOCP, SYSCONFIG_SOFTRESET);
    // While until done
    while ((INREG32(&pTimerRegs->TISTAT) & GPTIMER_TISTAT_RESETDONE) == 0);
    // Enable posted mode
    OUTREG32(&pTimerRegs->TSICR, GPTIMER_TSICR_POSTED);
    // Start timer
    OUTREG32(&pTimerRegs->TCLR, GPTIMER_TCLR_AR|GPTIMER_TCLR_ST);
    
	// Enable device clocks used by the bootloader
    EnableDeviceClocks(OMAP_DEVICE_GPIO1,TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO2,TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO3,TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO4,TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO5,TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO6,TRUE);

    // configure i2c devices
    OALI2CInit(OMAP_DEVICE_I2C1);
    OALI2CInit(OMAP_DEVICE_I2C2);
    OALI2CInit(OMAP_DEVICE_I2C3);

    GPIOInit();
    // Note that T2 accesses must occur after I2C initialization
    hTwl = TWLOpen();
    hGPIO = GPIOOpen(); 
    
    
    // Clear Reset on ethernet controller        
    GPIOSetBit(hGPIO,LAN9115_RESET_GPIO);            
    GPIOSetMode(hGPIO, LAN9115_RESET_GPIO,GPIO_DIR_OUTPUT);

	//rst usb hub
	GPIOClrBit(hGPIO,13);            
    GPIOSetMode(hGPIO, 13,GPIO_DIR_OUTPUT);
	OALStall(10000);
	GPIOSetBit(hGPIO,13);
	OALStall(1000);
	GPIOClrBit(hGPIO,13);  

    

    OALLog(L"\r\nTI OMAP%x Version 0x%08x (%s)\r\n", CPU_ID(CpuRevision), CPU_REVISION(CpuRevision),        
        version == CPU_FAMILY_35XX_REVISION_ES_1_0 ? L"ES1.0" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_0 ? L"ES2.0" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_1 ? L"ES2.1" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_0_CRC ? L"ES2.0, ID determined using CRC" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_1_CRC ? L"ES2.1, ID determined using CRC" :
        version == CPU_FAMILY_35XX_REVISION_ES_3_0 ? L"ES3.0" :
        version == CPU_FAMILY_35XX_REVISION_ES_3_1 ? L"ES3.1" : 
        version == CPU_FAMILY_37XX_REVISION_ES_1_0? L"ES1.0" :
        version == CPU_FAMILY_37XX_REVISION_ES_1_1? L"ES1.1" :
        version == CPU_FAMILY_37XX_REVISION_ES_1_2? L"ES1.2" :
        L"Unknown" );  
    /* Initialize Device Prefix */
    if(g_CPUFamily == CPU_FAMILY_DM37XX)
    {
        gDevice_prefix = BSP_DEVICE_37xx_PREFIX;
    }
    else if (g_CPUFamily == CPU_FAMILY_OMAP35XX)
    {
        gDevice_prefix = BSP_DEVICE_35xx_PREFIX;
    }
    else
    {
        OALLog(L"INFO: UnKnown CPU family:%d....\r\n", g_CPUFamily);
        gDevice_prefix = BSP_DEVICE_35xx_PREFIX;
    }

    version = TWLReadIDCode(hTwl);

    OALLog(L"TPS659XX Version 0x%02x (%s)\r\n", version,
        version == 0x00 ? L"ES1.0" : 
        version == 0x10 ? L"ES1.1" : 
        version == 0x20 ? L"ES1.2" : 
        version == 0x30 ? L"ES1.3" : L"Unknown" );
		
    g_ecctype = (UCHAR)dwEbootECCtype;

    // Done
    return TRUE;
}
Exemplo n.º 11
0
//------------------------------------------------------------------------------
//
//  Function:  OEMPlatformInit
//
//  This function provide platform initialization functions. It is called
//  from boot loader after OEMDebugInit is called.  Note that boot loader
//  BootloaderMain is called from  s/init.s code which is run after reset.
//
BOOL OEMPlatformInit()
{
    OMAP_GPTIMER_REGS *pTimerRegs;
    UINT32 CpuRevision, version;
    HANDLE hTwl,hGPIO;
    static UCHAR allocationPool[512];
    
    /*static const PAD_INFO ebootPinMux[] = {
            DSS_PADS
            GPIO_PADS
			USBOTG_PADS
            END_OF_PAD_ARRAY
    };*/
    static const PAD_INFO ebootPinMux_37XX[] = 
    {
            DSS_PADS_37XX
            GPIO_PADS_37XX
	     	USBOTG_PADS
	     	MCSPI1_PADS                     //Addition to MCSPI1 functional, Ray 13-09-24
            I2C3_PADS                       //Addition to MCSPI1 functional, Ray 13-10-21
            END_OF_PAD_ARRAY
    };
    
    OALLocalAllocInit(allocationPool, sizeof(allocationPool));

    // Get processor and companion chip versions
	g_CPUFamily = CPU_FAMILY_OMAP35XX;
    CpuRevision = Get_CPUVersion();
    version = CPU_REVISION(CpuRevision);
    g_CPUFamily = CPU_FAMILY(CpuRevision);

	// Set GPTIMER1 regs pointer
	pTimerRegs = OALPAtoUA(OMAP_GPTIMER1_REGS_PA);

    //if(g_CPUFamily == CPU_FAMILY_DM37XX)
    //{
	ConfigurePadArray(ebootPinMux_37XX);
    //}
    //else
    //{
    //    ConfigurePadArray(ebootPinMux);
    //}

    OALLog(L"ZEBEX Windows CE EBOOT for Z-2170 plus - Ray Testing"		//Ray 13-07-31 
	//OALLog(L"ZEBEX Windows CE EBOOT for Z-2170 plus - Brain"		
        L"\r\nBuilt %S at %S\r\n", __DATE__, __TIME__ );
    /*OALLog(
        L"EBOOT Version %d.%d, BSP " BSP_VERSION_STRING L"\r\n", 
        EBOOT_VERSION_MAJOR, EBOOT_VERSION_MINOR        
        );*/

    // Soft reset GPTIMER1
    OUTREG32(&pTimerRegs->TIOCP, SYSCONFIG_SOFTRESET);
    // While until done
    while ((INREG32(&pTimerRegs->TISTAT) & GPTIMER_TISTAT_RESETDONE) == 0)
    	;
 
    // Enable posted mode
    OUTREG32(&pTimerRegs->TSICR, GPTIMER_TSICR_POSTED);
    // Start timer
    OUTREG32(&pTimerRegs->TCLR, GPTIMER_TCLR_AR|GPTIMER_TCLR_ST);
    
	// Enable device clocks used by the bootloader
    EnableDeviceClocks(OMAP_DEVICE_GPIO1, TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO2, TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO3, TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO4, TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO5, TRUE);
    EnableDeviceClocks(OMAP_DEVICE_GPIO6, TRUE);

    // configure i2c devices
    OALI2CInit(OMAP_DEVICE_I2C1);
    OALI2CInit(OMAP_DEVICE_I2C2);
    OALI2CInit(OMAP_DEVICE_I2C3);

    GPIOInit();
    // Note that T2 accesses must occur after I2C initialization
    hTwl = TWLOpen();
    hGPIO = GPIOOpen(); 
    
    
    // Clear Reset on ethernet controller        
    //GPIOSetBit(hGPIO,LAN9115_RESET_GPIO);            
    //GPIOSetMode(hGPIO, LAN9115_RESET_GPIO,GPIO_DIR_OUTPUT);
	// test GPIO 
	GPIOClrBit(hGPIO, 136); 	// VIBRATOR
	GPIOSetMode(hGPIO, 136, GPIO_DIR_OUTPUT);
    GPIOClrBit(hGPIO, 16); 		// WLAN_EN
	GPIOSetMode(hGPIO, 16, GPIO_DIR_OUTPUT);
	GPIOClrBit(hGPIO, 15); 		// BT_EN
	GPIOSetMode(hGPIO, 15, GPIO_DIR_OUTPUT);
	GPIOSetBit(hGPIO, 61); 		// BACKLIGHT_EN, Ray
	GPIOSetMode(hGPIO, 61, GPIO_DIR_OUTPUT);

	//Initialization Side key GPIO, Ray 13-08-12
	GPIOSetMode(hGPIO, 114, GPIO_DIR_INPUT);     // SIDE_KEY1(KEY_2_4)
	GPIOSetMode(hGPIO, 115, GPIO_DIR_INPUT);     // SIDE_KEY3(KEY_1_4)

	//Initialization the "MC serial port interface (SPI1)" buses, Ray 13-09-24
    GPIOSetMode(hGPIO, SPI_CS0_PIN, GPIO_DIR_OUTPUT);
    GPIOSetMode(hGPIO, SPI_CLK_PIN, GPIO_DIR_OUTPUT);
    GPIOSetMode(hGPIO, SPI_DOUT_PIN, GPIO_DIR_OUTPUT);
    GPIOSetMode(hGPIO, SPI_DIN_PIN, GPIO_DIR_INPUT);

    //Initialization the "I-suqare-c (i2c3)" buses, Ray 13-10-07
    /*GPIOSetMode(hGPIO, I2C3_SCL_GPIO, INPUT_ENABLED);
    GPIOSetMode(hGPIO, I2C3_SDA_GPIO, INPUT_ENABLED);*/

    /*GPIOSetBit(hGPIO, I2C3_SCL_GPIO); 
    GPIOSetMode(hGPIO, I2C3_SCL_GPIO, GPIO_DIR_OUTPUT);
    GPIOSetBit(hGPIO, I2C3_SDA_GPIO); 
    GPIOSetMode(hGPIO, I2C3_SDA_GPIO, GPIO_DIR_OUTPUT);*/
    

   
	//SPI LCM setup
	/*XX
	GPIOSetBit(hGPIO,184); // PCM_EN serial clock 
	GPIOSetMode(hGPIO, 184, GPIO_PULLUP_ENABLE);
	//GPIOSetMode(hGPIO, 184, GPIO_DIR_OUTPUT);

	GPIOSetBit(hGPIO,185); // PCM_EN serial data
	GPIOSetMode(hGPIO, 185, GPIO_PULLUP_ENABLE);
	//GPIOSetMode(hGPIO, 185, GPIO_DIR_OUTPUT);*/


     OALLog(L"\r\nTI OMAP%x Version 0x%08x (%s)\r\n", CPU_ID(CpuRevision), CPU_REVISION(CpuRevision),        
        version == CPU_FAMILY_35XX_REVISION_ES_1_0 ? L"ES1.0" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_0 ? L"ES2.0" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_1 ? L"ES2.1" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_0_CRC ? L"ES2.0, ID determined using CRC" :
        version == CPU_FAMILY_35XX_REVISION_ES_2_1_CRC ? L"ES2.1, ID determined using CRC" :
        version == CPU_FAMILY_35XX_REVISION_ES_3_0 ? L"ES3.0" :
        version == CPU_FAMILY_35XX_REVISION_ES_3_1 ? L"ES3.1" : 
        version == CPU_FAMILY_37XX_REVISION_ES_1_0? L"ES1.0" :
        version == CPU_FAMILY_37XX_REVISION_ES_1_1? L"ES1.1" :
        version == CPU_FAMILY_37XX_REVISION_ES_1_2? L"ES1.2" :
        L"Unknown" );  

    /* Initialize Device Prefix */
    if(g_CPUFamily == CPU_FAMILY_DM37XX)
    {
        gDevice_prefix = BSP_DEVICE_37xx_PREFIX;
    }
    else if (g_CPUFamily == CPU_FAMILY_OMAP35XX)
    {
        gDevice_prefix = BSP_DEVICE_35xx_PREFIX;
    }
    else
    {
        OALLog(L"INFO: UnKnown CPU family:%d....\r\n", g_CPUFamily);
        gDevice_prefix = BSP_DEVICE_35xx_PREFIX;
    }

    version = TWLReadIDCode(hTwl);

    OALLog(L"TPS659XX Version 0x%02x (%s)\r\n", version,
        version == 0x00 ? L"ES1.0" : 
        version == 0x10 ? L"ES1.1" : 
        version == 0x20 ? L"ES1.2" : 
        version == 0x30 ? L"ES1.3" : L"Unknown" );
		
    g_ecctype = (UCHAR)dwEbootECCtype;

    // Done
    return TRUE;
}