Date: Tue, 27 Sep 2022 13:36:05 -0700 From: Mark Millard <marklmi@yahoo.com> To: bob prohaska <fbsd@www.zefox.net> Cc: freebsd-arm <freebsd-arm@freebsd.org>, =?utf-8?Q?Klaus_K=C3=BCchemann?= <maciphone2@googlemail.com> Subject: Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it Message-ID: <650FD030-783D-46C4-8CC9-50D608569898@yahoo.com> In-Reply-To: <61CFA9D4-8DFD-41C5-A2B4-E5B3CD78C327@yahoo.com> References: <20220921154240.GA37735@www.zefox.net> <8CC2A42B-21AC-44C6-BD02-44D320CADF63@yahoo.com> <20220921175026.GA45144@www.zefox.net> <5DB9C93B-B9E1-418D-ABA3-8A0CFCE85C0F@yahoo.com> <3781CF46-C4F7-4579-8655-B7558B724C0A@yahoo.com> <20220922014500.GA46697@www.zefox.net> <20220925160531.GA63213@www.zefox.net> <DBD238AA-8C65-46D2-87CC-A9875C6959BF@yahoo.com> <20220925193415.GA63733@www.zefox.net> <3D6CF13E-261D-41D2-AC5B-923C0BF54087@yahoo.com> <20220927160328.GA71742@www.zefox.net> <67C09E9F-AD1D-4D0D-9E6F-9C1B046D8952@googlemail.com> <4154AFCB-7428-4005-843A-4EF8C0EBCCB8@googlemail.com> <D8708275-D396-4D2F-9461-B305E522BCCE@yahoo.com> <9A3609DF-D873-4712-A61D-C351C162EF2A@googlemail.com> <61CFA9D4-8DFD-41C5-A2B4-E5B3CD78C327@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2022-Sep-27, at 13:06, Mark Millard <marklmi@yahoo.com> wrote: > On 2022-Sep-27, at 12:48, Klaus K=C3=BCchemann = <maciphone2@googlemail.com> wrote: >=20 >> Am 27.09.2022 um 21:20 schrieb Mark Millard <marklmi@yahoo.com>: >>>=20 >>> On 2022-Sep-27, at 11:33, Klaus K=C3=BCchemann = <maciphone2@googlemail.com> wrote: >>>=20 >>>=20 >>>>> Am 27.09.2022 um 19:58 schrieb Klaus K=C3=BCchemann = <maciphone2@googlemail.com>: >>>>>=20 >>>>>=20 >>>>>> Am 27.09.2022 um 18:03 schrieb bob prohaska <fbsd@www.zefox.net>: >>>>>>=20 >>>>>> I did look at common/usb.c but it's far from obvious how one >>>>>> can turn on the logging feature so as to report more errors >>>>>> to the console. >>>>>=20 >>>>> you can add the following to common/usb.c (e.g. insert in line = 44): >>>>>=20 >>>>> #define DEBUG >>>>>=20 >>>>> -- >>>>>=20 >>>>> that should then print out all debug functions inside the usb.c = file to the console=20 >>>>> after recompilation of u-boot. >>>>>=20 >>>>> Regards >>>>>=20 >>>>> Klaus >>>>=20 >>>> I saw there is /*#include <log.h>*/ available in usb.c=20 >>>> so you could also try to add : >>>>=20 >>>> #define LOG_DEBUG >>>>=20 >>>> to the common/usb.c file which should also then enable the debug = functions >>>> which then would be output in logging style. >>>>=20 >>>> You will need the debug output to to narrow down the issue. >>>>=20 >>>> just a guess :=20 >>>> electrical problem(of the Pi itself) which could perhaps be fixed = by manipulating the scan delay time . >>>=20 >>> Looks to me like: >>>=20 >>> https://github.com/u-boot/u-boot/blob/master/common/usb_hub.c >>>=20 >>> might be relevant, not just: >>>=20 >>> https://github.com/u-boot/u-boot/blob/master/common/usb.c >>>=20 >>>=20 >>> For example, usb_hub.c is where usb_pgood_delay is involved. >>> (My patch to enable my boot media assigns that, not that >>> such helped Bob.) >>>=20 >>> But I've not been able to uniquely identify all the specific >>> identifiers for all the (relevant) "usb boot scan delays", >>> although I'd expect that pgood_delay (and its usb_pgood_delay) >>> would be considered an example. >>>=20 >>> =3D=3D=3D >>> Mark Millard >>> marklmi at yahoo.com >>=20 >> good idea, >> I would then suggest to enable debug also in common/usb_hub.c >> by adding #define DEBUG or #define LOG_DEBUG .. >>=20 >> for the usb.c I=E2=80=99d expect something from the mdelay function = as an usb scan timer.. >> so let=E2=80=99s see what debug logs usb.c & usb_hub.c will spit = out .. >=20 > I'm not sure it would be relevant, there is also: >=20 > https://github.com/u-boot/u-boot/blob/master/common/usb_storage.c >=20 > But , unlike usb_pgood_delay that I recognized and it > being in usb_hub.c , I've no specific identification > of something relevant from usb_storage.c . Also, it looks like having LOG_DEBUG force DEBUG is a recent change for: https://github.com/u-boot/u-boot/commits/master/include/log.h Commits on Jul 26, 2022 log: force DEBUG when LOG_DEBUG is activated=20 So, for the vintage of U-Boot source that the u-boot ports are based on, DEBUG would need to be separately defined. The logic in question in the modern log.h requires LOG_DEBUG to be defined before the: #include <log.h> include/log.h @@ -194,6 +194,9 @@ int _log_buffer(enum log_category_t cat, enum = log_level_t level, #ifdef LOG_DEBUG #define _LOG_DEBUG LOGL_FORCE_DEBUG #ifndef DEBUG #define DEBUG #endif #else #define _LOG_DEBUG 0 #endif The inner #ifndef DEBUG related 3 lines are the new code. So it may be best to always #define LOG_DEBUG in whatever *.c file(s) before the line with: #include <log.h> Even the old logic indicates such ( _LOG_DEBUG handling ). =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?650FD030-783D-46C4-8CC9-50D608569898>