--- wcte11xp.c 2009-04-15 03:01:58.000000000 -0400 +++ new_wcte11xp.c 2009-04-15 03:14:47.000000000 -0400 @@ -648,8 +648,8 @@ static void t4_serial_setup(struct t1 *wc) { printk(KERN_INFO "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.2"); + wc->spantype == TYPE_E1 ? (unchannelized ? "Unchannelized E1" : "E1") : "T1", + wc->spanflags & FLAG_FALC12 ? "FALC V1.2" : "FALC V2.1 or 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) { @@ -661,7 +661,35 @@ t1_framer_out(wc, 0x97, 0x10); } else { /* Global clocks (8.192 Mhz CLK) */ - t1_framer_out(wc, 0x92, 0x00); + unsigned char wafer; + wafer = (t1_framer_in(wc, 0xec)>>6)&0x03; /* read wafer register to see it is a 2.1 or 2.2 version; */ + if ( wafer == 0x00) /* 2.1 */ + { + printk(KERN_INFO "Infineon PEF2256 V2.1 found\n"); + if (wc->spantype == TYPE_E1) { + 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 { + 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 /* 2.2 version, wafer should be 0x01 */ + { + printk(KERN_INFO "Infineon PEF2256 V2.2 found\n"); + t1_framer_out(wc, 0x92, 0x00); t1_framer_out(wc, 0x93, 0x18); t1_framer_out(wc, 0x94, 0xfb); t1_framer_out(wc, 0x95, 0x0b); @@ -670,6 +698,7 @@ 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 */ @@ -683,9 +712,14 @@ t1_framer_out(wc, 0x23, 0x04); /* XC1: 0 offset */ t1_framer_out(wc, 0x24, 0x07); /* RC0: Just shy of 255 */ if (wc->spanflags & FLAG_FALC12) + t1_framer_out(wc, 0x25, 0x04); /* RC1: The rest of RC0 */ + else if ( control_get_reg(wc, WC_VERSION) == 0xa0) /* openvox D110PG V1 */ + { + printk(KERN_INFO "OpenVox D110PG V1 found.\n"); t1_framer_out(wc, 0x25, 0x04); /* RC1: The rest of RC0 */ - else - t1_framer_out(wc, 0x25, 0x05); /* RC1: The rest of RC0 */ + } + else + 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 */