[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Adding SPI Driver causes Kernel to Hang



Hi Matt,

> I found out that I was actually missing a required #define.  In order 
> to get
> types.h to register types such as u32, I need to include the 
> following in my
> code:
> 
> #define __KERNEL__

The __KERNEL__ define is there to prevent user space applications from 
using internal kernel stuff. To define __KERNEL__ on your own is only 
rarely a good solution to whatever problem you want to solve.

> As a side note, I'm doing all my development on this C source file in 
> the
> user-apps directory, not the kernel directory.  Moving the source files over
> to the kernel source then compiling had no effect.

It seems to be a misunderstanding. I supposed you were trying write a 
kernel driver. The standard SPI interface does no more support a char 
device as user space interface, thus you will need to write a kernel 
driver to access your SPI devices. The code snips I have presented were 
actually copied from a kernel driver that connects to the SPI subsystem 
(using "xilinx_spi").

> Any suggestions?  I'm glad to see that people are interested, I 
> really hope
> to get this working.  Thanks.
> 
> Matt
> 

Regards,
Nicolas

-- 
gpg public key: ID 0xACBC3B35, jabber: nicolas@xxxxxxxxx
 -- frykten for herren er opphav til kunnskap --

Attachment: pgp9vrVN8TSkE.pgp
Description: PGP signature