Lines Matching +full:8 +full:- +full:ch
5 * See the COPYING file in the top-level directory.
22 #define BCM2708_DMA_ERR (1 << 8)
34 #define BCM2708_DMA_S_INC (1 << 8)
42 /* the current control block appears in the following registers - read only */
58 BCM2835DMAChan *ch = &s->chan[c]; in bcm2835_dma_update() local
62 if (!(s->enable & (1 << c))) { in bcm2835_dma_update()
66 while ((s->enable & (1 << c)) && (ch->conblk_ad != 0)) { in bcm2835_dma_update()
68 ch->ti = ldl_le_phys(&s->dma_as, ch->conblk_ad); in bcm2835_dma_update()
69 ch->source_ad = ldl_le_phys(&s->dma_as, ch->conblk_ad + 4); in bcm2835_dma_update()
70 ch->dest_ad = ldl_le_phys(&s->dma_as, ch->conblk_ad + 8); in bcm2835_dma_update()
71 ch->txfr_len = ldl_le_phys(&s->dma_as, ch->conblk_ad + 12); in bcm2835_dma_update()
72 ch->stride = ldl_le_phys(&s->dma_as, ch->conblk_ad + 16); in bcm2835_dma_update()
73 ch->nextconbk = ldl_le_phys(&s->dma_as, ch->conblk_ad + 20); in bcm2835_dma_update()
76 if (ch->ti & BCM2708_DMA_TDMODE) { in bcm2835_dma_update()
78 ylen += (ch->txfr_len >> 16) & 0x3fff; in bcm2835_dma_update()
79 xlen = ch->txfr_len & 0xffff; in bcm2835_dma_update()
80 dst_stride = ch->stride >> 16; in bcm2835_dma_update()
81 src_stride = ch->stride & 0xffff; in bcm2835_dma_update()
83 xlen = ch->txfr_len; in bcm2835_dma_update()
92 if (ch->ti & BCM2708_DMA_S_IGNORE) { in bcm2835_dma_update()
96 data = ldl_le_phys(&s->dma_as, ch->source_ad); in bcm2835_dma_update()
98 if (ch->ti & BCM2708_DMA_S_INC) { in bcm2835_dma_update()
99 ch->source_ad += 4; in bcm2835_dma_update()
102 if (ch->ti & BCM2708_DMA_D_IGNORE) { in bcm2835_dma_update()
105 stl_le_phys(&s->dma_as, ch->dest_ad, data); in bcm2835_dma_update()
107 if (ch->ti & BCM2708_DMA_D_INC) { in bcm2835_dma_update()
108 ch->dest_ad += 4; in bcm2835_dma_update()
112 xlen -= 4; in bcm2835_dma_update()
113 if (ch->ti & BCM2708_DMA_TDMODE) { in bcm2835_dma_update()
114 ch->txfr_len = (ylen << 16) | xlen; in bcm2835_dma_update()
116 ch->txfr_len = xlen; in bcm2835_dma_update()
120 if (--ylen != 0) { in bcm2835_dma_update()
121 ch->source_ad += src_stride; in bcm2835_dma_update()
122 ch->dest_ad += dst_stride; in bcm2835_dma_update()
126 ch->cs |= BCM2708_DMA_END; in bcm2835_dma_update()
127 if (ch->ti & BCM2708_DMA_INT_EN) { in bcm2835_dma_update()
128 ch->cs |= BCM2708_DMA_INT; in bcm2835_dma_update()
129 s->int_status |= (1 << c); in bcm2835_dma_update()
130 qemu_set_irq(ch->irq, 1); in bcm2835_dma_update()
134 ch->conblk_ad = ch->nextconbk; in bcm2835_dma_update()
137 ch->cs &= ~BCM2708_DMA_ACTIVE; in bcm2835_dma_update()
138 ch->cs |= BCM2708_DMA_ISPAUSED; in bcm2835_dma_update()
141 static void bcm2835_dma_chan_reset(BCM2835DMAChan *ch) in bcm2835_dma_chan_reset() argument
143 ch->cs = 0; in bcm2835_dma_chan_reset()
144 ch->conblk_ad = 0; in bcm2835_dma_chan_reset()
150 BCM2835DMAChan *ch; in bcm2835_dma_read() local
156 ch = &s->chan[c]; in bcm2835_dma_read()
160 res = ch->cs; in bcm2835_dma_read()
163 res = ch->conblk_ad; in bcm2835_dma_read()
166 res = ch->ti; in bcm2835_dma_read()
169 res = ch->source_ad; in bcm2835_dma_read()
172 res = ch->dest_ad; in bcm2835_dma_read()
175 res = ch->txfr_len; in bcm2835_dma_read()
178 res = ch->stride; in bcm2835_dma_read()
181 res = ch->nextconbk; in bcm2835_dma_read()
184 res = ch->debug; in bcm2835_dma_read()
197 BCM2835DMAChan *ch; in bcm2835_dma_write() local
203 ch = &s->chan[c]; in bcm2835_dma_write()
207 oldcs = ch->cs; in bcm2835_dma_write()
209 bcm2835_dma_chan_reset(ch); in bcm2835_dma_write()
212 /* abort is a no-op, since we always run to completion */ in bcm2835_dma_write()
215 ch->cs &= ~BCM2708_DMA_END; in bcm2835_dma_write()
218 ch->cs &= ~BCM2708_DMA_INT; in bcm2835_dma_write()
219 s->int_status &= ~(1 << c); in bcm2835_dma_write()
220 qemu_set_irq(ch->irq, 0); in bcm2835_dma_write()
222 ch->cs &= ~BCM2708_DMA_CS_RW_MASK; in bcm2835_dma_write()
223 ch->cs |= (value & BCM2708_DMA_CS_RW_MASK); in bcm2835_dma_write()
224 if (!(oldcs & BCM2708_DMA_ACTIVE) && (ch->cs & BCM2708_DMA_ACTIVE)) { in bcm2835_dma_write()
229 ch->conblk_ad = value; in bcm2835_dma_write()
232 ch->debug = value; in bcm2835_dma_write()
246 return bcm2835_dma_read(s, (offset & 0xff), size, (offset >> 8) & 0xf); in bcm2835_dma0_read()
250 return s->int_status; in bcm2835_dma0_read()
252 return s->enable; in bcm2835_dma0_read()
272 bcm2835_dma_write(s, (offset & 0xff), value, size, (offset >> 8) & 0xf); in bcm2835_dma0_write()
278 s->enable = (value & 0xffff); in bcm2835_dma0_write()
311 .name = TYPE_BCM2835_DMA "-chan",
346 /* DMA channels 0-14 occupy a contiguous block of IO memory, along in bcm2835_dma_init()
351 memory_region_init_io(&s->iomem0, OBJECT(s), &bcm2835_dma0_ops, s, in bcm2835_dma_init()
353 sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem0); in bcm2835_dma_init()
355 memory_region_init_io(&s->iomem15, OBJECT(s), &bcm2835_dma15_ops, s, in bcm2835_dma_init()
356 TYPE_BCM2835_DMA "-chan15", 0x100); in bcm2835_dma_init()
357 sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem15); in bcm2835_dma_init()
360 sysbus_init_irq(SYS_BUS_DEVICE(s), &s->chan[n].irq); in bcm2835_dma_init()
369 s->enable = 0xffff; in bcm2835_dma_reset()
370 s->int_status = 0; in bcm2835_dma_reset()
372 bcm2835_dma_chan_reset(&s->chan[n]); in bcm2835_dma_reset()
381 obj = object_property_get_link(OBJECT(dev), "dma-mr", &error_abort); in bcm2835_dma_realize()
382 s->dma_mr = MEMORY_REGION(obj); in bcm2835_dma_realize()
383 address_space_init(&s->dma_as, s->dma_mr, TYPE_BCM2835_DMA "-memory"); in bcm2835_dma_realize()
392 dc->realize = bcm2835_dma_realize; in bcm2835_dma_class_init()
394 dc->vmsd = &vmstate_bcm2835_dma; in bcm2835_dma_class_init()