Skip to contentSkip to conversation

m68k fix for Ethernet Buffers at address 0

PATCH New Wilson Callan 6 participants 23 messages Jun 29, 2007 – Aug 10, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

Hi,

Attached is a patch that fixes a problem i saw with a coldfire 5235 port. i'll include the patch here in the email as well since it describes the problem:

diff -purN u-boot-1.1.6/lib_m68k/board.c u-boot-1.1.6-pktfix/lib_m68k/ board.c
--- u-boot-1.1.6/lib_m68k/board.c 2006-11-02 09:15:01.000000000 -0500
+++ u-boot-1.1.6-pktfix/lib_m68k/board.c 2007-06-28
11:07:19.000000000 -0400
@@ -642,6 +642,22 @@ void board_init_r (gd_t *id, ulong dest_

#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET)
	WATCHDOG_RESET();

+
+ /* init NetRxPackets here otherwise eth_init() will cause
+ * buffer descriptors to use 0 as their buffer and overwrite lower
memory.
+ * NetLoop() does this properly later.
+ * Cannot remove eth_init() call because linux driver assumes this
+ * happened, for MAC Address to be loaded into microcontroller
+ */
+ {
+ int i;
+ static uchar pkt[(PKTBUFSRX+1) * PKTSIZE_ALIGN + PKTALIGN];
+ uchar *tx = pkt + (PKTALIGN - 1);
+ tx -= (ulong) tx % PKTALIGN;
+ for (i = 0; i < PKTBUFSRX; i++) {
+ NetRxPackets[i] = tx + (i+1)*PKTSIZE_ALIGN;
+ }
+ }

	eth_init(bd);

#endif

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pktfix.patch
Type: application/octet-stream
Size: 953 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070629/f5cbe197/attachment.obj

#1 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

Dear Wilson,

Quoted 4 lines · in message <[email protected]> you wrote:

Attached is a patch that fixes a problem i saw with a coldfire 5235 port. i'll include the patch here in the email as well since it describes the problem:

First, a formal issue: you missed to include the Signed-off-by: line which is mandatory for each patch.

Second, a technical issue:

Review

Quoted 2 lines
(quoted diff) +2 -0
+	 * Cannot remove eth_init() call because linux driver assumes this
+	 * happened, for MAC Address to be loaded into microcontroller

This is a problem with the Linux driver then, and should be fixed in Linux. Please see the FAQ entry about this, and then let's get rid of this eth_init call in U-Boot. Philosophy here is that devices shall be only initialized when really used by U-Boot.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Nature is very un-American.  Nature never hurries."
- William George Jordan
#2 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

Dear Wolfgang,

Quoted 3 lines

First, a formal issue: you missed to include the Signed-off-by: line which is mandatory for each patch.

Apologies. I didnt know i should "sign off" my own patches, but now i see that is what i'm supposed to do.

Quoted 4 lines

This is a problem with the Linux driver then, and should be fixed in Linux. Please see the FAQ entry about this, and then let's get rid of this eth_init call in U-Boot. Philosophy here is that devices shall be only initialized when really used by U-Boot.

that makes sense. in this case its u-boot that knows the Ethernet Address since its stored in its environment. Possibly the solution is to create a routine in fec.c (the fast ethernet driver) which only sets the MAC in the coldfire, instead of starting up the ethernet port before the buffers are ready. This change would keep things working as they are, but fix the bug where packets are received before the buffer address is set.

should i go ahead with this fix, or instead remove the eth_init() call and risk breaking all the m68k systems?

thanks, wilson

#3 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

Dear Wilson,

Quoted 8 lines · in message <[email protected]> you wrote:
Quoted 5 lines

This is a problem with the Linux driver then, and should be fixed in Linux. Please see the FAQ entry about this, and then let's get rid of this eth_init call in U-Boot. Philosophy here is that devices shall be only initialized when really used by U-Boot.

that makes sense. in this case its u-boot that knows the Ethernet Address since its stored in its environment. Possibly the solution is to create a routine in fec.c (the fast ethernet driver) which only

If you mean the U-Boot file: then no, that would be the wrong approach.

U-Boot shall initialize a device only when it uses it. If Ethernet is not used by U-Boot itself, it shall not touch any parts of the Ethernet controller.

U-Boot shall pass the MAC address to the Linux kernel by whatever means the current architecture provides; if no other means are available for example on the kernel command line.

Quoted 4 lines

sets the MAC in the coldfire, instead of starting up the ethernet port before the buffers are ready. This change would keep things working as they are, but fix the bug where packets are received before the buffer address is set.

Which bug are you talking about? Is this in U-Boot or in Linux?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Far back in the mists of ancient time, in the great and glorious days
of the former Galactic Empire, life was wild, rich  and  largely  tax
free.         - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
#4 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

Quoted 3 lines · Wolfgang Denk

U-Boot shall initialize a device only when it uses it. If Ethernet is not used by U-Boot itself, it shall not touch any parts of the Ethernet controller.

Ok, now I'm confused.

When I submitted the macb ethernet driver, which works on both avr32 and at91sam926x devices, for inclusion in the LInux kernel, I was told to remove the mac address from the platform data. This was because ARM relied on u-boot initializing the mac address of all ethernet controllers before booting Linux, so AVR32 should do the same as well.

So I did this and added some code to the avr32 board setup to initialize the mac address registers as a temporary measure until I could be sure that u-boot did in fact always set up the mac address on all interfaces.

Now, it seems like the situation is:
a) Other architectures rely on mac registers being initialized by
u-boot as well.
b) This is not how things are supposed to work.

I'd be happy to go back to passing mac addresses through the tagged list (in fact, u-boot never stopped doing that on avr32) but this needs to be resolved on ARM before I can change the driver.

H?vard

#5 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

Quoted 4 lines · In message <[email protected]> you…

When I submitted the macb ethernet driver, which works on both avr32 and at91sam926x devices, for inclusion in the LInux kernel, I was told to remove the mac address from the platform data. This was because ARM

So far this is most probably correct.

Quoted 2 lines

relied on u-boot initializing the mac address of all ethernet controllers before booting Linux, so AVR32 should do the same as well.

This is definitely not correct. U-Boot's position about this is very clear, and has been for a long time. This is actually a FAQ, please look it up.

Quoted 4 lines

So I did this and added some code to the avr32 board setup to initialize the mac address registers as a temporary measure until I could be sure that u-boot did in fact always set up the mac address on all interfaces.

It will never do that.

Quoted 4 lines

Now, it seems like the situation is:
a) Other architectures rely on mac registers being initialized by
u-boot as well.
b) This is not how things are supposed to work.

b)

Quoted 3 lines

I'd be happy to go back to passing mac addresses through the tagged list (in fact, u-boot never stopped doing that on avr32) but this needs to be resolved on ARM before I can change the driver.

The thing is that the ARM folks don't want o see MAC addresses in ATAGs either. Don't ask me why - if they use this mechanism for passing h/w related information around that would seem the most logical approach to me, too. But they don't want it.

And we are as stubborn as them: we don't want to initialize h/w we didn't use.

<asbestos>
The Right Thing (TM) would of course be to get rid of all this ATAGs stuff on ARM and use a proper device tree there, too, like the PowerPC folks have been doing for such a long time. And on MIPS and all the other systems, too.
</asbestos>

[He, I'm leaving for vacation, so I won't suffer from the fires of the flame war I just started :-) ]

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The use of COBOL cripples the mind; its teaching  should,  therefore,
be regarded as a criminal offense.                   - E. W. Dijkstra
#6 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

Quoted 6 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you…

When I submitted the macb ethernet driver, which works on both avr32 and at91sam926x devices, for inclusion in the LInux kernel, I was told to remove the mac address from the platform data. This was because ARM

Quoted 8 lines

So far this is most probably correct.

Quoted 2 lines

relied on u-boot initializing the mac address of all ethernet controllers before booting Linux, so AVR32 should do the same as well.

This is definitely not correct. U-Boot's position about this is very clear, and has been for a long time. This is actually a FAQ, please look it up.

Well, the mac address must be passed _somewhere_, so they are either both correct or both incorrect. But after reading the FAQ and the linux-arm thread it links to, it's clear to me that AVR32 is right and ARM is wrong, i.e. passing the mac address through the boot protocol (ATAGs or otherwise) is the right thing to do.

So I will just forget about "fixing" u-boot and instead consider posting a patch for the macb driver to look for the mac address in the platform_data instead of the hardware registers. I don't have the time to start a flamewar right now, so it'll have to wait until after my vacation at least.

