Skip to contentSkip to conversation

Xilinx: hwicap driver

PATCH In review Stephen Neuendorffer 2 participants 6 messages Feb 1, 2008 – Feb 5, 2008 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1201890163-12219-1-git-send-email-stephen.neuendorffer@xilinx.com

#1 lore raw

PATCH 1/1 Xilinx: hwicap driver

This includes code for new fifo-based xps_hwicap in addition to the older opb_hwicap, which has a significantly different interface. The common code between the two drivers is largely shared.

Significant differences exists between this driver and what is supported in the EDK drivers. In particular, most of the architecture-specific code for reconfiguring individual FPGA resources has been removed. This functionality is likely better provided in a user-space support library. In addition, read and write access is supported. In addition, although the xps_hwicap cores support interrupt-driver mode, this driver only supports polled operation, in order to make the code simpler, and since the interrupt processing overhead is likely to slow down the throughput under Linux.

Fixed to add mutexes, and a few style issues.

---

I will get this right eventually. :)

---
 drivers/char/Kconfig                       |    7 +
 drivers/char/Makefile                      |    1 +
 drivers/char/xilinx_hwicap/Makefile        |    7 +
 drivers/char/xilinx_hwicap/buffer_icap.c   |  380 ++++++++++++
 drivers/char/xilinx_hwicap/buffer_icap.h   |   57 ++
 drivers/char/xilinx_hwicap/fifo_icap.c     |  381 ++++++++++++
 drivers/char/xilinx_hwicap/fifo_icap.h     |   62 ++
 drivers/char/xilinx_hwicap/xilinx_hwicap.c |  904 ++++++++++++++++++++++++++++
 drivers/char/xilinx_hwicap/xilinx_hwicap.h |  193 ++++++
 9 files changed, 1992 insertions(+), 0 deletions(-)
 create mode 100644 drivers/char/xilinx_hwicap/Makefile
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.c
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.h
drivers/char/Kconfig +7 -0
index ef1ed5d..157ae2a 100644
@@ -831,6 +831,13 @@ config DTLK
 	  To compile this driver as a module, choose M here: the
 	  module will be called dtlk.
 
+config XILINX_HWICAP
+	tristate "Xilinx HWICAP Support"
+	depends on XILINX_VIRTEX
+	help
+	  This option enables support for Xilinx Internal Configuration
+	  Access Port (ICAP) driver.
+
 config R3964
 	tristate "Siemens R3964 line discipline"
 	---help---
drivers/char/Makefile +1 -0
index 07304d5..3a278a0 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_EFI_RTC)		+= efirtc.o
 obj-$(CONFIG_SGI_DS1286)	+= ds1286.o
 obj-$(CONFIG_SGI_IP27_RTC)	+= ip27-rtc.o
 obj-$(CONFIG_DS1302)		+= ds1302.o
+obj-$(CONFIG_XILINX_HWICAP)    += xilinx_hwicap/
 ifeq ($(CONFIG_GENERIC_NVRAM),y)
   obj-$(CONFIG_NVRAM)	+= generic_nvram.o
 else
drivers/char/xilinx_hwicap/Makefile new file +7 -0
new file mode 100644
index 0000000..5491cbc
@@ -0,0 +1,7 @@
+#
+# Makefile for the Xilinx OPB hwicap driver
+#
+
+obj-$(CONFIG_XILINX_HWICAP) += xilinx_hwicap_m.o 
+ 
+xilinx_hwicap_m-y := xilinx_hwicap.o fifo_icap.o buffer_icap.o
drivers/char/xilinx_hwicap/buffer_icap.c new file +380 -0

380 lines not on this page · raw message

drivers/char/xilinx_hwicap/buffer_icap.h new file +57 -0

57 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.c new file +381 -0

381 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.h new file +62 -0

62 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.c new file +904 -0

904 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.h new file +193 -0

193 lines not on this page · raw message

Signature · 1 line
1.5.3.4-dirty
Acked-by on v1 1/1
#2 lore raw
Quoted 14 lines · Stephen Neuendorffer

This includes code for new fifo-based xps_hwicap in addition to the older opb_hwicap, which has a significantly different interface. The common code between the two drivers is largely shared.

Significant differences exists between this driver and what is supported in the EDK drivers. In particular, most of the architecture-specific code for reconfiguring individual FPGA resources has been removed. This functionality is likely better provided in a user-space support library. In addition, read and write access is supported. In addition, although the xps_hwicap cores support interrupt-driver mode, this driver only supports polled operation, in order to make the code simpler, and since the interrupt processing overhead is likely to slow down the throughput under Linux.

Quoted 3 lines

Fixed to add mutexes, and a few style issues.

Inconsistent indentation (tabs vs. spaces) in some places. Otherwise:

g.

Quoted 9 lines
drivers/char/xilinx_hwicap/xilinx_hwicap.c new file +9 -0
+static int __devexit hwicap_remove(struct device *dev)
+{
+       struct hwicap_drvdata *drvdata;
+
+       drvdata = (struct hwicap_drvdata *)dev_get_drvdata(dev);
+
+       if (!drvdata)
+            return 0;
+

drivers/char/xilinx_hwicap/xilinx_hwicap.c line 711

Quoted 10 lines
drivers/char/xilinx_hwicap/xilinx_hwicap.c new file +10 -0
+        class_device_destroy(icap_class, drvdata->devt);
+        cdev_del(&drvdata->cdev);
+        iounmap(drvdata->base_address);
+        release_mem_region(drvdata->mem_start, drvdata->mem_size);
+        kfree(drvdata);
+        dev_set_drvdata(dev, NULL);
+        probed_devices[MINOR(dev->devt)-xhwicap_minor] = 0;
+
+       return 0;               /* success */
+}

Here in particular

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#3 lore raw

PATCH 1/1 Xilinx: hwicap driver

This includes code for new fifo-based xps_hwicap in addition to the older opb_hwicap, which has a significantly different interface. The common code between the two drivers is largely shared.

Significant differences exists between this driver and what is supported in the EDK drivers. In particular, most of the architecture-specific code for reconfiguring individual FPGA resources has been removed. This functionality is likely better provided in a user-space support library. In addition, read and write access is supported. In addition, although the xps_hwicap cores support interrupt-driver mode, this driver only supports polled operation, in order to make the code simpler, and since the interrupt processing overhead is likely to slow down the throughput under Linux.

Fixed to add mutexes, and a few style issues.

---

I will get this right eventually. :)

---
 drivers/char/Kconfig                       |    7 +
 drivers/char/Makefile                      |    1 +
 drivers/char/xilinx_hwicap/Makefile        |    7 +
 drivers/char/xilinx_hwicap/buffer_icap.c   |  380 ++++++++++++
 drivers/char/xilinx_hwicap/buffer_icap.h   |   57 ++
 drivers/char/xilinx_hwicap/fifo_icap.c     |  381 ++++++++++++
 drivers/char/xilinx_hwicap/fifo_icap.h     |   62 ++
 drivers/char/xilinx_hwicap/xilinx_hwicap.c |  904 ++++++++++++++++++++++++++++
 drivers/char/xilinx_hwicap/xilinx_hwicap.h |  193 ++++++
 9 files changed, 1992 insertions(+), 0 deletions(-)
 create mode 100644 drivers/char/xilinx_hwicap/Makefile
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.c
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.h
drivers/char/Kconfig +7 -0
index ef1ed5d..157ae2a 100644
@@ -831,6 +831,13 @@ config DTLK
 	  To compile this driver as a module, choose M here: the
 	  module will be called dtlk.
 
+config XILINX_HWICAP
+	tristate "Xilinx HWICAP Support"
+	depends on XILINX_VIRTEX
+	help
+	  This option enables support for Xilinx Internal Configuration
+	  Access Port (ICAP) driver.
+
 config R3964
 	tristate "Siemens R3964 line discipline"
 	---help---
drivers/char/Makefile +1 -0
index 07304d5..3a278a0 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_EFI_RTC)		+= efirtc.o
 obj-$(CONFIG_SGI_DS1286)	+= ds1286.o
 obj-$(CONFIG_SGI_IP27_RTC)	+= ip27-rtc.o
 obj-$(CONFIG_DS1302)		+= ds1302.o
+obj-$(CONFIG_XILINX_HWICAP)    += xilinx_hwicap/
 ifeq ($(CONFIG_GENERIC_NVRAM),y)
   obj-$(CONFIG_NVRAM)	+= generic_nvram.o
 else
drivers/char/xilinx_hwicap/Makefile new file +7 -0
new file mode 100644
index 0000000..5491cbc
@@ -0,0 +1,7 @@
+#
+# Makefile for the Xilinx OPB hwicap driver
+#
+
+obj-$(CONFIG_XILINX_HWICAP) += xilinx_hwicap_m.o 
+ 
+xilinx_hwicap_m-y := xilinx_hwicap.o fifo_icap.o buffer_icap.o
drivers/char/xilinx_hwicap/buffer_icap.c new file +380 -0

380 lines not on this page · raw message

drivers/char/xilinx_hwicap/buffer_icap.h new file +57 -0

57 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.c new file +381 -0

381 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.h new file +62 -0

62 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.c new file +904 -0

904 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.h new file +193 -0

193 lines not on this page · raw message

Signature · 1 line
1.5.3.4-dirty

A message that is not in the archive (sent off-list or not yet received): 1201900363-25230-1-git-send-email-stephen.neuendorffer@xilinx.com

author Acked-by Grant Likely
#5 lore raw

Grant,

One of the modifications to the include files got lost, so this won't compile. I also have the corresponding update to booting-without-of.txt queued up. However, webmail won't show me the message id for the thread (grr.), so I'll send it tomorrow when I'm in the office.

Steve

-----Original Message-----
From: Stephen Neuendorffer [mailto:[email protected]]
Sent: Fri 2/1/2008 1:12 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Stephen Neuendorffer
Subject: [PATCH] [POWERPC] Xilinx: hwicap driver

This includes code for new fifo-based xps_hwicap in addition to the older opb_hwicap, which has a significantly different interface. The common code between the two drivers is largely shared.

Significant differences exists between this driver and what is supported in the EDK drivers. In particular, most of the architecture-specific code for reconfiguring individual FPGA resources has been removed. This functionality is likely better provided in a user-space support library. In addition, read and write access is supported. In addition, although the xps_hwicap cores support interrupt-driver mode, this driver only supports polled operation, in order to make the code simpler, and since the interrupt processing overhead is likely to slow down the throughput under Linux.

Fixed to add mutexes, and a few style issues.

---

I will get this right eventually. :)

---
 drivers/char/Kconfig                       |    7 +
 drivers/char/Makefile                      |    1 +
 drivers/char/xilinx_hwicap/Makefile        |    7 +
 drivers/char/xilinx_hwicap/buffer_icap.c   |  380 ++++++++++++
 drivers/char/xilinx_hwicap/buffer_icap.h   |   57 ++
 drivers/char/xilinx_hwicap/fifo_icap.c     |  381 ++++++++++++
 drivers/char/xilinx_hwicap/fifo_icap.h     |   62 ++
 drivers/char/xilinx_hwicap/xilinx_hwicap.c |  904 ++++++++++++++++++++++++++++
 drivers/char/xilinx_hwicap/xilinx_hwicap.h |  193 ++++++
 9 files changed, 1992 insertions(+), 0 deletions(-)
 create mode 100644 drivers/char/xilinx_hwicap/Makefile
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.c
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.h
drivers/char/Kconfig +7 -0
index ef1ed5d..157ae2a 100644
@@ -831,6 +831,13 @@ config DTLK
 	  To compile this driver as a module, choose M here: the
 	  module will be called dtlk.
 
+config XILINX_HWICAP
+	tristate "Xilinx HWICAP Support"
+	depends on XILINX_VIRTEX
+	help
+	  This option enables support for Xilinx Internal Configuration
+	  Access Port (ICAP) driver.
+
 config R3964
 	tristate "Siemens R3964 line discipline"
 	---help---
drivers/char/Makefile +1 -0
index 07304d5..3a278a0 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_EFI_RTC)		+= efirtc.o
 obj-$(CONFIG_SGI_DS1286)	+= ds1286.o
 obj-$(CONFIG_SGI_IP27_RTC)	+= ip27-rtc.o
 obj-$(CONFIG_DS1302)		+= ds1302.o
+obj-$(CONFIG_XILINX_HWICAP)    += xilinx_hwicap/
 ifeq ($(CONFIG_GENERIC_NVRAM),y)
   obj-$(CONFIG_NVRAM)	+= generic_nvram.o
 else
drivers/char/xilinx_hwicap/Makefile new file +7 -0
new file mode 100644
index 0000000..5491cbc
@@ -0,0 +1,7 @@
+#
+# Makefile for the Xilinx OPB hwicap driver
+#
+
+obj-$(CONFIG_XILINX_HWICAP) += xilinx_hwicap_m.o 
+ 
+xilinx_hwicap_m-y := xilinx_hwicap.o fifo_icap.o buffer_icap.o
drivers/char/xilinx_hwicap/buffer_icap.c new file +380 -0

380 lines not on this page · raw message

drivers/char/xilinx_hwicap/buffer_icap.h new file +57 -0

57 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.c new file +381 -0

381 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.h new file +62 -0

62 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.c new file +904 -0

904 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.h new file +193 -0

193 lines not on this page · raw message

Signature · 1 line
1.5.3.4-dirty
#6 lore raw

PATCH 1/2 Xilinx: hwicap driver

In reply to a message not in the archive

This includes code for new fifo-based xps_hwicap in addition to the older opb_hwicap, which has a significantly different interface. The common code between the two drivers is largely shared.

Significant differences exists between this driver and what is supported in the EDK drivers. In particular, most of the architecture-specific code for reconfiguring individual FPGA resources has been removed. This functionality is likely better provided in a user-space support library. In addition, read and write access is supported. In addition, although the xps_hwicap cores support interrupt-driver mode, this driver only supports polled operation, in order to make the code simpler, and since the interrupt processing overhead is likely to slow down the throughput under Linux.

