Monday, 2020-12-28

*** tpb has joined #litex00:00
*** lf has quit IRC00:26
*** lf has joined #litex00:26
*** Dolu has quit IRC01:05
*** Degi_ has joined #litex04:46
*** Degi has quit IRC04:46
*** Degi_ is now known as Degi04:46
*** Bertl_oO is now known as Bertl_zZ06:52
*** esden has quit IRC07:45
*** tannewt has quit IRC07:45
*** tannewt has joined #litex07:47
*** esden has joined #litex07:48
*** martinraison has joined #litex08:32
*** martinraison has quit IRC08:59
*** _franck_6 has joined #litex08:59
*** _franck_ has quit IRC09:00
*** _franck_6 is now known as _franck_09:00
*** martinraison has joined #litex09:00
*** martinraison has joined #litex09:01
*** shenki has quit IRC09:13
*** shenki has joined #litex09:24
*** martinraison has quit IRC09:49
*** martinraison has joined #litex09:58
*** martinraison has quit IRC10:53
*** martinraison has joined #litex11:14
*** Dolu has joined #litex11:40
*** martinraison has quit IRC11:49
*** martinraison has joined #litex11:50
*** martinraison has quit IRC11:55
*** martinraison has joined #litex11:57
shornesomlo: fixing up the drivers should not be too hard13:14
*** feldim2425_ has joined #litex13:19
*** feldim2425 has quit IRC13:19
*** feldim2425_ is now known as feldim242513:19
somloshorne: I took a first pass at doing that in litex-hub/linux (litex-rebase branch); for now they SHOULD compile on 8-bit CSR and 32-bit CPU (as that's the target they were written for originally);13:37
somloI have (some hacked version of) shenki's liteETH driver and (spi-)sdcard drivers tested on my setup (64-bit rocket, 32-bit csr data width)13:39
*** Bertl_zZ is now known as Bertl14:49
*** feldim2425 has quit IRC15:42
*** feldim2425 has joined #litex15:50
*** andrewb1999 has joined #litex15:50
_florent_Hi somlo, I just did some tests with Linux-on-LiteX-VexRiscv and the https://github.com/litex-hub/linux/tree/litex-rebase branch15:58
_florent_unfortunately it's stalling during the boot: https://github.com/litex-hub/linux-on-litex-vexriscv/commit/78cc2fc25fa086c7d7c276edc849410ef09ed69316:00
_florent_the behavior is similar with 32-bit CSRs16:01
_florent_with just the serial enable in the .dts it's also similar. I'll try to have a closer look later16:07
_florent_just for info, with your previous litex-rocket-rebase things are working correctly16:08
_florent_litex-rocket-rebase/litex-rocket-rebase branch16:08
*** martinraison has quit IRC16:10
*** martinraison has joined #litex16:20
*** FFY00 has quit IRC17:09
*** FFY00 has joined #litex17:09
*** martinraison has quit IRC17:09
*** martinraison has joined #litex17:10
*** FFY00 has quit IRC17:13
*** FFY00 has joined #litex17:14
*** FFY00 has quit IRC17:16
*** FFY00 has joined #litex17:16
*** martinraison has quit IRC17:19
*** feldim2425 has quit IRC17:23
*** feldim2425 has joined #litex17:23
*** FFY00 has quit IRC17:28
*** FFY00 has joined #litex17:28
somlo_florent_: do you have (nexys4ddr) bitstream and a kernel (def)config file you could send me to debug this?17:31
somlomust be some really stupid and small/subtle change in the include/linux/litex.h accessors17:32
somloone thing I could do is try 8-bit csr data width with rocket (I know how to build the bitstream for that :)17:35
somloI'll try that and see what happens, BRB17:35
somlothe other thing is that I dropped the liteUART version I had in litex-rocket-rebase in favor of the one that went upstream17:41
somlonot sure that has anything to do with it, but it's the only other change I can think of that might be related17:42
_florent_somlo: yes I can test and prepare things on the nexys4ddr to help working together on this17:42
_florent_somlo: I did a test with only the UART in the .dts and the issue was also there, that's indeed possible it's related to it17:44
*** _franck_ has quit IRC17:44
somlo_florent_: so, can you copy the drivers/tty/serial/liteuart.c from litex-rocket-rebase over the one upstream (in litex-rebase) and see if that works?17:44
*** _franck_ has joined #litex17:44
somloIf yes, we can diff them and see what broke17:44
somlohopefully the Kconfig options are the same...17:45
somlo*option names, I mean17:45
somloso if the litex.h accessors work for 8-bit csr-data-width on rocket, I'd presume they're fine on vexriscv as well, which would leave the liteUART driver. I'm waiting for both the bitstream and kernel for 8-bit CSR rocket to build, will report back once I know if it works17:47
somlo(might have to take a 40-minute car trip that overlaps with it all, so it might be an hour before I get back with any results)17:48
*** martinraison has joined #litex17:48
*** martinraison has quit IRC17:48
*** FFY00 has quit IRC17:48
*** martinraison has joined #litex17:48
*** FFY00 has joined #litex17:48
somlo_florent_: also, ignoring the 'rocket-rebase' branch, proper-upstream should have 8-bit CSR support and liteUART17:49
somloso I wonder if *that* works (before any of my changes are applied at all)17:50
_florent_somlo: ok thanks. I try to the test with upstream and also liteuart before leaving the office17:51
somloit'd have to be a simplified design with no ethernet/sdcard/etc17:51
somlo_florent_: oh yeah, sorry, forgot it's much later where you are ;)17:51
_florent_the features can be present in the bitstream, just that it will not be used by Linux17:52
somlooh, that's good then17:52
somlo_florent_: I don't use liteUART directly from linux -- I use sbi, which traps into machine-mode and causes bbl to handle console i/o18:00
somlothat said, with 8-bit CSRs linux boots, but ethernet doesn't work18:01
somloso I might have screwed up the accessors. I'll do some debugging and post a v6 of the patch to lkml later today (hopefully) after I figure it out18:01
somloassume it's the accessors and that i messed it up, until further notice :)18:01
*** FFY00 has quit IRC18:03
somloand, btw, thanks for catching that!18:04
*** FFY00 has joined #litex18:04
*** Bertl is now known as Bertl_oO18:11
*** FFY00 has quit IRC18:11
*** FFY00 has joined #litex18:11
*** FFY00 has quit IRC18:13
*** FFY00 has joined #litex18:13
*** martinraison has quit IRC18:24
_florent_somlo: in fact the behavior is similar with upstream Linux 5.11-rc1, I'll try to understand tomorrow18:43
*** FFY00 has quit IRC18:45
*** FFY00 has joined #litex18:45
*** lkcl has quit IRC19:21
*** lkcl has joined #litex19:34
somlo_florent_: then we have *two* problems ;) I broke 8-bit CSR accessors between litex-rocket-rebase -> litex-rebase, AND upstream LiteUART is being weird...19:52
somlo_florent_: so, it turns out I did *not* break accessors for 8-bit CSRs. In my previous test, I accidentally kept using the 32-bit-CSR kernel on my 8-bit-CSR bitstream :D20:05
somlowith the actual 8-bit-CSR kernel on the 8-bit-CSR bitstream (nexys4ddr, rocket+litex) I can get LiteETH working fine in linux (which means the accessors are OK)20:05
_florent_somlo: ah ok, good20:06
somloI'm getting cmd-51 dma timeouts, cmd-1 command timeouts, and subsequent cmd-51 data xfer timeouts with liteSDCard, but I don't think that's specifically related to CSRs20:07
_florent_somlo: for now I kept 8-bit CSR to only change one thing at a time, but I'll probably switch Linux-on-LiteX-Vexriscv to 32-bit once the other issues are solved20:08
somloso liteSDCard (the linux driver) works on 32-bit CSRs, and not so well on 8-bit (bios is fine on either)20:09
_florent_somlo: interesting, I think that's the issue I had20:09
somlohmmm, need to troubleshoot the linux driver on the 8-bit CSR setup, see if I can find the problem20:09
somlobut the good news is that the for-upstream CSR patches are OK; we need to find why the LiteSDCard driver hates us on 8-bit subregisters, and why upstream liteUART hates us on vexriscv20:11
somloI think per shorne it seems OK on mor1k20:11
_florent_somlo: exactly, not sure it's worth spending too much time on the 8-bit CSR support for LiteSDCard20:16
_florent_I'll investigate on upstream linux/Vexriscv20:16
_florent_regarding LiteEth, are you using the polling or IRQ mode?20:18
somlo_florent_: IRQ mode21:24
somlolooking at the liteuart driver in upstream vs. litex-rocket-rebase, the .c file has quite a few changes. From the outside (Kconfig), it's only that LITEUART_NR_PORTS was renamed to LITEUART_MAX_PORTS21:39
somloand `port->type` is hardcoded to '1' rather than adding a special PORT_LITEUART value to serial_core.h21:41
somlobut I'm not set up to test it on this end (litex+rocket doesn't use it)21:41
somlothe litex-rocket-rebase version has its own accessors defined internally (using iowrite32/ioread32)21:44
somloand since each CSR is 8 bit, and alignment is 4 bytes regardless of subregister size, the register offsets don't change across the 8-vs-32-bit csr data width21:45
somloso this one should work the same on both 8- and 32-bit CSRs21:45
somloI don't think the breakage is in the CSR accessors, rather something else in the changes since the old version we still have in litex-rocket-rebase21:50
*** SpaceCoaster has quit IRC23:09
*** SpaceCoaster has joined #litex23:10
*** martinraison has joined #litex23:30
*** martinraison has quit IRC23:35
somlo_florent_: final conclusion for today: on nexys4ddr / litex+rocket, both litex-rocket-rebase ("old" kernel) and litex-rebase ("new" kernel) behave the same: working liteeth, litesdcard works on 32-bit CSR width, breaks on 8-bit CSR width23:42
somloliteUART driver accessors appear to have the same behavior in both kernels (I'm not set up to test easily) -- so the breakage must be elswhere in the diff between the litex-rocket and current upstream23:43
somlomore digging into litesdcard tomorrow :)23:44
somloI *am* getting data xfer timeouts even on 32-bit CSRs, but it generally works and high-level data integrity is preserved after xfers are retried23:45
somlohoping to find an actual bug by troubleshooting on 8-bit CSRs, one that would help fix behavior on 32-bit CSRs as well (one can dream, right?) :)23:45

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!