Quoted 8 lines
Quoted 3 lines

I'd be happy to go back to passing mac addresses through the tagged list (in fact, u-boot never stopped doing that on avr32) but this needs to be resolved on ARM before I can change the driver.

The thing is that the ARM folks don't want o see MAC addresses in ATAGs either. Don't ask me why - if they use this mechanism for passing h/w related information around that would seem the most logical approach to me, too. But they don't want it.

Yeah, I got the impression that they wanted to break nfsroot just for the heck of it...

Quoted 6 lines

<asbestos>
The Right Thing (TM) would of course be to get rid of all this ATAGs stuff on ARM and use a proper device tree there, too, like the PowerPC folks have been doing for such a long time. And on MIPS and all the other systems, too.
</asbestos>

Heh. AVR32 uses ATAGs too, so I suppose you want me to switch as well?

I guess I should look into it. Switching boot protocol sounds like a long and painful experience though...

Quoted 2 lines

[He, I'm leaving for vacation, so I won't suffer from the fires of the flame war I just started :-) ]

People don't seem to be taking the bait so far ;-)

H?vard

#7 lore raw

PATCH 1/1 Restore CONFIG_BOOTP_SERVER option

Hi,

back in u-boot-1.1.4 there was an option CONFIG_BOOTP_SERVER which controlled if the bootp server was the tftp server. in u-boot-1.1.6 it has been removed, but i find that option quite useful because you can program the tftp server using the environment variable serverip.

I have restored the option and included it in CONFIG_BOOTP_DEFAULT so the result is the same operation to all boards that dont remove it from their CONFIG_BOOTP_MASK.

CHANGELOG:

restored CONFIG_BOOTP_SERVER from previous u-boot code to control the tftp server vs the bootp server

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CONFIG_BOOTP_SERVER.patch
Type: application/octet-stream
Size: 1222 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070719/239a8cf5/attachment.obj

#8 lore raw

PATCH 1/1 Restore CONFIG_BOOTP_SERVER option

Hi Wilson,

Quoted 4 lines

back in u-boot-1.1.4 there was an option CONFIG_BOOTP_SERVER which controlled if the bootp server was the tftp server. in u-boot-1.1.6 it has been removed, but i find that option quite useful because you can program the tftp server using the environment variable serverip.

Can you help me to find that in the original sources? I seem not to be able to do that:

[dzu at pollux u-boot]$ git checkout U-Boot-1_1_4 [dzu at pollux u-boot]$ head -2 CHANGELOG | tail -1 Changes for U-Boot 1.1.4:
[dzu at pollux u-boot]$ grep -ri CONFIG_BOOTP_SERVER net/ [dzu at pollux u-boot]$

Flexing my git-muscle, I cannot find a reference to it anywhere in the history of the networking code:

[dzu at pollux u-boot]$ git checkout master Switched to branch "master"
[dzu at pollux u-boot]$ git log -p net/ | grep BOOTP_SERVER [dzu at pollux u-boot]$

What exact version did you see that option in?

Cheers
Detlev

Signature · 6 lines
Man is a fool, and woman, for tolerating him, is a damned fool
                       -- Mark Twain
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#9 lore raw

PATCH 1/1 Restore CONFIG_BOOTP_SERVER option

ah, you are correct. it looks like i added it back in my 1.1.4 port and missed that fact when porting to 1.1.6. So this is a submit for a new option then. I hope others find it useful. It fits in well with the existing serverip environment variable.

CHANGELOG:

Added CONFIG_BOOTP_SERVER to allow the tftp server to be different from the bootp server

Quoted 36 lines · Detlev Zundel

Hi Wilson,

Quoted 4 lines

back in u-boot-1.1.4 there was an option CONFIG_BOOTP_SERVER which controlled if the bootp server was the tftp server. in u-boot-1.1.6 it has been removed, but i find that option quite useful because you can program the tftp server using the environment variable serverip.

Can you help me to find that in the original sources? I seem not to be able to do that:

[dzu at pollux u-boot]$ git checkout U-Boot-1_1_4 [dzu at pollux u-boot]$ head -2 CHANGELOG | tail -1 Changes for U-Boot 1.1.4:
[dzu at pollux u-boot]$ grep -ri CONFIG_BOOTP_SERVER net/ [dzu at pollux u-boot]$

Flexing my git-muscle, I cannot find a reference to it anywhere in the history of the networking code:

[dzu at pollux u-boot]$ git checkout master Switched to branch "master"
[dzu at pollux u-boot]$ git log -p net/ | grep BOOTP_SERVER [dzu at pollux u-boot]$

What exact version did you see that option in?

Cheers
Detlev

Signature · 6 lines
Man is a fool, and woman, for tolerating him, is a damned fool
                       -- Mark Twain
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#10 lore raw

PATCH 1/1 Restore CONFIG_BOOTP_SERVER option

Hi Wilson,

Quoted 4 lines

ah, you are correct. it looks like i added it back in my 1.1.4 port and missed that fact when porting to 1.1.6. So this is a submit for a new option then. I hope others find it useful. It fits in well with the existing serverip environment variable.

I agree - lets wait until Ben picks it up.

Cheers
Detlev

Signature · 9 lines
Once the  implementation is  up and running,  it is still a trick to keep it
running.  In a normal,  closed implementation,  this is not a problem;  in a
system with metaobject protocols [..] there is the potential for spectacular
failure modes if certain situations are not properly anticipated.
                                       -- The Art of the Metaobject Protocol
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#11 lore raw

PATCH 1/1 Restore CONFIG_BOOTP_SERVER option

Hi Wilson,

Quoted 7 lines · Detlev Zundel

Hi Wilson,

Quoted 4 lines

ah, you are correct. it looks like i added it back in my 1.1.4 port and missed that fact when porting to 1.1.6. So this is a submit for a new option then. I hope others find it useful. It fits in well with the existing serverip environment variable.

Quoted 5 lines

I agree - lets wait until Ben picks it up.

Cheers
Detlev

This looks good. Sorry for being so picky, but please do the following and I'll integrate right away:

1. Since we're not restoring anything, the e-mail title needs to change
2. CHANGELOG part is no longer needed
3. Change e-mail body to a short description of the patch

If possible, please paste the patch into the message instead of attaching. Not a big deal, but it's a little easier for me that way.

thanks,
Ben

#12 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

Added CONFIG_BOOTP_SERVER to allow the tftp server to be different from the bootp server

--- u-boot-1.1.6/include/cmd_confdefs.h 2006-11-02 09:15:01.000000000
-0500
+++ u-boot/include/cmd_confdefs.h 2007-05-23 15:02:04.000000000 -0400
@@ -167,6 +167,7 @@
#define CONFIG_BOOTP_SEND_HOSTNAME 0x00000100
#define CONFIG_BOOTP_NTPSERVER 0x00000200
#define CONFIG_BOOTP_TIMEOFFSET 0x00000400
+#define CONFIG_BOOTP_SERVER 0x00000800
#define CONFIG_BOOTP_VENDOREX 0x80000000
@@ -176,7 +177,8 @@

#define CONFIG_BOOTP_DEFAULT		(CONFIG_BOOTP_SUBNETMASK | \
					CONFIG_BOOTP_GATEWAY	 | \
					CONFIG_BOOTP_HOSTNAME	 | \

- CONFIG_BOOTP_BOOTPATH)
+ CONFIG_BOOTP_BOOTPATH | \
+ CONFIG_BOOTP_SERVER)
#ifndef CONFIG_BOOTP_MASK
#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT

net/bootp.c +0 -0
@@ -120,10 +120,12 @@
	IPaddr_t tmp_ip;
	NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SERVER)
	NetCopyIP(&tmp_ip, &bp->bp_siaddr);
	if (tmp_ip != 0)
		NetCopyIP(&NetServerIP, &bp->bp_siaddr);
	memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6);
+#endif
	if (strlen(bp->bp_file) > 0)
		copy_filename (BootFile, bp->bp_file, sizeof(BootFile));
Quoted 7 lines · Ben Warren

1. Since we're not restoring anything, the e-mail title needs to change
2. CHANGELOG part is no longer needed
3. Change e-mail body to a short description of the patch

If possible, please paste the patch into the message instead of attaching.

#13 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

Wilson,

On Thu, 2007-07-26 at 12:08 -0400, Wilson Callan wrote:
<snip>

Quoted 11 lines · Ben Warren
Quoted 8 lines

1. Since we're not restoring anything, the e-mail title needs to change
2. CHANGELOG part is no longer needed
3. Change e-mail body to a short description of the patch

If possible, please paste the patch into the message instead of attaching.

Almost there. I get a 'malformed patch' error when I try to apply this. I don't think it's whitespace-related, but whatever you're using for diff doesn't play well with git.

Please re-submit, and make sure the patch is against the latest git snapshot, not v1.1.6:

'git clone git://www.denx.de/git/u-boot.git'

The best way to ensure that the patch will apply is to use 'git diff' instead of 'diff -...'

thanks,
Ben

#14 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

In reply to Ben Warren

Added CONFIG_BOOTP_SERVER to allow the tftp server to be different from the bootp server

include/cmd_confdefs.h +0 -0
index b3ccdce..581dbf7 100644
@@ -169,6 +169,7 @@

#define CONFIG_BOOTP_SEND_HOSTNAME 0x00000100
#define CONFIG_BOOTP_NTPSERVER 0x00000200
#define CONFIG_BOOTP_TIMEOFFSET 0x00000400
+#define CONFIG_BOOTP_SERVER 0x00000800
#define CONFIG_BOOTP_VENDOREX 0x80000000
@@ -178,7 +179,8 @@

#define CONFIG_BOOTP_DEFAULT		(CONFIG_BOOTP_SUBNETMASK | \
					CONFIG_BOOTP_GATEWAY	 | \
					CONFIG_BOOTP_HOSTNAME	 | \

- CONFIG_BOOTP_BOOTPATH)
+ CONFIG_BOOTP_BOOTPATH | \
+ CONFIG_BOOTP_SERVER)
#ifndef CONFIG_BOOTP_MASK
#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT

net/bootp.c +0 -0
index 1de9a8f..2c05f2e 100644
@@ -120,10 +120,12 @@ static void BootpCopyNetParams(Bootp_t *bp)
	IPaddr_t tmp_ip;
	NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SERVER)
	NetCopyIP(&tmp_ip, &bp->bp_siaddr);
	if (tmp_ip != 0)
		NetCopyIP(&NetServerIP, &bp->bp_siaddr);
	memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6);
+#endif
	if (strlen(bp->bp_file) > 0)
		copy_filename (BootFile, bp->bp_file, sizeof(BootFile));
#15 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

Quoted 29 lines · Wilson Callan

Added CONFIG_BOOTP_SERVER to allow the tftp server to be different from the bootp server

include/cmd_confdefs.h +3 -1
index b3ccdce..581dbf7 100644
@@ -169,6 +169,7 @@
 #define CONFIG_BOOTP_SEND_HOSTNAME	0x00000100
 #define CONFIG_BOOTP_NTPSERVER		0x00000200
 #define CONFIG_BOOTP_TIMEOFFSET		0x00000400
+#define CONFIG_BOOTP_SERVER		0x00000800
 #define CONFIG_BOOTP_VENDOREX		0x80000000
@@ -178,7 +179,8 @@
 #define CONFIG_BOOTP_DEFAULT		(CONFIG_BOOTP_SUBNETMASK | \
 					CONFIG_BOOTP_GATEWAY	 | \
 					CONFIG_BOOTP_HOSTNAME	 | \
-					CONFIG_BOOTP_BOOTPATH)
+					CONFIG_BOOTP_BOOTPATH	 | \
+					CONFIG_BOOTP_SERVER)
 #ifndef CONFIG_BOOTP_MASK
 #define CONFIG_BOOTP_MASK		CONFIG_BOOTP_DEFAULT
net/bootp.c +0 -0
index 1de9a8f..2c05f2e 100644

net/bootp.c static void BootpCopyNetParams(Bootp_t *bp) · line 129

Quoted 10 lines
net/bootp.c +2 -0
@@ -120,10 +120,12 @@ static void BootpCopyNetParams(Bootp_t *bp)
 	IPaddr_t tmp_ip;
 	NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SERVER)
 	NetCopyIP(&tmp_ip, &bp->bp_siaddr);
 	if (tmp_ip != 0)
 		NetCopyIP(&NetServerIP, &bp->bp_siaddr);
 	memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6);
