From nobody Thu Sep 29 03:04:31 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MdJ9x0qj9z4cvly for ; Thu, 29 Sep 2022 03:04:37 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-55.consmr.mail.gq1.yahoo.com (sonic316-55.consmr.mail.gq1.yahoo.com [98.137.69.31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4MdJ9w04Ssz3hDy for ; Thu, 29 Sep 2022 03:04:35 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1664420673; bh=lpzm6r258jhPv3ojS8P04Jo3uIO6FowSJbQ41FUAH3g=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From:Subject:Reply-To; b=Wk53gjrhxusWuKSjrsL+LXc4DWDfion+aCUH6lNT4nR4CJ76Zg+Gxbap+xCIIFdu9hTQV+oRdj0w5zBNzZSTWXAwP06oZ/j2EkYUzx0BdQWS3JVfM2QTilLhd5gwJsgK4wtMs1ecYWNdkXsdfNDmiuXilfgXt2Vnd7rjsmirQ6r7NAAZU4OTKaiCpCTdttzgrB7vDABKlahbqanBXRfwZ1fgoEBCRs9Yg2hvf2AypcisS51+Gf7WAr5O0HtV0SLWT6d6ZCRLkJo/GssqqAWRE5cPaaitQPCjshgFBcthPlq/k60r+yZHmLjHIny2vciyUahrYg1+/+/o993HlgNifg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1664420673; bh=sY294cJNmcELm52eVhKhRYTSyxaVOzLupCsuEADNpiq=; h=X-Sonic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4xHvsXlH51h9IGOtCs4lkeLv3S9OZqJv929 7louYVJ_Pc8qbKwKnUX9T.evdGRhh_p_PASkqmEI7DgR3cfcKzBtg05mCdFqyzbtqYW4Pw7Gi7li Gr1GYCOP7iPo8mdfJNgrR3crsy9ZdOhDa2nN28MfIdModecSaMhhaFYpfgWtI2UjEUqsnJgWjrHK yDq__tGQxfxA_PHU.sqyGaxqlDMc4FSJz0DeNpgMloOskhHmmf7UDYUzzGsn7OOYv2GolQNYhB6c qKMe9rjjRjuOmM15A6s9KEAy5N1hwJ9qIfxp3r7AKmPRnCTHwCBqBwPQY2Mm_21JfLPbsDGPODnv jh9fFvvwneMimuCdXDZ5NeMRhgGqMhBb8FP2x5QKGr4_tPlhy1qCVb_zy0ZqCWqK3tVUVK3AhuBy 0yxV6Q.v5p1Ti4uetQ3CttMPiP4nTzMlaEXjnMZJSAzaMHxncUxJFheqQPQvLAuFw_4MZlACM_ol SMkj7P3P.M6mMEWWdVLX527RP60P4slOJ9cfqG4gcmW5eSlP4fixSri1ucmCtzQF8Y8t8tcNtBge b X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Thu, 29 Sep 2022 03:04:33 +0000 Received: by hermes--production-gq1-7dfd88c84d-65ptt (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4621a60777e16c24717c8799c8e1c865; Thu, 29 Sep 2022 03:04:32 +0000 (UTC) From: Mark Millard Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_F4C37AD8-1917-4C76-8895-153697F7FFD8" List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it Date: Wed, 28 Sep 2022 20:04:31 -0700 In-Reply-To: <197D3C46-063B-4C67-AB1A-A3A072521D7F@yahoo.com> Cc: freebsd-arm , freebsd-uboot@freebsd.org To: bob prohaska References: <9F57D5D0-F715-4DD2-A05C-FB2B9E8B5C30@yahoo.com> <20220928015721.GA73356@www.zefox.net> <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> <197D3C46-063B-4C67-AB1A-A3A072521D7F@yahoo.com> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4MdJ9w04Ssz3hDy X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=Wk53gjrh; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.31 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-3.48 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.978]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.31:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; HAS_ATTACHMENT(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+,1:+,2:~,3:~,4:~,5:~]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.31:from] X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_F4C37AD8-1917-4C76-8895-153697F7FFD8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 2022-Sep-28, at 18:03, Mark Millard wrote: > On 2022-Sep-28, at 17:21, bob prohaska wrote: >=20 >> 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 >=20 > 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. >=20 >=20 >=20 > Interestingly, that message is not from the routine usb_new_device > but is from: >=20 >=20 > 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); >=20 > /* 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; > } > . . . >=20 > where: >=20 > = /********************************************************************** > * 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); > } >=20 > and: >=20 > = /********************************************************************** > * 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; >=20 > 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 */ >=20 > return result; > } >=20 > (I'll skip more nested routine usage.) >=20 >=20 > We apparently do not have enough output enabled to see the debug > routine's output. We are seeing the printf output. >=20 > 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, >=20 > CONFIG_LOG_MAX_LEVEL=3D8 >=20 > instead of the 7 we are now using. 7 vs. 8 was not the issue. I had the: #define LOG_DDEBUG #define DEBUG lines too late in the 3 usb*.c files. Moving them to before all the #include's in each leads to getting all the debug output too, at least if I set the default level to do so. But if it gets far enough to make use of the USB media, then it reports, for example, every usb read via output like: usb_read: udev 0 usb_read: dev 0 startblk 87878da0, blccnt 20 buffer 381a1200 read10: start 87878da0 blocks 20 COMMAND phase DATA phase STATUS phase usb_read: end startblk 87878dc0, blccnt 20 buffer 381a5200 It is a rather large amount of output (after the failure point you are hitting). The output messes up the loader serial output. The EFI loader loading the kernel is done via U-Boot services and so all those reads are present. Once the kernel is active, U-Boot is not and the serial I/O is back to normal. I've included the updated usb*.c files and the rpi_arm64_fragment update with an extra line explicitly for setting the default log level. =3D=3D=3D Mark Millard marklmi at yahoo.com --Apple-Mail=_F4C37AD8-1917-4C76-8895-153697F7FFD8 Content-Disposition: attachment; filename=patch-common_usb__hub.c Content-Type: application/octet-stream; x-unix-mode=0644; name="patch-common_usb__hub.c" Content-Transfer-Encoding: 7bit --- common/usb_hub.c.orig 2022-04-04 07:31:32.000000000 -0700 +++ common/usb_hub.c 2022-09-28 19:08:42.261977000 -0700 @@ -16,6 +16,8 @@ * (C) Copyright 2001 Denis Peter, MPL AG Switzerland */ +#define LOG_DEBUG +#define DEBUG /**************************************************************************** * HUB "Driver" * Probes device for being a hub and configurate it --Apple-Mail=_F4C37AD8-1917-4C76-8895-153697F7FFD8 Content-Disposition: attachment; filename=patch-common_usb__storage.c Content-Type: application/octet-stream; x-unix-mode=0644; name="patch-common_usb__storage.c" Content-Transfer-Encoding: 7bit --- common/usb_storage.c.orig 2022-04-04 07:31:32.000000000 -0700 +++ common/usb_storage.c 2022-09-28 19:09:02.566277000 -0700 @@ -20,6 +20,8 @@ * FreeBSD. */ +#define LOG_DEBUG +#define DEBUG /* Note: * Currently only the CBI transport protocoll has been implemented, and it * is only tested with a TEAC USB Floppy. Other Massstorages with CBI or CB --Apple-Mail=_F4C37AD8-1917-4C76-8895-153697F7FFD8 Content-Disposition: attachment; filename=patch-common_usb.c Content-Type: application/octet-stream; x-unix-mode=0644; name="patch-common_usb.c" Content-Transfer-Encoding: 7bit --- common/usb.c.orig 2022-04-04 07:31:32.000000000 -0700 +++ common/usb.c 2022-09-28 19:08:34.423048000 -0700 @@ -16,6 +16,8 @@ * (C) Copyright 2001 Denis Peter, MPL AG Switzerland */ +#define LOG_DEBUG +#define DEBUG /* * How it works: * --Apple-Mail=_F4C37AD8-1917-4C76-8895-153697F7FFD8 Content-Disposition: attachment; filename=rpi_arm64_fragment Content-Type: application/octet-stream; x-unix-mode=0644; name="rpi_arm64_fragment" Content-Transfer-Encoding: 7bit CONFIG_ENV_FAT_DEVICE_AND_PART="1:1" CONFIG_RPI_EFI_NR_SPIN_PAGES=2 CONFIG_LOG=y CONFIG_LOG_MAX_LEVEL=7 CONFIG_LOG_DEFAULT_LEVEL=7 CONFIG_LOG_CONSOLE=y --Apple-Mail=_F4C37AD8-1917-4C76-8895-153697F7FFD8--