slobodan_ has quit [Read error: Connection reset by peer]
slobodan has quit [Ping timeout: 252 seconds]
slobodan_ has joined #u-boot
f_ has quit [Remote host closed the connection]
f_ has joined #u-boot
f_ has quit [Ping timeout: 260 seconds]
ikarso has joined #u-boot
thopiekar has joined #u-boot
mripard has joined #u-boot
KREYREN_ has quit [Remote host closed the connection]
dsimic has quit [Ping timeout: 252 seconds]
KREYREN_ has joined #u-boot
dsimic has joined #u-boot
wooosaiiii has quit [Quit: wooosaiiii]
wooosaiiii has joined #u-boot
thopiekar has quit [Ping timeout: 255 seconds]
<calebccff>
marex: can I pick your brains about dwc3 role switching?
<calebccff>
I have this board with just a single USB controller, and a DIP switch which muxes it to either a type-c port, or to an internal USB hub.
<calebccff>
in Linux we have proper role detection working (well, when switching to host mode you have to unplug your type-c cable cuz vbus, but yeah) and the DT is thus modelled around this
<calebccff>
however this totally breaks U-Boot, as the dwc3-generic driver just nopes out if you don't tell it what mode to be in
<calebccff>
I could probably argue the case that we should set the mode to OTG instead, this would be correct to the bindings. But dwc3-generic treats OTG mode as peripheral mode
<calebccff>
and on this particular board, it's much more useful to default to host mode instead, so that we can boot from USB or via TFTP (usb ethernet), etc...
<calebccff>
on other qualcomm devices (like phones) we also may have just one USB controller, but in that case we really want it to be in peripheral mode (if DRD is unsupported) as that's the more useful option
<calebccff>
so my question is: what do?
<calebccff>
I think the "ideal" solution would be that the dwc3-generic driver can handle OTG properly, and do role switching either via hw detection or "on demand" (so "usb start" would trigger a role switch if there is only one controller and it's DRD capable)
<calebccff>
but that is a substantial effort to undertake (though definitely something I'm up for), and something that will take a lot of time... I'd like to find some kind of bandaid solution to get us through
<calebccff>
oh right, the problem with just modifying DT to set "dr_mode = host" is that if we hand that DT over to Linux then the type-c stack totally falls apart and we get no working USB (this is definitely something Linux should handle better)
<calebccff>
so far the best idea I've come up with is to set dr_mode = host in the DT and then use the DT fixup callback that runs just before the OS boots to remove the property or set it to OTG.
jclsn has joined #u-boot
thopiekar has joined #u-boot
mmu_man has joined #u-boot
mmu_man has quit [Ping timeout: 264 seconds]
Stat_headcrabed has joined #u-boot
mmu_man has joined #u-boot
thopiekar has quit [Ping timeout: 264 seconds]
mmu_man has quit [Ping timeout: 260 seconds]
mmu_man has joined #u-boot
thopiekar has joined #u-boot
mmu_man has quit [Ping timeout: 272 seconds]
mmu_man has joined #u-boot
KREYREN__ has joined #u-boot
KREYREN_ has quit [Remote host closed the connection]
mmu_man has quit [Ping timeout: 255 seconds]
mmu_man has joined #u-boot
KREYREN__ has quit [Remote host closed the connection]
mmu_man has quit [Ping timeout: 252 seconds]
monstr has quit [Remote host closed the connection]
<Tartarus>
Kwiboo: around? Can you confirm that commit ab3453e7b12d does work in your case please?
<pivi>
calebccff: why not just over-riding the property in $board-u-boot.dtsi ?
<pivi>
calebccff: bandaid solution, of course, at least it's trivial to implement.
<calebccff>
pivi: see my second to last message
f_ has joined #u-boot
schroes has quit [Ping timeout: 255 seconds]
Forty-Bot has quit [Ping timeout: 268 seconds]
<Kwiboo>
Tartarus: my local dev tree is based on top of ab3453e7b12d so that should work, will test with your WIP/18Apr2024 branch as soon as I get home
vagrantc has joined #u-boot
mckoan is now known as mckoan|away
schroes has joined #u-boot
enok has joined #u-boot
enok71 has joined #u-boot
enok71 has quit [Remote host closed the connection]
alperak has quit [Quit: Connection closed for inactivity]
<Tartarus>
Kwiboo: OK, thanks!
f_ has quit [Remote host closed the connection]
f_ has joined #u-boot
frieder has quit [Ping timeout: 256 seconds]
Clamor has quit [Read error: Connection reset by peer]
Clamor has joined #u-boot
enok has quit [Quit: enok]
Stat_headcrabed has quit [Quit: Stat_headcrabed]
alperak has joined #u-boot
<Kwiboo>
Tartarus: I just confirmed that the boot issue is resolved after rebasing on top of your WIP/18Apr2024 branch, thanks!
<pivi>
calebccff: I assumed you were not handling the internal/built-in device tree from U-Boot to the OS
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
<calebccff>
pivi: well it depends how you boot... But if you don't explicitly load a new FDT (either in U-Boot or via systemd-boot/grub/whatever) then the FDT built into U-Boot will be used
<calebccff>
for SystemReady IR this is a requirement even, you have to be able to boot generic distro images and those don't load a DT
<calebccff>
in other words, DT is part of the board firmware
<marex>
calebccff: I didnt ignore you btw, I was just ... sigh
enok has joined #u-boot
<calebccff>
marex: no pressure, sorry for the big wall of text... I've been sitting on this for the last week or so and I'm not quite sure how to progress
<calebccff>
this was the motivation behind my OF_FIXUP event, so I could set dr_mode before bind
<calebccff>
but as Tartarus rightly pointed out that's not really a solution