hw/dma/omap_dma: Remove unused ifdeffed out code
The OMAP DMA device includes a lot of code which has been disabled via ifdefs for over a decade. Whatever this unfinished development work was, all knowledge of it is long gone, and we're unlikely to be doing any serious work on this device model in future. If we did, we'd likely have to start from scratch. Remove all the ifdeffed out code. We will fix up the indentation in a followup commit that has only whitespace changes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20260528152852.3349928-2-peter.maydell@linaro.org
Peter Maydell committed
May 28, 2026 at 16:28 UTC
c215921e8177c25e958aacfb24c6f276cbce1701
1 file changed
-94
hw/dma/omap_dma.c
-94
@@ -343,9 +343,6 @@ static void omap_dma_transfer_generic(struct soc_dma_ch_s *dma)
343
struct omap_dma_channel_s *ch = dma->opaque;
344
struct omap_dma_reg_set_s *a = &ch->active_set;
345
int bytes = dma->bytes;
346
-#ifdef MULTI_REQ
347
- uint16_t status = ch->status;
348
-#endif
346
347
do {
348
/* Transfer a single element */
@@ -362,7 +359,6 @@ static void omap_dma_transfer_generic(struct soc_dma_ch_s *dma)
359
a->dest += a->elem_delta[1];
360
a->element ++;
361
365
-#ifndef MULTI_REQ
362
if (a->element == a->elements) {
363
/* End of Frame */
364
a->element = 0;
@@ -375,78 +371,6 @@ static void omap_dma_transfer_generic(struct soc_dma_ch_s *dma)
371
ch->cpc = a->dest & 0xffff;
372
}
373
} while ((bytes -= ch->data_type));
378
-#else
379
- /* If the channel is element synchronized, deactivate it */
380
- if (ch->sync && !ch->fs && !ch->bs)
381
- omap_dma_deactivate_channel(s, ch);
382
-
383
- /* If it is the last frame, set the LAST_FRAME interrupt */
384
- if (a->element == 1 && a->frame == a->frames - 1)
385
- if (ch->interrupts & LAST_FRAME_INTR)
386
- ch->status |= LAST_FRAME_INTR;
387
-
388
- /* If the half of the frame was reached, set the HALF_FRAME
389
- interrupt */
390
- if (a->element == (a->elements >> 1))
391
- if (ch->interrupts & HALF_FRAME_INTR)
392
- ch->status |= HALF_FRAME_INTR;
393
-
394
- if (ch->fs && ch->bs) {
395
- a->pck_element ++;
396
- /* Check if a full packet has been transferred. */
397
- if (a->pck_element == a->pck_elements) {
398
- a->pck_element = 0;
399
-
400
- /* Set the END_PKT interrupt */
401
- if ((ch->interrupts & END_PKT_INTR) && !ch->src_sync)
402
- ch->status |= END_PKT_INTR;
403
-
404
- /* If the channel is packet-synchronized, deactivate it */
405
- if (ch->sync)
406
- omap_dma_deactivate_channel(s, ch);
407
- }
408
- }
409
-
410
- if (a->element == a->elements) {
411
- /* End of Frame */
412
- a->element = 0;
413
- a->src += a->frame_delta[0];
414
- a->dest += a->frame_delta[1];
415
- a->frame ++;
416
-
417
- /* If the channel is frame synchronized, deactivate it */
418
- if (ch->sync && ch->fs && !ch->bs)
419
- omap_dma_deactivate_channel(s, ch);
420
-
421
- /* If the channel is async, update cpc */
422
- if (!ch->sync)
423
- ch->cpc = a->dest & 0xffff;
424
-
425
- /* Set the END_FRAME interrupt */
426
- if (ch->interrupts & END_FRAME_INTR)
427
- ch->status |= END_FRAME_INTR;
428
-
429
- if (a->frame == a->frames) {
430
- /* End of Block */
431
- /* Disable the channel */
432
-
433
- if (!ch->auto_init)
434
- omap_dma_disable_channel(s, ch);
435
- else if (ch->repeat || ch->end_prog)
436
- omap_dma_channel_load(ch);
437
- else {
438
- ch->waiting_end_prog = 1;
439
- omap_dma_deactivate_channel(s, ch);
440
- }
441
-
442
- if (ch->interrupts & END_BLOCK_INTR)
443
- ch->status |= END_BLOCK_INTR;
444
- }
445
- }
446
- } while (status == ch->status && ch->active);
447
-
448
- omap_dma_interrupts_update(s);
449
-#endif
374
}
375
376
enum {
@@ -475,13 +399,6 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
399
dest_p = &s->mpu->port[ch->port[1]];
400
if ((!ch->constant_fill && !src_p->addr_valid(s->mpu, a->src)) ||
401
(!dest_p->addr_valid(s->mpu, a->dest))) {
478
-#if 0
479
- /* Bus time-out */
480
- if (ch->interrupts & TIMEOUT_INTR)
481
- ch->status |= TIMEOUT_INTR;
482
- omap_dma_deactivate_channel(s, ch);
483
- continue;
484
-#endif
402
printf("%s: Bus time-out in DMA%i operation\n",
403
__func__, dma->num);
404
}
@@ -552,11 +469,6 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
469
470
/* Set appropriate interrupts and/or deactivate channels */
471
555
-#ifdef MULTI_REQ
556
- /* TODO: should all of this only be done if dma->update, and otherwise
557
- * inside omap_dma_transfer_generic below - check what's faster. */
558
- if (dma->update) {
559
-#endif
472
473
/* If the channel is element synchronized, deactivate it */
474
if (min_elems == elements[omap_dma_intr_element_sync])
@@ -612,9 +524,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
524
525
/* TODO: check if we really need to update anything here or perhaps we
526
* can skip part of this. */
615
-#ifndef MULTI_REQ
527
if (dma->update) {
617
-#endif
528
a->element += min_elems;
529
530
frames = a->element / a->elements;
@@ -629,11 +539,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
539
540
/* TODO: if the destination port is IMIF or EMIFF, set the dirty
541
* bits on it. */
632
-#ifndef MULTI_REQ
542
}
634
-#else
635
- }
636
-#endif
543
544
omap_dma_interrupts_update(s);
545
}