Thursday, 2018-09-13

*** tpb has joined #timvideos00:00
cr1901_modernmithro: Are you gonna be around tonight?00:15
shornemithro: on litex qemu I see we map both CSR_SPIFLASH_BASE and SPIFLASH_BASE00:46
shorneit seems CSR_SPIFLASH_BASE is for the bit banged spi flash controller00:46
shornethen SPIFLASH_BASE is just for all of the flash contents00:46
shorneis SPIFLASH_BASE, the flash contents being available in memory, really how its available in hardware?  or is that just for debug?00:47
shornelooking at hardware00:48
cr1901_modernSPIFLASH_BASE is how the CPU should access flash memory00:51
cr1901_modernCSR_SPIFLASH_BASE is for bitbanging writes00:51
shornecr1901_modern: I am not sure I get how it works at the hardware level01:01
shorneI see something like01:01
shorneI would think all interactions would be through the CSR_SPIFLASH_BASE register01:02
shornehow the the CPU access as memory mapped data work?01:02
shorneso... bad typing do you know how it works?01:03
cr1901_modernshorne: All reads on the address bus that are within the region of SPIFLASH_BASE go to an SPI-flash gateware that converts the parallel address bus to the format the serial flash expects01:05
shorneoh... I see its in the gateware / hdl01:05
xobsUsually for that sort of thing you just mmap() the target file to SPIFLASH_BASE and be done with it.01:05
xobsIt's XIP stuff.01:06
xobsUnless you feel like emulating read delays and caching.01:06
cr1901_modernxobs: And I know plenty of ppl who would emulate delays and caching :)01:06
xobsExecute-In-Place.  Pointing the program counter directly at an offset in SPI, without first reading it into RAM and patching up offsets.01:07
shornexobs: when you say, "usually for that sort of thing..." you mean usually there is not a gateware?  and you just have the kernel drivers take care of making it look like it in memory bia mmap?01:09
xobsshorne: No, usually it's the hardware that takes care of it.01:09
xobsSo if you want to emulate it from a programmer's model, you'd do the same.01:10
shorneok, qemu is emulating it just fine It seems then01:11
shornexobs: I see you mean from programmers model perspective01:23
*** puck_ has quit IRC01:26
*** futarisIRCcloud has joined #timvideos01:29
*** puck_ has joined #timvideos01:30
mithrocr1901_modern: No, I'm at the RISC-V Meetup at the moment02:04
mithrotinyfpga: Did I ever who you ?02:05
tpbTitle: i2cslave/ at shift_register_complex · mithro/i2cslave · GitHub (at
mithrotinyfpga: Specifically the - makes me think of your jk tests :-P02:06
tpbTitle: i2cslave/ at shift_register_complex · mithro/i2cslave · GitHub (at
shorneok... I figured something out with the qemu arguments (regarding deprecation of drive,serial)02:14
shorneThey recomment using '-device' instead, problem is -device is not initialized until after litex platform is initialized02:15
shornemaybe '-device' is fine for things like ide drives, but not sure how we can do memory mapping ...02:17
CarlFKoh oh :p02:26
shorneCarlFK: yes, also serial was not even supposed to be used for a serial driver name, but more like the serial number of the ide drive02:46
shorneI have some ideas02:46
mithroshorne: I think that was just a hack :-P03:04
mithroBe back later03:05
CarlFKserial number?!!  LOL  that hilarious.03:11
shornemy idea is we can use a global arg, i.e. --global driver=litex_ssi,spiflash=m25p8003:27
shornemithro: thanks for confirming my suspision :)04:12
shorneHave created,
tpbTitle: qemu: Fix spiflash args as per deprecated args by stffrdhrn · Pull Request #57 · timvideos/litex-buildenv · GitHub (at
shornein the end, the spiflash driver name could also be coming from devicetree04:40
*** cr1901_modern has quit IRC04:42
*** cr1901_modern has joined #timvideos04:42
shorneCarlFK: would you like to try the patch?04:56
shorneFYI, after I patched qemu and ran ./scripts/ it didnt pick up my latest changes04:56
CarlFKshorne: coming up...04:58
CarlFKhow handy - still on my screen: qemu-system-or1k: -drive if=mtd,format=qcow2,file=build/arty_net_or1k//qemu.qcow2,serial=n25q128a13: Block format 'qcow2' does not support the option 'serial'05:00
CarlFKup-arrow enter and off it goes05:01
CarlFKno help...  does not support the option 'serial'05:01
shorneoh.. did you get my litex-buildenv patch?05:03
CarlFKoh, that's what was patched...05:03
CarlFKI was thinking qemu05:03
CarlFKqemu-system-or1k: can't apply global litex_ssi.spiflash=n25q128a13: Property '.spiflash' not found05:06
shorneyou have qemu patch too?05:06
CarlFKI think so, but that's assuming all that repo/branch/fetch code does what we think it dose...05:06
shorneI thought it would be ignored if the property was bad05:06
shorneyeah, ... that didnt work for me05:07
CarlFKlet me rm the qemu source and pull a new copy  - adds 20 seconds :p05:07
shorneI did05:07
shornecd third_party/qemu-litex/05:07
shornegit pull timvideos-qemu-litex litex05:07
shorne git log -n2 --oneline05:08
shorne92d6c11f7c (HEAD -> litex, timvideos-qemu-litex/litex) litex: Add support for specifying properties for litex_ssi05:08
shorneCarlFK: maybe I should patch the git stuff too05:08
xobsLet me jsut say: Litescope is so very cool.05:11
*** rohitksingh has joined #timvideos05:19
*** rohitksingh has joined #timvideos05:21
*** rohitksingh has quit IRC05:36
*** rohitksingh has joined #timvideos05:36
*** rohitksingh has quit IRC05:45
*** rohitksingh has joined #timvideos05:53
shornemithro: I think we should probably update the qemu-litex to my rebased version... but I did a rebase, not sure my pull request would look good05:55
shornewhat do you usually do for those?05:55
mithroshorne: i have a solution, wait one moment05:56
mithroshorne: you should have an invite now05:58
shorneok, now I can just force push my branch there05:59
shorneare you ok with that?06:00
mithroshorne: push the old branch to old-master or something, then force push away06:00
*** tvCommitBot has joined #timvideos06:04
*** tvCommitBot has left #timvideos06:04
*** rohitksingh has quit IRC06:07
shorneits done06:07
tpbTitle: Commits · timvideos/qemu-litex · GitHub (at
mithroit is yay! :-P06:08
shorneok, testing this out06:08
shornegot some strange error06:08
tpbTitle: Issues · timvideos/qemu-litex · GitHub (at
*** tvCommitBot has joined #timvideos06:08
*** tvCommitBot has left #timvideos06:08
shornewarning: unable to rmdir 'capstone': Directory not empty06:08
*** rohitksingh has joined #timvideos06:08
shornewarning: unable to rmdir 'ui/keycodemapdb': Directory not empty06:08
shorneits my git patches06:09
mithrobed time for me06:10
mithroshorne: get CarlFK to give it a try?06:10
shornemithro: CarlFK: might have gone to bed06:13
shorneit works for me now06:14
shornesomething with my git patches, I might want to revoke my pr there06:14
CarlFKI should be..06:14
CarlFKlitex-buildenv$ make clean; rm build/arty_net_or1k/qemu/Makefile; ./scripts/build-qemu.sh06:18
* CarlFK does happy booted dance 06:19
CarlFKHDMI2USB firmware booting... ... H2U 00:00:00>06:20
CarlFKshorne: it works!06:20
shorneCarlFK: nice06:20
shorneit works here too06:20
shornewhats next ?  linux ...06:21
CarlFKtac-tics: get to downloading vavado!!!06:21
tac-ticsDon't know what to download06:21
tac-ticsHave no computer to do it06:21
tac-ticsLiterally I twiddle bits mid-air06:21
CarlFKoh, no computer makes it hard06:22
shornetodo next, cleanup & upstream the qemu patch , add some kind of config support (device tree), then cleanups & upstream link support06:22
shornelink -> linux06:22
CarlFKI'll start this, but I need to be up in 6 hours, so ...06:25
tpbTitle: HowTo LCA2018 FPGA Miniconf · timvideos/litex-buildenv Wiki · GitHub (at
CarlFKwell pout.  Makefile:146: recipe for target 'sub-make' failed06:35
CarlFK /home/juser/litex-buildenv/third_party/linux/Makefile:576: recipe for target 'scripts' failed06:36
CarlFKor1k-elf-newlib-gcc: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.06:36
CarlFKhome/juser/litex-buildenv/third_party/linux/scripts/ line 22:  703206:38
CarlFK Broken pipe06:38
CarlFKlots of broken stuff.06:38
shorneok, trye later06:50
*** rohitksingh has quit IRC06:55
*** rohitksingh has joined #timvideos07:26
*** rohitksingh has quit IRC07:47
*** Shari2 has joined #timvideos07:58
*** tac-tics has quit IRC08:09
*** futarisIRCcloud has quit IRC08:58
*** rohitksingh has joined #timvideos09:50
*** mauz555 has joined #timvideos09:51
*** mauz555 has quit IRC09:55
*** mauz555 has joined #timvideos09:55
*** mauz555 has quit IRC09:56
*** ewen has joined #timvideos09:58
ewenCarlFK: Re your LC_TIME issue, this is caused by change in LC_TIME struct between libc in compiler and locale data on your disk.09:59
ewenCarlFK: easiest work around I've found so far is "export LC_ALL=C"09:59
ewenmithro: FYI LC_TIME structure changed early 2018.  Latest glibc has a larger LC_TIME structure.  And static linked compilers built against older glibc will fail with newer glibc compiled locales (and vice versa).  We may yet need to add a work around for this.  Possibly "export LC_ALL=C"?10:01
ewenmithro: Main disadvantage is users lose translations of output messages / date/time/etc formats, etc.10:02
* ewen goes to bed, leaving these notes as hints for those whose morning is earlier...10:04
*** ewen has quit IRC10:13
*** mauz555 has joined #timvideos10:23
*** rohitksingh has quit IRC10:32
*** shorne has quit IRC10:57
*** shorne has joined #timvideos10:59
*** rohitksingh has joined #timvideos11:18
*** rohitksingh has quit IRC11:46
xobsSo ugly. Let's just do the Go thing and link against libmusl...11:55
xobsIn other news, I discovered this gpio block takes a lot longer to synthesize (but works much better) if I connect the CLK line to it. Also, I decided to write litegpio. We'll see how that goes...11:56
CarlFKmithro: good morning!  and linux build error -export LC_ALL=C ...
tpbTitle: Ubuntu Pastebin (at
*** rohitksingh has joined #timvideos12:34
*** rohitksingh has quit IRC12:45
*** mauz555 has quit IRC13:05
*** mauz555 has joined #timvideos13:07
*** Kripton has quit IRC14:25
*** Kripton has joined #timvideos14:26
Shari2CarlFK: I wrote a C++14 application to dump the raw ISO stream using libusb. How can get the code to you?14:58
CarlFKShari2: what's your gitjub username, and do you have your public keys there?14:58
Shari2CarlFK: i do not have a github account14:59
CarlFKI'll put them onto the opsis host and you can ssh in14:59
CarlFKhow about launchpad?14:59
Shari2CarlFK: never used14:59
CarlFKhow about somewhere I can wget your public key?15:00
CarlFKthere is a script for importing keys from those two hosts15:00
*** mauz555 has quit IRC15:00
Shari2CarlFK: I will create a github account, will need that anyway to send pull requests.15:11
mithroI've been working on fixing the above issues -- but someone seems to have stolen August from me....15:13
mithroCarlFK: I can leave Nikita in your hands?15:22
CarlFKmithro: yes - replying to her now - encouraging meeting me at ps1 soon to do the setup together15:23
CarlFKmithro: I'll keep CCing you on stuff till you tell me to stop15:23
Shari2CarlFK: Shari2 is my github account. Where should i put my public key?15:29
CarlFKShari2: look around for github instructions15:29
CarlFKShari2: it will be used  to auth you when you push your work to your account15:29
Shari2CarlFK: auth with ssh is working15:37
CarlFKk - sec...15:38
CarlFKShari2: did you get my /msg ?15:41
CarlFKdo whatever you want to that box - I install a new os/stuff often, so I completely don't care what is on the disk15:43
Shari2CarlFK: fragmentation fine with your opsis, every 1024 bytes is a payload header16:16
CarlFKneat - that's good, .. right?16:17
Shari2yes the capture stream is correct16:17
Shari2my board produces a fragmentation header every 4079 to 4081 bytes16:18
Shari2and i have no clue why16:18
*** rohitksingh has joined #timvideos16:28
*** Shari2 has quit IRC16:30
*** rohitksingh1 has joined #timvideos16:34
*** rohitksingh has quit IRC16:37
*** Shari2 has joined #timvideos17:17
*** tac-tics has joined #timvideos17:26
tac-ticssee, CarlFK. It's in my autojoin list17:26
CarlFKha za!17:27
CarlFKtac-tics: what's the situation on you downloading 25 gig?  which I realize may not be realistic17:28
*** rohitksingh1 has quit IRC17:30
tac-ticsUnless you send like a no-thinking-required direct link to a tarball, it will be on my "eventually" list. I had a two hour phone interview last night, and I don't have the brainspace for reading step-by-step instructions :(17:34
CarlFKit is like those things you say17:35
CarlFKbut it is not those things you say.  just like it.17:35
CarlFKtac-tics: there are links to the 2 files
tpbTitle: Xilinx Vivado · timvideos/litex-buildenv Wiki · GitHub (at
CarlFKbut if you aren't logged in,  you will be re-directed a login/create account page.17:40
tac-ticsI would just wget it remotely at home if I could17:42
* tac-tics shakes fist at closed-source things.17:44
* tac-tics (shakes other fist at open-source things)17:44
tac-ticsI figure I've got two fists. I better shake at two things.17:46
CarlFKgood plan17:46
*** cr1901_modern has quit IRC19:40
*** cr1901_modern has joined #timvideos19:46
*** Shari2 has quit IRC20:29
*** shorne has quit IRC21:33
*** ewen has joined #timvideos21:36
*** shorne has joined #timvideos21:36
ewenmithro: FTR, LC_TIME issue appears to be a flag day. In I think glibc 2.27.  It appears both older static linked binaries with newer locales (eg, CarlFK) and newer static linked binaries with older locales trigger it.  So we potentially need two cross compiler builds (old/new glibc).  Or some other work around.21:38
ewenmithro: FWIW, my notes on finding the root cause (for another context) are at (currently the last couple of comments, on LC_TIME)21:38
tpbTitle: Synology NAS timercreate Bad address (at
ewenCarlFK: Does "set | egrep 'LANG|LC_'" show anything else set other than LC_ALL for you?21:40
CarlFKewen: lots:
tpbTitle: Ubuntu Pastebin (at
ewenCarlFK: Ah yes, all the Ubuntu shell function stuff.  I've not figured out what that does (but 16.04 also looks similar).21:42
CarlFKewen: what's important is what is set after that all runs, right?21:43
CarlFKer, no.21:43
CarlFKI was thinking that was bashrc21:43
ewenCarlFK: My Ubuntu 16.04 laptop has bits like that too.  They're shell functions.  But probably defined in/via bashrc21:45
ewenWeirldly they seem to be things like _grub_mkimage(), which seems an odd thing to stick in all user shells.21:45
ewenI'm guessing *maybe* tab completion.  But yuck.21:47
ewenFWIW, some people seem to have also set LANG=C for this issue, eg,
ewen(but LC_ALL=C was sufficient on my Synology NAS.  Unclear why.)21:48
ewenAnd the one other thing that apparently worked for a few people was setting LANG=/path/to/locale/file, eg at
tpbTitle: debian - loadlocale.c _nl_intern_locale_data assertion error - Unix & Linux Stack Exchange (at
ewenEg, LANG=/usr/lib/locale/en_US21:50
ewenAlthough I think in all these cases its just persuading glibc *not* to try loading the locale data, so it never finds out its the wrong size :-(21:50
CarlFKthis is for compiling Linux right?22:00
ewenCarlFK: Linux or MicroPython.  The problem is the cross compilers we ue are static linked against older glibc.  And I'm assuming you're on a relatively modern Linux distro (to be seeing the issue).  Eg, Ubuntu 18.04, recent Fedora, etc.22:02
ewen(Interestingly I think this only happens with the compilers we're using for Linux / MicroPython, not the one we use for building the BIOS.)22:02
ewen(And building cross compilers against newer libc will just produce issues for running on older Linux distros AFAICT :-( )22:04
* ewen dislikes flag days22:04
* tac-tics dislikes FLAGS22:20
tac-ticsthe register22:20
tac-tics'Tis a silly register22:20

Generated by 2.13.1 by Marius Gedminas - find it at!