📄 cfw_platform.c
字号:
/*
* Set up translation constant for GetIdleTime() (1 ms units).
*
* Note: Since curridlehigh, curridlelow is counting in ms, and
* GetIdleTime() reports in ms, the conversion ratio is one. If
* curridlehigh, curridlelow were using other units (like ticks),
* then the conversion would be calculated from the clock frequency.
*/
idleconv = 1;
//dpCurSettings.ulZoneMask = 0x8100; //20 turn on loader zones
/*
* Initialize timer used for delays in the HAL.
*/
#ifdef DEBUG
NKDbgPrintfW(TEXT("Initialize timer used for delays")
TEXT("in the HAL\r\n"));
#endif
//
// Start up the scheduling timer.
//
OEMWriteDebugString(L"InitClock...\r\n");
InitClock();
//
// Initialize interrupts.
//
OEMInitInterrupts();
OEMPowerManagerInit();
// Only support one core module (0) under CE - interrupts come in on IRQ0.
// ARM doesn't use HookInterrupt - OEMInterruptHandler called by kernel
// instead.
#if 1
// dpCurSettings.ulZoneMask = 0xffffffff;
OEMWriteDebugString(L"Firmware Init Done.\r\n");
#endif
//
// Initialize EDBG/KITL if a bootloader started us.
//
//if (pBootArgs->ucLoaderFlags & LDRFL_USE_EDBG)
// InitDebugEther();
/*
if((DRIVER_GLOBALS_POINTER)->eth.EbootMagicNum == EBOOT_MAGIC_NUM ||
(DRIVER_GLOBALS_POINTER)->eth.EbootMagicNum == PARALLEL_MAGIC_NUM)
{
InitDebugEther();
}
*/
#ifdef EP93XX_CRUNCH
//
// Set up the coprocessor environment variables.
//
g_pOemGlobal->cbCoProcRegSize = 0xB8;
g_pOemGlobal->fSaveCoProcReg = 1;
g_pOemGlobal->pfnSaveCoProcRegs = OEMSaveCoProcRegister;
g_pOemGlobal->pfnRestoreCoProcRegs = OEMRestoreCoProcRegister;
g_pOemGlobal->pfnInitCoProcRegs = OEMInitCoProcRegisterSavedArea;
#endif // EP93XX_CRUNCH
pQueryPerformanceCounter =OEMQueryPerformanceCounter;
pQueryPerformanceFrequency =OEMQueryPerformanceFrequency;
g_pOemGlobal->pfnEnumExtensionDRAM=OEMEnumExtensionDRAM;
#if( SIZE_SDRAM_MAIN <0x04000000 )
g_pOemGlobal->pfnCalcFSPages=OEMCalcFSPages;
#endif
// Print out the current clock rates to the debug port.
//
KITLIoctl(IOCTL_KITL_STARTUP, NULL, 0, NULL, 0, NULL);
{ //Force clean boot to let the system more stable when booting up.
extern void NKForceCleanBoot();
NKForceCleanBoot( );
}
NKDbgPrintfW
(
L"Processor = %dMhz, Bus = %dMhz \r\n",
(REAL_FCLOCK/1000000),
(REAL_HCLOCK/1000000)
);
}
/*
* OEMGetExtensionDRAM
*
* For systems with memory sockets which may add more ram, here's where
* Windows CE finds out about it.
*/
BOOL OEMGetExtensionDRAM(LPDWORD lpMemStart, LPDWORD lpMemLen)
{
BOOL bRet=FALSE;
NKDbgPrintfW(TEXT("OEMGetExtensionDRAM\r\n"));
return FALSE;
}
DWORD OEMEnumExtensionDRAM(
PMEMORY_SECTION pMemSections,
DWORD cMemSections
)
{
DWORD dwExtMem=0;
NKDbgPrintfW(TEXT("OEMEnumExtensionDRAM\r\n"));
#ifdef IMGFLASH
NKDbgPrintfW(TEXT("OEMEnumExtensionDRAM XIP\r\n"));
#if (EP93XX_PLATFORM_TYPE == EDB9307A )|| ( EP93XX_PLATFORM_TYPE==EDB9315A)
// *lpMemStart = (SDRAM_VIRTUAL_MEMORY + 0x2000000);
// *lpMemLen = 0x2000000;
pMemSections[0].dwFlags=0;
pMemSections[0].dwStart= (SDRAM_VIRTUAL_MEMORY + 0x2000000);
pMemSections[0].dwLen=0x2000000;
dwExtMem=1;
#elif EP93XX_PLATFORM_TYPE == EDB9302A ||EP93XX_PLATFORM_TYPE == EDB9301 || EP93XX_PLATFORM_TYPE == EDB9302 ||EP93XX_PLATFORM_TYPE == EDB9301A
//The first 8 M bytes is defined in config.bib.
pMemSections[0].dwFlags=0;
pMemSections[0].dwStart=(SDRAM_VIRTUAL_MEMORY + SDRAM_MAIN_BLOCK_SIZE);
pMemSections[0].dwLen=SDRAM_MAIN_BLOCK_SIZE;
pMemSections[1].dwFlags=0;
pMemSections[1].dwStart=(SDRAM_VIRTUAL_MEMORY + 2*SDRAM_MAIN_BLOCK_SIZE);
pMemSections[1].dwLen=SDRAM_MAIN_BLOCK_SIZE;
pMemSections[2].dwFlags=0;
pMemSections[2].dwStart=(SDRAM_VIRTUAL_MEMORY + 3*SDRAM_MAIN_BLOCK_SIZE);
pMemSections[2].dwLen=SDRAM_MAIN_BLOCK_SIZE;
dwExtMem=3;
#endif
//umask these lines when doing release
#else //IMGFLASH
#if EP93XX_PLATFORM_TYPE == EDB9302A ||EP93XX_PLATFORM_TYPE == EDB9301 || EP93XX_PLATFORM_TYPE == EDB9302 ||EP93XX_PLATFORM_TYPE == EDB9301A
NKDbgPrintfW(TEXT("OEMEnumExtensionDRAM 9302A in DRAM\r\n"));
pMemSections[0].dwFlags=0;
pMemSections[0].dwStart=(SDRAM_VIRTUAL_MEMORY + 0x1000000);
pMemSections[0].dwLen=0x800000;
dwExtMem=1;
/*
pMemSections[1].dwFlags=0;
pMemSections[1].dwStart=(SDRAM_VIRTUAL_MEMORY + 0x0A00000);
pMemSections[1].dwLen=0x600000;
dwExtMem=2;
*/
#endif
#endif//IMGFLASH
return dwExtMem;
}
//****************************************************************************
// OEMTranslateIrq
//****************************************************************************
// Lets not use this function. It is made for devices that have a real
// bus like PCI or ISA. Just return the input value for now.
//
//
DWORD OEMTranslateIrq
(
DWORD Irq
)
{
return Irq;
}
//****************************************************************************
// OEMTranslateSysIntr
//****************************************************************************
// Lets not use this function. It is made for devices that have a real
// bus like PCI or ISA. Just return the input value for now.
//
//
DWORD OEMTranslateSysIntr
(
DWORD SysIntr
)
{
return SysIntr;
}
//****************************************************************************
// OEMRequestSysIntr
//****************************************************************************
// There are no interrupts that are available. All interrupts are for
// specified devices.
//
//
DWORD OEMRequestSysIntr
(
DWORD Irq
)
{
return Irq;
}
//****************************************************************************
// OEMGetInterrupt
//****************************************************************************
// We don't have a PCI bus so return failure.
//
//
BOOL OEMGetInterrupt
(
PDEVICE_LOCATION pDevLoc,
PDWORD pIrq
)
{
return FALSE;
}
/* EOF cfw_platform.c */
#if( SIZE_SDRAM_MAIN <0x04000000 )
DWORD OEMCalcFSPages( DWORD dwMemPages, DWORD dwDefaultFSPages)
{
NKDbgPrintfW(TEXT("OEMCalcFSPages entered %x %x\r\n", dwMemPages, dwDefaultFSPages));
return dwDefaultFSPages>>1;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -