summaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/sc7280/sdhci.c
diff options
context:
space:
mode:
authorShelley Chen <shchen@google.com>2023-01-11 16:10:07 -0800
committerShelley Chen <shchen@google.com>2023-02-08 17:00:27 +0000
commit978b47463e534c2b8325ebd9c86464555d96d4b6 (patch)
tree33843d188f986489c0c58a14d33e2cd763739eb8 /src/soc/qualcomm/sc7280/sdhci.c
parent8488b5948d52e208dc07bfdf621756ee0cbf6db4 (diff)
soc/qualcomm/sc7280: init eMMC
Use common sdhci driver in coreboot to initialize eMMC for sc7280. This should allow us to initialize eMMC earlier in the boot process, taking it out of the critical path. BUG=b:254092907 BRANCH=None TEST=emerge-herobrine coreboot chromeos-bootimage Change-Id: Ifa88da500e82b44d7523f2e68763e01399c89f4d Signed-off-by: Shelley Chen <shchen@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/71829 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/qualcomm/sc7280/sdhci.c')
-rw-r--r--src/soc/qualcomm/sc7280/sdhci.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/soc/qualcomm/sc7280/sdhci.c b/src/soc/qualcomm/sc7280/sdhci.c
new file mode 100644
index 0000000000..6e676f4feb
--- /dev/null
+++ b/src/soc/qualcomm/sc7280/sdhci.c
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <commonlib/sdhci.h>
+#include <commonlib/storage.h>
+#include <commonlib/storage/sd_mmc.h>
+#include <commonlib/storage/sdhci.h>
+#include <commonlib/sd_mmc_ctrlr.h>
+#include <soc/addressmap.h>
+#include <soc/sdhci.h>
+#include <soc/sdhci_msm.h>
+
+int qc_emmc_early_init(void)
+{
+ struct sd_mmc_ctrlr *ctrlr;
+ struct storage_media media = {0};
+
+ ctrlr = new_sdhci_msm_host((void *)(uintptr_t)SDC1_HC_BASE);
+ if (ctrlr == NULL)
+ return -1;
+
+ media.ctrlr = ctrlr;
+ SET_BUS_WIDTH(ctrlr, 1);
+ SET_CLOCK(ctrlr, 384 * 1000);
+
+ /* Send CMD1 */
+ return mmc_send_cmd1(&media);
+}