/* NAND FLASH (see S3C2440 manual chapter 6) */
#define NFCONF (*(volatile unsigned long *)0x4E000000)
#define NFCONT (*(volatile unsigned long *)0x4E000004)
#define NFCMMD (*(volatile unsigned char *)0x4E000008) // 杩欓噷涓嶈兘鍐欐垚long,鍒囪?锛?
#define NFADDR (*(volatile unsigned char *)0x4E00000C)
#define NFDATA (*(volatile unsigned char *)0x4E000010)
#define NFSTAT (*(volatile unsigned char *)0x4E000020)
/* 渚涘?閮ㄨ皟鐢ㄧ殑鍑芥暟 */
void nand_init(void);
void nand_read(unsigned char *buf, unsigned long start_addr, int size);
/* S3C2440鐨凬AND Flash鎿嶄綔鍑芥暟 */
/* 绛夊緟NAND Flash灏辩华 */
static void s3c2440_wait_idle(void)
{
int i;
while(!(NFSTAT & 1))
for(i=0; i<10; i++);
}
/* 鍙戝嚭鍦板潃 */
static void s3c2440_write_addr(unsigned int addr)
{
int i;
NFADDR = addr & 0xff; //鍐欏叆鏈
阅读(460) | 评论(0) | 转发(0) |