RE: [uClinux-dev] Queueing work from both driver and interrupt

2010-02-04 Thread David Wooff
David Wooff <http://www.calrec.com/images/siglogo.gif> Software Development Engineer Tel: +44 (0)1422 842159 Fax: +44 (0)1422 845244 Email: david.wo...@calrec.com Web: www.calrec.com <http://www.calrec.com/> CALREC AUDIO LTD Nutclough Mill Hebden Bridge W Yo

RE: [uClinux-dev] Queueing work from both driver and interrupt

2010-02-03 Thread David Wooff
> Yes, it is safe. See kernel/workqueue.c: > queue_work -> queue_work_on -> __queue_work -> spin_lock_irqsave > > Best regards, > > Daniel Ah, I see now! I should examine the code a bit more readily in future. Many thanks. This electronic transmission is strictly confidential and intended sole

RE: [uClinux-dev] Queueing work from both driver and interrupt

2010-02-02 Thread David Wooff
Hi David, I have replied direct as well since the list sometimes bounces me. I tend to solve this problem using a kernel worker thread and one or more message queues. The interrupt and the user task can all send requests to the message queue which wakes up the threa

[uClinux-dev] Queueing work from both driver and interrupt

2010-02-02 Thread David Wooff
Hello, I have a "bottom half" processing function which I'm queueing from an interrupt on a workqueue. Is it OK/safe to also queue the same function on the same workqueue from the driver in response to an application read/write? I have read LDD3 and looked for workqueues in the documentation and

[uClinux-dev] kfifo spinlock sharing

2010-02-01 Thread David Wooff
Hi, if I have a set of (40) kfifos, can I point them all to use the same spinlock? Having 40 separate spinlocks and only two threads accessing the kfifos seems a little wasteful. Thanks, Dave W This electronic transmission is strictly confidential and intended solely for the addressee(s). If y

RE: [uClinux-dev] char device driver interfacing to 32 bit wide fpgainterface

2010-01-13 Thread David Wooff
> Is this an Altera FPGA ? Thanks Michael, I probably should have ellaborated a little more. It is an Altera FPGA as it happens, but it's irrelevant really because I'm running uClinux on an ARM processor talking to the FPGA, so I could have said simply "device". There is no NIOS or Avalon buss in

[uClinux-dev] char device driver interfacing to 32 bit wide fpga interface

2010-01-13 Thread David Wooff
Hi, re subject, would it be inappropriate to use read and write calls to communicate with a 32 bit wide interface? The fpga cannot accept byte accesses and nor do I want it to anyway. So, should I control the file position so it can only ever be on 32 bit boundaries and accept accesses in multiples

RE: [uClinux-dev] Finding function source code

2010-01-12 Thread David Wooff
> >> e.g. if I use grep to find occurrences of say > "gpio_request", I get a > >> long list to search through, but I know many of the files are not > >> even compiled into my build. Is there an easy way to find > the real > >> place where a function is coded for my particular build? > > I use to l

RE: [uClinux-dev] Finding function source code

2010-01-11 Thread David Wooff
> I think LXR may be what you are looking for. If you only want That looks helpful, thanks. This electronic transmission is strictly confidential and intended solely for the addressee(s). If you are not the intended addressee, you must not disclose, copy or take any action in reliance of this e

[uClinux-dev] Finding function source code

2010-01-11 Thread David Wooff
Hi, this may be a stupid question. As I look around the kernel and driver source code I often find it difficult to find the "real" instance of a function. e.g. if I use grep to find occurrences of say "gpio_request", I get a long list to search through, but I know many of the files are not even co

[uClinux-dev] ARM GPIO - use directly?

2010-01-08 Thread David Wooff
Hi, I noticed in the ARM specific code that there are functions like at91_set_gpio Are these meant to be used directly or are they referenced by the generic gpio code in some way? Also, is there a way to write to a group of gpio pins e.g. a group of 8 configured as a byte? Many thanks P.S. Sor

RE: [uClinux-dev] Device driver types

2009-12-23 Thread David Wooff
> It sounds like ioctls are the way to talk to the FPGA, and > your driver should take on the appearance of a platform or > multifunction device driver (most likely the latter). I've > written drivers like this in the past and it sounds like > that's the way you're going to want to head if you want

RE: [uClinux-dev] Device driver types

2009-12-22 Thread David Wooff
> Try the char driver, it is simplest of three. Sounds like a good plan. Thanks for your advice. I'm currently following the ioctl route. It's slightly complicated because my FPGA is effectively a bridge to a number of hot-pluggable backplane I/O cards. It seems to me that I should probably atte

RE: [uClinux-dev] Driver appears to be successfully registetered butdoesn't appear in /dev

2009-12-17 Thread David Wooff
> you need to create it yourself with `mknod`, or if you want > to utilize the hotplug stack, you have to create some > classes/devices using the kobject layer. /dev is not a > pseudo file system (ignoring the devtmpfs in 2.6.32) which > means *someone* has to create the device node. it's either

[uClinux-dev] Driver appears to be successfully registetered but doesn't appear in /dev

2009-12-17 Thread David Wooff
Hi, would someone mind checking my module initialisation function in case I have missed something? It loads without error and the appropriate message is printed out on the console, buit it does not appear in /dev. I also do not see a modules directory in /lib (this was the subject of another questi

[uClinux-dev] Device driver types

2009-12-16 Thread David Wooff
Hello, I have read that there are 3 types, char, block and network. Does it follow that if I write a device driver for my custom FPGA that it MUST fit in to this structure? Assuming this to be the case, would it be best to use the char device type and then use fseek to access a given address withi

RE: [uClinux-dev] Loadable module on uCLinux (ATSAM9G20 ARM)

2009-12-16 Thread David Wooff
ion "Enable loadable module support" in the Linux Kernel Configuration that sets this symbol? Regards, Christian -Ursprüngliche Nachricht- Von: uclinux-dev-boun...@uclinux.org [mailto:uclinux-dev-boun...@uclinux.org] Im Auftrag von David Wooff Gesendet: Freitag, 11. Dezember 20

RE: [uClinux-dev] Loadable module on uCLinux (ATSAM9G20 ARM)

2009-12-11 Thread David Wooff
Thanks Christian, I don't have a /lib/modules/ directory. I must be missing an option somewhere. This is the output of my build: [?]$ make ARCH=arm CROSS_COMPILE=~/buildroot-v23434/build_arm/staging_dir/usr/bin/arm-linux- scripts/kconfig/conf -s arch/arm/Kconfig CHK include/linux/vers

[uClinux-dev] Loadable module on uCLinux (ATSAM9G20 ARM)

2009-12-09 Thread David Wooff
Hi, I have successfully built a simple driver module configured for built in operation and it runs at startup - great so far. I then built it for loadable operation and it builds ok. I am left with a .ko file. When I download my new image to the target, I cannot see the ko file in order to load