]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge with git://www.denx.de/git/u-boot-testing
authorWolfgang Denk <wd@denx.de>
Sat, 5 May 2007 19:12:41 +0000 (21:12 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 5 May 2007 19:12:41 +0000 (21:12 +0200)
common/cmd_nvedit.c
common/console.c
common/main.c
cpu/mpc5xxx/cpu.c
drivers/pci_auto.c
drivers/smc91111.c
include/asm-ppc/processor.h

index 9834ba65b7daa687d60128544a95dbb4136a1c3d..977ec5bae96153c390b37867546e6d5cb7b1c796 100644 (file)
@@ -391,7 +391,10 @@ int _do_setenv (int flag, int argc, char *argv[])
 void setenv (char *varname, char *varvalue)
 {
        char *argv[4] = { "setenv", varname, varvalue, NULL };
-       _do_setenv (0, 3, argv);
+       if (varvalue == NULL)
+               _do_setenv (0, 2, argv);
+       else
+               _do_setenv (0, 3, argv);
 }
 
 int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
index e9f23bec1820f178e3f4a67e3241182a0c65dc9d..d8a0cb6c7e8a1d43e43ad066514e23a72f88327e 100644 (file)
@@ -494,13 +494,7 @@ int console_init_r (void)
        /* suppress all output if splash screen is enabled and we have
           a bmp to display                                            */
        if (getenv("splashimage") != NULL)
-               outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
-#endif
-
-#ifdef CONFIG_SILENT_CONSOLE
-       /* Suppress all output if "silent" mode requested               */
-       if (gd->flags & GD_FLG_SILENT)
-               outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
+               gd->flags |= GD_FLG_SILENT;
 #endif
 
        /* Scan devices looking for input and output devices */
index cc4b50f615ab070c806773cfa57661f1dd889bbe..0003da2511caa517db9bc8c6cdd946c3b167edcf 100644 (file)
@@ -112,16 +112,8 @@ static __inline__ int abortboot(int bootdelay)
        u_int presskey_max = 0;
        u_int i;
 
-#ifdef CONFIG_SILENT_CONSOLE
-       if (gd->flags & GD_FLG_SILENT) {
-               /* Restore serial console */
-               console_assign (stdout, "serial");
-               console_assign (stderr, "serial");
-       }
-#endif
-
 #  ifdef CONFIG_AUTOBOOT_PROMPT
-       printf (CONFIG_AUTOBOOT_PROMPT, bootdelay);
+       printf(CONFIG_AUTOBOOT_PROMPT, bootdelay);
 #  endif
 
 #  ifdef CONFIG_AUTOBOOT_DELAY_STR
@@ -195,18 +187,12 @@ static __inline__ int abortboot(int bootdelay)
        }
 #  if DEBUG_BOOTKEYS
        if (!abort)
-               puts ("key timeout\n");
+               puts("key timeout\n");
 #  endif
 
 #ifdef CONFIG_SILENT_CONSOLE
-       if (abort) {
-               /* permanently enable normal console output */
-               gd->flags &= ~(GD_FLG_SILENT);
-       } else if (gd->flags & GD_FLG_SILENT) {
-               /* Restore silent console */
-               console_assign (stdout, "nulldev");
-               console_assign (stderr, "nulldev");
-       }
+       if (abort)
+               gd->flags &= ~GD_FLG_SILENT;
 #endif
 
        return abort;
@@ -222,14 +208,6 @@ static __inline__ int abortboot(int bootdelay)
 {
        int abort = 0;
 
-#ifdef CONFIG_SILENT_CONSOLE
-       if (gd->flags & GD_FLG_SILENT) {
-               /* Restore serial console */
-               console_assign (stdout, "serial");
-               console_assign (stderr, "serial");
-       }
-#endif
-
 #ifdef CONFIG_MENUPROMPT
        printf(CONFIG_MENUPROMPT, bootdelay);
 #else
@@ -244,8 +222,8 @@ static __inline__ int abortboot(int bootdelay)
        if (bootdelay >= 0) {
                if (tstc()) {   /* we got a key press   */
                        (void) getc();  /* consume input        */
-                       puts ("\b\b\b 0");
-                       abort = 1;      /* don't auto boot      */
+                       puts("\b\b\b 0");
+                       abort = 1;      /* don't auto boot      */
                }
        }
 #endif
@@ -266,23 +244,17 @@ static __inline__ int abortboot(int bootdelay)
 # endif
                                break;
                        }
-                       udelay (10000);
+                       udelay(10000);
                }
 
-               printf ("\b\b\b%2d ", bootdelay);
+               printf("\b\b\b%2d ", bootdelay);
        }
 
-       putc ('\n');
+       putc('\n');
 
 #ifdef CONFIG_SILENT_CONSOLE
