📄 powerinit.c
字号:
/*********************************************************************************
Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved.
This software is proprietary and confidential. By using this software you agree
to the terms of the associated Analog Devices License Agreement.
Description:
Configures the Power Management and EBIU modules for the
ADSP-BF561 EZ-KIT LITE in Dual Core Operation.
*********************************************************************************/
#include <services/services.h>
#define DO_NOT_CHANGE_MMR_SETTINGS 0
static void InitPower(void);
static void InitSDRAM(void);
static ADI_EBIU_SDRAM_BANK_VALUE bank_size = {0, ADI_EBIU_SDRAM_BANK_64MB};
/*********************************************************************
Function: Init
Description: Performs Core specific initialization
*********************************************************************/
void Init(void)
{
if ( (*ADI_SRAM_BASE_ADDR_MMR) == ADI_COREA ) {
// Hand over settings for the BF 561EZ-KIT
// (Will not be written into EBIU registers.
// thats the job for InitPower)
InitSDRAM();
}
// Initialize the power management module
InitPower();
}
/*********************************************************************
Function: InitPower
Description: Initializes the Power Management module
********************************************************************/
static void InitPower(void)
{
ADI_PWR_RESULT PWRResult;
// The following command table describes the configuration for the ADSP-BF561 EZ-KIT.
// All commands (except ADI_PWR_CMD_END) are equivalent to the single command
// { ADI_PWR_CMD_SET_EZKIT, (void*)ADI_PWR_EZKIT_BF561_600MHZ }
//
ADI_PWR_COMMAND_PAIR ezkit_power[] = {
{ ADI_PWR_CMD_SET_EZKIT, ADI_PWR_EZKIT_BF561_600MHZ}, // Use BF561 EZ-KIT
{ ADI_PWR_CMD_END, 0} // No more commands
};
// Pass the above table to the Intialization routine
PWRResult = adi_pwr_Init( ezkit_power );
if ((PWRResult != ADI_PWR_RESULT_SUCCESS) && (PWRResult != ADI_PWR_RESULT_CALL_IGNORED)) {
while(1);
}
PWRResult = adi_pwr_SetFreq( 0, 130, ADI_PWR_DF_OFF); // Try highest speed
*pEBIU_SDGCTL |= 2; // turn on clockout to check SCLK!
}
/*********************************************************************
Function: InitSDRAM
Description: Initializes the EBIU module with the required SDRAM
settings.
*********************************************************************/
static void InitSDRAM(void)
{
ADI_EBIU_RESULT EBIUResult;
// The following command table describes the configuration for the ADSP-BF561 EZ-KIT,
// which uses two Micron MT48LC16M16A2-75 (4Meg x 16 x 4 banks) memory modules to give
// a total of 64MB.
//
// This is the most general specification, as the values can be set according to the
// datasheet of the memory modules to be configured.
//
ADI_EBIU_COMMAND_PAIR ezkit_sdram[] = {
{ ADI_EBIU_CMD_SET_SDRAM_BANK_SIZE, (void*)&bank_size },
{ ADI_EBIU_CMD_SET_SDRAM_MODULE, (void*)ADI_EBIU_SDRAM_MODULE_MT48LC16M16A2_75 },
{ ADI_EBIU_CMD_END, 0}
};
// Pass the above table to the Intialization routine
EBIUResult = adi_ebiu_Init( ezkit_sdram, DO_NOT_CHANGE_MMR_SETTINGS );
if ((EBIUResult != ADI_EBIU_RESULT_SUCCESS) && (EBIUResult != ADI_EBIU_RESULT_CALL_IGNORED)) {
while(1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -