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

📄 amd29lv800.h

📁 motorola自己开发的针对coldfire 5272的Dbug bootloader程序
💻 H
字号:
/****************************************************************************************/
/*											*/
/*  File:		AMD29LV800.h							*/
/*  Date:		19 December 1997						*/
/*  Purpose:	Header file containing data definitions for the 128Kx8		*/
/*			AMD29LV800 Flash memory device.				*/
/*  Modified:	9 Feb 1999 by S.P.											*/
/*											*/
/****************************************************************************************/

#ifndef _AMD29LV800_H
#define _AMD29LV800_H

/****************************************************************************************/
/*											*/
/*  These are descriptors for the internal layout of the AMDF29LV800 Flash.		*/
/*											*/
/****************************************************************************************/

#define AMD29LV800_BLOCK_SIZE		(4 * 1024)
#define AMD29LV800_BLOCKS		(256)

#define AMD29LV800_ADDR1		(0x555)
#define AMD29LV800_ADDR2		(0x2AA)

/****************************************************************************************/
/*											*/
/*  These are the command lines to be used with a 32-bit bus				*/
/*											*/
/****************************************************************************************/

#if (defined(AMD29LV800_32BIT_WIDE))

typedef volatile uint32		AMD29LV800_CELL;

	/************************************************************************/
	/*  Used to enter Reset/Read mode.					*/
	/************************************************************************/
#define AMD29LV800_READ_CMD		(0xF0F0F0F0)

	/************************************************************************/
	/*  Prepares Flash for command.  Used by all except			*/
	/*  Reset/Read, Erase Suspend, and Erase Resume commands.		*/
	/************************************************************************/
#define AMD29LV800_UNLOCK_CMD1		(0xAAAAAAAA)
#define AMD29LV800_UNLOCK_CMD2		(0x55555555)

	/************************************************************************/
	/*  Used to read device data (manuf, id) and verify sector protection.	*/
	/************************************************************************/
#define AMD29LV800_AUTOSELECT_CMD	(0x90909090)

	/************************************************************************/
	/*  Prepares the Flash for programming.					*/
	/************************************************************************/
#define AMD29LV800_BYTEPROG_CMD3	(0xA0A0A0A0)

	/************************************************************************/
	/*  Prepares the Flash for an erase command.				*/
	/*  Unlock must be sent again before the erase commmand.		*/
	/************************************************************************/
#define AMD29LV800_ERASE_CMD		(0x80808080)

	/************************************************************************/
	/*  Chip Erase command.							*/
	/************************************************************************/
#define AMD29LV800_CHIPERASE_CMD	(0x10101010)

	/************************************************************************/
	/*  Sector Erase command.						*/
	/************************************************************************/
#define AMD29LV800_SECTORERASE_CMD	(0x30303030)

	/************************************************************************/
	/*  Chip identification information.  May be top boot block or bottom.	*/
	/*  Top is default if nothing is defined.				*/
	/************************************************************************/
#define AMD29LV800_AMD_CODE		(0x01010101)
#if (defined(AMD29LV800B))
 #define AMD29LV800_DEVICE_CODE		(0x225B225B)
#else	/* AMD29LV800B */
 #define AMD29LV800_DEVICE_CODE		(0x22DA22DA)
#endif	/* AMD29LV800B */

	/************************************************************************/
	/*  Mask for bit that signifies the end of a Sector Erase.		*/
	/************************************************************************/
#define AMD29LV800_ERASE_DONE		(0x80808080)

	/************************************************************************/
	/*  Mask for bit that signifies the end of a Sector Program		*/
	/************************************************************************/
#define AMD29LV800_DATA_POLL_MASK	(0x80808080)

	/************************************************************************/
	/*  Mask for bit that signifies error in Sector Erase or Program	*/
	/************************************************************************/
#define AMD29LV800_TIME_EXCEEDED	(0x20202020)

#endif	/* AMD29LV800_32BIT_WIDE */

/****************************************************************************************/
/*											*/
/*  These are the command lines to be used with a 16-bit bus				*/
/*	(See comments from 32-bit bus section above)					*/
/*											*/
/****************************************************************************************/

#if (defined(AMD29LV800_16BIT_WIDE))

typedef volatile uint16		AMD29LV800_CELL;

#define AMD29LV800_READ_CMD		(0xF0F0)

#define AMD29LV800_UNLOCK_CMD1		(0xAAAA)
#define AMD29LV800_UNLOCK_CMD2		(0x5555)

#define AMD29LV800_AUTOSELECT_CMD	(0x9090)
#define AMD29LV800_BYTEPROG_CMD		(0xA0A0)

#define AMD29LV800_ERASE_CMD		(0x8080)
#define AMD29LV800_CHIPERASE_CMD	(0x1010)
#define AMD29LV800_SECTORERASE_CMD	(0x3030)

#define AMD29LV800_AMD_CODE		(0x0001)
#if (defined(AMD29LV800B))
 #define AMD29LV800_DEVICE_CODE		(0x225B)
#else	/* AMD29LV800B */
 #define AMD29LV800_DEVICE_CODE		(0x22DA)
#endif	/* AMD29LV800B */

#define AMD29LV800_ERASE_DONE		(0x8080)
#define AMD29LV800_DATA_POLL_MASK	(0x8080)
#define AMD29LV800_TIME_EXCEEDED	(0x2020)

#endif	/* AMD29LV800_16BIT_WIDE */

/****************************************************************************************/
/*											*/
/*  These are the command lines to be used with a 8-bit bus				*/
/*	(See comments from 32-bit bus section above)					*/
/*											*/
/****************************************************************************************/

#if (defined(AMD29LV800_8BIT_WIDE))

typedef volatile uint8		AMD29LV800_CELL;

#define AMD29LV800_READ_CMD		(0xF0)

#define AMD29LV800_UNLOCK_CMD1		(0xAA)
#define AMD29LV800_UNLOCK_CMD2		(0x55)

#define AMD29LV800_AUTOSELECT_CMD	(0x90)
#define AMD29LV800_BYTEPROG_CMD		(0xA0)

#define AMD29LV800_ERASE_CMD		(0x80)
#define AMD29LV800_CHIPERASE_CMD	(0x10)
#define AMD29LV800_SECTORERASE_CMD	(0x30)

#define AMD29LV800_AMD_CODE		(0x01)
#if (defined(AMD29LV800B))
 #define AMD29LV800_DEVICE_CODE		(0xB6)
#else	/* AMD29LV800B */
 #define AMD29LV800_DEVICE_CODE		(0xB5)
#endif	/* AMD29LV800B */

#define AMD29LV800_ERASE_DONE		(0x80)
#define AMD29LV800_DATA_POLL_MASK	(0x80)
#define AMD29LV800_TIME_EXCEEDED	(0x20)

#endif	/* AMD29LV800_8BIT_WIDE */

/****************************************************************************************/
/*											*/
/*  Setup Internal structures								*/
/*  Values shown below are derived from Sector size divided by 4			*/
/****************************************************************************************/

typedef enum
{
	AMD29LV800_SECTOR_0 = 0,
	AMD29LV800_SECTOR_1 = 2,
	AMD29LV800_SECTOR_2 = 3,
	AMD29LV800_SECTOR_3 = 4,
	AMD29LV800_SECTOR_4 = 8,
	AMD29LV800_SECTOR_5 = 16,
	AMD29LV800_SECTOR_6 = 24,
	AMD29LV800_SECTOR_7 = 32,
	AMD29LV800_SECTOR_8 = 40,
	AMD29LV800_SECTOR_9 = 48,
	AMD29LV800_SECTOR_10 = 56,
	AMD29LV800_SECTOR_11 = 64,
	AMD29LV800_SECTOR_12 = 72,
	AMD29LV800_SECTOR_13 = 80,
	AMD29LV800_SECTOR_14 = 88,
	AMD29LV800_SECTOR_15 = 96,
	AMD29LV800_SECTOR_16 = 104,
	AMD29LV800_SECTOR_17 = 112,
	AMD29LV800_SECTOR_18 = 120
} AMD29LV800_SECTOR;

typedef volatile struct
{
	AMD29LV800_CELL		manuf;
	AMD29LV800_CELL		id;
	AMD29LV800_CELL		dataA[AMD29LV800_ADDR2 - 2];
	AMD29LV800_CELL		cmdreg2;
	AMD29LV800_CELL		dataB[AMD29LV800_ADDR1 - AMD29LV800_ADDR2 - 1];
	AMD29LV800_CELL		cmdreg1;
} AMD29LV800_DEVICE;

typedef volatile struct
{
	AMD29LV800_CELL		data[AMD29LV800_BLOCK_SIZE];
} AMD29LV800_SECTORDATA;

typedef volatile union
{
	AMD29LV800_DEVICE	device;
	AMD29LV800_SECTORDATA	sector[AMD29LV800_BLOCKS];
} AMD29LV800;

/****************************************************************************************/

#endif /* _AMD29LV800_H */

⌨️ 快捷键说明

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