aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-core.h
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.h
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.h')
-rw-r--r--drivers/mfd/glamo/glamo-core.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/drivers/mfd/glamo/glamo-core.h b/drivers/mfd/glamo/glamo-core.h
index 8e09564bc3f..f7062cddf70 100644
--- a/drivers/mfd/glamo/glamo-core.h
+++ b/drivers/mfd/glamo/glamo-core.h
@@ -3,18 +3,34 @@
#include <asm/system.h>
-/* for the time being, we put the on-screen framebuffer into the lowest
- * VRAM space. This should make the code easily compatible with the various
- * 2MB/4MB/8MB variants of the Smedia chips */
-#define GLAMO_OFFSET_VRAM 0x800000
-#define GLAMO_OFFSET_FB (GLAMO_OFFSET_VRAM)
-
/* we only allocate the minimum possible size for the framebuffer to make
* sure we have sufficient memory for other functions of the chip */
-//#define GLAMO_FB_SIZE (640*480*4) /* == 0x12c000 */
+/* FIXME: this should be autodetected */
#define GLAMO_INTERNAL_RAM_SIZE 0x800000
-#define GLAMO_MMC_BUFFER_SIZE (64 * 1024)
-#define GLAMO_FB_SIZE (GLAMO_INTERNAL_RAM_SIZE - GLAMO_MMC_BUFFER_SIZE)
+#define GLAMO_MMC_BUFFER_SIZE (64 * 1024) /* 64k MMC buffer */
+/* A 640x480, 16bpp, double-buffered framebuffer */
+#define GLAMO_FB_SIZE (640 * 480 * 4) /* == 0x12c000 */
+#define GLAMO_CMDQ_SIZE (128 * 1024) /* 128k ring buffer */
+/* Arbitrarily determined amount for the hardware cursor */
+#define GLAMO_CURSOR_SIZE (4096)
+/* Remaining memory will be used for 2D and 3D graphics */
+#define GLAMO_WORK_SIZE (GLAMO_INTERNAL_RAM_SIZE - GLAMO_FB_SIZE \
+ - GLAMO_CURSOR_SIZE \
+ - GLAMO_MMC_BUFFER_SIZE \
+ - GLAMO_CMDQ_SIZE)
+
+/* for the time being, we put the on-screen framebuffer into the lowest
+ * VRAM space. This should make the code easily compatible with the various
+ * 2MB/4MB/8MB variants of the Smedia chips
+ * glamo-fb.c assumes FB comes first, followed by cursor, so DON'T MOVE THEM
+ * (see glamo_regs[] in glamo-fb.c for more information) */
+#define GLAMO_MEM_BASE (0x800000)
+#define GLAMO_OFFSET_VRAM (0x000000)
+#define GLAMO_OFFSET_FB (GLAMO_OFFSET_VRAM)
+#define GLAMO_OFFSET_CURSOR (GLAMO_OFFSET_FB + GLAMO_FB_SIZE)
+#define GLAMO_OFFSET_MMC (GLAMO_OFFSET_CURSOR + GLAMO_CURSOR_SIZE)
+#define GLAMO_OFFSET_CMDQ (GLAMO_OFFSET_MMC + GLAMO_MMC_BUFFER_SIZE)
+#define GLAMO_OFFSET_WORK (GLAMO_OFFSET_CMDQ + GLAMO_CMDQ_SIZE)
struct glamo_core {
int irq;