summaryrefslogtreecommitdiff
path: root/xpp/initialize_registers
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-05-03 23:06:02 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-05-03 23:06:02 +0000
commit2dd60aaf18e98b0e9d3c06bd9dce5f1128fa55ad (patch)
tree1a1cd28888f191e6ce83bcbbe539124e2529c90b /xpp/initialize_registers
parent8c4db4e3acd9a7626e709af0494055487b589719 (diff)
xpp driver release 1.1.0 (first part of commit)
* FPGA firmware now loaded from PC (for newer models) * Driver for the FXO module * Moved most userspace files to the subdirectory utils (see also next commit) * Explicit license for firmware files * Optionally avoid auto-registration * Initializations parameters to chips given from userspace * And did I mention bugfixes? git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1021 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/initialize_registers')
-rwxr-xr-xxpp/initialize_registers39
1 files changed, 39 insertions, 0 deletions
diff --git a/xpp/initialize_registers b/xpp/initialize_registers
new file mode 100755
index 0000000..35386ce
--- /dev/null
+++ b/xpp/initialize_registers
@@ -0,0 +1,39 @@
+#! /bin/sh
+# XPD_BUS - bus name
+# XPD_NAME - xpd name
+# XPD_TYPE - xpd type number (from protocol reply):
+# 3 - FXS
+# 4 - FXO
+# XPD_REVISION - xpd revision number
+
+set -e
+
+LOGGER="logger -i -t `basename $0`"
+
+INIT_DIR=`dirname $0`
+BASE=/proc/xpp
+
+SLICS="$BASE/$XPD_BUS/$XPD_NAME/slics"
+FILE="$INIT_DIR/init_data_${XPD_TYPE}_${XPD_REVISION}.cmd"
+
+if [ ! -f "$SLICS" ]; then
+ $LOGGER "missing slics file '$SLICS'"
+ exit 1
+fi
+
+if [ ! -f "$FILE" ]; then
+ $LOGGER "missing register initialization file '$FILE'"
+ exit 1
+fi
+
+case "$XPD_TYPE" in
+3|4)
+ cat "$FILE" > "$SLICS"
+ ;;
+*)
+ $LOGGER "Unknown type '$XPD_TYPE'"
+ exit 2
+esac
+$LOGGER "Wrote '$FILE' into '$SLICS'"
+
+exit 0