nx823: get mac address from environment

The environment is the canonical storage location of the mac address, so
we're killing off the global data location and moving everything to
querying the env directly.

For the nx823, the serial number is moved out of load_sernum_ethaddr() and
into misc_init_r() as is the env setup.  This lets us kill off the former
function in the process.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
diff --git a/board/nx823/flash.c b/board/nx823/flash.c
index 194d841..336e704 100644
--- a/board/nx823/flash.c
+++ b/board/nx823/flash.c
@@ -27,8 +27,9 @@
 #include <common.h>
 #include <mpc8xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 flash_info_t	flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips	*/
-extern u_long  *my_sernum;		/* from nx823.c */
 
 /*-----------------------------------------------------------------------
  * Protection Flags:
@@ -346,7 +347,7 @@
 	if (addr >= CONFIG_SYS_FLASH_SN_SECTOR && addr < CONFIG_SYS_FLASH_SN_BASE)
 	{
 		u_long dest = CONFIG_SYS_FLASH_SN_BASE;
-		u_short *sn = (u_short *)my_sernum;
+		u_short *sn = (u_short *)gd->bd->bi_sernum;
 
 		printf("(saving sernum)");
 		for (i=0; i<4; i++)