xypron changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot 2023.01 / Merge Window is OPEN / Release v2023.04 is scheduled for 2023-04-03 / Channel archives at https://libera.irclog.whitequark.org/u-boot
<sjg1> I think we talked about that. How would we deal with dependencies between phases?
<Tartarus> How is it different from other file dependencies?
<sjg1> Well I mean we currently do things like make the SPL option default to y if the Proper option is enabled
<sjg1> Basically there are two ways to do this...I am looking at generating the separate autoconf files for each phase, but from a unified Kconfig
alan_o has quit [Read error: Connection reset by peer]
alan_o has joined #u-boot
qschulz has quit [Quit: qschulz]
qschulz has joined #u-boot
vagrantc has joined #u-boot
WoC has quit [Remote host closed the connection]
mmu_man has quit [Ping timeout: 252 seconds]
thopiekar has quit [Ping timeout: 260 seconds]
thopiekar has joined #u-boot
Leopold has quit []
Leopold has joined #u-boot
Leopold has quit [Client Quit]
Leopold has joined #u-boot
Leopold has quit [Client Quit]
Leopold has joined #u-boot
Leopold has quit [Ping timeout: 252 seconds]
torez has quit [Quit: torez]
Wouter01006704 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter01006704 has joined #u-boot
WoC has joined #u-boot
redbrain has quit [Ping timeout: 255 seconds]
redbrain has joined #u-boot
goliath has joined #u-boot
haritz has quit [Ping timeout: 265 seconds]
vagrantc has quit [Quit: leaving]
cottsay has quit [Quit: TTFN]
cottsay has joined #u-boot
frieder has joined #u-boot
mckoan|away is now known as mckoan
matthias_bgg has joined #u-boot
guillaume_g has joined #u-boot
matthias_bgg has quit [Quit: Leaving]
xroumegue has quit [Ping timeout: 265 seconds]
xroumegue has joined #u-boot
<apalos> sjg1: so looking a bit more, there's no init functions for tpm
<apalos> some one has shoehorned the tpm init on tpm_open
<apalos> but this is ony called from the command line interface,
<apalos> and ofc noone ever calls _close()
ldevulder has joined #u-boot
sszy has joined #u-boot
<sylensky[m]> is the fw_printenv capable of being run on early boot stages like systemd-generators?
ikarso has joined #u-boot
Wouter01006704 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter01006704 has joined #u-boot
apritzel has joined #u-boot
<apalos> sjg1: a60f7a3e35bc6da231046a8931072027575c6939 break virtio devices for me
<apalos> The console just hangs there
<apalos> 00fc8cade89e36855fe8143c4ee66e951a41734e is working
LordKalma has quit [Quit: Server has probably crashed]
LordKalma has joined #u-boot
ladis has joined #u-boot
hanetzer has quit [Quit: WeeChat 3.8]
mmu_man has joined #u-boot
hanetzer has joined #u-boot
haritz has joined #u-boot
haritz has joined #u-boot
haritz has quit [Changing host]
torez has joined #u-boot
<Tartarus> sylensky: sure
<sylensky[m]> thanks, i tested that already which works. however it cant read from block devices prior running udev/sytemd. is there something i can take advantage of to overcome this?
stefanro has quit [Remote host closed the connection]
stefanro has joined #u-boot
<Tartarus> Well, do you need it that early, or do you just want the ordering right?
<Tartarus> For the latter you can tell the unit to wait for the device
<Tartarus> For the former, uh, it's a bit harder to say and depends on the use case
<Tartarus> but often the kernel cmdline will be leveraged for this
matthias_bgg has joined #u-boot
<sylensky[m]> <Tartarus> "Well, do you need it that early,..." <- lets assume its a universal userspace which decides what to start based on the u-boot environment. preferrably i would like to have as early as possible to decide which services to start and which not.
ikarso has quit [Quit: Connection closed for inactivity]
<sjg1> apalos: You can call tpm_init() directly, right?
<apalos> 3Cfrom c code yea
<apalos> but that's really unusable,
<sjg1> Re the breakage, what board is this?
<apalos> qemu
<apalos> if I disable bootstd, evereything is fine, so my guess is that, this is soemthing on the auto scan code for devices
<apalos> on the tpm, I've sent a simple patch that makes the tpmv2 startup sequence proper
<apalos> and I use that on th efi subsystem. I'll think of a way not having that call on the tpm subsystem
<apalos> efi subsystem*
<sjg1> apalos: Is this a qemu we don't have in CI? Can I repeat it? Is it the call to ret = uclass_probe_all(UCLASS_VIRTIO); ?
<apalos> you can repeat it,
<apalos> make qemu_arm64_defconfig
<sjg1> apalos: Can you call tpm_init() from the EFI subsystem?
<apalos> yea we already do taht
<apalos> well not the init, the startup sequence those devices need
<apalos> but you might have a point there. Noone calls the init in that case
<apalos> But my whole point is that the *init* function is kind of useless
<apalos> It only does request a locallity
<apalos> on the crash, I guess we dont test virtio on the CI properly
<apalos> just compile a qemu_arm64_defconfig and launch https://pastebin.com/0EHG42Bs
<apalos> We still need that function, but I am going to add it in tpm_init()
<apalos> Since without the startup sequence the tpm is just useless.
<apalos> and I am going to use the tpm_init() directly from the efi subsystem
<apalos> but that really is not the right answer either.,
<sjg1> What is $image ?
<apalos> any image would would
<apalos> a qcow2 image for example
<apalos> I guess the selftests did catch it because we dont attach a virtio image anywhere?
<apalos> By requesting random files to initialize the TPM, we'll end up with spaghetti code and random calls to that thing
<apalos> I think that the *right* way to do it, assuming we want lazy binding, is add events arounds
<apalos> So one event startsup the tpm properly regardless of who needs it, cmd, a subsystem etc
<apalos> otherwise the sane thing to do is call it on .probe
<sjg1> apalos: Re the qemu thing, I think I can repeat a hang. Will take a look tonight
<apalos> sjg1: thanks, just do printenv -e, it will hang there forever
<sjg1> apalos: But we cannot start the TPM automatically...that would render the commands useless. The user needs to be in control
<sjg1> apalos: my log:
<apalos> no it would not render the commands useless
<apalos> some of them are redundant,
<apalos> But I would argue they were useless when they got merged
<apalos> I don't know why that was done the way it was,
<apalos> But having a bootloader expecting user command to initialize hardware sounds complicated
<apalos> and for the tpm specifically not very useful. For example, the tpm_startup command on the TPM
<apalos> You either says TPM2_SU_CLEAR which means initialize a reseted hardware
<apalos> or TPM2_SU_STATE which tells the TPM "restore your saved state if you have any"
<apalos> But the latter is used on suspend/resume
<apalos> So unless you have a very special case for a very special hardware, for which i'd argue again we dont care,
<apalos> Why can't we autostart it ?
<sjg1> Because then we cannot have the TPM in its initial state at all. It is a rule of DM that probe() probes the device, but does not set it up in any particular way. It makes it impossible for people to do something different, such as run TPM tests
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
<apalos> and that leads to spaghetti code, like the one I am trying to fix in EFI
<apalos> where you have random coammands call subsystem init sequences
<apalos> with no reasonable way of controlling dependencies
<apalos> It would be much saner for the tpm to either have
<apalos> 1. a driver flag
<apalos> or 2. a Kconfi option
<apalos> Saying "dont run the startupup sequence which *is needed* for the device to work, because i have a special snowflake hardware/usecase"
<apalos> But anyway, it's controllable for now,
<apalos> So instead of just calling the tpm_startup sequence from EFI, we'll also call tpm_startup
<apalos> At least it's only in one place now and we can look at it when it actually becomes a problem
<apalos> How about adding a Kconfig option with the subsystem you *want* to init
<apalos> So we could add a callback to DM and initialize that hardware on boot, instead of relying on preboot commands
<sjg1> apalos: The TPM init is irreversible once you have done it. I honestly thing that approach would lead to a lot more complexity than one function call. Is this the sort of thing that is done in Tianocore?
<sjg1> apalos: What if there are multiple TPMs available? We only want to p[robe and use the one that is in use. Remember the lazy-init stuff
<apalos> I have no idea what they do in that thing :>
<apalos> I think they enable it unconditionally on the DXE phase
mmu_man has quit [Ping timeout: 268 seconds]
<apalos> sjg1: I know it's irreversible as I said noone calls the .close callback
<apalos> but in the current case the tpm_init() doesnt do anything useful. IOW you can completely skip it and the tpm will work just fine, if you perform the startup sequence
<sjg1> apalos: Will try to come back on later. close() does not reverse it, only a TPM hardware reset does (by design)
<apalos> no close does reverse it
<apalos> Dont mix the internals of u-boot with how the tpm works
<apalos> You can send as many TPM startup commands as you want
<apalos> the tpm will just respond " I already did that"
<apalos> the .open callback now sets an internal value to 1,
<apalos> and the next time .open is called we return -EBUSY
<apalos> but you can do useful things on .close. e.g release locality
<apalos> which the tis core has, but we never call that
<apalos> but anyway, that's not that important atm, the device works fine. I'll keep the startup call on the efi subsystem, since we need to extend PCRs etc and see what we can do better
<apalos> For example Eddie's patches on measured boot without EFI, will also need to initialize that device
mckoan is now known as mckoan|away
<apalos> anyway kids time, I'll check back later
mmu_man has joined #u-boot
hanetzer has quit [Ping timeout: 246 seconds]
hanetzer has joined #u-boot
guillaume_g has quit [Quit: Konversation terminated!]
Leopold has joined #u-boot
Wouter01006704 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter01006704 has joined #u-boot
frieder has quit [Read error: Connection reset by peer]
apritzel has quit [Ping timeout: 246 seconds]
Leopold has quit [Ping timeout: 255 seconds]
Wouter01006704 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter01006704 has joined #u-boot
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<bryanb> was hoping you may have some ideas on how I could fix it before I deep dive into kconfig
<bryanb> i'll try to focus on the ti parts right now :)
Leopold has joined #u-boot
Leopold has quit [Ping timeout: 252 seconds]
mmu_man has quit [Ping timeout: 264 seconds]
mmu_man has joined #u-boot
ldevulder has quit [Read error: Connection reset by peer]
ldevulder has joined #u-boot
ldevulder has quit [Quit: Leaving]
vagrantc has joined #u-boot
<khilman> Q on USB gadget eth behavior. I'm getting `The remote end did not respond in time` when doing TFTP transfers. If I watch the host side with `udevadm monitor` I notice that for every tftp command, the host does an add/bind for the xfer and then an unbind/remove after. That makes sense, but when doing multiple TFTP commands in a row, it seems that the time to unbind/remove and then add/bind again is too slow for u-boot.
<khilman> is there any way to configure u-boot to wait a bit longer for the unbind/remove + add/bind to happen?
hanetzer has quit [Ping timeout: 255 seconds]
EdSwarthout has quit [Ping timeout: 260 seconds]
hanetzer has joined #u-boot
___nick___ has joined #u-boot
EdSwarthout has joined #u-boot
___nick___ has quit [Client Quit]
___nick___ has joined #u-boot
ladis has quit [Quit: Leaving]
<marex> khilman: it breaks other things however, like netconsole, and dwc3 I think too
<marex> khilman: it should keep the connection active however
<khilman> doesn't seem to keep the connection alive. I still see the udev add/bind and unbind/remove for each tftp command
<marex> khilman: even with the patch applied ? hum ....
<khilman> yes, with patch applied. I still see disconnect/reconnect.
<marex> uh ... wait a minute, reading that patch again, it seems like it isn't fixing what I thought it was fixing
<khilman> ugh, and that patch breaks fastboot over usb :(
<marex> khilman: could you reply to the patch and report the fastboot finding ?
<marex> I vaguely recall in V1 discussion there was something about changing the behavior of gadget to remain connected
<marex> i.e. no disconnect/reconnect on every transfer
<khilman> yes, I'll reply
<marex> khilman: but there may be one hint -- USB_CONNECT_TIMEOUT
<marex> khilman: it is now set to 3 seconds however, which is rather long
<khilman> depends on 3 sec from what. If it's from the initial connect, that's not very long, esp for a big TFTP xfer
<marex> khilman: try this
<marex> => setenv cdc_connect_timeout 10
<marex> if I read it right ... that should increase the timeout to 10 seconds
<khilman> will try, but due to broken fastboot, I have to a longer (re)flash process. :(
<marex> khilman: sorry about that
<khilman> marex: seems to work, thanks! doing a bit more testing now.
<marex> khilman: well, that's good :-)
___nick___ has quit [Ping timeout: 248 seconds]
prabhakarlad has quit [Quit: Client closed]
<Tartarus> Someone update doc/usage/environment.rst in the end please
torez has quit [Quit: torez]
<sjg1> bryanb: Sorry I'm not quite sure what you are asking?
<bryanb> ah no worries, that was a horrible question :) currently our TARGET_{SOC}_{CPU}_EVM is selecting a choice SOC_K3_{SOC}
vagrantc has quit [Quit: leaving]
<bryanb> i'm trying to wrap my head around how to structure things to make everything work
<bryanb> and k3conf be happy with it :)
<bryanb> s/k3conf/kconfig