public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Jonas Holmberg <jonas.holmberg@axis.com>
Cc: mtd@infradead.org
Subject: Re: Problems with cfi_cmdset_0002.c
Date: Tue, 13 Feb 2001 10:15:25 +0000	[thread overview]
Message-ID: <18719.982059325@redhat.com> (raw)
In-Reply-To: <151F3D2AE9F0D3119E480004ACB8EA3701DEC945@cluster01.axis.se>


jonas.holmberg@axis.com said:
>  It looks like the eigth bit in the last byte of the device ID. It is
> 1 for top boot chips and 0 for bottom boot chips! Does anyone have the
> device IDs for any other chips? In that case, please confirm this
> theory. 

Looks like as good a heuristic as any. Just wrap it in an ifdef and we can 
remove it or make it a config option if it causes trouble.

	__u8 maj,min;
	int swap = 0;

	maj = cfi_read_query(map, (adr+3)*ofs_factor);
	min = cfi_read_query(map, (adr+4)*ofs_factor);

	cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi->interleave, cfi->device_type, NULL);
	cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi->interleave, cfi->device_type, NULL);
	cfi_send_gen_cmd(0x90, 0x555, base, map, cfi->interleave, cfi->device_type, NULL);

       	cfi->mfr = cfi_read_query(map, base);
       	cfi->id = cfi_read_query(map, base + ofs_factor);

	bootloc = if (maj << 8 + min >= 0x0101 /* Is this right? */) {
		if (cfi_read_query(map, (adr+3)*ofs_factor) == 3)
			swap = 1;
	}
#ifdef FTSO_AMD
	else {
		/* Eep. Need to check JEDEC ID */
		if (cfi->id & 0x80) {
			printk(KERN_WARNING "JEDEC Device ID is 0x%02X. Assuming broken CFI table.\n" cfi->id);
			swap = 1;		
		}
	}
#endif
	if (swap) {
		printk(KERN_WARNING "Swapping erase regions for broken CFI table\n");
		/* Do the swap as before ... */
	}

--
dwmw2




To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

  reply	other threads:[~2001-02-13 10:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-13 10:04 Problems with cfi_cmdset_0002.c Jonas Holmberg
2001-02-13 10:15 ` David Woodhouse [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-02-15 15:49 Jonas Holmberg
2001-02-15 13:02 Jonas Holmberg
2001-02-15 12:44 Jonas Holmberg
2001-02-15 12:56 ` David Woodhouse
2001-02-15 11:01 Jonas Holmberg
2001-02-15 11:10 ` David Woodhouse
2001-02-14 15:41 Jonas Holmberg
2001-02-14 15:45 ` David Woodhouse
2001-02-13 12:53 Jamey Hicks
2001-02-13 13:31 ` David Woodhouse
2001-02-13  8:59 Jonas Holmberg
2001-02-13  8:31 Jonas Holmberg
2001-02-13  8:30 ` Johan Adolfsson
2001-02-13  9:17 ` David Woodhouse
2001-02-13  9:27   ` Johan Adolfsson
2001-02-12 16:31 Jonas Holmberg
2001-02-12 16:36 ` David Woodhouse
2001-02-12 17:14   ` Johan Adolfsson
2001-02-12 17:24     ` David Woodhouse
2001-02-12 17:33       ` Johan Adolfsson
2001-02-12 12:08 Jonas Holmberg
2001-02-12 13:24 ` David Woodhouse

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=18719.982059325@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=jonas.holmberg@axis.com \
    --cc=mtd@infradead.org \
    /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