_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
_whitelogger has joined #litex
Skip has quit [Remote host closed the connection]
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
Degi has quit [Ping timeout: 246 seconds]
Degi has joined #litex
futarisIRCcloud has joined #litex
_whitelogger has joined #litex
_whitelogger has joined #litex
st-gourichon-fid has joined #litex
_whitelogger has joined #litex
<benh_> _florent_: how did you simulate ? it works for me
<benh_> (the stack issue)
<benh_> _florent_: do you have the sram set to 0x2000 (8Kb) ?
<benh_> KB rather
<benh_> there *is* a bug in my code but I'm surprised it affects you :)
<benh_> _florent_: also what gcc / binutils are you using ? (actually respond on github, easier that way, I'm off to bed, I'll have a look tomorrow)
<_florent_> benh_: i just tested your proposed fix and it works in simulation: https://github.com/enjoy-digital/litex/commit/5b2f9c244dd71d2896f2bfca9a61c91f49f0251e
<tpb> Title: cores/cpu/microwatt: revert setup stack and fix missing subi %r1,%r1… · enjoy-digital/litex@5b2f9c2 · GitHub (at github.com)
Skip has joined #litex
CarlFK has quit [Quit: Leaving.]
<somlo> _florent_: I just diff-ed current master against 860ac1e2, and there are no sdcard related gateware changes
<somlo> that's the commit where I can still boot from sdcard (with litesdcard, slowly)
<somlo> so it's clearly a software bug we're still chasing
<_florent_> somlo: i also just started looking at this :)
<somlo> I built 860ac1e2 over the weekend, and got it to load and run `boot.bin` from sdcard successfully (it took a *long* time to load, but it worked)
<somlo> so (given the current litesdcard gateware) the breakage is somewhere in software; although the generic fatfs stuff seems to work fine for spi-sdcard
<_florent_> somlo: i got linux booting from sdcard with litesdcard, unfortunately github seems to be down so i can't push, the changes are: https://hastebin.com/epuhapulud.cs
<tpb> Title: hastebin (at hastebin.com)
<_florent_> somlo: can you do a test?
CarlFK has joined #litex
<keesj> why the flush cpu caches (line 62 of the hastbin?)
<_florent_> that's the next thing to investigate :)
<keesj> does all data go through the cache?
<somlo> _florent_: building now, will report back once I have it running. BTW, shouldn't we factor out busy_wait_us() (there's one in both spisdcard.c and in sdcard.c, and they look the same to me)
<Skip> _florent_: I've responded to https://github.com/enjoy-digital/liteeth/issues/38. Even with with_hw_init_reset = false the Ethernet core still requires the rst_n pad and still drives it. Is that expected?
<Skip> I tested with a current liteeth, but I didn't update anything else. Perhaps that's part of the problem?
<somlo> _florent_: besides the possibly duplicated `busy_wait_us()`, that patch does make it work for me (nexys4ddr, rocket)
st-gourichon-fid has quit [Ping timeout: 240 seconds]
st-gourichon-fid has joined #litex
st-gourichon-fid has quit [Ping timeout: 272 seconds]
Skip has quit [Remote host closed the connection]
Skip has joined #litex
<benh_> _florent_: somlo another "issue" is normally on power, the first 0x4000 of memory are exception vectors...
<benh_> something we need to "fix" if we ever going to have Linux working, we'll need DRAM at 0
<benh_> and "ideally" we need to keep that space free for vector in the bios in case it takes interrupts
<benh_> on "standalone" microwatt I have a control bit SW can use to select whether DRAM or block RAM is down at 0 but for flash, I'm thinking of adding a microwatt specific extension to allow the core to find its exceptions at f* instead of 0 during boot
<zyp> does it matter whether it's DRAM or block ram at 0 as long as it's writable?
<benh_> in theory no, but it would need to be more than 8K for Linux I think
<benh_> and it would force us to use CONFIG_RELOCATABLE which is unfortunate
<benh_> The kernel on powerpc likes just sitting at 0 and having RAM onwards from there
<benh_> it *can* run from elsewhere but it's a bit more messy (and includes some runtime overhead)
<zyp> okay, fair, I'm used to thinking from a bare metal perspective where things are a bit more flexible in regards to what goes where
<somlo> benh_: you can have a custom memory map for your CPU; Rocket wants the first 0x10000000 for its own "internal" SoC (the plic, and other stuff defined in chisel)
<zyp> I guess it should be easy enough to tell litex to put dram at 0
<tpb> Title: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com)
<somlo> so on Rocket the init address is 0x10000000, as far as LiteX is concerned, and I make sure to compile Rocket to jump there after it's done with its own internal initialization
<benh_> right, I don't think it's hard, I was just thinking out loud :-)
<benh_> we might need some trickery if we want to have sane exception vectors while running from BIOS before the OS boots
<zyp> by the way, how well does litex support memory maps >4G currently?
<zyp> the ecp5 board I'm working on got a sodimm socket that you can put an 8GB stick into (or 16GB if you can find one)
<somlo> zyp: I moved main_ram to 0x80000000 with nothing else above it so that RAM can grow contiguously with the availability of larger amounts
<somlo> but I never had access to anything with more than 1G (the trellisboard), so what would *actually* happen is untested, afaik
<somlo> to be precise, I moved main_ram to 0x80000000 for *Rocket*
<zyp> will be fun to see when I finish the board :)
<somlo> _florent_, keesj: on rocket it works fine even with the `flush_cpu_dcache()` call
<somlo> I'm wondering if on some CPUs the sdcard read/write sram buffers are marked cacheable, and then whatever hardware writes to them gets ignored by the CPU?
<somlo> * even *without* the `flush_cpu_dcache()` call (i.e., with that line commented out)
<somlo> getting tired of staring at this monitor, gotta go through my evening shut-down routine, catch y'all tomorrow :)
<benh_> somlo: I could support up to 52 bits of physical address with microwatt :)
<somlo> benh_: I'm fairly certain I can have > 32 on Rocket as well, I'm just too lazy to think about it in the absence of a board I can test on :)