Tuesday, 2020-01-07

*** tpb has joined #litex00:00
*** Xark has quit IRC05:19
*** Xark has joined #litex05:24
*** _whitelogger has quit IRC06:25
*** _whitelogger has joined #litex06:28
_florent_somlo: for the card_detect, IIRC we were not using it or managing it externally, but this could be useful to let LiteSDCard manage it09:55
*** keesj has quit IRC09:59
*** rohitksingh has joined #litex14:22
*** rohitksingh has quit IRC15:01
somlo_florent_: https://pastebin.com/chupVmd316:35
tpbTitle: [Diff] diff --git a/litesdcard/firmware/sdcard.c b/litesdcard/firmware/sdcard.c index - Pastebin.com (at pastebin.com)16:35
somlonot sure it's worth sending a PR over it, but I can if you want me to :)16:36
somlobut we shouldn't have global variables declared in a .h :)16:36
somlos/declared/defined/16:36
_florent_somlo: thanks, i can apply that. firmware.c can indeed probably be improved.16:38
somlobesides, it doesn't *need* to be global, as only sdcard_init actually uses it16:38
somloI'm trying to import the sdcard.c code into the litex bios binary, as opposed to just running the firmware tester as part of litesdcard16:39
somloand I noticed this while working on wrapping #ifdef CSR_SDCLK_BASE ... #endif around everything :)16:40
_florent_ah interesting, that would be great to have a sdcardboot capability :) (just copy raw data from the SDCard to SDRAM and boot to it)16:44
somlothen get a Linux driver for it, and boot from a pre-populated rv64gc distro image :)16:46
somlo_florent_: are sdinit/sdtest likely to destroy the data I have on the sdcard? :)17:13
_florent_somlo: sdinit no, but sdtest will write some blocks yes...20:22
kbeckmann_florent_: the question about litex + nmigen came up again in another discussion forum. did you have some ideas about how to approach this already? was the idea to allow instantiation of nmigen modules in a litex project? another obviously riskier option would be to migrate the codebase to the migen compatibility mode in nmigen, and i remember you mentioning lack of unit tests being a problem here in order to20:30
kbeckmannverify the migration.20:30
somlo_florent_: figured it out meanwhile... "luckily" for my sdcard (not that I have anything irreplaceable on it) the write test failed (initialization succeeded, though): https://pastebin.com/7qH1CCEx20:31
tpbTitle: __ _ __ _ __ / / (_) /____ | |/_/ / /__/ / __/ - - Pastebin.com (at pastebin.com)20:32
somloI think it fails setting the block count, then blindly tries writing a block and I think I get a hardware lockup, since it stops outputting anything20:33
somlothat's with 32-bit csr data width, now trying again with 8. Used mor1kx since I already have a toolchain for it, and the default litesdcard firmware was also targetting a big-endian cpu. I'm getting the same on vexriscv, btw. didn't even try rocket, not yet having had a chance to sanitize the code for 64bit :)20:36
_florent_kbeckmann: i did a first test with Minerva that is elaborated directly with nMigen during the build: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/cpu/minerva/core.py#L89-L10220:41
tpbTitle: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com)20:41
_florent_kbeckmann: then yes i want to continue adding unit tests and do more test with the nmigen compat mode20:41
kbeckmannoh, that's interesting. thanks for the link.20:49
somlo_florent_: interesting, now my sdcard is completely broken, getting buffer i/o errors when trying to open it on Linux :)21:08
somlonot entirely sure if it was sdtest or maybe it just died of old age and abuse, in a weird coincidence :)21:08
*** vup2 has quit IRC21:48
_florent_somlo: formating SDCards with the core can also be a use-case :)21:49
*** gruetzkopf has quit IRC21:49
*** vup has joined #litex21:49
*** gruetzkopf has joined #litex21:50
somlo_florent_: after several tries I managed to re-format it and use it again22:21
somloso maybe overwriting block 0 really annoys the sdcard hardware -- I'll try to rewrite the test to use blocks from the *end* (as opposed to the beginning) of the device22:21
somlothen create a partition to overlap with that in a way that protects my other data22:21
somlothen retry, then we'll see what's going on22:22
somloalso, I think CSR_SDCORE_RESPONSE_* is a good candidate for a unified >64bit CSR read function...22:33

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!