diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-12-19 15:53:16 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-12-19 15:53:16 +0000 |
commit | 246d632138ea45b54c80861eca72bdeb57ff6c9a (patch) | |
tree | df90510025e03c9479ec6c8d1cf5f6a238bc2702 | |
parent | 5889db4f46affb811864757b319eca4349a4cbaa (diff) |
Make T1 mode work -- tested against an old dusty lmc(4) if found somewhere.
-rw-r--r-- | sys/dev/pci/bt8370.c | 36 | ||||
-rw-r--r-- | sys/dev/pci/bt8370reg.h | 4 |
2 files changed, 22 insertions, 18 deletions
diff --git a/sys/dev/pci/bt8370.c b/sys/dev/pci/bt8370.c index 6a2051d1159..2010fa556ea 100644 --- a/sys/dev/pci/bt8370.c +++ b/sys/dev/pci/bt8370.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt8370.c,v 1.4 2005/08/27 13:32:01 claudio Exp $ */ +/* $OpenBSD: bt8370.c,v 1.5 2005/12/19 15:53:15 claudio Exp $ */ /* * Copyright (c) 2004,2005 Internet Business Solutions AG, Zurich, Switzerland @@ -41,6 +41,9 @@ #include "if_art.h" #include "bt8370reg.h" +#define FRAMER_LIU_E1_120 1 +#define FRAMER_LIU_T1_133 2 + void bt8370_set_sbi_clock_mode(struct art_softc *, enum art_sbi_type, u_int, int); void bt8370_set_bus_mode(struct art_softc *, enum art_sbi_mode, int); @@ -105,6 +108,8 @@ bt8370_set_frame_mode(struct art_softc *ac, enum art_sbi_type type, u_int mode, bt8370_set_sbi_clock_mode(ac, type, clockmode, channels); /* Receiver RLIU, RCVR */ + bt8370_set_line_buildout(ac, FRAMER_LIU_E1_120); + /* This one is critical */ ebus_write(&ac->art_ebus, Bt8370_RCR0, RCR0_HDB3 | RCR0_RABORT | RCR0_LFA_FAS | RCR0_RZCS_NBPV); ebus_write(&ac->art_ebus, Bt8370_RALM, 0x00); @@ -151,7 +156,7 @@ bt8370_set_frame_mode(struct art_softc *ac, enum art_sbi_type type, u_int mode, bt8370_set_sbi_clock_mode(ac, type, clockmode, channels); /* Receiver RLIU, RCVR */ - bt8370_set_line_buildout(ac, 0); + bt8370_set_line_buildout(ac, FRAMER_LIU_E1_120); /* This one is critical */ ebus_write(&ac->art_ebus, Bt8370_RCR0, RCR0_RFORCE | RCR0_HDB3 | RCR0_LFA_FAS | RCR0_RZCS_NBPV); @@ -207,7 +212,7 @@ bt8370_set_frame_mode(struct art_softc *ac, enum art_sbi_type type, u_int mode, bt8370_set_sbi_clock_mode(ac, type, clockmode, channels); /* Receiver RLIU, RCVR */ - bt8370_set_line_buildout(ac, 0); + bt8370_set_line_buildout(ac, FRAMER_LIU_E1_120); /* This one is critical */ ebus_write(&ac->art_ebus, Bt8370_RCR0, RCR0_RFORCE | RCR0_HDB3 | RCR0_LFA_FASCRC | RCR0_RZCS_NBPV); @@ -257,7 +262,7 @@ bt8370_set_frame_mode(struct art_softc *ac, enum art_sbi_type type, u_int mode, bt8370_set_sbi_clock_mode(ac, type, clockmode, channels); /* Receiver RLIU, RCVR */ - bt8370_set_line_buildout(ac, 0); + bt8370_set_line_buildout(ac, FRAMER_LIU_T1_133); /* This one is critical */ ebus_write(&ac->art_ebus, Bt8370_RCR0, RCR0_RFORCE | RCR0_AMI | RCR0_LFA_26F | RCR0_RZCS_NBPV); @@ -307,7 +312,7 @@ bt8370_set_frame_mode(struct art_softc *ac, enum art_sbi_type type, u_int mode, bt8370_set_sbi_clock_mode(ac, type, clockmode, channels); /* Receiver RLIU, RCVR */ - bt8370_set_line_buildout(ac, 0); + bt8370_set_line_buildout(ac, FRAMER_LIU_T1_133); /* This one is critical */ ebus_write(&ac->art_ebus, Bt8370_RCR0, RCR0_RFORCE | RCR0_B8ZS | RCR0_LFA_26F | RCR0_RZCS_NBPV); @@ -607,7 +612,7 @@ bt8370_set_bus_mode(struct art_softc *ac, enum art_sbi_mode mode, int nchannels) ebus_write(&ac->art_ebus, channel, SBCn_RINDO | SBCn_TINDO | SBCn_ASSIGN); /* In T1 mode timeslot 0 must not be used. */ - if (nchannels == 24 && channel == 0) + if (nchannels == 25 && channel == Bt8370_SBCn) ebus_write(&ac->art_ebus, channel, 0x00); } for (channel = Bt8370_TPCn; channel < Bt8370_TPCn + @@ -634,23 +639,22 @@ bt8370_set_line_buildout(struct art_softc *ac, int mode) RLIU_CR_AGC2048 | RLIU_CR_LONG_EYE); switch (mode) { -#if 0 case FRAMER_LIU_T1_133: - /* fallthrough */ + /* Short haul */ + ebus_write(&ac->art_ebus, Bt8370_VGA_MAX, 0x1F); + /* Force EQ off */ + ebus_write(&ac->art_ebus, Bt8370_PRE_EQ, 0xA6); + + ebus_write(&ac->art_ebus, Bt8370_TLIU_CR, TLIU_CR_100); + break; +#if 0 case FRAMER_LIU_T1_266: - /* fallthrough */ case FRAMER_LIU_T1_399: - /* fallthrough */ case FRAMER_LIU_T1_533: - /* fallthrough */ case FRAMER_LIU_T1_655: - /* fallthrough */ case FRAMER_LIU_T1_LH68: - /* fallthrough */ - case FRAMER_LIU_E1_120: - /* fallthrough */ #endif - default: + case FRAMER_LIU_E1_120: /* Short haul */ ebus_write(&ac->art_ebus, Bt8370_VGA_MAX, 0x1F); /* Force EQ off */ diff --git a/sys/dev/pci/bt8370reg.h b/sys/dev/pci/bt8370reg.h index 686be6c953e..3414c79ca33 100644 --- a/sys/dev/pci/bt8370reg.h +++ b/sys/dev/pci/bt8370reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bt8370reg.h,v 1.2 2005/08/13 23:52:49 claudio Exp $ */ +/* $OpenBSD: bt8370reg.h,v 1.3 2005/12/19 15:53:15 claudio Exp $ */ /* * Copyright (c) 2004,2005 Internet Business Solutions AG, Zurich, Switzerland @@ -25,7 +25,7 @@ #define CR0_E1_FAS 0x00 /* E1 FAS only */ #define CR0_E1_FAS_CRC 0x08 /* E1 FAS+CRC4 */ #define CR0_T1_SF 0x09 /* T1 SF */ -#define CR0_T1_ESF 0x1A /* T1 ESF+ForceCRC */ +#define CR0_T1_ESF 0x1B /* T1 ESF+ForceCRC */ #define Bt8370_JAT_CR 0x002 /* Jitter attenuator conf */ #define JAT_CR_JEN 0x80 /* Jitter anntenuator enable */ #define JAT_CR_JFREE 0x40 /* Free running JCLK and CLADO */ |