public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] EBC_NUM_BANKS for Virtex5 PPC440?
@ 2010-02-25 18:53 Lucas
  2010-03-02 13:21 ` Stefan Roese
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas @ 2010-02-25 18:53 UTC (permalink / raw)
  To: u-boot

I'm working on a custom board that is similar to the ml507 (with a virtex 5
powerpc 440), and I ran across this error compiling u-boot:

fdt.c: In function '__ft_board_setup':
fdt.c:43: error: 'EBC_NUM_BANKS' undeclared (first use in this function)
fdt.c:43: error: (Each undeclared identifier is reported only once
fdt.c:43: error: for each function it appears in.)
fdt.c:43: warning: unused variable 'ranges'

I looked in ppc4xx-ebc.h and EBC_NUM_BANKS is only defined for 405xx and
440xx variants.  I tried setting it to zero and it works so far (see the
following diff), but is there a more proper way of disabling EBC?

diff --git a/include/asm-ppc/ppc4xx-ebc.h b/include/asm-ppc/ppc4xx-ebc.h
index 9680f70..61beb8d 100644
--- a/include/asm-ppc/ppc4xx-ebc.h
+++ b/include/asm-ppc/ppc4xx-ebc.h
@@ -41,26 +41,33 @@
 #if defined(CONFIG_405CR) || defined(CONFIG_405GP) || \
     defined(CONFIG_405EZ) || \
     defined(CONFIG_440GP) || defined(CONFIG_440GX)
+
 #define EBC_NUM_BANKS  8
-#endif

-#if defined(CONFIG_405EP)
+#elif defined(CONFIG_405EP)
+
 #define EBC_NUM_BANKS  5
-#endif

-#if defined(CONFIG_405EX) || \
+#elif defined(CONFIG_405EX) || \
     defined(CONFIG_460SX)
+
 #define EBC_NUM_BANKS  4
-#endif

-#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+#elif defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
     defined(CONFIG_460EX) || defined(CONFIG_460GT)
+
 #define EBC_NUM_BANKS  6
-#endif

-#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#elif defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+
 #define EBC_NUM_BANKS  3
+
+#else
+
+/* TBD, what if CONFIG_440 but none of those others? */
+#define EBC_NUM_BANKS  0
+
 #endif

 /* Bank Configuration Register */


Thank you,

Lucas

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] EBC_NUM_BANKS for Virtex5 PPC440?
  2010-02-25 18:53 [U-Boot] EBC_NUM_BANKS for Virtex5 PPC440? Lucas
@ 2010-03-02 13:21 ` Stefan Roese
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2010-03-02 13:21 UTC (permalink / raw)
  To: u-boot

Hi Lucas,

On Thursday 25 February 2010 19:53:45 Lucas wrote:
> I'm working on a custom board that is similar to the ml507 (with a virtex 5
> powerpc 440), and I ran across this error compiling u-boot:
> 
> fdt.c: In function '__ft_board_setup':
> fdt.c:43: error: 'EBC_NUM_BANKS' undeclared (first use in this function)
> fdt.c:43: error: (Each undeclared identifier is reported only once
> fdt.c:43: error: for each function it appears in.)
> fdt.c:43: warning: unused variable 'ranges'
> 
> I looked in ppc4xx-ebc.h and EBC_NUM_BANKS is only defined for 405xx and
> 440xx variants.  I tried setting it to zero and it works so far (see the
> following diff), but is there a more proper way of disabling EBC?

Yes. I would prefer to disable using this EBC fdt blob configuration on those 
boards without EBC. Why don't you just don't call the weak default 
__ft_board_setup() function in cpu/ppc4xx/fdt.c by defining a board specific 
version in your board-platform code (board/board_name/board_name.c)? This way 
you can override the weak default function and it's not called at all.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-02 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25 18:53 [U-Boot] EBC_NUM_BANKS for Virtex5 PPC440? Lucas
2010-03-02 13:21 ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox