Wednesday, 2017-12-13

*** tpb has joined #timvideos00:00
*** CarlFK has joined #timvideos00:33
*** ChanServ sets mode: +v CarlFK00:33
*** FelixVi has quit IRC01:23
shenkiLinux buildroot 4.15.0-rc3-next-20171212-00012-ga2920d64bd9e #6 Wed Dec 13 14:02:59 Ax03:40
shenkibleeding edge03:40
shenkimithro: do we have a way to program the flash on the ARTY?04:10
shenkiI'd like to put the gateware on there04:10
*** rohitksingh_work has joined #timvideos04:12
mithroMake flash should work04:18
shenkimithro: okay04:19
shenkimithro: i forward-ported the 'make litex boot' stuff to linux-next04:19
shenkimithro: and seperated out the litex uart assembly changes from the rest04:19
shenkimithro: did you find the email where you explained what the other changes are for?04:20
shenkiError: Unknown flash device (ID 0x00ffffff)04:22
shenki$ openocd --version04:38
shenkiOpen On-Chip Debugger 0.10.0+dev-00219-geb26a884e-dirty (2017-12-11-07:14)04:38
shenkimmm -dirty04:38
*** thaytan has quit IRC04:46
shenki_florent_: have you had any success programing an atrix with openocd?04:55
*** FelixVi has joined #timvideos05:10
*** thaytan has joined #timvideos05:12
*** ChanServ sets mode: +v thaytan05:13
shenkii used vivado to program my board. it would be good to get openocd working though05:13
*** FelixVi has quit IRC05:13
*** msantana has quit IRC05:15
*** FelixVi has joined #timvideos05:16
*** msantana has joined #timvideos05:18
*** cr1901_modern has quit IRC05:43
*** cr1901_modern has joined #timvideos05:45
*** CarlFK has quit IRC05:45
mithroshenki: I'm pretty sure OpenOCD does work but don't have time now to look into it05:52
mithroshenki: "early_printk working on actual hardware!" has some explanation on the patches05:52
mithroshenki: The major patch needed apart from drivers to make LiteX work is support for EVBAR in head.S this is complicated by the fact we can't touch anything at the time we need to stash it -- currently I use a hack to stash EVBAR into r0 which the ABI says should be set to zero. See
tpbTitle: Fix the register clobbering. · mithro/[email protected] · GitHub (at
mithro - enabling printing of exceptions with litex-uart05:54
mithro - relating to the evbar setup05:54
mithro - mmu hacking05:54
mithro - some save/restoring of registers, I think this is so we preserve the evbar state?05:54
shenkiokay. so you take advantage of the fact that the load/store GPR macros use offsets from r0 in order to load/store their values relative to evbar05:55
mithroNot sure - it was a long time ago...05:55
mithroI think I was just using r0 as a know register which didn't any user data05:56
shenkiyou wrap the macros EXCEPTION_T_STORE_GPR30 in a _SETUP/_CLEAR macro05:56
shenkiand those EXCEPTION_T_STORE_GPRX macros do "l.sw    0x78(r0),r30"05:57
mithrobecause if we try to push / pop EVBAR anything off the stack we can hit a second fault05:57
shenkithat's a load r30 into r0+0x78, yeha?05:57
mithroshenki: Can you link me to the code - I can't recall from memory :-P06:02
shenkiyou just linked me to it :)06:04
tpbTitle: Fix the register clobbering. · mithro/[email protected] · GitHub (at
shenkierr, that didn't work06:05
shenkiline 6206:05
shenkiyour SETUP macro does a load from the EVBAR special register into zero06:05
mithro+#define TEMPORARY_SETUPl.mfsprr0,r0,SPR_EVBAR06:06
shenkiand then on line eg. 96 you can see what the GPR load/store does06:06
shenki#define EXCEPTION_STORE_GPR9l.sw    0x10(r0),r906:06
shenki#define EXCEPTION_LOAD_GPR9l.lwz   r9,0x10(r0)06:06
shenki#define EXCEPTION_STORE_GPR9      l.sw    0x10(r0),r906:06
shenki#define EXCEPTION_LOAD_GPR9       l.lwz   r9,0x10(r0)06:06
shenkithat's load r9 into 0x10 + r0, and store r9 into 0x10 + r0?06:07
mithro#define EXCEPTION_T_STORE_GPR30l.sw    0x78(r0),r3006:07
mithroI think you are right06:08
shenkiwe could change the kernel ABI to use one of the GPRs to always have the value of the EVBAR in it06:08
shenkishorne might have other ideas on how to solve the problem06:09
mithroIt was a temporary hack until a better solution was found06:09
shenkiit did the trick06:10
shenkikeen to get it sorted this week, so we can get the patches ready before christmas06:10
mithroI feel like there is something about setting EVBAR...06:11
mithroI don't know why I do the setup clear after a bunch of loads...06:12
shenkiyou need to make sure r0 contains zero for the rest of the code06:13
mithroI think there is some interaction between hitting a page boundary while stack pushing/poping...06:13
shenkimithro: the bit on line 900ish is different to the register saving stuff. do you recall what that was about?06:21
mithroshenki: I'm pretty sure that by fixing the tovirt/__ava macros those lines are not needed any more06:22
shenkiokay. you don't use the tovirt macro anywhere :)06:23
mithroshenki: Other macros do I believe06:23
shenkii grepped the source tree, there's no users06:23
shenkiyou did change tophys, so perhaps that was enough to fix that code?06:24
mithroshenki: I seem to recall it's obfuscated in some way...06:24
shenkiokay. it still builds and boots when they are deleted06:25
mithroNFI then...06:25
shenkiin the version of the patches i've been using, the LOAD_SYMBOL_2_GPR(r6,CSR_REGION_START) code is commented out06:25
shenkioh. that code is making it so the virtual address space == physical for the first chunk of memory06:27
shenkiwhich is where head.S does all of it's storing of stuff06:28
shenkii wonder if you were trying to make that cover EVBAR and up instead?06:28
*** FelixVi has quit IRC06:34
shenkiif i revert it back to upstream the kernel boots06:35
*** CarlFK has joined #timvideos07:09
*** ChanServ sets mode: +v CarlFK07:09
shenkihere's my kernel source tree if anyone wants to try out networking:
tpbTitle: GitHub - shenki/linux at litex/litex-4.15 (at
shenkii can't get dhcp or ssh to work. but ping and tftp do work07:34
*** cr1901_modern has quit IRC08:50
*** cr1901_modern has joined #timvideos10:20
_florent_shenki: yes i got openocd working with artix7, i'll try to find that later11:15
shenki_florent_: cheers11:43
*** tsglove has joined #timvideos11:48
shornemithro: shenki: I am not to sure what you are looking at without reading more of the history12:31
shornesetting r0 to non zero is not good, also for litex case I think evbar can be set once are remain the same ?12:32
*** rohitksingh_work has quit IRC12:40
shenkiyeah. mithro's hacks are not to change evbar12:47
shenkibut to make sure that the laods/saves of GPRs are relative to EVBAR in head.S12:47
shenkii've tried to split the patches into different functional changes. it's still a bit rough12:48
tpbTitle: openrisc: Save GPRs releative to EVBAR · shenki/[email protected] · GitHub (at
*** mikal_ has quit IRC13:05
*** mikal has joined #timvideos13:07
*** rohitksingh has joined #timvideos13:41
*** rohitksingh has quit IRC14:27
*** rohitksingh has joined #timvideos14:30
cr1901_modernOkay, so XMODEM firmware upload is about to be merged in. I've confirmed that it works on my end; could someone else with a mimasv2 or opsis check out my branch (xfer-fw),14:45
cr1901_moderndo a full build, and confirm that upload works by attempting to upload the same firmware file?
tpbTitle: Add writable SPI flash and XMODEM xfer support by cr1901 · Pull Request #370 · timvideos/HDMI2USB-litex-firmware · GitHub (at
cr1901_modernI've provided two convenience scripts- and to automate the process. This requires you to have the "rz" package installed14:47
cr1901_modernTo build the XMODEM upload code requires meson b/c the code is provided as a submodule14:47
cr1901_modernOf of course travis is gonna fail14:52
cr1901_modernIt has no concept of meson.py14:52
cr1901_modernmithro: I presume you want me to take care of fixing travis :P?14:55
*** abhas has joined #timvideos15:54
cr1901_modernmithro: The Ubuntu version used for trusty is too old to have a meson package. I'm not sure how to proceed.16:24
cr1901_modernIs python provided by default in the CI environment?16:24
*** danielki has joined #timvideos16:31
danielkihi guys16:31
danielkiso I finally managed to flash our opsis using prebuilt firmware16:32
danielkinow how do I switch the thing back to operational mode?16:32
danielki"hdmi2usb-mode-switch --mode operational" says it's not implemented16:32
danielkipower cycling always gets me into jtag mode16:35
felix_shenki: i'm not sure if the arty uses the digilent-hs1 or the digilent hs-2 programmer; if it's the hs1 variant this should work: openocd -f board/kc705.cfg -c init -c "pld load 0 bitstream.bit" -c exit16:49
danielkinever mind, I found the problem; a rogue ixo-usb-jtag.rules file16:49
felix_if it's the hs2 variant, you have to create a different board cfg file, but that's easy (maybe there is even some board cfg file with the right programmer)16:50
*** danielki has left #timvideos17:18
CarlFKmithro: docs17:28
CarlFKI would love to have a place to mention the rogue ixo-usb-jtag.rules file17:28
*** rohitksingh has quit IRC17:29
*** danielki has joined #timvideos18:15
*** danielki has left #timvideos18:15
*** [d__d] has quit IRC18:21
*** [d__d] has joined #timvideos18:23
*** abhas has quit IRC18:34
*** tsglove has quit IRC18:59
tpbTitle: Add MyStorm BlackIce I and II platforms by adamgreig · Pull Request #95 · m-labs/migen · GitHub (at
tpbTitle: GSoC Sydney Meetup (at
mithroCarlFK: Can we just add a check in mode-switch to remove it?19:55
cr1901_modernmithro: Why does navigating to throw up a fake Guru Meditation error?20:16
mithroGuru mediation error? Screenshot?20:17
tpbTitle: Imgur: The magic of the Internet (at
cr1901_modernLooks like a fake Guru Meditation to me20:19
mithroOh - that is just more the page you get on my webserver when a domain is not set up20:21
cr1901_modernIt's a nice touch... reminds me of an old obscure Amiga error :)20:25
* cr1901_modern has never own an Amiga20:25
CarlFK[m]mithro (IRC): I think I have seen one of your scripts detect it and suggest removing it.  but I wouldn't want anything to just do it.20:26
mithroCarlFK[m]: Sorry about not looking at the docs stuff yet, I'm pushing to get stuff released at work so things are hectic at the moment20:32
CarlFKmithro: if you will put a link to a wiki page I can edit, I'll fill it in there20:33
mithroCarlFK: Do you want to clean up this wiki? ->
tpbTitle: Home · timvideos/HDMI2USB Wiki · GitHub (at
CarlFKmithro: only if that URL is on this page
mithroI can do that20:34
mithroCarlFK: Can you go to the following for your pull request ->
tpbTitle: Allowing changes to a pull request branch created from a fork - User Documentation (at
CarlFKmithro:  "In the the right sidebar of your pull request, select Allow edits from maintainers"  I see the sidebar, I don't see anything like that option20:42
mithroCarlFK: On this page ->
tpbTitle: flash-gateware instructions by mithro · Pull Request #21 · timvideos/ · GitHub (at
CarlFKI can lock and now "Unlock conversation on this pull request"20:45
*** tpb has joined #timvideos20:49
cr1901_modernmithro: Do you have any suggestions to fix travis?20:53
tpbTitle: Flashing Firmware · timvideos/HDMI2USB Wiki · GitHub (at
mithroCarlFK: Keep refreshing for the next 5 minutes and it should update shortly...21:06
mithroCarlFK: Should be updated now....21:08
CarlFKmithro: If you are user, look at the ‘Flashing prebuilt firmware’ section.21:10
CarlFKthat is what i want to edit21:10
CarlFK  (thats ... odd.)21:11
mithroCarlFK: take a look now21:17
mithroCarlFK: Lots of links to the wiki21:22
CarlFK     If you are user, look at the ‘Flashing prebuilt firmware’ section.21:26
CarlFKoh, that goest hte21:26
CarlFKnever mind21:26
mithroCarlFK: all good?21:28
CarlFKyes - filling in that page now21:28
mithroCarlFK: can you also clean up the rest of that wiki too?21:30
CarlFKmithro: I was looking it over, not sure what needs cleaning up21:31
CarlFKand really, I want to get a handle up flashing so I can flash those 6? versions I listed somewhere21:31
CarlFKmithro:  xenial is the most supported/preferred distro, right ?21:32
mithro"hdmi2usb-mode-switch --flash-image image-gateware+bios+firmware.bin"21:33
CarlFKmithro: where is your script to dl ... um.. something21:41
tpbTitle: HDMI2USB-mode-switch/ at master · mithro/HDMI2USB-mode-switch · GitHub (at
mithroCarlFK: I would like that to be part of mode-switch and written in Python rather than the horrible shell script...21:42
mithroCarlFK: The two Linux distros I use at the moment are --  (a) Ubuntu Trusty Tahr and (b) Debian Testing (rolling release)22:43
mithroCarlFK: shorne uses Fedora and jimmo uses Arch22:44
CarlFKyou use trusty?22:44
CarlFKI thought there was some reason we couldn't.  hmm. lets see if my trusty installer still wroks22:45
mithroTrusty is mostly dead22:51
*** jea[m] has quit IRC22:58
*** jea[m] has joined #timvideos23:01
CarlFK[m]ah now I remember.. my automated installer segfaults trying to do dns lookups23:06
mithroI have acquired internet!23:07
mithroUpload is a bit slow :-(23:07
shenkifelix_: thanks! How do I discover what the programmer is?23:40
shenkifelix_: i thought it was just a ftdi chip that spoke jtag to the fpga23:41
shenkifelix_: and we need the correct FPGA bitstream loaded so it can then talk to the SPI flash23:41
felix_look at the output of lspci and then check the two programmer definition files in openocd23:52
felix_on how to use the proxy bitstream for flashing have a look at the comment at the end of the kc705 board config file23:52
felix_the command i wrote is just for loading the bitstream into the fpga and not for writing the flash23:52
tpbTitle: conda-hdmi2usb-packages/digilent-arty.patch at master · timvideos/conda-hdmi2usb-packages · GitHub (at
tpbTitle: HDMI2USB-litex-firmware/ at master · timvideos/HDMI2USB-litex-firmware · GitHub (at
felix_hmm, that's the same id as the digilent hs1 programmer, but the ftdi layout is different. weird23:54
mithroLast chance to sign up for FPGA Miniconf before I email everyone about it ->
tpbTitle: 2018 - Sydney 22-26 January 2018 (at
felix_oh, wait, i looked at the wrong file23:56
felix_the definitions in the arty file are just a copy of the definitions in the digilent hs1 cfg file23:56
felix_i'd include the digilent-hs1.cfg in the arty file instead23:57

Generated by 2.13.1 by Marius Gedminas - find it at!