[PATCH v3 09/10] tegra: add generic meminit

Lucas Stach dev at lynxeye.de
Tue Apr 2 02:19:11 EDT 2013


ODMdata tells us how much RAM is installed, so no need to define this at
the board level.

Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 arch/arm/boards/toshiba-ac100/board.c | 8 --------
 arch/arm/mach-tegra/tegra20.c         | 9 +++++++++
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boards/toshiba-ac100/board.c b/arch/arm/boards/toshiba-ac100/board.c
index 0eb85c5..51232ef 100644
--- a/arch/arm/boards/toshiba-ac100/board.c
+++ b/arch/arm/boards/toshiba-ac100/board.c
@@ -23,14 +23,6 @@
 #include <usb/ehci.h>
 #include <mach/iomap.h>
 
-static int ac100_mem_init(void)
-{
-	arm_add_mem_device("ram0", 0x0, SZ_512M);
-
-	return 0;
-}
-mem_initcall(ac100_mem_init);
-
 static struct ehci_platform_data ehci_pdata = {
 	.flags = EHCI_HAS_TT,
 };
diff --git a/arch/arm/mach-tegra/tegra20.c b/arch/arm/mach-tegra/tegra20.c
index 9104c3b..2b95994 100644
--- a/arch/arm/mach-tegra/tegra20.c
+++ b/arch/arm/mach-tegra/tegra20.c
@@ -17,6 +17,7 @@
 #include <common.h>
 #include <init.h>
 #include <ns16550.h>
+#include <asm/memory.h>
 #include <mach/iomap.h>
 #include <mach/lowlevel.h>
 
@@ -39,3 +40,11 @@ static int tegra20_add_debug_console(void)
 	return 0;
 }
 console_initcall(tegra20_add_debug_console);
+
+static int tegra20_mem_init(void)
+{
+	arm_add_mem_device("ram0", 0x0, tegra20_get_ramsize());
+
+	return 0;
+}
+mem_initcall(tegra20_mem_init);
-- 
1.8.1.4




More information about the barebox mailing list