Corelink DMA Engines: Difference between revisions
No edit summary |
|||
Line 7: | Line 7: | ||
sint8_t channel_sel; // @0 Selects which DMA channel to use: 0-7, -1 = don't care. | sint8_t channel_sel; // @0 Selects which DMA channel to use: 0-7, -1 = don't care. | ||
uint8_t endian_swap_size; // @1 Accepted values: 0=none, 2=16bit, 4=32bit, 8=64bit. | uint8_t endian_swap_size; // @1 Accepted values: 0=none, 2=16bit, 4=32bit, 8=64bit. | ||
uint8_t flags; // @2 bit0: | uint8_t flags; // @2 bit0: DST_IS_PERIPHERAL, bit1: SRC_IS_PERIPHERAL, bit2: SHALL_BLOCK, bit3: KEEP_ALIVE, bit6: DST_IS_RAM, bit7: SRC_IS_RAM | ||
uint8_t padding; | uint8_t padding; | ||
DmaSubConfig dst_cfg; | DmaSubConfig dst_cfg; | ||
Line 14: | Line 14: | ||
struct DmaSubConfig { | struct DmaSubConfig { | ||
sint8_t peripheral_id; // @0 If not * | sint8_t peripheral_id; // @0 If not *_IS_RAM set, this must be < 0x1E. | ||
uint8_t | uint8_t allowed_burst_sizes; // @1 Accepted values: 4, 8, 4|8 = 12, 1|2|4|8 = 15 | ||
sint16_t | sint16_t max_burst_total; // @2 Burst length * burst size | ||
sint16_t transfer_size?; // @4 Must not be 0 if peripheral_id == 0xFF. | sint16_t transfer_size?; // @4 Must not be 0 if peripheral_id == 0xFF. | ||
sint16_t unk4; // @6 | sint16_t unk4; // @6 | ||
Line 22: | Line 22: | ||
} | } | ||
If | If SRC_IS_PERIPHERAL/SRC_IS_PERIPHERAL is set in the flags field, the configuration for src/dst is loaded from src_cfg/dst_cfg respectively and the transfer will be done from/to a fixed address. If the *_IS_RAM flag is set same thing goes, except byte0 of each cfg is forced to 0xFF (RAM) and the transfer will be done from/to an incrementing address. *_IS_RAM has priority over _IS_PERIPHERAL. | ||
If | If neither *_IS_PERIPHERAL or *_IS_RAM is set, default configuration is loaded: | ||
.peripheral_id = 0xFF, | .peripheral_id = 0xFF, | ||
. | .allowed_burst_sizes = 1 | 2 | 4 | 8, | ||
. | .max_burst_total = 0x80, | ||
.transfer_size = 0, | .transfer_size? = 0, | ||
.unk4 = 0x80, | .unk4 = 0x80, | ||
. | .transfer_stride? = 0, | ||
If SHALL_BLOCK is set, the thread will sleep until the DMA engine is ready. If not set, the SVC will return 0xD04007F0 if the DMA channel is busy. | If SHALL_BLOCK is set, the thread will sleep until the DMA engine is ready. If not set, the SVC will return 0xD04007F0 if the DMA channel is busy. | ||
Line 138: | Line 136: | ||
! Description | ! Description | ||
|- | |- | ||
| 0 | | 0 | ||
| Process9 | | Process9 | ||
| CTRCARD | | CTRCARD |