# ******************************************************************************
#  INTEL CONFIDENTIAL
#
#  Copyright 2003 Intel Corporation All Rights Reserved.
#
#  The source code contained or described herein and all documents related to
#  the source code ("Material") are owned by Intel Corporation or its
#  suppliers or licensors.
#
#  Title to the Material #ains with Intel Corporation or its suppliers and
#  licensors. The Material contains trade secrets and proprietary and
#  confidential information of Intel or its suppliers and licensors.
#  The Material is protected by worldwide copyright and trade secret laws and
#  treaty provisions. No part of the Material may be used, copied, reproduced,
#  modified, published, uploaded, posted, transmitted, distributed,
#  or disclosed in any way without Intel's prior express written permission.
#
#  No license under any patent, copyright, trade secret or other intellectual
#  property right is granted to or conferred upon you by disclosure
#  or delivery of the Materials, either expressly, by implication, inducement,
#  estoppel or otherwise. Any license under such intellectual property rights
#  must be express and approved by Intel in writing.
#
# ******************************************************************************

# ******************************************************************************
# ============================================================================
#
# = PRODUCT
#      Intel(r) IXA SDK for the IXP2400 Network Processor
#
# = FILENAME
#      start_gbeth
#
# = DESCRIPTION
#
# ============================================================================
# ******************************************************************************

#!/bin/sh
if [ -z "$1" ]; then
echo
echo Syntax for $0.
echo $0 [bb/db0/db1].
echo
echo Two Gb ports are always positioned on backplane.
echo
echo ie.1. Two other Gb on mezz in db0.
echo $0 db0
echo
echo ie.2. Two other Gb on baseboard [MIC or backplane].
echo $0 bb
echo
exit
fi

if [ "$1" = "db0" ]; then
    GB_CONF=0
elif [ "$1" = "db1" ]; then
    GB_CONF=1
elif [ "$1" = "bb" ]; then
    GB_CONF=2
else
    echo Two Gb ports are positioned on backplane.
    echo Specify where two other giga bit ports are positioned:
    echo On baseboard [baseboard MIC] - \"bb\" or
    echo on mezzanine in db0 or db1 - \"db0\" or \"db1\".
   exit
fi

rm -f /dev/gbe /dev/MeDrv0
mknod /dev/gbe c 253 0
mknod /dev/MeDrv0 c 10 244

insmod ./halMeDrv.o
./WBSrvr &
./ethernet_project

if [ $GB_CONF = 0 ]; then
insmod ./bb_linux_drv val_conf="spi2;spi3;sphy;125mhz" db0_conf="spi0;spi1;sphy;125mhz"
elif [ $GB_CONF = 1 ]; then
insmod ./bb_linux_drv val_conf="spi2;spi3;sphy;125mhz" db1_conf="spi0;spi1;sphy;125mhz"
elif [ $GB_CONF = 2 ]; then
insmod ./bb_linux_drv val_conf="spi0;spi1;spi2;spi3;sphy;125mhz"
fi

./eth_drv_cfg


