board_dbg("diags: id %d ver %d nrw %d nro %d\n",id,ver,nrw,nro);
diag_read_word(nro-4,DIAG_RO_BANK,&dna[0]);
diag_read_word(nro-3,DIAG_RO_BANK,&dna[1]);
diag_read_word(nro-2,DIAG_RO_BANK,&dna[2]);
diag_read_word(nro-1,DIAG_RO_BANK,&sn);
board_dbg("S/N %x DNA %08x %08x %08x\n",sn,dna[0],dna[1],dna[2]);
// well, we can't do anything else than generate this crap from the device's DNA. The serial numbers
// provided by the MMC don't appear to be really UNIQUE...
uint32_tseed=dna[0]^dna[1]^dna[2];
mac[0]=0x22;
mac[1]=0x33;
mac[2]=(seed>>24)&0xff;
mac[3]=(seed>>16)&0xff;
mac[4]=(seed>>8)&0xff;
mac[5]=seed&0xff;
}
intwrc_board_early_init()
{
intmemtype;
...
...
@@ -41,8 +68,7 @@ int wrc_board_early_init()
if(id!=0x00012018&&id!=0xC22019)
{
pp_printf("Can't find a matching flash memory. Read ID = 0x%08x\n",id);
return0;
pp_printf("Warning! The flash memory has unsupported JEDEC ID: 0x%08x\n",id);
}
/*
...
...
@@ -58,14 +84,23 @@ int wrc_board_early_init()
*/
storage_mount(&wrc_storage_dev);
// fixme: read MAC address from the MMC
uint8_tmac[6];
sis83k_read_persistent_mac(board_mac_addr);
board_dbg("Board MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n",board_mac_addr[0],board_mac_addr[1],board_mac_addr[2],board_mac_addr[3],board_mac_addr[4],board_mac_addr[5]);
/* reset the networking part of the WRCore and start the WR Endpoint */