ChanServ changed the topic of #linux-sunxi to: Allwinner/sunxi development - Did you try looking at our wiki? https://linux-sunxi.org - Don't ask to ask. Just ask and wait for an answer! - This channel is logged at https://oftc.irclog.whitequark.org/linux-sunxi
evgeny_boger has quit [Ping timeout: 480 seconds]
rajkosto has quit [Read error: Connection reset by peer]
jernej has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
jernej has joined #linux-sunxi
jernej has quit []
jernej has joined #linux-sunxi
aggi has quit [Quit: connection closed.]
Danct12 has quit [Remote host closed the connection]
Danct12 has joined #linux-sunxi
aggi has joined #linux-sunxi
aggi has quit [Remote host closed the connection]
macromorgan has quit [Quit: Leaving]
aggi has joined #linux-sunxi
cnxsoft has joined #linux-sunxi
vagrantc has quit [Quit: leaving]
JohnDoe_71Rus has joined #linux-sunxi
warpme___ has quit []
chewitt has joined #linux-sunxi
indy has quit [Ping timeout: 480 seconds]
cnxsoft has quit [Read error: Connection reset by peer]
cnxsoft has joined #linux-sunxi
qwestion has joined #linux-sunxi
indy has joined #linux-sunxi
evgeny_boger has joined #linux-sunxi
cnxsoft has quit [Ping timeout: 480 seconds]
warpme___ has joined #linux-sunxi
apritzel has joined #linux-sunxi
JohnDoe_71Rus has quit []
apritzel has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has joined #linux-sunxi
chewitt has quit [Ping timeout: 480 seconds]
cnxsoft has joined #linux-sunxi
cnxsoft has quit []
aggi has quit [Remote host closed the connection]
aggi has joined #linux-sunxi
evgeny_boger has quit [Quit: evgeny_boger]
ats has quit [Ping timeout: 480 seconds]
rajkosto has joined #linux-sunxi
ats has joined #linux-sunxi
ftg has joined #linux-sunxi
vagrantc has joined #linux-sunxi
ftg^ has joined #linux-sunxi
ftg has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has quit []
digetx has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
digetx has joined #linux-sunxi
apritzel has joined #linux-sunxi
<jernej> apritzel, smaeul: are you aware why 32 bit reads with devmem2 don't work anymore on H6, unless they are aligned to 8 bytes?
<jernej> did something change in Linux 6.0?
<smaeul> jernej: are you sure you are not using some version of devmem2 that uses "long" for "word" accesses?
<jernej> hm... good point
<jernej> I'm using whatever arch provides
<jernej> let me self compile
<apritzel> I thought that devmem2 was always broken in that respect?
<jernej> it worked before, now I get "Bus error (core dumped)"
<jernej> smaeul: thanks, that was it. I changed unsigned long to unsigned int in source and it works
Danct12 has quit [Read error: Connection reset by peer]
<apritzel> jernej: but that was a problem already when the A64 appeared, so whenever you compile the userland tool for an LP64 system. So how did it work before?
hlauer has joined #linux-sunxi
<jernej> not sure, as I said, I used devmem from arch repo
<jernej> but it's possible it was devmem (earlier version)
<apritzel> I tried to fix it back then, but couldn't find a canonical source to report it to, and there were more problems
<apritzel> smaeul: palmer: I think you settled this already, but just for the records: I don't think the R528 deserves a separate clock compatible
<apritzel> because CLK_IS_CRITICAL is a Linux implementation details, and nothing that should be different in the DT
<jernej> apritzel: I found and fix several small bugs in your AC200 driver, but that reveal 1 major and 1 minor issue
<jernej> major: mdio driver for some reason doesn't deassert reset and enable clock
<jernej> minor: PHY driver doesn't load up, it's treated as generic PHY
<apritzel> jernej: so I think we don't need an AC200 specific PHY driver, do we? I just kept this part to not lose your code
<jernej> well, I'm not sure
<jernej> it disables some functionality, presumably because it's broken
<jernej> but first submission of the driver can be done without it
<apritzel> I am not even sure I enabled that driver?
<apritzel> jernej: and what do you mean with mdio driver? the generic DT PHY code?
<jernej> what do you mean? it has all right tables to be loaded at right time
<jernej> apritzel: yes, it lives in mdio bus and mdio driver files. PHY reset and clock are never handled
<apritzel> but is it built by default? As I said, I didn't really care about this
<jernej> I enabled the driver, it is built, so it should be loaded
<apritzel> jernej: is that something that changed in 6.0? because I am pretty sure *that* part worked (and provoked one crash, for instance)
<apritzel> (I mean the MDIO driver triggering the reset and clock handling)
<jernej> note, you have PHY clock enabled and reset deasserted whole time, because this line has inverted value (should be 0): https://github.com/apritzel/linux/blob/ac200-WIP/drivers/phy/allwinner/ac200-ephy-ctl.c#L193-L196
<jernej> I put printk in reset deassert and clock prepare callback - nothing in dmesg
<apritzel> mmh, I remember changing this line once, because it was initially wrong, but I thought this was the version I pushed?
<jernej> anyway, that line is not needed, because AC200 reset in MFD driver already resets everything, including register values
<apritzel> but I am pretty sure setting the bits disabled the clocks and reset, because I got this initially the other way around, and had issues
<jernej> nope, it's correct to be 0
<apritzel> that's why the symbol is called RESET_INVALID, for instance
<jernej> read manual and look at my U-Boot hack
<jernej> I'll push my fixes, you'll see
<apritzel> ah, I think I fixed it in the callbacks, but not in the probe function
<jernej> apritzel: I use "regmap_write(priv->regmap, AC200_SYS_EPHY_CTL0, 3);" hack in ephy syscon driver to make it work
<apritzel> in probe?
<jernej> yes
<jernej> oh, that 24 MHz clock selection can be considered as hack, too
<jernej> it seems it can work with 27 MHz too
<apritzel> mmh, that's odd, because I am pretty sure I saw the callbacks being called correctly, but then ran into some Linux clock framework problem
<jernej> yes, because of extra ampersand :)
<jernej> at least that was the source of kasan complaints
<apritzel> and 27 Mhz is somewhat theoretical, at least in the actual implementations? But I mean we can query the parent frequency, and set the bit accordingly
<jernej> it's possible when AC200 is used as standalone IC
<apritzel> yeah, but that's what I mean with theoretical, because even then you probably use a 24 MHz clock
<apritzel> but yeah, your fixed look legit, many thanks for digging into this
<jernej> np :)
<apritzel> I won't be near hardware till the end of the week, so can only check on the remaining problems then
<jernej> btw, I get message: mdio_bus stmmac-0:01: Resources present before probing
<jernej> and probing code seems to bail out with -EBUSY
warpme___ has quit []
<jernej> so maybe that's the reason it doesn't enable clock
<apritzel> never saw this message before
<jernej> apritzel: I have to correct myself. Reset is deasserted, just clock is not enabled
<jernej> apritzel: reset handling is actually done with two functions, second is effectively just rename of the first, so mdio_device_reset() and phy_device_reset()
<jernej> and second one is called in a lot of places
<jernej> so I guess we have to rethink this part
apritzel has quit [Ping timeout: 480 seconds]
benpoulson has joined #linux-sunxi
<jernej> apritzel: so missing call is in phy_device_register(). I put clock enable call there too and now it works without ephy syscon driver hacks
<jernej> mystery solved, now I can go to sleep :)
benpoulson has quit [Ping timeout: 480 seconds]
ftg^ has quit [Read error: Connection reset by peer]
hlauer has quit [Ping timeout: 480 seconds]