Merge with git://www.denx.de/git/u-boot-testing

This commit is contained in:
Wolfgang Denk 2007-05-05 21:12:41 +02:00
commit 2be1bab6a7
7 changed files with 44 additions and 58 deletions

View File

@ -391,6 +391,9 @@ int _do_setenv (int flag, int argc, char *argv[])
void setenv (char *varname, char *varvalue) void setenv (char *varname, char *varvalue)
{ {
char *argv[4] = { "setenv", varname, varvalue, NULL }; char *argv[4] = { "setenv", varname, varvalue, NULL };
if (varvalue == NULL)
_do_setenv (0, 2, argv);
else
_do_setenv (0, 3, argv); _do_setenv (0, 3, argv);
} }

View File

@ -494,13 +494,7 @@ int console_init_r (void)
/* suppress all output if splash screen is enabled and we have /* suppress all output if splash screen is enabled and we have
a bmp to display */ a bmp to display */
if (getenv("splashimage") != NULL) if (getenv("splashimage") != NULL)
outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev"); gd->flags |= GD_FLG_SILENT;
#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");
#endif #endif
/* Scan devices looking for input and output devices */ /* Scan devices looking for input and output devices */

View File

@ -112,16 +112,8 @@ static __inline__ int abortboot(int bootdelay)
u_int presskey_max = 0; u_int presskey_max = 0;
u_int i; 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 # ifdef CONFIG_AUTOBOOT_PROMPT
printf (CONFIG_AUTOBOOT_PROMPT, bootdelay); printf(CONFIG_AUTOBOOT_PROMPT, bootdelay);
# endif # endif
# ifdef CONFIG_AUTOBOOT_DELAY_STR # ifdef CONFIG_AUTOBOOT_DELAY_STR
@ -195,18 +187,12 @@ static __inline__ int abortboot(int bootdelay)
} }
# if DEBUG_BOOTKEYS # if DEBUG_BOOTKEYS
if (!abort) if (!abort)
puts ("key timeout\n"); puts("key timeout\n");
# endif # endif
#ifdef CONFIG_SILENT_CONSOLE #ifdef CONFIG_SILENT_CONSOLE
if (abort) { if (abort)
/* permanently enable normal console output */ gd->flags &= ~GD_FLG_SILENT;
gd->flags &= ~(GD_FLG_SILENT);
} else if (gd->flags & GD_FLG_SILENT) {
/* Restore silent console */
console_assign (stdout, "nulldev");
console_assign (stderr, "nulldev");
}
#endif #endif
return abort; return abort;
@ -222,14 +208,6 @@ static __inline__ int abortboot(int bootdelay)
{ {
int abort = 0; 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 #ifdef CONFIG_MENUPROMPT
printf(CONFIG_MENUPROMPT, bootdelay); printf(CONFIG_MENUPROMPT, bootdelay);
#else #else
@ -244,7 +222,7 @@ static __inline__ int abortboot(int bootdelay)
if (bootdelay >= 0) { if (bootdelay >= 0) {
if (tstc()) { /* we got a key press */ if (tstc()) { /* we got a key press */
(void) getc(); /* consume input */ (void) getc(); /* consume input */
puts ("\b\b\b 0"); puts("\b\b\b 0");
abort = 1; /* don't auto boot */ abort = 1; /* don't auto boot */
} }
} }
@ -266,23 +244,17 @@ static __inline__ int abortboot(int bootdelay)
# endif # endif
break; 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 #ifdef CONFIG_SILENT_CONSOLE
if (abort) { if (abort)
/* permanently enable normal console output */ gd->flags &= ~GD_FLG_SILENT;
gd->flags &= ~(GD_FLG_SILENT);
} else if (gd->flags & GD_FLG_SILENT) {
/* Restore silent console */
console_assign (stdout, "nulldev");
console_assign (stderr, "nulldev");
}
#endif #endif
return abort; return abort;

View File

@ -53,12 +53,16 @@ int checkcpu (void)
#else #else
svr = get_svr(); svr = get_svr();
pvr = get_pvr(); pvr = get_pvr();
switch (SVR_VER (svr)) {
case SVR_MPC5200: switch (pvr) {
printf ("MPC5200"); case PVR_5200:
printf("MPC5200");
break;
case PVR_5200B:
printf("MPC5200B");
break; break;
default: default:
printf ("MPC52?? (SVR %08x)", svr); printf("Unknown MPC5xxx");
break; 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); p = ft_get_prop(blob, "/" OF_SOC "/ethernet@3000/mac-address", &len);
if (p != NULL) if (p != NULL)
memcpy(p, bd->bi_enetaddr, 6); 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 #endif

View File

@ -34,7 +34,12 @@
void pciauto_region_init(struct pci_region* res) 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) void pciauto_region_align(struct pci_region *res, unsigned long size)

View File

@ -1538,9 +1538,9 @@ int eth_send(volatile void *packet, int length) {
int smc_get_ethaddr (bd_t * bd) int smc_get_ethaddr (bd_t * bd)
{ {
int env_size, rom_valid, env_present = 0, reg; 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]; 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)); 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 */ 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 (!env_present) { /* if NO env */
if (rom_valid) { /* but ROM is valid */ 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", sprintf (s_env_mac, "%02X:%02X:%02X:%02X:%02X:%02X",
v_mac[0], v_mac[1], v_mac[2], v_mac[3], v_mac[0], v_mac[1], v_mac[2], v_mac[3],
v_mac[4], v_mac[5]); v_mac[4], v_mac[5]);
@ -1573,7 +1573,7 @@ int smc_get_ethaddr (bd_t * bd)
return (-1); return (-1);
} }
} else { /* good env, don't care ROM */ } 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 */ if (env_present && rom_valid) { /* if both env and ROM are good */

View File

@ -706,8 +706,6 @@
#define SVR_MJREV(svr) (((svr) >> 4) & 0x0F) /* Major SOC design revision indicator */ #define SVR_MJREV(svr) (((svr) >> 4) & 0x0F) /* Major SOC design revision indicator */
#define SVR_MNREV(svr) (((svr) >> 0) & 0x0F) /* Minor 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 */ /* Processor Version Register */
@ -818,6 +816,12 @@
#define PVR_8260_HIP7R1 0x80822013 #define PVR_8260_HIP7R1 0x80822013
#define PVR_8260_HIP7RA 0x80822014 #define PVR_8260_HIP7RA 0x80822014
/*
* MPC 52xx
*/
#define PVR_5200 0x80822011
#define PVR_5200B 0x80822014
/* /*
* System Version Register * System Version Register