BOOL OEMKitlStartup (void) { g_pX86KitlInfo = (PX86KITLINFO) g_pOemGlobal->pKitlInfo; g_pX86Info = g_pX86KitlInfo->pX86Info; g_pOemGlobal->pfnKDIoctl = OEMKDIoControl; // start KITL OALKitlStart (); return TRUE; }
//------------------------------------------------------------------------------ // // Function: OEMInit // // This is Windows CE OAL initialization function. It is called from kernel // after basic initialization is made. // void OEMInit() { UINT32 logMask_Backup; extern DWORD CEProcessorType; // From nkarm.h in the private tree. //volatile S3C6410_VIC_REG *pIntr = (S3C6410_VIC_REG*)OALPAtoVA(S3C6410_BASE_REG_PA_VIC0, FALSE); //NKForceCleanBoot(); OALMSG(OAL_FUNC, (L"[OAL] ++OEMInit()\r\n")); OALMSG(TRUE, (L"[OAL] ++OEMInit()\r\n")); OALMSG(OAL_FUNC, ((L"[OAL] APLLCLK : %d\n\r"), System_GetAPLLCLK())); OALMSG(OAL_FUNC, ((L"[OAL] ARMCLK : %d\n\r"), System_GetARMCLK())); OALMSG(OAL_FUNC, ((L"[OAL] HCLK : %d\n\r"), System_GetHCLK())); OALMSG(OAL_FUNC, ((L"[OAL] PCLK : %d\n\r"), System_GetPCLK())); g_oalIoCtlClockSpeed = System_GetARMCLK(); // Lie about the Processor Type (we do this so that the visual C tools work) CEProcessorType = PROCESSOR_STRONGARM; logMask_Backup = g_oalLogMask; OALLogSetZones( (1<<OAL_LOG_ERROR) | (1<<OAL_LOG_WARN) | (1<<OAL_LOG_FUNC) ); RETAILMSG(TRUE, (TEXT("CEProcessorType = 0x%x\r\n"),CEProcessorType)); RETAILMSG(TRUE, (TEXT("APLLCLK: %d, FCLK: %d, HCLK: %d, PCLK: %d\r\n"), System_GetAPLLCLK(), System_GetARMCLK(), System_GetHCLK(), System_GetPCLK())); // Set memory size for DrWatson kernel support if (dwOEMDrWatsonSize != NOT_FIXEDUP) { dwNKDrWatsonSize = dwOEMDrWatsonSize; // set size of reserved memory for Watson dump } // Intialize optional kernel functions. (Processor Extended Feature) // pOEMIsProcessorFeaturePresent = OALIsProcessorFeaturePresent; // Set OEMSetMemoryAttributes function pfnOEMSetMemoryAttributes = OEMSetMemoryAttributes; // Turn Off all Debug LED // OEMWriteDebugLED(0, 0x0); // Initialize INFORM SFR // This function should be called for CPU Identification. InitializeINFORMSFR(); // Initialize Clock Source // InitializeCLKSource(); // Initialize Clock Gating // InitializeCLKGating(); // Initialize Block Power // InitializeBlockPower(); // Initialize OTG PHY Clock // InitializeOTGCLK(); // Initilize cache globals OALCacheGlobalsInit(); OALLogSerial( L"DCache: %d sets, %d ways, %d line size, %d size\r\n", g_oalCacheInfo.L1DSetsPerWay, g_oalCacheInfo.L1DNumWays, g_oalCacheInfo.L1DLineSize, g_oalCacheInfo.L1DSize ); OALLogSerial( L"ICache: %d sets, %d ways, %d line size, %d size\r\n", g_oalCacheInfo.L1ISetsPerWay, g_oalCacheInfo.L1INumWays, g_oalCacheInfo.L1ILineSize, g_oalCacheInfo.L1ISize ); // Initialize Interrupts // if (!OALIntrInit()) { OALMSG(OAL_ERROR, (L"[OAL:ERR] OEMInit() : failed to initialize interrupts\r\n")); } // Initialize system clock OALTimerInit(RESCHED_PERIOD, OEM_COUNT_1MS, 0); // Initialize GPIO // InitializeGPIO(); // Initialize the KITL connection if required RETAILMSG(1, (TEXT("OALKitlStart() \n\r"))); OALKitlStart(); Init_BspArgs(); OALMSG(OAL_FUNC, (L"-OEMInit\r\n")); OALLogSetZones(logMask_Backup); }