summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-30 13:57:22 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-08-01 21:49:33 +0800
commit95067e23ac78db76db3afddc92e17b6789012d38 (patch)
tree4c3d417d7ae43ec834c1ebe5950652da5072b5d7 /drivers
parentb821d73607cc6387b1ee588af97a44e8eb2b4fe2 (diff)
downloadbarebox-95067e23ac78db76db3afddc92e17b6789012d38.tar.gz
barebox-95067e23ac78db76db3afddc92e17b6789012d38.tar.xz
arm: introduce arm_add_mem_device to register dram device
this will automaticaly register the device to armlinux_add_dram Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/resource.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/base/resource.c b/drivers/base/resource.c
index 5fc705f2ab..175beb9c2d 100644
--- a/drivers/base/resource.c
+++ b/drivers/base/resource.c
@@ -118,3 +118,18 @@ struct device_d *add_usb_ehci_device(int id, resource_size_t hccr,
}
EXPORT_SYMBOL(add_usb_ehci_device);
#endif
+
+#ifdef CONFIG_ARM
+#include <asm/armlinux.h>
+
+struct device_d *arm_add_mem_device(const char* name, resource_size_t start,
+ resource_size_t size)
+{
+ struct device_d *dev;
+
+ dev = add_mem_device(name, start, size, IORESOURCE_MEM_WRITEABLE);
+ armlinux_add_dram(dev);
+
+ return dev;
+}
+#endif