IRC logs for #openrisc Wednesday, 2014-01-15

--- Log opened Wed Jan 15 00:00:54 2014
olofk_Does anyone have a linux hex file for that poor guy on the opencores forum?06:13
olofk_For de0 nano06:13
stekernI guess we could just objcopy one from the pre-built linux image from the workshop06:22
stekernI wonder why he want a hex though06:30
stekernmaybe he's just confused and a link to the elf will suffice06:30
olofk_I found an interesting hack yesterday here
olofk_Someone managed to compile the Xilinx simulation libraries so that they could be used with icarus06:46
stekerndoes that include the annoying "secure" ones too?06:48
olofk_Can't get it to work though. Have to make the Xilinx tools believe that ncsim is installed, but they might have changed the way for identifying that since the howto was written06:48
olofk_Good question06:48
olofk_I know that at least one of the simulation IP's we bought here used VPI for the business logic, so in that case it should just be to supply the correct .so file06:49
olofk_But encrypted verilog is probably not that easy to handle in icarus06:49
olofk_It's extra annoying now that Xilinx don't even provide a branded modelsim anymore since their toy simulator ISim don't support VPI06:51
stekernproprietary external encrypted simulation libraries wasn't what I had in mind though, I was more thinking about xilinx's own core libraries for their hard ip06:56
olofk_Yes, I'm mostly interested in the easy stuff like clock buffers, block RAM and stuff like that07:07
olofk_and of course the hard memory controllers07:07
olofk_ok, now I'm confused. The verilog code for the Xilinx primitives seem to be available in the installation. That would mean that no precompiled libs are needed at all for the basic stuff08:05
stekern...except for the annoying secure ones08:07
olofk_I'm feeling more and more how awesome it would be with a FPGA that has open specifications and toolchain08:15
olofk_Any potential startups in that area can have my money08:15
stekernmine too08:34
olofk_Great! Now we have two money08:38
olofk_I wonder how many money we need?08:38
stekernone more could be enough, if it's a big one08:46
blueCmd_another one bites the dust: linux-libc-dev_3.12.6-2.1_or1k.deb08:56
_franck_web_olofk_: last three commits are for you09:10
_franck_web_now I need to work for my boss ;)09:10
olofk__franck_web_: Awesome. I'll take a look at it after $dayjob09:36
olofk_blueCmd_: Still waiting for skype_or1k.deb ;)09:37
stekernit seems like it's a packet a day business blueCmd_ =)09:56
olofk_blueCmd_: How does your environment look for building .debs? Is it some chroot/qemu mumbo jumbo, or building inside or1ksim with native gcc?10:44
blueCmd_stekern: yes, slow and steady11:30
blueCmd_it's a lot of quirks :P I could do a day and just compile like 100 lib-debs, but that would be cheating - at least this is useful :)11:31
maxpalnHi, trying to work out if Linux is able to communiate with the SPI Flash - I am not convinced at the moment. Any ideas where the device should be in the Linux file system - I was expecting to see something under /dev that I could mount13:48
_franck_web_did you add the flash device under your spi node like this:
maxpaln_franck_web_ - I have something similar, although every example I see looks a little different14:11
maxpalnHere is what I have:14:11
maxpaln  spi0: spi0@b0000000 {14:12
maxpaln    compatible = "opencores,spi-simple";14:12
maxpaln    reg = <0xb0000000 0x5>;14:12
maxpalninterrupts = <6>;14:12
maxpalnWhen Linux boots I get the message to say the Opencores Simple SPI Driver has been loaded14:13
maxpaln"OpenCores Simple SPI controller (c) 2010 South Pole AB"14:13
_franck_web_did you enable the SPI flash driver in your config ?14:13
_franck_web_is it probed ?14:14
maxpalngood question - how do I check that?14:14
_franck_web_a printk ? :)14:15
maxpalnbut where? I was just trying to find the entry point to the SPI device drivers -14:16
maxpalnI have enabled the MTD drivers in the config but I haven't got as far as how the device itself gets probed14:16
LoneTechyou can probe via spi, if you have the appropriate driver14:17
_franck_web_can you paste your hole SPI devicetree node ?14:17
maxpalnyou mean in the dts file?14:18
LoneTechI think it's usually m25p8014:18
_franck_web_yes, the dts file14:18
maxpalnI posted it above - here it is again:14:18
maxpaln  spi0: spi0@b0000000 {14:18
maxpaln    compatible = "opencores,spi-simple";14:18
maxpaln    reg = <0xb0000000 0x5>;14:18
maxpalninterrupts = <6>;14:18
_franck_web_it that all ?14:18
_franck_web_your SPi flash won't be probed14:19
LoneTechbut you can do that via sysfs14:19
_franck_web_look at what I pasted14:19
maxpalnhmmm, that was strange - I logged out and back in again, can you see the DTS contents14:19
LoneTechwe only saw the spi0 block, nothing on the eeprom14:19
maxpalnah, you want the whole dts?14:20
maxpalnhere it is:14:20
_franck_web_use this:
maxpalnperfect - nice link: here it is14:20
LoneTechright, that does contain a description of the flash and two partitions14:22
_franck_web_that should work14:22
maxpalnI can see several differences with the link you posted _frank_web_14:22
maxpalnbut nothing that should obviously prevent it from working14:22
maxpalnok, so we think it should work - this is good, I came to the same conclusoin14:22
maxpalnso, I have assumed Linux won't auto mount the SPI Flash - is this a far assumption?14:23
LoneTechso it might show up in /dev/mtd* or /sys/bus/spi*14:23
_franck_web_./mtd/devices/m25p80.o do you have this ? (to be sure your config is ok)14:23
LoneTechit may be built in, should show up at /sys/bus/spi/drivers/m25p8014:24
maxpalnok so /sys/bus/drivers is empty14:24
blueCmd_olofk_: sorry, I missed your question14:25
LoneTechcan you modprobe m25p80?14:25
blueCmd_olofk_: chroot with a shitload of mumbo jumbo14:25
maxpalnHere is the result:14:26
blueCmd_I'm going to cross compile as much as I can and the longer term is making qemu work with it so you can do native compilation through that14:26
maxpaln# modprobe m25p8014:26
maxpalnmodprobe: chdir(/lib/modules): No such file or directory14:26
LoneTechsounds like the kernel you have has the SPI driver but not the driver for SPI flash chips, and you don't have modules in the filesystem for it to add either14:27
_franck_web_another one: cat .config | grep M25P8014:27
maxpaln_franck_web_ - you may have it14:28
maxpaln# cat marvell_phy_and_spi.config | grep M25P8014:28
maxpaln# CONFIG_MTD_M25P80 is not set14:28
LoneTechright. that's the driver for spi flash14:28
maxpalnBUT i have enabled MTD drivers in the config14:28
_franck_web_not enough14:28
_franck_web_"Self-contained MTD device drivers"14:29
LoneTechMTD is the subsystem for flashes in general, m25p80 is the driver for most SPI ones in particular14:29
LoneTechfrom your DTS, we have: compatible = "stm,m25p64";14:30
LoneTech/sbin/modinfo m25p80|grep m25p64 shows: alias:          spi:m25p6414:30
maxpalnok, so under "Self-Contained MTD Device Drivers" I have included "Support for most ..."14:32
maxpalnI now get14:32
maxpaln]# cat marvell_phy_and_spi.config | grep M25P8014:32
maxpalnThis looks promising - I will rebuild and retry14:33
LoneTechmounting is another layer, though. you might want to have ubifs, jffs2 or some other flash adapted filesystem if you really want it mounted directly, but that's so slow we usually just load initrds or some such14:35
maxpalnaha - SPI related info during booting so something has definitely changed14:36
maxpalnthanks so far - this has helped a lot14:41
maxpalnI am now getting errors about partitions extending beyond the end of the device:14:42
maxpaln"mtd: partition "free_space" extends beyond the end of device "spi32766.0" -- size truncated to 0x400000"14:42
maxpalnHow does Linux determine the size of the device? Is it from the device itself? or from the drivers?14:42
maxpalnthe SPI is 64Mbit, 0x400000 is only a small section of it14:43
_franck_web_AFAIR, it compare what you told him m25p64 and what is read from the device14:44
maxpalnhmmm, odd!14:44
_franck_web_0x03000000 if far after 64Mbits, no ?14:45
maxpalnyou could be right - I was just redoing the calcs now14:45
_franck_web_0x00800000 is your last address14:45
maxpalnagreed - not sure how I came up with the range in my DTS file!14:47
maxpalnok, this appears to be working - all the ranges are valid and so on14:59
maxpalnnow to mounting - I know it will be slow but it's the only Flash device on the target board so I'll live with it for now!14:59
stekernblueCmd_: have sebastian mackes qemu patches made it to upstream? if not, are you using them?15:15
stekernnot sure if anything was um related, but he found a bunchload of bugs in it15:15
stekern+ he did a lot of optimisations15:16
blueCmd_stekern: haven't tried using them15:19
blueCmd_yeah, I saw the patches15:19
blueCmd_I haven't tried using qemu*15:19
blueCmd_I know I will need to patch it anyway since I have a new syscall that is or1k specific15:20
stekernblueCmd_: now I'm confused, I thought you were using um qemu in the chrooted environment15:45
blueCmd_stekern: nope, all cross compiled for now15:45
stekernok, yeah I see now that you wrote that ;)15:45
stekernbut how is a new syscall something that would affect qemu?15:46
blueCmd_stekern: pretty sure it does not contain my additions to or1k_atomic that I haven't even sent to Jonas yet :P17:10
blueCmd_which everything using pthreads will use17:11
stekernblueCmd_: that doesn't answer my question, does qemu care about syscalls?17:42
blueCmd_stekern: it would have to right?18:04
blueCmd_since it's not running a kernel (i'm talking about the user-space qemu)18:05
stekernyeah, I think I've come to the same conclusion now when I started to think about it more18:13
stekernslightly related, I just noticed that nios 2 does that testandset in a weird way, it disables interrupts directly in that function18:20
stekernin uclibc that is18:20
stekerncan you disable interrupts from userspace in nios2?18:21
blueCmd_stekern: gcc-4.8-or1k-linux-gnu_4.8.2-13.1_amd64.db, libgcc+4.8-dev-or1k-cross_4.8.2-13.1_all.deb cpp-4.8-or1k-linux-gnu_4.8.2-13.1_amd64.deb22:48
blueCmd_so I'm breaking your '1 package per day'22:49
olofkblueCmd_: That's really cool. How much work (I guess a lot) would it be to bootstrap a debian that can install those packages?23:23
_franck_olofk: wait, I have a question23:25
_franck_when you have a SimulatorIcarus(Simulator) class23:27
_franck_SimulatorIcarus is herited from Simulator (? right, kind of)23:27
_franck_both class have def run23:28
_franck_which one is called when you do ?23:28
_franck_ok I found my error :)23:31
blueCmd_olofk: those packages are for amd64, so those are just the crosscompilers atm23:46
blueCmd_you need to add a repository or download the debs yourself23:47
blueCmd_but it's a very simple way of installing a cross compiler which is nice23:48
--- Log closed Thu Jan 16 00:00:56 2014

Generated by 2.15.2 by Marius Gedminas - find it at!