public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Zachi Friedman <zachi.friedman@m-sys.com>
Cc: linux-mtd@lists.infradead.org
Subject: RE: DiskOnChip 2000 128Mb problem
Date: Sat, 31 May 2003 14:19:13 +0100	[thread overview]
Message-ID: <1054387153.8432.30.camel@imladris.demon.co.uk> (raw)
In-Reply-To: <1054386483.8432.5.camel@imladris.demon.co.uk>

Zachi Friedman <zachi.friedman@m-sys.com> writes:
> So, once you have chip ID of 0x30, how can you tell whether it's a
> Millennium or the newer DiskOnChip 2000?  You have to read chip ID 4 
> times. If the 4th read is NOT 0x30 - it's a new DiskOnChip 2000 !

Thanks for the information. You say it has a new ASIC -- other than the
ChipID, in what other ways does it behave like a Millennium rather than
a DiskOnChip 2000?

It looks like it was passing the Millennium version of the 'toggle'
test, where we read the ECCConf register, rather than the DiskOnChip
2000 version where we read the 2k_ECCStatus register.

What are the contents of the fourth read supposed to be? 0x20 as we'd
expect from a DiskOnChip 2000? Should we just read the ChipID four times
and discard the first three, or do something like...

--- docprobe.c  23 May 2003 11:29:34 -0000      1.36
+++ docprobe.c  31 May 2003 13:18:37 -0000
@@ -137,19 +137,31 @@ static inline int __init doccheck(unsign
  
        ChipID = ReadDOC(window, ChipID);
    
        switch (ChipID) {
        case DOC_ChipID_Doc2k:
+       really2k:
                /* Check the TOGGLE bit in the ECC register */
                tmp  = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT;
                tmpb = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT;
                tmpc = ReadDOC(window, 2k_ECCStatus) & DOC_TOGGLE_BIT;
                if (tmp != tmpb && tmp == tmpc)
                                return ChipID;
                break;
  
        case DOC_ChipID_DocMil:
+               /* If we read the ID four times and it changes, then
+                  it wasn't really a Millennium; it was a newer
+                  DiskOnChip 2000. Pass me the baseball bat. */
+               ChipID = ReadDOC(window, ChipID);
+               ChipID = ReadDOC(window, ChipID);
+               ChipID = ReadDOC(window, ChipID);
+               if (ChipID != DOC_ChipID_DocMil) {
+                       printk(KERN_DEBUG "New DiskOnChip 2000 with bizarre ChipID detected. %02x on fourth read.\n", ChipID);
+                       goto really2k;
+               }
+
                /* Check the TOGGLE bit in the ECC register */
                tmp  = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
                tmpb = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
                tmpc = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
                if (tmp != tmpb && tmp == tmpc)



-- 
dwmw2

      reply	other threads:[~2003-05-31 13:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-07 20:37 DiskOnChip 2000 128Mb problem Matthew Dharm
2003-05-08  6:17 ` David Woodhouse
2003-05-08 18:04   ` Matthew Dharm
2003-05-09 14:25     ` David Woodhouse
2003-05-09 14:35       ` David Woodhouse
2003-05-09 16:40         ` Matthew Dharm
2003-05-09 16:48           ` David Woodhouse
2003-05-09 16:58             ` Matthew Dharm
2003-05-09 20:23               ` Edward A. Hildum
2003-05-09 20:29                 ` Matthew Dharm
2003-05-12 20:42                   ` Edward A. Hildum
2003-05-13  1:42                     ` Matthew Dharm
2003-05-13  7:40                       ` David Woodhouse
2003-05-13  8:03                         ` Daniel Toussaint
2003-05-13 16:22                           ` David Woodhouse
2003-05-13 18:34                         ` Matthew Dharm
2003-05-13  8:22                       ` David Woodhouse
2003-05-13 17:09                       ` Edward A. Hildum
2003-05-31 13:08         ` David Woodhouse
2003-05-31 13:19           ` David Woodhouse [this message]

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=1054387153.8432.30.camel@imladris.demon.co.uk \
    --to=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=zachi.friedman@m-sys.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