Fixed to add mutexes, and a few style issues.

The final update to xilinx_hwicap.h was missing.

---

I will get this right eventually. :)

---
 drivers/char/Kconfig                       |    7 +
 drivers/char/Makefile                      |    1 +
 drivers/char/xilinx_hwicap/Makefile        |    7 +
 drivers/char/xilinx_hwicap/buffer_icap.c   |  380 ++++++++++++
 drivers/char/xilinx_hwicap/buffer_icap.h   |   57 ++
 drivers/char/xilinx_hwicap/fifo_icap.c     |  381 ++++++++++++
 drivers/char/xilinx_hwicap/fifo_icap.h     |   62 ++
 drivers/char/xilinx_hwicap/xilinx_hwicap.c |  904 ++++++++++++++++++++++++++++
 drivers/char/xilinx_hwicap/xilinx_hwicap.h |  193 ++++++
 9 files changed, 1992 insertions(+), 0 deletions(-)
 create mode 100644 drivers/char/xilinx_hwicap/Makefile
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.c
 create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.h
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.c
 create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.h
drivers/char/Kconfig +7 -0
index ef1ed5d..157ae2a 100644
@@ -831,6 +831,13 @@ config DTLK
 	  To compile this driver as a module, choose M here: the
 	  module will be called dtlk.
 
+config XILINX_HWICAP
+	tristate "Xilinx HWICAP Support"
+	depends on XILINX_VIRTEX
+	help
+	  This option enables support for Xilinx Internal Configuration
+	  Access Port (ICAP) driver.
+
 config R3964
 	tristate "Siemens R3964 line discipline"
 	---help---
drivers/char/Makefile +1 -0
index 07304d5..3a278a0 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_EFI_RTC)		+= efirtc.o
 obj-$(CONFIG_SGI_DS1286)	+= ds1286.o
 obj-$(CONFIG_SGI_IP27_RTC)	+= ip27-rtc.o
 obj-$(CONFIG_DS1302)		+= ds1302.o
+obj-$(CONFIG_XILINX_HWICAP)    += xilinx_hwicap/
 ifeq ($(CONFIG_GENERIC_NVRAM),y)
   obj-$(CONFIG_NVRAM)	+= generic_nvram.o
 else
drivers/char/xilinx_hwicap/Makefile new file +7 -0
new file mode 100644
index 0000000..5491cbc
@@ -0,0 +1,7 @@
+#
+# Makefile for the Xilinx OPB hwicap driver
+#
+
+obj-$(CONFIG_XILINX_HWICAP) += xilinx_hwicap_m.o 
+ 
+xilinx_hwicap_m-y := xilinx_hwicap.o fifo_icap.o buffer_icap.o
drivers/char/xilinx_hwicap/buffer_icap.c new file +380 -0

380 lines not on this page · raw message

drivers/char/xilinx_hwicap/buffer_icap.h new file +57 -0

57 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.c new file +381 -0

381 lines not on this page · raw message

drivers/char/xilinx_hwicap/fifo_icap.h new file +62 -0

62 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.c new file +904 -0

904 lines not on this page · raw message

drivers/char/xilinx_hwicap/xilinx_hwicap.h new file +193 -0

193 lines not on this page · raw message

Signature · 1 line
1.5.3.4-dirty

A message that is not in the archive (sent off-list or not yet received): 1202232250-24971-1-git-send-email-stephen.neuendorffer@xilinx.com

#8 lore raw

PATCH 2/2 Xilinx: hwicap: update booting-without-of.txt

The ICAP device in Xilinx FPGAs differs slightly between different FPGAs. The driver needs an additional attribute in the device tree to distinguish this.

---
 Documentation/powerpc/booting-without-of.txt |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
Documentation/powerpc/booting-without-of.txt +14 -0
index e9a3cb1..035e28f 100644
@@ -2513,6 +2513,20 @@ platforms are moved over to use the flattened-device-tree model.
 
       Requred properties:
        - current-speed : Baud rate of uartlite
+
+      v) Xilinx hwicap
+
+		Xilinx hwicap devices provide access to the configuration logic
+		of the FPGA through the Internal Configuration Access Port
+		(ICAP).  The ICAP enables partial reconfiguration of the FPGA,
+		readback of the configuration information, and some control over
+		'warm boots' of the FPGA fabric.
+
+		Required properties:
+		- xlnx,family : The family of the FPGA, necessary since the
+                      capabilities of the underlying ICAP hardware
+                      differ between different families.  May be
+                      'virtex2p', 'virtex4', or 'virtex5'.
 
    More devices will be defined as this spec matures.
 
Signature · 1 line
1.5.3.4-dirty