aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-core.c
diff options
context:
space:
mode:
authorJorge Zapata <turran@openmoko.com>2009-02-19 16:42:54 +0100
committerThomas White <taw@bitwiz.org.uk>2009-03-26 21:34:10 +0000
commit22a1cc6ef8c82c485136be49eeca90777e8ac85c (patch)
tree0342597686a6bad6bf6ef9fcfa3c54fc4622abe5 /drivers/mfd/glamo/glamo-core.c
parente1179bc8e2bfa379e178e1f206b4687df71755f1 (diff)
Import part of Thomas White DRM tree:
Handle new memory layout. The "not-needed" memory should not be taken by the framebuffer driver. Use that for the DRM driver. Add the cmdq platform device Set aside 4k for hardware cursor, reject cursors that don't fit.
Diffstat (limited to 'drivers/mfd/glamo/glamo-core.c')
-rw-r--r--drivers/mfd/glamo/glamo-core.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
index 28dc1f309ac..506e7e6ab41 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -175,6 +175,25 @@ static inline void glamo_vmem_read(struct glamo_core *glamo, u_int16_t *buf,
/***********************************************************************
* resources of sibling devices
***********************************************************************/
+static struct resource glamo_cmdq_resources[] = {
+ {
+ .start = GLAMO_REGOFS_CMDQUEUE,
+ .end = GLAMO_REGOFS_RISC - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .name = "glamo-work-mem",
+ .start = GLAMO_MEM_BASE + GLAMO_OFFSET_WORK,
+ .end = GLAMO_MEM_BASE + GLAMO_OFFSET_WORK +
+ GLAMO_WORK_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device glamo_cmdq_dev = {
+ .name = "glamo-cmdq",
+ .resource = glamo_cmdq_resources,
+ .num_resources = ARRAY_SIZE(glamo_cmdq_resources),
+};
#if 0
static struct resource glamo_core_resources[] = {
@@ -277,8 +296,9 @@ static struct resource glamo_fb_resources[] = {
.flags = IORESOURCE_MEM,
}, {
.name = "glamo-fb-mem",
- .start = GLAMO_OFFSET_FB,
- .end = GLAMO_OFFSET_FB + GLAMO_FB_SIZE - 1,
+ .start = GLAMO_MEM_BASE + GLAMO_OFFSET_FB,
+ .end = GLAMO_MEM_BASE + GLAMO_OFFSET_FB +
+ GLAMO_FB_SIZE - 1,
.flags = IORESOURCE_MEM,
},
};
@@ -300,9 +320,9 @@ static struct resource glamo_mmc_resources[] = {
.end = IRQ_GLAMO_MMC,
.flags = IORESOURCE_IRQ,
}, { /* our data buffer for MMC transfers */
- .start = GLAMO_OFFSET_FB + GLAMO_FB_SIZE,
- .end = GLAMO_OFFSET_FB + GLAMO_FB_SIZE +
- GLAMO_MMC_BUFFER_SIZE - 1,
+ .start = GLAMO_MEM_BASE + GLAMO_OFFSET_MMC,
+ .end = GLAMO_MEM_BASE + GLAMO_OFFSET_MMC +
+ GLAMO_MMC_BUFFER_SIZE - 1,
.flags = IORESOURCE_MEM
},
};
@@ -1308,6 +1328,10 @@ static int __init glamo_probe(struct platform_device *pdev)
glamo->pdata->glamo_irq_is_wired;
/* start creating the siblings */
+ glamo_cmdq_dev.dev.parent = &pdev->dev;
+ mangle_mem_resources(glamo_cmdq_dev.resource,
+ glamo_cmdq_dev.num_resources, glamo->mem);
+ platform_device_register(&glamo_cmdq_dev);
glamo_2d_dev.dev.parent = &pdev->dev;
mangle_mem_resources(glamo_2d_dev.resource,