[svn-commits] kpfleming: trunk r1575 - in /trunk: ./ wct4xxp/
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Wed Nov 8 16:09:34 MST 2006
Author: kpfleming
Date: Wed Nov 8 17:09:33 2006
New Revision: 1575
URL: http://svn.digium.com/view/zaptel?rev=1575&view=rev
Log:
Merged revisions 1574 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.4
................
r1574 | kpfleming | 2006-11-08 17:06:17 -0600 (Wed, 08 Nov 2006) | 11 lines
Merged revisions 1573 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.2
........
r1573 | kpfleming | 2006-11-08 17:04:33 -0600 (Wed, 08 Nov 2006) | 3 lines
clean up recent VPMOCT changes
add support for Infineon FALC rev 2.2
........
................
Modified:
trunk/ (props changed)
trunk/wct4xxp/base.c
trunk/wct4xxp/vpm450m.c
trunk/wct4xxp/vpm450m.h
trunk/wcte11xp.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.4-merged (original)
+++ branch-1.4-merged Wed Nov 8 17:09:33 2006
@@ -1,1 +1,1 @@
-/branches/1.4:1-1471,1490,1500,1507,1520,1528,1530,1536,1543,1547,1568
+/branches/1.4:1-1471,1490,1500,1507,1520,1528,1530,1536,1543,1547,1568,1574
Modified: trunk/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/base.c?rev=1575&r1=1574&r2=1575&view=diff
==============================================================================
--- trunk/wct4xxp/base.c (original)
+++ trunk/wct4xxp/base.c Wed Nov 8 17:09:33 2006
@@ -3102,64 +3102,71 @@
unsigned int check1, check2;
int laws[4] = { 0, };
int x;
- int try;
int passedinit = 0;
-#ifdef HOTPLUG_FIRMWARE
- const struct firmware *firmware;
-#endif
if (!vpmsupport) {
- printk("VPM450M: Support Disabled\n");
+ printk("VPM450: Support Disabled\n");
return;
}
+
/* Turn on GPIO/DATA mux if supported */
t4_gpio_setdir(wc, (1 << 24), (1 << 24));
__t4_raw_oct_out(wc, 0x000a, 0x5678);
__t4_raw_oct_out(wc, 0x0004, 0x1234);
check1 = __t4_raw_oct_in(wc, 0x0004);
check2 = __t4_raw_oct_in(wc, 0x000a);
- if (1 || debug)
+ if (debug)
printk("OCT Result: %04x/%04x\n", __t4_raw_oct_in(wc, 0x0004), __t4_raw_oct_in(wc, 0x000a));
if (__t4_raw_oct_in(wc, 0x0004) != 0x1234) {
printk("VPM450: Not Present\n");
return;
}
- /* First try to load the VPMOCT128 then fallback to VPMOCT064 */
- for (try=0; try<2; try++) {
-#ifdef HOTPLUG_FIRMWARE
- if (!try) { /* vpmoct128 */
- if (request_firmware(&firmware, "OCT6114-128D.ima", &wc->dev->dev) != 0 || !firmware) {
- printk("VPM450M: firmware OCT6114-128D.ima not found to be loaded\n");
- continue;
- }
- } else { /* vpmoct064 */
- if (request_firmware(&firmware, "OCT6114-64D.ima", &wc->dev->dev) != 0 || !firmware) {
- printk("VPM450M: firmware OCT6114-64D not found to be loaded\n");
+
+ /* Setup alaw vs ulaw rules */
+ for (x = 0;x < wc->numspans; x++) {
+ if (wc->tspans[x]->span.channels > 24)
+ laws[x] = 1;
+ }
+
+#ifndef HOTPLUG_FIRMWARE
+ if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans)))
+ passedinit = 1;
+#else
+ {
+ const struct firmware *firmware;
+
+ /* if this is a 4-span card, just try using the 128-channel firmware;
+ otherwise, try both, because a 2-span card could potentially have
+ a 128-channel Octasic module
+ */
+ if (wc->numspans < 3) {
+ if ((request_firmware(&firmware, oct064_firmware, &wc->dev->dev) != 0) ||
+ !firmware) {
+ printk("VPM450: firmware %s not available from userspace\n", oct064_firmware);
return;
- }
- }
- printk("VPM450: Firmware of size %zd found try=%d\n", firmware->size, try+1);
-#else
- printk("VPM450: Using classic method of loading firmware try=%d\n", try+1);
-#endif
- /* Setup alaw vs ulaw rules */
- for (x=0;x<wc->numspans;x++) {
- if (wc->tspans[x]->span.channels > 24)
- laws[x] = 1;
- }
-#ifdef HOTPLUG_FIRMWARE
- if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware))) {
- passedinit=1;
- break;
- }
- release_firmware(firmware);
-#else
- if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans))) {
- passedinit=1;
- break;
- }
-#endif
- }
+ } else {
+ if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware)))
+ passedinit=1;
+
+ release_firmware(firmware);
+ }
+ }
+
+ if (!passedinit) {
+ if ((request_firmware(&firmware, oct128_firmware, &wc->dev->dev) != 0) ||
+ !firmware) {
+ printk("VPM450: firmware %s not available from userspace\n", oct128_firmware);
+ return;
+ } else {
+ if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware)))
+ passedinit=1;
+
+ release_firmware(firmware);
+ }
+ }
+ }
+#endif
+
if (!passedinit) {
printk("VPM450: Failed to initialize\n");
return;
@@ -3181,7 +3188,7 @@
unsigned int i, x, y, gen2vpm=0;
if (!vpmsupport) {
- printk("VPM400M: Support Disabled\n");
+ printk("VPM400: Support Disabled\n");
return;
}
@@ -3191,7 +3198,7 @@
case 1:
break;
default:
- printk("VPM: %d is not a valid vpmspans value, using 4\n", vpmspans);
+ printk("VPM400: %d is not a valid vpmspans value, using 4\n", vpmspans);
vpmspans = 4;
}
Modified: trunk/wct4xxp/vpm450m.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/vpm450m.c?rev=1575&r1=1574&r2=1575&view=diff
==============================================================================
--- trunk/wct4xxp/vpm450m.c (original)
+++ trunk/wct4xxp/vpm450m.c Wed Nov 8 17:09:33 2006
@@ -403,6 +403,7 @@
Oct6100GetInstanceSizeDef(&InstanceSize);
ChipOpen.pProcessContext = wc;
+
#ifdef HOTPLUG_FIRMWARE
ChipOpen.pbyImageFile = firmware->data;
ChipOpen.ulImageSize = firmware->size;
@@ -415,6 +416,7 @@
ChipOpen.ulImageSize = sizeof(vpmoct064_fw);
}
#endif
+
ChipOpen.fEnableMemClkOut = TRUE;
ChipOpen.ulMemClkFreq = cOCT6100_MCLK_FREQ_133_MHZ;
ChipOpen.ulMaxChannels = vpm450m->numchans;
Modified: trunk/wct4xxp/vpm450m.h
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/vpm450m.h?rev=1575&r1=1574&r2=1575&view=diff
==============================================================================
--- trunk/wct4xxp/vpm450m.h (original)
+++ trunk/wct4xxp/vpm450m.h Wed Nov 8 17:09:33 2006
@@ -4,30 +4,50 @@
* Mark Spencer <markster at digium.com>
*
* All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
*/
#ifndef _VPM450M_H
#define _VPM450M_H
+struct vpm450m;
-struct vpm450m;
#ifdef HOTPLUG_FIRMWARE
struct firmware;
#endif
+static const char *oct064_firmware = "OCT6114-64D.ima";
+static const char *oct128_firmware = "OCT6114-128D.ima";
+
/* From driver */
-extern unsigned int oct_get_reg(void *data, unsigned int reg);
-extern void oct_set_reg(void *data, unsigned int reg, unsigned int val);
+unsigned int oct_get_reg(void *data, unsigned int reg);
+void oct_set_reg(void *data, unsigned int reg, unsigned int val);
-/* From vpm450m2 */
+/* From vpm450m */
#ifdef HOTPLUG_FIRMWARE
-extern struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct firmware *firmware);
+struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct firmware *firmware);
#else
-extern struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans);
+struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans);
#endif
-extern void vpm450m_setec(struct vpm450m *instance, int channel, int eclen);
-extern void vpm450m_setdtmf(struct vpm450m *instance, int channel, int dtmfdetect, int dtmfmute);
-extern int vpm450m_checkirq(struct vpm450m *vpm450m);
-extern int vpm450m_getdtmf(struct vpm450m *vpm450m, int *channel, int *tone, int *start);
-extern void release_vpm450m(struct vpm450m *instance);
+
+void vpm450m_setec(struct vpm450m *instance, int channel, int eclen);
+void vpm450m_setdtmf(struct vpm450m *instance, int channel, int dtmfdetect, int dtmfmute);
+int vpm450m_checkirq(struct vpm450m *vpm450m);
+int vpm450m_getdtmf(struct vpm450m *vpm450m, int *channel, int *tone, int *start);
+void release_vpm450m(struct vpm450m *instance);
+
#endif
Modified: trunk/wcte11xp.c
URL: http://svn.digium.com/view/zaptel/trunk/wcte11xp.c?rev=1575&r1=1574&r2=1575&view=diff
==============================================================================
--- trunk/wcte11xp.c (original)
+++ trunk/wcte11xp.c Wed Nov 8 17:09:33 2006
@@ -628,7 +628,7 @@
{
printk("TE110P: Setting up global serial parameters for %s %s\n",
wc->spantype == TYPE_E1 ? (unchannelized ? "Unchannelized E1" : "E1") : "T1",
- wc->spanflags & FLAG_FALC12 ? "FALC V1.2" : "FALC V2.1");
+ wc->spanflags & FLAG_FALC12 ? "FALC V1.2" : "FALC V2.2");
t1_framer_out(wc, 0x85, 0xe0); /* GPC1: Multiplex mode enabled, FSC is output, active low, RCLK from channel 0 */
t1_framer_out(wc, 0x08, 0x05); /* IPC: Interrupt push/pull active low */
if (wc->spanflags & FLAG_FALC12) {
@@ -639,38 +639,15 @@
t1_framer_out(wc, 0x96, 0x03);
t1_framer_out(wc, 0x97, 0x10);
} else {
-#ifdef TRUST_INFINEON_ERRATA
- if (wc->spantype == TYPE_E1) {
- /* Global clocks (8.192 Mhz CLK) */
- t1_framer_out(wc, 0x92, 0x00);
- t1_framer_out(wc, 0x93, 0x00);
- t1_framer_out(wc, 0x94, 0x00);
- t1_framer_out(wc, 0x95, 0x00);
- t1_framer_out(wc, 0x96, 0x00);
- t1_framer_out(wc, 0x97, 0x0F);
- t1_framer_out(wc, 0x98, 0x80);
- t1_framer_out(wc, 0x99, 0x00);
- } else {
- /* Global clocks (8.192 Mhz CLK) */
- t1_framer_out(wc, 0x92, 0x00);
- t1_framer_out(wc, 0x93, 0x10);
- t1_framer_out(wc, 0x94, 0xfb);
- t1_framer_out(wc, 0x95, 0x03);
- t1_framer_out(wc, 0x96, 0x00);
- t1_framer_out(wc, 0x97, 0x0b);
- t1_framer_out(wc, 0x98, 0x8c);
- t1_framer_out(wc, 0x99, 0x80);
- }
-#else
- t1_framer_out(wc, 0x92, 0x66);
- t1_framer_out(wc, 0x93, 0x0e);
- t1_framer_out(wc, 0x94, 0x3f);
- t1_framer_out(wc, 0x95, 0x0f);
- t1_framer_out(wc, 0x96, 0x04);
- t1_framer_out(wc, 0x97, 0x3c);
- t1_framer_out(wc, 0x98, 0x9c);
- t1_framer_out(wc, 0x99, 0x90);
-#endif
+ /* Global clocks (8.192 Mhz CLK) */
+ t1_framer_out(wc, 0x92, 0x00);
+ t1_framer_out(wc, 0x93, 0x18);
+ t1_framer_out(wc, 0x94, 0xfb);
+ t1_framer_out(wc, 0x95, 0x0b);
+ t1_framer_out(wc, 0x96, 0x00);
+ t1_framer_out(wc, 0x97, 0x0b);
+ t1_framer_out(wc, 0x98, 0xdb);
+ t1_framer_out(wc, 0x99, 0xdf);
}
/* Configure interrupts */
t1_framer_out(wc, 0x46, 0x40); /* GCR: Interrupt on Activation/Deactivation of AIX, LOS */
@@ -687,7 +664,7 @@
if (wc->spanflags & FLAG_FALC12)
t1_framer_out(wc, 0x25, 0x04); /* RC1: The rest of RC0 */
else
- t1_framer_out(wc, 0x25, 0x06); /* RC1: The rest of RC0 */
+ t1_framer_out(wc, 0x25, 0x05); /* RC1: The rest of RC0 */
/* Configure ports */
t1_framer_out(wc, 0x80, 0x00); /* PC1: SPYR/SPYX input on RPA/XPA */
More information about the svn-commits
mailing list