]> git.sur5r.net Git - u-boot/blobdiff - lib_nios/board.c
FSL: Move board/mpc8266ads under board/freescale
[u-boot] / lib_nios / board.c
index 30044f7adeb6d1e628e8688afe9ff47a8c282942..0a0d2e38fdacb72e7c070ac896c703712f7f6871 100644 (file)
@@ -32,6 +32,7 @@
 #include <status_led.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * All attempts to come up with a "common" initialization sequence
@@ -106,8 +107,6 @@ init_fnc_t *init_sequence[] = {
 /***********************************************************************/
 void board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd;
        init_fnc_t **init_fnc_ptr;
        char *s, *e;
@@ -117,6 +116,9 @@ void board_init (void)
         * Nios treats CFG_GBL_DATA_OFFSET as an address.
         */
        gd = (gd_t *)CFG_GBL_DATA_OFFSET;
+       /* compiler optimization barrier needed for GCC >= 3.4 */
+       __asm__ __volatile__("": : :"memory");
+
        memset( gd, 0, CFG_GBL_DATA_SIZE );
 
        gd->bd = (bd_t *)(gd+1);        /* At end of global data */