]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
m68k: powerpc: Clean up do_mdm_init
authorSimon Glass <sjg@chromium.org>
Fri, 11 Apr 2014 02:01:32 +0000 (20:01 -0600)
committerTom Rini <trini@ti.com>
Thu, 29 May 2014 21:49:33 +0000 (17:49 -0400)
This code seems unnecessarily complex. We really just need to check the
global_data. Now that is it all in one place, and not arch-specific, this
is pretty easy.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/m68k/lib/board.c
arch/powerpc/lib/board.c
common/board_r.c
common/main.c
include/common.h

index 318ca01ea7f6df0ed39f04bb6152454b61d96d21..6de920eb43735f08e5949902975fedc250374454 100644 (file)
@@ -628,13 +628,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
        }
 #endif
 
-#ifdef CONFIG_MODEM_SUPPORT
- {
-        extern int do_mdm_init;
-        do_mdm_init = gd->do_mdm_init;
- }
-#endif
-
 #ifdef CONFIG_WATCHDOG
        /* disable watchdog if environment is set */
        if ((s = getenv ("watchdog")) != NULL) {
index 57b4a09b04e320aed88fad76b80c49c04fee2f04..300ab12a3b593fd5704e6fab59a33595e411df7c 100644 (file)
@@ -991,14 +991,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
        kbd_init();
 #endif
 
-#ifdef CONFIG_MODEM_SUPPORT
-       {
-               extern int do_mdm_init;
-
-               do_mdm_init = gd->do_mdm_init;
-       }
-#endif
-
        /* Initialization complete - start the monitor */
 
        /* main_loop() can return to retry autoboot, if so just run it again. */
index d1f0aa9b1ad12272bb657d6fabbad382d72ad746..602a239380d02951793b1d6cb34cc1c5be686f37 100644 (file)
@@ -704,17 +704,6 @@ static int initr_kbd(void)
 }
 #endif
 
-#ifdef CONFIG_MODEM_SUPPORT
-static int initr_modem(void)
-{
-       /* TODO: with new initcalls, move this into the driver */
-       extern int do_mdm_init;
-
-       do_mdm_init = gd->do_mdm_init;
-       return 0;
-}
-#endif
-
 static int run_main_loop(void)
 {
 #ifdef CONFIG_SANDBOX
@@ -928,9 +917,6 @@ init_fnc_t init_sequence_r[] = {
 #endif
 #ifdef CONFIG_PS2KBD
        initr_kbd,
-#endif
-#ifdef CONFIG_MODEM_SUPPORT
-       initr_modem,
 #endif
        run_main_loop,
 };
index c4ed846c3b249b951e7bde1f0f0e7e49f95a63f0..e3e9f8487165136257a8d59ab95b6531e23a53fe 100644 (file)
 #include <malloc.h>
 #include <version.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Board-specific Platform code can reimplement show_boot_progress () if needed
  */
 void inline __show_boot_progress (int val) {}
 void show_boot_progress (int val) __attribute__((weak, alias("__show_boot_progress")));
 
-#ifdef CONFIG_MODEM_SUPPORT
-int do_mdm_init = 0;
-extern void mdm_init(void); /* defined in board.c */
-#endif
-
 void main_loop(void)
 {
 #ifdef CONFIG_PREBOOT
@@ -40,8 +37,8 @@ void main_loop(void)
 #endif
 
 #ifdef CONFIG_MODEM_SUPPORT
-       debug("DEBUG: main_loop:   do_mdm_init=%d\n", do_mdm_init);
-       if (do_mdm_init) {
+       debug("DEBUG: main_loop:   gd->do_mdm_init=%lu\n", gd->do_mdm_init);
+       if (gd->do_mdm_init) {
                char *str = strdup(getenv("mdm_cmd"));
                setenv("preboot", str);  /* set or delete definition */
                if (str != NULL)
index 91745cf790fa1b7cf3f555491c6583f1455e3995..3473ee50ef719e46b93bab1c186906027678a9f5 100644 (file)
@@ -299,6 +299,7 @@ extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
 extern u8 __dtb_dt_begin[];    /* embedded device tree blob */
 int set_cpu_clk_info(void);
+int mdm_init(void);
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void);
 #else