-       if (abort) {
-               /* permanently enable normal console output */
-               gd->flags &= ~(GD_FLG_SILENT);
-       } else if (gd->flags & GD_FLG_SILENT) {
-               /* Restore silent console */
-               console_assign (stdout, "nulldev");
-               console_assign (stderr, "nulldev");
-       }
+       if (abort)
+               gd->flags &= ~GD_FLG_SILENT;
 #endif
 
        return abort;
index 813aa7935d168f78203bf0a01fe670e9df4e47c1..1eac2bbfbe10a2f1e64c4d5f0bb959630c366258 100644 (file)
@@ -53,12 +53,16 @@ int checkcpu (void)
 #else
        svr = get_svr();
        pvr = get_pvr();
-       switch (SVR_VER (svr)) {
-       case SVR_MPC5200:
-               printf ("MPC5200");
+
+       switch (pvr) {
+       case PVR_5200:
+               printf("MPC5200");
+               break;
+       case PVR_5200B:
+               printf("MPC5200B");
                break;
        default:
-               printf ("MPC52??  (SVR %08x)", svr);
+               printf("Unknown MPC5xxx");
                break;
        }
 
@@ -127,5 +131,9 @@ ft_cpu_setup(void *blob, bd_t *bd)
        p = ft_get_prop(blob, "/" OF_SOC "/ethernet@3000/mac-address", &len);
        if (p != NULL)
                memcpy(p, bd->bi_enetaddr, 6);
+
+       p = ft_get_prop(blob, "/" OF_SOC "/ethernet@3000/local-mac-address", &len);
+       if (p != NULL)
+               memcpy(p, bd->bi_enetaddr, 6);
 }
 #endif
index 969167555ea27369008b7c5b53dc76f75bc9a46f..f170c2db89e066420771a5fbb813385905c9baf2 100644 (file)
 
 void pciauto_region_init(struct pci_region* res)
 {
-       res->bus_lower = res->bus_start;
+       /*
+        * Avoid allocating PCI resources from address 0 -- this is illegal
+        * according to PCI 2.1 and moreover, this is known to cause Linux IDE
+        * drivers to fail. Use a reasonable starting value of 0x1000 instead.
+        */
+       res->bus_lower = res->bus_start ? res->bus_start : 0x1000;
 }
 
 void pciauto_region_align(struct pci_region *res, unsigned long size)
index f91e4b984369fca9c75138be33a808134e779610..8061f12979dbbbf5317079d49a932f6c48794cb7 100644 (file)
@@ -1538,9 +1538,9 @@ int eth_send(volatile void *packet, int length) {
 int smc_get_ethaddr (bd_t * bd)
 {
        int env_size, rom_valid, env_present = 0, reg;
-       char *s = NULL, *e, *v_mac, es[] = "11:22:33:44:55:66";
+       char *s = NULL, *e, es[] = "11:22:33:44:55:66";
        char s_env_mac[64];
-       uchar v_env_mac[6], v_rom_mac[6];
+       uchar v_env_mac[6], v_rom_mac[6], *v_mac;
 
        env_size = getenv_r ("ethaddr", s_env_mac, sizeof (s_env_mac));
        if ((env_size > 0) && (env_size < sizeof (es))) {       /* exit if env is bad */
@@ -1563,7 +1563,7 @@ int smc_get_ethaddr (bd_t * bd)
 
        if (!env_present) {     /* if NO env */
                if (rom_valid) {        /* but ROM is valid */
-                       v_mac = (char *)v_rom_mac;
+                       v_mac = v_rom_mac;
                        sprintf (s_env_mac, "%02X:%02X:%02X:%02X:%02X:%02X",
                                 v_mac[0], v_mac[1], v_mac[2], v_mac[3],
                                 v_mac[4], v_mac[5]);
@@ -1573,7 +1573,7 @@ int smc_get_ethaddr (bd_t * bd)
                        return (-1);
                }
        } else {                /* good env, don't care ROM */
-               v_mac = (char *)v_env_mac;      /* always use a good env over a ROM */
+               v_mac = v_env_mac;      /* always use a good env over a ROM */
        }
 
        if (env_present && rom_valid) { /* if both env and ROM are good */
index e9361c5174b48cbdafc2be9cdeae0c0fe9e3ff05..5efc3ee2ca7d287b6add45f2adbbbe0abba62043 100644 (file)
 #define SVR_MJREV(svr) (((svr) >>  4) & 0x0F)   /* Major SOC design revision indicator */
 #define SVR_MNREV(svr) (((svr) >>  0) & 0x0F)   /* Minor SOC design revision indicator */
 
-/* System-On-Chip Version Numbers (version field only) */
-#define SVR_MPC5200    0x8011
 
 /* Processor Version Register */
 
 #define PVR_8260_HIP7R1 0x80822013
 #define PVR_8260_HIP7RA        0x80822014
 
+/*
+ * MPC 52xx
+ */
+#define PVR_5200       0x80822011
+#define PVR_5200B      0x80822014
+
 
 /*
  * System Version Register