Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it

Mark Millard <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
On 2022-Sep-30, at 12:36, Klaus Küchemann <[email protected]> wrote:

> …`found  someone in the WWW who fixed similar issues of an even earlier rpi-model 
> by increasing/adding mdelay values,  no clue if something like that would be a valid test worth…
> Like this :
> * requests in the first microframe, the stick crashes. Wait about
>         * one microframe duration here (1mS for USB 1.x , 125uS for USB 2.0).
>         */
> -       mdelay(1);
> +       mdelay(300);
> 
> /* only support for one config for now */
>        err = usb_get_configuration_len(dev, 0);
> +       mdelay(100);
> 
> usb_set_maxpacket(dev);
> +       mdelay(100);

I've included a patch-common_usb.c update with these lines
adjusted/added (with a suffix comment for each).

Reverting to the official rpi_arm64_fragment could be used
to also test without the debug output.

===
Mark Millard
marklmi at yahoo.com
patch-common_usb.c (application/octet-stream, 964 B)
--- common/usb.c.orig	2022-04-04 07:31:32.000000000 -0700
+++ common/usb.c	2022-09-30 12:49:31.876729000 -0700
@@ -16,6 +16,8 @@
  * (C) Copyright 2001 Denis Peter, MPL AG Switzerland
  */
 
+#define LOG_DEBUG
+#define DEBUG
 /*
  * How it works:
  *
@@ -1098,10 +1100,11 @@
 	 * requests in the first microframe, the stick crashes. Wait about
 	 * one microframe duration here (1mS for USB 1.x , 125uS for USB 2.0).
 	 */
-	mdelay(1);
+	mdelay(300); //MMJNK: was: 1, comment above not adusted
 
 	/* only support for one config for now */
 	err = usb_get_configuration_len(dev, 0);
+	mdelay(100); //MMJNK: new mdelay
 	if (err >= 0) {
 		tmpbuf = (unsigned char *)malloc_cache_aligned(err);
 		if (!tmpbuf)
@@ -1119,6 +1122,7 @@
 	usb_parse_config(dev, tmpbuf, 0);
 	free(tmpbuf);
 	usb_set_maxpacket(dev);
+	mdelay(100); //MMJNK: new mdelay
 	/*
 	 * we set the default configuration here
 	 * This seems premature. If the driver wants a different configuration
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.