MUNICes: fix board Makefile for remote build directory
[oweals/u-boot.git] / board / xilinx / ml300 / ml300.c
index dbe8a8ac749e95633e990a4caee82aa1b1528268..58bfac07166ffe6171c1f96882c52ca2f2c1e59a 100644 (file)
  *
  */
 
+#include <config.h>
 #include <common.h>
 #include <asm/processor.h>
-#include "xparameters.h"
+
+#ifdef CFG_ENV_IS_IN_EEPROM
+extern void convert_env(void);
+#endif
 
 int
 board_pre_init(void)
@@ -51,22 +55,25 @@ board_pre_init(void)
 int
 checkboard(void)
 {
-       unsigned char *s = getenv("serial#");
-       unsigned char *e;
+       char tmp[64];           /* long enough for environment variables */
+       char *s, *e;
+       int i = getenv_r("L", tmp, sizeof (tmp));
 
-       if (!s || strncmp(s, "ML300", 9)) {
+       if (i < 0) {
                printf("### No HW ID - assuming ML300");
        } else {
-               for (e = s; *e; ++e) {
+               for (e = tmp; *e; ++e) {
                        if (*e == ' ')
                                break;
                }
 
-               for (; s < e; ++s) {
+               printf("### Board Serial# is ");
+
+               for (s = tmp; s < e; ++s) {
                        putc(*s);
                }
-       }
 
+       }
        putc('\n');
 
        return (0);
@@ -101,9 +108,21 @@ ulong
 get_PCI_freq(void)
 {
        ulong val;
-       PPC405_SYS_INFO sys_info;
+       PPC4xx_SYS_INFO sys_info;
 
        get_sys_info(&sys_info);
        val = sys_info.freqPCI;
        return val;
 }
+
+#ifdef CONFIG_MISC_INIT_R
+
+int
+misc_init_r()
+{
+       /* convert env name and value to u-boot standard */
+       convert_env();
+       return 0;
+}
+
+#endif