• Yanbo Li's avatar
    ath10k: add memory dump debugfs interface · 9f65ad25
    Yanbo Li authored
    Add mem_val debugfs file for dumping the firmware (target) memory and also for
    writing to the memory. The firmware memory is accessed through one file which
    uses position of the file as the firmware memory address. For example, with dd
    use skip parameter for the address.
    
    Beucase target memory width is 32 bits it's strongly recommended to use
    blocksize divisable with 4 when using this interface. For example, when using
    dd use bs=4 to set the block size to 4 and remember to divide both count and
    skip values with four.
    
    To read 4 kB chunk from address 0x400000:
    
    dd if=mem_value bs=4 count=1024 skip=1048576 | xxd -g1
    
    To write value 0x01020304 to address 0x400400:
    
    echo 0x01020304 | xxd -r | dd of=mem_value bs=4 seek=1048832
    
    To read 4 KB chunk of memory and then write back after edit:
    
    dd if=mem_value of=tmp.bin bs=4 count=1024 skip=1048576
    emacs tmp.bin
    dd if=tmp.bin of=mem_value bs=4 count=1024 seek=1048576
    Signed-off-by: default avatarYanbo Li <yanbol@qti.qualcomm.com>
    Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
    9f65ad25
hif.h 6.21 KB