高分相送:关于TFFS建立时FLASH_BASE_ADRS的定义问题(mpc8379开发板)
[复制链接]
情况是板上有两片flash ,一片 32Mnor,一片256Mnand。nor flash驱动已经做好。在做nand flash驱动时,mtd层编写完毕,对socket注册时,定义一个FLASH_NAND_BASE.根据存储分配,在Base Memory Mapped Registers(0xE0000000)和nor flash(0xFC000000)之间,未定义的区间,在systffs中我给FLASH_NAND_BASE定义为 0xF0000000,size为256K;并做了以下设置:
local bus access window 2 base address register (LBLAWBAR2) 0xf0000000
eLBC local access window 2 attribute register (LBLAWAR2) (LAWAR_ENABLE | LAWAR_SIZE_256KB ) )
or1 0xfffc07ae
br1 0xf0000c21
syslib中
sysPhysMemDesc []
(VIRT_ADDR) 0xf0000000 ,
(PHYS_ADDR) 0xf0000000,
0x00040000, /*256 k - nand flash window */
VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE |
VM_STATE_MASK_GUARDED,
VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT |
VM_STATE_GUARDED
}
还有一个
UINT32 sysBatDesc [2 * (_MMU_NUM_IBAT + _MMU_NUM_DBAT + _MMU_NUM_EXTRA_IBAT + _MMU_NUM_EXTRA_DBAT)]
块地址转换表不知道 nand flash需不需要定义(我试过了定义不定义仍然无法调用mtd驱动),nor做了如下定义
((FLASH_BASE_ADRS & _MMU_UBAT_BEPI_MASK) | _MMU_UBAT_BL_64M |
_MMU_UBAT_VS | _MMU_UBAT_VP),
((FLASH_BASE_ADRS & _MMU_LBAT_BRPN_MASK) | _MMU_LBAT_PP_RW |
_MMU_LBAT_CACHE_INHIBIT | _MMU_LBAT_GUARDED),
结果在运行tffsShow 1(0为nor)时,总显示
tffsShow 1
0x278904(shell0) checkStatus() ERROR line 77
1, **** communication failed with error 。-1
这个结果应该表明映射地址不对,所以不能调用nandMTDIdentify(我把MTD表都undef留下nandMTDIdentify,nor flash会正常调用nandMTDIdentify,当然结果输出是Debug: did not identify flash media.\n");
关于mpc8379的flash 地址映射,我有什么没做的,或做的不对的,求高人,急啊,谢谢。
|