<rfs613>
in order to not change existing behaviour, I only wanted to "optionally" enable the clock(s).
<rfs613>
IOW this is like devm_clk_get_optional but for multiple clocks
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shadow>
Guest81: often there are mmc device each for eMMC and for SD card, what board is that?
warpme_ has joined #u-boot
<Guest81>
shadow I appreciate your response. I am using nxp 2026.04. I have researched a bit, in the function env_mmc_load_singular from .../env/mmc.c I am getting int dev = mmc_get_env_dev(); always to be 2
mmu_man has quit [Ping timeout: 257 seconds]
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<marex>
rfs613: ret = clk_get_bulk(); if (ret) { handle return value } . What's the problem ?
<marex>
rfs613: and surely the GPIO IP must have clock supplied to it from somewhere ?
<rfs613>
marex: but I don't want to bail out if clk_get_bulk() fails for some reason (on any of the dozens of boards which use this).
<rfs613>
note that I am checking the return (for success) as part of the if()
<marex>
rfs613: what happens if the clock get fails and you acess registers which are unclocked ? the system hangs ?
<marex>
that is not good
<rfs613>
sure but that's why i am checking for success, and only calling clk_enable_bulk() if the get was successful
<marex>
if the clock get fails => clock are not enabled => unclocked register access hangs the system.
<rfs613>
right, and indeed that happens on RZ/N1 since clocks are not enabled by defaut.
<rfs613>
but there are dozens of existing users, who evnidently don't need to enable the clock first, and mauy not even have one specified in dts.
<marex>
surely the GPIO IP must have clock supplied to it from somewhere ?
<rfs613>
I would think so, and I could audit all the DTS in the tree, but it seemed safer to not assume
mmu_man has joined #u-boot
<rfs613>
eg. less like to break existing users
<marex>
rfs613: check the bindings document and if the clock in DT are really optional, then the return value check needs to check for some ENOSYS or some such (clock not present in DT), not blanked ignore any error value
warpme_ has joined #u-boot
<rfs613>
marex: Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml says minItems: 1 for the clock
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rfs613>
marex: going through the DTS, there seem to be many that lack clock nodes
alpernebbi has quit [Ping timeout: 242 seconds]
<rfs613>
for example socfpga_agilex5 and berlin2q-marvell
<rfs613>
I could add a dev_warn() to flag the missing clocks, but not make it fail the driver probe, otherwise we'll break existing users.
apritzel_ has quit [Ping timeout: 242 seconds]
warpme_ has joined #u-boot
dsimic has quit [Ping timeout: 244 seconds]
dsimic has joined #u-boot
alpernebbi has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mmu_man has quit [Ping timeout: 245 seconds]
mmu_man has joined #u-boot
warpme__ has joined #u-boot
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<marex>
rfs613: are clocks in required: properties ? if not -> clock are optional (which is really not good)
<marex>
rfs613: handle the special ENOSYS case , other errors are real errors
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
frieder has quit [Remote host closed the connection]
warthog9 has joined #u-boot
artiepoole has quit [Ping timeout: 253 seconds]
warpme__ has joined #u-boot
artiepoole has joined #u-boot
sszy has quit [Remote host closed the connection]
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zsoltiv_ has joined #u-boot
artiepoole_ has joined #u-boot
artiepoole has quit [Ping timeout: 245 seconds]
warpme__ has joined #u-boot
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
___nick___ has quit [Ping timeout: 260 seconds]
___nick___ has joined #u-boot
warpme__ has joined #u-boot
Knogle_ has quit [Quit: WeeChat 4.9.3]
Stat_headcrabbe1 has joined #u-boot
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
warpme__ has joined #u-boot
malte has quit [Ping timeout: 244 seconds]
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<marex>
rfs613: handle the special ENOSYS case , other errors are real errors
malte has joined #u-boot
<rfs613>
marex: sorry to be dense, but I don't see ENOSYS in teh clock code. For clk_get_bulk() it returns -ENOENT when the clock node is missing. It can also return -ENOMEM or -EINVAL.
mmu_man has quit [Ping timeout: 265 seconds]
warpme__ has joined #u-boot
<rfs613>
I mean specifically in clk_get_bulk(). For clk_enable_bulk() it specifically ignores -ENOSYS
mmu_man has joined #u-boot
__nick__ has joined #u-boot
___nick___ has quit [Ping timeout: 264 seconds]
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<marex>
rfs613: ENOENT it is then
<marex>
rfs613: ENOMEM does not sound like an error where clock are missing from DT , after all ... and you should bail on such an error I think
<rfs613>
marex: correct, ENOMEM is when clk_get_bulk() fails to malloc enough space for the array of "struct clk"
warpme__ has joined #u-boot
justache has quit [Ping timeout: 256 seconds]
Stat_headcrabbe1 has quit [Quit: Stat_headcrabbe1]
urja has quit [Ping timeout: 252 seconds]
justache has joined #u-boot
urja has joined #u-boot
warpme__ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
goliath has joined #u-boot
zumbi has quit [Ping timeout: 256 seconds]
zumbi has joined #u-boot
Hypfer has quit [Read error: Connection reset by peer]
darkling has quit [Ping timeout: 256 seconds]
rbm has quit [Ping timeout: 248 seconds]
darkling has joined #u-boot
rbm has joined #u-boot
Hypfer has joined #u-boot
<marex>
rfs613: that does not look like an error which is fixed by skipping the clock enablement :)
clarity has quit [Ping timeout: 248 seconds]
clarity has joined #u-boot
darkling has quit [Ping timeout: 252 seconds]
darkling has joined #u-boot
warpme_ has joined #u-boot
rainbyte has quit [Read error: Connection reset by peer]
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rainbyte has joined #u-boot
warpme_ has joined #u-boot
__nick__ has quit [Remote host closed the connection]
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
goliath has quit [Quit: SIGSEGV]
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
flyback has joined #u-boot
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mmu_man has quit [Ping timeout: 265 seconds]
mmu_man has joined #u-boot
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
warpme_ has joined #u-boot
warpme_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]