]> git.proxmox.com Git - qemu.git/blobdiff - hw/omap_dma.c
usb-bus: fix no params
[qemu.git] / hw / omap_dma.c
index 99e4306f37706bea303f0a37cb3416b57ed43009..3e718ba7f1ff88c8f66bd61c9d7458683b778bbf 100644 (file)
@@ -31,8 +31,8 @@ struct omap_dma_channel_s {
     int endian_lock[2];
     int translate[2];
     enum omap_dma_port port[2];
-    a_target_phys_addr addr[2];
-    e_omap_dma_addressing mode[2];
+    target_phys_addr_t addr[2];
+    omap_dma_addressing_t mode[2];
     uint32_t elements;
     uint16_t frames;
     int32_t frame_index[2];
@@ -78,7 +78,7 @@ struct omap_dma_channel_s {
     struct omap_dma_channel_s *sibling;
 
     struct omap_dma_reg_set_s {
-        a_target_phys_addr src, dest;
+        target_phys_addr_t src, dest;
         int frame;
         int element;
         int pck_element;
@@ -588,87 +588,89 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
 #ifdef MULTI_REQ
     /* TODO: should all of this only be done if dma->update, and otherwise
      * inside omap_dma_transfer_generic below - check what's faster.  */
-    if (dma->update)
+    if (dma->update) {
 #endif
 
-    /* If the channel is element synchronized, deactivate it */
-    if (min_elems == elements[omap_dma_intr_element_sync])
-        omap_dma_deactivate_channel(s, ch);
+        /* If the channel is element synchronized, deactivate it */
+        if (min_elems == elements[omap_dma_intr_element_sync])
+            omap_dma_deactivate_channel(s, ch);
 
-    /* If it is the last frame, set the LAST_FRAME interrupt */
-    if (min_elems == elements[omap_dma_intr_last_frame])
-        ch->status |= LAST_FRAME_INTR;
+        /* If it is the last frame, set the LAST_FRAME interrupt */
+        if (min_elems == elements[omap_dma_intr_last_frame])
+            ch->status |= LAST_FRAME_INTR;
 
-    /* If exactly half of the frame was reached, set the HALF_FRAME
-       interrupt */
-    if (min_elems == elements[omap_dma_intr_half_frame])
-        ch->status |= HALF_FRAME_INTR;
+        /* If exactly half of the frame was reached, set the HALF_FRAME
+           interrupt */
+        if (min_elems == elements[omap_dma_intr_half_frame])
+            ch->status |= HALF_FRAME_INTR;
 
-    /* If a full packet has been transferred, set the END_PKT interrupt */
-    if (min_elems == elements[omap_dma_intr_packet])
-        ch->status |= END_PKT_INTR;
+        /* If a full packet has been transferred, set the END_PKT interrupt */
+        if (min_elems == elements[omap_dma_intr_packet])
+            ch->status |= END_PKT_INTR;
 
-    /* If the channel is packet-synchronized, deactivate it */
-    if (min_elems == elements[omap_dma_intr_packet_sync])
-        omap_dma_deactivate_channel(s, ch);
+        /* If the channel is packet-synchronized, deactivate it */
+        if (min_elems == elements[omap_dma_intr_packet_sync])
+            omap_dma_deactivate_channel(s, ch);
 
-    /* If the channel is frame synchronized, deactivate it */
-    if (min_elems == elements[omap_dma_intr_frame_sync])
-        omap_dma_deactivate_channel(s, ch);
+        /* If the channel is frame synchronized, deactivate it */
+        if (min_elems == elements[omap_dma_intr_frame_sync])
+            omap_dma_deactivate_channel(s, ch);
 
-    /* Set the END_FRAME interrupt */
-    if (min_elems == elements[omap_dma_intr_frame])
-        ch->status |= END_FRAME_INTR;
+        /* Set the END_FRAME interrupt */
+        if (min_elems == elements[omap_dma_intr_frame])
+            ch->status |= END_FRAME_INTR;
 
-    if (min_elems == elements[omap_dma_intr_block]) {
-        /* End of Block */
-        /* Disable the channel */
+        if (min_elems == elements[omap_dma_intr_block]) {
+            /* End of Block */
+            /* Disable the channel */
 
-        if (ch->omap_3_1_compatible_disable) {
-            omap_dma_disable_channel(s, ch);
-            if (ch->link_enabled)
-                omap_dma_enable_channel(s, &s->ch[ch->link_next_ch]);
-        } else {
-            if (!ch->auto_init)
+            if (ch->omap_3_1_compatible_disable) {
                 omap_dma_disable_channel(s, ch);
-            else if (ch->repeat || ch->end_prog)
-                omap_dma_channel_load(ch);
-            else {
-                ch->waiting_end_prog = 1;
-                omap_dma_deactivate_channel(s, ch);
+                if (ch->link_enabled)
+                    omap_dma_enable_channel(s, &s->ch[ch->link_next_ch]);
+            } else {
+                if (!ch->auto_init)
+                    omap_dma_disable_channel(s, ch);
+                else if (ch->repeat || ch->end_prog)
+                    omap_dma_channel_load(ch);
+                else {
+                    ch->waiting_end_prog = 1;
+                    omap_dma_deactivate_channel(s, ch);
+                }
             }
-        }
 
-        if (ch->interrupts & END_BLOCK_INTR)
-            ch->status |= END_BLOCK_INTR;
-    }
+            if (ch->interrupts & END_BLOCK_INTR)
+                ch->status |= END_BLOCK_INTR;
+        }
 
-    /* Update packet number */
-    if (ch->fs && ch->bs) {
-        a->pck_element += min_elems;
-        a->pck_element %= a->pck_elements;
-    }
+        /* Update packet number */
+        if (ch->fs && ch->bs) {
+            a->pck_element += min_elems;
+            a->pck_element %= a->pck_elements;
+        }
 
-    /* TODO: check if we really need to update anything here or perhaps we
-     * can skip part of this.  */
+        /* TODO: check if we really need to update anything here or perhaps we
+         * can skip part of this.  */
 #ifndef MULTI_REQ
-    if (dma->update) {
+        if (dma->update) {
 #endif
-        a->element += min_elems;
+            a->element += min_elems;
 
-        frames     = a->element / a->elements;
-        a->element = a->element % a->elements;
-        a->frame  += frames;
-        a->src    += min_elems * a->elem_delta[0] + frames * a->frame_delta[0];
-        a->dest   += min_elems * a->elem_delta[1] + frames * a->frame_delta[1];
+            frames = a->element / a->elements;
+            a->element = a->element % a->elements;
+            a->frame += frames;
+            a->src += min_elems * a->elem_delta[0] + frames * a->frame_delta[0];
+            a->dest += min_elems * a->elem_delta[1] + frames * a->frame_delta[1];
 
-        /* If the channel is async, update cpc */
-        if (!ch->sync && frames)
-            ch->cpc = a->dest & 0xffff;
+            /* If the channel is async, update cpc */
+            if (!ch->sync && frames)
+                ch->cpc = a->dest & 0xffff;
 
-        /* TODO: if the destination port is IMIF or EMIFF, set the dirty
-         * bits on it.  */
+            /* TODO: if the destination port is IMIF or EMIFF, set the dirty
+             * bits on it.  */
 #ifndef MULTI_REQ
+        }
+#else
     }
 #endif
 
@@ -885,8 +887,8 @@ static int omap_dma_ch_reg_write(struct omap_dma_s *s,
         break;
 
     case 0x02: /* SYS_DMA_CCR_CH0 */
-        ch->mode[1] = (e_omap_dma_addressing) ((value & 0xc000) >> 14);
-        ch->mode[0] = (e_omap_dma_addressing) ((value & 0x3000) >> 12);
+        ch->mode[1] = (omap_dma_addressing_t) ((value & 0xc000) >> 14);
+        ch->mode[0] = (omap_dma_addressing_t) ((value & 0x3000) >> 12);
         ch->end_prog = (value & 0x0800) >> 11;
         if (s->model >= omap_dma_3_2)
             ch->omap_3_1_compatible_disable  = (value >> 10) & 0x1;
@@ -911,7 +913,7 @@ static int omap_dma_ch_reg_write(struct omap_dma_s *s,
         break;
 
     case 0x06: /* SYS_DMA_CSR_CH0 */
-        OMAP_RO_REG((a_target_phys_addr) reg);
+        OMAP_RO_REG((target_phys_addr_t) reg);
         break;
 
     case 0x08: /* SYS_DMA_CSSA_L_CH0 */
@@ -951,7 +953,7 @@ static int omap_dma_ch_reg_write(struct omap_dma_s *s,
         break;
 
     case 0x18: /* SYS_DMA_CPC_CH0 or DMA_CSAC */
-        OMAP_RO_REG((a_target_phys_addr) reg);
+        OMAP_RO_REG((target_phys_addr_t) reg);
         break;
 
     case 0x1c: /* DMA_CDEI */
@@ -1443,7 +1445,7 @@ static int omap_dma_sys_read(struct omap_dma_s *s, int offset,
     return 0;
 }
 
-static uint32_t omap_dma_read(void *opaque, a_target_phys_addr addr)
+static uint32_t omap_dma_read(void *opaque, target_phys_addr_t addr)
 {
     struct omap_dma_s *s = (struct omap_dma_s *) opaque;
     int reg, ch;
@@ -1486,7 +1488,7 @@ static uint32_t omap_dma_read(void *opaque, a_target_phys_addr addr)
     return 0;
 }
 
-static void omap_dma_write(void *opaque, a_target_phys_addr addr,
+static void omap_dma_write(void *opaque, target_phys_addr_t addr,
                 uint32_t value)
 {
     struct omap_dma_s *s = (struct omap_dma_s *) opaque;
@@ -1612,7 +1614,7 @@ static void omap_dma_setcaps(struct omap_dma_s *s)
     }
 }
 
-struct soc_dma_s *omap_dma_init(a_target_phys_addr base, qemu_irq *irqs,
+struct soc_dma_s *omap_dma_init(target_phys_addr_t base, qemu_irq *irqs,
                 qemu_irq lcd_irq, struct omap_mpu_state_s *mpu, omap_clk clk,
                 enum omap_dma_model model)
 {
@@ -1686,7 +1688,7 @@ static void omap_dma_interrupts_4_update(struct omap_dma_s *s)
         qemu_irq_raise(s->irq[3]);
 }
 
-static uint32_t omap_dma4_read(void *opaque, a_target_phys_addr addr)
+static uint32_t omap_dma4_read(void *opaque, target_phys_addr_t addr)
 {
     struct omap_dma_s *s = (struct omap_dma_s *) opaque;
     int irqn = 0, chnum;
@@ -1831,7 +1833,7 @@ static uint32_t omap_dma4_read(void *opaque, a_target_phys_addr addr)
     }
 }
 
-static void omap_dma4_write(void *opaque, a_target_phys_addr addr,
+static void omap_dma4_write(void *opaque, target_phys_addr_t addr,
                 uint32_t value)
 {
     struct omap_dma_s *s = (struct omap_dma_s *) opaque;
@@ -1908,8 +1910,8 @@ static void omap_dma4_write(void *opaque, a_target_phys_addr addr,
         ch->bs = (value >> 18) & 1;
         ch->transparent_copy = (value >> 17) & 1;
         ch->constant_fill = (value >> 16) & 1;
-        ch->mode[1] = (e_omap_dma_addressing) ((value & 0xc000) >> 14);
-        ch->mode[0] = (e_omap_dma_addressing) ((value & 0x3000) >> 12);
+        ch->mode[1] = (omap_dma_addressing_t) ((value & 0xc000) >> 14);
+        ch->mode[0] = (omap_dma_addressing_t) ((value & 0x3000) >> 12);
         ch->suspend = (value & 0x0100) >> 8;
         ch->priority = (value & 0x0040) >> 6;
         ch->fs = (value & 0x0020) >> 5;
@@ -1973,12 +1975,12 @@ static void omap_dma4_write(void *opaque, a_target_phys_addr addr,
         break;
 
     case 0x1c: /* DMA4_CSSA */
-        ch->addr[0] = (a_target_phys_addr) (uint32_t) value;
+        ch->addr[0] = (target_phys_addr_t) (uint32_t) value;
         ch->set_update = 1;
         break;
 
     case 0x20: /* DMA4_CDSA */
-        ch->addr[1] = (a_target_phys_addr) (uint32_t) value;
+        ch->addr[1] = (target_phys_addr_t) (uint32_t) value;
         ch->set_update = 1;
         break;
 
@@ -2031,7 +2033,7 @@ static CPUWriteMemoryFunc * const omap_dma4_writefn[] = {
     omap_dma4_write,
 };
 
-struct soc_dma_s *omap_dma4_init(a_target_phys_addr base, qemu_irq *irqs,
+struct soc_dma_s *omap_dma4_init(target_phys_addr_t base, qemu_irq *irqs,
                 struct omap_mpu_state_s *mpu, int fifo,
                 int chans, omap_clk iclk, omap_clk fclk)
 {