[flashrom] [PATCH] eraseblocks for mx25

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Wed Sep 16 16:22:44 CEST 2009


On 06.09.2009 15:11, Carl-Daniel Hailfinger wrote:
> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>   

Again, this time with changelog.

Add comments about the meaning of block erase related struct flashchip
members.
Cosmetics: Place curly brackets on a common line.
Add MX25V512 as alias name to MX25L512.
Add erase block definitions for
MX25L2005, MX25L4005, MX25L8005, MX25L1605


> Index: flashrom-eraseblocks_mx25/flashchips.c
> ===================================================================
> --- flashrom-eraseblocks_mx25/flashchips.c	(Revision 719)
> +++ flashrom-eraseblocks_mx25/flashchips.c	(Arbeitskopie)
> @@ -44,6 +44,11 @@
>  	 * .probe		= Probe function
>  	 * .probe_timing	= Probe function delay
>  	 * .erase		= Chip erase function
> +	 * .block_erasers[]	= Array of erase layouts and erase functions
> +	 * {
> +	 *	.eraseblocks[]	= Array of { blocksize, blockcount }
> +	 *	.block_erase	= Block erase function
> +	 * }
>  	 * .write		= Chip write function
>  	 * .read		= Chip read function
>  	 */
> @@ -1235,20 +1240,16 @@
>  			{
>  				.eraseblocks = { {4 * 1024, 16} },
>  				.block_erase = spi_block_erase_20,
> -			},
> -			{
> +			}, {
>  				.eraseblocks = { {64 * 1024, 1} },
>  				.block_erase = spi_block_erase_52,
> -			},
> -			{
> +			}, {
>  				.eraseblocks = { {64 * 1024, 1} },
>  				.block_erase = spi_block_erase_d8,
> -			},
> -			{
> +			}, {
>  				.eraseblocks = { {64 * 1024, 1} },
>  				.block_erase = spi_block_erase_60,
> -			},
> -			{
> +			}, {
>  				.eraseblocks = { {64 * 1024, 1} },
>  				.block_erase = spi_block_erase_c7,
>  			},
> @@ -1274,16 +1275,13 @@
>  			{
>  				.eraseblocks = { {4 * 1024, 32} },
>  				.block_erase = spi_block_erase_20,
> -			},
> -			{
> +			}, {
>  				.eraseblocks = { {64 * 1024, 2} },
>  				.block_erase = spi_block_erase_d8,
> -			},
> -			{
> +			}, {
>  				.eraseblocks = { {128 * 1024, 1} },
>  				.block_erase = spi_block_erase_60,
> -			},
> -			{
> +			}, {
>  				.eraseblocks = { {128 * 1024, 1} },
>  				.block_erase = spi_block_erase_c7,
>  			},
> @@ -1304,6 +1302,25 @@
>  		.probe		= probe_spi_rdid,
>  		.probe_timing	= TIMING_ZERO,
>  		.erase		= spi_chip_erase_60_c7,
> +		.block_erasers	=
> +		{
> +			{
> +				.eraseblocks = { {4 * 1024, 64} },
> +				.block_erase = spi_block_erase_20,
> +			}, {
> +				.eraseblocks = { {64 * 1024, 4} },
> +				.block_erase = spi_block_erase_52,
> +			}, {
> +				.eraseblocks = { {64 * 1024, 4} },
> +				.block_erase = spi_block_erase_d8,
> +			}, {
> +				.eraseblocks = { {256 * 1024, 1} },
> +				.block_erase = spi_block_erase_60,
> +			}, {
> +				.eraseblocks = { {256 * 1024, 1} },
> +				.block_erase = spi_block_erase_c7,
> +			},
> +		},
>  		.write		= spi_chip_write_256,
>  		.read		= spi_chip_read,
>  	},
> @@ -1320,6 +1337,25 @@
>  		.probe		= probe_spi_rdid,
>  		.probe_timing	= TIMING_ZERO,
>  		.erase		= spi_chip_erase_60_c7,
> +		.block_erasers	=
> +		{
> +			{
> +				.eraseblocks = { {4 * 1024, 128} },
> +				.block_erase = spi_block_erase_20,
> +			}, {
> +				.eraseblocks = { {64 * 1024, 8} },
> +				.block_erase = spi_block_erase_52,
> +			}, {
> +				.eraseblocks = { {64 * 1024, 8} },
> +				.block_erase = spi_block_erase_d8,
> +			}, {
> +				.eraseblocks = { {512 * 1024, 1} },
> +				.block_erase = spi_block_erase_60,
> +			}, {
> +				.eraseblocks = { {512 * 1024, 1} },
> +				.block_erase = spi_block_erase_c7,
> +			},
> +		},
>  		.write		= spi_chip_write_256,
>  		.read		= spi_chip_read,
>  	},
> @@ -1336,6 +1372,25 @@
>  		.probe		= probe_spi_rdid,
>  		.probe_timing	= TIMING_ZERO,
>  		.erase		= spi_chip_erase_60_c7,
> +		.block_erasers	=
> +		{
> +			{
> +				.eraseblocks = { {4 * 1024, 256} },
> +				.block_erase = spi_block_erase_20,
> +			}, {
> +				.eraseblocks = { {64 * 1024, 16} },
> +				.block_erase = spi_block_erase_52,
> +			}, {
> +				.eraseblocks = { {64 * 1024, 16} },
> +				.block_erase = spi_block_erase_d8,
> +			}, {
> +				.eraseblocks = { {1024 * 1024, 1} },
> +				.block_erase = spi_block_erase_60,
> +			}, {
> +				.eraseblocks = { {1024 * 1024, 1} },
> +				.block_erase = spi_block_erase_c7,
> +			},
> +		},
>  		.write		= spi_chip_write_256,
>  		.read		= spi_chip_read,
>  	},
> @@ -1352,6 +1407,25 @@
>  		.probe		= probe_spi_rdid,
>  		.probe_timing	= TIMING_ZERO,
>  		.erase		= spi_chip_erase_60_c7,
> +		.block_erasers	=
> +		{
> +			{
> +				.eraseblocks = { {4 * 1024, 512} },
> +				.block_erase = spi_block_erase_20,	/* This erase function has 64k blocksize for eLiteFlash */
> +			}, {
> +				.eraseblocks = { {64 * 1024, 32} },	/* Not supported in MX25L1605 (eLiteFlash) and MX25L1605D/MX25L1635D */
> +				.block_erase = spi_block_erase_52,
> +			}, {
> +				.eraseblocks = { {64 * 1024, 32} },
> +				.block_erase = spi_block_erase_d8,
> +			}, {
> +				.eraseblocks = { {2 * 1024 * 1024, 1} },
> +				.block_erase = spi_block_erase_60,
> +			}, {
> +				.eraseblocks = { {2 * 1024 * 1024, 1} },
> +				.block_erase = spi_block_erase_c7,
> +			},
> +		},
>  		.write		= spi_chip_write_256,
>  		.read		= spi_chip_read,
>  	},
> Index: flashrom-eraseblocks_mx25/flashchips.h
> ===================================================================
> --- flashrom-eraseblocks_mx25/flashchips.h	(Revision 719)
> +++ flashrom-eraseblocks_mx25/flashchips.h	(Arbeitskopie)
> @@ -251,7 +251,7 @@
>   * and use the same set of IDs.
>   */
>  #define MX_ID			0xC2	/* Macronix (MX) */
> -#define MX_25L512		0x2010	/* 2^19 kbit or 2^16 kByte */
> +#define MX_25L512		0x2010	/* Same as MX25V512 */
>  #define MX_25L1005		0x2011
>  #define MX_25L2005		0x2012
>  #define MX_25L4005		0x2013	/* MX25L4005{,A} */
>
>
>   


-- 
http://www.hailfinger.org/





More information about the flashrom mailing list