?? syslib.c
字號:
char * sysModel ( void ) { return( "MPC8260 PowerQUICC II -- Wind River. SBC8260ATM " ) ; }/************************************************************************* sysBspRev - return the BSP version and revision number** This routine returns a pointer to a BSP version and revision number, for* example, 1.2/0. BSP_REV is concatenated to BSP_VERSION and returned.** RETURNS: A pointer to the BSP version/revision string.*/char * sysBspRev ( void ) { return( BSP_VERSION BSP_REV ); }/************************************************************************* sysHwInit - initialize the system hardware** This routine initializes various feature of the EST MPC8260 board. It sets* up the control registers, initializes various devices if they are present.** NOTE: This routine should not be called directly by the user.** RETURNS: N/A*/void sysHwInit ( void ) { volatile UINT32 temp; int ix; ULONG * pDPRAM1;#ifdef INCLUDE_VWARE_LAUNCH char vwareMacAdrs[VWARE_MAC_ADRS_LEN];#endif /* INCLUDE_VWARE_LAUNCH */ /* Get the physical location of the IMMR register */ int immrVal = vxImmrGet (); /* Issue a Software Reset Command to the CPM core */ sysCpmReset (); /* Initialize the LEDs */ sysLedInit (); /* Initialize DPRAM1 to zero. */ pDPRAM1 = (unsigned long *)immrVal; for (ix = 0; ix < 0x1000; ix++) *pDPRAM1++ = 0; /* reset port A, B, C, and D */ *M8260_IOP_PAPAR( immrVal ) = 0x00000000; *M8260_IOP_PADIR( immrVal ) = 0x00000000; *M8260_IOP_PAODR( immrVal ) = 0x00000000; *M8260_IOP_PBPAR( immrVal ) = 0x00000000; *M8260_IOP_PBDIR( immrVal ) = 0x00000000; *M8260_IOP_PBODR( immrVal ) = 0x00000000; *M8260_IOP_PCPAR( immrVal ) = 0x00000000; *M8260_IOP_PCDIR( immrVal ) = 0x00000000; *M8260_IOP_PCSO( immrVal ) = 0x00000000; *M8260_IOP_PDPAR( immrVal ) = 0x00000000; *M8260_IOP_PDDIR( immrVal ) = 0x00000000; *M8260_IOP_PDSO( immrVal ) = 0x00000000; /* * Initialize SICR. */ *M8260_SICR( immrVal ) = 0x00000000; /* * Initialize interrupts - default interrupt level. */ m8260IntrInit (); if (sysChipRev () == SILICON_REV_PREA1) { temp = *M8260_SIUMCR( immrVal ); temp &= 0xf3ffffff; /* First clear DPPC ... */ temp |= 0x08000000; /* ... then enable TBEN. */ *M8260_SIUMCR( immrVal ) = temp; } /* * Init the DPRAM lib */ m82xxDpramLibInit (); /* * Reset serial channels. */ sysSerialHwInit (); /* * Setup port D for SMC1. */ *M8260_IOP_PDPAR( immrVal ) |= (PD8 | PD9); *M8260_IOP_PDDIR( immrVal ) |= PD9; /* * Setup port A for SMC2. */ *M8260_IOP_PAPAR( immrVal ) |= (PA8 | PA9); *M8260_IOP_PADIR( immrVal ) |= PA9;#ifdef FORCE_DEFAULT_BOOT_LINE strncpy (sysBootLine,DEFAULT_BOOT_LINE,strlen(DEFAULT_BOOT_LINE)+1);#elif defined INCLUDE_VWARE_LAUNCH if (sysVwareBuildBootLine ((char*)&vwareMacAdrs)) { sysEnetAddrSet(vwareMacAdrs[0], vwareMacAdrs[1], vwareMacAdrs[2], vwareMacAdrs[3], vwareMacAdrs[4], vwareMacAdrs[5] ); }#endif /* FORCE_DEFAULT_BOOT_LINE */#ifdef INCLUDE_MOTSCCEND /* make sure Ethernet is disabled */ sysSccEnetDisable ( 0 ) ; sysSccEnetIntDisable( 0 ) ;#endif /* INLUCDE_MOTSCCEND */#ifdef INCLUDE_MOTFCCEND sysFccEnetDisable (immrVal, 2);#endif /* INCLUDE_MOTFCCEND */ }/************************************************************************* sysPhysMemTop - get the address of the top of physical memory** This routine returns the address of the first missing byte of memory,* which indicates the top of memory.** Normally, the user specifies the amount of physical memory with the* macro LOCAL_MEM_SIZE in config.h. BSPs that support run-time* memory sizing do so only if the macro LOCAL_MEM_AUTOSIZE is defined.* If not defined, then LOCAL_MEM_SIZE is assumed to be, and must be, the* true size of physical memory.** NOTE: Do no adjust LOCAL_MEM_SIZE to reserve memory for application* use. See sysMemTop() for more information on reserving memory.** RETURNS: The address of the top of physical memory.** SEE ALSO: sysMemTop()*/char * sysPhysMemTop ( void ) { static char * physTop = NULL; if (physTop == NULL) { physTop = (char *)(LOCAL_MEM_LOCAL_ADRS + LOCAL_MEM_SIZE); } return( physTop ) ; }/************************************************************************* sysMemTop - get the address of the top of VxWorks memory** This routine returns a pointer to the first byte of memory not* controlled or used by VxWorks.** The user can reserve memory space by defining the macro USER_RESERVED_MEM* in config.h. This routine returns the address of the reserved memory* area. The value of USER_RESERVED_MEM is in bytes.** RETURNS: The address of the top of VxWorks memory.*/char *sysMemTop ( void ) { static char * memTop = NULL; if ( memTop == NULL ) { memTop = sysPhysMemTop () - USER_RESERVED_MEM ; } return memTop ; }/************************************************************************* sysToMonitor - transfer control to the ROM monitor** This routine transfers control to the ROM monitor. Normally, it is called* only by reboot()--which services ^X--and by bus errors at interrupt level.* However, in some circumstances, the user may wish to introduce a* <startType> to enable special boot ROM facilities.** RETURNS: Does not return.*/STATUS sysToMonitor ( int startType /* parameter passed to ROM to tell it how to boot */ ) { FUNCPTR pRom = (FUNCPTR) (ROM_TEXT_ADRS + 4); /* Warm reboot */#ifdef INCLUDE_MOTFCCEND /* */ /* Get the physical location of the IMMR register */ /* */ int immrVal = vxImmrGet ();#endif /* INCLUDE_MOTFCCEND */ intLock (); cacheDisable (INSTRUCTION_CACHE); cacheDisable (DATA_CACHE);#if defined(INCLUDE_AUX_CLK) sysAuxClkDisable();#endif /* INCLUDE_AUX_CLK */#ifdef INCLUDE_MOTSCCEND sysSccEnetDisable ( 0 ); /* disable the ethernet device */ sysSccEnetIntDisable ( 0 ); /* disable the ethernet device interrupt */#endif /* INCLUDE_MOTSCCEND */#ifdef INCLUDE_MOTFCCEND /* disable the FCC */ sysFccEnetDisable (immrVal, 2);#endif /* INCLUDE_MOTFCCEND */ sysSerialReset (); /* reset the serial device */ vxMsrSet(0); (*pRom) (startType); /* jump to bootrom entry point */ return( OK ); /* in case we continue from ROM monitor */ }/************************************************************************* sysHwInit2 - initialize additional system hardware** This routine connects system interrupt vectors and configures any * required features not configured by sysHwInit().** RETURNS: N/A*/void sysHwInit2 ( void ) { static BOOL configured = FALSE ; if ( ! configured ) {#if defined(INCLUDE_AUX_CLK) /* * initialize and start auxiliary clock support */ sysAuxClkEnable ();#endif /* INCLUDE_AUX_CLK */ /* * initialize serial interrupts */ sysSerialHwInit2 (); /* * Indicate we have been through this procedure for reentrancy. */ configured = TRUE; } }/************************************************************************* sysProcNumGet - get the processor number** This routine returns the processor number for the CPU board, which is* set with sysProcNumSet().** RETURNS: The processor number for the CPU board.** SEE ALSO: sysProcNumSet()*/int sysProcNumGet ( void ) { return( sysProcNum ); }/************************************************************************* sysProcNumSet - set the processor number** This routine sets the processor number for the CPU board. Processor numbers* should be unique on a single backplane. It also maps local resources onto* the VMEbus.** RETURNS: N/A** SEE ALSO: sysProcNumGet()**/void sysProcNumSet ( int procNum /* processor number */ ) { sysProcNum = procNum; }/************************************************************************* vxImmrSet - Set the IMMR to a specific value
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -