mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Booting AM335x MLO from network no longer works
@ 2018-09-15 12:33 Dennis Menschel
  2018-09-17 10:10 ` [PATCH] ARM: omap: xload: Fix network boot filename Sascha Hauer
  2018-09-17 10:11 ` Booting AM335x MLO from network no longer works Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Dennis Menschel @ 2018-09-15 12:33 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1.1: Type: text/plain, Size: 1612 bytes --]

Hi,

while upgrading to a recent version of barebox, I've encountered the
problem that booting an AM335x board via network does no longer work.
The MLO fails to chain-load barebox.bin, it doesn't even send a request
to the TFTP-Server to retrieve the main bootloader file.

Working through the Git history, I've been able to pinpoint the problem
as follows (using output from "git describe"):

- On the topic branch which introduced the bug, v2017.11.0-11-g946bc95a4
was the last working version.

- From v2017.11.0-12-gab84733e5 up to v2017.11.0-14-g6b4a38d00, the MLO
neither produces any outputs on the UART0 nor chain-loads barebox.bin.

- Since version v2017.11.0-15-g528298b70, the MLO produces the following
output:

> barebox 2017.11.0 #1 Wed Sep 12 07:23:48 UTC 2018
>
>
> Board: Phytec phyCORE AM335x
> cpsw 4a100000.ethernet: detected phy mask 0x1
> mdio_bus: miibus0: probed
> eth0: got preset MAC address: c4:f3:12:e7:cb:9c
> booting from NET
> eth0: got preset MAC address: c4:f3:12:e7:cb:9c
> eth0: 100Mbps full duplex link detected
> eth0: DHCP client bound to address 192.168.4.52
> bootfile not found.
> booting failed

The master branch includes the problem as of v2017.12.0-90-g3dbe78ab5,
so that the first official release with this behavior has been v2018.01.0.

The bug still persists in v2018.09.0.

The board-specific MLO I've been using is this:
barebox-am33xx-phytec-phycore-r2-mlo-512mb.img

Let me know if you need further information in order to reproduce and/or
fix the problem.

Thanks in advance, and best regards,
Dennis Menschel


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: omap: xload: Fix network boot filename
  2018-09-15 12:33 Booting AM335x MLO from network no longer works Dennis Menschel
@ 2018-09-17 10:10 ` Sascha Hauer
  2018-09-17 10:11 ` Booting AM335x MLO from network no longer works Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-09-17 10:10 UTC (permalink / raw)
  To: Barebox List; +Cc: Dennis Menschel

The dhcp code no longer exports the "bootfile" environment variable.
It now uses global.dhcp.bootfile. Since global variable support is
not necessarily part of the MLO we instead use struct dhcp_result *
to get the bootfile information.

Fixes: 528298b702 ("net: dhcp: rework")

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-omap/xload.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index d8b1c9ee1c..bb58825dcf 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -236,6 +236,7 @@ static void *am33xx_net_boot(void)
 	char *file;
 	char ip4_str[sizeof("255.255.255.255")];
 	struct eth_device *edev;
+	struct dhcp_result *dhcp_res;
 
 	am33xx_register_ethaddr(0, 0);
 
@@ -248,12 +249,14 @@ static void *am33xx_net_boot(void)
 		return NULL;
 	}
 
-	err = dhcp(edev, &dhcp_param);
+	err = dhcp_request(edev, &dhcp_param, &dhcp_res);
 	if (err) {
 		printf("dhcp failed\n");
 		return NULL;
 	}
 
+	dhcp_set_result(edev, dhcp_res);
+
 	/*
 	 * Older tftp server don't send the file size.
 	 * Then tftpfs needs temporary place to store the file.
@@ -276,7 +279,7 @@ static void *am33xx_net_boot(void)
 		return NULL;
 	}
 
-	bootfile = getenv("bootfile");
+	bootfile = dhcp_res->bootfile;
 	if (!bootfile) {
 		printf("bootfile not found.\n");
 		return NULL;
-- 
2.19.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Booting AM335x MLO from network no longer works
  2018-09-15 12:33 Booting AM335x MLO from network no longer works Dennis Menschel
  2018-09-17 10:10 ` [PATCH] ARM: omap: xload: Fix network boot filename Sascha Hauer
@ 2018-09-17 10:11 ` Sascha Hauer
  2018-09-17 16:50   ` Dennis Menschel
  1 sibling, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2018-09-17 10:11 UTC (permalink / raw)
  To: Dennis Menschel; +Cc: barebox

Hi Dennis,

On Sat, Sep 15, 2018 at 02:33:51PM +0200, Dennis Menschel wrote:
> Hi,
> 
> while upgrading to a recent version of barebox, I've encountered the
> problem that booting an AM335x board via network does no longer work.
> The MLO fails to chain-load barebox.bin, it doesn't even send a request
> to the TFTP-Server to retrieve the main bootloader file.
> 
> Working through the Git history, I've been able to pinpoint the problem
> as follows (using output from "git describe"):
> 
> - On the topic branch which introduced the bug, v2017.11.0-11-g946bc95a4
> was the last working version.
> 
> - From v2017.11.0-12-gab84733e5 up to v2017.11.0-14-g6b4a38d00, the MLO
> neither produces any outputs on the UART0 nor chain-loads barebox.bin.
> 
> - Since version v2017.11.0-15-g528298b70, the MLO produces the following
> output:
> 
> > barebox 2017.11.0 #1 Wed Sep 12 07:23:48 UTC 2018
> >
> >
> > Board: Phytec phyCORE AM335x
> > cpsw 4a100000.ethernet: detected phy mask 0x1
> > mdio_bus: miibus0: probed
> > eth0: got preset MAC address: c4:f3:12:e7:cb:9c
> > booting from NET
> > eth0: got preset MAC address: c4:f3:12:e7:cb:9c
> > eth0: 100Mbps full duplex link detected
> > eth0: DHCP client bound to address 192.168.4.52
> > bootfile not found.
> > booting failed
> 
> The master branch includes the problem as of v2017.12.0-90-g3dbe78ab5,
> so that the first official release with this behavior has been v2018.01.0.
> 
> The bug still persists in v2018.09.0.
> 
> The board-specific MLO I've been using is this:
> barebox-am33xx-phytec-phycore-r2-mlo-512mb.img
> 
> Let me know if you need further information in order to reproduce and/or
> fix the problem.

I just sent a fix. I can't test it since our DHCP server does not
provide a bootfile, but I'm confident that this is the right fix. Could
you give it a try?

Thanks
 Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Booting AM335x MLO from network no longer works
  2018-09-17 10:11 ` Booting AM335x MLO from network no longer works Sascha Hauer
@ 2018-09-17 16:50   ` Dennis Menschel
  0 siblings, 0 replies; 4+ messages in thread
From: Dennis Menschel @ 2018-09-17 16:50 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1.1: Type: text/plain, Size: 456 bytes --]

Hi Sascha,

Am 17.09.2018 um 12:11 schrieb Sascha Hauer:
> [...]
> 
> I just sent a fix. I can't test it since our DHCP server does not
> provide a bootfile, but I'm confident that this is the right fix. Could
> you give it a try?
> 
> Thanks
>  Sascha
> 

Thanks for the quick reply.

I've tested the patch today with the aforementioned AM335x board and I
am pleased to announce that it has solved the problem.

Best regards,
Dennis


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-17 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-15 12:33 Booting AM335x MLO from network no longer works Dennis Menschel
2018-09-17 10:10 ` [PATCH] ARM: omap: xload: Fix network boot filename Sascha Hauer
2018-09-17 10:11 ` Booting AM335x MLO from network no longer works Sascha Hauer
2018-09-17 16:50   ` Dennis Menschel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox