Friday, 2022-05-20

*** tpb <[email protected]> has joined #litex00:00
swetlandaaand TX is happy too.  And etherbone is working now.00:03
jevinskie[m]:) that is a weird trick. What made you try that??00:04
swetlandwell the crc error register ticked up on almost every inbound packet, only a few surviving.  made me think the clock was badly aligned00:05
swetlandsome of the fancier phys have a clock offset parameter but not this one00:05
swetlandso by flipping the 0, 1 in the ddrout to 1,0, the clock shifts by half its cycle00:05
jevinskie[m]ah, but of course! nice :)00:06
swetlandand it would appear that is sufficient to line up with the rx data reliably (flood pinged the device, dumping rx info in a little test program and it seemed to keep up ok w/ no errors)00:06
swetlandbig question is, can we parameterize this so I can avoid having local hacky patches -- question for _florent_ I suppose00:07
* swetland apologizes in advance for inflicting more workaround for more weirdly broken hardware on people...00:07
swetlandupshot is litex_server/litex_cli is also happily chattering with the board via etherbone00:08
swetlandhmm. both these etherbone docs mention FEC for UDP but neither specifies an implementation00:18
jevinskie[m]I haven't seen it implemented/used00:48
swetlandI guess most of the time on modern switched ethernet on a local link without heavy congestion the chances of dropped or corrupt packets are pretty low01:02
shorne_hello, is there still any effort/will to get litex SoC's into qemu?01:21
shorne_I am working on adding some stuff for openRISC, and thinking maybe also it would not be too hard to get the litex devices in01:22
shorne_I guess the concern before was that litex soc's could be reconfigured and change and qemu want's their hardware definitions to be static.  But I think the board configs are more stable now01:25
swetlandshorne_: I've been adding a few peripherals for a RV32 target in qemu.  haven't tried pushing them upstream yet01:56
swetlandwork in progress over here: https://github.com/swetland/qemu/commits/litex01:57
swetlandhave chatted a bit with _florent_ and mithro about stable CSR/IRQ base addresses.  Not sure if there's agreement on exactly how to approach that yet01:58
swetlandfor now I have a local patch that keeps CSRs on my fpga target from moving around unexpectedly01:58
jevinskie[m]Can’t qemu parse DTS? I wonder if that’s a path forward02:14
swetlandugh. 02:18
swetlandIf you want to pitch that to the Qemu people you'll need to find someone who doesn't hate DTS to do it, which rules me out. ^^02:20
swetlandI gather even trying to get them to agree on "having a runtime configuration language" to set things up has failed multiple times in the past...02:21
jevinskie[m]Oh, that’s disappointing. I come from Apple-dom and as a hobbies Zephyr user so devicetree is natural to me :P02:25
swetlandI consider it a really horrific piece of technical debt foisted off on us from open firmware02:26
swetlandstring matching is error prone and clunky.  the data payload typing is basically all by convention, not any actual reliably parsed type indicators, etc, etc02:26
swetlandevery time I'm forced to deal with it, the results are entire afternoons wasted debugging shit that would have Just Worked if we were still using board files02:27
swetlandso, no, not a fan02:27
shorne_jevinskie[m]: well, qemu can also generate dts, so as long as the qemu target stays the same and the CSRs inside the decive don't move around it should be ok02:33
shorne_The goal would be able to have a kernel that can boot on both qemu and litex, so we can test litex software/drivers02:36
swetlandyeah from the standpoint of "can I run the same kernel on qemu-litex and some-fpga-litex", both can provide you with DTS and then at least as long as the specific registers within a CSR bank don't move around, you should be okay02:36
shorne_yeah, thats my thought, so the issue of litex changing memory maps is not really an issue with qemu02:37
swetlandand I think that's desirable anyway since code is going to upstream linux, zephyr, etc -- needlessly breaking existing drivers by rearranging CSRs within a bank or bits within individual registers feels counterproductive02:37
shorne_as of now, we have litemmc, liteeth, liteuart upstream in the kernel, so as long as those don't change I think we can build a qemu hw/02:38
shorne_yup02:38
swetlandmithro has a spreadsheet tracking driver/emulation support: https://docs.google.com/spreadsheets/d/1XTHfdYXuvwoYdPXm4M6qDA0D2fZCPy220-9q6qZpTw4/02:39
tpbTitle: LiteX Soft-CPU, FPGA and Firmware Support - Google Tabellen (at docs.google.com)02:39
swetlandnow that I'm getting liteeth going on the hardware I'll probably end up doing a qemu implementation of that as well02:40
shorne_cool, better tick of lite_eth and lite_mmc drivers as upstrea in linux there02:41
shorne_I thought liteeth was done on the qemu side...02:41
shorne_https://github.com/timvideos/qemu-litex/blob/master/hw/net/liteeth.c02:45
shorne_wow from 201802:46
shorne_swetland: ^ thats the liteeth implementation in qemu02:46
shorne_there are other devices available too02:46
swetlandyeah. though it's from 2018 qemu... and 2018 litex02:47
swetlandstill useful, but probably needs a little adjusting for qemu 7.0.002:47
shorne_thats right02:48
*** Degi_ <[email protected]> has joined #litex03:47
*** Degi <[email protected]> has quit IRC (Ping timeout: 260 seconds)03:47
*** Degi_ is now known as Degi03:47
shenkihere's a model that will work with the upstream liteeth: https://github.com/legoater/qemu/commit/f22427c91b644bbe3dbcdf1c287ec5ec9c3c63ec05:58
shenkiwe can submit it i guess. it never went up as we didn't submit the microwatt machine05:58
shenkihttps://github.com/legoater/qemu/commits/ppc-microwatt05:59
shenkiswetland: what's your email address?06:12
swetland[email protected]06:20
*** FabM <[email protected]> has joined #litex06:59
shenkithanks06:59
shenkihttps://lore.kernel.org/qemu-devel/[email protected]/06:59
tpbTitle: [PATCH] hw/net: Add LiteEth model - Joel Stanley (at lore.kernel.org)06:59
shenkii'm not sure what the qemu reviewers will say about merging a model without a machine that uses it06:59
shenkibut at least it's more discoverable on the mailing list than in a random git branch 07:00
cr1901_florent_: Could you answer this when you get the chance? https://libera.irclog.whitequark.org/litex/2022-05-19#32271802;07:00
tpbTitle: #litex on 2022-05-19 — irc logs at libera.irclog.whitequark.org (at libera.irclog.whitequark.org)07:00
cr1901I didn't see it in the scrollback07:00
shorne_shenki: wow, just got the mail, didn't realize you did a separate implementation, it looks more clean, ill have to review07:15
shorne_I am working on an openrisc virt board now, it was kind of on my todo for fun projects07:16
shorne_but as I was doing it I was wondering why we can't do a litex board, now that qemu can jsut generated the DTS for the kernel07:17
swetlandI've got a very simple litex machine model I've been using, mostly with the aim of being as close a match to the litex setup I have on a ECP5 fpga board07:22
swetlandshenki: thanks for the cc!07:22
_florent_not really able to contribute, but that's great to see the qemu efforts! Good support would be really nice and would complement the verilator simulations + tests on hardware.08:36
_florent_cr1901: sorry, forgot to answer, litevideo and opentitan are no longer installed with LiteX no; litevideo can still be used but is no longer maintained (would need to be fully re-written) and for Video Out we now have a simple core directly integrated in LiteX; opentitan was install for ibex, but we switched to the ibex repo directly.08:37
swetland_florent_: opinions on clock skew hackery for liteeth/phy/rmii.py ?08:38
swetlandI was getting 90+% crc errors on rx on the muselab board w/ waveshare module08:39
swetlandthe cheesy trick of swapping 0 and 1 here fixes rx for me: self.specials += DDROutput(0, 1, clock_pads.ref_clk, ClockSignal("eth_tx"))08:39
swetland(all the hardware I try to use with litex appears to be cursed in some way)08:39
_florent_swetland: lol, hoping we won't have to put workaround everywhere for all the combinations of cursed hardware you are using :)08:42
_florent_I would need to have a closer look, I never had trouble with the current setting, but I should have a closer look to see if it's optimal or not08:44
_florent_we could eventually add a parameter to configure the clk phase.08:44
swetlandwell the good news is I'm running out of Litex peripherals to discover bad interactions with!  Though I haven't fully put spiflash and sdcard through their paces yet...08:51
swetlandone piece of information: my waveshare board is *not* LAN8720A.  It's DP83848 (https://www.ti.com/product/DP83848-EP)08:52
_florent_swetland: OK, I have to add a LAN8720A RMII module to one project in a couple of days. While doing so, I'll look at the LAN8720A/DP83848 datasheets12:10
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Quit: Leaving)14:36
*** cr1901 <cr1901!~cr1901@2601:8d:8600:911:10e1:b51c:4acf:914d> has quit IRC (Read error: Connection reset by peer)17:03
*** cr1901 <cr1901!~cr1901@2601:8d:8600:911:8db5:5914:188d:d12d> has joined #litex17:44
*** linearcannon <linearcannon!~linear_ca@2600:1700:4090:5fe0:2d1d:4cb2:2dc2:a05f> has joined #litex18:38
*** linear_cannon <linear_cannon!~linear_ca@2600:1700:4090:5fe0:b569:c5ef:a9d6:a48d> has quit IRC (Ping timeout: 248 seconds)18:38
*** linear_cannon <linear_cannon!~linear_ca@2600:1700:4090:5fe0::3d> has joined #litex18:54
*** linearcannon <linearcannon!~linear_ca@2600:1700:4090:5fe0:2d1d:4cb2:2dc2:a05f> has quit IRC (Ping timeout: 260 seconds)18:56
swetland_florent_: Thanks!  I've got a batch of LAN8720A RMII pmods arriving from JLCPCB next week so it'll be interesting to see if they work as-is or need trickery.20:58
swetlandAlso, I guess I'll want to add a commandline option to select between the waveshare and pmod (different pinouts) https://twitter.com/dnaltews/status/152622549258340352321:00

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