libdragon
|
Low-level RSP hardware library. More...
Functions | |
DEFINE_RSP_UCODE (rsp_crash) | |
void | rsp_init (void) |
Initialize the RSP subsytem. | |
void | rsp_load (rsp_ucode_t *ucode) |
Load a RSP ucode. | |
void | rsp_load_code (void *start, unsigned long size, unsigned int imem_offset) |
Do a DMA transfer to load a piece of code into RSP IMEM. | |
void | rsp_load_data (void *start, unsigned long size, unsigned int dmem_offset) |
Do a DMA transfer to load a piece of data into RSP DMEM. | |
void | rsp_read_code (void *start, unsigned long size, unsigned int imem_offset) |
Do a DMA transfer to load a piece of code from RSP IMEM to RDRAM. | |
void | rsp_read_data (void *start, unsigned long size, unsigned int dmem_offset) |
Do a DMA transfer to load a piece of data from RSP DMEM to RDRAM. | |
void | __rsp_run_async (uint32_t status_flags) |
Internal implementation of rsp_run_async. | |
void | rsp_wait (void) |
Wait until RSP has finished processing. | |
void | rsp_run (void) |
Run RSP ucode. | |
void | rsp_run_async (void) |
Run RSP async. | |
Low-level RSP hardware library.
DEFINE_RSP_UCODE | ( | rsp_crash | ) |
RSP crash handler ucode (rsp_crash.S)
void rsp_load | ( | rsp_ucode_t * | ucode | ) |
Load a RSP ucode.
This function allows to load a RSP ucode into the RSP internal memory. The function executes the transfer right away, so it is responsibility of the caller making sure that it's a good time to do it.
The function internally keeps a pointer to the last loaded ucode. If the ucode passed is the same, it does nothing. This makes it easier to write code that optimistically switches between different ucodes, but without forcing transfers every time.
[in] | ucode | Ucode to load into RSP |
void rsp_load_code | ( | void * | code, |
unsigned long | size, | ||
unsigned int | imem_offset | ||
) |
Do a DMA transfer to load a piece of code into RSP IMEM.
This is a lower-level function that actually executes a DMA transfer from RDRAM to IMEM. Prefer using rsp_load instead.
[in] | code | Pointer to buffer in RDRAM containing code. Must be aligned to 8 bytes. |
[in] | size | Size of the code to load. Must be a multiple of 8. |
[in] | imem_offset | Byte offset in IMEM where to load the code. Must be a multiple of 8. |
void rsp_load_data | ( | void * | data, |
unsigned long | size, | ||
unsigned int | dmem_offset | ||
) |
Do a DMA transfer to load a piece of data into RSP DMEM.
This is a lower-level function that actually executes a DMA transfer from RDRAM to DMEM. Prefer using rsp_load instead.
[in] | data | Pointer to buffer in RDRAM containing data. Must be aligned to 8 bytes. |
[in] | size | Size of the data to load. Must be a multiple of 8. |
[in] | dmem_offset | Offset in DMEM where to load the code. Must be a multiple of 8. |
void rsp_read_code | ( | void * | code, |
unsigned long | size, | ||
unsigned int | imem_offset | ||
) |
Do a DMA transfer to load a piece of code from RSP IMEM to RDRAM.
This is a lower-level function that actually executes a DMA transfer from IMEM to RDRAM.
[in] | code | Pointer to buffer in RDRAM where to write code. Must be aligned to 8 bytes. |
[in] | size | Size of the code to load. Must be a multiple of 8. |
[in] | imem_offset | Byte offset in IMEM where where the code will be loaded from. Must be a multiple of 8. |
void rsp_read_data | ( | void * | data, |
unsigned long | size, | ||
unsigned int | dmem_offset | ||
) |
Do a DMA transfer to load a piece of data from RSP DMEM to RDRAM.
This is a lower-level function that actually executes a DMA transfer from DMEM to RDRAM.
[in] | data | Pointer to buffer in RDRAM where to write data. Must be aligned to 8 bytes. |
[in] | size | Size of the data to load. Must be a multiple of 8. |
[in] | dmem_offset | Byte offset in IMEM where where the data will be loaded from. Must be a multiple of 8. |
void rsp_wait | ( | void | ) |
Wait until RSP has finished processing.
This function will wait until the RSP is halted. It contains a fixed timeout of 500 ms, after which rsp_crash is invoked to abort the program.
void rsp_run | ( | void | ) |
Run RSP ucode.
This function starts running the RSP, and wait until the ucode is finished.
|
externinline |
Run RSP async.
This function starts running the RSP in background. Use rsp_wait() to synchronize later.