|
楼主 |
发表于 2009-6-25 20:03:15
|
显示全部楼层
cavium寄存器设置求助
这两天ms搞的差不多了,不过现在flash的读写只能写一块,连续写会不对,可能和下面这个寄存器有关,望用过cavium的达人指教,不甚感谢~~
MIO_BOOT_REG_TIMn 里面的参数设置不是非常清楚,求教!
cavium自带的一个例子(boot flash的),望达人解释为什么这么设置,以及具体参数含义,谢谢。。。
cpu :octeon5020
#define FLASH_RoundUP(_Dividend, _Divisor) (((_Dividend)+(_Divisor))/(_Divisor))
ECLK_PERIOD = 1000000 / 1000;
/* Set timing to be valid for all CPU clocks up to 600 Mhz */
reg_tim.u64 = 0;
reg_tim.s.pagem = 0;
reg_tim.s.wait = 0x3f;
reg_tim.s.adr = FLASH_RoundUP((FLASH_RoundUP(10000ULL, ECLK_PERIOD) - 1), 4);
reg_tim.s.pause = 0;
reg_tim.s.ce = FLASH_RoundUP((FLASH_RoundUP(50000ULL, ECLK_PERIOD) - 1), 4);
if (OCTEON_IS_MODEL(OCTEON_CN30XX) || OCTEON_IS_MODEL(OCTEON_CN31XX))
reg_tim.s.ale = 4; /* Leave ALE at 34 nS */
reg_tim.s.oe = FLASH_RoundUP((FLASH_RoundUP(50000ULL, ECLK_PERIOD) - 1), 4);
reg_tim.s.rd_hld = FLASH_RoundUP((FLASH_RoundUP(25000ULL, ECLK_PERIOD) - 1), 4);
reg_tim.s.wr_hld = FLASH_RoundUP((FLASH_RoundUP(35000ULL, ECLK_PERIOD) - 1), 4);
reg_tim.s.we = FLASH_RoundUP((FLASH_RoundUP(35000ULL, ECLK_PERIOD) - 1), 4);
reg_tim.s.page = FLASH_RoundUP((FLASH_RoundUP(25000ULL, ECLK_PERIOD) - 1), 4);
cvmx_write_csr(CVMX_MIO_BOOT_REG_TIM0, reg_tim.u64); |
|