summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Wu <pengw@nvidia.com>2014-04-22 17:39:20 -0700
committerBryan Wu <pengw@nvidia.com>2014-04-22 17:41:44 -0700
commit9e7653f710853a7dcb54de66544f0a1384b3c9a2 (patch)
tree6297fcc4db9f57e9bb995e84e80e6c441ff9e2b0
parentd03e1b861b9eaaf13fa37a8d4251d78b3814eaaf (diff)
downloadu-boot-9e7653f710853a7dcb54de66544f0a1384b3c9a2.tar.gz
Tegra: Use mem size in memory controller instead of ODMData
Read MC_EMEM_CFG (offset 50h) to get EMEM_SIZE_MB, shift it left to be ODMDATA compatible (bits 31:28), and use it instead of ODMDATA on Venice. ODMDATA isn't available currently because NVFlash/bootloader.bin don't work on Venice (yet). Another option would be to modify the CrOS script that creates the BCT and embed an ODMDATA at that time, but this change is more forward-looking, since we don't really use ODMDATA for anything but the RAM size bits. Change-Id: I105f7a7d476f343b6e0a93246fb97699106a8d53 Signed-off-by: Tom Warren <twarren@nvidia.com> Reviewed-on: https://gerrit.chromium.org/gerrit/61511 Signed-off-by: Bryan Wu <pengw@nvidia.com>
-rw-r--r--arch/arm/cpu/tegra-common/board.c12
-rw-r--r--include/configs/jetson-tk1.h3
2 files changed, 14 insertions, 1 deletions
diff --git a/arch/arm/cpu/tegra-common/board.c b/arch/arm/cpu/tegra-common/board.c
index 6a6faf4b27..20ecf65754 100644
--- a/arch/arm/cpu/tegra-common/board.c
+++ b/arch/arm/cpu/tegra-common/board.c
@@ -14,6 +14,7 @@
#include <asm/arch-tegra/pmc.h>
#include <asm/arch-tegra/sys_proto.h>
#include <asm/arch-tegra/warmboot.h>
+#include <asm/arch-tegra/mc.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -34,11 +35,20 @@ enum {
unsigned int query_sdram_size(void)
{
- struct pmc_ctlr *const pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
u32 reg;
+#if defined(CONFIG_TEGRA_USE_EMC_DRAM_SIZE)
+ struct mc_ctlr *const mc = (struct mc_ctlr *)NV_PA_MC_BASE;
+
+ reg = readl(&mc->mc_emem_cfg); /* EMEM_SIZE_MB */
+ debug("mc->mc_emem_cfg (MEM_SIZE_MB) = 0x%08x\n", reg);
+ reg <<= 20; /* get into ODMDATA position */
+#else
+ struct pmc_ctlr *const pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
reg = readl(&pmc->pmc_scratch20);
debug("pmc->pmc_scratch20 (ODMData) = 0x%08x\n", reg);
+#endif
#if defined(CONFIG_TEGRA20)
/* bits 30:28 in OdmData are used for RAM size on T20 */
diff --git a/include/configs/jetson-tk1.h b/include/configs/jetson-tk1.h
index 6255750c3b..8e4807c573 100644
--- a/include/configs/jetson-tk1.h
+++ b/include/configs/jetson-tk1.h
@@ -12,6 +12,9 @@
#include "tegra124-common.h"
+/* Use memory controller SDRAM size instead of ODMDATA */
+#define CONFIG_TEGRA_USE_EMC_DRAM_SIZE
+
/* Enable fdt support for Jetson TK1. Flash the image in u-boot-dtb.bin */
#define CONFIG_DEFAULT_DEVICE_TREE tegra124-jetson-tk1
#define CONFIG_OF_CONTROL