--- u-boot-1.2.0/lib_mips/board.c
+++ u-boot-1.2.0/lib_mips/board.c
@@ -313,6 +313,8 @@
  ************************************************************************
  */
 
+static char stb225_mac_address[20];
+#include "nand.h"
 void board_init_r (gd_t *id, ulong dest_addr)
 {
 	cmd_tbl_t *cmdtp;
@@ -402,6 +403,7 @@
 	env_relocate();
 
 	/* board MAC address */
+
 	s = getenv ("ethaddr");
 #ifdef CONFIG_ETHADDR
 #ifndef __STR
@@ -407,9 +407,58 @@
 #ifndef __STR
 #define __STR(x) #x
 #endif
+
 #ifndef STR
 #define STR(x) __STR(x)
 #endif
+#if defined (CONFIG_STB225) && (CONFIG_STB225 == 1)
+	
+	// Lets try and read the MAC address from the NAND FLASH before using the default one
+	// The MAC address is stored in the last 6 bytes of the SRB which is in the last page of the first FLASH partition...
+	{
+		unsigned long magic_size = 4;
+		unsigned char srb_magic[4];
+		unsigned long mac_size = 6;
+		unsigned char nand_mac_address[6];
+		unsigned int offset = (1024 * 128) - nand_info[0].erasesize;
+		
+		// Search for last good block within first 128k partition
+		while(offset > (48 * 1024))
+		{
+			if(nand_info[0].block_isbad(&nand_info[0], offset) == 0)
+			{
+				nand_read(&nand_info[0], offset + nand_info[0].erasesize - nand_info[0].oobblock, &magic_size, srb_magic);
+				nand_read(&nand_info[0], offset + nand_info[0].erasesize - nand_info[0].oobblock + 256 - mac_size, &mac_size, nand_mac_address);
+
+				// check for the existence of the SRB magic
+		 		if((magic_size == 4) && (mac_size == 6))
+				{
+					if((srb_magic[0] == 'R') && (srb_magic[1] == 'O') && (srb_magic[2] == 'K') && (srb_magic[3] == 'U'))
+					{
+						// The NAND FLASH is programmed, so create the MAC address from them
+						sprintf(stb225_mac_address, "%02x:%02x:%02x:%02x:%02x:%02x", nand_mac_address[0], 
+																					 nand_mac_address[1], 
+																					 nand_mac_address[2], 
+																					 nand_mac_address[3], 
+																					 nand_mac_address[4], 
+																					 nand_mac_address[5]);
+						s = stb225_mac_address;
+		
+						puts("MAC address: ");
+						puts(s);
+						puts("\n");
+		
+						// Store the MAC address in the environment
+						setenv ("ethaddr", s);
+					}
+				}
+				break;
+			}
+			// Bad block found, so skip to the previous one
+			offset -= nand_info[0].erasesize;
+		}
+  	}
+#endif
 	if (!s)
 		s = STR(CONFIG_ETHADDR);
