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.
On 9/26/07, Robert Millan rmh@aybabtu.com wrote:
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.
Maybe simpler, but not really correct. What if you have 2 of your boards? With your patch, you have to compile twice. That's not elegant. If you can make just one ROM image, and then automatically change the MAC at a specified location inside of it for each individual motherboard, things work better. (AMI/award/etc do this, when you use their flash utilities, it does not overwrite the MAC so you don't lose it)
Your solution is ok if you want to just support your single board on your desktop, but for anybody trying to make a commercial product with LB, they won't want to be recompiling for each unit shipped.
On Wed, Sep 26, 2007 at 05:02:33PM -0400, Tom Sylla wrote:
On 9/26/07, Robert Millan rmh@aybabtu.com wrote:
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.
Maybe simpler, but not really correct. What if you have 2 of your boards? With your patch, you have to compile twice. That's not elegant. If you can make just one ROM image, and then automatically change the MAC at a specified location inside of it for each individual motherboard, things work better. (AMI/award/etc do this, when you use their flash utilities, it does not overwrite the MAC so you don't lose it)
Your solution is ok if you want to just support your single board on your desktop, but for anybody trying to make a commercial product with LB, they won't want to be recompiling for each unit shipped.
Agreed. MACs are a bit of a pain (also on the MCP55), and we currently do not have a good way to deal with them. I have MCP55-based LinuxBIOS machines in production that have 00:00:00:00:00:00 as MAC address for each interface, and I need to force the MAC manually in /etc/network/interfaces. Not elegant, and not ideal. The kernel does not like it either, on startup it says 'complain to your bios vendor' ;)
I would like a way to change the MAC address for a rom image with some tool - ideally as an option to flashrom, I guess. Keep in mind that there can be multiple addresses on a board!
Thanks, Ward.
On 9/26/07, Ward Vandewege ward@gnu.org wrote:
I would like a way to change the MAC address for a rom image with some tool - ideally as an option to flashrom, I guess. Keep in mind that there can be multiple addresses on a board!
There are many ways to do this in Linux-land. xxd->sed->xxd would certainly be one easy way. (maybe dd would would even work)
Mailed to soon, xxd does patching directly: --- Patch the date in the file xxd.1 % echo '0000029: 3574 68' | xxd -r - xxd.1 % xxd -s 0x28 -l 12 -c 12 xxd.1 0000028: 3235 7468 204d 6179 2031 3939 25th May 199 ---
On 9/26/07, Ward Vandewege ward@gnu.org wrote:
On Wed, Sep 26, 2007 at 05:02:33PM -0400, Tom Sylla wrote:
On 9/26/07, Robert Millan rmh@aybabtu.com wrote:
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.
Maybe simpler, but not really correct. What if you have 2 of your boards? With your patch, you have to compile twice. That's not elegant. If you can make just one ROM image, and then automatically change the MAC at a specified location inside of it for each individual motherboard, things work better. (AMI/award/etc do this, when you use their flash utilities, it does not overwrite the MAC so you don't lose it)
Your solution is ok if you want to just support your single board on your desktop, but for anybody trying to make a commercial product with LB, they won't want to be recompiling for each unit shipped.
Agreed. MACs are a bit of a pain (also on the MCP55), and we currently do not have a good way to deal with them. I have MCP55-based LinuxBIOS machines in production that have 00:00:00:00:00:00 as MAC address for each interface, and I need to force the MAC manually in /etc/network/interfaces. Not elegant, and not ideal. The kernel does not like it either, on startup it says 'complain to your bios vendor' ;)
I would like a way to change the MAC address for a rom image with some tool - ideally as an option to flashrom, I guess. Keep in mind that there can be multiple addresses on a board!
Thanks, Ward.
-- Ward Vandewege ward@fsf.org Free Software Foundation - Senior System Administrator
On Wed, Sep 26, 2007 at 05:25:07PM -0400, Tom Sylla wrote:
Mailed to soon, xxd does patching directly:
Patch the date in the file xxd.1 % echo '0000029: 3574 68' | xxd -r - xxd.1 % xxd -s 0x28 -l 12 -c 12 xxd.1 0000028: 3235 7468 204d 6179 2031 3939 25th May 199
Then how about integrating this in the build system so that romstrap is modified on build time using a config file option? This way we please both kinds of users.
On 9/26/07, Ward Vandewege ward@gnu.org wrote:
On Wed, Sep 26, 2007 at 05:02:33PM -0400, Tom Sylla wrote:
On 9/26/07, Robert Millan rmh@aybabtu.com wrote:
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.
Maybe simpler, but not really correct. What if you have 2 of your boards? With your patch, you have to compile twice. That's not elegant. If you can make just one ROM image, and then automatically change the MAC at a specified location inside of it for each individual motherboard, things work better. (AMI/award/etc do this, when you use their flash utilities, it does not overwrite the MAC so you don't lose it)
Your solution is ok if you want to just support your single board on your desktop, but for anybody trying to make a commercial product with LB, they won't want to be recompiling for each unit shipped.
Agreed. MACs are a bit of a pain (also on the MCP55), and we currently do not have a good way to deal with them. I have MCP55-based LinuxBIOS machines in production that have 00:00:00:00:00:00 as MAC address for each interface, and I need to force the MAC manually in /etc/network/interfaces. Not elegant, and not ideal. The kernel does not like it either, on startup it says 'complain to your bios vendor' ;)
I would like a way to change the MAC address for a rom image with some tool - ideally as an option to flashrom, I guess. Keep in mind that there can be multiple addresses on a board!
Thanks, Ward.
-- Ward Vandewege ward@fsf.org Free Software Foundation - Senior System Administrator
I would like a way to change the MAC address for a rom image with some tool - ideally as an option to flashrom, I guess. Keep in mind that there can be multiple addresses on a board!
1. use flashrom with exclude range to keep the old mac... 2. add some script to read out and mac, and flash linuxbios, and write back mac addr again.
YH
On 26.09.2007 23:07, Ward Vandewege wrote:
On Wed, Sep 26, 2007 at 05:02:33PM -0400, Tom Sylla wrote:
On 9/26/07, Robert Millan rmh@aybabtu.com wrote:
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.
Maybe simpler, but not really correct. What if you have 2 of your boards? With your patch, you have to compile twice. That's not elegant. If you can make just one ROM image, and then automatically change the MAC at a specified location inside of it for each individual motherboard, things work better. (AMI/award/etc do this, when you use their flash utilities, it does not overwrite the MAC so you don't lose it)
Your solution is ok if you want to just support your single board on your desktop, but for anybody trying to make a commercial product with LB, they won't want to be recompiling for each unit shipped.
Agreed. MACs are a bit of a pain (also on the MCP55), and we currently do not have a good way to deal with them. I have MCP55-based LinuxBIOS machines in production that have 00:00:00:00:00:00 as MAC address for each interface, and I need to force the MAC manually in /etc/network/interfaces. Not elegant, and not ideal. The kernel does not like it either, on startup it says 'complain to your bios vendor' ;)
Hahaha. I added that warning to the forcedeth driver. However, after printing that warning forcedeth _should_ auto-generate a random MAC address for the card. No idea if that part of the still works.
I would like a way to change the MAC address for a rom image with some tool - ideally as an option to flashrom, I guess. Keep in mind that there can be multiple addresses on a board!
Yes, but usually only one of them is in the MCP55 part.
Regards, Carl-Daniel
On Wed, Sep 26, 2007 at 05:07:45PM -0400, Ward Vandewege wrote:
I would like a way to change the MAC address for a rom image with some tool - ideally as an option to flashrom, I guess. Keep in mind that there can be multiple addresses on a board!
I just wrote a small utility to set the appropiate bytes in linuxbios.rom.
Any comments? Would you like a patch to integrate it in the build system?
On Thu, Sep 27, 2007 at 04:20:28PM +0200, Robert Millan wrote:
I just wrote a small utility to set the appropiate bytes in linuxbios.rom.
Any comments?
I prefer the xxd trick. Note that I am exclusively working on systems where (I can make sure) xxd is available.
//Peter
On Thu, Sep 27, 2007 at 05:44:29PM +0200, Peter Stuge wrote:
On Thu, Sep 27, 2007 at 04:20:28PM +0200, Robert Millan wrote:
I just wrote a small utility to set the appropiate bytes in linuxbios.rom.
Any comments?
I prefer the xxd trick. Note that I am exclusively working on systems where (I can make sure) xxd is available.
Looking at the manpage, it seems that xxd is aimed at a different kind of use. I'm a bit skeptic about it being able to do that job (specialy about handling bit shifting, endianess and negative offsets). Perhaps you could show an example?