[U-Boot] [PATCH 08/12] 83xx, kmeter: QE_ENET10 errata for Silicon Revision 2.1

old code implemented the QE_ENET10 errata only for Silicon Revision 2.0. New code reads now the Silicon Revision register and sets dependend on the Silicon Revision the values as advised in the QE_ENET10 errata.
Also added missing get_svr() in cpu/mpc83xx/start.S to read the Silicon Revision register.
Signed-off-by: Heiko Schocher hs@denx.de --- board/keymile/kmeter1/kmeter1.c | 20 ++++++++++++-------- cpu/mpc83xx/start.S | 5 +++++ 2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c index 0b0c2a3..0f4217a 100644 --- a/board/keymile/kmeter1/kmeter1.c +++ b/board/keymile/kmeter1/kmeter1.c @@ -80,19 +80,23 @@ static int board_init_i2c_busses (void)
int board_early_init_r (void) { - void *reg = (void *)(CONFIG_SYS_IMMR + 0x14a8); - u32 val; + unsigned short svid;
+ svid = (unsigned short) get_svr (); /* * Because of errata in the UCCs, we have to write to the reserved * registers to slow the clocks down. */ - val = in_be32 (reg); - /* UCC1 */ - val |= 0x00003000; - /* UCC2 */ - val |= 0x0c000000; - out_be32 (reg, val); + switch (svid) { + case 0x0020: + setbits_be32((void *)(CONFIG_SYS_IMMR + 0x14a8), + 0x0c003000); + break; + case 0x0021: + clrsetbits_be32((void *)(CONFIG_SYS_IMMR + 0x14ac), + 0x00000050, 0x000000a0); + break; + } /* enable the PHY on the PIGGY */ setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x10003), 0x01);
diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S index 26e3106..8ef5368 100644 --- a/cpu/mpc83xx/start.S +++ b/cpu/mpc83xx/start.S @@ -137,6 +137,11 @@ get_pvr: mfspr r3, PVR blr
+ .globl get_svr +get_svr: + mfspr r3, SVR + blr + .globl ppcDWstore ppcDWstore: lfd 1, 0(r4)

