Wednesday, 2021-02-10

*** tpb has joined #litex00:00
*** lf has quit IRC00:28
*** lf has joined #litex00:29
*** mikeK_de10nano has joined #litex00:38
*** Degi has quit IRC01:09
*** mikeK_de10nano has quit IRC03:56
*** Bertl_oO is now known as Bertl_zZ04:03
*** davidlattimore has quit IRC04:21
*** davidlattimore has joined #litex04:21
*** sorear has quit IRC04:22
*** sorear has joined #litex04:23
*** davidlattimore has quit IRC04:37
*** st-gourichon-fid has quit IRC04:37
*** davidlattimore has joined #litex04:42
*** st-gourichon-fid has joined #litex04:42
*** david-sawatzke[m has quit IRC04:45
*** apolkosnik[m] has quit IRC04:45
*** jevinskie[m] has quit IRC04:46
*** xobs has quit IRC04:46
*** jryans has quit IRC04:47
*** leons has quit IRC04:49
*** promach3 has quit IRC04:49
*** disasm[m] has quit IRC04:49
*** sajattack[m] has quit IRC04:50
*** CarlFK[m] has quit IRC04:50
*** david-sawatzke[m has joined #litex04:56
*** jevinskie[m] has joined #litex05:10
*** xobs has joined #litex05:12
*** FFY00 has quit IRC05:13
*** apolkosnik[m] has joined #litex05:17
*** CarlFK[m] has joined #litex05:19
*** jryans has joined #litex05:22
*** leons has joined #litex05:24
*** promach3 has joined #litex05:25
*** disasm[m] has joined #litex05:25
*** sajattack[m] has joined #litex05:26
_florent_nickoe: 50MHz is indeed a bit low for the DDR3 frequency and also for the capability of the controller to adjust and find the right delays (it has fixed delay taps, so delays can saturate more easily with a low frequency), that's why I recommend using a higher frequency to do the initial port on a new Artix7 board.06:38
*** ius has quit IRC07:21
*** Melkhior has joined #litex07:28
*** Melkhior has quit IRC09:26
*** miek has quit IRC09:37
*** Melkhior has joined #litex10:24
*** Bertl_zZ is now known as Bertl11:33
*** Bertl is now known as Bertl_oO12:51
*** Bertl_oO is now known as Bertl13:49
*** FFY00 has joined #litex14:00
*** Melkhior has quit IRC14:10
*** miek has joined #litex14:21
nickoe_florent_: Do you have any hints on how to test the flash?15:11
*** peeps[zen] has joined #litex15:35
*** peepsalot has quit IRC15:37
_florent_nickoe: you can do a mem_list to get the different memory regions, then to a mem_read on the SPI Flash region and verify it matches contents that has been previously flashed15:39
*** peeps[zen] has quit IRC15:48
*** peepsalot has joined #litex15:55
*** peepsalot has quit IRC16:04
*** peepsalot has joined #litex16:07
*** Degi has joined #litex16:19
*** kgugala has quit IRC16:22
*** kgugala has joined #litex16:22
*** lkcl has quit IRC16:39
*** lkcl has joined #litex16:40
*** _whitelogger has quit IRC16:48
*** _whitelogger has joined #litex16:52
*** TMM has quit IRC17:46
*** TMM has joined #litex17:46
*** peepsalot has quit IRC17:47
*** mikeK_de1_SoC_do has joined #litex17:58
*** peepsalot has joined #litex18:09
nickoe_florent_: OK, I did try that, and it does not look exactly as I expect, https://dpaste.com/565PNKC58#line-25418:12
tpbTitle: dpaste: 565PNKC58 (at dpaste.com)18:12
nickoeI think this is in 1x spi mode, but the flash also supports QSPI (4x ?)18:13
*** lkcl has quit IRC18:28
nickoehttps://i.snipboard.io/86HBhl.jpg18:32
*** lkcl has joined #litex18:40
*** peepsalot has quit IRC18:48
*** Bertl is now known as Bertl_oO19:28
*** peepsalot has joined #litex20:58
nickoe_florent_: If using add_spi_sdcard do I need to use add_sdcard as well?22:31
somlonickoe: I know this one :) spi-sdcard and "native" sdcard are mutually exclusive, if you're using one then you don't need/want the other22:51
nickoesomlo: Ok, thank you for confirming! :)22:51
nickoesomlo: Have you tried to use it, it does not look like there are any test app for the spi sdcard in the bios code.22:52
somlonickoe: if you build bitstream with either spi- or "native" sdcard, you get a "sdcardboot" command in the bios22:52
somloand a bunch of other commands to test writes and reads from the sdcard, to initialize the card, etc.22:53
nickoeHmm, yesh, I have that. I am not sure I have tried to use that. Doesn't that asume you put a binary on it?22:53
somlotyping "help" at the bios prompt should give you a list22:53
nickoesomlo: yeah, well, I got this, https://dpaste.com/AVLM8J8TB22:54
tpbTitle: dpaste: AVLM8J8TB (at dpaste.com)22:54
somlonot sure this isn't written down somewhere, but you want a fat16 filesystem (maybe fat32 will work too), and then things diverge: you can have some sort of .json file listing what other files should be loaded (dtb, kernel, etc)22:54
nickoeand the sdcard does not seem to be listed in mem_list22:55
somloor (in the rocket/bbl case) just a boot.bin file that has everything built in22:55
nickoesomlo: I am not really familiar with the boot stuff22:58
somlonickoe: hmmm, I don't have a bitstream with spi-sdcard handy; on my "native" sdcard bitstream I have sdcardboot in the same place as you, but also a bunch of test commands further down: https://imgur.com/a/Qcr7f7U22:59
tpbTitle: Imgur: The magic of the Internet (at imgur.com)22:59
nickoesomlo: ok, so it appears that it do read the sdcard successfully? in between those two commands I did eject the sdcard and put it in my laptop and touched a boot.json with a few random bytes in it. https://dpaste.com/EXRNGBERW23:02
tpbTitle: dpaste: EXRNGBERW (at dpaste.com)23:02
nickoesomlo: Are you using spi sdcard?23:02
somloyes; and "success" should look something like this: https://imgur.com/a/TOebRY323:04
tpbTitle: Imgur: The magic of the Internet (at imgur.com)23:04
nickoesomlo: they appear to come from https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/bios/cmds/cmd_litesdcard.c23:05
nickoeI am not sure how those defines are defined, CSR_SDMEM2BLOCK_BASE for example.23:06
somlonickoe: so they depend on `#ifdef CSR_SD*_BASE`, which may be a "native" sdcard thing only23:07
nickoeBy the way, I build with ./mars_ax3.py  --integrated-rom-size=0x10000 --build --with-spi-sdcard23:07
somloif you look in `build/<your-board>/software/include/generated/csr.h`, there should be something related to the sdcard and/or SPI23:07
nickoehttps://github.com/litex-hub/litex-boards/compare/master...nickoe:mars_ax323:08
nickoesomlo: there are no SD2MEM thing, but SPISDCARD things23:10
somloand you should be able to tell by switching `s/--with-spi-sdcard/--with-sdcard/` (assuming your target file supports both -- look at litex-boards/targets/nexys4ddr.py for an example of how to "clone" that for your board, if you haven't already23:10
somloso I'm guessing `SDCORE` and `SDPHY` aren't there except when you use `--with-sdcard`23:10
nickoemars_ax3.py: error: argument --with-sdcard: not allowed with argument --with-spi-sdcard23:12
somloright, they're mutually exclusive23:12
nickoeI mean, those requirements are inspired by https://github.com/litex-hub/litex-boards/blob/master/litex_boards/targets/arty.py#L118-L12023:13
somlonickoe: and if you replace one with the other, you don't have to wait for the bitstream to be built -- as soon as the C compiler starts spitting things out, you can ctrl-c and the generated csr.h should already be there for you to look at23:14
nickoesomlo: bu this hardware is only routed in SPI  configration to the sdcard.23:15
somloI'm not super familiar with the arty board and its target file, but there are other boards (e.g. nexys4ddr) that enforce mutual exclusion between native and spi sdcard modes: https://github.com/litex-hub/litex-boards/blob/master/litex_boards/targets/nexys4ddr.py#L12823:15
nickoesomlo: yeah, that is what I linked just above :)23:17
somlooh wait, in the *platform* file you only have spi pins connected? nexys has both: https://github.com/litex-hub/litex-boards/blob/master/litex_boards/platforms/nexys4ddr.py#L6823:17
nickoecorrect.23:17
somlooh, then nevermind about `with-sdcard`, it assumes you have the extra data pins connected to something on the fpga. If that's not the case, then your only option is `--with-spi-sdcard`23:17
nickoeAnyway, for the SD card it looks like it works for SPI mode as it appears to be able to find the boot.json23:18
nickoeMaybe I can remove those defines in the sdcard lib?23:18
somloI can't tell if it *found* boot.json or skipped it23:19
somlofrom your screenshot, that is23:19
somlooh, because it didn't say "boot.json file not found" -- which it does for me, since I don't have one :)23:20
nickoeyeah23:20
somloso then maybe all you need is the proper dtb and kernel and whatever files on your sdcard23:20
nickoeI am still quite new to this, so I am not really sure if I can just run a kernel for this with just the ram workng?23:21
somlowell, with the proper boot.json (or boot.bin), you should be able to at least start *loading* a kernel to RAM, and have the bios jump to it, and start booting. That it may die a horrible death some way into that process is to be expected ;)23:23
nickoeWhat do I need to get that?23:23
somlowell, in your case, targeting vexriscv, you should dig around the litex-hub/linux-on-litex-vexriscv project and start by figuring out what they like to put into boot.json23:24
somloI would expect a dtb, some sort of machine-layer "emulator", a kernel, and an initrd filesystem23:24
somloI for one am building with a 64-bit rocket CPU, and have the initrd built into the kernel, which is built into BBL along with the dtb. So it's basically a Matrioshka doll of filesystem-within-kernel-plus-dtb-within-bbl, named "boot.bin" -- a single image that gets loaded and executed23:26
somloso what I know about how to do things is going to be less useful to you23:26
nickoeok23:27
somloso boot.json will list all those other files, then the bios will process the json and try to load each file separately from the sdcard, before jumping into either the emulator or the kernel or whatever, and letting things proceed from there23:28
somloI don't have a good handle on the nitty gritty detail for vexriscv, but I'm sure it's somewhere in the linux-on-litex-vexriscv repo23:29
nickoesomlo:  for https://github.com/litex-hub/linux-on-litex-vexriscv, can I use ny own board there?23:31
somlosorry, I don't know23:32
nickoemm, trying "./make.py --board=arty " I get "subprocess.CalledProcessError: Command 'dtc -O dtb -o images/rv32.dtb build/arty/arty.dts' returned non-zero exit status 127."23:33
somlowhat I meant is that there will be an example or some sort of specification of what the boot.json file should look like; but yeah, if you're *really* *lucky*, there may be a way to just leverage the whole thing into building software for your board :) I wouldn't know23:34
somlore. your error: do you have the dtc package installed?23:35
somloit's the thing that compiles a .dtb blob from your .dts (device tree spec) sources23:35
*** mikeK_de1_SoC_do has quit IRC23:37
nickoewoh well, I just installed it, so it did build something23:39
nickoesomlo: How is the the kernel built? Is that to be checkout seperately and a custom defconfig?23:51
nickoeoh, missed https://github.com/litex-hub/linux-on-litex-vexriscv#generating-the-linux-binaries-optional23:51
somlonickoe: ok, happy you found it -- I'm sure there's some defconfig for vexriscv somewhere under linux-on-litex-vexriscv, but I'd have to race you if I wanted to find it :)23:53
nickoeyeah, no worries. I better head to bed anyways :D23:54
somloyeah, time to shut down the day, live to fight another :) Later!23:55

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