summaryrefslogtreecommitdiff
path: root/xpp/init_card_7_26
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-04-29 20:19:13 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-04-29 20:19:13 +0000
commit878abc56f013a9bd94a46bf1a009407e6c8ecceb (patch)
treed38e11f3cc2cdb3cc9357e9a1bee1f20c724f272 /xpp/init_card_7_26
parent47bcd1d6d884db6f92c68772aad712579f1c3b16 (diff)
xpp rev. 3814:
* Protocol no. 2.6: syncing improvements. * Support for 8-port Astribank BRI. * Firmware unloading now works: rmmod xpp_usb; /etc/hotplug/usb/xpp_fxloader reset * Defaults of kernel parameters are now part of parameter description. * World-readable kernel parameters. * No need for extra patch beyond bristuff for Astribank BRI. * Default poll intervals changed: 500 in BRI and FXO. * Allow changing FXS polls interval at run time. * BRI initalization fixed on SUSE (path to logger). * When using the SUSE zaptel rpm package, set modules_var=ZAPTEL_MODULES in /etc/sysconfig/zaptel . * zt_registration not verbose by default. * xpp_sync warns if FXO is sync slave. * Fixed genzaptelconf -z (zapscan output emulation). * PCM fixes. * Solves "multiple ticks" bug. No need for pcm_tasklets workaround. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2475 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/init_card_7_26')
-rwxr-xr-xxpp/init_card_7_2640
1 files changed, 27 insertions, 13 deletions
diff --git a/xpp/init_card_7_26 b/xpp/init_card_7_26
index 7219707..83ed3a0 100755
--- a/xpp/init_card_7_26
+++ b/xpp/init_card_7_26
@@ -68,7 +68,7 @@ if (-t STDERR) {
logit "Interactive startup\n";
} else {
$unit_id = "$ENV{XPD_BUS}/$ENV{XPD_NAME}";
- open (STDERR, "| /usr/bin/logger -t $program -p kern.info") || die;
+ open (STDERR, "| logger -t $program -p kern.info") || die;
logit "Non Interactive startup\n";
}
@@ -200,7 +200,8 @@ sub setup_fifo {
my $fifonum = ($portnum << 3) | ($chan << 1) | ($direction); # # MSB first
my $r_slot = ($portnum << 3) | ($chan << 1) | ($direction);
# receive data from STIO2, transmit to STIO1
- my $a_sl_cfg = (0x80 | ($portnum << 3) | ($chan << 1) | ($direction));
+ my $short_portnum = $portnum & 0x03;
+ my $a_sl_cfg = (0x80 | ($short_portnum << 3) | ($chan << 1) | ($direction));
#logit "setup_fifo($fifonum)";
xhfc_selfifo $fifonum;
@@ -214,6 +215,8 @@ sub setup_fifo {
xhfc_selfifo $fifonum; # wait for busy is builtin in this command
BRI::gen "0 WD 10 %02X", $r_slot; # R_SLOT
BRI::gen "0 WD D0 %02X", $a_sl_cfg; # A_SL_CFG
+
+ #system("/bin/echo \"----=====NT\" \"short_portnum=\"$short_portnum \"portnum=\" $portnum \"chan=\" $chan\"======----\n\" >>/root/xortel/test_init");
}
# zap_xhfc_su.c:1071
@@ -297,6 +300,7 @@ my %opts;
getopts('o:', \%opts);
$ENV{XPP_BASE} = '/proc/xpp';
+my $cmd = "$ENV{XPP_BASE}/$ENV{XPD_BUS}/command";
my $output;
if ($opts{o}) {
$output = $opts{o};
@@ -352,6 +356,9 @@ sub init_xhfc() {
BRI::gen "0 WS 14 98 20"; # R_PCM_MD1: V_PLL_ADJ
# (DPLL adjust speed) in the
# last slot of PCM frame
+
+ BRI::gen "0 WD 4C 03"; # GPIOGPIO function (not PWM) on GPIO0 and GPIO1 pins
+ BRI::gen "0 WD 4A 03"; # Output enable for GPIO0 and GPIO1 pins
}
my %port_type = (
@@ -375,13 +382,16 @@ sub main() {
BRI::gen "0 Wm";
# Common initialization
- if($ENV{XPD_SUBUNIT} eq '0') {
+ if(($ENV{XPD_SUBUNIT} % 4) eq '0') {
# Turn off multi-byte packet reception before initialization started
- system("/bin/echo \"0A 00 0F 00 C0 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
- system("/bin/echo \"0A 00 0F 08 C0 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
- system("/bin/echo \"0A 00 0F 10 C0 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
- system("/bin/echo \"0A 00 0F 18 C0 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
-
+ my $chipnum = ($ENV{XPD_SUBUNIT} & 0x04) << 3; # Max 2 XHFC chips
+ for my $subunit (0 .. 3) { # 4 subunits per XHFC chip
+ my $addr = $chipnum | ($subunit << 3);
+ my $str = sprintf("0A 00 0F %02X C0 00 00 00 00 00\n", $addr);
+ open(CMD, ">$cmd") || die "Failed to open '$cmd': $!\n";
+ print CMD $str;
+ close CMD;
+ }
init_xhfc; # zap_xhfc_su.c:1173 in setup_instance()
}
@@ -397,12 +407,16 @@ sub main() {
$p->zthfc_startup;
- if($ENV{XPD_SUBUNIT} eq 3) {
+ if(($ENV{XPD_SUBUNIT} % 4) eq 3) {
# Turn on multi-byte packet reception when ports initialization finished
- system("/bin/echo \"0A 00 0F 00 80 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
- system("/bin/echo \"0A 00 0F 08 80 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
- system("/bin/echo \"0A 00 0F 10 80 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
- system("/bin/echo \"0A 00 0F 18 80 00 00 00 00 00\" >/proc/xpp/$ENV{XPD_BUS}/command");
+ my $chipnum = ($ENV{XPD_SUBUNIT} & 0x04) << 3; # Max 2 XHFC chips
+ for my $subunit (0 .. 3) { # 4 subunits per XHFC chip
+ my $addr = $chipnum | ($subunit << 3);
+ my $str = sprintf("0A 00 0F %02X 80 00 00 00 00 00\n", $addr);
+ open(CMD, ">$cmd") || die "Failed to open '$cmd': $!\n";
+ print CMD $str;
+ close CMD;
+ }
}
}