public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix AMCC bootstrap option letter label order
Date: Wed, 25 Apr 2007 07:19:35 +0200	[thread overview]
Message-ID: <200704250719.36215.sr@denx.de> (raw)
In-Reply-To: <1628E43D99629C46988BE46087A3FBB997AD7F@ep-01.EmbeddedPlanet.local>

Hi Jeff,

On Tuesday 24 April 2007 21:49, Jeff Mann wrote:
> Several of the AMCC 440 processors have a stupid 'error' in the user
> manual resulting in the logical order of option 'G' and option 'F' being
> labeled in reverse. (The logical order of the bootstrap pins represent
> settings from 0 through 7, while the letters are ordered A, B, C, D, E,
> G, F, H.) In my case, I found this problem affecting the 440EPx and GRx
> processors.

Good catch. I never noticed this, thanks.

> See table 8-2 in the 440EPx Users' Manual.
>
> The option AMCC_PINSTP_F_G_REVERSED has been added to these processors
> where they appear in cpu.c where the array bootstrap_str[] is located.
> Code to reverse a bootstrap setting of 5 and 6 (corresponding to G and
> F) has been added to bootstrap_option().

<insert some code from the patch>

> @@ -207,7 +208,18 @@ static int bootstrap_option(void)
>  	unsigned long val;
>
>  	mfsdr(SDR_PINSTP, val);
> -	return ((val & 0xf0000000) >> SDR0_PINSTP_SHIFT);
> +	val = ((val & 0xf0000000) >> SDR0_PINSTP_SHIFT);
> +
> +/* Some AMCC 440 processors have an error with bootstrap Option F and G
> +   labeled in reverse in the user manual. It has never been fixed */
> +#if defined(AMCC_PINSTP_F_G_REVERSED)
> +	if (val == 5)
> +		val=6;
> +	else if (val==6)
> +		val=5;
> +#endif
> +
> +	return val;
>  }
>  #endif /* SDR0_PINSTP_SHIFT */

I don't think this is the right way do deal with this problem. We should 
instead encode the bootstrap character "A..." into the string too:

#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
#define SDR0_PINSTP_SHIFT       29
static char *bootstrap_str[] = {
        "A - EBC (8 bits)",
        "B - EBC (16 bits)",
        "C - EBC (16 bits)",
        "D - NAND (8 bits)",
        "E - PCI",
        "G - I2C (Addr 0x54)",
        "F - PCI",
        "H - I2C (Addr 0x52)",
};
#endif

I think this gives us more flexibility and doesn't "pollute" the code with 
more #ifdef's, especially when other 4xx PPC's will have such a "problem" 
too.

> I know that this problem 
> affects more processors in this family, so other users should add this
> option when they are identified.

I know that 440EP/GR are affected too. Do you know more?

If you (or any other) have no objection against my suggestions mentioned 
above, I'll change the code accordingly.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
=====================================================================

  reply	other threads:[~2007-04-25  5:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24 19:49 [U-Boot-Users] [PATCH] Fix AMCC bootstrap option letter label order Jeff Mann
2007-04-25  5:19 ` Stefan Roese [this message]
2007-04-25  8:10   ` Stefan Roese
2007-04-25 13:52     ` Jeff Mann
2007-04-25 14:14       ` Stefan Roese

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=200704250719.36215.sr@denx.de \
    --to=sr@denx.de \
    --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