On Wed, 11 Feb 2009 19:26:22 +0100 Heiko Schocher hs@denx.de wrote:
- switch (svid) {
case 0x0020:
'case' should be aligned directly under 'switch'.
+++ b/cpu/mpc83xx/start.S @@ -137,6 +137,11 @@ get_pvr: mfspr r3, PVR blr
- .globl get_svr
+get_svr:
- mfspr r3, SVR
- blr
on a ./MAKEALL SIMPC8313_LP, I'm getting:
powerpc-linux-gnu-ld: NAND bootstrap too big powerpc-linux-gnu-ld: NAND bootstrap too big make[1]: *** [/home/r1aaha/git/u-boot/nand_spl/u-boot-spl] Error 1 make: *** [nand_spl] Error 2 make: *** Waiting for unfinished jobs.... powerpc-linux-gnu-size: './u-boot': No such file
and I think (because I haven't verified it), it's because of the above addition to start.S; Can you please look into moving this fn elsewhere - see commit 455a4691 and test rebuilding the SIMPC board?
Thank you,
Kim

Hello Kim,
Kim Phillips wrote:
On Wed, 11 Feb 2009 19:26:22 +0100 Heiko Schocher hs@denx.de wrote:
- switch (svid) {
case 0x0020:
'case' should be aligned directly under 'switch'.
+++ b/cpu/mpc83xx/start.S @@ -137,6 +137,11 @@ get_pvr: mfspr r3, PVR blr
- .globl get_svr
+get_svr:
- mfspr r3, SVR
- blr
on a ./MAKEALL SIMPC8313_LP, I'm getting:
powerpc-linux-gnu-ld: NAND bootstrap too big powerpc-linux-gnu-ld: NAND bootstrap too big make[1]: *** [/home/r1aaha/git/u-boot/nand_spl/u-boot-spl] Error 1 make: *** [nand_spl] Error 2 make: *** Waiting for unfinished jobs.... powerpc-linux-gnu-size: './u-boot': No such file
Hmm.. with actual u-boot I get for this board (without my patches):
[hs@pollux u-boot]$ ./MAKEALL SIMPC8313_LP ...Large Page NAND...Configuring for SIMPC8313 board... In file included from /home/hs/U-Boot-Patches/u-boot/include/config.h:5, from include/common.h:35: /home/hs/U-Boot-Patches/u-boot/include/configs/SIMPC8313.h:81:1: warning: "CONFIG_MAX_MEM_MAPPED" redefined In file included from /home/hs/U-Boot-Patches/u-boot/include/config.h:4, from include/common.h:35: /home/hs/U-Boot-Patches/u-boot/include/asm/config.h:28:1: warning: this is the location of the previous definition In file included from /home/hs/U-Boot-Patches/u-boot/include/config.h:5, from start.S:30: [...]
also with actual u-boot-mpc83xx.git:
[hs@pollux u-boot-mpc83xx]$ ./MAKEALL SIMPC8313_LP ...Large Page NAND...Configuring for SIMPC8313 board... In file included from /home/hs/U-Boot-Patches/u-boot-mpc83xx/include/config.h:5, from include/common.h:35: /home/hs/U-Boot-Patches/u-boot-mpc83xx/include/configs/SIMPC8313.h:81:1: warning: "CONFIG_MAX_MEM_MAPPED" redefined In file included from /home/hs/U-Boot-Patches/u-boot-mpc83xx/include/config.h:4, from include/common.h:35: [...]
and I think (because I haven't verified it), it's because of the above addition to start.S; Can you please look into moving this fn elsewhere
Yes, that seems plausible, but see above, I didn;t get this error with actual u-boot-mpc83xx.git nor with actual u-boot.
- see commit 455a4691 and test rebuilding the SIMPC board?
Yes, I try to move get_svr to cpu.c?
thanks Heiko

Hello Kim,
Heiko Schocher wrote:
Kim Phillips wrote:
On Wed, 11 Feb 2009 19:26:22 +0100 Heiko Schocher hs@denx.de wrote:
- switch (svid) {
case 0x0020:
'case' should be aligned directly under 'switch'.
+++ b/cpu/mpc83xx/start.S @@ -137,6 +137,11 @@ get_pvr: mfspr r3, PVR blr
- .globl get_svr
+get_svr:
- mfspr r3, SVR
- blr
on a ./MAKEALL SIMPC8313_LP, I'm getting:
powerpc-linux-gnu-ld: NAND bootstrap too big powerpc-linux-gnu-ld: NAND bootstrap too big make[1]: *** [/home/r1aaha/git/u-boot/nand_spl/u-boot-spl] Error 1 make: *** [nand_spl] Error 2 make: *** Waiting for unfinished jobs.... powerpc-linux-gnu-size: './u-boot': No such file
Hmm.. with actual u-boot I get for this board (without my patches):
[hs@pollux u-boot]$ ./MAKEALL SIMPC8313_LP ...Large Page NAND...Configuring for SIMPC8313 board... In file included from /home/hs/U-Boot-Patches/u-boot/include/config.h:5, from include/common.h:35: /home/hs/U-Boot-Patches/u-boot/include/configs/SIMPC8313.h:81:1: warning: "CONFIG_MAX_MEM_MAPPED" redefined In file included from /home/hs/U-Boot-Patches/u-boot/include/config.h:4, from include/common.h:35: /home/hs/U-Boot-Patches/u-boot/include/asm/config.h:28:1: warning: this is the location of the previous definition In file included from /home/hs/U-Boot-Patches/u-boot/include/config.h:5, from start.S:30: [...]
I was to fast, i get the error (I just have to wait for the end of the above warnings):
[hs@pollux u-boot]$ ./MAKEALL SIMPC8313_LP ...Large Page NAND...Configuring for SIMPC8313 board... In file included from /home/hs/U-Boot-Patches/u-boot/include/config.h:5, from include/common.h:35: [..] /home/hs/U-Boot-Patches/u-boot/include/asm/config.h:28:1: warning: this is the location of the previous definition ppc_82xx-ld: NAND bootstrap too big ppc_82xx-ld: NAND bootstrap too big make[1]: *** [/home/hs/U-Boot-Patches/u-boot/nand_spl/u-boot-spl] Fehler 1 make: *** [nand_spl] Fehler 2 make: *** Warte auf noch nicht beendete Prozesse... ppc_82xx-size: './u-boot': No such file [hs@pollux u-boot]$
I get this error just with actual u-boot.
bye Heiko

On Tue, 17 Feb 2009 09:54:51 +0100 Heiko Schocher hs@denx.de wrote:
ppc_82xx-ld: NAND bootstrap too big ppc_82xx-ld: NAND bootstrap too big make[1]: *** [/home/hs/U-Boot-Patches/u-boot/nand_spl/u-boot-spl] Fehler 1 make: *** [nand_spl] Fehler 2 make: *** Warte auf noch nicht beendete Prozesse... ppc_82xx-size: './u-boot': No such file [hs@pollux u-boot]$
I get this error just with actual u-boot.
now that I've verified it, I see it too. I bisected it:
bced7ccefa08512c54a6d146658ff7dbc33d5dfe is first bad commit commit bced7ccefa08512c54a6d146658ff7dbc33d5dfe Author: Kumar Gala galak@kernel.crashing.org Date: Fri Feb 6 08:08:06 2009 -0600
ppc: Fix roll over bug in flush_cache()
If we call flush_cache(0xfffff000, 0x1000) it would never terminate the loop since end = 0xffffffff and we'd roll over our counter from 0xfffffe0 to 0 (assuming a 32-byte cache line)
Signed-off-by: Kumar Gala galak@kernel.crashing.org
the extra checks this patch makes makes flush_cache() consume a mere 16 more bytes, which makes the SIMPC8313 build fail.
I don't see an easy way out of this that satisfies everyone. Ideas?
Kim

On Feb 17, 2009, at 7:25 PM, Kim Phillips wrote:
On Tue, 17 Feb 2009 09:54:51 +0100 Heiko Schocher hs@denx.de wrote:
ppc_82xx-ld: NAND bootstrap too big ppc_82xx-ld: NAND bootstrap too big make[1]: *** [/home/hs/U-Boot-Patches/u-boot/nand_spl/u-boot-spl] Fehler 1 make: *** [nand_spl] Fehler 2 make: *** Warte auf noch nicht beendete Prozesse... ppc_82xx-size: './u-boot': No such file [hs@pollux u-boot]$
I get this error just with actual u-boot.
now that I've verified it, I see it too. I bisected it:
bced7ccefa08512c54a6d146658ff7dbc33d5dfe is first bad commit commit bced7ccefa08512c54a6d146658ff7dbc33d5dfe Author: Kumar Gala galak@kernel.crashing.org Date: Fri Feb 6 08:08:06 2009 -0600
ppc: Fix roll over bug in flush_cache()
If we call flush_cache(0xfffff000, 0x1000) it would never terminate the loop since end = 0xffffffff and we'd roll over our counter from 0xfffffe0 to 0 (assuming a 32-byte cache line)
Signed-off-by: Kumar Gala galak@kernel.crashing.org
the extra checks this patch makes makes flush_cache() consume a mere 16 more bytes, which makes the SIMPC8313 build fail.
I don't see an easy way out of this that satisfies everyone. Ideas?
Kim
what params is flush_cache() being called width on SIMC8313?
- k

On Feb 17, 2009, at 8:29 PM, Kumar Gala wrote:
On Feb 17, 2009, at 7:25 PM, Kim Phillips wrote:
On Tue, 17 Feb 2009 09:54:51 +0100 Heiko Schocher hs@denx.de wrote:
ppc_82xx-ld: NAND bootstrap too big ppc_82xx-ld: NAND bootstrap too big make[1]: *** [/home/hs/U-Boot-Patches/u-boot/nand_spl/u-boot-spl] Fehler 1 make: *** [nand_spl] Fehler 2 make: *** Warte auf noch nicht beendete Prozesse... ppc_82xx-size: './u-boot': No such file [hs@pollux u-boot]$
I get this error just with actual u-boot.
now that I've verified it, I see it too. I bisected it:
bced7ccefa08512c54a6d146658ff7dbc33d5dfe is first bad commit commit bced7ccefa08512c54a6d146658ff7dbc33d5dfe Author: Kumar Gala galak@kernel.crashing.org Date: Fri Feb 6 08:08:06 2009 -0600
ppc: Fix roll over bug in flush_cache()
If we call flush_cache(0xfffff000, 0x1000) it would never terminate the loop since end = 0xffffffff and we'd roll over our counter from 0xfffffe0 to 0 (assuming a 32-byte cache line)
Signed-off-by: Kumar Gala galak@kernel.crashing.org
the extra checks this patch makes makes flush_cache() consume a mere 16 more bytes, which makes the SIMPC8313 build fail.
I don't see an easy way out of this that satisfies everyone. Ideas?
Kim
what params is flush_cache() being called width on SIMC8313?
As I read back through the thread I see its not the change in runtime its the fact that the code is bigger that is causing issues. I can't really help on that front.
- k

On Tue, Feb 17, 2009 at 07:25:50PM -0600, Kim Phillips wrote:
the extra checks this patch makes makes flush_cache() consume a mere 16 more bytes, which makes the SIMPC8313 build fail.
I don't see an easy way out of this that satisfies everyone. Ideas?
Trim some bytes from elsewhere. Statically determine large v. small page, for example.
-Scott

On Wed, 18 Feb 2009 11:20:18 -0600 Scott Wood scottwood@freescale.com wrote:
On Tue, Feb 17, 2009 at 07:25:50PM -0600, Kim Phillips wrote:
the extra checks this patch makes makes flush_cache() consume a mere 16 more bytes, which makes the SIMPC8313 build fail.
I don't see an easy way out of this that satisfies everyone. Ideas?
Trim some bytes from elsewhere. Statically determine large v. small page, for example.
thanks, turns out a pending patch from Ron already fixes it:
http://lists.denx.de/pipermail/u-boot/2009-February/047793.html
Kim

On Mon, Feb 16, 2009 at 07:37:20PM -0600, Kim Phillips wrote:
On Wed, 11 Feb 2009 19:26:22 +0100 Heiko Schocher hs@denx.de wrote:
- switch (svid) {
case 0x0020:
'case' should be aligned directly under 'switch'.
+++ b/cpu/mpc83xx/start.S @@ -137,6 +137,11 @@ get_pvr: mfspr r3, PVR blr
- .globl get_svr
+get_svr:
- mfspr r3, SVR
- blr
on a ./MAKEALL SIMPC8313_LP, I'm getting:
powerpc-linux-gnu-ld: NAND bootstrap too big powerpc-linux-gnu-ld: NAND bootstrap too big make[1]: *** [/home/r1aaha/git/u-boot/nand_spl/u-boot-spl] Error 1 make: *** [nand_spl] Error 2 make: *** Waiting for unfinished jobs.... powerpc-linux-gnu-size: './u-boot': No such file
and I think (because I haven't verified it), it's because of the above addition to start.S; Can you please look into moving this fn elsewhere
- see commit 455a4691 and test rebuilding the SIMPC board?
Seems like both get_pvr and get_svr should really be inline functions.
-Scott
participants (5)
-
Heiko Schocher
-
Kim Phillips
-
Kumar Gala
-
Kumar Gala
-
Scott Wood