# @name 
#	SPI modular test with optional params 
# @desc 
#       modprobe spi module with params first and then do RW and then rmmod it
# @requires  spi_master/*/spi_davinci 
# @setup_requires spi

# Notes: this test is not working yet since spi_davinci_busfreq is not recognized.

SPI_S_MODULAR_INSMOD_RW_RMMOD_W_PARAM_0001 source "common.sh"; install_modules.sh "spi"; mod_name=`get_modular_name.sh "spi"` || die "error getting modular name"; opt_params="spi_davinci_busfreq=10"; do_cmd insmod.sh "$mod_name" "$opt_params";   part=`get_mtd_partition_number.sh "spi"` || die "error getting mtd part number: $part"; size=`get_mtd_size.sh "$part"` || die "error getting mtd size: $size"; size=$(( $size/MB )) && size=`get_ceiling_divide.sh "$size" 10` || die "error getting divide ceiling"; do_cmd blk_device_dd_readwrite_test.sh -f "jffs2" -b "1M" -c "$size" -l "1" -d "spi";     do_cmd rmmod.sh "$mod_name" 
