summaryrefslogtreecommitdiffstats
path: root/arch/nios2
diff options
context:
space:
mode:
authorFranck Jullien <franck.jullien@gmail.com>2012-11-14 23:23:32 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-11-15 08:47:27 +0100
commit5cd86790e74080771d719e4b365f9c704b4e2923 (patch)
tree329f86f1d54d5fb4038cc162c86c43883e96a97b /arch/nios2
parent9b8fa53626b66eb4c3c3a74122de33c2728d8b00 (diff)
downloadbarebox-5cd86790e74080771d719e4b365f9c704b4e2923.tar.gz
nios2: use barebox_add_memory_bank in generic.c
In the nios2 generic board generic.c file, use the new barebox_add_memory_bank to init ram memory. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/nios2')
-rw-r--r--arch/nios2/boards/generic/generic.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c
index 66eb856..499d93b 100644
--- a/arch/nios2/boards/generic/generic.c
+++ b/arch/nios2/boards/generic/generic.c
@@ -3,6 +3,7 @@
#include <driver.h>
#include <partition.h>
#include <fs.h>
+#include <memory.h>
static int phy_address = 1;
@@ -32,11 +33,17 @@ static struct device_d mac_dev = {
.platform_data = &phy_address,
};
+static int mem_init(void)
+{
+ barebox_add_memory_bank("ram0", NIOS_SOPC_MEMORY_BASE, NIOS_SOPC_MEMORY_SIZE);
+
+ return 0;
+}
+mem_initcall(mem_init);
+
static int generic_devices_init(void)
{
add_cfi_flash_device(DEVICE_ID_DYNAMIC, NIOS_SOPC_FLASH_BASE, NIOS_SOPC_FLASH_SIZE, 0);
- add_mem_device("ram0", NIOS_SOPC_MEMORY_BASE, NIOS_SOPC_MEMORY_SIZE,
- IORESOURCE_MEM_WRITEABLE);
platform_device_register(&mac_dev);
/*register_device(&epcs_flash_device);*/