--- Log opened Thu Jan 15 00:00:56 2015 | ||
olofk | Can anyone explain why we are building binutils with --enable-shared, but gcc with --disable-shared for the newlib toolchain? | 07:21 |
---|---|---|
olofk | Where can I find the finest kernel in the land? | 08:04 |
olofk | openrisc.net/stefan/linux? | 08:05 |
olofk | And will I get into any compatibility troubles wrt atomics if I use a bad combination of sw and hw? | 08:07 |
poke53282 | olofk: http://git.openrisc.net/cgit.cgi/stefan/linux/log/?h=smp | 08:08 |
poke53282 | This is the current reference kernel for me. | 08:08 |
poke53282 | I guess, you have a config option to emulate l.swa and l.lwa. | 08:09 |
poke53282 | Not sure if this is tested well. | 08:09 |
olofk | First thing I see in menuconfig is that 64 bit kernel is set by default. I guess I should turn that off :) | 08:24 |
olofk | And 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: http://git.openrisc.net/cgit.cgi/stefan/linux/tree/arch/openrisc/configs?h=smp | 08:25 |
olofk | Thanks | 08:26 |
olofk | hmm.. 64 bit kernel is still set | 08:27 |
_franck__ | olofk: how do I force which simulator I want to use with fusesoc ? | 08:27 |
_franck__ | --simulator=... ? | 08:27 |
olofk | --sim=<modelsim/verilator/icarus> | 08:27 |
_franck__ | ok thanks | 08:27 |
olofk | fusesoc <global options> sim <put --sim here> system | 08:27 |
olofk | I 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 default | 08:31 |
olofk | But if I run make I have to go through a ton of options. And most stuff is x86-related | 08:31 |
olofk | And 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-linux | 08:34 |
_franck__ | the vanilla kernel still use or32-linux as reference toolchain | 08:34 |
_franck__ | http://git.openrisc.net/cgit.cgi/stefan/linux/tree/arch/openrisc/kernel/vmlinux.lds.S?h=smp#n34 | 08:34 |
_franck__ | ^ you'll have to change this too | 08:35 |
olofk | Where do I define __OR1K__ ? | 08:35 |
olofk | Is that a kernel option? | 08:35 |
_franck__ | ? | 08:35 |
_franck__ | oh it's been updated, I didn't see | 08:36 |
olofk | If __OR1K__ is defined, we get the correct link format | 08:36 |
_franck__ | it's defined by the toolchain | 08:36 |
olofk | ah.. cool | 08:36 |
olofk | Just "make" to build vmlinux, or should I set any env vars first (like ARCH)? | 08:37 |
_franck__ | what I do is: export ARCH=openrisc | 08:37 |
_franck__ | export CROSS_COMPILE= | 08:37 |
_franck__ | make or1k_sim_defconfig | 08:37 |
_franck__ | make | 08:37 |
_franck__ | this __OR1K__ ifdef is not upstreamed :( | 08:38 |
olofk | Yeah, we got a few things we want to upstream | 08:38 |
_franck__ | it's very time to get a co-maintainer | 08:38 |
olofk | I agree | 08:38 |
olofk | Gaahh!!! | 08:39 |
olofk | 1. Check out stekern's smp branch | 08:40 |
olofk | 2. Copy de0_nano_defconfig to .config | 08:40 |
_franck__ | 2. just do "make de0_nano_defconfig" | 08:41 |
olofk | ah. cool. Didn't know | 08:41 |
olofk | But first export ARCH and CROSS_COMPILE | 08:41 |
_franck__ | 2. because if you copy it to .config you'll miss tons of default options | 08:41 |
olofk | Yeah. This seems to work better | 08:42 |
olofk | And then just make? | 08:42 |
_franck__ | yes | 08:42 |
olofk | I still get a lot of questions | 08:42 |
olofk | It seems to ask for everything that is not in de0_nano_defconfig | 08:43 |
_franck__ | I'm cloning the repo right now | 08:44 |
olofk | I just picked default for everything. | 08:44 |
olofk | Fuck! Forgot to change the devie tree | 08:44 |
_franck__ | do "make clean && make mrproper" and redo "make de0_nano_config" | 08:45 |
olofk | I'll try that. The compilation failed | 08:46 |
olofk | cpuinfo undeclared in drivers/spi/spi-oc-simple.c | 08:46 |
olofk | But clean and mrproper helped. I didn't get any questions now | 08:48 |
poke53282 | olofk: "make menuconfig ARCH=openrisc" | 08:48 |
olofk | Why on earth is nfs being compiled for the de0_nano config? | 08:49 |
poke53282 | network maybe. Or it is the or1ksim defconfig | 08:49 |
poke53282 | http://pastie.org/9832876 | 08:51 |
poke53282 | This is m script for jor1k. | 08:51 |
poke53282 | Most of it is jor1k related, but not everything. | 08:52 |
poke53282 | sed -i~ -e "s/or32/or1k/g" src/linux/arch/openrisc/kernel/vmlinux.lds.S | 08:54 |
poke53282 | for example this line | 08:54 |
poke53282 | I would say there are at least ten patches ready for the Linux kernel. | 08:55 |
olofk | Yeah. Could someone contact Jonas about that? | 08:56 |
poke53282 | for the official one I mean. | 08:56 |
poke53282 | Nope, haven't done it yet. | 08:57 |
olofk | Ok, kernel compiles now when I turned off the spi driver | 08:57 |
poke53282 | spi? Which config option? | 08:58 |
olofk | Don't know the exact option, but it's the OpenCores Simple SPI driver. | 08:59 |
olofk | cpuinfo undeclared in drivers/spi/spi-oc-simple. | 08:59 |
olofk | c | 08:59 |
poke53282 | SPI_OCSIMPLE and SPI_OC_TINY | 09:00 |
olofk | IT's the OCSIMPLE one | 09:00 |
poke53282 | I am not using it. | 09:01 |
poke53282 | So might be something related to stekern. | 09:01 |
poke53282 | This is also the part, that conflicted, when I updated to 3.19. | 09:01 |
olofk | What does this mean in gdb? | 09:05 |
olofk | (gdb) x $r3 | 09:05 |
olofk | 0xdeadbeef:0x25c02525 | 09:05 |
olofk | Is the value of r3 0xdeadbeef or 0x25c02525 ? | 09:05 |
poke53282 | not 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 memory | 09:12 |
olofk | aha | 09:12 |
olofk | It seems to work for $pc | 09:12 |
_franck__ | "info register r3" should work | 09:12 |
olofk | cool | 09:12 |
_franck__ | but openocd can do that too ;) | 09:14 |
olofk | Oh.. that's good | 09:15 |
_franck__ | I don't use gdb anymore | 09:16 |
olofk | Looks like I won't be using it either | 09:17 |
olofk | _franck_: Is this done with the telnet intercace (port 4444)? | 09:18 |
olofk | I want to read the PC | 09:19 |
olofk | from OpenOCD | 09:19 |
_franck__ | yes, from the telnet interface. "reg pc" | 09:20 |
olofk | register pc not found in current target | 09:21 |
olofk | npc works | 09:21 |
olofk | Can I read memory with OpenOCD too? | 09:24 |
_franck__ | yep | 09:26 |
_franck__ | mdw | 09:26 |
_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 word | 09:27 |
_franck__ | ... | 09:27 |
stekern | olofk: 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 |
stekern | probably | 09:40 |
olofk | probably broke the driver, or probably takes 15 minutes? | 09:41 |
stekern | probably takes 15 minutes | 09:41 |
olofk | openocd is quite a bit faster | 09:41 |
_franck__ | olofk: it is :( | 09:41 |
olofk | But then I can't signaltap at the same time | 09:41 |
olofk | Need to find out why the kernel ends up in _bus_fault_handler | 09:42 |
olofk | Any debugging tips? | 09:42 |
olofk | I don't get any printouts | 09:42 |
_franck__ | did you set r3 = 0 before running the kernel ? | 09:42 |
olofk | r3. Yeah, I'm pretty sure I did. | 09:43 |
olofk | "reg r3 0" in OpenOCD? | 09:43 |
olofk | I can't do that easily with or1k-download, right? | 09:43 |
_franck__ | yes, bus fault mean bus fault, that should be easy to find | 09:43 |
_franck__ | we could do it in or1k-download | 09:44 |
olofk | Fuck!!! I forgot to set the trigger | 09:44 |
_franck__ | :) a classic one | 09:44 |
olofk | Just have to wait another 15 minutes to download a new kernel :) | 09:44 |
olofk | If not or1k-download can be of help here | 09:44 |
olofk | Jesus! There's a lot of TCL in or1k-tcltools :) | 09:48 |
_franck__ | https://github.com/openrisc/or1k-tcltools/blob/master/loader.tcl#L316 | 09:49 |
stekern | olofk: http://git.openrisc.net/cgit.cgi/stefan/linux/commit/?h=smp&id=accd1fd6022d411edebe500383bd55079e062e91 | 09:50 |
olofk | Cool! | 09:50 |
_franck__ | replace adbg_wb_burst_read with adbg_wb_burst_write and the right parameters and run it before we start the downloaded program | 09:50 |
_franck__ | (need to create another function) | 09:50 |
olofk | Hmm... why isn't my kernel booting? How early is the earliest printk? | 09:54 |
poke53282 | to the serial console? | 09:56 |
poke53282 | "decompressing linux ..." maybe? | 09:57 |
stekern | "decompressing linux"? | 09:59 |
stekern | there's no such output | 10:00 |
stekern | the first printk is from the devicetree stuff | 10:00 |
stekern | but it will be buffered until the device tree is parsed and the cpu clock is determined | 10:01 |
_franck__ | olofk: http://pastie.org/9832980 <-- reset r3 in or1k-tcltools (not tested) | 10:02 |
poke53282 | Ahh, yes. I forgot the buffering. | 10:05 |
_franck__ | olofk: if you have some time, could you please try this new branch: https://github.com/openrisc/or1k-tcltools/tree/for_testing ? | 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 work | 10:49 |
olofk | stekern: Can I turn off buffering somehow? | 10:55 |
olofk | I have successfully run a bare-metal hello world, so I know that the uart works | 10:56 |
olofk | and 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 |
olofk | ok, 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 |
LoneTech | for a bus fault eear might be interesting too | 11:08 |
olofk | Aha! Found eear0. It's register 61 in OpenOCD | 11:17 |
olofk | But it just points me to 0x200 | 11:17 |
stekern | what's epcr | 11:23 |
LoneTech | I suspect also 200. I suspect a bus error fetching the first instruction of the bus error handler. | 11:26 |
stekern | olofk: (check magic and fall back) that's exactly what we do | 11:28 |
olofk | stekern: Aha. So then it shouldn't matter what r3 is set to | 11:30 |
olofk | Hmm.... it looks like the bus fault occurs after just reading two instructions from the boot rom | 11:31 |
olofk | stekern: Tracing pc_decode should give me a good picture of what happens, right? | 11:31 |
stekern | olofk: it does matter what r3 is set to, because that is the *pointer* to where the magic value should be read from | 11:33 |
stekern | and if that mem address cause a bus fault when you try to check for the magic value, you're screwed | 11:34 |
stekern | I usually trace pc_execute | 11:35 |
olofk | Ah.. right. And it's of course hard/impossible to do any sanity checks on r3 to see if it's an addressable address | 11:36 |
stekern | at least hard | 11:37 |
stekern | I suppose it'd be easy to verify that it at least is aligned right... | 11:37 |
olofk | How does other arches handle that? Is a bootloader assumed? | 11:37 |
stekern | think so | 11:38 |
stekern | I think it's pretty unusual that you go straight from reset vector into booting the kernel | 11:38 |
olofk | Isn'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 configurable | 11:39 |
stekern | there's u-boot spl | 11:41 |
olofk | I 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 directly | 11:41 |
olofk | Only drawback will be that it will take four cycles per access, but I don't think that matters | 11:41 |
olofk | HA! I think I see the error. It jumps from F0000104 to F0000204 | 11:43 |
olofk | So it's a relative jump instead of an absolute | 11:44 |
olofk | So.... absolute jumps? How? | 11:44 |
LoneTech | via register | 11:44 |
olofk | l.jr | 11:45 |
olofk | Aha. I always thought that was Jump Return (from a function) | 11:46 |
LoneTech | well, if you jump to link register, it is used that way | 11:46 |
olofk | True | 11:47 |
olofk | So my trusty bootloader has probably never worked at all :) | 11:48 |
olofk | hmmm | 12:17 |
olofk | I found the problem | 12:17 |
olofk | When 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 error | 12:18 |
olofk | How is this supposed to work? | 12:18 |
olofk | Maybe enabling the IMMU again might improve things :) | 12:19 |
olofk | Do I need both IMMU and DMMU? | 12:19 |
olofk | Booting!!! | 12:26 |
olofk | ...a bit at least | 12:27 |
olofk | Looks like busybox isn't starting | 12:28 |
olofk | A bit harder to debug this now. It's running around in rcu_idle_enter, rcu_idle_exit, arch_local_save_flags... | 12:38 |
olofk | and last thing I see is "Freeing unused kernel memory: 1648K (c0254000 - c03f0000)" | 12:38 |
olofk | Where is the kernel leaving control to busybox? | 12:39 |
olofk | Do 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 panic...no init found" | 12:43 |
olofk | Good idea | 12:43 |
olofk | Yep. Now it panics because it can't find busybox | 12:45 |
olofk | Anything with atomics perhaps? | 12:45 |
olofk | Or do I need to turn on one of the ramdisk compression alghoritms? | 12:47 |
olofk | I did turn off bunch of kernel options. Maybe I turned off too much (gentoo habit) | 12:48 |
stekern | can you start that kernel in or1ksim? | 12:57 |
stekern | do you have atomics enabled or disabled? | 13:00 |
olofk | Yep, I can start it in or1ksim | 13:07 |
olofk | # CONFIG_OPENRISC_HAVE_INST_LWA_SWA is not set | 13:07 |
olofk | I'm using mor1kx 2.2 | 13:07 |
olofk | kernel from your smp head | 13:07 |
olofk | It looks like the kernel is alive since it jumps between functions. It just doesn't seem to have very much work to do | 13:08 |
olofk | stekern: btw, there is an option CONFIG_PROC_DEVICETREE in the de0_nano_defconfig that I can't find in the kernel | 13:09 |
stekern | is atomics enabled in mor1kx? | 13:11 |
stekern | (they are by default) | 13:11 |
olofk | stekern: Even in 2.2? | 13:12 |
olofk | Looking at the mor1kx parameters I haven't turned anything off at least | 13:13 |
stekern | yes, even in 2.2 | 13:14 |
olofk | hm.. So what else can it be? | 13:14 |
olofk | It was easier when it crashed :) | 13:15 |
stekern | hmm, not sure | 13:17 |
olofk | UART irq wasn't connected. Could be that perhaps | 13:18 |
stekern | yes | 13:18 |
stekern | uart tx is interrupt driven after the boot console is switched away | 13:18 |
olofk | I'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_: Cool | 13:21 |
_franck__ | r3 is now cleared | 13:21 |
olofk | Did that not work before? | 13:21 |
_franck__ | it worked but it didn't clear r3 | 13:22 |
olofk | ah ok | 13:22 |
_franck__ | I think I'll add a console to or1k-tcltools so we can read/write memory like in openocd | 13:22 |
olofk | awesome | 13:22 |
olofk | It's very useful to be able to use signaltap at the same time | 13:23 |
_franck__ | I just need to figure out how to do that ;) | 13:23 |
olofk | init started: BusyBox v1.23.0.git (2014-07-16 07:52:52 EEST) | 13:25 |
olofk | That took a while :) | 13:35 |
stekern | freescales documentation is about as well organized as ours... | 14:02 |
ams | i.e. not at all? | 14:02 |
stekern | pretty much | 14:03 |
-!- knz_ is now known as knz | 14:36 | |
Me1234 | ok, ran tests/turnup.sh (output from not first run: https://drive.google.com/file/d/0B5U7b-LVTCGtOU5xTzJ6b3gzUVU/view?usp=sharing). rootfs incomplete. | 17:18 |
Me1234 | simulator output https://drive.google.com/file/d/0B5U7b-LVTCGtNzNTQUo2V00zVG8/view?usp=sharing | 17:18 |
Me1234 | modified turnup.sh https://drive.google.com/file/d/0B5U7b-LVTCGtSlZ1c19vU1JiR1k/view?usp=sharing | 17:19 |
Me1234 | How to get complete rootfs? need to compile busybox? | 17:20 |
stekern | Me1234: you can get a initramfs from here: http://git.openrisc.net/cgit.cgi/stefan/linux/tree/arch/openrisc/support/initramfs?h=smp | 17:49 |
ysangkok | maybe this is also useful: https://github.com/s-macke/jor1k/wiki/How-to-develop-for-jor1k#chroot-into-an-emulated-sysroot-environment | 17:51 |
stekern | indeed | 18:05 |
-!- 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, enghong | 22: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.net | 23: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 secs | 23:10 | |
-!- ServerMode/#openrisc [-o juliusb] by tepper.freenode.net | 23:11 | |
!tepper.freenode.net *** Notice -- TS for #openrisc changed from 1421363413 to 1301926790 | 23:11 | |
-!- ServerMode/#openrisc [+ct-s] by tepper.freenode.net | 23:11 | |
-!- tepper.freenode.net changed the topic of #openrisc to: Official OpenRISC Project channel | http://opencores.org/or1k | http://openrisc.net | wiki: http://opencores.org/or1k/OR1K:Community_portal | Mailing lists: http://lists.openrisc.net/ http://lists.opencores.org/ | forum: http://opencores.org/forum,OpenRISC | git: https://github.com/openrisc | IRC log: http://juliusbaxter.net/openrisc-irc/ | OpenCores in #opencores | 23:11 | |
-!- ysangkok_ is now known as ysangkok | 23:27 | |
--- Log closed Fri Jan 16 00:00:57 2015 |
Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!