_florent_ changed the topic of #litex to: LiteX FPGA SoC builder and Cores / Github : https://github.com/enjoy-digital, https://github.com/litex-hub / Logs: https://freenode.irclog.whitequark.org/litex
tpb has quit [Remote host closed the connection]
tpb has joined #litex
lf has quit [Ping timeout: 258 seconds]
lf has joined #litex
mikeK_de10nano has joined #litex
Degi has quit [Ping timeout: 272 seconds]
mikeK_de10nano has quit [Quit: Connection closed]
Bertl_oO is now known as Bertl_zZ
davidlattimore has quit [Read error: Connection reset by peer]
davidlattimore has joined #litex
sorear has quit [Read error: Connection reset by peer]
sorear has joined #litex
davidlattimore has quit [*.net *.split]
st-gourichon-fid has quit [*.net *.split]
davidlattimore has joined #litex
st-gourichon-fid has joined #litex
david-sawatzke[m has quit [Ping timeout: 240 seconds]
apolkosnik[m] has quit [Ping timeout: 246 seconds]
jevinskie[m] has quit [Ping timeout: 265 seconds]
xobs has quit [Ping timeout: 246 seconds]
jryans has quit [Ping timeout: 240 seconds]
leons has quit [Ping timeout: 268 seconds]
promach3 has quit [Ping timeout: 268 seconds]
disasm[m] has quit [Ping timeout: 240 seconds]
sajattack[m] has quit [Ping timeout: 268 seconds]
CarlFK[m] has quit [Ping timeout: 268 seconds]
david-sawatzke[m has joined #litex
jevinskie[m] has joined #litex
xobs has joined #litex
FFY00 has quit [Ping timeout: 260 seconds]
apolkosnik[m] has joined #litex
CarlFK[m] has joined #litex
jryans has joined #litex
leons has joined #litex
promach3 has joined #litex
disasm[m] has joined #litex
sajattack[m] has joined #litex
<_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.
ius has quit [Quit: Lost terminal]
Melkhior has joined #litex
Melkhior has quit [Quit: Ping timeout (120 seconds)]
miek has quit [Ping timeout: 265 seconds]
Melkhior has joined #litex
Bertl_zZ is now known as Bertl
Bertl is now known as Bertl_oO
Bertl_oO is now known as Bertl
FFY00 has joined #litex
Melkhior has quit [Quit: Ping timeout (120 seconds)]
miek has joined #litex
<nickoe> _florent_: Do you have any hints on how to test the flash?
peeps[zen] has joined #litex
peepsalot has quit [Ping timeout: 264 seconds]
<_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 flashed
peeps[zen] has quit [Ping timeout: 265 seconds]
peepsalot has joined #litex
peepsalot has quit [Ping timeout: 240 seconds]
peepsalot has joined #litex
Degi has joined #litex
kgugala has quit [Quit: -a- Connection Timed Out]
kgugala has joined #litex
lkcl has quit [Ping timeout: 246 seconds]
lkcl has joined #litex
_whitelogger has joined #litex
TMM has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
TMM has joined #litex
peepsalot has quit [Ping timeout: 264 seconds]
mikeK_de1_SoC_do has joined #litex
peepsalot has joined #litex
<nickoe> _florent_: OK, I did try that, and it does not look exactly as I expect, https://dpaste.com/565PNKC58#line-254
<tpb> Title: dpaste: 565PNKC58 (at dpaste.com)
<nickoe> I think this is in 1x spi mode, but the flash also supports QSPI (4x ?)
lkcl has quit [Ping timeout: 256 seconds]
lkcl has joined #litex
peepsalot has quit [Ping timeout: 256 seconds]
Bertl is now known as Bertl_oO
peepsalot has joined #litex
<nickoe> _florent_: If using add_spi_sdcard do I need to use add_sdcard as well?
<somlo> nickoe: I know this one :) spi-sdcard and "native" sdcard are mutually exclusive, if you're using one then you don't need/want the other
<nickoe> somlo: Ok, thank you for confirming! :)
<nickoe> somlo: Have you tried to use it, it does not look like there are any test app for the spi sdcard in the bios code.
<somlo> nickoe: if you build bitstream with either spi- or "native" sdcard, you get a "sdcardboot" command in the bios
<somlo> and a bunch of other commands to test writes and reads from the sdcard, to initialize the card, etc.
<nickoe> Hmm, yesh, I have that. I am not sure I have tried to use that. Doesn't that asume you put a binary on it?
<somlo> typing "help" at the bios prompt should give you a list
<nickoe> somlo: yeah, well, I got this, https://dpaste.com/AVLM8J8TB
<tpb> Title: dpaste: AVLM8J8TB (at dpaste.com)
<somlo> not 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)
<nickoe> and the sdcard does not seem to be listed in mem_list
<somlo> or (in the rocket/bbl case) just a boot.bin file that has everything built in
<nickoe> somlo: I am not really familiar with the boot stuff
<somlo> nickoe: 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/Qcr7f7U
<tpb> Title: Imgur: The magic of the Internet (at imgur.com)
<nickoe> somlo: 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/EXRNGBERW
<tpb> Title: dpaste: EXRNGBERW (at dpaste.com)
<nickoe> somlo: Are you using spi sdcard?
<somlo> yes; and "success" should look something like this: https://imgur.com/a/TOebRY3
<tpb> Title: Imgur: The magic of the Internet (at imgur.com)
<nickoe> I am not sure how those defines are defined, CSR_SDMEM2BLOCK_BASE for example.
<somlo> nickoe: so they depend on `#ifdef CSR_SD*_BASE`, which may be a "native" sdcard thing only
<nickoe> By the way, I build with ./mars_ax3.py --integrated-rom-size=0x10000 --build --with-spi-sdcard
<somlo> if you look in `build/<your-board>/software/include/generated/csr.h`, there should be something related to the sdcard and/or SPI
<nickoe> somlo: there are no SD2MEM thing, but SPISDCARD things
<somlo> and 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 already
<somlo> so I'm guessing `SDCORE` and `SDPHY` aren't there except when you use `--with-sdcard`
<nickoe> mars_ax3.py: error: argument --with-sdcard: not allowed with argument --with-spi-sdcard
<somlo> right, they're mutually exclusive
<somlo> nickoe: 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 at
<nickoe> somlo: bu this hardware is only routed in SPI configration to the sdcard.
<somlo> I'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#L128
<nickoe> somlo: yeah, that is what I linked just above :)
<somlo> oh 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#L68
<nickoe> correct.
<somlo> oh, 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`
<nickoe> Anyway, for the SD card it looks like it works for SPI mode as it appears to be able to find the boot.json
<nickoe> Maybe I can remove those defines in the sdcard lib?
<somlo> I can't tell if it *found* boot.json or skipped it
<somlo> from your screenshot, that is
<somlo> oh, because it didn't say "boot.json file not found" -- which it does for me, since I don't have one :)
<nickoe> yeah
<somlo> so then maybe all you need is the proper dtb and kernel and whatever files on your sdcard
<nickoe> I 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?
<somlo> well, 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 ;)
<nickoe> What do I need to get that?
<somlo> well, 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.json
<somlo> I would expect a dtb, some sort of machine-layer "emulator", a kernel, and an initrd filesystem
<somlo> I 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 executed
<somlo> so what I know about how to do things is going to be less useful to you
<nickoe> ok
<somlo> so 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 there
<somlo> I 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 repo
<nickoe> somlo: for https://github.com/litex-hub/linux-on-litex-vexriscv, can I use ny own board there?
<somlo> sorry, I don't know
<nickoe> mm, 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."
<somlo> what 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 know
<somlo> re. your error: do you have the dtc package installed?
<somlo> it's the thing that compiles a .dtb blob from your .dts (device tree spec) sources
mikeK_de1_SoC_do has quit [Quit: Connection closed]
<nickoe> woh well, I just installed it, so it did build something
<nickoe> somlo: How is the the kernel built? Is that to be checkout seperately and a custom defconfig?
<somlo> nickoe: 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 :)
<nickoe> yeah, no worries. I better head to bed anyways :D
<somlo> yeah, time to shut down the day, live to fight another :) Later!