![]() |
vitasdk
Documentation of the vitasdk
|
Exports for Kernel. More...
Data Structures | |
| struct | SceSdifContextPartBase |
| Common 0x30-byte prefix of the FW 3.60 MMC, SD, and SDIO contexts. More... | |
| struct | SceSdifHostRegisters |
| Memory-mapped SD host-controller register block. More... | |
| struct | SceSdifCmdInput |
| SD/MMC command object. More... | |
| struct | SceSdifContextData |
| Mutable state for one FW 3.60 SDIF controller. More... | |
| struct | SceSdifContextGlobal |
| Process-global state for one SDIF controller. More... | |
| union | SceSdifContextPartBase.__unnamed49__ |
| union | SceSdifContextPartBase.__unnamed51__ |
| union | SceSdifCmdInput.response |
| Stores a normal response without the command index and CRC-7. This can also store CID or CSD; CRC-7 is cleared. The storage order is reversed. More... | |
| struct | SceSdifCmdInput.response.words |
Macros | |
| #define | SCE_SDIF_DEVICE_USD SCE_SDIF_DEVICE_SD |
| Alias using the internal uSD name for the microSD controller index. | |
Typedefs | |
| typedef void * | SceSdifDeviceContext |
| typedef struct SceSdifContextPart | SceSdifContextPart |
| Opaque device-specific context. | |
Enumerations | |
| enum | SceSdifDeviceIndex { SCE_SDIF_DEVICE_EMMC = 0x0 , SCE_SDIF_DEVICE_GC = 0x1 , SCE_SDIF_DEVICE_SDIO = 0x2 , SCE_SDIF_DEVICE_SD = 0x3 } |
| enum | SceSdifDeviceType { SCE_SDIF_DEVICE_TYPE_INVALID = 0x0 , SCE_SDIF_DEVICE_TYPE_MMC = 0x1 , SCE_SDIF_DEVICE_TYPE_SD = 0x2 , SCE_SDIF_DEVICE_TYPE_SDIO = 0x3 } |
| enum | SceSdifCommandState { SCE_SDIF_COMMAND_STATE_FREE = 0 , SCE_SDIF_COMMAND_STATE_QUEUED = 1 , SCE_SDIF_COMMAND_STATE_ACTIVE = 2 , SCE_SDIF_COMMAND_STATE_COMPLETED = 3 } |
| Internal state of a command owned by a controller context. More... | |
Exports for Kernel.
Include the header file in your project:
Link the library to the executable:
| struct SceSdifContextPartBase |
Common 0x30-byte prefix of the FW 3.60 MMC, SD, and SDIO contexts.
A SceSdifContextPart pointer may be cast to this type to inspect fields shared by every device-specific context.
| Data Fields | ||
|---|---|---|
| struct SceSdifContextGlobal * | global_context | Owning controller context. |
| SceUInt32 | card_flags | Bit 0 indicates block addressing; otherwise sector arguments use byte addressing. |
| union SceSdifContextPartBase.__unnamed49__ | __unnamed__ | |
| union SceSdifContextPartBase.__unnamed51__ | __unnamed__ | |
| SceUInt8 | cid[16] | Card identification register, in big-endian byte order. |
| SceUInt8 | csd[16] | Card-specific data register, in big-endian byte order. |
| struct SceSdifHostRegisters |
Memory-mapped SD host-controller register block.
FW 3.60 maps a 0x1000-byte register memblock for each of the three controllers. The register prefix follows the SD Host Controller interface; the remainder of the mapping is unused by the reviewed SceSdif code.
| Data Fields | ||
|---|---|---|
| volatile SceUInt32 | dma_system_address | |
| volatile SceUInt16 | block_size | |
| volatile SceUInt16 | block_count | |
| volatile SceUInt32 | argument | |
| volatile SceUInt16 | transfer_mode | |
| volatile SceUInt16 | command | |
| volatile SceUInt32 | response[4] | |
| volatile SceUInt32 | buffer_data_port | |
| volatile SceUInt32 | present_state | |
| volatile SceUInt8 | host_control | |
| volatile SceUInt8 | power_control | |
| volatile SceUInt8 | block_gap_control | |
| volatile SceUInt8 | wakeup_control | |
| volatile SceUInt16 | clock_control | |
| volatile SceUInt8 | timeout_control | |
| volatile SceUInt8 | software_reset | |
| volatile SceUInt16 | normal_interrupt_status | |
| volatile SceUInt16 | error_interrupt_status | |
| volatile SceUInt16 | normal_interrupt_status_enable | |
| volatile SceUInt16 | error_interrupt_status_enable | |
| volatile SceUInt16 | normal_interrupt_signal_enable | |
| volatile SceUInt16 | error_interrupt_signal_enable | |
| volatile SceUInt16 | auto_cmd_error_status | |
| volatile SceUInt16 | host_control_2 | |
| volatile SceUInt32 | capabilities[2] | |
| volatile SceUInt32 | maximum_current_capabilities | |
| SceUInt8 | reserved_4C[4] | |
| volatile SceUInt16 | force_event_auto_cmd_error_status | |
| volatile SceUInt16 | force_event_error_interrupt_status | |
| volatile SceUInt8 | adma_error_status | |
| SceUInt8 | reserved_55[3] | |
| volatile SceUInt32 | adma_system_address | |
| SceUInt8 | reserved_5C[0xA0] | |
| volatile SceUInt16 | slot_interrupt_status | |
| volatile SceUInt16 | host_controller_version | |
| SceUInt8 | reserved_100[0xF00] | |
| struct SceSdifCmdInput |
SD/MMC command object.
Each SceSdifContextGlobal owns 16 of these objects. SceSdif moves them through the free, pending, active, and completed states; callers must not allocate or free them independently.
Data Fields | ||
| SceSize | size | |
| Must be 0x240. | ||
| SceUInt32 | state_flags | |
| Host-command, response, transfer, DMA, and completion flags. | ||
| SceUInt32 | command | |
| SD/MMC command index. | ||
| SceUInt32 | argument | |
| SD/MMC command argument. | ||
| union { | ||
| SceUInt8 | bytes [0x10] | |
| struct { | ||
| SceUInt32 | dw0 | |
| SceUInt32 | dw1 | |
| SceUInt32 | dw2 | |
| SceUInt32 | dw3 | |
| } | words | |
| } | response | |
| Stores a normal response without the command index and CRC-7. This can also store CID or CSD; CRC-7 is cleared. The storage order is reversed. | ||
| void * | buffer | |
| Command data buffer, split into leading, direct-DMA, and trailing regions as needed. | ||
| SceUInt16 | block_size | |
| Data block size; normally 0x200 for sector transfers. | ||
| SceUInt16 | block_count | |
| Number of data blocks. | ||
| SceInt32 | error_code | |
| Completion error written by the interrupt and timeout paths. | ||
| SceUInt32 | unknown_2C | |
| Its purpose is unknown. | ||
| SceUInt8 | command_specific_data [0x30] | |
| Command-specific storage; asynchronous SDIO transfers use its final 0x20 bytes. | ||
| struct SceSdifCmdInput * | next_cmd | |
| SceSdifCommandState | state | |
| SceUInt32 | command_index | |
| Index from 0 through 15 in the owning controller's command array. | ||
| int(* | completion_callback )(struct SceSdifCmdInput *cmd) | |
| Called after completion; its return value is passed on internally. | ||
| SceUID | event_flag_id | |
| Event flag used by synchronous commands. | ||
| struct SceSdifCmdInput * | secondary_cmd | |
| Dependent command started after this command succeeds. | ||
| struct SceSdifContextGlobal * | global_context | |
| SceUIntPtr | active_dma_descriptors_paddr | |
| Physical address of the active DMA descriptor table. | ||
| SceUInt8 | internal_dma_descriptors [0x80] | |
| Embedded table of up to 16 eight-byte DMA descriptors. | ||
| void * | active_dma_descriptors | |
| Active DMA descriptor table. | ||
| SceKernelPARange | physical_ranges [16] | |
| Storage within this command object, passed to ksceKernelVARangeToPAVector. | ||
| SceUIntPtr | internal_dma_descriptors_paddr | |
| Physical address of internal_dma_descriptors. | ||
| SceUID | dma_descriptor_memblock_uid | |
| UID of the dynamically allocated DMA descriptor memblock, if any. | ||
| SceUInt32 | unknown_18C | |
| Its purpose is unknown. | ||
| SceUInt32 | unknown_190 | |
| Its purpose is unknown. | ||
| SceUInt32 | unknown_194 | |
| Its purpose is unknown. | ||
| void * | aligned_buffer | |
| Direct-DMA portion of the command data buffer. | ||
| SceSize | aligned_buffer_size | |
| Size of the direct-DMA portion. | ||
| SceSize | leading_fragment_size | |
| Size of the leading unaligned fragment. | ||
| SceSize | trailing_fragment_size | |
| Size of the trailing unaligned fragment. | ||
| SceUIntPtr | leading_fragment_paddr | |
| Physical address of leading_fragment. | ||
| SceUIntPtr | trailing_fragment_paddr | |
| Physical address of trailing_fragment. | ||
| SceInt64 | start_time | |
| System time when the command starts. | ||
| SceInt64 | end_time | |
| System time when the command completes. | ||
| SceUInt8 | leading_fragment [0x40] | |
| Bounce buffer for the leading unaligned fragment. | ||
| SceUInt8 | trailing_fragment [0x40] | |
| Bounce buffer for the trailing unaligned fragment. | ||
| struct SceSdifContextData |
Mutable state for one FW 3.60 SDIF controller.
| Data Fields | ||
|---|---|---|
| SceSdifCmdInput * | free_cmd_head | |
| SceSdifCmdInput * | free_cmd_tail | |
| SceSdifCmdInput * | pending_cmd_head | |
| SceSdifCmdInput * | pending_cmd_tail | |
| SceSdifDeviceType | device_type | |
| SceSdifContextPartBase * | device_context | Device-specific context owned by SceSdif; callers must not free it. |
| SceUInt32 | supported_voltages | OCR voltage mask: 0x80 for controllers 0 and 2, and 0x300000 for controller 1. |
| SceUInt32 | relative_card_address | Relative card address in the low 16 bits. |
| SceUInt32 | controller_index | Controller index from 0 through 2. |
| SceUInt8 | command_complete | Set when the active host command completes. |
| SceUInt8 | suspended | Nonzero while normal command submission is suspended. |
| SceUInt8 | unknown_26 | Its purpose is unknown. |
| SceUInt8 | unknown_27 | Its purpose is unknown. |
| SceSdifCmdInput * | active_cmd | |
| SceSdifCmdInput * | active_data_cmd | |
| SceSdifHostRegisters * | host_registers | Base of the controller's 0x1000-byte register memblock. |
| SceUInt32 | enabled_subintr_mask | |
| SceUInt8 | timeout_control | Host timeout-control value; initialized to 14 on FW 3.60. |
| SceUInt8 | slow_mode | Enables minimum transfer delays for controller 1 MMC reads and writes. |
| SceUInt8 | slow_read_count | Initialized from system time and incremented for each slow-mode read chunk. |
| SceUInt8 | slow_write_count | Initialized from system time and incremented for each slow-mode write. |
| SceUID | host_registers_uid | UID of the controller's 0x1000-byte register memblock. |
| SceUID | event_flag_id | Controller event flag. |
| SceKernelFastMutex | sdif_fast_mutex | Controller fast mutex. |
| SceUID | dma_descriptor_pool_uid | Offset 0x2484; UID of the 0x10000-byte DMA descriptor pool memblock. |
| void * | dma_descriptor_pool | DMA descriptor pool used when the embedded table is too small. |
| SceUInt32 | ocr | Last operation-conditions register value. |
| SceUInt32 | unknown_90 | Its purpose is unknown. |
| SceKernelSpinlock | spinlock | |
| SceUInt64 | last_transfer_duration | Duration of the last sector transfer in microseconds. |
| SceUInt8 | sdio_interrupt_status | |
| SceUInt8 | sdio_enabled_function_mask | |
| SceUInt8 | sdio_pending_function_mask | |
| SceUInt8 | unknown_A3 | Its purpose is unknown. |
| SceUInt32 | sdio_subintr2_intr_code | Interrupt code used with subinterrupt 2. |
| SceUInt32 | sdio_subintr3_8_intr_code | Interrupt code used with subinterrupts 3 through 8. |
| SceUInt32 | sdio_dispatch_pending | |
| SceUInt32 | unknown_B0 | Cleared when the controller is reset; its purpose is unknown. |
| SceUInt32 | unknown_B4 | Cleared when the controller is reset; its purpose is unknown. |
| SceUInt32 | unknown_B8 | Its purpose is unknown. |
| SceUInt32 | unknown_BC | Its purpose is unknown. |
| struct SceSdifContextGlobal |
Process-global state for one SDIF controller.
FW 3.60 owns three instances, selected by controller indices 0 through 2.
| Data Fields | ||
|---|---|---|
| SceSdifCmdInput | commands[16] | Controller-owned command pool. |
| SceSdifContextData | ctx_data | |
| union SceSdifContextPartBase.__unnamed49__ |
| union SceSdifContextPartBase.__unnamed51__ |
| union SceSdifCmdInput.response |
Stores a normal response without the command index and CRC-7. This can also store CID or CSD; CRC-7 is cleared. The storage order is reversed.
| Data Fields | ||
|---|---|---|
| SceUInt8 | bytes[0x10] | |
| struct SceSdifCmdInput.response.words | words | |
| struct SceSdifCmdInput.response.words |
| #define SCE_SDIF_DEVICE_USD SCE_SDIF_DEVICE_SD |
Alias using the internal uSD name for the microSD controller index.
| typedef void* SceSdifDeviceContext |
| typedef struct SceSdifContextPart SceSdifContextPart |
Opaque device-specific context.
FW 3.60 MMC, SD, and SDIO contexts all begin with a SceSdifContextPartBase, but use different layouts and storage sizes beyond that prefix: 0x398 bytes for MMC, 0xC0 bytes for SD, and 0xD38 bytes for SDIO. The context is owned by SceSdif and remains valid until that device is reset or reinitialized; callers must not free it.
| enum SceSdifDeviceIndex |
| enum SceSdifDeviceType |
| enum SceSdifCommandState |
| SceSdifDeviceContext * ksceSdifGetSdContextPartValidateMmc | ( | SceSdifDeviceIndex | dev_index | ) |
Get an initialized MMC context.
| [in] | dev_index | - Device to validate. |
SceSdifDeviceContext * for backwards compatibility. | int ksceSdifInitializeMmcDevice | ( | SceSdifDeviceIndex | dev_index, |
| SceSdifDeviceContext * | dev_ctx | ||
| ) |
Initialize an MMC device.
FW 3.60 supports SCE_SDIF_DEVICE_EMMC and SCE_SDIF_DEVICE_GC. The context is static SceSdif storage and must not be freed.
| [in] | dev_index | - Device to initialize. |
| [out] | dev_ctx | - Optional storage for the SceSdif-owned device context pointer. It is set to NULL before initialization is attempted. |
| int ksceSdifWriteCmd56 | ( | SceSdifDeviceContext * | dev_ctx, |
| const void * | buf, | ||
| SceSize | size | ||
| ) |
Send a game-card CMD56 request.
FW 3.60 sends command argument 0 as a synchronous one-block write.
| [in] | dev_ctx | - Direct pointer to SceSdifContextPart. On FW 3.60, pass the context pointer itself, not the address of that pointer, despite the historical declaration. |
| [in] | buf | - Command input buffer. |
| [in] | size | - Input buffer size. It must equal the MMC block size in the context; this is 0x200 for a FW 3.60 game card. |
| int ksceSdifReadCmd56 | ( | SceSdifDeviceContext * | dev_ctx, |
| void * | buf, | ||
| SceSize | size | ||
| ) |
Receive a game-card CMD56 response.
FW 3.60 sends command argument 1 as a synchronous one-block read.
| [in] | dev_ctx | - Direct pointer to SceSdifContextPart. On FW 3.60, pass the context pointer itself, not the address of that pointer, despite the historical declaration. |
| [out] | buf | - Command output buffer. |
| [in] | size | - Output buffer size. It must equal the MMC block size in the context; this is 0x200 for a FW 3.60 game card. |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x30 | , |
| SceSdifContextPartBase | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x1000 | , |
| SceSdifHostRegisters | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x240 | , |
| SceSdifCmdInput | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0xC0 | , |
| SceSdifContextData | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x24C0 | , |
| SceSdifContextGlobal | |||
| ) |
| int ksceSdifGetCardInsertState1 | ( | SceSdifDeviceIndex | device_index | ) |
Get a controller's card-detect input.
On FW 3.60 this function is identical to ksceSdifGetCardInsertState2.
| [in] | device_index | - Controller index. FW 3.60 accepts indices 0 through 2. |
| int ksceSdifGetCardInsertState2 | ( | SceSdifDeviceIndex | device_index | ) |
Get a controller's card-detect input.
On FW 3.60 this function is identical to ksceSdifGetCardInsertState1.
| [in] | device_index | - Controller index. FW 3.60 accepts indices 0 through 2. |
| int ksceSdifGetCID | ( | const SceSdifContextPart * | ctx, |
| void * | cid | ||
| ) |
Copy a device's card identification register.
| [in] | ctx | - Initialized MMC or SD device context. |
| [out] | cid | - Destination for the 16-byte CID. |
| SceSdifContextGlobal * ksceSdifGetSdContextGlobal | ( | SceSdifDeviceIndex | device_index | ) |
Get a controller's process-global context.
| [in] | device_index | - Controller index. FW 3.60 accepts indices 0 through 2. |
| SceSdifDeviceContext * ksceSdifGetSdContextPartValidateSd | ( | SceSdifDeviceIndex | dev_index | ) |
Get an initialized SD context.
| [in] | dev_index | - Controller to validate. |
SceSdifDeviceContext * for backwards compatibility. | SceSdifContextPart * ksceSdifGetSdContextPartValidateSdio | ( | SceSdifDeviceIndex | device_index | ) |
Get an initialized SDIO context.
| [in] | device_index | - Controller to validate. The FW 3.60 WLAN and Bluetooth callers use SCE_SDIF_DEVICE_SDIO. |
| int ksceSdifInitializeSdDevice | ( | SceSdifDeviceIndex | device_index, |
| SceSdifContextPart ** | result | ||
| ) |
Initialize an SD device.
| [in] | device_index | - Controller to initialize. FW 3.60 accepts indices 0 through 2, but initialization succeeds only when the detected device is an SD card. |
| [out] | result | - Optional storage for a pointer to the SceSdif-owned 0xC0-byte SD context. The pointer is set to NULL before initialization is attempted. Callers must not free the context. |
| int ksceSdifReadSectorMmc | ( | SceSdifContextPart * | ctx, |
| SceUInt32 | sector, | ||
| void * | buffer, | ||
| SceUInt32 | sector_count | ||
| ) |
Read MMC sectors.
FW 3.60 uses CMD17 for one sector and CMD18 for multiple sectors. The MF4GAM game-card layout translates logical sectors through its partition map and splits large reads into chunks of at most 0x1000 sectors.
| [in] | ctx | - MMC device context. |
| [in] | sector | - First logical sector to read. |
| [out] | buffer | - Destination buffer. |
| [in] | sector_count | - Number of sectors to read. Must not be 0. |
| int ksceSdifReadSectorSd | ( | SceSdifContextPart * | ctx, |
| SceUInt32 | sector, | ||
| void * | buffer, | ||
| SceUInt32 | sector_count | ||
| ) |
Read SD sectors.
FW 3.60 uses CMD17 for one sector and CMD18 for multiple sectors. A block-addressed card receives sector directly; a byte-addressed card receives sector << 9.
| [in] | ctx | - SD device context. |
| [in] | sector | - First logical sector to read. |
| [out] | buffer | - Destination buffer. |
| [in] | sector_count | - Number of sectors to read. Must not be 0. |
| int ksceSdifWriteSectorMmc | ( | SceSdifContextPart * | ctx, |
| SceUInt32 | sector, | ||
| const void * | buffer, | ||
| SceUInt32 | sector_count | ||
| ) |
Write MMC sectors.
FW 3.60 uses CMD24 for one sector and CMD25 for multiple sectors. The source buffer is read but not modified.
| [in] | ctx | - MMC device context. |
| [in] | sector | - First logical sector to write. |
| [in] | buffer | - Source buffer. |
| [in] | sector_count | - Number of sectors to write. Must not be 0. |
| int ksceSdifWriteSectorSd | ( | SceSdifContextPart * | ctx, |
| SceUInt32 | sector, | ||
| const void * | buffer, | ||
| SceUInt32 | sector_count | ||
| ) |
Write SD sectors.
FW 3.60 uses CMD24 for one sector and CMD25 for multiple sectors. A block-addressed card receives sector directly; a byte-addressed card receives sector << 9. The source buffer is read but not modified.
| [in] | ctx | - SD device context. |
| [in] | sector | - First logical sector to write. |
| [in] | buffer | - Source buffer. |
| [in] | sector_count | - Number of sectors to write. Must not be 0. |
| int ksceSdifMemoryCardEnableSlowMode | ( | void | ) |
Enable slow-mode delays for controller 1 MMC transfers.
This affects SceSdif game-card MMC sector reads and writes only. It does not affect SD, SDIO, or SceMsif Memory Stick transfers.
| int ksceSdifMemoryCardDisableSlowMode | ( | void | ) |
Disable slow-mode delays for controller 1 MMC transfers.
| struct SceSdifContextGlobal* SceSdifContextPartBase::global_context |
Owning controller context.
| SceUInt32 SceSdifContextPartBase::card_flags |
Bit 0 indicates block addressing; otherwise sector arguments use byte addressing.
| SceUInt32 { ... } ::mmc_sector_size |
MMC block size in the low 16 bits.
| SceUInt32 { ... } ::sd_write_protected |
Nonzero when SD writes are prohibited.
| SceUInt32 { ... } ::sdio_function_count |
Number of SDIO functions.
| union { ... } SceSdifContextPartBase |
| SceUInt32 { ... } ::mmc_uses_special_sector_map |
Nonzero for the MF4GAM game-card layout.
| SceUInt32 { ... } ::sd_sector_size |
SD block size in the low 16 bits.
| SceUInt32 { ... } ::sdio_reserved_0C |
Its purpose is unknown.
| union { ... } SceSdifContextPartBase |
| SceUInt8 SceSdifContextPartBase::cid[16] |
Card identification register, in big-endian byte order.
| SceUInt8 SceSdifContextPartBase::csd[16] |
Card-specific data register, in big-endian byte order.
| volatile SceUInt32 SceSdifHostRegisters::dma_system_address |
| volatile SceUInt16 SceSdifHostRegisters::block_size |
| volatile SceUInt16 SceSdifHostRegisters::block_count |
| volatile SceUInt32 SceSdifHostRegisters::argument |
| volatile SceUInt16 SceSdifHostRegisters::transfer_mode |
| volatile SceUInt16 SceSdifHostRegisters::command |
| volatile SceUInt32 SceSdifHostRegisters::response[4] |
| volatile SceUInt32 SceSdifHostRegisters::buffer_data_port |
| volatile SceUInt32 SceSdifHostRegisters::present_state |
| volatile SceUInt8 SceSdifHostRegisters::host_control |
| volatile SceUInt8 SceSdifHostRegisters::power_control |
| volatile SceUInt8 SceSdifHostRegisters::block_gap_control |
| volatile SceUInt8 SceSdifHostRegisters::wakeup_control |
| volatile SceUInt16 SceSdifHostRegisters::clock_control |
| volatile SceUInt8 SceSdifHostRegisters::timeout_control |
| volatile SceUInt8 SceSdifHostRegisters::software_reset |
| volatile SceUInt16 SceSdifHostRegisters::normal_interrupt_status |
| volatile SceUInt16 SceSdifHostRegisters::error_interrupt_status |
| volatile SceUInt16 SceSdifHostRegisters::normal_interrupt_status_enable |
| volatile SceUInt16 SceSdifHostRegisters::error_interrupt_status_enable |
| volatile SceUInt16 SceSdifHostRegisters::normal_interrupt_signal_enable |
| volatile SceUInt16 SceSdifHostRegisters::error_interrupt_signal_enable |
| volatile SceUInt16 SceSdifHostRegisters::auto_cmd_error_status |
| volatile SceUInt16 SceSdifHostRegisters::host_control_2 |
| volatile SceUInt32 SceSdifHostRegisters::capabilities[2] |
| volatile SceUInt32 SceSdifHostRegisters::maximum_current_capabilities |
| SceUInt8 SceSdifHostRegisters::reserved_4C[4] |
| volatile SceUInt16 SceSdifHostRegisters::force_event_auto_cmd_error_status |
| volatile SceUInt16 SceSdifHostRegisters::force_event_error_interrupt_status |
| volatile SceUInt8 SceSdifHostRegisters::adma_error_status |
| SceUInt8 SceSdifHostRegisters::reserved_55[3] |
| volatile SceUInt32 SceSdifHostRegisters::adma_system_address |
| SceUInt8 SceSdifHostRegisters::reserved_5C[0xA0] |
| volatile SceUInt16 SceSdifHostRegisters::slot_interrupt_status |
| volatile SceUInt16 SceSdifHostRegisters::host_controller_version |
| SceUInt8 SceSdifHostRegisters::reserved_100[0xF00] |
| SceSize SceSdifCmdInput::size |
Must be 0x240.
| SceUInt32 SceSdifCmdInput::state_flags |
Host-command, response, transfer, DMA, and completion flags.
Observed bits include read (0x100), write (0x200), DMA (0x400), multi-block (0x800), per-command DMA-table allocation (0x100000), and forced completion (0x40000000).
| SceUInt32 SceSdifCmdInput::command |
SD/MMC command index.
| SceUInt32 SceSdifCmdInput::argument |
SD/MMC command argument.
| SceUInt8 { ... } ::bytes[0x10] |
| SceUInt32 { ... } ::dw0 |
| SceUInt32 { ... } ::dw1 |
| SceUInt32 { ... } ::dw2 |
| SceUInt32 { ... } ::dw3 |
| struct { ... } SceSdifCmdInput::words |
| union { ... } SceSdifCmdInput::response |
Stores a normal response without the command index and CRC-7. This can also store CID or CSD; CRC-7 is cleared. The storage order is reversed.
| void* SceSdifCmdInput::buffer |
Command data buffer, split into leading, direct-DMA, and trailing regions as needed.
| SceUInt16 SceSdifCmdInput::block_size |
Data block size; normally 0x200 for sector transfers.
| SceUInt16 SceSdifCmdInput::block_count |
Number of data blocks.
| SceInt32 SceSdifCmdInput::error_code |
Completion error written by the interrupt and timeout paths.
| SceUInt32 SceSdifCmdInput::unknown_2C |
Its purpose is unknown.
| SceUInt8 SceSdifCmdInput::command_specific_data[0x30] |
Command-specific storage; asynchronous SDIO transfers use its final 0x20 bytes.
| struct SceSdifCmdInput* SceSdifCmdInput::next_cmd |
| SceSdifCommandState SceSdifCmdInput::state |
| SceUInt32 SceSdifCmdInput::command_index |
Index from 0 through 15 in the owning controller's command array.
| int(* SceSdifCmdInput::completion_callback) (struct SceSdifCmdInput *cmd) |
Called after completion; its return value is passed on internally.
| SceUID SceSdifCmdInput::event_flag_id |
Event flag used by synchronous commands.
| struct SceSdifCmdInput* SceSdifCmdInput::secondary_cmd |
Dependent command started after this command succeeds.
| struct SceSdifContextGlobal* SceSdifCmdInput::global_context |
| SceUIntPtr SceSdifCmdInput::active_dma_descriptors_paddr |
Physical address of the active DMA descriptor table.
| SceUInt8 SceSdifCmdInput::internal_dma_descriptors[0x80] |
Embedded table of up to 16 eight-byte DMA descriptors.
| void* SceSdifCmdInput::active_dma_descriptors |
Active DMA descriptor table.
| SceKernelPARange SceSdifCmdInput::physical_ranges[16] |
Storage within this command object, passed to ksceKernelVARangeToPAVector.
| SceUIntPtr SceSdifCmdInput::internal_dma_descriptors_paddr |
Physical address of internal_dma_descriptors.
| SceUID SceSdifCmdInput::dma_descriptor_memblock_uid |
UID of the dynamically allocated DMA descriptor memblock, if any.
| SceUInt32 SceSdifCmdInput::unknown_18C |
Its purpose is unknown.
| SceUInt32 SceSdifCmdInput::unknown_190 |
Its purpose is unknown.
| SceUInt32 SceSdifCmdInput::unknown_194 |
Its purpose is unknown.
| void* SceSdifCmdInput::aligned_buffer |
Direct-DMA portion of the command data buffer.
| SceSize SceSdifCmdInput::aligned_buffer_size |
Size of the direct-DMA portion.
| SceSize SceSdifCmdInput::leading_fragment_size |
Size of the leading unaligned fragment.
| SceSize SceSdifCmdInput::trailing_fragment_size |
Size of the trailing unaligned fragment.
| SceUIntPtr SceSdifCmdInput::leading_fragment_paddr |
Physical address of leading_fragment.
| SceUIntPtr SceSdifCmdInput::trailing_fragment_paddr |
Physical address of trailing_fragment.
| SceInt64 SceSdifCmdInput::start_time |
System time when the command starts.
| SceInt64 SceSdifCmdInput::end_time |
System time when the command completes.
| SceUInt8 SceSdifCmdInput::leading_fragment[0x40] |
Bounce buffer for the leading unaligned fragment.
| SceUInt8 SceSdifCmdInput::trailing_fragment[0x40] |
Bounce buffer for the trailing unaligned fragment.
| SceSdifCmdInput* SceSdifContextData::free_cmd_head |
| SceSdifCmdInput* SceSdifContextData::free_cmd_tail |
| SceSdifCmdInput* SceSdifContextData::pending_cmd_head |
| SceSdifCmdInput* SceSdifContextData::pending_cmd_tail |
| SceSdifDeviceType SceSdifContextData::device_type |
| SceSdifContextPartBase* SceSdifContextData::device_context |
Device-specific context owned by SceSdif; callers must not free it.
| SceUInt32 SceSdifContextData::supported_voltages |
OCR voltage mask: 0x80 for controllers 0 and 2, and 0x300000 for controller 1.
| SceUInt32 SceSdifContextData::relative_card_address |
Relative card address in the low 16 bits.
| SceUInt32 SceSdifContextData::controller_index |
Controller index from 0 through 2.
| SceUInt8 SceSdifContextData::command_complete |
Set when the active host command completes.
| SceUInt8 SceSdifContextData::suspended |
Nonzero while normal command submission is suspended.
| SceUInt8 SceSdifContextData::unknown_26 |
Its purpose is unknown.
| SceUInt8 SceSdifContextData::unknown_27 |
Its purpose is unknown.
| SceSdifCmdInput* SceSdifContextData::active_cmd |
| SceSdifCmdInput* SceSdifContextData::active_data_cmd |
| SceSdifHostRegisters* SceSdifContextData::host_registers |
Base of the controller's 0x1000-byte register memblock.
| SceUInt32 SceSdifContextData::enabled_subintr_mask |
| SceUInt8 SceSdifContextData::timeout_control |
Host timeout-control value; initialized to 14 on FW 3.60.
| SceUInt8 SceSdifContextData::slow_mode |
Enables minimum transfer delays for controller 1 MMC reads and writes.
| SceUInt8 SceSdifContextData::slow_read_count |
Initialized from system time and incremented for each slow-mode read chunk.
| SceUInt8 SceSdifContextData::slow_write_count |
Initialized from system time and incremented for each slow-mode write.
| SceUID SceSdifContextData::host_registers_uid |
UID of the controller's 0x1000-byte register memblock.
| SceUID SceSdifContextData::event_flag_id |
Controller event flag.
| SceKernelFastMutex SceSdifContextData::sdif_fast_mutex |
Controller fast mutex.
| SceUID SceSdifContextData::dma_descriptor_pool_uid |
Offset 0x2484; UID of the 0x10000-byte DMA descriptor pool memblock.
| void* SceSdifContextData::dma_descriptor_pool |
DMA descriptor pool used when the embedded table is too small.
| SceUInt32 SceSdifContextData::ocr |
Last operation-conditions register value.
| SceUInt32 SceSdifContextData::unknown_90 |
Its purpose is unknown.
| SceKernelSpinlock SceSdifContextData::spinlock |
| SceUInt64 SceSdifContextData::last_transfer_duration |
Duration of the last sector transfer in microseconds.
| SceUInt8 SceSdifContextData::sdio_interrupt_status |
| SceUInt8 SceSdifContextData::sdio_enabled_function_mask |
| SceUInt8 SceSdifContextData::sdio_pending_function_mask |
| SceUInt8 SceSdifContextData::unknown_A3 |
Its purpose is unknown.
| SceUInt32 SceSdifContextData::sdio_subintr2_intr_code |
Interrupt code used with subinterrupt 2.
| SceUInt32 SceSdifContextData::sdio_subintr3_8_intr_code |
Interrupt code used with subinterrupts 3 through 8.
| SceUInt32 SceSdifContextData::sdio_dispatch_pending |
| SceUInt32 SceSdifContextData::unknown_B0 |
Cleared when the controller is reset; its purpose is unknown.
| SceUInt32 SceSdifContextData::unknown_B4 |
Cleared when the controller is reset; its purpose is unknown.
| SceUInt32 SceSdifContextData::unknown_B8 |
Its purpose is unknown.
| SceUInt32 SceSdifContextData::unknown_BC |
Its purpose is unknown.
| SceSdifCmdInput SceSdifContextGlobal::commands[16] |
Controller-owned command pool.
| SceSdifContextData SceSdifContextGlobal::ctx_data |