Implement enable/reset of 3D engine drm-tracking
authorThomas White <taw@bitwiz.org.uk>
Sat, 16 Jan 2010 20:30:22 +0000 (21:30 +0100)
committerThomas White <taw@bitwiz.org.uk>
Sat, 16 Jan 2010 20:30:22 +0000 (21:30 +0100)
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
drivers/mfd/glamo/glamo-cmdq.c
drivers/mfd/glamo/glamo-core.c

index f3dcc83..3dd9362 100644 (file)
@@ -460,6 +460,8 @@ int glamo_cmdq_init(struct glamodrm_handle *gdrm)
        /* Enable 2D and 3D */
        glamo_engine_enable(gdrm->glamo_core, GLAMO_ENGINE_2D);
        glamo_engine_reset(gdrm->glamo_core, GLAMO_ENGINE_2D);
+       glamo_engine_enable(gdrm->glamo_core, GLAMO_ENGINE_3D);
+       glamo_engine_reset(gdrm->glamo_core, GLAMO_ENGINE_3D);
 
        /* Start by zeroing the command queue memory */
        for ( i=0; i<GLAMO_CMDQ_SIZE; i+=2 ) {
index 3dcb358..556ae3c 100644 (file)
@@ -487,6 +487,19 @@ int __glamo_engine_enable(struct glamo_core *glamo, enum glamo_engine engine)
                __reg_set_bit_mask(glamo, GLAMO_REG_CLOCK_GEN5_1,
                                   GLAMO_CLOCK_GEN51_EN_DIV_GCLK, 0xffff);
                break;
+       case GLAMO_ENGINE_3D:
+               __reg_set_bit_mask(glamo, GLAMO_REG_CLOCK_3D,
+                                         GLAMO_CLOCK_3D_EN_M8CLK |
+                                         GLAMO_CLOCK_3D_EN_ECLK |
+                                         GLAMO_CLOCK_3D_EN_RCLK |
+                                         GLAMO_CLOCK_3D_DG_M8CLK |
+                                         GLAMO_CLOCK_3D_DG_RCLK |
+                                         GLAMO_CLOCK_3D_DG_ECLK, 0xffff);
+               /* Enable 3D MMIO */
+               __reg_set_bit_mask(glamo, GLAMO_REG_HOSTBUS(2),
+                                         GLAMO_HOSTBUS2_MMIO_EN_3D,
+                                         GLAMO_HOSTBUS2_MMIO_EN_3D);
+               break;
        case GLAMO_ENGINE_CMDQ:
                __reg_set_bit_mask(glamo, GLAMO_REG_CLOCK_2D,
                                   GLAMO_CLOCK_2D_EN_M6CLK, 0xffff);
@@ -622,6 +635,10 @@ struct glamo_script reset_regs[] = {
        [GLAMO_ENGINE_2D] = {
                GLAMO_REG_CLOCK_2D, GLAMO_CLOCK_2D_RESET
        },
+       [GLAMO_ENGINE_3D] = {
+               GLAMO_REG_CLOCK_3D, GLAMO_CLOCK_3D_BACK_RESET |
+                                   GLAMO_CLOCK_3D_FRONT_RESET
+       },
        [GLAMO_ENGINE_JPEG] = {
                GLAMO_REG_CLOCK_JPEG, GLAMO_CLOCK_JPEG_RESET
        },