Hi!

I just run through this piece of code in southbridge/nvidia/ck804/ck804_nic.c,

                unsigned long mac_pos;
                mac_pos = 0xffffffd0; // refer to romstrap.inc and romstrap.lds
                mac_l = readl(mac_pos) + nic_index;
                mac_h = readl(mac_pos + 4);

and can't understand what is this romstrap and why it retrieves the MAC from
it in runtime.  Is this some kind of legacy interface?  Wouldn't it be simpler
to just hardcode it during build?  E.g. see attached patch.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
Index: src/southbridge/nvidia/ck804/ck804_nic.c
===================================================================
--- src/southbridge/nvidia/ck804/ck804_nic.c	(revision 2807)
+++ src/southbridge/nvidia/ck804/ck804_nic.c	(working copy)
@@ -77,10 +77,8 @@
 	}
 //	if that is invalid we will read that from romstrap
 	if(!eeprom_valid) {
-		unsigned long mac_pos;
-		mac_pos = 0xffffffd0; // refer to romstrap.inc and romstrap.lds
-		mac_l = readl(mac_pos) + nic_index;
-		mac_h = readl(mac_pos + 4);
+		mac_l = ((MAC_VENDOR & 0xff) << 24) | MAC_SERIAL;
+		mac_h = MAC_VENDOR >> 8;
 	}
 #if 1   
 //      set that into NIC MMIO
Index: src/mainboard/asus/a8n5x/Config.lb
===================================================================
--- src/mainboard/asus/a8n5x/Config.lb	(revision 0)
+++ src/mainboard/asus/a8n5x/Config.lb	(working copy)
@@ -162,6 +162,12 @@
 mainboardinit southbridge/nvidia/ck804/id.inc
 ldscript /southbridge/nvidia/ck804/id.lds
 
+## ASUS
+makedefine CFLAGS += -DMAC_VENDOR=0x0013D4
+
+## Put your serial number here (should this be in Options.lb ?)
+makedefine CFLAGS += -DMAC_SERIAL=0x012345
+
 ##
 ## ROMSTRAP table for CK804
 ##
-- 
linuxbios mailing list
linuxbios@linuxbios.org
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to