| .. SPDX-License-Identifier: GPL-2.0+: |
| The cp command is used to copy *count* chunks of memory from the *source* |
| address to the *target* address. If the *target* address points to NOR flash, |
| the flash is programmed. When the *target* address points at ordinary memory, |
| memmove() is used, so the two regions may overlap. |
| The number bytes in one chunk is defined by the suffix defaulting to 4 bytes: |
| source address, hexadecimal |
| target address, hexadecimal |
| number of words to be copied, hexadecimal |
| The example device has a NOR flash where the lower part of the flash is |
| protected. We first copy to RAM, then to unprotected flash. Last we try to |
| - block size: 0x20000 bytes |
| - 0x000000000000-0x000002000000 : "nor0" |
| => cp.b 4020000 5000000 200000 |
| => cp.b 4020000 1e00000 20000 |
| Copy to Flash... Can't write to protected Flash sectors |
| The cp command is available if CONFIG_CMD_MEMORY=y. Support for 64 bit words |
| (cp.q) is only available on 64-bit targets. Copying to flash depends on |
| The return value $? is set to 0 (true) if the command was successfully, |