public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: ebiederman@lnxi.com (Eric W. Biederman)
To: Andy Hawkins <a.hawkins@cabletime.com>
Cc: D.A.Fedorov@inp.nsk.su, linux-mtd@lists.infradead.org,
	Thayne Harbaugh <tharbaugh@lnxi.com>
Subject: Re: Problem writing to NOR flash
Date: 05 Aug 2004 17:24:39 -0600	[thread overview]
Message-ID: <m37jsdnp6w.fsf@maxwell.lnxi.com> (raw)
In-Reply-To: <1090858047.2219.77.camel@adh>

Andy Hawkins <a.hawkins@cabletime.com> writes:

> Hi all,
> 
> After a bit more digging and reading of the data sheet, it appears the
> the chip I'm using doesn't need locking and unlocking. I then went back
> to the version of the code where we had this working (whatever came with
> the 2.4.20 kernel) and found that none of this locking / unlocking
> mechanism was present.
> 
> So, to test I commented out the contents of cfi_amdstd_lock_varsize and
> cfi_amdstd_unlock_varsize, and I can now successfully write to the NOR!
> 
> Are these functions only required for some very specific chips? 

Yes.

> If so,
> what is the *correct* way for this code to determine whether or not they
> are needed (this code is in a 'generic' file, so I'm surprised that
> there's chip specific information in there).

When Thayne wrote the code he was assuming that since there were no
lock/unlock functions the lock/unlock entry points were simply
not called.  And he figured if it actually broken something someone
would scream.  And then he thought someone had removed the code
when cfi_cmdset_0002 was scrubbed a while ago.

In addition that code really is generic, it applies to firmware
hub parts and there are chips that use both cfi_cmdset_0001 and
cfi_cmdset_0002 that can use it.

When I get a chance it is my intention to refactor the probing
routines to make handling of chips with special capabilities
simpler.

As a first step I am putting a few conditionals in cfi_amdstd_setup
so that chips that we won't use those methods on chips that
don't support them.  Then we can look at better ways to organize
the probe code so the probe/setup code is not such a mess.

I have the first chunk done but I'm not ready to check it
in until I have a chance to test it.  And I am swamped right now...

Eric

  reply	other threads:[~2004-08-05 23:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26 13:32 Problem writing to NOR flash Andy Hawkins
2004-07-26 14:00 ` Dmitry A. Fedorov
2004-07-26 14:11   ` Andy Hawkins
2004-07-26 14:35     ` Dmitry A. Fedorov
2004-07-26 14:49       ` Andy Hawkins
2004-07-26 15:00         ` Dmitry A. Fedorov
2004-07-26 15:39           ` Andy Hawkins
2004-07-26 16:07             ` Andy Hawkins
2004-08-05 23:24               ` Eric W. Biederman [this message]
2004-08-12  6:59                 ` Eric W. Biederman
2004-07-29 19:41 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2004-07-19 16:06 Andy Hawkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m37jsdnp6w.fsf@maxwell.lnxi.com \
    --to=ebiederman@lnxi.com \
    --cc=D.A.Fedorov@inp.nsk.su \
    --cc=a.hawkins@cabletime.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tharbaugh@lnxi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox