From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Getz Date: Mon, 13 Jul 2009 16:19:51 -0400 Subject: [U-Boot] [PATCH] - save the server's mac address... In-Reply-To: <200907081450.16160.rgetz@blackfin.uclinux.org> References: <200907081450.16160.rgetz@blackfin.uclinux.org> Message-ID: <200907131619.51969.rgetz@blackfin.uclinux.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Robin Getz Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :) This sets the env var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to.... addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr) Signed-of-by: Robin Getz --- Index: net/net.c =================================================================== --- net/net.c (revision 1968) +++ net/net.c (working copy) @@ -1273,6 +1274,15 @@ /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break; + +#ifdef CONFIG_KEEP_SERVERADDR + if (NetServerIP == NetArpWaitPacketIP) { + char buf[20]; + sprintf(buf, "%pM", arp->ar_data); + setenv("serveraddr", buf); + } +#endif + #ifdef ET_DEBUG printf("Got ARP REPLY, set server/gtwy eth addr (%pM)\n", arp->ar_data); Index: README =================================================================== --- README (revision 1968) +++ README (working copy) @@ -1165,6 +1165,11 @@ Defines a default value for the IP address of a TFTP server to contact when using the "tftboot" command. + CONFIG_KEEP_SERVERADDR + + Keeps the server's MAC address, in the env 'serveraddr' + for passing to bootargs (like Linux's netconsole option) + - Multicast TFTP Mode: CONFIG_MCAST_TFTP