Sunday, 2016-04-17

*** tpb has joined #timvideos00:00
*** Bertl_zZ is now known as Bertl00:25
*** Bertl is now known as Bertl_oO01:07
shenkimithro: hello!01:25
mithroI have something you'll might like01:26
shenkimithro: oh?01:27
mithroI got the JTAG debug interface for the or1k working. You can attach gdb to the softcpu in the FPGA and do all your normal gdb things!01:28
shenkimithro: oh swet01:28
shenkimithro: oh sweet01:28
mithroShould make debugging the random C code lock ups much easier01:29
shenkiyeah, for sure01:30
shenkiok, so what are we working on today?01:30
mithroAnd your porting stuff01:30
shenkiget the minispartan support reviewd and merged?01:30
mithroAnd get it working for you01:31
mithroI'm just walking to work now01:31
mithroNeed to get some food on the way01:32
mithroSo you should get yourself on an unmodified version of my branch and try building that.01:36
mithroshenki: so I made it to work01:49
mithroyou want revision 454f688b5e2048899feca2b952c1172829edcb0401:49
mithroshenki: Oh, did you see that the reason I was confused about the reset was because it's the pipistrello that needs to be hard power cycled?01:50
shenkiok im on that now01:50
shenkii should have checked before moving. oh well01:50
shenkimithro: ah ok01:51
shenkimithro: were you testing on a pipstrello?01:51
mithroshenki: I've been testing on both01:51
mithrothe pipistrello is by the m-labs guys01:52
mithrofor atriq01:52
mithrowhich is probably the most "advanced" user of MiSoC/Migen01:52
shenkimithro: ok, your branch appears to work fine01:56
shenki      platform: minispar01:56
shenkido we trim the name on purpose?01:57
mithroshenki: I think they trim it to fit into a 64bit register or something?01:57
shenkiso we can merge it in?01:59
shenki    gateware/hdmi: Hacks to make output work when pack_factor == 101:59
shenkihrm, perhaps not01:59
mithroshenki: I think we are going to want to create a "string table" type object in the future01:59
mithroshenki: btw I assume you haven't gotten your Atlys back from my parents?01:59
mithroshenki: Just a FYI, your will need to find your Atlys power supply and be very careful to not plug your Opsis power supply into your Atlys (otherwise it will let the magic smoke out)02:00
shenkimithro: yeah, your mum dropped by yesterday02:02
mithroshenki: oh cool!02:02
shenkimithro: ok. polarity, or voltage difference?02:02
mithroOpsis is 12V02:02
mithroAtlys is 5V02:02
mithroThey have the same size barrel connector02:02
shenkiok. it's easy for now, as i don't have a barrel connector suitable for the opsis02:03
mithroshenki: fair enough02:03
shenkiso im using a ATX psu02:03
mithroI'm still kicking myself for not also including a screw header02:03
shenkii needed an atx psu for the ast2500 board, so it was on the table already02:03
shenkiinterestingly the ast2500 bord uses the modern sata power connector for power02:04
shenkiscrew header? so you can attach a bench power supply?02:04
mithroshenki: so you can cut the barrel jack off any 12V supply and connect it :)02:05
shenkioh well02:05
mithroThink they just want to sell :P02:05
tpbTitle: DC Barrel Jack Adapter (for power) - Numato Lab (at
shenkimithro: why did you decide not to put a power brick in the opsis crowdfunding project?02:06
mithroshenki: Supplying power supplies internationally turns out to be surprisingly tricky02:07
mithroLots more regulations then you would have thought02:07
mithroshenki: so, it sounds like you have it building / booting?02:13
mithroshenki: Would be worth looking over too02:15
tpbTitle: Adding the minispartan6+ board in a mostly working state by mithro · Pull Request #249 · timvideos/HDMI2USB-misoc-firmware · GitHub (at
shenkimithro: yeah, it's working02:15
shenkimithro: im reading uart code now02:15
mithroshenki: \o/02:15
shenkimithro: where does the ram mapping come from?02:17
shenkimithro: it would be nice to put it at 0x2.... like we do for the other boards02:18
mithroshenki: what do you mean?02:18
shenki+RAM_ADDR = 0x4000000002:18
shenkimithro: i assume that mapping is something we control?02:18
mithroWe always put the off-chip RAM at 0x4000000002:19
mithroOn the SLX45 chips, we put about 8k of "on chip ROM" at 0x2000000002:19
shenkioh, i see02:20
shenki +TIMESPEC "TSise_sucks7" = FROM "GRPpix0_clk" TO "GRPsys_clk" TIG;02:23
shenki +TIMESPEC "TSise_sucks8" = FROM "GRPsys_clk" TO "GRPpix0_clk" TIG;02:23
mithroBut the SLX25 doesn't have enough block ram to add that 8k02:25
mithroshenki: so we put everything into DDR RAM02:26
mithroshenki: we could actually probably just execute directly from the SPI flash02:26
cr1901_modern1TIMESPEC ISE Sucks, huh?02:26
shenkimithro: not everything; the bios is still in the BRAM, right?02:27
mithroshenki: although apparently the BIOS can be stored in the flash too!?02:27
mithroshenki: my opsis-timing branch actually gives that stuff better names / comments02:28
shenkiyeah, perhaps that will be handy if we put IP that needs more blockstreams02:28
shenkinot sure where that word came from02:28
*** sb0 has quit IRC02:29
mithroshenki: I like having the BIOS in the gateware because it gives us output even when other things like SDRAM and SPI flash are borked02:30
mithroshenki: If you take a look at you can see me trying to understand (and make understandable) the clocking stuff02:31
tpbTitle: WIP: Fixing the timing propagation through PLL/DCM parts in ISE. by mithro · Pull Request #226 · timvideos/HDMI2USB-misoc-firmware · GitHub (at
mithroshenki: do you have enough to work on for about an hour?02:32
mithroshenki: Oh, I rebased my or1k patches02:33
mithroshenki: merged02:34
xfxfmithro: delayed response again, dealing with super dodgy HFC at the moment (outages in my area at the moment)02:37
mithroxfxf: I need someone to do some testing02:37
xfxfokay, i can probably do that this evening assuming my internet isn't terrible02:38
xfxfi got stuck at having to re-download the xilinx tools to progress any further02:38
mithroxfxf: you should keep a local copy02:39
xfxfonce that's done i'll have a laptop dedicated to video stuff so testing new builds should be easy02:39
mithroxfxf: actually - you should also test "make download-prebuilt" too02:39
xfxfmithro: yeah, i sold the laptop i was using that had everything on it, this is a new one02:39
mithroxfxf: Put it on a USB stick or something :)02:40
shenkimithro: yeah, im hacking on uart stuff02:41
*** sb0 has joined #timvideos02:42
mithroshenki: okay02:42
mithroshenki: You could look at too02:43
tpbTitle: Fix the framebuffer allocations · Issue #250 · timvideos/HDMI2USB-misoc-firmware · GitHub (at
mithroshenki: we also really need to get the vizzini UART driver upstream02:53
shenkihrm, im confused03:19
shenkifrom my reading uart_rxtx_write, whihc writes to the uart rx/tx register, should make a character appear out the uart03:19
shenkineeded moar delays03:29
mithroshenki: working?03:51
shenkimithro: yeah03:52
shenkimithro: i was using the normal buffered/interrupt driven stuff around my byte-poking03:53
shenkimithro: so it was overwriting the byte pokes03:53
mithroshenki: what are you working on?03:53
shenkinot really sure why tho; i assumed that once a write had happened to the uart register it would appear out the port03:53
shenkimithro: a tiny firmware that lets me understand the uart03:54
mithroshenki: ahh03:54
shenkiso i can get characters out of the serial port in linux03:54
mithroshenki: yeah, you could write a document on how it works :P03:56
mithroshenki: you found the code in libbase right?04:09
shenkimithro: yep04:09
shenkimithro: reading the misoc04:13
shenkimithro: how do you know which signals become registers?04:14
shenkiregisters in the memory mapped value sense04:14
mithroshenki: they inherit from CSR something04:14
mithroshenki: See something like
tpbTitle: HDMI2USB-misoc-firmware/ at master · timvideos/HDMI2USB-misoc-firmware · GitHub (at
shenkiclass UARTPHYSerial(Module, AutoCSR):04:15
shenkiAutoCSR sounds like it does magic?04:15
shenkiin the hdmi code it creates csr objects04:16
tpbTitle: misoc/ at legacy · timvideos/misoc · GitHub (at
shenkiso tx_busy is a register, i think04:17
shenkibut i can't see how that gets spat out04:17
mithroshenki: here maybe?
tpbTitle: misoc/ at legacy · timvideos/misoc · GitHub (at
shenkioh, i didn't look in the __init__04:20
mithroshenki: yeah, it gets me every now and then04:20
mithroNormally people have empty files04:21
shenkihrm, i miss the first character04:30
shenkiuart test program:
tpbTitle: HDMI2USB-misoc-firmware/main.c at f32273dc5caaaff935d10c637f8d00c95e76b944 · shenki/HDMI2USB-misoc-firmware · GitHub (at
shenkinow to look at the kernel04:59
mithroshenki: do you want to try getting the or1k working for you too?05:01
mithroshenki: oh, a couple of things - the shadow region avoids the l2 cache05:02
mithroshenki: which is why you need 0xe0001000 rather than the normal value05:03
mithroshenki: In your uart test program05:06
tpbTitle: HDMI2USB-misoc-firmware/main.c at f32273dc5caaaff935d10c637f8d00c95e76b944 · shenki/HDMI2USB-misoc-firmware · GitHub (at
mithroYou don't check that the uart isn't full05:06
mithroI think you want to swap lines 64/6505:06
shenkiswap, or put the wait before and after?05:12
mithroshenki: there could still be a byte in the uart from the bios?05:13
shenkimithro: yeah. that fixed my missing char issue05:13
shenkii think it makes snse to wait after as well05:13
shenkifor the situation where the next instruction is to reboot05:14
*** ssk1328 has joined #timvideos05:15
mithroshenki: well, this is only test firmware, I hope you wouldn't be waiting in the real driver :P05:15
*** sb0 has quit IRC05:15
shenkii will use this to get linux booting i think05:16
shenkithen we convince someone to write a 8250 compatabile misoc uart05:16
shenkiand use that05:16
mithroshenki: I was looking at the 8250 uart, it's *way* to complicated05:18
shenkiin what sense?05:19
mithroshenki: In that the driver code is more than 100 lines of code05:19
shenkiwe don't need to implement it all. just enough of the register api that we can use the driver05:19
mithrodid you see the xilinx uart thingy I linked?05:19
shenkino, didn't click that05:20
shenkiwhat was it again?05:20
tpbTitle: HDMI2USB-misoc-linux/uartlite.c at openrisc · mithro/HDMI2USB-misoc-linux · GitHub (at
shenkimithro: 700 lines!05:23
tpbTitle: linux-milkymist/milkymist_uart.c at ng · m-labs/linux-milkymist · GitHub (at
mithrothat milkymist_uart *isnt* for the misoc one btw05:23
mithroThe 8250 is like 20 files :P -
tpbTitle: HDMI2USB-misoc-linux/drivers/tty/serial/8250 at openrisc · mithro/HDMI2USB-misoc-linux · GitHub (at
shenkii know05:24
mithro700 lines for a simple uart, Linux sure is bloated ;-)05:25
shenkisays the guy that works on chrome05:25
shenkimithro: this is the kernel tree we should be using?
tpbTitle: GitHub - openrisc/linux: Linux kernel source tree (at
mithroSee the repo I forked mine from for the person who has been doing the most work lately05:29
mithroHe is in the openrisc channel pretty frequently05:29
mithroshenki: with the fact that the drivers should be CPU independent - do you think it's worth trying to resurrect the lm32 arch?05:30
shenkimithro: we can if you want05:31
mithroI'm going to go do some other stuff for a couple of hours. If you are around when I get back, it might be worth seeing if you can get my hacky or1k JTAG debug thingy working05:32
mithroI'm still getting the random lock ups in our firmware on the or1k05:39
*** ssk1328 has quit IRC05:44
*** ssk1328 has joined #timvideos06:33
*** panther has joined #timvideos06:41
*** panther is now known as sab_12306:41
*** panther_ has joined #timvideos07:02
*** sab_123 has quit IRC07:05
mithroshenki: still around, or you gone of to do other things?07:42
* mithro is pondering if to call it a day07:44
shenkimithro: im writing a uart driver07:44
shenkiit's the worst07:44
shenkiso much boilerplate07:44
mithroshenki: ahh07:45
mithroWell, if you are still at it - I'll try and finish cleaning up the or1k branch07:48
*** panther__ has joined #timvideos07:49
*** panther_ has quit IRC07:58
*** tpb has joined #timvideos08:06
shenkimithro: the csr defines has defines like CSR_UART_EV_PENDING_ADDR08:06
shenkimithro: i can't find where they come from08:06
mithroshenki: They are generated08:07
shenkimithro: right. but from where?08:08
*** FooBar_ has joined #timvideos08:08
shenkimithro: i can't see anything called 'pending' in the misoc python08:09
mithrothe csr code - migen/bank/ maybe?08:09
mithroEV == EventManager08:11
shenkiok, i see08:12
*** cr1901_modern1 has quit IRC08:13
*** G33KatWork has quit IRC08:13
*** FooBar has quit IRC08:13
*** micolous has quit IRC08:13
*** andi-m has quit IRC08:13
*** MaZderMind has quit IRC08:13
*** Kripton has quit IRC08:13
*** seaLne has quit IRC08:13
*** micolous_ has joined #timvideos08:14
*** Kripton has joined #timvideos08:15
*** sb0 has joined #timvideos08:16
*** seaLne has joined #timvideos08:21
*** rohitksingh has joined #timvideos08:33
*** rohitksingh has quit IRC08:38
*** seaLne has quit IRC08:47
*** seaLne has joined #timvideos08:47
*** rohitksingh has joined #timvideos08:53
*** rohitksingh has quit IRC09:00
shenkimithro: is there any documentation for the eventmanager registers?09:10
mithroshenki: The source code :P09:11
shenkiyeah :(09:11
shenkii guess they make sense09:11
mithroshenki: feel free to write some :)09:11
*** rohitksingh has joined #timvideos09:15
shenkimithro: yeah. i'll write a blog post on what im up to or something09:15
mithroshenki: that would be good09:15
mithroshenki: do you want to see if you can get the debug interface working?09:16
shenkimithro: ok09:18
mithroshenki: try the adv_dbg_if branch in my repo09:18
*** andi-m has joined #timvideos09:19
*** rohitksingh has quit IRC09:19
mithroshenki: yeah09:19
*** MaZderMind has joined #timvideos09:20
*** G33KatWork has joined #timvideos09:20
tpbTitle: tutorials/ at master · openrisc/tutorials · GitHub (at
mithroshenki: need ARCH=or1k09:26
shenkiyup, worked that out :)09:26
shenkiwhy are our toolchains 4.9 based?09:27
mithroshenki: Because I haven't gotten around to upgrading to gcc 5 or gcc 6 and checking things work09:29
shenkijust wondering09:31
*** rohitksingh has joined #timvideos09:32
shenkitakes a decent amount of time to route09:34
mithroshenki: early gcc 5 versions didn't produce working lm32 output09:34
shenkimithro: ok09:34
shenkimithro: do any of the cpus have upstream support?09:34
mithroEven j-core stuff needs some patches09:35
mithroshenki: the or1k branch does have gcc 5/6 support09:36
mithrobut wanted the lm32/or1k to be using the same compiler versions09:36
shenkii got a bunch of warnings when building the kernel09:36
shenkiwhich was why i asked09:37
mithroshenki: it only takes 5 minutes here09:37
*** rohitksingh has quit IRC09:37
shenkimy cpu is a bit slower than yours09:38
shenkiTotal CPU time to Router completion: 9 mins 44 secs09:39
mithroYou also need to modify ./build/conda/share/openocd/scripts/board/or1k_generic.cfg09:39
shenkimithro: what do i need to change? :)09:42
mithro#set FPGATAPID 0x020b30dd09:42
mithroset FPGATAPID 0x4400809309:42
mithrooh - and the "set TAP_TYPE VJTAG" to "set TAP_TYPE XILINX_BSCAN"09:44
mithroshenki: ha - I guess we don't have path patching on that09:46
tpbTitle: conda-hdmi2usb-packages/.travis.yml at master · timvideos/conda-hdmi2usb-packages · GitHub (at
*** rohitksingh has joined #timvideos09:50
mithroshenki: you'll want or1k-gdb09:51
mithrothen after flashing and hitting the reset button09:52
mithroopenocd -f interface/ftdi/minispartan6.cfg -f board/or1k_generic.cfg -c 'init'09:52
*** rohitksingh has quit IRC09:55
shenkioh, reset button09:56
mithroshenki: Did you get "Target ready...." ?09:58
mithroI can't seem to single step though09:59
mithroor1k-elf-gdb third_party/misoc/software/bios/bios.elf --eval-command='target remote localhost:3333'09:59
shenkiim just grabbing gdb09:59
mithroYou even get debug symbols :P10:00
mithroIt looks like there is some type of stack corruption going on10:01
shenkiReading symbols from third_party/misoc/software/bios/bios.elf...(no debugging symbols found)...done.10:02
shenkiRemote debugging using localhost:333310:02
shenkiRemote failure reply: E0E10:02
mithrooh wait10:05
mithrofor the minispartan6 you need FPGATAPID of 0x2400409310:05
cr1901_modernI really need to learn how to use OpenOCD to do JTAG debugging. Currently, I only know how to flash chips with it.10:08
shenkiDebug: 340 7166 or1k_du_adv.c:450 adbg_wb_burst_read(): Doing burst read, word size 4, word count 32, start address 0x0000040010:08
shenkiWarn : 341 7167 or1k_du_adv.c:518 adbg_wb_burst_read(): Burst read timed out10:08
shenkiWarn : 342 7167 or1k_du_adv.c:518 adbg_wb_burst_read(): Burst read timed out10:08
shenkiError: 343 7168 or1k_du_adv.c:521 adbg_wb_burst_read(): Burst read failed10:08
shenkiError: 344 7168 or1k.c:1177 or1k_get_gdb_reg_list(): Error while calling or1k_save_context10:08
shenkiDebug: 345 7168 gdb_server.c:1341 gdb_error(): Reporting -4 to GDB as generic error10:08
shenkiDebug: 346 7168 gdb_server.c:1020 gdb_connection_closed(): GDB Close, Target: or1200.cpu, state: running, gdb_actual_connections=010:08
*** rohitksingh has joined #timvideos10:08
mithroshenki: did you change the FPGATAPID above?10:08
shenkiset FPGATAPID 0x2400409310:09
mithroWhat is the full output?10:09
mithromine looks like this10:12
tpbTitle: Pastebin | IRCCloud (at
*** rohitksingh has quit IRC10:12
shenkiso why is the crc not ok?10:13
mithroshenki: hrm...10:13
mithroshenki: restart the processor and connect again?10:13
mithroYou on "commit 41925c5a977f96effe85fcee1b61b9e41d8ca87c" ?10:14
*** panther__ has quit IRC10:15
mithroshenki: and it doesn't work if you reset and connect again?10:20
mithroDebug: 277 25 or1k.c:579 or1k_halt(): target->state: halted10:21
mithroDebug: 278 25 or1k.c:582 or1k_halt(): Target was already halted10:21
mithroThat means you didn't restart after flashing I think?10:22
*** rohitksingh has joined #timvideos10:23
shenkii did. perhaps it didn't work10:23
mithroThe lights should go out?10:24
mithroshenki: I think I'm done for the weekend - going to head home10:26
mithroDidn't get enough sleep last night10:27
mithroOh, maybe try stopping in the BIOS10:34
shenkino worries10:35
*** sb0 has quit IRC10:50
*** cr1901_modern1 has joined #timvideos11:21
*** cr1901_modern has quit IRC11:24
*** Andy has joined #timvideos11:31
*** Andy has left #timvideos11:32
*** ssk1328 has quit IRC11:39
*** rohitksingh has quit IRC12:05
*** Kripton has quit IRC12:06
*** Kripton has joined #timvideos12:09
*** thaytan has quit IRC12:32
*** thaytan has joined #timvideos13:03
*** ChanServ sets mode: +v thaytan13:03
*** cr1901_modern has joined #timvideos15:24
*** cr1901_modern1 has quit IRC15:32
*** tpb has joined #timvideos16:29
*** cr1901_modern has quit IRC16:33
*** tpb has joined #timvideos16:55
*** G33KatWo1k has joined #timvideos16:59
*** Kripton has quit IRC17:02
*** G33KatWork has quit IRC17:02
*** MaZderMind has quit IRC17:02
*** andi-m has quit IRC17:02
*** Kripton has joined #timvideos17:03
*** rohitksingh has joined #timvideos17:55
*** se6astian|away is now known as se6astian17:59
*** rohitksingh has quit IRC17:59
*** rohitksingh has joined #timvideos18:14
*** rohitksingh has quit IRC18:37
*** Bertl_oO is now known as Bertl_zZ18:53
*** FooBar_ is now known as FooBar19:46
*** se6astian is now known as se6astian|away21:02

Generated by 2.13.1 by Marius Gedminas - find it at!