+#endif
 	if (strlen(bp->bp_file) > 0)
 		copy_filename (BootFile, bp->bp_file, sizeof(BootFile));

Any chance we can get this patch rebased on the version of things in the u-boot-testing tree? It would save everyone a bunch of trouble!

Thanks,
jdl

#16 lore raw

PATCH 1/1 New u-boot-testing CONFIG_BOOTP_SERVERIP option

Added CONFIG_BOOTP_SERVERIP to allow the tftp server to be different from the bootp server

README +0 -0
index cfbd39a..d7812a3 100644
@@ -1141,6 +1141,9 @@ The following options need to be configured:

CONFIG_BOOTP_TIMEOFFSET
CONFIG_BOOTP_VENDOREX

+ CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip
+ environment variable, not the BOOTP server.
+
CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS serverip from a DHCP server, it is possible that more than one DNS serverip is offered to the client.
@@ -1153,7 +1156,7 @@ The following options need to be configured:
CONFIG_BOOTP_SEND_HOSTNAME - Some DHCP servers are capable to do a dynamic update of a DNS server. To do this, they need the hostname of the DHCP requester.
- If CONFIG_BOOP_SEND_HOSTNAME is defined, the content
+ If CONFIG_BOOTP_SEND_HOSTNAME is defined, the content
of the "hostname" environment variable is passed as option 12 to the DHCP server.

net/bootp.c +0 -0
index 80f53bc..be1ee33 100644
@@ -120,10 +120,12 @@ static void BootpCopyNetParams(Bootp_t *bp)
	IPaddr_t tmp_ip;

	NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if !defined(CONFIG_BOOTP_SERVERIP)
	NetCopyIP(&tmp_ip, &bp->bp_siaddr);
	if (tmp_ip != 0)
		NetCopyIP(&NetServerIP, &bp->bp_siaddr);
	memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6);
+#endif
	if (strlen(bp->bp_file) > 0)
		copy_filename (BootFile, bp->bp_file, sizeof(BootFile));
Quoted 8 lines · Jon Loeliger

Any chance we can get this patch rebased on the version of things in the u-boot-testing tree? It would save everyone a bunch of trouble!

Thanks,
jdl

#17 lore raw

PATCH 1/1 New u-boot-testing CONFIG_BOOTP_SERVERIP option

Quoted 2 lines · In message <[email protected]> you wrote:

Added CONFIG_BOOTP_SERVERIP to allow the tftp server to be different from the bootp server

Can you please explain why this is needed?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
One essential to success is that you desire be an all-obsessing  one,
your thoughts and aims be co-ordinated, and your energy be concentra-
ted and applied without letup.
#18 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

In reply to Wilson Callan
Quoted 2 lines · In message <[email protected]> you wrote:

Added CONFIG_BOOTP_SERVER to allow the tftp server to be different from the bootp server

Sorry for the late review...

Which problem is this patch supposed to fix? Doesn't the "nextserver" option in your DHCP server config file do exactly what you want?

Quoted 23 lines

index b3ccdce..581dbf7 100644

include/cmd_confdefs.h +3 -1
@@ -169,6 +169,7 @@
 #define CONFIG_BOOTP_SEND_HOSTNAME	0x00000100
 #define CONFIG_BOOTP_NTPSERVER		0x00000200
 #define CONFIG_BOOTP_TIMEOFFSET		0x00000400
+#define CONFIG_BOOTP_SERVER		0x00000800
 #define CONFIG_BOOTP_VENDOREX		0x80000000
@@ -178,7 +179,8 @@
 #define CONFIG_BOOTP_DEFAULT		(CONFIG_BOOTP_SUBNETMASK | \
 					CONFIG_BOOTP_GATEWAY	 | \
 					CONFIG_BOOTP_HOSTNAME	 | \
-					CONFIG_BOOTP_BOOTPATH)
+					CONFIG_BOOTP_BOOTPATH	 | \
+					CONFIG_BOOTP_SERVER)
 #ifndef CONFIG_BOOTP_MASK
 #define CONFIG_BOOTP_MASK		CONFIG_BOOTP_DEFAULT
net/bootp.c +0 -0
index 1de9a8f..2c05f2e 100644

net/bootp.c static void BootpCopyNetParams(Bootp_t *bp) · line 127

Quoted 8 lines
net/bootp.c +2 -0
@@ -120,10 +120,12 @@ static void BootpCopyNetParams(Bootp_t *bp)
 	IPaddr_t tmp_ip;
 	NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SERVER)
 	NetCopyIP(&tmp_ip, &bp->bp_siaddr);
 	if (tmp_ip != 0)
 		NetCopyIP(&NetServerIP, &bp->bp_siaddr);
 	memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6);
+#endif

If I understand corrrectly, this patch changes the behaviour for all boards that currently don't define CONFIG_BOOTP_SERVER.

Is this intentional?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is dangerous to be right on a subject  on  which  the  established
authorities are wrong.                                    -- Voltaire
#19 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

Hi Wolfgang,

Quoted 8 lines
Quoted 2 lines · In message <[email protected]> you wrote:

Added CONFIG_BOOTP_SERVER to allow the tftp server to be different from the bootp server

Sorry for the late review...

Which problem is this patch supposed to fix? Doesn't the "nextserver" option in your DHCP server config file do exactly what you want?

I would not say it tries to "fix a problem" but rather "add an option". In my opinion next-server really serves the same purpose, but of course out of reach of U-Boot. So we gain more freedom in regard to misconfigured DHCP servers.

Quoted 35 lines
Quoted 23 lines

index b3ccdce..581dbf7 100644

include/cmd_confdefs.h +3 -1
@@ -169,6 +169,7 @@
 #define CONFIG_BOOTP_SEND_HOSTNAME	0x00000100
 #define CONFIG_BOOTP_NTPSERVER		0x00000200
 #define CONFIG_BOOTP_TIMEOFFSET		0x00000400
+#define CONFIG_BOOTP_SERVER		0x00000800
 #define CONFIG_BOOTP_VENDOREX		0x80000000
@@ -178,7 +179,8 @@
 #define CONFIG_BOOTP_DEFAULT		(CONFIG_BOOTP_SUBNETMASK | \
 					CONFIG_BOOTP_GATEWAY	 | \
 					CONFIG_BOOTP_HOSTNAME	 | \
-					CONFIG_BOOTP_BOOTPATH)
+					CONFIG_BOOTP_BOOTPATH	 | \
+					CONFIG_BOOTP_SERVER)
 #ifndef CONFIG_BOOTP_MASK
 #define CONFIG_BOOTP_MASK		CONFIG_BOOTP_DEFAULT
net/bootp.c +0 -0
index 1de9a8f..2c05f2e 100644

net/bootp.c static void BootpCopyNetParams(Bootp_t *bp) · line 127

Quoted 8 lines
net/bootp.c +2 -0
@@ -120,10 +120,12 @@ static void BootpCopyNetParams(Bootp_t *bp)
 	IPaddr_t tmp_ip;
 	NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SERVER)
 	NetCopyIP(&tmp_ip, &bp->bp_siaddr);
 	if (tmp_ip != 0)
 		NetCopyIP(&NetServerIP, &bp->bp_siaddr);
 	memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6);
+#endif

If I understand corrrectly, this patch changes the behaviour for all boards that currently don't define CONFIG_BOOTP_SERVER.

Quoted 1 line

Is this intentional?

If I understand this correctly, because CONFIG_BOOTP_MASK is tested and I don't see anyone defining this, it will *not* touch any configuration right now. Subsequently for consistency the code in bootp.c _may_ move to also using this MASK variable but then many configs will have to be touched. Many configs potentially can simply move to CONFIG_BOOTP_DEFAULT.

Cheers
Detlev

Signature · 7 lines
I propose that each copy of the OS should ship with an orange jumpsuit and
sensory deprivation goggles, since all Vista users have been unilaterally
declared 'enemy combatants' by the content apparatchiki" - Daniel Nevin.
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#20 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Which problem is this patch supposed to fix? Doesn't the "nextserver" option in your DHCP server config file do exactly what you want?

I would not say it tries to "fix a problem" but rather "add an option". In my opinion next-server really serves the same purpose, but of course out of reach of U-Boot. So we gain more freedom in regard to misconfigured DHCP servers.

Hm...

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+++ b/include/cmd_confdefs.h

