1 .. SPDX-License-Identifier: GPL-2.0-or-later:
3 read and write commands
4 =======================
11 read <interface> <dev[:part|#partname]> <addr> <blk#> <cnt>
12 write <interface> <dev[:part|#partname]> <addr> <blk#> <cnt>
14 The read and write commands can be used for raw access to data in
15 block devices (or partitions therein), i.e. without going through a
21 The block device is specified using the <interface> (e.g. "mmc") and
22 <dev> parameters. If the block device has a partition table, one can
23 optionally specify a partition number (using the :part syntax) or
24 partition name (using the #partname syntax). The command then reads
25 the <cnt> blocks of data starting at block number <blk#> of the given
26 device/partition to the memory address <addr>.
31 The write command is completely equivalent to the read command, except
32 of course that the transfer direction is reversed.
37 # Read 2 MiB from partition 3 of mmc device 2 to $loadaddr
38 read mmc 2.3 $loadaddr 0 0x1000
40 # Read 16 MiB from the partition named 'kernel' of mmc device 1 to $loadaddr
41 read mmc 1#kernel $loadaddr 0 0x8000
43 # Write to the third sector of the partition named 'bootdata' of mmc device 0
44 write mmc 0#bootdata $loadaddr 2 1