1#!/usr/bin/bash
2
3if [ $# -eq 0 ]
4then
5    echo "usage: setsmem2size 64"
6    echo "usage: setsmem2size 128"
7    echo " Sets console simulated MEM2 size. Either 64MB or 128MB is set as the console simulated memory size."
8    exit 1
9fi
10
11if [ "$NDEV" = "" ]
12then
13    echo "NDEV is not found. Do nothing and exit."
14fi
15
16if [ "$NDEV" != "" ]
17then
18    echo "NDEV detected"
19
20    #
21    # change NDEV configuration
22    #
23
24    if [ $1 = 64 ]
25    then
26        if $REVOLUTION_SDK_ROOT/x86/bin/tickleBI2 -o "$REVOLUTION_SDK_ROOT/x86/bin/bi2.bin" 44 0x4000000
27        then
28            echo "Successfully done. Set 64MB as the console simulated mem size."
29        else
30            echo "Failed to set the console simulated mem size."
31            exit 1
32        fi
33    elif [ $1 = 128 ]
34    then
35        if $REVOLUTION_SDK_ROOT/x86/bin/tickleBI2 -o "$REVOLUTION_SDK_ROOT/x86/bin/bi2.bin" 44 0x8000000
36        then
37            echo "Successfully done. Set 128MB as the console simulated mem size."
38        else
39            echo "Failed to set the console simulated mem size."
40            exit 1
41        fi
42    elif [ $1 = "0" ]
43    then
44        if $REVOLUTION_SDK_ROOT/x86/bin/tickleBI2 -o "$REVOLUTION_SDK_ROOT/x86/bin/bi2.bin" 44 0x0
45        then
46            echo "Successfully done. Physical memory size is considered as the console simulated mem size."
47        else
48            echo "Failed to set the console simulated mem size."
49            exit 1
50        fi
51    elif [ $1 = "0x0" ]
52    then
53        if $REVOLUTION_SDK_ROOT/x86/bin/tickleBI2 -o "$REVOLUTION_SDK_ROOT/x86/bin/bi2.bin" 44 0x0
54        then
55            echo "Successfully done. Physical memory size is considered as the console simulated mem size."
56        else
57            echo "Failed to set the console simulated mem size."
58            exit 1
59        fi
60    else
61        echo "usage: setsmem2size 64"
62        echo "usage: setsmem2size 128"
63        echo " Sets console simulated MEM2 size. Either 64MB or 128MB is set as the console simulated memory size."
64        exit 1
65    fi
66fi
67
68echo
69echo "**********************************************************************"
70echo "* If you make master data, you must execute ndrun before you do so!! *"
71echo "**********************************************************************"
72echo
73
74