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
aggi has quit [Quit: rebooting]
apritzel has quit [Ping timeout: 480 seconds]
sunshavi_ has joined #linux-sunxi
rajkosto has quit [Read error: Connection reset by peer]
Danct12 has joined #linux-sunxi
hexdump01 has joined #linux-sunxi
hexdump0815 has quit [Ping timeout: 480 seconds]
rajkosto has joined #linux-sunxi
Danct12 has quit [Remote host closed the connection]
Danct12 has joined #linux-sunxi
apritzel has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
Danct12 has quit [Read error: Connection reset by peer]
Danct12 has joined #linux-sunxi
Danct12 has quit [Quit: Leaving]
ftg has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
Danct12 has joined #linux-sunxi
JoaoSchim has joined #linux-sunxi
rajkosto has quit [Read error: Connection reset by peer]
apritzel has joined #linux-sunxi
aggi has joined #linux-sunxi
Danct12 has quit [Quit: Leaving]
pg12_ has quit [Ping timeout: 480 seconds]
pg12_ has joined #linux-sunxi
<apritzel> jernej: regarding the AC200 driver split: what about we move the regmap accessing part totally out of the PHY driver?
<apritzel> jernej: just have the PHY reference the reset controller in the MFD child device, and do the setup there (reset, LED polarity, PHY address, ...)
<apritzel> I think that would mimic the "normal" PHY setup, where this is typically done in hardware, using pins or just board layout decisions
<apritzel> PHY address and LED polarity could be MFD child DT properties, I think we need the latter anyway, since it's a board layout decision?
<apritzel> and there is already a generic resets property for PHY bindings, so we just add the few lines in the PHY driver to de-assert this reset, and this would trigger the setup on the MFD child side?
tnovotny has joined #linux-sunxi
<cyrozap> apritzel: Nice work on the FEL thing! I know you're not done yet, but it's good to see you're making progress.
linusw___ has quit []
evgeny_boger has joined #linux-sunxi
Net147 has quit [Quit: Quit]
Net147 has joined #linux-sunxi
JohnDoe_71Rus has quit []
<apritzel> cyrozap: you bindiff'ed dram_sun50i_h616.o between GCC 10.3 and 12.1, right? Without finding anything sticking out?
JoaoSchim has quit [Remote host closed the connection]
JoaoSchim has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
cnxsoft has quit [Remote host closed the connection]
vagrantc has joined #linux-sunxi
<jernej> apritzel: absolutely, regmap part should be removed from PHY driver
<jernej> but it would be strange to me to specify LED polarity in AC200 EPHY node, but well, still better than comming up with some tricky alternative
<jernej> phy address should be read from PHY node, right?
<apritzel> so looking around I was thinking of having a pure MDIO PHY driver, no extra compatible, just with mdio_device_id matching, but having that "resets" property, triggering the MFD device reset controller
<apritzel> that would be basically the equivalent to the Realtek PHY driver, which is only controller via MDIO
<apritzel> its configuration (PHY address, LEDs) is typically done "in hardware" (pins tied to GND/Vcc), and the MFD child would take that role
<apritzel> you said the H3 internal PHY shares the MDIO device ID?
<jernej> yes, at least if I remember correctly
<jernej> I suspect it's completely the same PHY
<jernej> I think it would also match to A64 and H5 internal PHYs
<jernej> which is IMO good thing
<apritzel> do we match that ID already?
<jernej> no
<jernej> at least last time I checked, which is a long time ago
<apritzel> so there is some magic going on with allwinner,sun8i-h3-mdio-internal, right?
<jernej> why do you think so?
<apritzel> or allwinner,sun8i-h3-mdio-mux
<jernej> in general, PHYs should have good defaults
<apritzel> because someone must enable that clock referenced in the PHY, AFAICS this is not a generic property handled by ethernet-phy-ieee802.3-c22
<jernej> Realtek PHYs work with or without driver
<apritzel> yes, but they don't require special properties
<jernej> emac driver sets syscon register accordingly for internal PHYs, if that's what you think
<jernej> but there is no need for MDIO configuration
<jernej> at least it seems so
<apritzel> I meant that sunxi-h3-h5.dtsi references clocks and resets in the internal PHY node, and I don't think the generic PHY driver handles the clock
<apritzel> jernej: that MDIO setup that you do in ac200_ephy_config_init() (Disable APS, PHYAFE TRX optimization, ...), is that also applicable to the H3 PHYs? Or is it just setting the default values, for good measures?
<jernej> Interesting, I don't think clock property is valid, per DT bindings. Maybe montjoie will know?
<apritzel> yeah, also I didn't find it in the of_mdio driver, but reset handling is there
<jernej> apritzel: I copied (and partially rewrite) init procedure from BSP driver
<apritzel> ah, I see
<apritzel> I will have a closer look
<jernej> and I think it actually applies also for older SoCs
<jernej> I don't really remember everything anymore
<apritzel> the H616 is the same AC200 co-packaged like the H6
<apritzel> ?
<jernej> should be, yes
<jernej> IIRC, H3 BSP has basically the same PHY driver with some different hacks for probing
<apritzel> and yeah, we handle clock and reset explicitly in dwmac-sun8i.c:get_ephy_nodes()
<apritzel> by scanning child nodes ...
<jernej> IIRC there was a big discussion how to properly represent everything in DT
<apritzel> yeah, I dimly remember ...
<apritzel> and I think the PHY address, to be programmed into the I2C register, must come from the DT, next to the LED polarity
<apritzel> because you could have multiple AC200s in your system
<apritzel> also as you mentioned A64 above: that doesn't have an internal PHY, right? It's just only H3 and H5, and later SoCs (H6, H616) used the co-packaged AC200
<jernej> ah, right
bauen1 has quit [Ping timeout: 480 seconds]
tnovotny has quit [Quit: Leaving]
evgeny_boger has quit [Ping timeout: 480 seconds]
rajkosto has joined #linux-sunxi
rajkosto has quit [Read error: Connection reset by peer]
apritzel has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
hlauer has joined #linux-sunxi
apritzel has joined #linux-sunxi
JohnDoe_71Rus has quit []
vagrantc has quit [Quit: leaving]
aggi has quit [Quit: nyaa~]
aggi has joined #linux-sunxi
evgeny_boger has joined #linux-sunxi
hlauer has quit [Ping timeout: 480 seconds]
Danct12 has joined #linux-sunxi
evgeny_boger1 has joined #linux-sunxi
evgeny_boger has quit [Ping timeout: 480 seconds]
rajkosto has joined #linux-sunxi
<cyrozap> apritzel: dram_sun50i_h616.o only contains three functions, since a lot of them were declared static and simply got included in `mctl_core_init`. The bulk of the differences are in `mctl_core_init`, with the remaining two functions (`sunxi_dram_init` and `mbus_configure_port`) having negligible differences (`mbus_configure_port` is nearly identical, with some instructions moved around and tst/csel
<cyrozap> instructions removed, and `sunxi_dram_init` has a small number of similarly-inconsequential optimizations).
bauen1 has joined #linux-sunxi
<cyrozap> One of the static functions contained in `mctl_core_init` (`mctl_phy_read_training`) is included by one of the configure flags you mentioned earlier ("but when I disable CONFIG_DRAM_SUN50I_H616_READ_TRAINING, it works with both compilers"), so either there's a problem with that function and disabling that one function fixed the return to FEL, or disabling CONFIG_DRAM_SUN50I_H616_WRITE_LEVELING,
<cyrozap> CONFIG_DRAM_SUN50I_H616_READ_TRAINING, and CONFIG_DRAM_SUN50I_H616_WRITE_TRAINING together is what fixed it.
<cyrozap> So, maybe it really is an issue with the stack, like you mentioned earlier--I'm thinking if those functions were disabled, it might free up enough stack space to avoid clobbering the saved mask ROM data.
<apritzel> cyrozap: yeah, the stack idea is really tempting, as it would explain everything nicely:
<apritzel> GCC 12 uses a bit more stack, so something gets overwritten which was not touched before
<apritzel> and including more functions also increases the stack usage, which would explain why the X96 Mate works, as it doesn't use most of those "extra" functions
<apritzel> the only problem is: it cannot be the stack (alone), as moving it away doesn't fix it
ftg has quit [Ping timeout: 480 seconds]
<cyrozap> apritzel: Yeah, and I'm comparing the assembly listings of the working and broken functions and they both appear to use the same amount of stack space...
<apritzel> exactly, I checked that as well
<apritzel> another thing I am trying is to move the *later* SPL stack into SRAM as well. After DRAM init, we switch BSS and stack to the newly initialised DRAM. So if DRAM is not initialised correctly, it might explain the failure
<apritzel> cyrozap: mmh, no change :-(
<apritzel> cyrozap: and yeah, the inlining is slightly annoying (though clever). I identified and matched each C line from mctl_phy_read_training() in the 12.1 objdump, but don't see any obvious issues
<cyrozap> apritzel: Is there a way to get JTAG access on these chips? Maybe attaching a debugger would at least let you see where in the return-to-FEL process things are getting stuck, or let you dump memory at that point in the broken binary so you can compare it to the memory at the same point during execution of the working binary.
<smaeul> > moving it away doesn't fix it // which did you move, the SPL stack or the save area?
<smaeul> I woulder if bisecting GCC optimization flags would be a useful way of debugging this
vagrantc has joined #linux-sunxi
<smaeul> cyrozap: you can get JTAG on port F with a microSD breakout board
evgeny_boger1 has quit [Remote host closed the connection]
diego71_ has joined #linux-sunxi
diego71 has quit [Ping timeout: 480 seconds]
vagrantc has quit [Quit: leaving]