Skip to content
Snippets Groups Projects
board.c 25 KiB
Newer Older
  • Learn to ignore specific revisions
  • 	WATCHDOG_RESET();
    	bedbug_init();
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    #endif
    
    
    #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER)
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    	/*
    	 * Export available size of memory for Linux,
    	 * taking into account the protected RAM at top of memory
    	 */
    	{
    
    		char memsz[32];
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    
    
    #ifdef CONFIG_PRAM
    		pram = getenv_ulong("pram", 10, CONFIG_PRAM);
    
    		/* Also take the logbuffer into account (pram is in kB) */
    
    		pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024;
    
    		sprintf(memsz, "%ldk", (bd->bi_memsize / 1024) - pram);
    		setenv("mem", memsz);
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    	}
    #endif
    
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    #ifdef CONFIG_MODEM_SUPPORT
    
    	{
    		extern int do_mdm_init;
    
    		do_mdm_init = gd->do_mdm_init;
    	}
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    #endif
    
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    	/* Initialization complete - start the monitor */
    
    	/* main_loop() can return to retry autoboot, if so just run it again. */
    	for (;;) {
    
    		WATCHDOG_RESET();
    		main_loop();
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    	}
    
    	/* NOTREACHED - no way out of command loop except booting */
    }
    
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    {
    
    	puts("### ERROR ### Please RESET the board ###\n");
    
    	bootstage_error(BOOTSTAGE_ID_NEED_RESET);
    
    #if 0	/* We could use plain global data, but the resulting code is bigger */
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    /*
     * Pointer to initial global data area
     *
     * Here we initialize it.
     */
    #undef	XTRN_DECLARE_GLOBAL_DATA_PTR
    #define XTRN_DECLARE_GLOBAL_DATA_PTR	/* empty = allocate here */
    
    DECLARE_GLOBAL_DATA_PTR =
    	(gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
    #endif /* 0 */
    
    Wolfgang Denk's avatar
    Wolfgang Denk committed
    
    /************************************************************************/