mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
x1000: rewrite SD driver using sdmmc_host
Remove all SD protocol handling and all target specific code like GPIO/interrupt handling and clock parent setup. This can now be handled from sdmmc_host_target_init() for each target. Now only the clock frequency is managed by the MSC driver. To make this code easier to factor out later, it's confined to helper functions that do not access the driver state. One small change is that MSCxDIV output is now clamped to a minimum of 50MHz to avoid unnecessary frequency changes. The MSC_CLKRT divider can still divide 50MHz down to 400 KHz so there is no downside to this. Auto-CMD12 is now unused. Using it would make error handling more difficult for sdmmc_host since the controller does not expose response data for the auto-CMD12. Explicit CMD12 was not handled correctly in the old version of the driver because the busy signal was ignored for R1b responses if there was no associated data transfer. This is now fixed by waiting for the PRG_DONE interrupt instead of END_CMD_RES for non-data transfer R1b type commands. Since existing X1000 targets are all very similar they use a shared implementation in sdmmc-x1000-common.c for clock setup and card detection. New targets can either use this or create a separate file if they are different enough to warrant one. Change-Id: I35396637325d7c06a10151bb6aee64cabdc7b682
This commit is contained in:
parent
28e5a125ab
commit
f40cae6cdc
8 changed files with 444 additions and 1255 deletions
|
|
@ -95,6 +95,9 @@
|
|||
#define STORAGE_WANTS_ALIGN
|
||||
#define STORAGE_NEEDS_BOUNCE_BUFFER
|
||||
|
||||
/* One SD card slot */
|
||||
#define SDMMC_HOST_NUM_SD_CONTROLLERS 1
|
||||
|
||||
/* Power management */
|
||||
#define CONFIG_BATTERY_MEASURE (VOLTAGE_MEASURE | PERCENTAGE_MEASURE/*|CURRENT_MEASURE*/)
|
||||
#define CONFIG_CHARGING CHARGING_MONITOR
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@
|
|||
#define STORAGE_WANTS_ALIGN
|
||||
#define STORAGE_NEEDS_BOUNCE_BUFFER
|
||||
|
||||
/* One SD card slot */
|
||||
#define SDMMC_HOST_NUM_SD_CONTROLLERS 1
|
||||
|
||||
/* RTC settings */
|
||||
#define CONFIG_RTC RTC_X1000
|
||||
/* TODO: implement HAVE_RTC_ALARM */
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@
|
|||
#define STORAGE_WANTS_ALIGN
|
||||
#define STORAGE_NEEDS_BOUNCE_BUFFER
|
||||
|
||||
/* One SD card slot */
|
||||
#define SDMMC_HOST_NUM_SD_CONTROLLERS 1
|
||||
|
||||
/* RTC settings */
|
||||
#define CONFIG_RTC RTC_X1000
|
||||
/* TODO: implement HAVE_RTC_ALARM */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue