**** BEGIN LOGGING AT Thu May 15 02:59:59 2014 May 15 04:24:55 hmmm i don't get how sid got this codez to work May 15 05:03:05 gah warning: relocation to symbol "C0" overflowed; the 18-bit relocated address May 15 06:05:16 that would never happen on x86 May 15 08:20:30 x86 all things! May 15 08:20:38 as long as i'm employed here May 15 08:20:59 * mranostay looks for other ships 3 years out May 15 09:16:13 mranostay: sid defines C4 like this: int C4 __attribute__((cregister("MEM",near),peripheral)); May 15 09:17:19 yeah need far pointers May 15 09:17:26 need to sleep for dayjob May 15 09:17:37 * mranostay converts to x86 protected mode May 15 09:17:43 k May 15 09:17:59 day starts at? May 15 09:18:05 5 hours from now May 15 09:18:15 * mranostay rarely sleeps May 15 09:37:34 mranostay: would a 16-byte SBBO instruction to DDR complete in a single cycle? May 15 13:05:41 * karki_ is happy that is theory exams are over! May 15 13:05:50 * karki_ *his May 15 13:07:04 Abhishek_ : any access to the DDR would take multiple cycles! May 15 13:21:44 that I understand, but I have to quantify it for my application May 15 13:25:33 as in? May 15 13:26:30 Abhishek_ : are the access cycles constant when accessing the DDR? (I doubt it....) May 15 13:27:11 not expected, depends on the L3Fast interconnect that connects them May 15 13:27:35 panto : Hi! May 15 14:53:23 karki_: so u are done now...i'm just starting :( May 15 14:56:10 vvu|Log : It's okay.... I still have a week left :( May 15 14:56:44 oh well May 15 14:57:15 panto : wanted to discuss some device driver stuff with you! May 15 15:04:30 vvu|Log : have you worked with kobjects? May 15 15:08:36 mranostay : what is the significance of __attribute__ in your code? May 15 15:09:37 that's the new TI Compiler magic May 15 15:10:50 is it in the doc? May 15 15:11:08 Abhishek_ : what does it do? May 15 15:11:12 Check README.txt, I posted a link on Sunday, IIRC May 15 15:15:19 * karki_ should RTM more :p May 15 16:07:35 Abhishek_: README.txt is barely helpful :) May 15 16:08:11 we need READMORE.txt :P May 15 16:10:20 Abhishek_ : +1 ;) May 15 16:10:41 I want an opensource C compiler! May 15 16:11:27 Well there's a GCC port to PRU ds2 linked to once May 15 16:11:39 I wonder if it's usable May 15 16:28:53 I remember that, checked it out. but don't know how well it works. May 15 16:37:38 karki_: nop, never did kernel driver dev May 15 16:43:46 I'm betting on UIO for the first bits, will get onto remoteproc later May 15 16:49:29 You would have to change quite a bit of code, right? if you plan to move from UIO to remote proc? May 15 16:53:37 mranostay: examining the ws28xx lighting code disassembly for PRU0, the compiler is doing something weird for the CTRs , I see no SBCO instruction May 15 16:53:49 there's one LBCO, that's all May 15 16:55:42 yeah it is all broken May 15 16:55:47 pru1 code works :) May 15 16:56:09 well, that's just pure assembly, so expected ;) May 15 16:56:32 would nodejs help here? May 15 16:56:34 :) May 15 16:57:30 Dunno, I was reading and came across "the Jeft Atwood's law" May 15 16:57:56 any application that can be written in JavaScript will eventually be written in JavaScript May 15 17:01:54 * karki_ is not really found of JS May 15 17:02:46 */me *fond May 15 17:02:52 * karki_ * fond May 15 17:03:01 damn this keyboard :/ May 15 17:10:41 panto : Hi! May 15 17:17:44 mranostay: I just sent you a patch to the Makefile to generate detailed ASM listings (C interleaved) instead of the objdump listings which had little meaning. May 15 17:43:33 panto mranostay : for my project, would I be developing my own driver or modifying the rproc_pru driver that is currently available? May 15 17:47:19 karki_: modify the rproc_pru one May 15 17:47:24 add your syscalls May 15 17:48:37 and how would I be getting a userspace interface to talk to the driver? May 15 17:48:50 well, that's something to develope May 15 17:48:53 *develop May 15 17:50:37 alexanderhiam was discussing about a sysfs interface..... May 15 17:52:06 panto : what other alternatives do I have? May 15 17:54:05 a sysfs interface is know to work May 15 17:54:19 but, it's not very high performance May 15 17:54:51 ideally you want a shared memory interface exposing downcalls May 15 17:55:27 mranostay: How would you suggest defining a LA interface over remoteproc? May 15 17:57:20 panto : shared memory interface as in? Isn't sysfs just to give a user space exposure to the driver? shared memory is the driver <--> PRU implementation, right? May 15 17:58:03 well, you can map a chunk of memory to user-space May 15 17:58:46 and then use a mechanism to trigger a downcall to the PRU May 15 17:58:55 that's for ARM -> PRU comms May 15 17:59:33 so an upcall is when the PRU signals the ARM, correct? May 15 17:59:35 hhmm.... so implement mmap for the driver? May 15 17:59:48 I'm confused! May 15 17:59:52 for PRU to ARM, you can try to map some PRU event bits to a user-space signal May 15 18:00:22 from the PRU side it looks like an up-call May 15 18:00:56 and on the user side use a signal handler? May 15 18:01:13 you need to have a well defined interface, in order to handle the copying of arguments to/from the shared memory and handle cache management May 15 18:01:25 karki_, yes May 15 18:01:38 how does the current UIO implementation wait for interrupts? May 15 18:01:53 you don't have to do the work in the signal handler, the signal handler can notify the main loop of your application to handle it May 15 18:02:42 https://www.kernel.org/doc/htmldocs/uio-howto/wait_for_interrupts.html May 15 18:03:05 don't worry about it yet May 15 18:03:25 just keep on hacking, get the pru code ported to the new TI compiler stuff May 15 18:03:36 and when this is done, I'll give you guys a hand May 15 18:07:20 panto : the main application (on linux) does not run in a loop (or so I thought). I will have to have a wait_for_event() function, this has to return only when the signal arrives, right? (thinking along the lines of the UIO interface) May 15 18:07:57 panto: I'm thinking, with a remoteproc implementation, I'll have to map a chunk of memory to userspace, then use a mechanism for downcalls, upcalls, isn't this exactly what's there in the UIO driver and libprussdrv? May 15 18:08:58 karki_, sigwait May 15 18:09:16 Abhishek_, almost May 15 18:09:28 UIO doesn't know how to deal with cache May 15 18:10:02 and you can't use it if you want to do a standard kernel driver interface in the same time May 15 18:10:39 I'm looking at this: https://github.com/beagleboard/linux/blob/beaglebone-3.2/drivers/uio/uio_pruss.c and I see the SRAM something. Is this the cache? May 15 18:11:07 oops, wrong branch May 15 18:11:16 no, this is the static ram May 15 18:11:18 this: https://github.com/beagleboard/linux/blob/3.8/drivers/uio/uio_pruss.c May 15 18:11:50 static ram is mapped uncached May 15 18:12:17 but you have to copy data in/out of it May 15 18:12:58 you can't do something like pru_tx(void *data, int size) with the pointer in user-space data May 15 18:13:15 in DRAM May 15 18:13:31 so the data address space you can address is very small May 15 18:13:36 IIRC the SRAM is a few K May 15 18:13:43 64K May 15 18:13:48 I think May 15 18:14:46 how exactly do you "handle" the cache? Is it not supposed to be transparent to the programmer? May 15 18:18:23 panto: It isn't clear to me when you said " you can't do something like pru_tx(void *data, int size) with the pointer in user-space data in DRAM" May 15 18:18:55 karki_, it is transparent to the ARM programmer May 15 18:19:03 PRU & ARM are not coherent May 15 18:19:40 Abhishek_, passing a pointer to DRAM requires manual cache management May 15 18:20:11 the DRAM being the 512MB RAM, correct? May 15 18:20:16 yes May 15 18:21:03 panto : how do you go about manual cache management? May 15 18:21:39 you need to call the cache management functions manually May 15 18:22:13 http://minghuasweblog.wordpress.com/2013/03/29/arm-cache-flush-on-mmapd-buffers-with-clear-cache/ May 15 18:22:48 it needs to use a syscall May 15 18:23:01 but, there are complications May 15 18:23:34 so that's why I want to use some kind of user-space to downcall bridge May 15 18:23:51 which will perform the required management transparently May 15 18:25:16 panto: What you said is that this pru_tx is a function that's running on ARM, and it's passing some data to the PRU. So it means that I cannot just pass a pointer to my data in RAM to the PRU directly, it needs to be in a specific region of the DDR RAM so that the PRU can access it? May 15 18:25:43 not exactly May 15 18:25:56 the user-space pointer is a virtual address May 15 18:27:02 and VM to PM translation is process specific..... May 15 18:27:03 the PRU has full access to the DRAM address space May 15 18:27:21 PRU bypasses MMU, right? May 15 18:27:23 yep, that I know May 15 18:27:23 so let's take a transmit call for example May 15 18:27:24 yes May 15 18:27:32 you need to do the following May 15 18:28:00 1. flush the contents of the cache lines in the given virtual address space (data, data + size - 1) May 15 18:28:27 2. lock the memory pages contains the buffer in physical memory May 15 18:29:05 3. convert the virtual address span to a list of (physical, count) scatter gather array elements May 15 18:29:42 4. get the physical address of the scatter gather array May 15 18:30:21 5. perform a down call as pru_tx_pru(struct scatter_gather *sga, int nelems) May 15 18:31:00 6. return from the downcall (collecting the return value) May 15 18:31:06 7. unlock the memory pages May 15 18:31:14 8. return to user-space May 15 18:31:32 thats a big list..... May 15 18:31:43 things are simpler if you use a mmemaped memory space May 15 18:31:56 since you can skip the scatter gather part May 15 18:32:08 and pass a pointer directly there May 15 18:32:14 for that the driver has to give an implementation of mmap, right? May 15 18:32:28 hey, life's hard, get over it :) May 15 18:32:41 or is it something else? :p May 15 18:33:09 the driver will have some device file you can map just like uio May 15 18:33:20 but I expect all of that to be handled by a user-space library May 15 18:33:28 I don't want applications to deal with it May 15 18:34:11 we have a hacky way to do it with UIO May 15 18:34:19 * karki_ wonders how cool this would be if they thought this is class! May 15 18:34:21 I want something elegant and easy to use May 15 18:34:22 OK so as I understood, the problem with UIO occurs when you have to pass big chunks of data to the PRU, they may be existing as scattered chunks in the physical memory and UIO doesn't know how to deal with it? May 15 18:34:36 UIO can't deal with cached memory areas May 15 18:34:52 which is all your DRAM basically May 15 18:35:16 So UIO is fine only with sram stuff? May 15 18:35:30 is fine with non-cached memory areas May 15 18:36:00 UIO's existence is solely due to reason of circumventing the GPL May 15 18:36:09 but don't pass that info around :) May 15 18:36:54 why? May 15 18:37:13 cause device drivers must have their source released under the GPL May 15 18:37:22 user-space application do not have to May 15 18:38:28 oh, so implement the driver as a user space application and use the "GPLed" UIO to talk to their device? May 15 18:40:36 panto : one more concern, if people keep patching the rproc_pru for every firmware they develop, won't it mess up that driver? (eg. I'm going to modify the driver for my firmware, you added support for your firmware, etc) May 15 18:41:38 karki_, we'll figure things out May 15 18:41:55 we'll refactor the driver May 15 18:42:10 into common use parts and implementation specific parts May 15 18:42:28 this was not a problem when it was first created May 15 18:42:33 exactly what I was typing ;) May 15 18:43:10 okay, so would it be possible to have a libprussdrv-like API for the remoteproc implementation May 15 18:43:24 something like libprussdrvrproc? May 15 18:43:37 yeah May 15 18:43:49 but probably much more advanced May 15 18:43:55 :'D libprussdrvrproc May 15 18:44:01 I have a few ideas about how to go May 15 18:44:05 is this to be done this SoC? May 15 18:44:11 but you need to fix the basic stuff first May 15 18:44:21 Abhishek_, not really May 15 18:44:40 you're only doing the first parts of something that might end up much bigger May 15 18:44:50 at the moment you have your goals May 15 18:45:07 exactly my thought, things are getting too stretched for this SoC :( have to split work smartly! May 15 18:45:43 * karki_ has ended up using "exactly" one too many times today ;) May 15 18:46:34 So what I'm taking off this discussion is that I'm continuing with UIO drivers for the Logic Analyzer code for the SoC, and taking a remoteproc implementation as it becomes available as a stretch goal. (So switching from libprussdrv to libprussdrv-rproc as it develops) May 15 18:46:57 *core/code May 15 18:49:28 yeah May 15 18:49:37 the core PRU code is irrelevant May 15 18:49:59 panto: What's your opinion? May 15 18:50:13 panto : interface like libprussdrv-rproc is something I'll HAVE to develop, right? or there is no way I'll get any client interaction in the first place! May 15 18:50:49 Abhishek_, we have different goals - yours is to get the logic analyzer May 15 18:51:11 I'm more interested in getting the PRU stuff easily usable by users May 15 18:51:22 karki_, you have to do it May 15 18:51:40 so if you're ready by the time Abhishek_ is done, he might have time to use your stuff May 15 18:51:50 ok, enough for now, got to work too May 15 18:52:00 hhmm..... I'll have to modify my SoC goals May 15 18:52:05 Thanks panto :) May 15 18:52:12 thank you for your time panto :) May 15 18:52:16 np May 15 18:52:37 * karki_ realizes he has to sleep! May 15 18:52:49 Abhishek_ : when do you sleep? May 15 18:53:36 it's about to be 2am here, I have to rerecord the audio track for my slides May 15 18:54:08 usually by 3am May 15 18:54:13 where are you? May 15 18:54:20 Jakarta, ID May 15 18:54:23 when do you wake up? May 15 18:54:44 normally in 8hrs after I sleep May 15 18:55:11 I didn't know you stayed in indonesia! May 15 18:55:41 here since my vacations in May May 15 18:57:16 I sleep at 1, get up at 7. So G'nite, I have half an hour to finish my recording, of which I'm almost done.. May 15 18:58:22 g'nite May 15 19:20:14 panto: (cc mranostay) bothering you again with one more question: What issues can I have with UIO implementations for a LA situation (PRU is sampling from the GPIs and transferring data in bulk to the userspace application: maybe writing directly to DRAM in the extram_pool area (given by UIO), or in small chunks of PRU shared RAM being used as a ring May 15 19:20:14 buffer)? May 15 19:20:44 cache coherency management May 15 19:20:52 and working with UIO which is kinda of a hack May 15 19:21:40 could you suggest a resource for knowing more cache coherency? May 15 19:30:22 panto: ^ & the link which you gave above for "__clear_cache" could help in this case? Also, could you point me to the UIO hack regarding memory management? May 15 20:40:00 IRCCloud seems to have crashed May 15 20:43:39 Abhishek_: use IRSSI May 15 20:43:51 and leave it open in a screen session May 15 21:22:27 the hell is irccloud? May 15 21:26:30 * Abhishek_ is downloading koen's evil kernel sources May 15 21:28:06 mranostay: IRCCloud is a fancy new IRC web client (and subscription based bouncer) May 15 21:29:40 * Abhishek_ wonders how much he will use out of the 2 GB bundle he's downloading May 15 21:31:26 downloading? May 15 21:31:32 what warez? May 15 21:31:50 Koen's kernel May 15 21:33:00 *sources May 15 21:33:53 what horrible ISPs do you have? May 15 21:34:48 Currently clocking 5mbps, "4G TD-LTE" May 15 21:36:09 ah done, only 750MB May 15 21:42:50 so many x lines add whitespace errors warnings in patches May 15 22:11:45 make -j on the kernel can crash my system? May 16 00:01:36 Abhishek_: why crash ? May 16 00:01:49 it should now if u have enough ram May 16 00:02:46 j May 16 00:04:30 crash? May 16 00:06:22 the build will stop, but no crashing May 16 00:26:33 I don't know what happened, I did make -j and my system froze (only hdd activity, no kbd or mouse inputs), screen went blank after some time and no response to CtrlC. I hard rebooted and completed the kernel build with make -j8 May 16 00:28:08 Strange because there's 8GB RAM and an i7-3 May 16 00:29:37 what i learned after GSOC was that a VPS somewhere sames a lot of time than working on ur local machine May 16 00:32:13 VPS for building the project? May 16 00:32:48 yeah, i had to recompile kernels all over the place at some point May 16 00:33:00 and was sick of keeping my laptop on all times **** ENDING LOGGING AT Fri May 16 02:59:58 2014