Merge branch 'u-boot-tegra/master' into 'u-boot-arm/master'
[oweals/u-boot.git] / arch / powerpc / lib / board.c
index f86c6f3e8fa0476e6ee394b3fab91d2bc9186480..300ab12a3b593fd5704e6fab59a33595e411df7c 100644 (file)
@@ -343,6 +343,13 @@ void board_init_f(ulong bootflag)
 #ifdef CONFIG_PRAM
        ulong reg;
 #endif
+#ifdef CONFIG_DEEP_SLEEP
+       const ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+       struct ccsr_scfg *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG;
+       u32 start_addr;
+       typedef void (*func_t)(void);
+       func_t kernel_resume;
+#endif
 
        /* Pointer is writable since we allocated a register for it */
        gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
@@ -360,6 +367,15 @@ void board_init_f(ulong bootflag)
                if ((*init_fnc_ptr) () != 0)
                        hang();
 
+#ifdef CONFIG_DEEP_SLEEP
+       /* Jump to kernel in deep sleep case */
+       if (in_be32(&gur->scrtsr[0]) & (1 << 3)) {
+               start_addr = in_be32(&scfg->sparecr[1]);
+               kernel_resume = (func_t)start_addr;
+               kernel_resume();
+       }
+#endif
+
 #ifdef CONFIG_POST
        post_bootmode_init();
        post_run(NULL, POST_ROM | post_bootmode_get(NULL));
@@ -531,7 +547,6 @@ void board_init_f(ulong bootflag)
        bd->bi_ipbfreq = gd->arch.ipb_clk;
        bd->bi_pcifreq = gd->pci_clk;
 #endif /* CONFIG_MPC5xxx */
-       bd->bi_baudrate = gd->baudrate; /* Console Baudrate     */
 
 #ifdef CONFIG_SYS_EXTBDINFO
        strncpy((char *) bd->bi_s_version, "1.2", sizeof(bd->bi_s_version));
@@ -976,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. */