aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorjoakim <joakim.landberg@stericsson.com>2010-08-27 10:04:23 +0200
committerJohn Rigby <john.rigby@linaro.org>2010-09-02 22:45:53 -0600
commitd6af4c608223547b5e0ecfcacfbc4c2fa7b3a5ae (patch)
tree78afaa7c8a09d8c9852530bf4c4ab8ad88548d53 /arch/arm
parent9276a2f05cd460d05c25729021ec71b9ad6eeee9 (diff)
Add hardware memory driver to kernel
This driver provides a way to allocate contiguous system memory which can be used by hardware. Mcde has been modified in order to take advantage of hwmem. ST-Ericsson ID: WP270489 Signed-off-by: Joakim Landberg <joakim.landberg@stericsson.com> Change-Id: I5bf22754a343f8ba3dceb6305ce780f6e1a8b379 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/4205 Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Diffstat (limited to 'arch/arm')
-rwxr-xr-xarch/arm/mach-ux500/board-mop500.c1
-rwxr-xr-xarch/arm/mach-ux500/devices.c31
-rw-r--r--arch/arm/mach-ux500/include/mach/devices.h1
3 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index ce173ed335e..fe33cf5d5ba 100755
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -1316,6 +1316,7 @@ static struct platform_device *platform_board_devs[] __initdata = {
&ab8500_bm_device,
&ste_ff_vibra_device,
&ux500_musb_device,
+ &ux500_hwmem_device,
&ux500_mcde_device,
&ux500_b2r2_device,
#ifdef CONFIG_ANDROID_PMEM
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c
index e962102e51d..6b9cc39ebc6 100755
--- a/arch/arm/mach-ux500/devices.c
+++ b/arch/arm/mach-ux500/devices.c
@@ -45,6 +45,7 @@
#include <mach/uart.h>
#include <mach/setup.h>
#include <mach/kpd.h>
+#include <linux/hwmem.h>
void __init u8500_register_device(struct platform_device *dev, void *data)
{
@@ -327,6 +328,36 @@ struct platform_device ux500_b2r2_device = {
.resource = b2r2_resources,
};
+static struct hwmem_platform_data hwmem_pdata = {
+ .start = 0,
+ .size = 0,
+};
+
+static int __init early_hwmem(char *p)
+{
+ hwmem_pdata.size = memparse(p, &p);
+
+ if (*p != '@')
+ goto no_at;
+
+ hwmem_pdata.start = memparse(p + 1, &p);
+
+ return 0;
+
+no_at:
+ hwmem_pdata.size = 0;
+
+ return -EINVAL;
+}
+early_param("hwmem", early_hwmem);
+
+struct platform_device ux500_hwmem_device = {
+ .name = "hwmem",
+ .dev = {
+ .platform_data = &hwmem_pdata,
+ },
+};
+
#ifdef CONFIG_ANDROID_PMEM
static int __init early_pmem_generic_parse(char *p, struct android_pmem_platform_data * data)
{
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h
index d334ef897c4..0d16c7f1a29 100644
--- a/arch/arm/mach-ux500/include/mach/devices.h
+++ b/arch/arm/mach-ux500/include/mach/devices.h
@@ -32,6 +32,7 @@ extern struct platform_device u8500_hsit_device;
extern struct platform_device u8500_hsir_device;
extern struct platform_device u8500_shrm_device;
extern struct platform_device ux500_b2r2_device;
+extern struct platform_device ux500_hwmem_device;
extern struct platform_device u8500_pmem_device;
extern struct platform_device u8500_pmem_mio_device;
extern struct platform_device u8500_pmem_hwb_device;