diff options
author | Jay Bhukhanwala <jbhukhanwala@nvidia.com> | 2014-04-01 17:49:04 -0700 |
---|---|---|
committer | Seema Khowala <seemaj@nvidia.com> | 2014-04-23 14:07:21 -0700 |
commit | dec61d97c72e0f8be8336eb2055010c77bd66ed3 (patch) | |
tree | 60dbdb2c06415753329d4fec0b6c3dbc075348b8 /arch | |
parent | d570a7f70c526e1bf6cd753750d49f8575e1c4a9 (diff) |
ARM: Tegra: T124: Load EMC tables from DeviceTree
- Load the emc tables from Device Tree by default.
- This is only if memory-controller node representing the
emc-table is available in the Device Tree.
Change-Id: I49d414bddd7b9af1bc45f671bb6d29f46c103783
Signed-off-by: Jay Bhukhanwala <jbhukhanwala@nvidia.com>
Reviewed-on: http://git-master/r/391035
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
Tested-by: Thomas Cherry <tcherry@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-ardbeg-memory.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-norrin-memory.c | 10 |
2 files changed, 22 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-ardbeg-memory.c b/arch/arm/mach-tegra/board-ardbeg-memory.c index 598ada3179ca..c6897e6f6425 100644 --- a/arch/arm/mach-tegra/board-ardbeg-memory.c +++ b/arch/arm/mach-tegra/board-ardbeg-memory.c @@ -20088,37 +20088,34 @@ int __init ardbeg_emc_init(void) * we do not need to check for board ids and blindly load the one * flashed on the NCT partition. */ + #ifdef CONFIG_TEGRA_USE_NCT if (!tegra12_nct_emc_table_init(&board_emc_pdata)) { tegra_emc_device.dev.platform_data = &board_emc_pdata; pr_info("Loading EMC table read from NCT partition.\n"); - } else { + } else #endif + if (of_find_compatible_node(NULL, NULL, "nvidia,tegra12-emc")) { + /* If Device Tree Partition contains emc-tables, load them */ + pr_info("Loading EMC tables from DeviceTree.\n"); + use_dt_emc_table = true; + } else { tegra_get_board_info(&bi); switch (bi.board_id) { case BOARD_PM358: pr_info("Loading PM358 EMC tables.\n"); - tegra_emc_device.dev.platform_data = &ardbeg_ddr3_emc_pdata_pm358; + tegra_emc_device.dev.platform_data = + &ardbeg_ddr3_emc_pdata_pm358; break; case BOARD_PM359: pr_info("Loading PM359 EMC tables.\n"); tegra_emc_device.dev.platform_data = - &ardbeg_ddr3_emc_pdata_pm359; - break; - case BOARD_P1761: - case BOARD_E1784: - case BOARD_E1922: - pr_info("Loading TN8 (%d) EMC tables from DeviceTree.\n", - bi.board_id); - use_dt_emc_table = true; + &ardbeg_ddr3_emc_pdata_pm359; break; case BOARD_E1780: case BOARD_E1782: - if (of_machine_is_compatible("nvidia,tn8")) { - pr_info("Loading TN8 EMC tables from DeviceTree.\n"); - use_dt_emc_table = true; - } else if (tegra_get_memory_type()) { + if (tegra_get_memory_type()) { pr_info("Loading Ardbeg 4GB EMC tables.\n"); tegra_emc_device.dev.platform_data = &ardbeg_4GB_emc_pdata; @@ -20134,11 +20131,13 @@ int __init ardbeg_emc_init(void) break; case BOARD_E1792: pr_info("Loading Ardbeg EMC tables.\n"); - tegra_emc_device.dev.platform_data = &ardbeg_lpddr3_emc_pdata; + tegra_emc_device.dev.platform_data = + &ardbeg_lpddr3_emc_pdata; break; case BOARD_E1781: pr_info("Loading Ardbeg (1781) EMC tables\n"); - tegra_emc_device.dev.platform_data = &ardbeg_lpddr3_emc_pdata_E1781; + tegra_emc_device.dev.platform_data = + &ardbeg_lpddr3_emc_pdata_E1781; break; case BOARD_PM375: if (of_machine_is_compatible("nvidia,jetson-tk1")) { @@ -20155,9 +20154,7 @@ int __init ardbeg_emc_init(void) pr_info("emc dvfs table not present\n"); return -EINVAL; } - #ifdef CONFIG_TEGRA_USE_NCT } - #endif if (!use_dt_emc_table) platform_device_register(&tegra_emc_device); diff --git a/arch/arm/mach-tegra/board-norrin-memory.c b/arch/arm/mach-tegra/board-norrin-memory.c index 3b2025dc3a6f..86396ab86115 100644 --- a/arch/arm/mach-tegra/board-norrin-memory.c +++ b/arch/arm/mach-tegra/board-norrin-memory.c @@ -6895,12 +6895,18 @@ int __init norrin_emc_init(void) * we do not need to check for board ids and blindly load the one * flashed on the NCT partition. */ + #ifdef CONFIG_TEGRA_USE_NCT if (!tegra12_nct_emc_table_init(&board_emc_pdata)) { tegra_emc_device.dev.platform_data = &board_emc_pdata; pr_info("Loading EMC table read from NCT partition.\n"); - } else { + } else #endif + if (of_find_compatible_node(NULL, NULL, "nvidia,tegra12_emc")) { + /* If Device Tree Partition contains emc-tables, load them */ + pr_info("Loading EMC tables from DeviceTree.\n"); + use_dt_emc_table = true; + } else { tegra_get_board_info(&bi); switch (bi.board_id) { @@ -6931,9 +6937,7 @@ int __init norrin_emc_init(void) WARN(1, "Invalid board ID: %u\n", bi.board_id); return -EINVAL; } - #ifdef CONFIG_TEGRA_USE_NCT } - #endif if (!use_dt_emc_table) platform_device_register(&tegra_emc_device); |