IRC logs for #openrisc Thursday, 2015-01-15

--- Log opened Thu Jan 15 00:00:56 2015
olofkCan anyone explain why we are building binutils with --enable-shared, but gcc with --disable-shared for the newlib toolchain?07:21
olofkWhere can I find the finest kernel in the land?08:04
olofkAnd will I get into any compatibility troubles wrt atomics if I use a bad combination of sw and hw?08:07
poke53282This is the current reference kernel for me.08:08
poke53282I guess, you have a config option to emulate l.swa and l.lwa.08:09
poke53282Not sure if this is tested well.08:09
olofkFirst thing I see in menuconfig is that 64 bit kernel is set by default. I guess I should turn that off :)08:24
olofkAnd PC speaker is enabled. Hmm.... is really make ARCH=openrisc defconfig working as intended?08:25
_franck__I think defconfig won't work. Pick on of these:
olofkhmm.. 64 bit kernel is still set08:27
_franck__olofk: how do I force which simulator I want to use with fusesoc ?08:27
_franck__--simulator=... ?08:27
_franck__ok thanks08:27
olofkfusesoc <global options> sim <put --sim here> system08:27
olofkI think :)08:27
olofk_franck__: There are just a few options in the defconfigs you gave me. What about the rest of all options?08:30
_franck__they fall back to default08:31
olofkBut if I run make I have to go through a ton of options. And most stuff is x86-related08:31
olofkAnd should the cross compile prefix really be or32-linux?08:33
_franck__export CROSS_COMPILE=/your/path/here/or1k-elf-08:33
_franck__but yes, the default one is still or32-linux08:34
_franck__the vanilla kernel still use or32-linux as reference toolchain08:34
_franck__^ you'll have to change this too08:35
olofkWhere do I define __OR1K__  ?08:35
olofkIs that a kernel option?08:35
_franck__oh it's been updated, I didn't see08:36
olofkIf __OR1K__ is defined, we get the correct link format08:36
_franck__it's defined by the toolchain08:36
olofkah.. cool08:36
olofkJust "make" to build vmlinux, or should I set any env vars first (like ARCH)?08:37
_franck__what I do is: export ARCH=openrisc08:37
_franck__export CROSS_COMPILE=08:37
_franck__make or1k_sim_defconfig08:37
_franck__this __OR1K__ ifdef is not upstreamed :(08:38
olofkYeah, we got a few things we want to upstream08:38
_franck__it's very time to get a co-maintainer08:38
olofkI agree08:38
olofk1. Check out stekern's smp branch08:40
olofk2. Copy de0_nano_defconfig to .config08:40
_franck__2. just do "make de0_nano_defconfig"08:41
olofkah. cool. Didn't know08:41
olofkBut first export ARCH and CROSS_COMPILE08:41
_franck__2. because if you copy it to .config you'll miss tons of default options08:41
olofkYeah. This seems to work better08:42
olofkAnd then just make?08:42
olofkI still get a lot of questions08:42
olofkIt seems to ask for everything that is not in de0_nano_defconfig08:43
_franck__I'm cloning the repo right now08:44
olofkI just picked default for everything.08:44
olofkFuck! Forgot to change the devie tree08:44
_franck__do "make clean && make mrproper" and redo "make de0_nano_config"08:45
olofkI'll try that. The compilation failed08:46
olofkcpuinfo undeclared in drivers/spi/spi-oc-simple.c08:46
olofkBut clean and mrproper helped. I didn't get any questions now08:48
poke53282olofk: "make menuconfig ARCH=openrisc"08:48
olofkWhy on earth is nfs being compiled for the de0_nano config?08:49
poke53282network maybe. Or it is the or1ksim defconfig08:49
poke53282This is m script for jor1k.08:51
poke53282Most of it is jor1k related, but not everything.08:52
poke53282sed -i~ -e "s/or32/or1k/g" src/linux/arch/openrisc/kernel/
poke53282for example this line08:54
poke53282I would say there are at least ten patches ready for the Linux kernel.08:55
olofkYeah. Could someone contact Jonas about that?08:56
poke53282for the official one I mean.08:56
poke53282Nope, haven't done it yet.08:57
olofkOk, kernel compiles now when I turned off the spi driver08:57
poke53282spi? Which config option?08:58
olofkDon't know the exact option, but it's the OpenCores Simple SPI driver.08:59
olofkcpuinfo undeclared in drivers/spi/spi-oc-simple.08:59
poke53282SPI_OCSIMPLE and SPI_OC_TINY09:00
olofkIT's the OCSIMPLE one09:00
poke53282I am not using it.09:01
poke53282So might be something related to stekern.09:01
poke53282This is also the part, that conflicted, when I updated to 3.19.09:01
olofkWhat does this mean in gdb?09:05
olofk(gdb) x $r309:05
olofkIs the value of r3 0xdeadbeef or 0x25c02525 ?09:05
poke53282not sure what you mean. Haven't worked with openrisc related gdb stuff.09:08
_franck__olofk: "info registers"09:09
_franck__andI think x is only for memory09:12
olofkIt seems to work for $pc09:12
_franck__"info register r3" should work09:12
_franck__but openocd can do that too ;)09:14
olofkOh.. that's good09:15
_franck__I don't use gdb anymore09:16
olofkLooks like I won't be using it either09:17
olofk_franck_: Is this done with the telnet intercace (port 4444)?09:18
olofkI want to read the PC09:19
olofkfrom OpenOCD09:19
_franck__yes, from the telnet interface. "reg pc"09:20
olofkregister pc not found in current target09:21
olofknpc works09:21
olofkCan I read memory with OpenOCD too?09:24
_franck__ mdw [phys] addr [count]09:27
_franck__ mdh [phys] addr [count]09:27
_franck__mdb [phys] addr [count]09:27
_franck__mww [phys] addr word09:27
stekernolofk: ah, yes I might have broke the spi driver...09:39
olofk_franck_: Is it supposed to take something like 15 minutes to load a kernel with or1k-tcltools?09:40
olofkprobably broke the driver, or probably takes 15 minutes?09:41
stekernprobably takes 15 minutes09:41
olofkopenocd is quite a bit faster09:41
_franck__olofk: it is :(09:41
olofkBut then I can't signaltap at the same time09:41
olofkNeed to find out why the kernel ends up in _bus_fault_handler09:42
olofkAny debugging tips?09:42
olofkI don't get any printouts09:42
_franck__did you set r3 = 0 before running the kernel ?09:42
olofkr3. Yeah, I'm pretty sure I did.09:43
olofk"reg r3 0" in OpenOCD?09:43
olofkI can't do that easily with or1k-download, right?09:43
_franck__yes, bus fault mean bus fault, that should be easy to find09:43
_franck__we could do it in or1k-download09:44
olofkFuck!!! I forgot to set the trigger09:44
_franck__:) a classic one09:44
olofkJust have to wait another 15 minutes to download a new kernel :)09:44
olofkIf not or1k-download can be of help here09:44
olofkJesus! There's a lot of TCL in or1k-tcltools :)09:48
_franck__replace adbg_wb_burst_read with adbg_wb_burst_write and the right parameters and run it before we start the downloaded program09:50
_franck__(need to create another function)09:50
olofkHmm... why isn't my kernel booting? How early is the earliest printk?09:54
poke53282to the serial console?09:56
poke53282"decompressing linux ..." maybe?09:57
stekern"decompressing linux"?09:59
stekernthere's no such output10:00
stekernthe first printk is from the devicetree stuff10:00
stekernbut it will be buffered until the device tree is parsed and the cpu clock is determined10:01
_franck__olofk:   <-- reset r3 in or1k-tcltools (not tested)10:02
poke53282Ahh, yes. I forgot the buffering.10:05
_franck__olofk: if you have some time, could you please try this new branch: ?10:25
olofk_franck_: I will do that later. For now, I changed the bootloader to clear r3 and jump to 0x100, but it still doesn't work10:49
olofkstekern: Can I turn off buffering somehow?10:55
olofkI have successfully run a bare-metal hello world, so I know that the uart works10:56
olofkand there must be some better way to handle the device trees. Isn't there some magic value in the beginning of the device-tree that we can check against and fall back to an internal tree if that fails?10:58
olofkok, once I'm in bus_fault_handler, is there any way to figure out why I ended up there? Isn't there some "This is where we encountered the exception" address?11:05
_franck__epcr register ?11:07
LoneTechfor a bus fault eear might be interesting too11:08
olofkAha! Found eear0. It's register 61 in OpenOCD11:17
olofkBut it just points me to 0x20011:17
stekernwhat's epcr11:23
LoneTechI suspect also 200. I suspect a bus error fetching the first instruction of the bus error handler.11:26
stekernolofk: (check magic and fall back) that's exactly what we do11:28
olofkstekern: Aha. So then it shouldn't matter what r3 is set to11:30
olofkHmm.... it looks like the bus fault occurs after just reading two instructions from the boot rom11:31
olofkstekern: Tracing pc_decode should give me a good picture of what happens, right?11:31
stekernolofk: it does matter what r3 is set to, because that is the *pointer* to where the magic value should be read from11:33
stekernand if that mem address cause a bus fault when you try to check for the magic value, you're screwed11:34
stekernI usually trace pc_execute11:35
olofkAh.. right. And it's of course hard/impossible to do any sanity checks on r3 to see if it's an addressable address11:36
stekernat least hard11:37
stekernI suppose it'd be easy to verify that it at least is aligned right...11:37
olofkHow does other arches handle that? Is a bootloader assumed?11:37
stekernthink so11:38
stekernI think it's pretty unusual that you go straight from reset vector into booting the kernel11:38
olofkIsn't there any ultra small bootloaders that could fit into a block RAM? I have started a collection of tiny assembler hacks, but it would be a lot of work to do something more configurable11:39
stekernthere's u-boot spl11:41
olofkI got an idea yesterday for how to improbe wb_ram btw. I'm going to rewrite it to use a 8-bit RAM and add some 32-to-8 logic outside of that. Two benefits will be that it will be easier for tools to map it properly to HW resources, and we can also use the or1k-elf-objdump verilog backend directly11:41
olofkOnly drawback will be that it will take four cycles per access, but I don't think that matters11:41
olofkHA! I think I see the error. It jumps from F0000104 to F000020411:43
olofkSo it's a relative jump instead of an absolute11:44
olofkSo.... absolute jumps? How?11:44
LoneTechvia register11:44
olofkAha. I always thought that was Jump Return (from a function)11:46
LoneTechwell, if you jump to link register, it is used that way11:46
olofkSo my trusty bootloader has probably never worked at all :)11:48
olofkI found the problem12:17
olofkWhen it jumps to or32_early_setup, it tries to read c0xxxxxx, but up until that it has read addresses starting with 00xxxxxxx, so it gets a bus error12:18
olofkHow is this supposed to work?12:18
olofkMaybe enabling the IMMU again might improve things :)12:19
olofkDo I need both IMMU and DMMU?12:19
olofk...a bit at least12:27
olofkLooks like busybox isn't starting12:28
olofkA bit harder to debug this now. It's running around in rcu_idle_enter, rcu_idle_exit, arch_local_save_flags...12:38
olofkand last thing I see is "Freeing unused kernel memory: 1648K (c0254000 - c03f0000)"12:38
olofkWhere is the kernel leaving control to busybox?12:39
olofkDo I have to do something funky with my busybox?12:41
_franck__I don't think it's your busybox, that would be later. To be sure, you can remove support for initramfs in the kernel and see if you go until "Kernel init found"12:43
olofkGood idea12:43
olofkYep. Now it panics because it can't find busybox12:45
olofkAnything with atomics perhaps?12:45
olofkOr do I need to turn on one of the ramdisk compression alghoritms?12:47
olofkI did turn off bunch of kernel options. Maybe I turned off too much (gentoo habit)12:48
stekerncan you start that kernel in or1ksim?12:57
stekerndo you have atomics enabled or disabled?13:00
olofkYep, I can start it in or1ksim13:07
olofk# CONFIG_OPENRISC_HAVE_INST_LWA_SWA is not set13:07
olofkI'm using mor1kx 2.213:07
olofkkernel from your smp head13:07
olofkIt looks like the kernel is alive since it jumps between functions. It just doesn't seem to have very much work to do13:08
olofkstekern: btw, there is an option CONFIG_PROC_DEVICETREE in the de0_nano_defconfig that I can't find in the kernel13:09
stekernis atomics enabled in mor1kx?13:11
stekern(they are by default)13:11
olofkstekern: Even in 2.2?13:12
olofkLooking at the mor1kx parameters I haven't turned anything off at least13:13
stekernyes, even in 2.213:14
olofkhm.. So what else can it be?13:14
olofkIt was easier when it crashed :)13:15
stekernhmm, not sure13:17
olofkUART irq wasn't connected. Could be that perhaps13:18
stekernuart tx is interrupt driven after the boot console is switched away13:18
olofkI'm so psyched now! Building a bitstream has never felt this slow :)13:19
_franck__i tested my new version of or1k-tcltools and it seems to work (at least it runs barebox)13:21
olofk_franck_: Cool13:21
_franck__r3 is now cleared13:21
olofkDid that not work before?13:21
_franck__it worked but it didn't clear r313:22
olofkah ok13:22
_franck__I think I'll add a console to or1k-tcltools so we can read/write memory like in openocd13:22
olofkIt's very useful to be able to use signaltap at the same time13:23
_franck__I just need to figure out how to do that ;)13:23
olofkinit started: BusyBox v1.23.0.git (2014-07-16 07:52:52 EEST)13:25
olofkThat took a while :)13:35
stekernfreescales documentation is about as well organized as ours...14:02
amsi.e. not at all?14:02
stekernpretty much14:03
-!- knz_ is now known as knz14:36
Me1234ok, ran tests/ (output from not first run: rootfs incomplete.17:18
Me1234simulator output
Me1234How to get complete rootfs? need to compile busybox?17:20
stekernMe1234: you can get a initramfs from here:
ysangkokmaybe this is also useful:
-!- Netsplit *.net <-> *.split quits: clopez, ysangkok, mithro, tariq786, _franck_, enghong, ssvb, dalias, Amadiro, kiwichris, (+30 more, use /NETSPLIT to show all of them)22:52
-!- Netsplit over, joins: kiwichris, ssvb, martinboehnert, felixr, Me1234, O01eg, trevorman, knz, enghong, ams (+18 more)22:53
-!- Netsplit *.net <-> *.split quits: wallento, ams, knz, enghong22:54
--- Log closed Thu Jan 15 23:04:58 2015
--- Log opened Thu Jan 15 23:10:13 2015
-!- ServerMode/#openrisc [+ns] by tepper.freenode.net23:10
-!- Irssi: #openrisc: Total of 1 nicks [1 ops, 0 halfops, 0 voices, 0 normal]23:10
-!- Irssi: Join to #openrisc was synced in 7 secs23:10
-!- ServerMode/#openrisc [-o juliusb] by tepper.freenode.net23:11
! *** Notice -- TS for #openrisc changed from 1421363413 to 130192679023:11
-!- ServerMode/#openrisc [+ct-s] by tepper.freenode.net23:11
-!- changed the topic of #openrisc to: Official OpenRISC Project channel | | | wiki: | Mailing lists: | forum:,OpenRISC | git: | IRC log: | OpenCores in #opencores23:11
-!- ysangkok_ is now known as ysangkok23:27
--- Log closed Fri Jan 16 00:00:57 2015

Generated by 2.15.2 by Marius Gedminas - find it at!