Patchworkβ Confirm EN29LV800 bus, timing, and page size

login
register
about
Submitter TJ
Date 2010-02-06 00:29:22
Message ID <1265416162.32362.94.camel@hephaestion>
Download mbox | patch
Permalink /patch/884/
State Superseded
Headers show

Comments

TJ - 2010-02-06 00:29:22
Uncertain values now confirmed.

If you're happy with the new EN29LV800 code I'll submit a combined patch
with a Signed-off-by tag.
---
 flashchips.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
Sean Nelson - 2010-02-06 02:59:13
On 2/5/10 4:29 PM, TJ wrote:
> Uncertain values now confirmed.
>
> If you're happy with the new EN29LV800 code I'll submit a combined patch
> with a Signed-off-by tag.
> ---
>   flashchips.c |   12 ++++++------
>   1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/flashchips.c b/flashchips.c
> index b5be180..10b8dea 100644
> --- a/flashchips.c
> +++ b/flashchips.c
> @@ -2166,15 +2166,15 @@ struct flashchip flashchips[] = {
>   	{
>   		.vendor		= "EON",
>   		.name		= "EN29LV800(B)(C)B",
> -		.bustype	= CHIP_BUSTYPE_UNKNOWN,
> +		.bustype	= CHIP_BUSTYPE_PARALLEL,
>   		.manufacture_id	= EON_ID,
>   		.model_id	= EN_29LV800B,
>   		.total_size	= 1024,
> -		.page_size	= 1024, // TODO: check this
> +		.page_size	= 1024,
>   		.feature_bits	= FEATURE_ADDR_AAA | FEATURE_EITHER_RESET,
>   		.tested		= TEST_UNTESTED,
>   		.probe		= probe_jedec,
> -		.probe_timing	= TIMING_ZERO,	/* TODO: check Datasheet has no timing info specified */
> +		.probe_timing	= TIMING_ZERO,
>   		.erase		= NULL,
>   		.block_erasers	=
>   		{
> @@ -2198,15 +2198,15 @@ struct flashchip flashchips[] = {
>   	{
>   		.vendor		= "EON",
>   		.name		= "EN29LV800(B)(C)T",
> -		.bustype	= CHIP_BUSTYPE_UNKNOWN,
> +		.bustype	= CHIP_BUSTYPE_PARALLEL,
>   		.manufacture_id	= EON_ID,
>   		.model_id	= EN_29LV800T,
>   		.total_size	= 1024,
> -		.page_size	= 1024, // TODO: check this
> +		.page_size	= 1024,
>   		.feature_bits	= FEATURE_ADDR_AAA | FEATURE_EITHER_RESET,
>   		.tested		= TEST_UNTESTED,
>   		.probe		= probe_jedec,
> -		.probe_timing	= TIMING_ZERO,	/* TODO: check Datasheet has no timing info specified */
> +		.probe_timing	= TIMING_ZERO,
>   		.erase		= NULL,
>   		.block_erasers	=
>   		{
>    
EN29LV800 is not a JEDEC compatible chip, it uses an odd command 
sequence like the M29F400BT
TJ - 2010-02-06 04:05:30
On Fri, 2010-02-05 at 18:59 -0800, Sean Nelson wrote:
    
> EN29LV800 is not a JEDEC compatible chip, it uses an odd command 
> sequence like the M29F400BT

Are EON incorrect in the datasheet then, or is there a subtle
distinction between what flashrom means with JEDEC and what EON mean?

The datasheet says:

• JEDEC Standard program and erase commands
• JEDEC standard DATA polling and toggle bits feature

I saw the custom probe functions for EN29F512 and EN29F002A but wasn't
clear that would be needed although I did see they match the datasheet
probe sequence.

I compared the probes to the datasheets because the code questions how
to exit autoselect mode and my reading of it is that it only needs a:

 chip_writeb(0xF0, bios + 0x555); // write address can be any value

since the datasheets say "The system must write the reset command to
exit the autoselect mode and return to reading array data" and the same
for interrupting erase/program modes.

Does it follow that the erase/write operations will also need custom
functions if JEDEC isn't really supported?

I guess I need to get up to speed on JEDEC and the rest of flashrom - I
only came across flashrom last night in pursuit of some clues for
manipulating Phoenix BIOS settings.
Sean Nelson - 2010-02-06 09:29:36
On 2/5/10 8:05 PM, TJ wrote:
> On Fri, 2010-02-05 at 18:59 -0800, Sean Nelson wrote:
>
>    
>> EN29LV800 is not a JEDEC compatible chip, it uses an odd command
>> sequence like the M29F400BT
>>      
> Are EON incorrect in the datasheet then, or is there a subtle
> distinction between what flashrom means with JEDEC and what EON mean?
>
> The datasheet says:
>
> • JEDEC Standard program and erase commands
> • JEDEC standard DATA polling and toggle bits feature
>
> I saw the custom probe functions for EN29F512 and EN29F002A but wasn't
> clear that would be needed although I did see they match the datasheet
> probe sequence.
>
> I compared the probes to the datasheets because the code questions how
> to exit autoselect mode and my reading of it is that it only needs a:
>
>   chip_writeb(0xF0, bios + 0x555); // write address can be any value
>
> since the datasheets say "The system must write the reset command to
> exit the autoselect mode and return to reading array data" and the same
> for interrupting erase/program modes.
>
> Does it follow that the erase/write operations will also need custom
> functions if JEDEC isn't really supported?
>
> I guess I need to get up to speed on JEDEC and the rest of flashrom - I
> only came across flashrom last night in pursuit of some clues for
> manipulating Phoenix BIOS settings.
>
>
> _______________________________________________
> flashrom mailing list
> flashrom@flashrom.org
> http://www.flashrom.org/mailman/listinfo/flashrom
JEDEC has a 5555/2AAA/5555 command sequence, where as EON uses a 
AAA/555/AAA. Our code is byte based.
Carl-Daniel Hailfinger - 2010-03-15 03:36:57
Hi TJ,

thanks for your EN29LV800 patches.
The caveat mentioned by Sean is indeed something important. Looking at
the EN29LV800 datasheet, you'll find the following description:
"8 Megabit (1024K x 8-bit / 512K x 16-bit) Flash Memory"
This indicates a dual-mode flash, and that means you have to use
different addresses for commands depending on whether you're using that
chip in 8-bit or 16-bit mode.
Table 5 (EN29LV800 Command Definitions) in said datasheet lists command
addresses for Word mode and Byte mode. Word mode uses standard JEDEC
addresses, but Byte mode uses JEDEC addresses shifted left by 1 bit.
These flash chips are wired to 8 bit on x86 mainboards, so you have to
pick the command addresses in Byte mode.

On 06.02.2010 10:29, Sean Nelson wrote:
> On 2/5/10 8:05 PM, TJ wrote:
>> On Fri, 2010-02-05 at 18:59 -0800, Sean Nelson wrote:   
>>> EN29LV800 is not a JEDEC compatible chip, it uses an odd command
>>> sequence like the M29F400BT
>>>      
>> Are EON incorrect in the datasheet then, or is there a subtle
>> distinction between what flashrom means with JEDEC and what EON mean?
>>
>> The datasheet says:
>>
>> • JEDEC Standard program and erase commands
>> • JEDEC standard DATA polling and toggle bits feature
>>
> JEDEC has a 5555/2AAA/5555 command sequence, where as EON uses a
> AAA/555/AAA. Our code is byte based.

m29f400bt.c is very similar to jedec.c, but it uses JEDEC addresses left
shifted by 1 bit, so I think using the functions in that file should
mostly work. There might be a need to rewrite the erase/write functions
to be more generic (well, to look similar to those in jedec.c instead of
hard-coding the eraseblock layout).
A good start to copy the flash chip definition from is probably the
M29F400BT entry. If you decide to modify your current patch instead,
please make sure to adjust the .feature_bits and to remove the .erase
line (the latter has been eliminated in latest flashrom).

I hope this explanation was helpful for you.

If possible, please provide one combined patch for the EN29LF800 against
latest flashrom, and add your signoff. That makes it easier to review
and apply the patch. If you believe the patch is not ready yet, just
mention that in the mail and we'll wait with applying and/or do a more
thorough review.

Regards,
Carl-Daniel

Patch

diff --git a/flashchips.c b/flashchips.c
index b5be180..10b8dea 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -2166,15 +2166,15 @@  struct flashchip flashchips[] = {
 	{
 		.vendor		= "EON",
 		.name		= "EN29LV800(B)(C)B",
-		.bustype	= CHIP_BUSTYPE_UNKNOWN,
+		.bustype	= CHIP_BUSTYPE_PARALLEL,
 		.manufacture_id	= EON_ID,
 		.model_id	= EN_29LV800B,
 		.total_size	= 1024,
-		.page_size	= 1024, // TODO: check this
+		.page_size	= 1024,
 		.feature_bits	= FEATURE_ADDR_AAA | FEATURE_EITHER_RESET,
 		.tested		= TEST_UNTESTED,
 		.probe		= probe_jedec,
-		.probe_timing	= TIMING_ZERO,	/* TODO: check Datasheet has no timing info specified */
+		.probe_timing	= TIMING_ZERO,
 		.erase		= NULL,
 		.block_erasers	=
 		{
@@ -2198,15 +2198,15 @@  struct flashchip flashchips[] = {
 	{
 		.vendor		= "EON",
 		.name		= "EN29LV800(B)(C)T",
-		.bustype	= CHIP_BUSTYPE_UNKNOWN,
+		.bustype	= CHIP_BUSTYPE_PARALLEL,
 		.manufacture_id	= EON_ID,
 		.model_id	= EN_29LV800T,
 		.total_size	= 1024,
-		.page_size	= 1024, // TODO: check this
+		.page_size	= 1024,
 		.feature_bits	= FEATURE_ADDR_AAA | FEATURE_EITHER_RESET,
 		.tested		= TEST_UNTESTED,
 		.probe		= probe_jedec,
-		.probe_timing	= TIMING_ZERO,	/* TODO: check Datasheet has no timing info specified */
+		.probe_timing	= TIMING_ZERO,
 		.erase		= NULL,
 		.block_erasers	=
 		{