Saturday, 2021-01-16

*** tpb has joined #litex00:00
*** DerFetzer[m] has quit IRC00:05
*** DerFetzer[m] has joined #litex00:06
*** lf_ has quit IRC00:06
*** lf has joined #litex00:07
*** Dolu has quit IRC02:03
*** _whitelogger has quit IRC02:36
*** _whitelogger has joined #litex02:38
*** Degi_ has joined #litex04:07
*** Degi has quit IRC04:09
*** Degi_ is now known as Degi04:09
*** ranzbak has quit IRC04:49
*** ranzbak has joined #litex05:13
*** lambda_ is now known as lambda08:35
*** futarisIRCcloud has quit IRC08:52
*** mibus has joined #litex09:39
*** mibus has quit IRC09:41
*** Melkhior has joined #litex09:48
*** Dolu has joined #litex09:50
*** Melkhior has quit IRC10:19
*** FFY00 has quit IRC10:37
*** FFY00 has joined #litex10:38
*** FFY00 has quit IRC10:39
*** FFY00 has joined #litex10:40
*** FFY00 has quit IRC10:47
*** FFY00 has joined #litex10:48
joseng_florent_ Tested now with l2_size=0, that also disables the reversing of the data order (and the flag "l2_reverse" which is by default True does not do anything with cache size 0)10:54
josengIs it recommended to have no l2 cache at all? Or can the cache somehow be disabled for the DMA readers and writers?10:55
_florent_joseng: the LiteDRAMDMAReader/Writer are directly connected to the DRAM controller, so there is no caching. But if for your test you are writing/checking data from the CPU, you'll have to be sure the L2 cache is flushed before doings reads from the CPU, or disable the L2 cache as you just did.11:20
_florent_The L2 cache improve performance and allow more efficient accesses to the DRAM, but you should indeed probably disable it for now (but with a potential reversing of the data as you seen, that we could try to avoid).11:24
*** Dolu has quit IRC11:33
*** captain_morgan has quit IRC11:33
*** Dolu_ has joined #litex11:34
*** captain_morgan0 has joined #litex11:34
*** tmbinc has quit IRC11:34
*** tmbinc has joined #litex11:35
*** Dolu_ has quit IRC11:57
*** ambro718 has joined #litex12:37
somlo_florent_: got litescope working with the actual fpga board \o/12:59
somlothanks again for the handholding! :)12:59
*** Melkhior has joined #litex13:02
MelkhiorHello,13:38
MelkhiorI'm trying to get the sdcard work in SPI mode in the LiteX BIOS on my HW, and so far no luck.13:38
MelkhiorThe 'native' mode works beautifully - LiteX loads the kernel and root filesystem very fast, and everything is fine.13:38
MelkhiorHowever if I use SPI mode instead, the BIOS hangs on 'Booting from boot.json...', though sometimes after some minutes I get "Booting from boot.bin..." (and occasionally after that "SDCard boot failed./No boot medium found").13:38
MelkhiorAny suggestion what could cause the SPI mode to fail? Or how I could try to figure out the problem?13:38
MelkhiorThanks in advance!13:38
*** Melkhior has quit IRC13:42
*** Melkhior has joined #litex13:51
*** Bertl_oO is now known as Bertl14:07
*** TMM has quit IRC14:18
*** TMM has joined #litex14:18
_florent_Melkhior: getting SPI mode working should be easier than native mode. I would recommend checking your pins definition.16:08
_florent_for reference, you can look at:16:08
_florent_https://github.com/litex-hub/litex-boards/blob/master/litex_boards/platforms/arty.py#L285-L30716:08
_florent_https://github.com/litex-hub/litex-boards/blob/master/litex_boards/platforms/orangecrab.py#L161-L17616:09
_florent_you can also try lowering the clock: https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/liblitesdcard/spisdcard.c#L2816:10
_florent_palmer: it's possible to run our setup in simulation (with Verilator): https://github.com/litex-hub/linux-on-litex-vexriscv/blob/master/sim.py16:27
_florent_it's not very fast (5 to 10min to boot linux), but if this is useful for you, happy to help you setting this up16:28
Melkhior_florent_ Thanks for the advice. I triple-checked the signals (all 4 of them :-) ) that I based on the arty design. I guess they're OK as it seems the "init" part is always successful, at least that the impression I got from tracking the state of the FSM in the SPI-based controllers I've tried with my design (and with one btistream - that I can't17:29
Melkhiorregenerate for unknown reasons - I was able to read blocks from the card... early in the process so I didn't think of saving it!).17:29
MelkhiorI also tried lowering/raising the frequency (thanks for confirming I had the right file, it felt strange to change C code rather than HDL)  - 25 MHz, 20MHz, 5MHz, 400KHz, all hangs the same way. Meanwhile, 'native' mode always just works!17:29
MelkhiorI wish I could just use litesdcard in my design, I've managed to generate some verilog, but the interface is too complicated for my limited HW skills at this stage. I can't figure out to _not_ have a local ClockDomain & PLLs (so I can use my own 48, 50 or 100 MHz clock directly), how to expose the CSR (can I just do17:29
Melkhior"bus_pads.cmd_arg.eq(self.sdcore.cmd_argument.storage)" and expose them to the outside world ?), or how to talk to the source/sink...17:29
MelkhiorThe only difference between 'working' and 'non-working' is using "sdcard" or "spisdcard" in "make.py", which the board defines like this:17:33
Melkhior    ("spisdcard", 0,17:33
Melkhior        Subsignal("clk",  Pins("R8"), Misc("PULLUP")),17:33
Melkhior        Subsignal("mosi", Pins("T5"), Misc("PULLUP")),17:33
Melkhior        Subsignal("cs_n", Pins("V6"), Misc("PULLUP")),17:33
Melkhior        Subsignal("miso", Pins("V5"), Misc("PULLUP")),17:33
Melkhior        Misc("SLEW=FAST"),17:33
Melkhior        IOStandard("LVCMOS33"),17:33
Melkhior    ),17:33
Melkhior    ("sdcard", 0,17:33
Melkhior        Subsignal("data", Pins("V5 V4 V7 V6"), Misc("PULLUP")),17:33
Melkhior        Subsignal("cmd",  Pins("T5"), Misc("PULLUP")),17:33
Melkhior        Subsignal("clk",  Pins("R8")),17:33
Melkhior        #Subsignal("cd",   Pins("V6")),17:33
Melkhior        Misc("SLEW=FAST"),17:33
Melkhior        IOStandard("LVCMOS33"),17:33
Melkhior    ),17:33
MelkhiorWeird...17:33
MelkhiorI need to find a smaller, older micro-sd card than I currently have (https://github.com/sy2002/QNICE-FPGA/blob/master/doc/constraints.txt reports trouble with SPI and modern micro-sd cards...)17:36
MelkhiorMy attempt at generating litesdcard verilog for inclusion in my (VHDL ;-) ) design: https://gist.github.com/rdolbeau/62a775d4ec5f27575a417ae32eb8a81c17:40
*** Melkhior has quit IRC17:45
*** Melkhior has joined #litex17:47
*** kgugala has quit IRC17:52
_florent_Melkhior: the pinout seems fine, only thing I can see is the un-required PULLUP on the clk pin17:56
_florent_for now exporting LiteSDCard will indeed not be very easy since there are no generator (as it's the case for LiteDRAM, LiteEth, etc...)17:56
Melkhiortried with and without, doesn't make any difference that I can see ; I'll remove it again17:56
Melkhior(the pullup on clk)17:57
_florent_maybe try with other SDCard is you have others17:57
MelkhiorI tried some designs with alternate cards, same result; unrotunately they are all class-10 UHS1 - I can't find anything older/slower at home... and older/slower cards are as expensive as large, fast ones :-(17:58
MelkhiorAnyway thanks for all the help - and for LiteX, quite impressive how it works if you don't deliberately cripple it by using an older, slower mode of operation :-)18:01
_florent_Melkhior: recent SDCard should work fine, the current limitation is to use ver2.00+ SDCards: https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/liblitesdcard/spisdcard.c#L23918:01
_florent_Melkhior: BTW, why aren't you able to use the native mode in your application?18:02
MelkhiorI can use native mode, but I haven't found a controller that I could integrate with my own design (non-LiteX):-(  Everything is either SPI-only (and reasonably easy to use) or a Wishbone-with-DMA-and-all-the-goodies that I can't figure out how to use. I'm trying to interface with another bus, good ol' IEEE 1496-1993, obsoleted in 2000:-)18:04
Melkhior(a.k.a. Sun's own SBus https://github.com/rdolbeau/SBusFPGA)18:05
_florent_Melkhior: thanks re LiteX, that's really interesting to see what you already manage to do with it (and also the extension you implemented for VexRiscv)18:06
_florent_ok for your implementation, I remember we discussed this by mail18:06
_florent_For LiteSDCard, we could eventually work on a core generate together if you want to integrate it as a verilog core in your VHDL design18:07
_florent_If you want to contribute an initial implementation, I'll be happy to review it and help you getting it working18:08
_florent_For examples of generators, you can look at LiteDRAM:18:08
Melkhioryep, decided to have a got at it:-)  turns out the interface with the SBus worked first time, and I can get some crypto on it :-)18:08
MelkhiorTrying to get the sdcard to work turns out to be the big problem - and I was sort of expecting it to be 'standard' enough to be the easiest part... silly me :-)18:08
_florent_https://github.com/enjoy-digital/litedram/blob/master/litedram/gen.py18:08
_florent_or LiteEth:18:08
_florent_https://github.com/enjoy-digital/liteeth/blob/master/liteeth/gen.py18:09
_florent_or LitePCIe :):18:09
_florent_https://github.com/enjoy-digital/litepcie/blob/master/litepcie/gen.py18:09
_florent_the aims is always the same, generate a standalone verilog core from a .yml configuration file and the core18:10
MelkhiorOh excellent, didn't realize there were examples:-)18:10
MelkhiorI'll look at them and see if I can improve my first poor attempt18:10
_florent_Melkhior: I think this is really similar to what you did18:10
Melkhior... and now I'm wondering if I couldn't use litepcie to create a SBus-to-PCIe bridge and solves the peripherals issue once and for all;-)18:12
MelkhiorProbably should create a generator for litesdcard and get the d*mn sd card working first, one mad project at a time18:13
MelkhiorThanks again !18:13
*** Bertl is now known as Bertl_oO18:16
*** captain_morgan0 is now known as captain_morgan18:37
*** somlo has quit IRC19:13
*** somlo has joined #litex19:13
*** cr1901_modern has joined #litex19:31
*** ambro718 has quit IRC19:34
*** Melkhior has left #litex20:14
*** Melkhior has joined #litex20:14
*** ambro718 has joined #litex21:06
*** skiphs has joined #litex21:40
*** skiphs has quit IRC21:41
*** Melkhior has quit IRC22:22

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