init_exmimo2 2.18 KB
Newer Older
1 2
#!/bin/bash

3 4 5 6 7
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements.  See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
8
# * the OAI Public License, Version 1.1  (the "License"); you may not use this file
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *      http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# *      contact@openairinterface.org
# */

24 25 26 27 28 29
# file init_nas_nos1
# brief loads the nasmesh module and sets up the radio bearers (used to provide ip interface without S1 interface)
# author Florian Kaltenberger
#
#######################################

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
load_module() 
{
  mod_name=${1##*/}
  mod_name=${mod_name%.*}
  if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
    then
      echo "module $mod_name already loaded: I remove it first"
      sudo rmmod $mod_name
  fi
  echo loading $mod_name
  sudo insmod $1
}


function main() 
{
46 47 48 49 50 51 52 53 54 55 56 57 58
PCI=`lspci -m | grep Xilinx`
if [ -z "$PCI" ]; then
 echo "No card found. Stopping!"
 return
fi

## This part corrects the wrong configuration of the endpoint done by the bios in some machines
echo "$PCI" | while read config_reg; do
SLOT_NUMBER=`echo $config_reg | awk -F\" '{print $1}'`
sudo setpci -s $SLOT_NUMBER 60.b=10
done


59
load_module $OPENAIR_DIR/targets/bin/openair_rf.ko
60 61 62 63 64 65 66
sleep 1

if [ ! -e /dev/openair0 ]; then 
 sudo mknod /dev/openair0 c 127 0
 sudo chmod a+rw /dev/openair0
fi

67
   $OPENAIR_DIR/targets/bin/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10
68 69 70
}

main "$@"