summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/mmdc.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2014-11-23 15:07:02 +0800
committerShawn Guo <shawn.guo@linaro.org>2014-11-23 15:07:02 +0800
commit2ce34b105c79ee0404b3a8f68c9ab2ce197dd06f (patch)
tree2111f40b612ccf19b0acb480f82c1e7a80d2e24a /arch/arm/mach-imx/mmdc.c
parent0df1f2487d2f0d04703f142813d53615d62a1da4 (diff)
parent3db47dc0ae4d370ec3c86fc357608132ca695c27 (diff)
Merge tag 'imx-soc-3.19' into imx/dt
The i.MX SoC update for 3.19: - Update i.MX6 suspend code to check DDR instead of CPU type, as the difference we need to handle is between LPDDR2 and DDR3, not SoCs. - Set anatop properly for LPDDR2 in DSM mode - Add support for new SoC LS1021A which integrates dual Cortex-A7 - Add ENET initialization for i.MX6SX platform - Add cpufreq support for i.MX53 platform - Add a SNVS based poweroff driver for i.MX6 platforms - Use ARM Global Timer as clocksource on VF610 Note: the change set is built on top of tag imx-fixes-3.18-2 to resolve a conflict on file arch/arm/mach-imx/clk-vf610.c.
Diffstat (limited to 'arch/arm/mach-imx/mmdc.c')
-rw-r--r--arch/arm/mach-imx/mmdc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index 7a9686ad994..3729d90cfa4 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -21,6 +21,12 @@
#define BP_MMDC_MAPSR_PSD 0
#define BP_MMDC_MAPSR_PSS 4
+#define MMDC_MDMISC 0x18
+#define BM_MMDC_MDMISC_DDR_TYPE 0x18
+#define BP_MMDC_MDMISC_DDR_TYPE 0x3
+
+static int ddr_type;
+
static int imx_mmdc_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
@@ -31,6 +37,12 @@ static int imx_mmdc_probe(struct platform_device *pdev)
mmdc_base = of_iomap(np, 0);
WARN_ON(!mmdc_base);
+ reg = mmdc_base + MMDC_MDMISC;
+ /* Get ddr type */
+ val = readl_relaxed(reg);
+ ddr_type = (val & BM_MMDC_MDMISC_DDR_TYPE) >>
+ BP_MMDC_MDMISC_DDR_TYPE;
+
reg = mmdc_base + MMDC_MAPSR;
/* Enable automatic power saving */
@@ -51,6 +63,11 @@ static int imx_mmdc_probe(struct platform_device *pdev)
return 0;
}
+int imx_mmdc_get_ddr_type(void)
+{
+ return ddr_type;
+}
+
static struct of_device_id imx_mmdc_dt_ids[] = {
{ .compatible = "fsl,imx6q-mmdc", },
{ /* sentinel */ }