(quoted diff) +1 -0
@@ -169,6 +169,7 @@
 #define CONFIG_BOOTP_SEND_HOSTNAME	0x00000100
 #define CONFIG_BOOTP_NTPSERVER		0x00000200
 #define CONFIG_BOOTP_TIMEOFFSET		0x00000400
+#define CONFIG_BOOTP_SERVER		0x00000800
 #define CONFIG_BOOTP_VENDOREX		0x80000000
@@ -178,7 +179,8 @@
Quoted 8 lines
Quoted 8 lines

Review line 185

Quoted 8 lines
(quoted diff) +2 -1
 #define CONFIG_BOOTP_DEFAULT		(CONFIG_BOOTP_SUBNETMASK | \
 					CONFIG_BOOTP_GATEWAY	 | \
 					CONFIG_BOOTP_HOSTNAME	 | \
-					CONFIG_BOOTP_BOOTPATH)
+					CONFIG_BOOTP_BOOTPATH	 | \
+					CONFIG_BOOTP_SERVER)
 #ifndef CONFIG_BOOTP_MASK
 #define CONFIG_BOOTP_MASK		CONFIG_BOOTP_DEFAULT

We don't even have include/cmd_confdefs.h any more...

Quoted 11 lines
Quoted 4 lines

If I understand corrrectly, this patch changes the behaviour for all boards that currently don't define CONFIG_BOOTP_SERVER.

Is this intentional?

If I understand this correctly, because CONFIG_BOOTP_MASK is tested and I don't see anyone defining this, it will *not* touch any configuration right now. Subsequently for consistency the code in bootp.c _may_ move to also using this MASK variable but then many configs will have to be touched. Many configs potentially can simply move to CONFIG_BOOTP_DEFAULT.

Hmmm... I have to admit that I never liked this CONFIG_BOOTP_MASK stuff so I'm happy it's gone.

So in any case the patch must be cleaned up and resubmitted.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Virtual" means never knowing where your next byte is coming from.
#21 lore raw

PATCH 1/1 New CONFIG_BOOTP_SERVER option

Quoted 10 lines · Wolfgang Denk
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
#define CONFIG_BOOTP_DEFAULT		(CONFIG_BOOTP_SUBNETMASK | \
					CONFIG_BOOTP_GATEWAY	 | \
					CONFIG_BOOTP_HOSTNAME	 | \
(quoted diff) +2 -1
-					CONFIG_BOOTP_BOOTPATH)
+					CONFIG_BOOTP_BOOTPATH	 | \
+					CONFIG_BOOTP_SERVER)

#ifndef CONFIG_BOOTP_MASK
#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT

We don't even have include/cmd_confdefs.h any more...

That is correct!

As you may recall, I had asked him to rewrite his patch against the new CONFIG_CMD_* style that was in -testing specifically to avoid this issue.

Quoted 12 lines
Quoted 11 lines
Quoted 4 lines

If I understand corrrectly, this patch changes the behaviour for all boards that currently don't define CONFIG_BOOTP_SERVER.

Is this intentional?

If I understand this correctly, because CONFIG_BOOTP_MASK is tested and I don't see anyone defining this, it will *not* touch any configuration right now. Subsequently for consistency the code in bootp.c _may_ move to also using this MASK variable but then many configs will have to be touched. Many configs potentially can simply move to CONFIG_BOOTP_DEFAULT.

Quoted 2 lines

Hmmm... I have to admit that I never liked this CONFIG_BOOTP_MASK stuff so I'm happy it's gone.

Hi! I can address this issue! :-)

That is correct. It went away with the Command Config rewrite as it was in the same file and style.

Quoted 1 line

So in any case the patch must be cleaned up and resubmitted.

Agreed.

Quoted 3 lines

Best regards,

Wolfgang Denk

Thanks,
jdl

#22 lore raw

PATCH 1/1 m68k fix for Ethernet Buffers at address 0

In reply to Wolfgang Denk

Dear Wolfgang,

Quoted 5 lines
Quoted 3 lines

This change would keep things
working as they are, but fix the bug where packets are received before the buffer address is set.

Which bug are you talking about? Is this in U-Boot or in Linux?

The bug is in u-boot. it currently starts the ethernet port before the receive buffer address is initialized. this results in receiving packets into memory 0 and overwriting the vector table.

I'll wait to see your response to Havard's email regarding setting up the MAC Address in u-boot.

thanks, wilson