Memory Card Explorer for the Elan P423

Glen Slick glen.slick at gmail.com
Thu Jul 7 17:18:23 CDT 2022


On Wed, Jul 6, 2022 at 7:51 PM Glen Slick <glen.slick at gmail.com> wrote:
>
> I'll have to boot up again the Linux system I had set up for this and
> refresh my memory on some of the details. If I remember correctly, one
> of the things I had to do was to rebuild the pcmcia driver with the
> CONFIG_MTD_PCMCIA_ANONYMOUS option enabled. Some of the linear flash
> cards I have might not have a separate attribute memory plane and no
> valid CIS, so the card wouldn't get recognized without that option
> enabled. Pretty sure there was something else I had to change to get
> things to work with some of the cards I have. Just don't remember now.
>

Maybe no one else is interested in this detail, but just for future
reference reference, it looks like one of the changes I had to make to
get the MTD driver to work with some of my linear flash cards was to
this read_pri_intelext() routine in this source file:

drivers / mtd / chips / cfi_cmdset_0001.c

from:

    if (extp->MinorVersion >= '0') {
        extra_size = 0;

        /* Protection Register info */
        extra_size += (extp->NumProtectionFields - 1) *
                  sizeof(struct cfi_intelext_otpinfo);
    }

    if (extp->MinorVersion >= '1') {
        /* Burst Read info */
        extra_size += 2;
        if (extp_size < sizeof(*extp) + extra_size)
            goto need_more;
        extra_size += extp->extra[extra_size - 1];
    }

to:

    extra_size = 0;

    if ((extp->MinorVersion >= '0') && (extp->FeatureSupport & 64)) {
        /* Protection Register info */
        extra_size += (extp->NumProtectionFields - 1) *
                  sizeof(struct cfi_intelext_otpinfo);
    }

    if ((extp->MinorVersion >= '1') && (extp->FeatureSupport & 128)) {
        /* Burst Read info */
        extra_size += 2;
        if (extp_size < sizeof(*extp) + extra_size)
            goto need_more;
        extra_size += extp->extra[extra_size - 1];
    }

The problem with the original code is that without checking the
Optional Feature and Command Support bits, it assumes that if the
Intel CFI Primary Vendor-Specific Extended Query Table exists then the
flash device has OTP support, and if the Minor Version is >=1 then the
flash device has Page Mode Read support. According to the 290606-015
datasheet for Intel 28F320J5 and 28F640J5 StrataFlash devices the
Minor Version number in the Intel CFI Primary Vendor-Specific Extended
Query Table is 1, but those device do not have OTP support nor do they
have Page Mode Read support, which causes the read_pri_intelext() fail
or hang while trying to parse the Intel CFI Primary Vendor-Specific
Extended Query Table.

I must have some linear flash cards that are based on Intel 28F320J5
or 28F640J5 StrataFlash devices that encountered this issue. Without
going through my stack of cards I don't remember which cards those
might be.


More information about the cctalk mailing list