]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/main.c
net: fec_mxc: use fec_set_dev_name to set name
[karo-tx-uboot.git] / common / main.c
index 61c6cac882150acaba23f032b2ef4bb14c0d4bca..5d8454ea0e5a6407882e4b0e06a27426270036f2 100644 (file)
@@ -53,9 +53,7 @@
 #include <linux/ctype.h>
 #include <menu.h>
 
-#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
 DECLARE_GLOBAL_DATA_PTR;
-#endif
 
 /*
  * Board-specific Platform code can reimplement show_boot_progress () if needed
@@ -333,6 +331,20 @@ err:
        hang();
 }
 
+static void process_fdt_options(const void *blob)
+{
+       ulong addr;
+
+       /* Add an env variable to point to a kernel payload, if available */
+       addr = fdtdec_get_config_int(gd->fdt_blob, "kernel-offset", 0);
+       if (addr)
+               setenv_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
+
+       /* Add an env variable to point to a root disk, if available */
+       addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0);
+       if (addr)
+               setenv_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
+}
 #endif /* CONFIG_OF_CONTROL */
 
 
@@ -364,6 +376,8 @@ void main_loop (void)
        char bcs_set[16];
 #endif /* CONFIG_BOOTCOUNT_LIMIT */
 
+       bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
+
 #ifdef CONFIG_BOOTCOUNT_LIMIT
        bootcount = bootcount_load();
        bootcount++;
@@ -451,6 +465,8 @@ void main_loop (void)
        if (env)
                s = env;
 
+       process_fdt_options(gd->fdt_blob);
+
        /*
         * If the bootsecure option was chosen, use secure_boot_cmd().
         * Always use 'env' in this case, since bootsecure requres that the
@@ -1125,8 +1141,16 @@ int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
                                        puts (tab_seq+(col&07));
                                        col += 8 - (col&07);
                                } else {
-                                       ++col;          /* echo input           */
-                                       putc (c);
+                                       char buf[2];
+
+                                       /*
+                                        * Echo input using puts() to force am
+                                        * LCD flush if we are using an LCD
+                                        */
+                                       ++col;
+                                       buf[0] = c;
+                                       buf[1] = '\0';
+                                       puts(buf);
                                }
                                *p++ = c;
                                ++n;