[WIP] sd/mmc: enable high speed transfers

- Switch to 25MHz clock
- Switch to 4bit transfers mode (the default is 1bit)

Reading and writing SD cards do not seem to work anymore with these
changes. I get invalid data on read, and on write, an interrupt is never
called in some cases.
This commit is contained in:
Adrien Destugues
2021-01-12 22:01:43 +01:00
parent cf15598562
commit 522c141d53
6 changed files with 68 additions and 35 deletions
+3 -2
View File
@@ -58,6 +58,7 @@ enum SD_COMMANDS {
enum SDHCI_APPLICATION_COMMANDS {
SD_SET_BUS_WIDTH = 6,
SD_SEND_OP_COND = 41,
};
@@ -90,8 +91,8 @@ typedef struct mmc_bus_interface {
// type of card.
typedef struct mmc_device_interface {
driver_module_info info;
status_t (*execute_command)(device_node* node, uint8_t command,
uint32_t argument, uint32_t* result);
status_t (*execute_command)(device_node* node, uint16_t rca,
uint8_t command, uint32_t argument, uint32_t* result);
// Execute a command with no I/O phase
status_t (*do_io)(device_node* controller, uint16_t rca,
uint8_t command, IOOperation* operation, bool offsetAsSectors);