intel_l3_parity: Use getopt for the l3 parity tool

Add new command line arguments in addition to supporting the old
features. This patch only introduces one feature, the -e argument to
enable a specific row/bank/subbank. Previously you could only enable
all. Otherwise, it has what you expect (we prefer -r -b -s for
specifying the row/bank/subbank).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
Ben Widawsky
2013-09-06 21:10:50 -07:00
parent e740bdf5bd
commit a9cd76b36e
2 changed files with 109 additions and 25 deletions
+6 -6
View File
@@ -8,20 +8,20 @@ fi
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
. $SOURCE_DIR/drm_lib.sh
$SOURCE_DIR/../tools/intel_l3_parity -c
$SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -e
#Check that we can remap a row
$SOURCE_DIR/../tools/intel_l3_parity 0,0,0
disabled=`$SOURCE_DIR/../tools/intel_l3_parity | grep -c 'Row 0, Bank 0, Subbank 0 is disabled'`
$SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -d
disabled=`$SOURCE_DIR/../tools/intel_l3_parity -l | grep -c 'Row 0, Bank 0, Subbank 0 is disabled'`
if [ "$disabled" != "1" ] ; then
echo "Fail"
exit 1
fi
$SOURCE_DIR/../tools/intel_l3_parity -c
$SOURCE_DIR/../tools/intel_l3_parity -r 0 -b 0 -s 0 -e
#Check that we can clear remaps
if [ `$SOURCE_DIR/../tools/intel_l3_parity | wc -c` != "0" ] ; then
echo "Fail"
if [ `$SOURCE_DIR/../tools/intel_l3_parity -l | wc -c` != "0" ] ; then
echo "Fail 2"
exit 1
fi