patch-2.4.20 linux-2.4.20/include/asm-cris/etraxvirtex.h

Next file: linux-2.4.20/include/asm-cris/fasttimer.h
Previous file: linux-2.4.20/include/asm-cris/etraxgpio.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/include/asm-cris/etraxvirtex.h linux-2.4.20/include/asm-cris/etraxvirtex.h
@@ -0,0 +1,35 @@
+/* $Id: etraxvirtex.h,v 1.1 2002/06/25 10:01:05 stefanl Exp $ */
+
+#ifndef _LINUX_ETRAXVIRTEX_FPGA_H
+#define _LINUX_ETRAXVIRTEX_FPGA_H
+
+/* etraxvirtex_fpga _IOC_TYPE, bits 8 to 15 in ioctl cmd */
+
+#define ETRAXVIRTEX_FPGA_IOCTYPE 45
+
+/* supported ioctl _IOC_NR's */
+
+/* in write operations, the argument contains both virtex
+ * register and value.
+ */
+
+#define VIRTEX_FPGA_WRITEARG(reg, value) (((reg) << 16) | (value))
+#define VIRTEX_FPGA_READARG(reg) ((reg) << 16)
+
+#define VIRTEX_FPGA_ARGREG(arg) (((arg) >> 16) & 0x0fff)
+#define VIRTEX_FPGA_ARGVALUE(arg) ((arg) & 0xffff)
+
+#define VIRTEX_FPGA_WRITEREG 0x1   /* write to an (FPGA implemented) register */
+#define VIRTEX_FPGA_READREG  0x2   /* read from an (FPGA implemented register */
+
+/*
+EXAMPLE usage:
+
+    virtex_arg = VIRTEX_FPGA_WRITEARG( reg, val);
+    ioctl(fd, _IO(ETRAXVIRTEX_FPGA_IOCTYPE, VIRTEX_FPGA_WRITEREG), virtex_arg);
+
+    virtex_arg = VIRTEX_FPGA_READARG( reg);
+    val = ioctl(fd, _IO(ETRAXVIRTEX_FPGA_IOCTYPE, VIRTEX_FPGA_READREG), virtex_arg);
+
+*/
+#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)