Wednesday, 2017-04-05

*** tpb has joined #timvideos00:00
*** CarlFK has joined #timvideos00:30
*** ChanServ sets mode: +v CarlFK00:30
mithrocr1901_modern1: ping?00:45
*** arcticShadow has joined #timvideos01:18
*** sb0 has joined #timvideos01:32
*** rohitksingh_work has joined #timvideos03:53
*** Sewar has quit IRC04:10
*** Sewar has joined #timvideos04:11
*** Sewar has quit IRC04:27
*** Sewar has joined #timvideos04:28
*** sb0 has quit IRC04:33
*** CarlFK has quit IRC04:51
*** CarlFK has joined #timvideos05:22
*** ChanServ sets mode: +v CarlFK05:22
*** sb0 has joined #timvideos05:36
*** Sewar has quit IRC05:39
*** Sewar has joined #timvideos05:41
*** Sewar has quit IRC05:46
*** Sewar has joined #timvideos05:47
*** Sewar has quit IRC06:04
*** Sewar has joined #timvideos06:05
*** Sewar has quit IRC06:12
*** Sewar has joined #timvideos06:13
*** arcticShadow has quit IRC06:14
*** Sewar has quit IRC06:19
*** Sewar has joined #timvideos06:21
*** Sewar has quit IRC06:27
*** Sewar has joined #timvideos06:31
*** Sewar has quit IRC06:35
*** Sewar has joined #timvideos06:37
*** Sewar has quit IRC06:49
*** Sewar has joined #timvideos06:51
*** Sewar has quit IRC07:07
*** futaris has joined #timvideos07:20
futarisHi mithro. Just saw your e-mail.07:21
futarisWhen I last did board bringup, it was on ARM using ATAGs. I'm new to devicetree.07:34
futaris looks useful though.07:35
tpbTitle: booting-without-of.txt\devicetree\Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree (at
mithrofutaris: or1k is pretty tied to devicetree from what I can see07:36
futarisYep. devicetree is much more modern, and I would be surprised if or1k wasn't using it.07:36
futarisAnd oops about typing lm32 in my last e-mail. I keep meaning to say or1k.07:37
futarisDo you have your .config for the linux kernel?07:40
mithrofutaris: It's pretty much the defconfig for or1k07:41
mithroshenki just tested stock or1k with buildroot and qemu and it worked apparently07:42
futarisYep. The instructions in the e-mail should just work.07:42
futarisI suppose we can use the same "machine type" number as the or1ksim.07:44
futarisCONFIG_OPENRISC_BUILTIN_DTB is building the DTB into the kernel, so we shouldn't have to worry too much...07:46
mithrofutaris: yeah07:47
futaris is the arch specific devtree stuff.07:50
tpbTitle: prom.c\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at
futarisSo nothing from _emergency_print: Copying Linux....07:52
mithrofutaris: Hrm?07:53
futarisThe first linux does is relocate the kernel in memory... "Copying Linux.............." (with a new dot each time)07:54
tpbTitle: head.S\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at
mithroIs this just upstream or?07:54
futarisEvery arch does this.07:55
mithrofutaris: Oh, your not seeing this - your just telling me what *should* happen07:56
futaris - bootargs = "console=uart,mmio,0x90000000,115200";07:56
tpbTitle: kvm-sgx/or1ksim.dts at master · 01org/kvm-sgx · GitHub (at
futarisNow, we don't have the uart at that mmio on mor1k / litex...07:57
futarisLet's ignore the bootargs first, and just get _emergency_print fixed for our UART.07:59
mithrofutaris: okay08:02
tpbTitle: HDMI2USB-firmware-prebuilt/csr.h at master · timvideos/HDMI2USB-firmware-prebuilt · GitHub (at
futarisThe quick way to get it working, is to just hack head.S first. _early_uart_init and emergency_print ...08:03
futarisSo just write a char/byte to 0xe0001000 (physical) and the UART will spit it out?08:04
futarisCan you fix the SYS_CLK and UART_DIVISOR for litex?08:05
tpbTitle: head.S\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at
futarisActually, UART_DLL and UART_DLM don't exist on litex do they?08:05
tpbTitle: litex/uart.c at master · enjoy-digital/litex · GitHub (at
futarisHmm. How do I set the baud rate of the UART with litex?08:07
mithrofutaris: Its hard coded I think08:08
tpbTitle: litex/ at master · enjoy-digital/litex · GitHub (at
futarisOk. So _early_uart_init can essentially be just "l.jr r9, l.nop"08:10
futarisThis is the ASM instruction set for openrisc:08:11
mithrofutaris: Do you need to check if the uart is full?08:11
tpbTitle: OPENRISC Instruction Documentation (at
futarisWe'll just assume we've just powered on the machine, and jumped straight into the beginning of the linux kernel after the BIOS has done the DDR init etc.08:12
mithrofutaris: Correct08:12
futarisSo, just rewrite ENTRY(_emergency_print) first...08:13
futarisSo the original function in the original routine clobbers r4, r5, r6, r7. putc is l.movhi r4,hi(UART_BASE_ADD) ...08:16
futarisActually, looking at your init code for uart, we probably should do the same. uart_ev_pending_write(uart_ev_pending_read()); and uart_ev_enable_write(UART_EV_TX);08:20
futarisWe don't need irqs in early emergency_printk support. Just keep polling until we can print.08:20
mithrofutaris: Yeah08:22
mithrofutaris: Have you attempted to build my qemu with litex support?08:22
futarisYeah, it builds.08:22
mithroI was just helping shenki to build it then08:22
mithrofutaris: As part of the HDMI2USB-litex-firmware?08:22
futarisI think I just built from the tree.08:23
mithrofutaris: with the ./ script?08:24
futarisI'll try that script again soon. Last time I built using the script, I only built lm32, not or1k.08:25
mithroYeah - I'm pretty sure that shenki just discovered that using that script doesn't really work for or1k at the moment08:27
*** futaris has quit IRC08:35
mithroI'm heading to dinner be back in an hour08:36
*** futarisWeb has joined #timvideos08:39
*** Sewar has joined #timvideos08:39
futarisWebThe following packages will be DOWNGRADED due to dependency conflicts:      python:       3.6.0-0        --> 3.5.3-108:53
futarisWeb./scripts/ fails at openocd for me.08:58
*** arcticShadow has joined #timvideos09:17
futarisWebdrivers/tty/serial/8250 is where the or1k (non litex) UART is done. CONFIG_SERIAL_8250, CONFIG_SERIAL_8250_CONSOLE. 8250_of.c gets the information from the devicetree if CONFIG_SERIAL_OF_PLATFORM is defined.09:44
mithrofutarisWeb: sorry, I went to dinner09:54
mithroI'm back now09:54
futarisWebSo looking at the UART essentially is just doing bit banging in hardware? Is there any more documentation on the offsets etc?09:56
tpbTitle: litex/ at master · enjoy-digital/litex · GitHub (at
mithrofutarisWeb: What do you mean?09:57
mithrofutarisWeb: Are you using the web gateware as you haven't discovered IRCCloud yet?09:58
futarisWeblike register offsets. Eg in an 8250, the CONTROL register, etc...09:58
mithrofutarisWeb: None apart from the implementation and the code which uses it09:59
futarisWebBeen a while since I was using IRC.09:59
mithrohighly recommend irccloud, they even have a phone client09:59
futarisWebNo free account though?10:00
futarisWebI used to use BitchX.10:00
tpbTitle: Pricing | IRCCloud (at
*** futarisIRCcloud has joined #timvideos10:01
mithroThe major thing with the free account is that if you are inactive for more then 2 hours it disconnects you10:01
mithroPushed a fix for the openocd issue10:04
mithrofutarisIRCcloud: I also hang out on #openrisc and #m-labs10:05
mithroWhat question did you have about the uart?10:05
mithroPrebuilt headers+bios+firmware for or1k on the Opsis/Atlys platform will be available in about an hour ->
futarisIRCcloudI only just saw today, that you can't change baudrate for example... I'm just looking through drivers/tty/serial trying to see the simplest uart driver, to base a new litex uart off.10:07
mithroYou want a basic fifo style uart10:09
futarisIRCcloudOk. xilinx uartlite references ... Nothing similar for litex uart?10:11
*** arcticShadow has quit IRC10:13
mithrofutarisIRCcloud: The uart isn't even close to being that complicated10:15
*** rohitksingh_wor1 has joined #timvideos10:16
mithroThe full implementation is here ->
tpbTitle: litex/ at master · enjoy-digital/litex · GitHub (at
*** rohitksingh_work has quit IRC10:16
mithrofutarisIRCcloud: #define GET_UART_CSR(addr) ((unsigned char)(*((uint32_t*)addr)))10:26
mithrofutarisIRCcloud: while(true) { while(GET_UART_CSR(0xe0001004)); SET_UART_CSR(0xe0001000, 'x'); }10:27
mithrothat would print infinite x's without overflowing the UART10:27
mithrofutarisIRCcloud: reading is similar10:28
futarisIRCcloudSo there is no hardware flow control? I thought you had interrupts and events for TX full etc.10:29
mithrofutarisIRCcloud: There are interrupts for the fifo getting full or empty10:29
futarisIRCcloudqemu-system-or32: -M litex: unsupported machine type10:30
mithrofutarisIRCcloud: How did you build qemu?10:30
futarisIRCcloudJust realised third-party/qemu-litex needed a git pull.10:31
futarisIRCcloudWe could probably just start of with a modern version of:10:34
futarisIRCcloudstart _off_10:34
mithrofutarisIRCcloud: You were telling me how to modify head.S?10:35
futarisIRCcloudJust need to modify _early_uart_init. It'll probably work if we remove everything, and just "l.jr r9" then "nop".10:37
futarisIRCcloudI don't quite understand all the or1k asm, but _emergency_printf should just check until it can write, putc, check that the byte was written, then do the same for the next character until it reaches the end of the string.10:38
mithroWhat is l.jr r9?10:39
futarisIRCcloudreturn to where this function was called from.10:40
mithroWell, I guess we don't really need to init the uart10:40
tpbTitle: OPENRISC Instruction Documentation (at
mithroTechnically we might want to drain the uart10:41
futarisIRCcloudFor qemu, it shouldn't really matter.10:41
*** arcticShadow has joined #timvideos10:41
futarisIRCcloud_emergency_print_nr will need to be fixed up the same like _emergency_print too...10:42
futarisIRCcloudCONFIG_DEBUG_KERNEL should be switched on.10:45
*** arcticShadow has quit IRC10:46
futarisIRCcloudSYS_HAS_EARLY_PRINTK isn't defined anywhere for arch openrisc10:48
futarisIRCcloudHave to do something like arch/microblaze/Kconfig.debug ...10:49
mithroSorry, I'm distracted fixing a couple of small qemu things10:52
*** sb0 has quit IRC11:03
futarisIRCcloudKERNEL_BASE / PAGE_OFFSET is 0xc0000000 on or1k in linux...11:06
futarisIRCcloudThis is probably why qemu elf loading via kernel is broken. RAM is at 0x40000000 on litex, right?11:07
*** arcticShadow has joined #timvideos11:12
mithrofutarisIRCcloud: No11:15
mithrofutarisIRCcloud: that value is virtual address space if I understand shenki11:16
mithrofutarisIRCcloud: I'm fixing the qemu elf loading right now11:17
futarisWebOk. Is arch/openrisc/include/asm/pgtable.h setup correctly for our physical RAM addresses?11:21
mithrofutarisWeb: I don't know - I was trying to figure that out11:28
futarisWeb ... Might be easier than reading the code.11:39
tpbTitle: ARM: add support to dump the kernel page tables [] (at
futarisWebNever mind...11:43
tpbTitle: openrisc: Consolidate setup to use memblock instead of bootmem - Patchwork (at
tpbTitle: Linux-Kernel Archive: [GIT PULL] Openrisc changes for 4.10 merge (at
tpbTitle: OpenRISC Has New Maintainer For The Linux Kernel - Phoronix (at
futarisWebStafford Horne - is the maintainer for OpenRISC Linux Kernel 4.10.11:44
*** arcticShadow has quit IRC11:56
mithrofutarisWeb: almost got the elf loading stuff working11:56
mithrofutarisWeb: Yes, I've chatted with him yesterday on #openrisc11:56
futarisIRCcloudarch/openrisc/kernel/setup.c is where the memory setup happens.11:58
futarisIRCcloudAnyway, go to go now.11:58
*** futarisWeb has quit IRC11:59
*** sb0 has joined #timvideos12:02
mithroWell, I fixed qemu elf loading12:03
*** arcticShadow has joined #timvideos12:28
*** arcticShadow has quit IRC12:30
*** rohitksingh_wor1 has quit IRC12:51
*** rohitksingh has joined #timvideos14:32
*** rohitksingh has quit IRC19:13
CarlFKanyone want to poke at some oddness?    hdmi conected to #1, status: input0:  0x0 (@38.55 MHz) (disabled) input1:  0x0 (@148.49 MHz) (capturing)20:00
CarlFKomg omg omg!!!!  can someone put status on the pattern?20:01
*** arcticShadow has joined #timvideos20:17
*** arcticShadow has quit IRC21:02
*** arcticShadow has joined #timvideos21:54
*** SamSagaZ__ has quit IRC22:13
*** CarlFK has quit IRC23:41

Generated by 2.13.1 by Marius Gedminas - find it at!