ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / tegra_emc_dt_parse.c
index bcbc0f8..7fac736 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <linux/platform_data/tegra_emc.h>
 
-#include "fuse.h"
+#include "common.h"
 
 #ifdef CONFIG_OF
 static struct device_node *tegra_emc_ramcode_devnode(
@@ -54,19 +54,21 @@ void *tegra_emc_dt_parse_pdata(struct platform_device *pdev)
 #if defined(CONFIG_ARCH_TEGRA_12x_SOC)
        struct tegra12_emc_pdata *pdata = NULL;
        const char *comp = "nvidia,tegra12-emc-table";
+       const char *emc_mode = "nvidia,emc-mode-0";
 #elif defined(CONFIG_ARCH_TEGRA_11x_SOC)
        struct tegra11_emc_pdata *pdata = NULL;
        const char *comp = "nvidia,tegra11-emc-table";
+       const char *emc_mode = "nvidia,emc-mode-reset";
 #endif
 
-       tegra_bct_strapping = tegra_get_bct_strapping();
-
        if (!np) {
                dev_err(&pdev->dev,
                        "Unable to find memory-controller node\n");
                return NULL;
        }
 
+       tegra_bct_strapping = tegra_get_bct_strapping();
+
        if (of_find_property(np, "nvidia,use-ram-code", NULL)) {
                tnp = tegra_emc_ramcode_devnode(np);
 
@@ -216,11 +218,10 @@ void *tegra_emc_dt_parse_pdata(struct platform_device *pdev)
                }
                pdata->tables[i].emc_cfg = u;
 
-               ret = of_property_read_u32(iter, "nvidia,emc-mode-reset", &u);
+               ret = of_property_read_u32(iter, emc_mode, &u);
                if (ret) {
-                       dev_err(&pdev->dev,
-                               "malformed emc-mode-reset property in %s\n",
-                               iter->full_name);
+                       dev_err(&pdev->dev, "malformed %s property in %s\n",
+                               emc_mode, iter->full_name);
                        continue;
                }
                pdata->tables[i].emc_mode_reset = u;
@@ -308,6 +309,42 @@ void *tegra_emc_dt_parse_pdata(struct platform_device *pdev)
                        continue;
                }
                pdata->tables[i].emc_cfg_dig_dll = u;
+
+               ret = of_property_read_u32(iter, "nvidia,emc-bgbias-ctl0", &u);
+               if (ret) {
+                       dev_err(&pdev->dev,
+                               "malformed emc-bgbias-ctl0 property in %s\n",
+                               iter->full_name);
+                       continue;
+               }
+               pdata->tables[i].emc_bgbias_ctl0 = u;
+
+               ret = of_property_read_u32(iter, "nvidia,emc-auto-cal-config2", &u);
+               if (ret) {
+                       dev_err(&pdev->dev,
+                               "malformed emc-auto-cal-config2 property in %s\n",
+                               iter->full_name);
+                       continue;
+               }
+               pdata->tables[i].emc_auto_cal_config2 = u;
+
+               ret = of_property_read_u32(iter, "nvidia,emc-auto-cal-config3", &u);
+               if (ret) {
+                       dev_err(&pdev->dev,
+                               "malformed emc-auto-cal-config3 property in %s\n",
+                               iter->full_name);
+                       continue;
+               }
+               pdata->tables[i].emc_auto_cal_config3 = u;
+
+               ret = of_property_read_u32(iter, "nvidia,emc-auto-cal-config", &u);
+               if (ret) {
+                       dev_err(&pdev->dev,
+                               "malformed emc-auto-cal-config property in %s\n",
+                               iter->full_name);
+                       continue;
+               }
+               pdata->tables[i].emc_auto_cal_config = u;
 #endif
 
 #if defined(CONFIG_ARCH_TEGRA_11x_SOC)