This is the uClinux driver for the Freescale 68332 QSPI unit. (QSPI: Queued Serial Peripheral Interface) (C) Copyright 2004, Sieghard Schicktanz (S.Schicktanz@Kanis.de) It is distributed under the GNU General Public License - see the accompanying COPYING file for more details. This driver is concerned with setting up the QSPI registers as well as writing data to and reading data from the connected devices. It makes use of the standard read and write interface routines as well as the ioctl function to set up the required operational parameters. The driver uses character device major number 126, the minor numbers select the channel (0..3) to use. Add some entries to your Makefile DEVICE statement like the following: qspi0,c,126,0 qspi1,c,126,1 qspi2,c,126,2 qspi3,c,126,3 The driver basically works as follows: The device minor number defines the qspi channel (chip select) to use. Writing to the device puts the data written to the internal buffer. Write data consist of bytes or words according to current QSPIIOCG_BITS ioctrl setting. The buffer may hold up to 1024 bytes or 512 words of data. After the buffer has filled up, no more data will be accepted. The module is started on a read or, if no data are to be read, on close. A read will retrieve any data received during output of the contents of the write buffer, followed by as many bytes of additional read data as requested. If more data are read than were written, they will be requested by outputting the value of the argument to the last QSPIIOCS_READDATA ioctl call, or 0 if none was issued. Reading the device clears the write buffer, even if not all read data are consumed. The following files belong to the driver proper: 24528 2005-05-17 12:05 68332qspi.c 6552 2005-05-17 12:06 68332qspi.h 1881 2005-05-17 12:06 mcfqspi.h 10172 2005-05-17 12:04 m68332_exts.h Use of the driver's functions is exemplified by a little program to set up any or all the QSPI channels with basic parameters (qspiset.c), The program gets its data from a configuration file, an example of which is given by the file "SPIinit". The following files comprise the example program: 9225 2005-05-17 12:06 qspiset.c 834 2005-05-17 12:02 SPIinit