| 1 |
|
| 2 |
|
| 3 |
#include <commonlib/sdhci.h> |
| 4 |
#include <commonlib/storage.h> |
| 5 |
#include <commonlib/storage/sd_mmc.h> |
| 6 |
#include <commonlib/storage/sdhci.h> |
| 7 |
#include <commonlib/sd_mmc_ctrlr.h> |
| 8 |
#include <soc/addressmap.h> |
| 9 |
#include <soc/sdhci.h> |
| 10 |
#include <soc/sdhci_msm.h> |
| 11 |
|
| 12 |
int qc_emmc_early_init(void) |
| 13 |
{ |
| 14 |
struct sd_mmc_ctrlr *ctrlr; |
| 15 |
struct storage_media media = {0}; |
| 16 |
|
| 17 |
ctrlr = new_sdhci_msm_host((void *)(uintptr_t)SDC1_HC_BASE); |
| 18 |
if (ctrlr == NULL) |
| 19 |
return -1; |
| 20 |
|
| 21 |
media.ctrlr = ctrlr; |
| 22 |
SET_BUS_WIDTH(ctrlr, 1); |
| 23 |
SET_CLOCK(ctrlr, 384 * 1000); |
| 24 |
|
| 25 |
|
| 26 |
return mmc_send_cmd1(&media); |
| 27 |
} |