*** tpb has joined #timvideos | 00:00 | |
*** CarlFK has joined #timvideos | 00:30 | |
*** ChanServ sets mode: +v CarlFK | 00:30 | |
mithro | cr1901_modern1: ping? | 00:45 |
---|---|---|
*** arcticShadow has joined #timvideos | 01:18 | |
*** sb0 has joined #timvideos | 01:32 | |
*** rohitksingh_work has joined #timvideos | 03:53 | |
*** Sewar has quit IRC | 04:10 | |
*** Sewar has joined #timvideos | 04:11 | |
*** Sewar has quit IRC | 04:27 | |
*** Sewar has joined #timvideos | 04:28 | |
*** sb0 has quit IRC | 04:33 | |
*** CarlFK has quit IRC | 04:51 | |
*** CarlFK has joined #timvideos | 05:22 | |
*** ChanServ sets mode: +v CarlFK | 05:22 | |
*** sb0 has joined #timvideos | 05:36 | |
*** Sewar has quit IRC | 05:39 | |
*** Sewar has joined #timvideos | 05:41 | |
*** Sewar has quit IRC | 05:46 | |
*** Sewar has joined #timvideos | 05:47 | |
*** Sewar has quit IRC | 06:04 | |
*** Sewar has joined #timvideos | 06:05 | |
*** Sewar has quit IRC | 06:12 | |
*** Sewar has joined #timvideos | 06:13 | |
*** arcticShadow has quit IRC | 06:14 | |
*** Sewar has quit IRC | 06:19 | |
*** Sewar has joined #timvideos | 06:21 | |
*** Sewar has quit IRC | 06:27 | |
*** Sewar has joined #timvideos | 06:31 | |
*** Sewar has quit IRC | 06:35 | |
*** Sewar has joined #timvideos | 06:37 | |
*** Sewar has quit IRC | 06:49 | |
*** Sewar has joined #timvideos | 06:51 | |
*** Sewar has quit IRC | 07:07 | |
*** futaris has joined #timvideos | 07:20 | |
futaris | Hi mithro. Just saw your e-mail. | 07:21 |
mithro | Hi! | 07:26 |
futaris | When I last did board bringup, it was on ARM using ATAGs. I'm new to devicetree. | 07:34 |
futaris | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/booting-without-of.txt looks useful though. | 07:35 |
tpb | Title: booting-without-of.txt\devicetree\Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org) | 07:35 |
mithro | futaris: or1k is pretty tied to devicetree from what I can see | 07:36 |
futaris | Yep. devicetree is much more modern, and I would be surprised if or1k wasn't using it. | 07:36 |
futaris | And oops about typing lm32 in my last e-mail. I keep meaning to say or1k. | 07:37 |
futaris | Do you have your .config for the linux kernel? | 07:40 |
mithro | futaris: It's pretty much the defconfig for or1k | 07:41 |
mithro | shenki just tested stock or1k with buildroot and qemu and it worked apparently | 07:42 |
futaris | Yep. The instructions in the e-mail should just work. | 07:42 |
futaris | I suppose we can use the same "machine type" number as the or1ksim. | 07:44 |
futaris | CONFIG_OPENRISC_BUILTIN_DTB is building the DTB into the kernel, so we shouldn't have to worry too much... | 07:46 |
mithro | futaris: yeah | 07:47 |
futaris | https://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 |
tpb | Title: prom.c\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org) | 07:50 |
futaris | So nothing from _emergency_print: Copying Linux.... | 07:52 |
mithro | futaris: Hrm? | 07:53 |
futaris | The first linux does is relocate the kernel in memory... "Copying Linux.............." (with a new dot each time) | 07:54 |
futaris | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/openrisc/kernel/head.S#n1379 | 07:54 |
tpb | Title: head.S\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org) | 07:54 |
mithro | Is this just upstream or? | 07:54 |
futaris | Every arch does this. | 07:55 |
mithro | futaris: Oh, your not seeing this - your just telling me what *should* happen | 07:56 |
futaris | https://github.com/01org/kvm-sgx/blob/master/arch/openrisc/boot/dts/or1ksim.dts#L9 - bootargs = "console=uart,mmio,0x90000000,115200"; | 07:56 |
tpb | Title: kvm-sgx/or1ksim.dts at master · 01org/kvm-sgx · GitHub (at github.com) | 07:56 |
futaris | Now, we don't have the uart at that mmio on mor1k / litex... | 07:57 |
futaris | Let's ignore the bootargs first, and just get _emergency_print fixed for our UART. | 07:59 |
mithro | futaris: okay | 08:02 |
mithro | futaris: https://github.com/timvideos/HDMI2USB-firmware-prebuilt/blob/master/archive/master/v0.0.3-703-ga16b484/mimasv2/base/or1k/software/include/generated/csr.h#L396 | 08:02 |
tpb | Title: HDMI2USB-firmware-prebuilt/csr.h at master · timvideos/HDMI2USB-firmware-prebuilt · GitHub (at github.com) | 08:02 |
futaris | The quick way to get it working, is to just hack head.S first. _early_uart_init and emergency_print ... | 08:03 |
futaris | So just write a char/byte to 0xe0001000 (physical) and the UART will spit it out? | 08:04 |
futaris | Can you fix the SYS_CLK and UART_DIVISOR for litex? | 08:05 |
futaris | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/openrisc/kernel/head.S#n1507 | 08:05 |
tpb | Title: head.S\kernel\openrisc\arch - kernel/git/torvalds/linux.git - Linux kernel source tree (at git.kernel.org) | 08:05 |
futaris | Actually, UART_DLL and UART_DLM don't exist on litex do they? | 08:05 |
mithro | futaris: https://github.com/enjoy-digital/litex/blob/master/litex/soc/software/libbase/uart.c | 08:06 |
tpb | Title: litex/uart.c at master · enjoy-digital/litex · GitHub (at github.com) | 08:06 |
futaris | Hmm. How do I set the baud rate of the UART with litex? | 08:07 |
mithro | futaris: Its hard coded I think | 08:08 |
mithro | futaris: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart/core.py#L106 | 08:09 |
tpb | Title: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com) | 08:09 |
futaris | Ok. So _early_uart_init can essentially be just "l.jr r9, l.nop" | 08:10 |
futaris | This is the ASM instruction set for openrisc: | 08:11 |
mithro | futaris: Do you need to check if the uart is full? | 08:11 |
futaris | https://sourceware.org/cgen/gen-doc/openrisc-insn.html | 08:11 |
tpb | Title: OPENRISC Instruction Documentation (at sourceware.org) | 08:11 |
futaris | We'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 |
mithro | futaris: Correct | 08:12 |
futaris | So, just rewrite ENTRY(_emergency_print) first... | 08:13 |
futaris | So the original function in the original routine clobbers r4, r5, r6, r7. putc is l.movhi r4,hi(UART_BASE_ADD) ... | 08:16 |
futaris | Actually, 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 |
futaris | We don't need irqs in early emergency_printk support. Just keep polling until we can print. | 08:20 |
mithro | futaris: Yeah | 08:22 |
mithro | futaris: Have you attempted to build my qemu with litex support? | 08:22 |
futaris | Yeah, it builds. | 08:22 |
mithro | I was just helping shenki to build it then | 08:22 |
mithro | futaris: As part of the HDMI2USB-litex-firmware? | 08:22 |
futaris | I think I just built from the tree. | 08:23 |
mithro | futaris: with the ./build-qemu-litex.sh script? | 08:24 |
futaris | I'll try that script again soon. Last time I built using the script, I only built lm32, not or1k. | 08:25 |
mithro | Yeah - I'm pretty sure that shenki just discovered that using that script doesn't really work for or1k at the moment | 08:27 |
*** futaris has quit IRC | 08:35 | |
mithro | I'm heading to dinner be back in an hour | 08:36 |
*** futarisWeb has joined #timvideos | 08:39 | |
*** Sewar has joined #timvideos | 08:39 | |
futarisWeb | The following packages will be DOWNGRADED due to dependency conflicts: python: 3.6.0-0 --> 3.5.3-1 | 08:53 |
futarisWeb | ./scripts/download-env.sh fails at openocd for me. | 08:58 |
*** arcticShadow has joined #timvideos | 09:17 | |
futarisWeb | drivers/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 |
mithro | futarisWeb: sorry, I went to dinner | 09:54 |
mithro | I'm back now | 09:54 |
futarisWeb | So 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 |
tpb | Title: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com) | 09:56 |
mithro | futarisWeb: What do you mean? | 09:57 |
mithro | futarisWeb: Are you using the web gateware as you haven't discovered IRCCloud yet? | 09:58 |
futarisWeb | like register offsets. Eg in an 8250, the CONTROL register, etc... | 09:58 |
mithro | futarisWeb: None apart from the implementation and the code which uses it | 09:59 |
futarisWeb | Been a while since I was using IRC. | 09:59 |
mithro | highly recommend irccloud, they even have a phone client | 09:59 |
futarisWeb | No free account though? | 10:00 |
futarisWeb | I used to use BitchX. | 10:00 |
mithro | futarisWeb: https://www.irccloud.com/pricing | 10:00 |
tpb | Title: Pricing | IRCCloud (at www.irccloud.com) | 10:00 |
*** futarisIRCcloud has joined #timvideos | 10:01 | |
mithro | The major thing with the free account is that if you are inactive for more then 2 hours it disconnects you | 10:01 |
futarisIRCcloud | :( | 10:01 |
mithro | Pushed a fix for the openocd issue | 10:04 |
mithro | futarisIRCcloud: I also hang out on #openrisc and #m-labs | 10:05 |
mithro | What question did you have about the uart? | 10:05 |
mithro | Prebuilt headers+bios+firmware for or1k on the Opsis/Atlys platform will be available in about an hour -> https://travis-ci.org/timvideos/HDMI2USB-litex-firmware | 10:06 |
futarisIRCcloud | I 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 |
mithro | You want a basic fifo style uart | 10:09 |
futarisIRCcloud | Ok. xilinx uartlite references https://www.xilinx.com/support/documentation/ip_documentation/opb_uartlite.pdf ... Nothing similar for litex uart? | 10:11 |
*** arcticShadow has quit IRC | 10:13 | |
mithro | futarisIRCcloud: The uart isn't even close to being that complicated | 10:15 |
*** rohitksingh_wor1 has joined #timvideos | 10:16 | |
mithro | The full implementation is here -> https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart/core.py#L138 | 10:16 |
tpb | Title: litex/core.py at master · enjoy-digital/litex · GitHub (at github.com) | 10:16 |
*** rohitksingh_work has quit IRC | 10:16 | |
mithro | futarisIRCcloud: #define GET_UART_CSR(addr) ((unsigned char)(*((uint32_t*)addr))) | 10:26 |
mithro | futarisIRCcloud: while(true) { while(GET_UART_CSR(0xe0001004)); SET_UART_CSR(0xe0001000, 'x'); } | 10:27 |
mithro | that would print infinite x's without overflowing the UART | 10:27 |
futarisIRCcloud | Yep. | 10:27 |
mithro | futarisIRCcloud: reading is similar | 10:28 |
futarisIRCcloud | So there is no hardware flow control? I thought you had interrupts and events for TX full etc. | 10:29 |
mithro | futarisIRCcloud: There are interrupts for the fifo getting full or empty | 10:29 |
futarisIRCcloud | qemu-system-or32: -M litex: unsupported machine type | 10:30 |
mithro | futarisIRCcloud: How did you build qemu? | 10:30 |
futarisIRCcloud | Just realised third-party/qemu-litex needed a git pull. | 10:31 |
futarisIRCcloud | We could probably just start of with a modern version of: | 10:34 |
futarisIRCcloud | http://www.linuxjournal.com/article/6331 | 10:34 |
futarisIRCcloud | http://www.ibiblio.org/pub/linux/docs/linux-journal/listings/issue104/6331l1.txt | 10:34 |
futarisIRCcloud | start _off_ | 10:34 |
mithro | futarisIRCcloud: You were telling me how to modify head.S? | 10:35 |
futarisIRCcloud | Just need to modify _early_uart_init. It'll probably work if we remove everything, and just "l.jr r9" then "nop". | 10:37 |
futarisIRCcloud | I 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 |
mithro | What is l.jr r9? | 10:39 |
futarisIRCcloud | return to where this function was called from. | 10:40 |
mithro | Oh | 10:40 |
mithro | Well, I guess we don't really need to init the uart | 10:40 |
futarisIRCcloud | https://sourceware.org/cgen/gen-doc/openrisc-insn.html | 10:40 |
tpb | Title: OPENRISC Instruction Documentation (at sourceware.org) | 10:40 |
mithro | Technically we might want to drain the uart | 10:41 |
futarisIRCcloud | For qemu, it shouldn't really matter. | 10:41 |
*** arcticShadow has joined #timvideos | 10:41 | |
futarisIRCcloud | _emergency_print_nr will need to be fixed up the same like _emergency_print too... | 10:42 |
mithro | Yeah | 10:42 |
futarisIRCcloud | CONFIG_DEBUG_KERNEL should be switched on. | 10:45 |
*** arcticShadow has quit IRC | 10:46 | |
futarisIRCcloud | SYS_HAS_EARLY_PRINTK isn't defined anywhere for arch openrisc | 10:48 |
futarisIRCcloud | Have to do something like arch/microblaze/Kconfig.debug ... | 10:49 |
mithro | Sorry, I'm distracted fixing a couple of small qemu things | 10:52 |
*** sb0 has quit IRC | 11:03 | |
futarisIRCcloud | KERNEL_BASE / PAGE_OFFSET is 0xc0000000 on or1k in linux... | 11:06 |
futarisIRCcloud | This is probably why qemu elf loading via kernel is broken. RAM is at 0x40000000 on litex, right? | 11:07 |
*** arcticShadow has joined #timvideos | 11:12 | |
mithro | futarisIRCcloud: No | 11:15 |
mithro | futarisIRCcloud: that value is virtual address space if I understand shenki | 11:16 |
mithro | futarisIRCcloud: I'm fixing the qemu elf loading right now | 11:17 |
futarisWeb | Ok. Is arch/openrisc/include/asm/pgtable.h setup correctly for our physical RAM addresses? | 11:21 |
mithro | futarisWeb: I don't know - I was trying to figure that out | 11:28 |
futarisWeb | https://lwn.net/Articles/572320/ ... Might be easier than reading the code. | 11:39 |
tpb | Title: ARM: add support to dump the kernel page tables [LWN.net] (at lwn.net) | 11:39 |
mithro | Hrm? | 11:40 |
futarisWeb | Never mind... | 11:43 |
futarisWeb | https://patchwork.kernel.org/patch/8760351/ | 11:43 |
futarisWeb | http://lkml.iu.edu/hypermail/linux/kernel/1612.1/02153.html | 11:43 |
tpb | Title: openrisc: Consolidate setup to use memblock instead of bootmem - Patchwork (at patchwork.kernel.org) | 11:43 |
tpb | Title: Linux-Kernel Archive: [GIT PULL] Openrisc changes for 4.10 merge (at lkml.iu.edu) | 11:43 |
futarisWeb | https://www.phoronix.com/scan.php?page=news_item&px=Linux-4.10-OpenRISC | 11:43 |
tpb | Title: OpenRISC Has New Maintainer For The Linux Kernel - Phoronix (at www.phoronix.com) | 11:43 |
futarisWeb | Stafford Horne - is the maintainer for OpenRISC Linux Kernel 4.10. | 11:44 |
*** arcticShadow has quit IRC | 11:56 | |
mithro | futarisWeb: almost got the elf loading stuff working | 11:56 |
mithro | futarisWeb: Yes, I've chatted with him yesterday on #openrisc | 11:56 |
futarisIRCcloud | Ok. | 11:56 |
futarisIRCcloud | arch/openrisc/kernel/setup.c is where the memory setup happens. | 11:58 |
futarisIRCcloud | Anyway, go to go now. | 11:58 |
*** futarisWeb has quit IRC | 11:59 | |
*** sb0 has joined #timvideos | 12:02 | |
mithro | Well, I fixed qemu elf loading | 12:03 |
*** arcticShadow has joined #timvideos | 12:28 | |
*** arcticShadow has quit IRC | 12:30 | |
*** rohitksingh_wor1 has quit IRC | 12:51 | |
*** rohitksingh has joined #timvideos | 14:32 | |
*** rohitksingh has quit IRC | 19:13 | |
CarlFK | anyone 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 |
CarlFK | omg omg omg!!!! can someone put status on the pattern? | 20:01 |
*** arcticShadow has joined #timvideos | 20:17 | |
*** arcticShadow has quit IRC | 21:02 | |
*** arcticShadow has joined #timvideos | 21:54 | |
*** SamSagaZ__ has quit IRC | 22:13 | |
*** CarlFK has quit IRC | 23:41 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!