⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flash_lib.h

📁 ARM9基于WINDOWSCE的BSP源代码
💻 H
字号:
/*
*   The content of this file or document is CONFIDENTIAL and PROPRIETARY
*   to Jade Technologies Co., Ltd.  It is subjected to the terms of a
*   License Agreement between Licensee and Jade Technologies Co., Ltd.
*   restricting among other things, the use, reproduction, distribution
*   and transfer.  Each of the embodiments, including this information 
*   and any derivative work shall retain this copyright notice.
* 
*   Copyright (c) 2004 - 2005 Jade Technologies Co., Ltd. 
*   All rights reserved.
*/
// ----------------------------------------------------------------
// File:     flash_lib.h,v
// Revision: 1.0
// ----------------------------------------------------------------
// $
//

#ifndef FLASH_LIB
#define FLASH_LIB

// Z228 Development Board has 64 MB of FLASH and we assume the blocks are 128K each
// These are allocated as follows:
//
// Block 0          - Jasmon.AXF
// 
// Block 2          - eboot image (256KB)
// Block 3          - eboot settings
// Block 4 -> 243   - NK image (60MB)
// Block 244 -> 255 - Reserved (3MB)
//

#define BLDR_FLASH_BLOCK               4
#define BLDR_SETTINGS_FLASH_BLOCK      6
#define NK_FLASH_BLOCK                 8
#define RESERVED_FLASH_BLOCK         488

#define BLDR_FLASH_BASE             (PHYS_FLASH_BASE + (BLDR_FLASH_BLOCK * ARMVPB_FLASH_BLOCK_SIZE))
#define BLDR_SETTINGS_FLASH_BASE    (PHYS_FLASH_BASE + (BLDR_SETTINGS_FLASH_BLOCK * ARMVPB_FLASH_BLOCK_SIZE))
#define NK_FLASH_BASE               (PHYS_FLASH_BASE + (NK_FLASH_BLOCK * ARMVPB_FLASH_BLOCK_SIZE))
#define RESERVED_FLASH_BASE         (PHYS_FLASH_BASE + (RESERVED_FLASH_BLOCK * ARMVPB_FLASH_BLOCK_SIZE))

/*
 * The following typedefs are used when defining objects that may also
 * be created on a host system, where the word size is not
 * 32bits. This ensures that the same data values are manipulated.
 */

typedef unsigned int unsigned32;
typedef signed int signed32;
typedef int int32;

typedef unsigned short int unsigned16;
typedef signed short int signed16;

typedef signed char int8;
typedef unsigned char unsigned8;

#define FAIL -1
#define PASS 0


// 
// Intel flash routine prototypes.
//
void CFI_Flash_Write_Enable();
void CFI_Flash_Write_Disable();
int32 CFI_Write_Word (unsigned16 *address, unsigned16 data);
int32 CFI_Write_Block(unsigned16 *address, unsigned16 *data, unsigned32 size);
int32 CFI_Read_Word  (unsigned16 *address, unsigned16 *value);
int32 CFI_Read_Block (unsigned16 *address, unsigned16 *data, unsigned32 size);
int32 CFI_Erase_Block (unsigned16 *address);

#endif

// End of File - flash_lib.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -