public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Fix device detection for API consumers
@ 2013-05-19 10:09 Ilya Bakulin
  2013-05-21 18:14 ` Jeroen Hofstee
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Bakulin @ 2013-05-19 10:09 UTC (permalink / raw)
  To: u-boot

Hi list,
I use U-Boot for starting FreeBSD/arm on Globalscale DreamPlug.
On this platform FreeBSD uses "ubldr" second-stage bootloader, which is
an U-Boot API consumer and uses U-Boot API to access block devices, network, etc.
Dreamplug has several block devices accessible: internal SD card, SD card reader,
and any number of USB-attached mass storage devices.

But when I boot ubldr, I can see only one block device.

I have traced down the problem and it seems to be in U-Boot API. When doing
block device enumeration, the "more" flag is not set properly on first access.

This patch fixes the problem for me. After applying the patch, FreeBSD ubldr
is able to see and access all block devices that U-Boot self knows.

diff --git a/api/api_storage.c b/api/api_storage.c
index c535712..1147e79 100644
--- a/api/api_storage.c
+++ b/api/api_storage.c
@@ -129,6 +129,9 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
 		else
 			found = 1;
 
+		if (specs[type].max_dev > 1)
+			*more = 1;
+
 	} else {
 		for (i = 0; i < specs[type].max_dev; i++)
 			if (di->cookie == (void *)get_dev(specs[type].name, i)) {

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

end of thread, other threads:[~2013-05-21 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-19 10:09 [U-Boot] [PATCH] Fix device detection for API consumers Ilya Bakulin
2013-05-21 18:14 ` Jeroen Hofstee

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