Patchwork AAI on SST chips (was: Re: AAI on SST25VF016B)

login
register
about
Submitter Noé Rubinstein
Date 2011-08-01 10:10:17
Message ID <20110801101017.GB13511@xivo-clients.proformatique.com>
Download mbox | patch
Permalink /patch/3324/
State Accepted
Headers show

Comments

Noé Rubinstein - 2011-08-01 10:10:17
Use AAI for some SST chips

Patch updated, based on Joshua Roys' patch
http://patchwork.coreboot.org/patch/2065/
I double checked against the datasheets. Also wrapped the comments to
respect 80-columns line width.

Use AAI:
SST25VF016B
SST25VF040B{,.REMS}
SST25VF080B

Datasheets say AAI is supported, but via a different opcode:
SST25VF040.REMS
SST25LF040A.RES

Signed-off-by: Noé Rubinstein <nrubinstein@avencall.com>
---
Joshua Roys - 2011-08-01 11:43:38
On 08/01/2011 06:10 AM, Noé Rubinstein wrote:
> Use AAI for some SST chips
>
> Patch updated, based on Joshua Roys' patch
> http://patchwork.coreboot.org/patch/2065/
> I double checked against the datasheets. Also wrapped the comments to
> respect 80-columns line width.
>
> Use AAI:
> SST25VF016B
> SST25VF040B{,.REMS}
> SST25VF080B
>
> Datasheets say AAI is supported, but via a different opcode:
> SST25VF040.REMS
> SST25LF040A.RES
>
> Signed-off-by: Noé Rubinstein <nrubinstein@avencall.com>

Signed-off-by: Joshua Roys <roysjosh@gmail.com>

> ---
> Index: flashchips.c
> ===================================================================
> --- flashchips.c	(revision 1401)
> +++ flashchips.c	(working copy)
> @@ -5606,7 +5606,7 @@
>   			},
>   		},
>   		.unlock		= spi_disable_blockprotect,
> -		.write		= spi_chip_write_1,
> +		.write		= spi_aai_write,
>   		.read		= spi_chip_read,
>   		.voltage	= {2700, 3600},
>   	},
> @@ -5708,7 +5708,8 @@
>   			},
>   		},
>   		.unlock		= spi_disable_blockprotect,
> -		.write		= spi_chip_write_1,
> +		.write		= spi_chip_write_1, /* datasheet says AAI using
> +						       0xAF ? */
>   		.read		= spi_chip_read,
>   		.voltage	= {2700, 3600},
>   	},
> @@ -5744,7 +5745,7 @@
>   			},
>   		},
>   		.unlock		= spi_disable_blockprotect,
> -		.write		= spi_chip_write_1,
> +		.write		= spi_aai_write,
>   		.read		= spi_chip_read,
>   		.voltage	= {2700, 3600},
>   	},
> @@ -5774,7 +5775,8 @@
>   			},
>   		},
>   		.unlock		= spi_disable_blockprotect,
> -		.write		= spi_chip_write_1,
> +		.write		= spi_chip_write_1, /* datasheet says AAI using
> +						       0xAF ? */
>   		.read		= spi_chip_read,
>   		.voltage	= {3000, 3600},
>   	},
> @@ -5810,7 +5812,7 @@
>   			},
>   		},
>   		.unlock		= spi_disable_blockprotect,
> -		.write		= spi_chip_write_1,
> +		.write		= spi_aai_write,
>   		.read		= spi_chip_read,
>   		.voltage	= {2700, 3600},
>   	},
> @@ -5846,7 +5848,7 @@
>   			},
>   		},
>   		.unlock		= spi_disable_blockprotect,
> -		.write		= spi_chip_write_1,
> +		.write		= spi_aai_write,
>   		.read		= spi_chip_read,
>   		.voltage	= {2700, 3600},
>   	},
>
> _______________________________________________
> flashrom mailing list
> flashrom@flashrom.org
> http://www.flashrom.org/mailman/listinfo/flashrom
Stefan Tauner - 2011-08-01 18:44:25
On Mon, 01 Aug 2011 07:43:38 -0400
Joshua Roys <roysjosh@gmail.com> wrote:

> On 08/01/2011 06:10 AM, Noé Rubinstein wrote:
> > Use AAI for some SST chips
> >
> > Patch updated, based on Joshua Roys' patch
> > http://patchwork.coreboot.org/patch/2065/
> > I double checked against the datasheets. Also wrapped the comments to
> > respect 80-columns line width.
> >
> > Use AAI:
> > SST25VF016B
> > SST25VF040B{,.REMS}
> > SST25VF080B
> >
> > Datasheets say AAI is supported, but via a different opcode:
> > SST25VF040.REMS
> > SST25LF040A.RES
> >
> > Signed-off-by: Noé Rubinstein <nrubinstein@avencall.com>  
> 
> Signed-off-by: Joshua Roys <roysjosh@gmail.com>

hello you two,

of course joshua deserves the signed-off for his initial patch. i have
reverted the line wrapping, because we dont use that in flashchips.c
afaics (and it does not make sense anyway imo :)

i have now committed the result in r1402 as
Signed-off-by: Joshua Roys <roysjosh@gmail.com>
Rebased and
Acked-by: Noé Rubinstein <nrubinstein@avencall.com>

i hope that is ok for both of you (it has to ;) and want to thank you
both for your work of digging through the datasheets!
Tim Small - 2011-08-01 20:24:57
On 01/08/11 11:10, Noé Rubinstein wrote:
> +		.write		= spi_chip_write_1, /* datasheet says AAI using
> +						       0xAF ? */
> +		.write		= spi_chip_write_1, /* datasheet says AAI using
> +						       0xAF ? */
>   

These (SST25LF020A / SST25LF040A and SST25VF040) have an "AAI" mode
which only writes a single byte at a time, not two.

The AT26F004 has what looks like the same mode to me (same 0xAF opcode
too), and I wrote (and have tested) code to support that (
spi_at26_write_sequential ) in my AT26F004 patch (currently in the patch
queue - http://patchwork.coreboot.org/patch/3186/ ).

Googling for

+spi 0xAF

shows up a few other implementations (including one in the Linux kernel,
by the look of it).

Tim.

Patch

Index: flashchips.c
===================================================================
--- flashchips.c	(revision 1401)
+++ flashchips.c	(working copy)
@@ -5606,7 +5606,7 @@ 
 			},
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_1,
+		.write		= spi_aai_write,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -5708,7 +5708,8 @@ 
 			},
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_1,
+		.write		= spi_chip_write_1, /* datasheet says AAI using
+						       0xAF ? */
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -5744,7 +5745,7 @@ 
 			},
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_1,
+		.write		= spi_aai_write,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -5774,7 +5775,8 @@ 
 			},
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_1,
+		.write		= spi_chip_write_1, /* datasheet says AAI using
+						       0xAF ? */
 		.read		= spi_chip_read,
 		.voltage	= {3000, 3600},
 	},
@@ -5810,7 +5812,7 @@ 
 			},
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_1,
+		.write		= spi_aai_write,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -5846,7 +5848,7 @@ 
 			},
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_1,
+		.write		= spi_aai_write,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},