?? onenand.h
字號(hào):
/**************************************************************************************
*
* Project Name : S3C6410 OneNand SJF
*
* Copyright 2007 by Samsung Electronics, Inc.
* All rights reserved.
*
* Project Description :
* This software is only for JTAG Flash Fusing of the S3C6410.
*
*--------------------------------------------------------------------------------------
*
* File Name : onenand.h
*
* File Description : write to the OneNand Device using JTAG Flash Fusing
*
* Author : Heemyung.noh
* Dept. : AP Development Team
* Created Date : 2007/12/11
* Version : 0.1
*
* History
* - Created(Heemyung.noh 2007/12/11)
*
**************************************************************************************/
#ifndef __ONENAND_H__
#define __ONENAND_H__
#define ONENAND_MODE (0x40E0)
#define ONENAND_PAGESIZE (2048)
#define ONENAND_NUMOFPAGE (64)
#define ONENAND_NUMOFBLOCK (2048)
#define X5A_MANU_ID (0x00EC)
#define X5A_DEV_ID (0x0040)
// OneNand Device Register Map
#define DATA_RAM0 (0x200)
#define MANUF_ID (0xF000)
#define DEVICE_ID (0xF001)
#define VERSION_ID (0xF002)
#define DATA_BUFFER_SIZE (0xF003)
#define BOOT_BUFFER_SIZE (0xF004)
#define AMOUNT_OF_BUFFER (0xF005)
#define TECH (0xF006)
#define START_ADDR1 (0xF100)
#define START_ADDR2 (0xF101)
#define START_ADDR3 (0xF102)
#define START_ADDR4 (0xF103)
#define START_ADDR5 (0xF104)
#define START_ADDR6 (0xF105)
#define START_ADDR7 (0xF106)
#define START_ADDR8 (0xF107)
#define START_BUFFER (0xF200)
#define COMMAND (0xF220)
#define SYS_CONFIG1 (0xF221)
#define SYS_CONFIG2 (0xF222)
#define CON_STATUS (0xF240)
#define INTERRUPT (0xF241)
#define START_BLOCK_ADDR (0xF24C)
#define WR_PROT_STATUS (0xF24E)
#define ECC_STATUS (0xFF00)
#define ECC_MAIN_RESULT1 (0xFF01)
#define ECC_SPARE_RESULT1 (0xFF02)
#define ECC_MAIN_RESULT2 (0xFF03)
#define ECC_SPARE_RESULT2 (0xFF04)
#define ECC_MAIN_RESULT3 (0xFF05)
#define ECC_SPARE_RESULT3 (0xFF06)
#define ECC_MAIN_RESULT4 (0xFF07)
#define ECC_SPARE_RESULT4 (0xFF08)
// OneNand Command
#define LOAD_SECTOR (0x0000)
#define LOAD_SPARE (0x0013)
#define PROGRAM_SECTOR (0x0080)
#define PROGRAM_SPARE (0x001A)
#define UNLOCK_BLOCK (0x0023)
#define UNLOCK_ALL_BLOCK (0x0027)
#define ERASE_BLOCK (0x0094)
#define DFS(n) (unsigned short)(n<<15)
#define DBS(n) (unsigned short)(n<<15)
#define FBA(n) (n&0x7FF)
#define SBA(n) (n&0x7FF)
#define FPA(n) ((n&0x3F)<<2)
#define FSA(n) (n&0x3)
#define BSA(n) ((n&0xF)<<8)
#define BSC(n) (n&0x3)
// Function Declaration
void KFM2G16Q2x_Program(void);
void OneNand_Init(void);
void OneNand_UnlockBlock(U16 StartBlock, U16 EndBlock);
U16 OneNand_EraseBlock(U16 StartBlock, U16 EndBlock);
U16 OneNand_WritePage(U16 Block, U16 Page, U16 *Buffer);
void OneNand_ReadID(U16 *ManuID, U16 *DevID);
void ProgramOneNand(void);
void OneNand_JtagInit(void);
void OneNand_WriteRegister(U16 Address, U16 Data);
U16 OneNand_ReadRegister(U16 Address);
void OneNand_WriteData(U16 Address, U32 Data);
#endif //__ONENAND_H__
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -