i2c tools better naming scheme
[cr816-sim.git] / tools / bq_test_eeprom_flash_32
blob710e614c0852f041321f54c435cc6e7eb94e2ae9
1 #!/bin/sh
2 #writes 1 byte to ADDR of flash region (base is 0x0 (ram))
3 #won't erase, so new value is ANDed with old one
5 ROW=$((${1}))
7 if [ -z "${ROW}" ] || [ "${#}" -ne "33" ]; then
8 echo "writes 32 bytes to ROW of data space" >&2
9 echo "Usage:" >&2
10 echo " ${0} <row> <val0> .. <val31>" >&2
11 exit
14 echo "will write 32 bytes to data flash!!" >&2
15 echo "enter to continue, ctrl+c to quit" >&2
16 read
18 shift
20 DATA="${@}"
22 . ./i2c_config.sh
24 smb_init
25 smb_write 35 0x44 33 ${ROW} ${DATA}
26 smb_commit