From ae2833c5e5ce0e62a20aa5dea7e189f9aa7219c5 Mon Sep 17 00:00:00 2001 From: James Wylder Date: Wed, 2 Mar 2011 12:39:50 -0600 Subject: [PATCH] ARM: tegra: stingray: use generic memory vendor matching 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 --- arch/arm/mach-tegra/board-stingray-memory.c | 47 +++++++++------------ 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-tegra/board-stingray-memory.c b/arch/arm/mach-tegra/board-stingray-memory.c index 2f6aea1fccfe..139a02f775ae 100644 --- a/arch/arm/mach-tegra/board-stingray-memory.c +++ b/arch/arm/mach-tegra/board-stingray-memory.c @@ -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)); } -- 2.34.1