]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Blackfin: respect/check CONFIG_SYS_GBL_DATA_SIZE
authorMike Frysinger <vapier@gentoo.org>
Mon, 6 Oct 2008 07:57:39 +0000 (03:57 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 28 Jan 2009 18:26:12 +0000 (13:26 -0500)
When setting up the global data, rather than relying on sizeof(), use the
common CONFIG_SYS_GBL_DATA_SIZE define.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
lib_blackfin/board.c

index dcf246d6cef2a1f01c7fd90b3035ba9bbd113274..fef1934d6faa2bace750177a551849b95e4d34ba 100644 (file)
@@ -279,9 +279,13 @@ void board_init_f(ulong bootflag)
        dcache_enable();
 #endif
 
+#ifdef DEBUG
+       if (CONFIG_SYS_GBL_DATA_SIZE < sizeof(*gd))
+               hang();
+#endif
        serial_early_puts("Init global data\n");
        gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
-       memset((void *)gd, 0, sizeof(gd_t));
+       memset((void *)gd, 0, CONFIG_SYS_GBL_DATA_SIZE);
 
        /* Board data initialization */
        addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));