|
DSWifi
|
BMI utilities for DSi Wifi. More...
#include <nds/ndstypes.h>#include <dswifi_version.h>Functions | |
| u32 | ath6k_bmi_execute (u32 addr, u32 arg) |
| Call an Xtensa subroutine from BMI mode. | |
| u32 | ath6k_bmi_get_version (void) |
| Reads the wifi module version. | |
| void | ath6k_bmi_lz_upload (u32 addr, const u8 *data, u32 len) |
| Upload LZ-compressed data to the Xtensa-internal address space. The BMI bootloader decompresses it. | |
| void | ath6k_bmi_read_memory (u32 addr, u32 len, u8 *data) |
| Read a block of Xtensa-internal memory via BMI. | |
| u32 | ath6k_bmi_read_register (u32 addr) |
| Reads an Xtensa-internal I/O register. | |
| void | ath6k_bmi_set_entrypoint (u32 addr) |
| Set the runtime Xtensa firmware entrypoint. | |
| void | ath6k_bmi_start_firmware (void) |
| Start the firmware at the address specified by wifi_card_bmi_set_entrypoint() | |
| void | ath6k_bmi_wait_count4 (void) |
| Perform a busywait until it is possible to send more data via BMI. | |
| void | ath6k_bmi_write_memory (u32 addr, const u8 *data, u32 len) |
| Writes a block of data into Xtensa-internal memory via BMI. | |
| void | ath6k_bmi_write_register (u32 addr, u32 val) |
| Writes an Xtensa-internal I/O register. | |
| void | ath6k_deinit_hw (void) |
| Deinitializes the Wifi SDIO card. | |
| int | ath6k_init_hw_to_bmi (void) |
| Initializes the Wifi SDIO card into BMI (bootloader) mode. | |
| bool | ath6k_mbox0_read_u32_timeout (u32 *retv, u32 timeout_max) |
| Read a 32-bit word from the MBOX0 FIFO, with timeout. | |
| u16 | ath6k_mbox0_readbytes (u8 *dat, u32 sz_buf, u32 len_read) |
| Read a block of data from the MBOX0 FIFO. | |
| void | ath6k_mbox0_sendbytes (const u8 *dat, u32 len) |
| Send a block of data to the MBOX0 FIFO. | |
| void | ath6k_mbox0_write_u32 (u32 val, bool send_irq) |
| Write a 32-bit word to the MBOX0 FIFO. | |
| u32 | ath6k_read_intern_word (u32 addr) |
| Read a 32-bit word from the Xtensa internal address space. | |
| void | ath6k_write_intern_word (u32 addr, u32 data) |
| Writes a 32-bit word into the Xtensa internal address space. | |
| void | SDIO_enable_cardirq (bool en) |
| Sets whether the SDIO card interrupt is enabled. | |
| u8 | SDIO_func0_read_u8 (u32 addr) |
| Read a byte from the SDIO Function 0 address space. | |
| int | SDIO_func0_write_u8 (u32 addr, u8 val) |
| Write a byte to the SDIO Function 0 address space. | |
| u32 | SDIO_func1_read_u32 (u32 addr) |
| Read a 32-bit word from the SDIO Function 1 address space. | |
| u8 | SDIO_func1_read_u8 (u32 addr) |
| Read a byte from the SDIO Function 1 address space. | |
| void | SDIO_func1_write_u32 (u32 addr, u32 val) |
| Write a 32-bit word to the SDIO Function 1 address space. | |
| int | SDIO_func1_write_u8 (u32 addr, u8 v) |
| Write a byte to the SDIO Function 1 address space. | |
| u16 | SDIO_get_cardirq_stat (void) |
| Gets whether the SDIO card interrupt is pending. | |
BMI utilities for DSi Wifi.
This header defines EXPERIMENTAL functions for low-level access to the WiFi card hardware, including functions for uploading code to the Xtensa CPU in the WiFi card.
Please do not assume this API is stable, it might still change in the- future.
| u32 ath6k_bmi_execute | ( | u32 | addr, |
| u32 | arg | ||
| ) |
Call an Xtensa subroutine from BMI mode.
| addr | Function address to call |
| arg | Argument to pass to thre function |
| u32 ath6k_bmi_get_version | ( | void | ) |
Reads the wifi module version.
DWM-W015 = 0x20000188 DWM-W024 = 0x23000024 DWM-W028 = 0x2300006F
| void ath6k_bmi_lz_upload | ( | u32 | addr, |
| const u8 * | data, | ||
| u32 | len | ||
| ) |
Upload LZ-compressed data to the Xtensa-internal address space. The BMI bootloader decompresses it.
| addr | Xtensa-internal address to decompress the data to |
| data | LZ-compressed data to transfer and decompress |
| len | size of compressed data |
| void ath6k_bmi_read_memory | ( | u32 | addr, |
| u32 | len, | ||
| u8 * | data | ||
| ) |
Read a block of Xtensa-internal memory via BMI.
| addr | address to read from |
| len | number of bytes to read |
| data | buffer to return read data into |
| u32 ath6k_bmi_read_register | ( | u32 | addr | ) |
Reads an Xtensa-internal I/O register.
| addr | I/O register address |
| void ath6k_bmi_set_entrypoint | ( | u32 | addr | ) |
Set the runtime Xtensa firmware entrypoint.
| addr | firmware entrypoint address |
| void ath6k_bmi_write_memory | ( | u32 | addr, |
| const u8 * | data, | ||
| u32 | len | ||
| ) |
Writes a block of data into Xtensa-internal memory via BMI.
| addr | address to write to |
| data | data to write |
| len | number of bytes to write |
| void ath6k_bmi_write_register | ( | u32 | addr, |
| u32 | val | ||
| ) |
Writes an Xtensa-internal I/O register.
| addr | I/O register address |
| val | I/O register value |
| int ath6k_init_hw_to_bmi | ( | void | ) |
Initializes the Wifi SDIO card into BMI (bootloader) mode.
| bool ath6k_mbox0_read_u32_timeout | ( | u32 * | retv, |
| u32 | timeout_max | ||
| ) |
Read a 32-bit word from the MBOX0 FIFO, with timeout.
| retv | pointer to write the return value to. only written to in case no timeout occurs. |
| timeout_max | maximum tries before a timeout is signalled |
| u16 ath6k_mbox0_readbytes | ( | u8 * | dat, |
| u32 | sz_buf, | ||
| u32 | len_read | ||
| ) |
Read a block of data from the MBOX0 FIFO.
| dat | buffer to read into |
| sz_buf | maximum buffer size |
| len_read | number of bytes to read, must not exceed 0x1800! |
| void ath6k_mbox0_sendbytes | ( | const u8 * | dat, |
| u32 | len | ||
| ) |
Send a block of data to the MBOX0 FIFO.
| dat | data to send |
| len | number of bytes to send, must not exceed 0x1800! |
| void ath6k_mbox0_write_u32 | ( | u32 | val, |
| bool | send_irq | ||
| ) |
Write a 32-bit word to the MBOX0 FIFO.
| val | value to write |
| send_irq | whether to interrupt the Xtensa core of the Wifi module |
| u32 ath6k_read_intern_word | ( | u32 | addr | ) |
Read a 32-bit word from the Xtensa internal address space.
| addr | address to read from |
| void ath6k_write_intern_word | ( | u32 | addr, |
| u32 | data | ||
| ) |
Writes a 32-bit word into the Xtensa internal address space.
| addr | address to write to |
| data | value to write |
| void SDIO_enable_cardirq | ( | bool | en | ) |
Sets whether the SDIO card interrupt is enabled.
irqSetAUX(IRQ_WIFI_SDIO_CARDIRQ, YOUR_ISR_HERE); irqEnableAUX(IRQ_WIFI_SDIO_CARDIRQ); SDIO_enable_cardirq(true); SDIO_func1_write_u32(0x418, 0x010300D1); SDIO_func0_write_u8(0x4, 0x3); // CCCR irq_enable, main+func1
| en | True for enable the IRQ, false for disable |
| u8 SDIO_func0_read_u8 | ( | u32 | addr | ) |
Read a byte from the SDIO Function 0 address space.
| addr | Function 0 address to read from |
| int SDIO_func0_write_u8 | ( | u32 | addr, |
| u8 | val | ||
| ) |
Write a byte to the SDIO Function 0 address space.
| addr | Function 0 address to write to |
| v | value to write |
| u32 SDIO_func1_read_u32 | ( | u32 | addr | ) |
Read a 32-bit word from the SDIO Function 1 address space.
| addr | Function 1 address to read from |
| u8 SDIO_func1_read_u8 | ( | u32 | addr | ) |
Read a byte from the SDIO Function 1 address space.
| addr | Function 1 address to read from |
| void SDIO_func1_write_u32 | ( | u32 | addr, |
| u32 | val | ||
| ) |
Write a 32-bit word to the SDIO Function 1 address space.
| addr | Function 1 address to write to |
| v | value to write |
| int SDIO_func1_write_u8 | ( | u32 | addr, |
| u8 | v | ||
| ) |
Write a byte to the SDIO Function 1 address space.
| addr | Function 1 address to write to |
| v | value to write |
| u16 SDIO_get_cardirq_stat | ( | void | ) |
Gets whether the SDIO card interrupt is pending.