ARM: tegra: stingray: use generic memory vendor matching
authorJames Wylder <james.wylder@motorola.com>
Wed, 2 Mar 2011 18:39:50 +0000 (12:39 -0600)
committerColin Cross <ccross@android.com>
Fri, 4 Mar 2011 02:57:31 +0000 (18:57 -0800)
Initialize arrays to utilize new signature of tegra_init_emc.
Memory types are matched internally and command line
option is no longer needed.

Change-Id: Icc7d44e4a82031638c78eeac3b172b713e0ca97b
Signed-off-by: James Wylder <james.wylder@motorola.com>
arch/arm/mach-tegra/board-stingray-memory.c

index 2f6aea1fccfe75ae177aa534fbbcd857a58b3813..139a02f775ae39eb0f0e83d0f439e1770dc34671 100644 (file)
@@ -21,9 +21,6 @@
 #include "board-stingray.h"
 #include "tegra2_emc.h"
 
-static long stingray_mem_vid;
-static long stingray_mem_pid;
-
 static const struct tegra_emc_table stingray_emc_tables_samsung[] = {
        {
                .rate = 60000,   /* SDRAM frquency */
@@ -438,30 +435,28 @@ static const struct tegra_emc_table stingray_emc_tables_elpida[] = {
        }
 };
 
-static int __init stingray_param_mem_vid(char *options)
-{
-       return strict_strtol(options, 0, &stingray_mem_vid);
-}
-__setup("mem_vid=", stingray_param_mem_vid);
-
-static int __init stingray_param_mem_pid(char *options)
-{
-       return strict_strtol(options, 0, &stingray_mem_pid);
-}
-__setup("mem_pid=", stingray_param_mem_pid);
+struct tegra_emc_chip stingray_emc_chips[] = {
+       {
+               .description = "Samsung",
+               .mem_manufacturer_id = 0x0101,
+               .mem_revision_id1 = -1,
+               .mem_revision_id2 = -1,
+               .mem_pid = 0x5454,
+               .table = stingray_emc_tables_samsung,
+               .table_size = ARRAY_SIZE(stingray_emc_tables_samsung)
+       },
+       {
+               .description = "Elpida 50nm",
+               .mem_manufacturer_id = 0x0303,
+               .mem_revision_id1 = -1,
+               .mem_revision_id2 = -1,
+               .mem_pid = 0x5454,
+               .table = stingray_emc_tables_elpida,
+               .table_size = ARRAY_SIZE(stingray_emc_tables_elpida)
+       }
+};
 
 void stingray_init_emc(void)
 {
-       if (stingray_mem_vid == 0x101 && stingray_mem_pid == 0x5454) {
-               pr_info("%s: Samsung memory found\n", __func__);
-               tegra_init_emc(stingray_emc_tables_samsung,
-                       ARRAY_SIZE(stingray_emc_tables_samsung));
-       } else if (stingray_mem_vid == 0x303 && stingray_mem_pid == 0x5454) {
-               pr_info("%s: Elpida memory found\n", __func__);
-               tegra_init_emc(stingray_emc_tables_elpida,
-                       ARRAY_SIZE(stingray_emc_tables_elpida));
-       } else {
-               pr_info("%s: Memory not recognized, memory scaling disabled\n",
-                       __func__);
-       }
+       tegra_init_emc(stingray_emc_chips, ARRAY_SIZE(stingray_emc_chips));
 }