📄 ezkitbf533_initcode.h
字号:
/****************************************************************************
Include Section
*****************************************************************************/
#include <blackfin.h>
#include "defBF532_add.h"
#include "nblackfin.h"
/*****************************************************************************
Symbolic constants / definitions
******************************************************************************/
#define SIC_IWR0 SIC_IWR /* Interrupt Wakeup Register */
#define IRQ_PLL_WAKEUP PLL_WAKEUP_IRQ /* PLL Wakeup Interrupt Request */
/*****************************************************************************
Dynamic Power Managment
*****************************************************************************/
/********************************
* PLL Control Register Value *
* Reset = 0x1400 *
* ADSP-BF533 EZ-KIT Lite: *
* CLKIN = 27MHz *
* MSEL = 19 *
* --> VCO = 27MHz x 19 = 513MHz *
* 0x13 = 19 *
********************************/
#define PLL_CTL_VAL (\
nBYPASS | /* Bypass the PLL */\
nOUT_DELAY | /* Add 200ps Delay To EBIU Output Signals */\
nIN_DELAY | /* Add 200ps Delay To EBIU Input Latches */\
nPDWN | /* Enter Deep Sleep Mode */\
nSTOPCK | /* Core Clock Off */\
nPLL_OFF | /* PLL Not Powered */\
nDF | /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */\
SET_MSEL(19) | /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */\
0)
#define CLKIN_Hz 27000000 /* CLKIN [Hz] */
#define VCO_MAX_Hz 600000000 /* VCO [Hz] */
/***********************************
* PLL Divide Register Value *
* Reset = 0x0005 *
* ADSP-BF533 EZ-KIT Lite: *
* CSEL = 1 *
* --> CCLK = VCO / CSEL *
* --> CCLK = 513MHz / 1 = 513MHz *
* SSEL = 4 *
* --> SCLK = VCO / SSEL *
* --> SCLK = 513MHz / 4 = 128MHz *
***********************************/
#define PLL_DIV_VAL (\
SET_SSEL(4) | /* Set SSEL = 1-15 --> SCLK = VCO/SSEL */\
CCLK_DIV1 | /* CCLK = VCO / 1 */\
0)
#define CCLK_MAX_Hz VCO_MAX_Hz /* Maximum Core Clock [Hz] */
#define SCLK_MAX_Hz 133000000 /* Maximum System Clock [Hz] */
/********************************
* PLL Lock Count Register Value *
* Reset = 0x0200 *
********************************/
#define PLL_LOCKCNT_VAL 0x0200
/****************************
* PLL Status Register Value *
* Reset = 0x00A2 *
****************************/
#define PLL_STAT_VAL (\
VSTAT | /* Voltage Regulator Status: Regulator at programmed voltage */\
nCORE_IDLE | \
PLL_LOCKED | /* PLL Locked Status */\
nSLEEP | \
nDEEP_SLEEP | \
nACTIVE_PLLDISABLED | /* Active Mode With PLL Disabled */\
FULL_ON | /* Full-On Mode */\
nACTIVE_PLLENABLED | /* Active Mode With PLL Enabled */\
0)
/*******************************************
* Voltage Regulator Control Register Value *
* Reset = 0x00DB *
*******************************************/
#define VR_CTL_VAL (\
nSCKELOW | /* Do Not Drive SCKE High During Reset After Hibernate */\
nWAKE | /* Enable RTC/Reset Wakeup From Hibernate */\
VLEV_125 | /* VLEV = 1.25 V (-5% - +10% Accuracy) */\
GAIN_20 | /* GAIN = 20 */\
FREQ_1000 | /* Switching Frequency Is 1 MHz */\
0)
/*****************************************************************************
EBIU: Asynchronous Memory
*****************************************************************************/
/****************************************************
* Asynchronous Memory Global Control Register Value *
* Reset = 0x00F2 *
* ADSP-BF533-proc.xml = 0x00FF *
* --> Enabling all four Async Banks and Clock Out *
****************************************************/
#define EBIU_AMGCTL_VAL (\
nCDPRIO | /* Core/DMA Priority */\
AMCKEN | /* Enable CLKOUT */\
AMBEN_ALL | /* 4MB Asynchronous Memory */\
0)
/****************************************************
* Asynchronous Memory Bank Control 0 Register Value *
* Reset = 0xFFC2 FFC2 *
* here = 0x7BB0 7BB0 *
****************************************************/
#define EBIU_AMBCTL0_VAL (\
B1WAT_7 | /* B1 Write Access Time = 7 cycles */\
B1RAT_11 | /* B1 Read Access Time = 11 cycles */\
B1HT_2 | /* B1 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */\
B1ST_3 | /* B1 Setup Time from AOE asserted to Read/Write asserted=3 cycles */\
B0WAT_7 | /* B0 Write Access Time = 7 cycles */\
B0RAT_11 | /* B0 Read Access Time = 11 cycles */\
B0HT_2 | /* B0 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */\
B0ST_3 | /* B0 Setup Time from AOE asserted to Read/Write asserted=3 cycles */\
0)
/****************************************************
* Asynchronous Memory Bank Control 1 Register Value *
* Reset = 0xFFC2 FFC2 *
* here = 0x7BB0 7BB0 *
****************************************************/
#define EBIU_AMBCTL1_VAL (\
B3WAT_7 | /* B3 Write Access Time = 7 cycles */\
B3RAT_11 | /* B3 Read Access Time = 11 cycles */\
B3HT_2 | /* B3 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */\
B3ST_3 | /* B3 Setup Time from AOE asserted to Read/Write asserted=3 cycles */\
B2WAT_7 | /* B2 Write Access Time = 7 cycles */\
B2RAT_11 | /* B2 Read Access Time = 11 cycles */\
B2HT_2 | /* B2 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */\
B2ST_3 | /* B2 Setup Time from AOE asserted to Read/Write asserted=3 cycles */\
0)
/*****************************************************************************
EBIU: SDRAM Memory
SDRAM Setup according to ADSP-BF533 EZ-KIT Lite
SDRAM Devices = M48LC4M16ATG-75
NRA = 8192
tRef = 64ms
tRAS = 44ns
tRP = 20ns
always round up tRAS and tRP values
SDRRC = SCLK x tRef / NRA - SCLK x tRAS - SCLK x tRP
SCLK = 54MHz: SDRRC = 0416 = 0x01A0
SCLK = 100MHz: SDRRC = 0774 = 0x0306
SCLK = 128MHz: SDRRC = 0992 = 0x03E0
SCLK = 133MHz: SDRRC = 1030 = 0x0406
Note: with a 27MHz crystal the default SCLK rate is 54MHz on the EZ-KIT Lite.
*****************************************************************************/
/********************************************
* SDRAM Refresh Rate Control Register Value *
* Reset = 0x081A *
* ADSP-BF533-proc.xml = 0x01A0 *
* here = 0x0397, SCLK @ 128MHz *
********************************************/
#define EBIU_SDRRC_VAL 0x03E0
#define NRA 8192 /* [int] */
#define tREF 64 /* [ms] */
/*********************************************
* SDRAM Memory Global Control Register Value *
* Reset = 0xE008 8849 *
* ADSP-BF533-proc.xml = 0x0091 998D *
*********************************************/
#define EBIU_SDGCTL_VAL (\
nCDDBG | /* Tristate SDRAM Controls During Bus Grant */\
nTCSR | /* Temp-Compensated Self-Refresh Value (85/45* Deg C) */\
nEMREN | /* Extended Mode Register Enable */\
nFBBRW | /* Enable Fast Back-To-Back Read To Write */\
nEBUFE | /* Enable External Buffering Timing */\
nSRFS | /* Enable SDRAM Self-Refresh Mode */\
nPSM | /* Power-Up Sequence (Mode Register Before/After* Refresh) */\
nPUPSD | /* Power-Up Start Delay (15 SCLK Cycles Delay) */\
SCTLE | /* Enable SDRAM Signals */\
PSS | /* Enable Power-Up Sequence on Next SDRAM Access */\
TWR_2 | /* SDRAM tWR = 2 cycle */\
TRCD_3 | /* SDRAM tRCD = 3 cycles */\
TRP_3 | /* SDRAM tRP = 3 cycles */\
TRAS_6 | /* SDRAM tRAS = 6 cycles */\
PASR_ALL | /* All 4 SDRAM Banks Refreshed In Self-Refresh */\
CL_3 | /* SDRAM CAS Latency = 3 cycles */\
0)
/*******************************************
* SDRAM Memory Bank Control Register Value *
* Reset = 0x0000 *
* ADSP-BF533-proc.xml = 0x0025 *
*******************************************/
#define EBIU_SDBCTL_VAL (\
nEBSZ_32 | /* SDRAM External Bank Size = 32MB | For BF533 EZ-Kit Lite's rev 1.6 and below */\
EBE | /* Enable SDRAM External Bank */\
EBSZ_64 | /* SDRAM External Bank Size = 64MB | For BF533 EZ-Kit Lite's rev 1.7 and above */\
EBCAW_10 | /* SDRAM External Bank Column Address Width = 10 Bits */\
0)
/****************************************************************************
EOF
*****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -