[Pkg-voip-commits] r10084 - in /dahdi-linux/trunk/debian: changelog patches/pciradio-request_firmware patches/series patches/tor2-request_firmware rules

tzafrir at alioth.debian.org tzafrir at alioth.debian.org
Mon Jan 28 14:40:41 UTC 2013


Author: tzafrir
Date: Mon Jan 28 14:40:40 2013
New Revision: 10084

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=10084
Log:
Remove non-free FPGA bitfiles and patch drivers to load them
(Closes: #693666) (Ben Hutchings).

Added:
    dahdi-linux/trunk/debian/patches/pciradio-request_firmware
    dahdi-linux/trunk/debian/patches/tor2-request_firmware
Modified:
    dahdi-linux/trunk/debian/changelog
    dahdi-linux/trunk/debian/patches/series
    dahdi-linux/trunk/debian/rules

Modified: dahdi-linux/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/changelog?rev=10084&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/changelog (original)
+++ dahdi-linux/trunk/debian/changelog Mon Jan 28 14:40:40 2013
@@ -1,6 +1,8 @@
-dahdi-linux (1:2.6.1+dfsg-2) UNRELEASED; urgency=low
+dahdi-linux (1:2.6.1+dfsg2-1) UNRELEASED; urgency=low
 
   * Patch fix_define_dev: fix building with kernel 3.8.
+  * Remove non-free FPGA bitfiles and patch drivers to load them
+    (Closes: #693666) (Ben Hutchings).
 
  -- Tzafrir Cohen <tzafrir at debian.org>  Mon, 28 Jan 2013 14:23:01 +0200
 

Added: dahdi-linux/trunk/debian/patches/pciradio-request_firmware
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/pciradio-request_firmware?rev=10084&op=file
==============================================================================
--- dahdi-linux/trunk/debian/patches/pciradio-request_firmware (added)
+++ dahdi-linux/trunk/debian/patches/pciradio-request_firmware Mon Jan 28 14:40:40 2013
@@ -1,0 +1,135 @@
+Author: Ben Hutchings <ben at decadent.org.uk>
+Description: pciradio: Use request_firmware() to load bitfile
+Bug-Debian: http://bugs.debian.org/693666
+
+Non-free bits belong in separate (source & binary) packages.
+This driver must use request_firmware() to load the FPGA bitfile.
+
+---
+--- a/drivers/dahdi/pciradio.c
++++ b/drivers/dahdi/pciradio.c
+@@ -51,6 +51,7 @@ With driver:	303826  (1.5 %)
+ #include <linux/interrupt.h>
+ #include <linux/moduleparam.h>
+ #include <linux/sched.h>
++#include <linux/firmware.h>
+ #include <asm/io.h>
+ #include <asm/delay.h> 
+ 
+@@ -220,8 +221,6 @@ struct tonedef {
+ 	unsigned char b2;
+ } ;
+ 
+-#include "radfw.h"
+-
+ static struct tonedef cttable_tx [] = {
+ {0,0,0},
+ {670,0xE,0xB1},
+@@ -1505,9 +1504,18 @@ static void wait_just_a_bit(int foo)
+ 
+ static int pciradio_hardware_init(struct pciradio *rad)
+ {
++const struct firmware *bitfile;
+ unsigned char byte1,byte2;
+ int	x;
+ unsigned long endjif;
++int res;
++
++	res = request_firmware(&bitfile, "dahdi-fw-pciradio.bin",
++			       &rad->dev->dev);
++	if (res)
++		return res;
++
++	res = -EIO;
+ 
+ 	/* Signal Reset */
+ 	outb(0x01, rad->ioaddr + RAD_CNTL);
+@@ -1539,7 +1547,7 @@ unsigned long endjif;
+ 	while (inb(rad->ioaddr + RAD_AUXR) & (XINIT | XDONE) && (jiffies <= endjif));
+ 	if (endjif < jiffies) {
+ 		printk(KERN_DEBUG "Timeout waiting for INIT and DONE to go low\n");
+-		return -1;
++		goto out;
+ 	}
+ 	if (debug) printk(KERN_DEBUG "fwload: Init and done gone to low\n");
+ 	/* De-assert PGM */
+@@ -1550,16 +1558,16 @@ unsigned long endjif;
+ 	while (!(inb(rad->ioaddr + RAD_AUXR) & XINIT) && (jiffies <= endjif));
+ 	if (endjif < jiffies) {
+ 		printk(KERN_DEBUG "Timeout waiting for INIT to go high\n");
+-		return -1;
++		goto out;
+ 	}
+ 	if (debug) printk(KERN_DEBUG "fwload: Init went high (clearing done)\nNow loading...\n");
+ 	/* Assert CS+Write */
+ 	rad->ios &= ~XCS;
+ 	outb(rad->ios, rad->ioaddr + RAD_AUXD);
+-	for (x = 0; x < sizeof(radfw); x++)
++	for (x = 0; x < bitfile->size; x++)
+ 	   {
+ 		  /* write the byte */
+-		outb(radfw[x],rad->ioaddr + RAD_REGBASE);
++		outb(bitfile->data[x], rad->ioaddr + RAD_REGBASE);
+ 		  /* if DONE signal, we're done, exit */
+ 		if (inb(rad->ioaddr + RAD_AUXR) & XDONE) break;
+ 		  /* if INIT drops, we're screwed, exit */
+@@ -1580,12 +1588,12 @@ unsigned long endjif;
+ 	if (!(inb(rad->ioaddr + RAD_AUXR) & XINIT))
+ 	   {
+ 		printk(KERN_NOTICE "Drove Init low!! CRC Error!!!\n");
+-		return -1;
++		goto out;
+ 	   }
+ 	if (!(inb(rad->ioaddr + RAD_AUXR) & XDONE))
+ 	   {
+ 		printk(KERN_INFO "Did not get DONE signal. Short file maybe??\n");
+-		return -1;
++		goto out;
+ 	   }
+ 	wait_just_a_bit(2);
+ 	/* get the thingy started */
+@@ -1646,7 +1654,10 @@ unsigned long endjif;
+ 	/* Wait 1/4 of a sec */
+ 	wait_just_a_bit(HZ/4);
+ 
+-	return 0;
++	res = 0;
++out:
++	release_firmware(bitfile);
++	return res;
+ }
+ 
+ static void pciradio_enable_interrupts(struct pciradio *rad)
+@@ -1765,7 +1776,8 @@ static int __devinit pciradio_init_one(s
+ 			/* Keep track of which device we are */
+ 			pci_set_drvdata(pdev, rad);
+ 
+-			if (pciradio_hardware_init(rad)) {
++			res = pciradio_hardware_init(rad);
++			if (res) {
+ 				/* Set Reset Low */
+ 				x=inb(rad->ioaddr + RAD_CNTL);
+ 				outb((~0x1)&x, rad->ioaddr + RAD_CNTL);
+@@ -1780,7 +1792,7 @@ static int __devinit pciradio_init_one(s
+ 				pci_set_drvdata(pdev, NULL);
+ 				dahdi_free_device(rad->ddev);
+ 				kfree(rad);
+-				return -EIO;
++				return res;
+ 
+ 			}
+ 
+--- a/drivers/dahdi/Kbuild
++++ b/drivers/dahdi/Kbuild
+@@ -141,11 +141,4 @@ ifeq ($(HPEC_PRESENT),yes)
+ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_HPEC)	+= dahdi_echocan_hpec.o
+ endif
+ 
+-$(obj)/pciradio.o: $(obj)/radfw.h
+-
+ hostprogs-y := makefw
+-
+-$(obj)/radfw.h: $(src)/pciradio.rbt $(obj)/makefw
+-	$(obj)/makefw $< radfw > $@
+-
+-clean-files	:= radfw.h

Modified: dahdi-linux/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/series?rev=10084&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/patches/series (original)
+++ dahdi-linux/trunk/debian/patches/series Mon Jan 28 14:40:40 2013
@@ -4,3 +4,5 @@
 chanmute
 notest
 fix_define_dev
+tor2-request_firmware
+pciradio-request_firmware

Added: dahdi-linux/trunk/debian/patches/tor2-request_firmware
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/tor2-request_firmware?rev=10084&op=file
==============================================================================
--- dahdi-linux/trunk/debian/patches/tor2-request_firmware (added)
+++ dahdi-linux/trunk/debian/patches/tor2-request_firmware Mon Jan 28 14:40:40 2013
@@ -1,0 +1,87 @@
+Author: Ben Hutchings <ben at decadent.org.uk>
+Description: tor2: Use request_firmware() to load bitfile
+Bug-Debian: http://bugs.debian.org/693666
+
+Non-free bits belong in separate (source & binary) packages.
+This driver must use request_firmware() to load the FPGA bitfile.
+
+---
+--- a/drivers/dahdi/tor2.c
++++ b/drivers/dahdi/tor2.c
+@@ -31,11 +31,11 @@
+ #include <linux/sched.h>
+ #include <linux/interrupt.h>
+ #include <linux/moduleparam.h>
++#include <linux/firmware.h>
+ 
+ #include <dahdi/kernel.h>
+ #define NEED_PCI_IDS
+ #include "tor2-hw.h"
+-#include "tor2fw.h"
+ 
+ /*
+  * Tasklets provide better system interactive response at the cost of the
+@@ -379,6 +379,7 @@ static int __devinit tor2_probe(struct p
+ 	unsigned long endjif;
+ 	__iomem volatile unsigned long *gpdata_io, *lasdata_io;
+ 	unsigned long gpdata,lasdata;
++	const struct firmware *bitfile;
+ 
+ 	res = pci_enable_device(pdev);
+ 	if (res)
+@@ -439,6 +440,11 @@ static int __devinit tor2_probe(struct p
+ 		       tor->xilinx8_len, tor->xilinx8_region);
+ 		goto err_out_release_plx_region;
+ 	}
++	res = request_firmware(&bitfile, "dahdi-fw-tor2.bin", &pdev->dev);
++	if (res) {
++		ret = res;
++		goto err_out_release_all_regions;
++	}
+ 	pci_set_drvdata(pdev, tor);
+ 	printk(KERN_INFO "Detected %s at 0x%lx/0x%lx irq %d\n", tor->type, 
+ 		tor->xilinx32_region, tor->xilinx8_region,tor->irq);
+@@ -490,10 +496,10 @@ static int __devinit tor2_probe(struct p
+ 	/* assert WRITE signal */
+ 	gpdata &= ~GPIO_WRITE;
+ 	writel(gpdata, gpdata_io);
+-	for (x = 0; x < sizeof(tor2fw); x++)
++	for (x = 0; x < bitfile->size; x++)
+ 	   {
+ 		  /* write the byte */
+-		writeb(tor2fw[x], tor->mem8);
++		writeb(bitfile->data[x], tor->mem8);
+ 		  /* if DONE signal, we're done, exit */
+ 		if (readl(gpdata_io) & GPIO_DONE)
+ 			break;
+@@ -612,9 +618,12 @@ static int __devinit tor2_probe(struct p
+ 			break;
+ 	}
+ 
++	release_firmware(bitfile);
+ 	return 0;
+ 
+ err_out_release_all:
++	release_firmware(bitfile);
++err_out_release_all_regions:
+ 	release_mem_region(tor->xilinx32_region, tor->xilinx32_len);
+ 	release_mem_region(tor->xilinx8_region, tor->xilinx8_len);
+ err_out_release_plx_region:
+--- a/drivers/dahdi/Kbuild
++++ b/drivers/dahdi/Kbuild
+@@ -142,14 +142,10 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECH
+ endif
+ 
+ $(obj)/pciradio.o: $(obj)/radfw.h
+-$(obj)/tor2.o: $(obj)/tor2fw.h
+ 
+ hostprogs-y := makefw
+ 
+-$(obj)/tor2fw.h: $(src)/tormenta2.rbt $(obj)/makefw 
+-	$(obj)/makefw $< tor2fw > $@
+-
+ $(obj)/radfw.h: $(src)/pciradio.rbt $(obj)/makefw
+ 	$(obj)/makefw $< radfw > $@
+ 
+-clean-files	:= radfw.h tor2fw.h
++clean-files	:= radfw.h

Modified: dahdi-linux/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/rules?rev=10084&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/rules (original)
+++ dahdi-linux/trunk/debian/rules Mon Jan 28 14:40:40 2013
@@ -25,7 +25,7 @@
 DEBVERSION:=$(shell head -n 1 debian/changelog \
 		    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
 DEB_BASE_VERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9~.a-z]*$$//')
-UPVERSION:=$(shell echo $(DEB_BASE_VERSION) | sed -e 's/[~+]dfsg\(~\|$$\)/\1/' -e 's/~\(rc\|beta\)/-\1/')
+UPVERSION:=$(shell echo $(DEB_BASE_VERSION) | sed -e 's/[~+]dfsg[0-9]*\(~\|$$\)/\1/' -e 's/~\(rc\|beta\)/-\1/')
 
 UPFILENAME := $(PACKAGE_SRC)_$(UPVERSION).orig.tar.gz
 FILENAME := $(PACKAGE_SRC)_$(DEB_BASE_VERSION).orig.tar.gz
@@ -117,6 +117,7 @@
 	@@cd $(TARBALL_DIR) ; \
 	tar xfz ../$(UPFILENAME)
 	@@rm -rf $(TARBALL_DIR)/$(PACKAGE_SRC)-$(UPVERSION)/drivers/dahdi/xpp/firmwares/*.hex
+	@@rm -f $(TARBALL_DIR)/$(PACKAGE_SRC)-$(UPVERSION)/drivers/dahdi/*.rbt
 	@@cd $(TARBALL_DIR) ; \
 	tar cfz ../$(FILENAME) *
 	@@echo Cleaning up...




More information about the Pkg-voip-commits mailing list