⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysspeed.c

📁 WINDRIVER MCP750 BSP
💻 C
字号:
/* sysSpeed.c - Support for determining Bus and DRAM speed *//* Copyright 1997-2001 Wind River Systems, Inc. *//* Copyright 1997,1998 Motorola, Inc., All Rights Reserved */#include "copyright_wrs.h"/*modification history--------------------01f,25oct01,mil  Moved sysGetBusSpd(), sysGetDramSpd() and sysGetMpuSpd() into                 sysASpeed.s (SPR 71148).01e,16sep01,dat  Use of WRS_ASM macro01d,21jul98,scb  #define name cleanup - removal of board name defines.01c,13jan98,srr  updated copyright dates to 1998.01b,16aug97,scb  Add MPC750 (Arthur) support.01a,09jul97,tb   created.*//*DESCRIPTION*//* includes */#include "vxWorks.h"#include "config.h"/* defines *//* typedefs *//* globals */#ifdef INCLUDE_I2CIMPORT	void	i2cgetDIMM (UINT, UCHAR *, UINT);#endif /* INCLUDE_I2C *//* locals *//* forward declarations */#ifdef INCLUDE_I2CUINT	getDIMMdramspeed (void);#endif /* INCLUDE_I2C */#ifdef INCLUDE_I2C/******************************************************************************** getDIMMdramspeed - retreive the slowest dram speed for the DIMM*                    combinations.** This function's purpose is to access the DIMMs via the I2C controller* and return the slowest speed found.** RETURNS: slowest dram speed*/UINT getDIMMdramspeed (void)    {    UCHAR DIMM_info[15];    UINT dspeed;    UINT ii;    dspeed = 0;    /* Check all of the DRAM Serial Presence Detect (SPD) SROMs */    for (ii = 0; ii <= 6; ii += 2)	{	/* Get SPD struct */	i2cgetDIMM((0xA0 + ii), &(DIMM_info[0]), 14);	/* Does this DIMM use the slowest DRAM ? */	if (DIMM_info[9] > dspeed)		{		/* Yes! update return value */		dspeed = DIMM_info[9];		}	}    return (dspeed);    }/******************************************************************************** getDIMMrefreshrate - retreive the fastest dram refresh rate required*                      for the installed DIMMs.** This function's purpose is to access the DIMMs via the I2C controller* and return the fastest refresh rate required.** RETURNS: refresh_rate*			0 = Normal refresh rate*			Non-zero = Fast refresh rate*/UINT getDIMMrefreshrate (void)    {    UCHAR DIMM_info[15];    UINT refresh_rate;    UINT ii;    /* Default return value to normal refresh rate */    refresh_rate = 0;        /* Check all of the DRAM Serial Presence Detect (SPD) SROMs */    for (ii = 0; ii <= 6; ii += 2)	{	/* Get SPD struct */	i2cgetDIMM((0xA0 + ii), &(DIMM_info[0]), 14);	/* Does this DIMM require a fast refresh rate? */	if ((DIMM_info[12] == 1) || (DIMM_info[12] == 2))		{		/* Yes!  Update return value */		refresh_rate = DIMM_info[12];		}	}    return (refresh_rate);    }#endif /* INCLUDE_I2C */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -