DMA

A command of the separate bcma command line; see Commands for other chip families.

DMA facilities interface.

DMA alloc [<mem-unit>] <count> [<name>]
free <dma-id>|all
load <dma-id> [<mem-unit>] <data>
fill <dma-id> [<mem-unit>] <value> [<count>]
edit <dma-id> [<mem-unit>]
dump <dma-id> [<mem-unit>] [<count>]
info

Built-in help

This command provides access to the DMA memory API via the following
sub-commands:
    alloc - Allocate cache-coherent DMA memory region.
        <mem-unit> - Memory unit (see below).
        <count>    - Number of memory units to allocate.
        <name>     - Optional string to identify the DMA region.
    free  - Free DMA memory region.
        <dma-id>   - DMA memory ID (see below).
    load  - Write data o DMA memory.
        <dma-id>   - DMA memory ID (see below).
        <mem-unit> - Memory unit (see below).
        <data>     - Space-separated list of data values which will be
                     parsed according to the selected memory unit.
                     If the memory unit is Byte, data may be specified
                     as a sequence of hex bytes. e.g. 0x123456abcdef.
                     Underscores in the hex bytes will be ignored.
                     If the memory unit is HEXdigit, data may be
                     specified as a sequence of hex digits. e.g. 12ef.
                     Spaces, commas, underscores or hyphens in the hex
                     digits will be ignored. This is for the
                     convenience of data copy and paste.
    fill  - Fill DMA memory with a single value.
        <dma-id>   - DMA memory ID (see below).
        <mem-unit> - Memory unit (see below).
        <value>    - Value to fill into the DMA memory.
        <count>    - Number of memory units to fill. If not specified,
                     the entire DMA region will be filled.
    edit  - Edit DMA memory interactively.
        <dma-id>   - DMA memory ID (see below).
        <mem-unit> - Memory unit (see below).
    dump  - Dump the contents of DMA memory.
        <dma-id>   - DMA memory ID (see below).
        <mem-unit> - Memory unit (see below).
        <count>    - Number of memory units to dump. If not specified,
                     the entire DMA region will be dumped.
    info  - List all allocated DMA memory regions, including the
            logical address, size in bytes, physical address,
            cache-coherent information, and the region name (if any).
            No map/unmap is required for DMA memory regions with
            cache-coherent attribute.

The default memory unit is Byte, but Halfword (16-bits) or
Word (32-bits) can be used if this is more suitable for the DMA memory
contents. HEXdigit is an extra type supported in sub-command 'load'.

The DMA memory ID is either the logical address of the DMA memory or
the associated name (optionally) specified during allocation.

If the option <name> parameter is specified with the allocation
command, then a set of local environment variables will be created
as follows:
    $dma_<name>_laddr - Logical address of the DMA memory region.
    $dma_<name>_paddr - Physical address of the DMA memory region.
    $dma_<name>_size  - Size of the DMA memory region.

The following local variables will be created/updated for each
successful memory allocation whether the <name> is specified or not:
    $dma_laddr - Logical address of the DMA memory region.
    $dma_paddr - Physical address of the DMA memory region.
    $dma_size  - Size of the DMA memory region.

Built-in examples

alloc 35
alloc w 10
alloc h 20 xyz
info
load xyz hex 01,02-03_04 05060708090a0b0c
load xyz 1 2 3 4 5 6 7 8 9 0xa 11 12
load xyz h 0x0201 0x0403 0x0605 0x0807 0x0a09 0xc0b
load xyz w 0x04030201 0x08070605 0x0c0b0a09
fill 0x7fa11543ba83 b 0x5a 10
fill 0x7fa11543ba80 w 0x5aa5a55a 5
fill xyz 0
edit 0x7fa1_1543ba84 w
edit xyz
dump xyz
dump xyz w 5
dump $dma_laddr 10
free xyz
free all