Tuesday, 2021-09-14

*** tpb <[email protected]> has joined #litex00:00
*** shenki <[email protected]> has quit IRC (Ping timeout: 250 seconds)00:56
*** shenki <[email protected]> has joined #litex00:57
*** Coldberg <[email protected]> has quit IRC (Ping timeout: 268 seconds)01:36
jevinskie[m]Any idea why I’m only getting a 25 MHz rx clock and no activity on tx clk with an 88e1111 PHY (intel max10 dev kit) even after turning off autoneg and setting 100 mode manually via mdio (and resetting plenty). The data shows up fine on RX as well02:25
jevinskie[m]Link status also shows as up via MDIO02:26
jevinskie[m]Verified with both litescope on the clocks themselves (from eth’s crg submod) and via counters02:28
*** alainlou <[email protected]> has quit IRC (Quit: Client closed)02:54
*** alainlou <[email protected]> has joined #litex03:00
*** alainlou <[email protected]> has quit IRC (Ping timeout: 256 seconds)03:15
jevinskie[m]I ported libliteeth’s MDIO commands to remoteclient so you don’t need a soft core. It’s slow but it works :) https://gist.github.com/jevinskie/426b28c43cf6e2b74faa2beac710026b03:26
*** Degi_ <[email protected]> has joined #litex03:48
*** Degi <[email protected]> has quit IRC (Ping timeout: 252 seconds)03:48
*** Degi_ is now known as Degi03:48
*** FabM <FabM!~FabM@2a03:d604:103:600:6f7c:26b8:c7ea:7b6f> has joined #litex04:39
*** shenki <[email protected]> has quit IRC (Ping timeout: 268 seconds)04:41
*** shenki <[email protected]> has joined #litex04:42
*** shenki <[email protected]> has quit IRC (Ping timeout: 268 seconds)05:10
*** shenki <[email protected]> has joined #litex05:10
*** shenki <[email protected]> has quit IRC (Ping timeout: 260 seconds)05:29
*** shenki <[email protected]> has joined #litex05:29
jevinskie[m]Doh, I bet I know what it is. Found out Rx clk is derived from the incoming eth signals by the phy but the tx clk from the phy is derived from a 25 MHz clock I’m not feeding it (:06:28
jevinskie[m]Crap, it’s fed by a silabs clock gen, not the fpga.06:41
Melkhiorsajattack[m]: if the buldroot is too big, you need to change the memory map loaded at boot so that there's enough space for it07:04
sajattack[m]Oh yeah07:04
sajattack[m]I thought the buildroot was the last thing loaded though07:05
sajattack[m]ie it could fill the rest of ram07:05
*** nickoe <[email protected]> has quit IRC (Ping timeout: 252 seconds)07:06
jevinskie[m]Hmm, 25 MHz is documented as a default output of the silabs clock gen. If MDIO works fine, it has to be getting a clock, right?07:06
Melkhiorin the json it is, but something somewhere (sorry, machine with the code is off) in the Litex source codes is pointing Linux at the memory it can use07:06
*** michalsieron <[email protected]> has joined #litex07:07
Melkhiorso if rootf is is at 0x41000000 and linux uses from 0x42000000, you can only fit 16 MiB of FS before running into trouble07:07
sajattack[m]Aha07:08
Melkhiorhttps://github.com/enjoy-digital/litex/blob/694878a35a2f792ad195ff9c585d689467a76b1d/litex/tools/litex_json2dts_linux.py#L35-L3907:12
Melkhiorhttps://github.com/enjoy-digital/litex/blob/694878a35a2f792ad195ff9c585d689467a76b1d/litex/tools/litex_json2dts_linux.py#L63007:13
MelkhiorMight be just that07:13
_florent_jevinskie[m]: IIRC the 88e1111 has a GMII interface in 1Gbps mode, MII interface in 100Mbps mode and the clocking is different between these modes: https://github.com/enjoy-digital/liteeth/blob/master/liteeth/phy/gmii.py#L64-L6507:16
_florent_I think the KC705 uses this PHY, this could be worth comparing your hardware/code vs this board/target07:17
*** michalsieron <[email protected]> has quit IRC (Remote host closed the connection)07:23
*** michalsieron <[email protected]> has joined #litex07:23
*** michalsieron <[email protected]> has quit IRC (Remote host closed the connection)07:26
jevinskie[m]Yes I’m trying to use it in 100/mii mode and I’m instantiating a mii phy (I also have gtx commented out). Thanks I’ll take a look at that board07:44
jevinskie[m]Also not generating the 125 MHz clock on gtx regardless of if I’m passing it to the phy07:45
jevinskie[m]BTW, florent, litex’s CSRs, *bone bridges and litex_server are so fantastic, it feels like I have superpowers :P07:49
_florent_jevinskie[m]: Thanks, this indeed allow you to control/observe things in the FPGA with the confort of your traditional dev environment/tools :) I'm using it a lot to design new cores/peripherals and later to investigate issues on hardware.08:07
*** TMM_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)08:30
*** TMM_ <[email protected]> has joined #litex08:30
*** shenki <[email protected]> has quit IRC (Ping timeout: 268 seconds)08:44
*** shenki <[email protected]> has joined #litex08:44
*** shenki <[email protected]> has quit IRC (Ping timeout: 260 seconds)09:14
*** shenki <[email protected]> has joined #litex09:14
*** pauluzs <pauluzs!~Pauluzs@2a02:a461:635a:1:fd13:bd3:d77e:168d> has quit IRC (Ping timeout: 260 seconds)09:32
*** pauluzs <pauluzs!~Pauluzs@2a02:a461:635a:1:93e1:a4f6:f446:ce02> has joined #litex09:44
shenkii'm attempting to boot linux on vexriscv. I've built myself a soc and have grabbed the prebuilt linux/opensbi/rootfs, which I'm loading over ethernet09:50
shenkiit jumps to the payload and I don't see any output09:50
shenkiare there issues with using the prebuilt opensbi and litex master?09:50
shenkii built the soc from litex-boards:09:52
shenkilitex_boards/targets/digilent_arty.py --output-dir build/arty-vexriscv --cpu-type vexriscv_smp --cpu-variant=linux --with-ethernet --variant a7-100 --csr-json build/arty-vexriscv/system.json  --build --load09:52
_florent_shenki: it's probably related the a specific CSR/Interrupt/Mem Mapping: https://github.com/litex-hub/linux-on-litex-vexriscv/blob/master/soc_linux.py#L56-L6909:55
_florent_we should indeed allow building it directly from LiteX-Boards, but this is probably not yet supported09:56
_florent_can you try to re-integrate this mapping in the digilent_arty target and see if it improves things?09:56
*** shenki <[email protected]> has quit IRC (Ping timeout: 268 seconds)10:06
*** shenki <[email protected]> has joined #litex10:07
shenki_florent_: to fix it, I need to build a opensbi against my generated soc?10:45
*** pauluzs <pauluzs!~Pauluzs@2a02:a461:635a:1:93e1:a4f6:f446:ce02> has quit IRC (Quit: Leaving)10:57
_florent_shenki: if you don't use soc_linux's mapping, updating opensbi's CSR mapping should indeed work11:11
*** indy <[email protected]> has quit IRC (Ping timeout: 245 seconds)11:50
*** indy <[email protected]> has joined #litex11:51
*** TMM_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)12:06
*** TMM_ <[email protected]> has joined #litex12:06
shenkithanks, I updated the uart base address in opensbi and then I got it working13:12
shenkimy device tree wasn't correct, so I couldn't see the early printk messages without sbi console working13:12
shenkiif not for that i might have booted straight through with the prebuilt opensbi13:13
shenkii'm now trying to build a kernel from upstream. it's not doing much; no output after opensbi13:25
*** cr1901 <cr1901!~William@2601:8d:8600:911:d12a:5ac6:c44f:6445> has quit IRC (Ping timeout: 252 seconds)14:03
geertushenki: You need to build a kernel from litex-hub/linux#linux-rebase14:15
sajattack[m]lmao https://hastebin.com/ayuradehap.yaml14:55
tpbTitle: hastebin (at hastebin.com)14:55
sajattack[m]do I need to define a custom linker script to define my memory regions?14:58
sajattack[m]scientific progress goes boink https://hastebin.com/jusenepehu.properties15:28
tpbTitle: hastebin (at hastebin.com)15:28
sajattack[m]does this mean I need to not use ilp32d?15:28
*** _franck_0 <[email protected]> has joined #litex15:49
*** _franck_ <[email protected]> has quit IRC (Ping timeout: 268 seconds)15:51
*** _franck_0 is now known as _franck_15:51
*** _franck_5 <[email protected]> has joined #litex15:55
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Quit: Leaving)15:55
*** Martoni42 <Martoni42!~Martoni@2a03:d604:103:600:2ad2:44ff:fe23:2f72> has joined #litex15:56
*** _franck_ <[email protected]> has quit IRC (Ping timeout: 265 seconds)15:57
*** _franck_5 is now known as _franck_15:57
Melkhiorsajattack[m]: ilp32d requires support in the entire system - kernel, buildroot, compiler, binutils, gdb, ... (and likely run on RV32G)16:21
Melkhiorthat's what I use, so it is usable :-)16:21
sajattack[m]ok16:24
*** msh <[email protected]> has quit IRC (Read error: Connection reset by peer)16:43
*** msh <[email protected]> has joined #litex16:43
*** cr1901 <cr1901!~William@2601:8d:8600:911:70fb:6a50:fd5:35b3> has joined #litex18:04
*** Martoni42 <Martoni42!~Martoni@2a03:d604:103:600:2ad2:44ff:fe23:2f72> has quit IRC (Ping timeout: 268 seconds)19:00
tpw_rulesis there good documentation on the litex ecosystem anywhere? i am trying to get a crossover uart running and it compiles now, but i don't know what to do from there19:09
tpw_rulesand i'm really mystified in general about how everything works and i'm not usre hwo to learn more19:12
tpw_rulessure how*19:12
_florent_tpw_rules: this can be useful to understand the bridges: https://github.com/enjoy-digital/litex/wiki/Use-Host-Bridge-to-control-debug-a-SoC19:25
shorneshenki: are you perhaps trying to test the .dts kernel params?20:31
somloanyone have (a pointer to) an explanation of what additional initialization magic happens for vexriscv_smp in addition to what is done for the single-core case? I think the relevant diff is this: http://hastebin.com/ixademekoy.diff21:08
tpbTitle: hastebin (at hastebin.com)21:08
somlolooks like hart #0 goes straight to bss_init, everyone else spins in an smp_slave loop, then everyone (?) eventually jumps to the address in smp_lottery_target?21:10
somloexcept in line #68-69 of the diff we no longer enable external interrupt sources (like we used to for single-core), wondering why that's not a problem :)21:10
somloAnyway, if there's a write-up somewhere on what the moving parts (and choreography) actually look like, I'd much appreciate the link...21:11
shornesomlo: I don't have a write up but I went through it when I did the SMP upstreaming work for openrisc , I did a presentation on it https://elinux.org/images/2/2b/Openrisc_smp_2017.pdf21:17
shornebut that doesn't discuss the CPU booting handoff21:17
shorneI think it is a bit generic though... 21:17
shornein Openrisc we just sit and wait for secondary_release flag: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/openrisc/kernel/head.S?h=v5.15-rc1#n71321:20
tpbTitle: head.S « kernel « openrisc « arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org)21:20
*** nickoe <[email protected]> has joined #litex21:21
shorneThe secondary_release is triggered by (__cpu_up) in smp.c (should be the same on RISC-V)21:22
shorneWhen the secondary cpu's get releases the finish setup and jump to secondary_start_kernel.  Which boots them then marks them as enabled in the kernel bookkeeping.21:25
somloshorne: thanks! In the mean time I also found this: https://www.sifive.com/blog/all-aboard-part-6-booting-a-risc-v-linux-kernel21:26
somlowhich suggests that basically all harts but 0 are looping until boot_helper() is ready to jump into linux (or bbl, or whatever was loaded into RAM by the BIOS)21:26
shorneNice, the bits in OpenRISC might be more simple, but it should help understand how the secondary cores get released.21:26
shorneFor openrisc all cores boot up to ram address 0x100, the program code is the same for each for they check their COREID, CORE-0 goes ahead and all others wait.21:28
somlothe only weird think is that for single-core external interrupts are enabled right before calling the bios main() function, but that's *NOT* the case on smp, which feels weird to me...21:28
shornewell, for RISC-V I remember one thing.  There is this thing called IPI21:28
shorneinter process interrups, which are used to send messages between cores21:29
somlothat's a thing on x86 as well, iirc21:29
shornethat is how IRQ balancing is handled too, i.e. CPU0 may say, hey CPU1 can you take over hanlding IRQ 23 now? and the masking is moved from CPU0 to CPU121:29
shorneFor OpenRISC and most architectures we do IPI with external interrupts21:30
somlonot sure how it applies here, but worth following up... I'll have a look at your slides as well, maybe after staring at everything for a few iterations something will end up making sense :)21:30
shornefor RISC-V, they do IPI via the SBI21:30
shorneso maybe they don't need external itnerrupts enabled21:30
somlofor context, I've built a multicore Rocket (4 fpu-less cores fit on e.g. a nexys4ddr), and I'm trying to get it to load the bios (right now I'm getting crickets on the console)21:31
sorearthe problem with "all cores enter the kernel at once" is that it requires all of your bootloader stages to be SMP-aware21:31
somloand I think step #1 is updating crt0.S...21:31
shornesomlo: not sure if you caught it is my thought is the on RISC-V because they do IPI via the SBI instructions they don't need external interrupts enabled.  They will be enabled when IRQ balancing happens by the kernel later.21:33
somloI *think* BBL is, but I haven't made it that far yet -- getting no output on the console from LiteX bios (no big surprise there) which is why my first step was to diff the uni-vs-multi core vexriscv crt0.S files :)21:33
shorneor by irqbalancer21:33
shorneBut in terms of the console, its usually handled by CPU0 until it gets handed over later with irq smp_affinity changes21:34
shornesomlo: did you see my recent changes for json2dts?21:34
somloI know Rocket has a built in PLIC, whereas vexriscv is a bit different in terms of how irq handling is done21:35
sorearBBL is but (if memory serves) u-boot isn't and requires the use of a spintable instead21:35
shorneOne change I did is change bootparams: earlycon=sbi to earlycon=liteuart,0x{:x}21:36
somloshorne: I saw them "fly by", didn't look too closely :)21:36
shornehttps://github.com/enjoy-digital/litex/pull/1032/files21:36
somloI did try both of those in the dts I compile into BBL, (earlicon sbi vs. directly liteuart) -- both seem to work 21:37
somlothe latter is probably cheaper (saves a trap into m-mode to have bbl handle it there)21:37
shorneI see, in terms of litex bios having issues its not going to be related to the linux console settings21:37
somloshorne: I don't get the litex logo and memtest output, way before I'd ever jump into anything loaded from "media" (like bbl, or the kernel, or anything like that)21:38
somloso my multiple cores seem to be tripping over each other due to a single-core-only crt0.S in soc/cores/cpu/rocket/21:39
somloI'll probably hit another brick wall once the built-in bios loads and I try to boot something, but that's a bridge I'll have to cross later :)21:39
somlosorry, mixing a bunch of cheesy metaphors :D21:40
shorneI see, yeah you will need the bootloader / pre kernel stuff understand SMP too21:42
shornehaha you'll be able to Wrangle this issue21:43
*** alainlou <[email protected]> has joined #litex21:55
alainlouEE majors! Why would adding header cables to the address bus solve any problems? (full details of my question here: https://github.com/litex-hub/litex-boards/issues/253#issuecomment-917727037)22:02
*** geertu <[email protected]> has quit IRC (Ping timeout: 252 seconds)23:03
*** geertu <[email protected]> has joined #litex23:20

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