			Linux kernel driver for SCET core
			=================================

The driver itself already included in the OpenRISC patch for the Linux
kernel available from OpenCores (latest at http://opencores.org/ocsvn/openrisc/openrisc/trunk/linux/patches/linux-2.6.34-or32.patch.bz2 )

Included in this path is an example C file to be compiled and run in userspace.

Steps to setting up for using the character driver interface to the SCET.

1. Enable the character driver for the SCET in the kernel under
   Device drivers -> Character devices -> SCET support

2. After booting the kernel with SCET support enable, create a character device
   for interfacing with the SCET with the following command:

   $ mknod /dev/scet_dev c 100 0

3. Compile and run the example program in this path, using the uClibc library 
   so it can be run in Linux userspace:

On host:
   $ or32-elf-gcc scet-kernel-chardrivertest.c -o scet

On target:
   ./scet


Driver information:

SCET userspace interface.
Set //#define DEVELOP 1 in scet.h to enable debug print out. 

This hardware interface driver, provide the usersapce with 4 IOCTL functions.

IOCTL_SET_SCET_TIME _IOR(MAJOR_NUM, 0, char *)
Set a timer value. Each char byte correpsond to a hardware register in the SCET timer. 
Note that only the 6 timer register can be modified with this call. 


IOCTL_GET_SCET_TIME _IOR(MAJOR_NUM, 1, char *)
 Returns the value of all 6 timer registers, be carefull to always allocate a 
sufficent buffer in userspace before calling it (min 6 Byte) This function 
always write 6 bytes into the buffer prvoided. The timer is freezed when 
reading of the timer starts, and unfreexed when returned.

IOCTL_SET_SCET_OPERATION _IOWR(MAJOR_NUM, 2, int)
Description: Write 1 to Stop the timer and 0  and Start the timer

IOCTL_GET_SCET_STATUS _IOR(MAJOR_NUM, 3, int *)
return status of the timer
0 = Stoped
  1 = Running
  2 = Freezing + Stoped
  3 = Freezing + Running


