Fix AMCC bootstrap option letter label order
PATCH 1/1 Fix AMCC bootstrap option letter label order
U-boot Users:
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.
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(). I know that this problem affects more processors in this family, so other users should add this option when they are identified.
Patch attached.
-Jeffrey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AMCCbootstrap.patch
Type: application/octet-stream
Size: 1249 bytes
Desc: AMCCbootstrap.patch
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070424/3f467d3b/attachment.obj
PATCH 1/1 Fix AMCC bootstrap option letter label order
Hi Jeff,
Quoted 6 lines · Jeff Mann
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.
Quoted 6 lines
See table 8-2 in the 440EPx Users' Manual.
The option
AMCC_PINSTP_F_G_REVERSEDhas been added to these processors where they appear incpu.cwhere the array bootstrap_str[] is located. Code to reverse a bootstrap setting of 5 and 6 (corresponding to G and
F) has been added tobootstrap_option().
<insert some code from the patch>
Quoted 9 lines
(quoted diff) +4
-1@@ -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 */
Review static int bootstrap_option(void) · line 224
Quoted 10 lines
(quoted diff) +8
-0+#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.
Quoted 3 lines
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
=====================================================================
PATCH 1/1 Fix AMCC bootstrap option letter label order
Hi Jeff,
another note to your patch:
cpu/ppc4xx/cpu.c
Quoted 9 lines
[PATCH] Fixed bootstrap option letter label error for some 440 processors
Signed-off-by Jeffrey Mann <[email protected]>--- cpu/ppc4xx/cpu.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-)cpu/ppc4xx/cpu.c +0
-0
It happened earlier too, that you change the file modes. Please make sure that future patches do not touch the file modes of existing files and new files are added with the correct file mode.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
=====================================================================
PATCH 1/1 Fix AMCC bootstrap option letter label order
Quoted 5 lines
It happened earlier too, that you change the file modes. Please make sure that future patches do not touch the file modes of existing files and new files are added with the correct file mode.
Hmmm...I wonder why this is happening. It must have something to do with using ubuntu inside windows (and editing files in windows over samba). Nonetheless, I am having problems learning how to use git effectively. I am using some guide on kernel.com, but I wish I had some more detailed directions that were also less cryptic.
when I type: git format-patch origin, can I edit the text in pico instead of vi?
Stefan, one day you will stop getting all of these patch formating mistakes from me.
Quoted 1 line
If you (or any other) have no objection against my suggestions
mentioned above, I'll change the code accordingly.
No objection. That works fine too.
-JMann
PATCH 1/1 Fix AMCC bootstrap option letter label order
Hi Jeff,
Quoted 7 lines · Jeff Mann
Quoted 4 lines
It happened earlier too, that you change the file modes. Please make sure that future patches do not touch the file modes of existing files and new files are added with the correct file mode.
Hmmm...I wonder why this is happening. It must have something to do with using ubuntu inside windows (and editing files in windows over samba).
Autsch. I thought as much.
Quoted 6 lines
Nonetheless, I am having problems learning how to use git effectively. I am using some guide on kernel.com, but I wish I had some more detailed directions that were also less cryptic.
when I type: git format-patch origin, can I edit the text in pico instead of vi?
export EDITOR='pico'
in your .bashrc will help.
Quoted 2 lines
Stefan, one day you will stop getting all of these patch formating mistakes from me.
I'm looking forward... ;-)
Quoted 5 lines
Quoted 1 line
If you (or any other) have no objection against my suggestions
mentioned above, I'll change the code accordingly.
No objection. That works fine too.
OK, I'll implement it this way.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
=====================================================================