Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8f2b0c5 authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti
Browse files

mmc: host: sdhci-msm: Configure dll-user-control in dll init sequence



With SDCC v5.1.0, additional setting needed for enabling DLL output.
The dll-user-control register need to be configured during dll
initialization for getting proper dll output.

Without this configuration, we don't get the DLL lock status properly.

Change-Id: Ic9e15e5ad8ccec515430035140d9580039721b20
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent 2b029ca3
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@
#define DDR_CONFIG_PRG_RCLK_DLY_MASK	0x1FF
#define DDR_CONFIG_PRG_RCLK_DLY		115
#define DDR_CONFIG_2_POR_VAL		0x80040873
#define DLL_USR_CTL_POR_VAL		0x10800
#define ENABLE_DLL_LOCK_STATUS		(1 << 26)

/* 512 descriptors */
#define SDHCI_MSM_MAX_SEGMENTS  (1 << 9)
@@ -200,6 +202,7 @@ struct sdhci_msm_offset {
	u32 CORE_DLL_CONFIG_2;
	u32 CORE_DDR_CONFIG;
	u32 CORE_DDR_CONFIG_2;
	u32 CORE_DLL_USR_CTL; /* Present on SDCC5.1 onwards */
};

struct sdhci_msm_offset sdhci_msm_offset_mci_removed = {
@@ -229,6 +232,7 @@ struct sdhci_msm_offset sdhci_msm_offset_mci_removed = {
	.CORE_DLL_CONFIG_2 = 0x254,
	.CORE_DDR_CONFIG = 0x258,
	.CORE_DDR_CONFIG_2 = 0x25C,
	.CORE_DLL_USR_CTL = 0x388,
};

struct sdhci_msm_offset sdhci_msm_offset_mci_present = {
@@ -795,6 +799,15 @@ static int msm_init_cm_dll(struct sdhci_host *host)
				msm_host_offset->CORE_DLL_CONFIG_2);
	}

	/*
	 * Configure DLL user control register to enable DLL status
	 * This setting is applicable to SDCC v5.1 onwards only
	 */
	if (msm_host->need_dll_user_ctl) {
		writel_relaxed(DLL_USR_CTL_POR_VAL | ENABLE_DLL_LOCK_STATUS,
			host->ioaddr + msm_host_offset->CORE_DLL_USR_CTL);
	}

	/* Set DLL_EN bit to 1. */
	writel_relaxed((readl_relaxed(host->ioaddr +
			msm_host_offset->CORE_DLL_CONFIG) | CORE_DLL_EN),
@@ -4563,6 +4576,10 @@ static void sdhci_set_default_hw_caps(struct sdhci_msm_host *msm_host,
		msm_host->ice_hci_support = true;
		host->cdr_support = true;
	}

	if ((major == 1) && (minor >= 0x71))
		msm_host->need_dll_user_ctl = true;

}

#ifdef CONFIG_MMC_CQ_HCI
+1 −0
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ struct sdhci_msm_host {
	struct sdhci_msm_regs_restore regs_restore;
	int soc_min_rev;
	struct workqueue_struct *pm_qos_wq;
	bool need_dll_user_ctl;
};

extern char *saved_command_line;