Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Sep 2022 18:03:23 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        bob prohaska <fbsd@www.zefox.net>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>, freebsd-uboot@freebsd.org
Subject:   Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it
Message-ID:  <197D3C46-063B-4C67-AB1A-A3A072521D7F@yahoo.com>
In-Reply-To: <20220929002131.GA77106@www.zefox.net>
References:  <9F57D5D0-F715-4DD2-A05C-FB2B9E8B5C30@yahoo.com> <20220928015721.GA73356@www.zefox.net> <C657BE65-ADCC-479B-B756-445D0825E0FA@yahoo.com> <E0BDFF06-3998-48E0-B04D-3B4A11F4A9AE@yahoo.com> <20220928045145.GB73356@www.zefox.net> <81F58716-72CE-45E8-951A-B7B92AD0FE95@yahoo.com> <20220928172839.GA75564@www.zefox.net> <62A7FD9D-DFAD-46B2-8681-F6EF0E5AC0DE@yahoo.com> <8CB25EDF-704A-4F86-B0D4-40818291C161@yahoo.com> <20220928234341.GA77046@www.zefox.net> <20220929002131.GA77106@www.zefox.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2022-Sep-28, at 17:21, bob prohaska <fbsd@www.zefox.net> wrote:

> With the correct patches finally in place there is some
> extra output from u-boot:
>=20
> U-Boot 2022.04 (Sep 28 2022 - 16:45:12 -0700)
> . . .
> starting USB...
> . . .
> usb_new_device: Cannot read configuration, skipping device 152d:0583

The above is reporting U-Boot having a problem dealing with
your bridge/drive combination as seen via bridge access,
presuming that I recognize the 152d:0583 correctly.



Interestingly, that message is not from the routine usb_new_device
but is from:


int usb_select_config(struct usb_device *dev)
{
. . .
        /*
         * Kingston DT Ultimate 32GB USB 3.0 seems to be extremely =
sensitive
         * about this first Get Descriptor request. If there are any =
other
         * 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);

        /* only support for one config for now */
        err =3D usb_get_configuration_len(dev, 0);
        if (err >=3D 0) {
                tmpbuf =3D (unsigned char *)malloc_cache_aligned(err);
                if (!tmpbuf)
                        err =3D -ENOMEM;
                else
                        err =3D usb_get_configuration_no(dev, 0, tmpbuf, =
err);
        }
        if (err < 0) {
                printf("usb_new_device: Cannot read configuration, " \
                       "skipping device %04x:%04x\n",
                       dev->descriptor.idVendor, =
dev->descriptor.idProduct);
                free(tmpbuf);
                return err;
        }
. . .

where:

/**********************************************************************
 * gets len of configuration cfgno
 */
int usb_get_configuration_len(struct usb_device *dev, int cfgno)
{
        int result;
        ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, 9);
        struct usb_config_descriptor *config;
                   =20
        config =3D (struct usb_config_descriptor *)&buffer[0];
        result =3D usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, =
9);
        if (result < 9) {  =20
                if (result < 0)
                        printf("unable to get descriptor, error %lX\n",
                                dev->status);
                else
                        printf("config descriptor too short " \
                                "(expected %i, got %i)\n", 9, result);
                return -EIO;
        }
        return le16_to_cpu(config->wTotalLength);
}

and:

/**********************************************************************
 * gets configuration cfgno and store it in the buffer
 */
int usb_get_configuration_no(struct usb_device *dev, int cfgno,
                             unsigned char *buffer, int length)
{
        int result;
        struct usb_config_descriptor *config;

        config =3D (struct usb_config_descriptor *)&buffer[0];
        result =3D usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, =
length);
        debug("get_conf_no %d Result %d, wLength %d\n", cfgno, result,
              le16_to_cpu(config->wTotalLength));
        config->wTotalLength =3D result; /* validated, with CPU byte =
order */

        return result;
}

(I'll skip more nested routine usage.)


We apparently do not have enough output enabled to see the debug
routine's output. We are seeing the printf output.

There might be a way to set the output message levels while at a
U-Boot prompt, up to the maximum compiled in. But it may also be
that we would need, say,

CONFIG_LOG_MAX_LEVEL=3D8

instead of the 7 we are now using.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?197D3C46-063B-4C67-AB1A-A3A072521D7F>