public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V5 1/2] MTD/SPI: introduce table driven probing
Date: Mon, 11 Oct 2010 03:28:07 -0400	[thread overview]
Message-ID: <201010110328.10519.vapier@gentoo.org> (raw)
In-Reply-To: <1286290600-18988-2-git-send-email-u-boot@emk-elektronik.de>

On Tuesday, October 05, 2010 10:56:39 Reinhard Meyer wrote:
> +	/*
> +	 * count the number of continuation bytes, but
> +	 * leave at least 3 bytes to the end of the buffer untouched
> +	 */
> +	for (shift = 0, idp = idbuf;
> +		shift < (sizeof(idbuf) - 3) && *idp == 0x7f;
> +			shift++, idp++)
> +		;
> +
> +	/* search the table for matches in shift and id */
> +	for (i = 0; i < ARRAY_SIZE(flashes); i++) {
> +		if (flashes[i].shift == shift && flashes[i].idcode == *idp) {
> +			/* we have a match, call probe */
> +			flash = flashes[i].probe(spi, idp);
> +			if (flash)
> +				break;
> +		}
>  	}

thinking about this some more, i see two problems.  (1) we've been providing 4 
bytes to probe funcs (like the spansion), so 3 is too small.  (2) all of the 
probe devices today expect to get the whole idcode buffer.  so if we're going 
to change this API, we need to fix all the probe funcs too.  but that is a lot 
of changes to roll into one commit, so let's first focus on converting to a 
table without changing any probe semantics.

see the follow up patch that addresses these issues and some other stuff.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101011/a8a0608b/attachment.pgp 

  parent reply	other threads:[~2010-10-11  7:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 14:56 [U-Boot] [PATCH V5 0/2] Patches to support Ramtron FRAMs Reinhard Meyer
2010-10-05 14:56 ` [U-Boot] [PATCH V5 1/2] MTD/SPI: introduce table driven probing Reinhard Meyer
2010-10-05 14:56   ` [U-Boot] [PATCH V5 2/2] MTD/SPI: add support for Ramtron FRAMs Reinhard Meyer
2010-10-11  7:33     ` Mike Frysinger
2010-10-11  7:28   ` Mike Frysinger [this message]
2010-10-11  7:56     ` [U-Boot] [PATCH V5 1/2] MTD/SPI: introduce table driven probing Reinhard Meyer
2010-10-11  8:17       ` Mike Frysinger
2010-10-11  8:30         ` Reinhard Meyer
2010-10-13  1:19           ` Mike Frysinger
2010-10-11  7:31   ` [U-Boot] [PATCH] sf: turn probe switch into a lookup table Mike Frysinger
2010-10-11  8:29 ` [U-Boot] [PATCH 1/2] " Mike Frysinger
2010-10-11  8:29 ` [U-Boot] [PATCH 2/2] sf: ramtron: new spi fram driver Mike Frysinger
2010-10-13  7:44   ` Reinhard Meyer
2010-10-13 13:43     ` Mike Frysinger

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=201010110328.10519.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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