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
mithroHi!07:26
futarisWhen I last did board bringup, it was on ARM using ATAGs. I'm new to devicetree.07:34
futarishttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/booting-without-of.txt looks useful though.07:35
tpbTitle: booting-without-of.txt\devicetree\Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org)07:35
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
futarishttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/openrisc/kernel/prom.c is the arch specific devtree stuff.07:50
tpbTitle: prom.c\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org)07:50
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
futarishttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/openrisc/kernel/head.S#n137907:54
tpbTitle: head.S\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org)07:54
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
futarishttps://github.com/01org/kvm-sgx/blob/master/arch/openrisc/boot/dts/or1ksim.dts#L9 - bootargs = "console=uart,mmio,0x90000000,115200";07:56
tpbTitle: kvm-sgx/or1ksim.dts at master · 01org/kvm-sgx · GitHub (at github.com)07:56
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
mithrofutaris: https://github.com/timvideos/HDMI2USB-firmware-prebuilt/blob/master/archive/master/v0.0.3-703-ga16b484/mimasv2/base/or1k/software/include/generated/csr.h#L39608:02
tpbTitle: HDMI2USB-firmware-prebuilt/csr.h at master · timvideos/HDMI2USB-firmware-prebuilt · GitHub (at github.com)08:02
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
futarishttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/openrisc/kernel/head.S#n150708:05
tpbTitle: head.S\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org)08:05
futarisActually, UART_DLL and UART_DLM don't exist on litex do they?08:05
mithrofutaris: https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/libbase/uart.c08:06
tpbTitle: litex/uart.c at master · enjoy-digital/litex · GitHub (at github.com)08:06
futarisHmm. How do I set the baud rate of the UART with litex?08:07
mithrofutaris: Its hard coded I think08:08
mithrofutaris: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart/core.py#L10608:09
tpbTitle: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com)08:09
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
futarishttps://sourceware.org/cgen/gen-doc/openrisc-insn.html08:11
tpbTitle: OPENRISC Instruction Documentation (at sourceware.org)08:11
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 ./build-qemu-litex.sh 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/download-env.sh 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 https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart/core.py the UART essentially is just doing bit banging in hardware? Is there any more documentation on the offsets etc?09:56
tpbTitle: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com)09:56
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
mithrofutarisWeb: https://www.irccloud.com/pricing10:00
tpbTitle: Pricing | IRCCloud (at www.irccloud.com)10:00
*** 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
futarisIRCcloud:(10: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 -> https://travis-ci.org/timvideos/HDMI2USB-litex-firmware10:06
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 https://www.xilinx.com/support/documentation/ip_documentation/opb_uartlite.pdf ... 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 -> https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart/core.py#L13810:16
tpbTitle: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com)10:16
*** 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
futarisIRCcloudYep.10: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
futarisIRCcloudhttp://www.linuxjournal.com/article/633110:34
futarisIRCcloudhttp://www.ibiblio.org/pub/linux/docs/linux-journal/listings/issue104/6331l1.txt10: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
mithroOh10:40
mithroWell, I guess we don't really need to init the uart10:40
futarisIRCcloudhttps://sourceware.org/cgen/gen-doc/openrisc-insn.html10:40
tpbTitle: OPENRISC Instruction Documentation (at sourceware.org)10:40
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
mithroYeah10: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
futarisWebhttps://lwn.net/Articles/572320/ ... Might be easier than reading the code.11:39
tpbTitle: ARM: add support to dump the kernel page tables [LWN.net] (at lwn.net)11:39
mithroHrm?11:40
futarisWebNever mind...11:43
futarisWebhttps://patchwork.kernel.org/patch/8760351/11:43
futarisWebhttp://lkml.iu.edu/hypermail/linux/kernel/1612.1/02153.html11:43
tpbTitle: openrisc: Consolidate setup to use memblock instead of bootmem - Patchwork (at patchwork.kernel.org)11:43
tpbTitle: Linux-Kernel Archive: [GIT PULL] Openrisc changes for 4.10 merge (at lkml.iu.edu)11:43
futarisWebhttps://www.phoronix.com/scan.php?page=news_item&px=Linux-4.10-OpenRISC11:43
tpbTitle: OpenRISC Has New Maintainer For The Linux Kernel - Phoronix (at www.phoronix.com)11:43
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
futarisIRCcloudOk.11: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 irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!