[svn-commits] mspiceland: branch linux/mspiceland/dahdi-qfalc31 r7050 - /linux/team/mspicel...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 21 09:17:34 CDT 2009


Author: mspiceland
Date: Fri Aug 21 09:17:30 2009
New Revision: 7050

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=7050
Log:
Identify qfalc chip as v3.1 or v2.1 or before.

Modified:
    linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c

Modified: linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c?view=diff&rev=7050&r1=7049&r2=7050
==============================================================================
--- linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c Fri Aug 21 09:17:30 2009
@@ -302,7 +302,7 @@
 #endif
 	int irq;			/* IRQ used by device */
 	int order;			/* Order */
-	int flags;			/* Device flags */
+	unsigned int falc31 : 1;	/* are we falc v3.1 (atomic not necessary) */
 	int master;				/* Are we master */
 	int ledreg;				/* LED Register */
 	unsigned int gpio;
@@ -3496,7 +3496,7 @@
 static int t4_hardware_init_2(struct t4 *wc)
 {
 	int x;
-	unsigned int falcver;
+	unsigned int regval;
 
 	if (t4_pci_in(wc, WC_VERSION) >= 0xc01a0165) {
 		wc->tspans[0]->spanflags |= FLAG_OCTOPT;
@@ -3505,10 +3505,31 @@
 	/* Setup LEDS, take out of reset */
 	t4_pci_out(wc, WC_LEDS, 0x000000ff);
 	t4_activate(wc);
+
+	/* 
+	 * In order to find out the QFALC framer version, we have to temporarily term off compat
+	 * mode and take a peak at VSTR.  We turn compat back on when we are done.
+	 */
+	if (t4_framer_in(wc, 0, 0x4a) != 0x05)
+		printk(KERN_INFO "WARNING: FALC framer not intialized in compatibility mode.\n");
+	regval = t4_framer_in(wc, 0 ,0xd6);
+	regval |= (1 << 5); /* set COMP_DIS*/
+	t4_framer_out(wc, 0, 0xd6, regval);
+	if (t4_framer_in(wc, 0, 0x4a) == 0x05)
+		printk(KERN_INFO "FALC framer is v2.1 or earlier.\n");
+	else if (t4_framer_in(wc, 0, 0x4a) == 0x20) {
+		printk(KERN_INFO "card %d: FALC framer is v3.1.\n", wc->num);
+		wc->falc31 = 1;
+	} else
+		printk(KERN_INFO "ERROR: FALC framer version is unknown (VSTR = 0x%02x).\n", 
+			t4_framer_in(wc, 0, 0x4a));
+	regval = t4_framer_in(wc, 0 ,0xd6);
+	regval &= ~(1 << 5); /* clear COMP_DIS*/
+	t4_framer_out(wc, 0, 0xd6, regval);
 	
 	t4_framer_out(wc, 0, 0x4a, 0xaa);
-	falcver = t4_framer_in(wc, 0 ,0x4a);
-	printk(KERN_INFO "FALC version: %08x, Board ID: %02x\n", falcver, wc->order);
+	regval = t4_framer_in(wc, 0 ,0x4a);
+	printk(KERN_INFO "FALC version: %08x, Board ID: %02x\n", regval, wc->order);
 
 	for (x=0;x< 11;x++)
 		printk(KERN_INFO "Reg %d: 0x%08x\n", x, t4_pci_in(wc, x));




More information about the svn-commits mailing list