📄 bsp_nand_cfg.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
//------------------------------------------------------------------------------
//
// File: bsp_nand_cfg.h
//
// This file contains information about NAND flash used on H4Sample board.
// There are two group of constants. First defines READY/~BUSY signal and it
// is board specific. Second defines NAND geometry and it depends on chip
// used.
//
#ifndef __BSP_NAND_CFG_H
#define __BSP_NAND_CFG_H
//------------------------------------------------------------------------------
// NAND operation timeout
#define BSP_NAND_TIMEOUT 2000
//------------------------------------------------------------------------------
// NAND Id and geometry
//
// Following constats must be specified for each supported NAND chip:
// 1. manufacturer ID (UINT8), 2. device Id (UINT8),
// 3. number of block (UINT32), 4. sectors per block (UINT32),
// 5. sector data size (UINT32), 6. extended address (BOOL)
#define BSP_NAND_INFO \
{ 0xEC, 0x45, 2048, 32, 512, FALSE }, \
{ 0xEC, 0x55, 2048, 32, 512, FALSE }, \
{ 0xEC, 0x35, 2048, 32, 512, FALSE }, \
{ 0xEC, 0x75, 2048, 32, 512, FALSE }, \
{ 0xEC, 0x46, 4096, 32, 512, TRUE } \
//------------------------------------------------------------------------------
// Boot Partition buffer
//
// Buffer size is calculated as blockSize + sectorSize + (sectors/block) * 8.
// Value used must be sufficient for all supported NANDs.
#define BSP_NAND_BPART_BUFFER_SIZE 0x4300
//------------------------------------------------------------------------------
// NAND Flash Commands
#define BSP_NAND_CMD_READ 0x00 // Read
#define BSP_NAND_CMD_READ1 0x01 // Read1
#define BSP_NAND_CMD_READ2 0x50 // Read2
#define BSP_NAND_CMD_READID 0x90 // ReadID
#define BSP_NAND_CMD_WRITE 0x80 // Write phase 1
#define BSP_NAND_CMD_WRITE2 0x10 // Write phase 2
#define BSP_NAND_CMD_ERASE 0x60 // Erase phase 1
#define BSP_NAND_CMD_ERASE2 0xd0 // Erase phase 2
#define BSP_NAND_CMD_STATUS 0x70 // Status read
#define BSP_NAND_CMD_RESET 0xff // Reset
//------------------------------------------------------------------------------
// Status bit pattern
#define BSP_NAND_STATUS_READY 0x40 // Ready
#define BSP_NAND_STATUS_ERROR 0x01 // Error
//------------------------------------------------------------------------------
#endif // __BSP_NAND_CFG_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -